contentful-ui-extensions-sdk 4.0.0-alpha.32 → 4.0.0-alpha.36
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/CHANGELOG.md +28 -0
- package/dist/cf-extension-api.js +1 -1
- package/dist/types/api.types.d.ts +11 -2
- package/dist/types/app.types.d.ts +2 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/space.types.d.ts +210 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [4.0.0-alpha.36](https://github.com/contentful/ui-extensions-sdk/compare/v4.0.0-alpha.35...v4.0.0-alpha.36) (2021-09-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add patch in message for canary ([#999](https://github.com/contentful/ui-extensions-sdk/issues/999)) ([54b46d7](https://github.com/contentful/ui-extensions-sdk/commit/54b46d7c2d6885f4c50ea1d300c6151d2d16c808))
|
|
7
|
+
|
|
8
|
+
# [4.0.0-alpha.35](https://github.com/contentful/ui-extensions-sdk/compare/v4.0.0-alpha.34...v4.0.0-alpha.35) (2021-09-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* remove Promise<...> type from OnConfigureHandlerReturn ([#992](https://github.com/contentful/ui-extensions-sdk/issues/992)) ([19bbfbb](https://github.com/contentful/ui-extensions-sdk/commit/19bbfbb469cfb7904d05eb90df9e4f061e59f563))
|
|
14
|
+
|
|
15
|
+
# [4.0.0-alpha.34](https://github.com/contentful/ui-extensions-sdk/compare/v4.0.0-alpha.33...v4.0.0-alpha.34) (2021-09-24)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **AccessAPI:** add support for JSON patches in access sdk [EXT-3041] ([#972](https://github.com/contentful/ui-extensions-sdk/issues/972)) ([8fad304](https://github.com/contentful/ui-extensions-sdk/commit/8fad304a945393e6f32346034e9c69873eb767d1))
|
|
21
|
+
|
|
22
|
+
# [4.0.0-alpha.33](https://github.com/contentful/ui-extensions-sdk/compare/v4.0.0-alpha.32...v4.0.0-alpha.33) (2021-09-14)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* [EXT-2970] add space api deprecation warnings ([#949](https://github.com/contentful/ui-extensions-sdk/issues/949)) ([784e8bb](https://github.com/contentful/ui-extensions-sdk/commit/784e8bbf17d91721f26b35ee307409bb24717bad))
|
|
28
|
+
|
|
1
29
|
# [4.0.0-alpha.32](https://github.com/contentful/ui-extensions-sdk/compare/v4.0.0-alpha.31...v4.0.0-alpha.32) (2021-09-13)
|
|
2
30
|
|
|
3
31
|
|
package/dist/cf-extension-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).contentfulExtension={})}(this,(function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)};var n,r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var o=function(){function e(){this._id=0,this._listeners={}}return e.prototype.dispatch=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r in this._listeners)(e=this._listeners)[r].apply(e,t)},e.prototype.attach=function(e){var t=this;if("function"!=typeof e)throw new Error("listener function expected");var n=this._id++;return this._listeners[n]=e,function(){return delete t._listeners[n]}},e}(),i="__private__memoized__arguments__",a=function(e){function r(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=e.call(this)||this;if(o[n]=[],!t.length)throw new Error("Initial value to be memoized expected");return o[i]=t,o}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,e),r.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this[i]=t,e.prototype.dispatch.apply(this,t)},r.prototype.attach=function(t){var n=e.prototype.attach.call(this,t);return t.apply(void 0,this[i]),n},r}(o);n=i;var s=function(){function e(e,t){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=function(e,t){var n=0;return function(r,o){var i=n++;return t.postMessage({source:e,id:i,method:r,params:o},"*"),i}}(e,t.parent),t.addEventListener("message",(function(e){n._handleMessage(e.data)}))}return e.prototype.call=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this._send(e,n);return new Promise((function(e,n){t._responseHandlers[o]={resolve:e,reject:n}}))},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._send(e,t)},e.prototype.addHandler=function(e,t){return e in this._messageHandlers||(this._messageHandlers[e]=new o),this._messageHandlers[e].attach(t)},e.prototype._handleMessage=function(e){if(e.method){var t=e.method,n=e.params,r=this._messageHandlers[t];r&&r.dispatch.apply(r,n)}else{var o=e.id,i=this._responseHandlers[o];if(!i)return;"result"in e?i.resolve(e.result):"error"in e&&i.reject(e.error),delete this._responseHandlers[o]}},e}();var l=function(){function e(e,t){var n=this;this.id=t.id,this.locale=t.locale,this.type=t.type,this.required=t.required,this.validations=t.validations,this.items=t.items,this._value=t.value,this._valueSignal=new a(this._value),this._isDisabledSignal=new a(void 0),this._schemaErrorsChangedSignal=new a(void 0),this._channel=e,e.addHandler("valueChanged",(function(e,t,r){e!==n.id||t&&t!==n.locale||(n._value=r,n._valueSignal.dispatch(r))})),e.addHandler("isDisabledChangedForFieldLocale",(function(e,t,r){e===n.id&&t===n.locale&&n._isDisabledSignal.dispatch(r)})),e.addHandler("schemaErrorsChangedForFieldLocale",(function(e,t,r){e===n.id&&t===n.locale&&n._schemaErrorsChangedSignal.dispatch(r)}))}return e.prototype.getValue=function(){return this._value},e.prototype.setValue=function(e){return this._value=e,this._valueSignal.dispatch(e),this._channel.call("setValue",this.id,this.locale,e)},e.prototype.removeValue=function(){return this._value=void 0,this._channel.call("removeValue",this.id,this.locale)},e.prototype.setInvalid=function(e){return this._channel.call("setInvalid",e,this.locale)},e.prototype.onValueChanged=function(e){return this._valueSignal.attach(e)},e.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},e.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},e}(),u=function(){function e(e,t,n){this.id=t.id,this.locales=t.locales,this.type=t.type,this.required=t.required,this.validations=t.validations,this.items=t.items,this._defaultLocale=n,this._fieldLocales=t.locales.reduce((function(n,o){var i,a=new l(e,{id:t.id,type:t.type,required:t.required,validations:t.validations,items:t.items,locale:o,value:t.values[o]});return r(r({},n),((i={})[o]=a,i))}),{}),this.assertHasLocale(n)}return e.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},e.prototype.setValue=function(e,t){return this._getFieldLocale(t).setValue(e)},e.prototype.removeValue=function(e){return this.setValue(void 0,e)},e.prototype.onValueChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onValueChanged(n)},e.prototype.onIsDisabledChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onIsDisabledChanged(n)},e.prototype._getFieldLocale=function(e){return e=e||this._defaultLocale,this.assertHasLocale(e),this._fieldLocales[e]},e.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},e.prototype.assertHasLocale=function(e){if(!this._fieldLocales[e])throw new Error('Unknown locale "'+e+'" for field "'+this.id+'"')},e}();function c(e,t){var n,r=e,o=r.document,i=r.MutationObserver,a=function(){u.updateHeight()},s=new i(a),l=!1,u={startAutoResizer:function(){if(u.updateHeight(),l)return;l=!0,s.observe(o.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.addEventListener("resize",a)},stopAutoResizer:function(){if(!l)return;l=!1,s.disconnect(),e.removeEventListener("resize",a)},updateHeight:function(e){void 0===e&&(e=null);null===e&&(e=Math.ceil(o.documentElement.getBoundingClientRect().height));e!==n&&(t.send("setHeight",e),n=e)}};return u}var d=["getTask","getTasks","createTask","updateTask","deleteTask"];function p(e,t,n,o){var i=t.sys,s=new a(i),l=t.metadata,u=new a(l);e.addHandler("sysChanged",(function(e){i=e,s.dispatch(i)})),e.addHandler("metadataChanged",(function(e){l=e,u.dispatch(l)}));var c={};return d.forEach((function(t){c[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callEntryMethod",t,n)}})),r(r(r({getSys:function(){return i},onSysChanged:function(e){return s.attach(e)},fields:n.reduce((function(e,t){return e[t.id]=o(t),e}),{})},l?{metadata:l}:{}),{getMetadata:function(){return l},onMetadataChanged:function(e){return u.attach(e)}}),c)}var f=["getContentType","getEntry","getEntrySnapshots","getAsset","getEditorInterface","getPublishedEntries","getPublishedAssets","getContentTypes","getEntries","getEditorInterfaces","getAssets","createContentType","createEntry","createAsset","updateContentType","updateEntry","updateAsset","deleteContentType","deleteEntry","deleteAsset","publishEntry","publishAsset","unpublishEntry","unpublishAsset","archiveEntry","archiveAsset","unarchiveEntry","unarchiveAsset","createUpload","processAsset","waitUntilAssetProcessed","getUsers","getAllScheduledActions","getEntityScheduledActions","signRequest","createTag","readTags","updateTag","deleteTag","getTeams"];function h(e,t){var n={};return f.forEach((function(t){n[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callSpaceMethod",t,n)}})),n.getCachedContentTypes=function(){return function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e}([],t)},n}var g=function(e){return"object"!=typeof(t=e)||null===t||Array.isArray(t)?{}:e;var t};function v(e,t){return{openAlert:n.bind(null,"alert"),openConfirm:n.bind(null,"confirm"),openPrompt:n.bind(null,"prompt"),openExtension:o,openCurrentApp:i,openCurrent:function(e){return t.app?i(e):o(r(r({},e),{id:t.extension}))},selectSingleEntry:a.bind(null,"Entry",!1),selectSingleAsset:a.bind(null,"Asset",!1),selectMultipleEntries:a.bind(null,"Entry",!0),selectMultipleAssets:a.bind(null,"Asset",!0)};function n(t,n){return e.call("openDialog",t,g(n))}function o(n){var o=g(n);if((o=r(r({},o),{id:o.id||t.extension})).id)return e.call("openDialog","extension",o);throw new Error("Extension ID not provided.")}function i(n){if(n=g(n),t.app){var o=r(r({},n),{id:t.app});return e.call("openDialog","app",o)}throw new Error("Not in the app context.")}function a(t,n,r){return(r=g(r)).entityType=t,r.multiple=n,e.call("openDialog","entitySelector",r)}}function y(e,t){var n=new a(void 0),r=new a(void 0);return e.addHandler("localeSettingsChanged",(function(e){n.dispatch(e)})),e.addHandler("showDisabledFieldsChanged",(function(e){r.dispatch(e)})),{editorInterface:t,onLocaleSettingsChanged:function(e){return n.attach(e)},onShowDisabledFieldsChanged:function(e){return r.attach(e)}}}function _(e,t){var n=new o;return e.addHandler("navigateSlideIn",(function(e){n.dispatch(e)})),{openEntry:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Entry",id:t}))},openNewEntry:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,n){return e.call("navigateToBulkEditor",r({entryId:t},n))},openAsset:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Asset",id:t}))},openNewAsset:function(t){return e.call("navigateToContentEntity",r(r({},t),{entityType:"Asset",id:null}))},openPageExtension:function(n){return e.call("navigateToPage",r({type:"extension",id:t.extension},n))},openCurrentAppPage:function(n){return e.call("navigateToPage",r({type:"app",id:t.app},n))},openAppConfig:function(){return e.call("navigateToAppConfig")},openEntriesList:function(){return e.call("navigateToSpaceEnvRoute",{route:"entries"})},openAssetsList:function(){return e.call("navigateToSpaceEnvRoute",{route:"assets"})},onSlideInNavigation:function(e){return n.attach(e)}}}var E="preInstall",m="postInstall",A=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},C=function(e){return"function"==typeof e},T=function(e){return console.error(e),Promise.resolve(!1)},I=function(e,t,n){if(!C(e))return Promise.resolve(t);var r;try{r=void 0===n?e():e(n)}catch(e){return T(e)}var o,i=r;return A(o=i)&&C(o.then)||(i=Promise.resolve(i)),i.then((function(e){return e instanceof Error?Promise.reject(e):!1!==e&&(A(e)?e:t)}),T).catch(T)};function w(e){var t,n=((t={}).preInstall=null,t.postInstall=null,t),r=function(e,t){if(!C(t))throw new Error("Handler must be a function.");n[e]=t};return e.addHandler("appHook",(function(t){var r=t.stage,o=t.installationRequestId,i=t.err;return r===E?I(n[r],{}).then((function(t){return e.send("appHookResult",{stage:r,installationRequestId:o,result:t})})):r===m?I(n[r],void 0,i||null).then((function(){return e.send("appHookResult",{stage:r,installationRequestId:o})})):Promise.resolve()})),{setReady:function(){return e.call("callAppMethod","setReady")},isInstalled:function(){return e.call("callAppMethod","isInstalled")},getParameters:function(){return e.call("callAppMethod","getParameters")},getCurrentState:function(){return e.call("callAppMethod","getCurrentState")},onConfigure:function(e){r(E,e)},onConfigurationCompleted:function(e){r(m,e)}}}var b,L={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP_CONFIG:"app-config"},O=function(e){return function(t){return e.call("CMAAdapterCall",t)}};function S(e){return{makeRequest:O(e)}}var H=[D,x,function(e,t){var n=t.field;if(!n)throw new Error('FieldAPI called for location without "field" property defined.');return{field:new l(e,n)}},P,R],N=((b={})[L.LOCATION_ENTRY_FIELD]=H,b[L.LOCATION_ENTRY_FIELD_SIDEBAR]=H,b[L.LOCATION_ENTRY_SIDEBAR]=[D,x,P,R],b[L.LOCATION_ENTRY_EDITOR]=[D,x,P],b[L.LOCATION_DIALOG]=[D,function(e){return{close:function(t){return e.send("closeDialog",t)}}},R],b[L.LOCATION_PAGE]=[D],b[L.LOCATION_APP_CONFIG]=[D,function(e){return{app:w(e)}}],b);function D(e,t){var n=t.user,r=t.parameters,o=t.locales,i=t.ids,a=t.initialContentTypes,s=t.location||L.LOCATION_ENTRY_FIELD;return{cmaAdapter:S(e),location:{is:function(e){return s===e}},user:n,parameters:r,locales:{available:o.available,default:o.default,names:o.names,fallbacks:o.fallbacks,optional:o.optional,direction:o.direction},space:h(e,a),dialogs:v(e,i),navigator:_(e,i),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})}},ids:i,access:{can:function(t,n){return e.call("checkAccess",t,n)},canEditAppConfig:function(){return e.call("checkAppConfigAccess")}}}}function R(e,t,n){return{window:c(n,e)}}function P(e,t){return{editor:y(e,t.editorInterface)}}function x(e,t){var n=t.locales,r=t.contentType,o=t.entry,i=t.fieldInfo;return{contentType:r,entry:p(e,o,i,(function(t){return new u(e,t,n.default)}))}}var F,k,M,V,j=(F=window,k=function(e,t,n){return(N[t.location]||H).reduce((function(o,i){return r(r({},o),i(e,t,n))}),{})},(M={promise:null,resolve:null}).promise=new Promise((function(e){M.resolve=e})),(V=M).promise.then((function(e){var t=e[0],n=F.document;n.addEventListener("focus",(function(){return t.send("setActive",!0)}),!0),n.addEventListener("blur",(function(){return t.send("setActive",!1)}),!0)})),function(e,t){!function(e,t){function n(r){var o=r.data;"connect"===o.method&&(e.removeEventListener("message",n),t.apply(void 0,o.params))}e.addEventListener("message",n)}(e,(function(n,r){var o=new s(n.id,e);t(o,n,r)}))}(F,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V.resolve(e)})),function(e,t){var n=void 0===t?{supressIframeWarning:!1}:t,r=n.makeCustomApi;n.supressIframeWarning||F.self!==F.top||console.error("Cannot use ui-extension-sdk outside of Contenful:\n\nIn order for the ui-extension-sdk to function correctly, your app needs to be run in an iframe in the Contentful Web App.\n\nLearn more about local development with the ui-extension-sdk here:\n https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/#how-can-i-use-the-ui-extension-sdk-locally"),V.promise.then((function(t){var n,o=t[0],i=t[1],a=t[2],s=k(o,i,F);"function"==typeof r&&(n=r(o,i)),a.forEach((function(e){o._handleMessage(e)})),e(s,n)}))});e.init=j,e.locations=L,Object.defineProperty(e,"__esModule",{value:!0})})),window.contentfulApp=window.contentfulExtension;
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).contentfulExtension={})}(this,(function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)};var n,r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var o=function(){function e(){this._id=0,this._listeners={}}return e.prototype.dispatch=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r in this._listeners)(e=this._listeners)[r].apply(e,t)},e.prototype.attach=function(e){var t=this;if("function"!=typeof e)throw new Error("listener function expected");var n=this._id++;return this._listeners[n]=e,function(){return delete t._listeners[n]}},e}(),i="__private__memoized__arguments__",a=function(e){function r(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=e.call(this)||this;if(o[n]=[],!t.length)throw new Error("Initial value to be memoized expected");return o[i]=t,o}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,e),r.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this[i]=t,e.prototype.dispatch.apply(this,t)},r.prototype.attach=function(t){var n=e.prototype.attach.call(this,t);return t.apply(void 0,this[i]),n},r}(o);n=i;var s=function(){function e(e,t){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=function(e,t){var n=0;return function(r,o){var i=n++;return t.postMessage({source:e,id:i,method:r,params:o},"*"),i}}(e,t.parent),t.addEventListener("message",(function(e){n._handleMessage(e.data)}))}return e.prototype.call=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this._send(e,n);return new Promise((function(e,n){t._responseHandlers[o]={resolve:e,reject:n}}))},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._send(e,t)},e.prototype.addHandler=function(e,t){return e in this._messageHandlers||(this._messageHandlers[e]=new o),this._messageHandlers[e].attach(t)},e.prototype._handleMessage=function(e){if(e.method){var t=e.method,n=e.params,r=this._messageHandlers[t];r&&r.dispatch.apply(r,n)}else{var o=e.id,i=this._responseHandlers[o];if(!i)return;"result"in e?i.resolve(e.result):"error"in e&&i.reject(e.error),delete this._responseHandlers[o]}},e}();var l=function(){function e(e,t){var n=this;this.id=t.id,this.locale=t.locale,this.type=t.type,this.required=t.required,this.validations=t.validations,this.items=t.items,this._value=t.value,this._valueSignal=new a(this._value),this._isDisabledSignal=new a(void 0),this._schemaErrorsChangedSignal=new a(void 0),this._channel=e,e.addHandler("valueChanged",(function(e,t,r){e!==n.id||t&&t!==n.locale||(n._value=r,n._valueSignal.dispatch(r))})),e.addHandler("isDisabledChangedForFieldLocale",(function(e,t,r){e===n.id&&t===n.locale&&n._isDisabledSignal.dispatch(r)})),e.addHandler("schemaErrorsChangedForFieldLocale",(function(e,t,r){e===n.id&&t===n.locale&&n._schemaErrorsChangedSignal.dispatch(r)}))}return e.prototype.getValue=function(){return this._value},e.prototype.setValue=function(e){return this._value=e,this._valueSignal.dispatch(e),this._channel.call("setValue",this.id,this.locale,e)},e.prototype.removeValue=function(){return this._value=void 0,this._channel.call("removeValue",this.id,this.locale)},e.prototype.setInvalid=function(e){return this._channel.call("setInvalid",e,this.locale)},e.prototype.onValueChanged=function(e){return this._valueSignal.attach(e)},e.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},e.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},e}(),u=function(){function e(e,t,n){this.id=t.id,this.locales=t.locales,this.type=t.type,this.required=t.required,this.validations=t.validations,this.items=t.items,this._defaultLocale=n,this._fieldLocales=t.locales.reduce((function(n,o){var i,a=new l(e,{id:t.id,type:t.type,required:t.required,validations:t.validations,items:t.items,locale:o,value:t.values[o]});return r(r({},n),((i={})[o]=a,i))}),{}),this.assertHasLocale(n)}return e.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},e.prototype.setValue=function(e,t){return this._getFieldLocale(t).setValue(e)},e.prototype.removeValue=function(e){return this.setValue(void 0,e)},e.prototype.onValueChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onValueChanged(n)},e.prototype.onIsDisabledChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onIsDisabledChanged(n)},e.prototype._getFieldLocale=function(e){return e=e||this._defaultLocale,this.assertHasLocale(e),this._fieldLocales[e]},e.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},e.prototype.assertHasLocale=function(e){if(!this._fieldLocales[e])throw new Error('Unknown locale "'+e+'" for field "'+this.id+'"')},e}();function c(e,t){var n,r=e,o=r.document,i=r.MutationObserver,a=function(){u.updateHeight()},s=new i(a),l=!1,u={startAutoResizer:function(){if(u.updateHeight(),l)return;l=!0,s.observe(o.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.addEventListener("resize",a)},stopAutoResizer:function(){if(!l)return;l=!1,s.disconnect(),e.removeEventListener("resize",a)},updateHeight:function(e){void 0===e&&(e=null);null===e&&(e=Math.ceil(o.documentElement.getBoundingClientRect().height));e!==n&&(t.send("setHeight",e),n=e)}};return u}var d=["getTask","getTasks","createTask","updateTask","deleteTask"];function p(e,t,n,o){var i=t.sys,s=new a(i),l=t.metadata,u=new a(l);e.addHandler("sysChanged",(function(e){i=e,s.dispatch(i)})),e.addHandler("metadataChanged",(function(e){l=e,u.dispatch(l)}));var c={};return d.forEach((function(t){c[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callEntryMethod",t,n)}})),r(r(r({getSys:function(){return i},onSysChanged:function(e){return s.attach(e)},fields:n.reduce((function(e,t){return e[t.id]=o(t),e}),{})},l?{metadata:l}:{}),{getMetadata:function(){return l},onMetadataChanged:function(e){return u.attach(e)}}),c)}var f=["getContentType","getEntry","getEntrySnapshots","getAsset","getEditorInterface","getPublishedEntries","getPublishedAssets","getContentTypes","getEntries","getEditorInterfaces","getAssets","createContentType","createEntry","createAsset","updateContentType","updateEntry","updateAsset","deleteContentType","deleteEntry","deleteAsset","publishEntry","publishAsset","unpublishEntry","unpublishAsset","archiveEntry","archiveAsset","unarchiveEntry","unarchiveAsset","createUpload","processAsset","waitUntilAssetProcessed","getUsers","getAllScheduledActions","getEntityScheduledActions","signRequest","createTag","readTags","updateTag","deleteTag","getTeams"];function h(e,t){var n={};return f.forEach((function(t){n[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return console.warn("You called "+String(t)+" on the Space API. Since version 4.0.0 the Space API and its methods are deprecated. We recommend that you use the CMA client instead. See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details."),e.call("callSpaceMethod",t,n)}})),n.getCachedContentTypes=function(){return function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e}([],t)},n}var g=function(e){return"object"!=typeof(t=e)||null===t||Array.isArray(t)?{}:e;var t};function v(e,t){return{openAlert:n.bind(null,"alert"),openConfirm:n.bind(null,"confirm"),openPrompt:n.bind(null,"prompt"),openExtension:o,openCurrentApp:i,openCurrent:function(e){return t.app?i(e):o(r(r({},e),{id:t.extension}))},selectSingleEntry:a.bind(null,"Entry",!1),selectSingleAsset:a.bind(null,"Asset",!1),selectMultipleEntries:a.bind(null,"Entry",!0),selectMultipleAssets:a.bind(null,"Asset",!0)};function n(t,n){return e.call("openDialog",t,g(n))}function o(n){var o=g(n);if((o=r(r({},o),{id:o.id||t.extension})).id)return e.call("openDialog","extension",o);throw new Error("Extension ID not provided.")}function i(n){if(n=g(n),t.app){var o=r(r({},n),{id:t.app});return e.call("openDialog","app",o)}throw new Error("Not in the app context.")}function a(t,n,r){return(r=g(r)).entityType=t,r.multiple=n,e.call("openDialog","entitySelector",r)}}function y(e,t){var n=new a(void 0),r=new a(void 0);return e.addHandler("localeSettingsChanged",(function(e){n.dispatch(e)})),e.addHandler("showDisabledFieldsChanged",(function(e){r.dispatch(e)})),{editorInterface:t,onLocaleSettingsChanged:function(e){return n.attach(e)},onShowDisabledFieldsChanged:function(e){return r.attach(e)}}}function _(e,t){var n=new o;return e.addHandler("navigateSlideIn",(function(e){n.dispatch(e)})),{openEntry:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Entry",id:t}))},openNewEntry:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,n){return e.call("navigateToBulkEditor",r({entryId:t},n))},openAsset:function(t,n){return e.call("navigateToContentEntity",r(r({},n),{entityType:"Asset",id:t}))},openNewAsset:function(t){return e.call("navigateToContentEntity",r(r({},t),{entityType:"Asset",id:null}))},openPageExtension:function(n){return e.call("navigateToPage",r({type:"extension",id:t.extension},n))},openCurrentAppPage:function(n){return e.call("navigateToPage",r({type:"app",id:t.app},n))},openAppConfig:function(){return e.call("navigateToAppConfig")},openEntriesList:function(){return e.call("navigateToSpaceEnvRoute",{route:"entries"})},openAssetsList:function(){return e.call("navigateToSpaceEnvRoute",{route:"assets"})},onSlideInNavigation:function(e){return n.attach(e)}}}var m="preInstall",E="postInstall",A=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},C=function(e){return"function"==typeof e},T=function(e){return console.error(e),Promise.resolve(!1)},w=function(e,t,n){if(!C(e))return Promise.resolve(t);var r;try{r=void 0===n?e():e(n)}catch(e){return T(e)}var o,i=r;return A(o=i)&&C(o.then)||(i=Promise.resolve(i)),i.then((function(e){return e instanceof Error?Promise.reject(e):!1!==e&&(A(e)?e:t)}),T).catch(T)};function I(e){var t,n=((t={}).preInstall=null,t.postInstall=null,t),r=function(e,t){if(!C(t))throw new Error("Handler must be a function.");n[e]=t};return e.addHandler("appHook",(function(t){var r=t.stage,o=t.installationRequestId,i=t.err;return r===m?w(n[r],{}).then((function(t){return e.send("appHookResult",{stage:r,installationRequestId:o,result:t})})):r===E?w(n[r],void 0,i||null).then((function(){return e.send("appHookResult",{stage:r,installationRequestId:o})})):Promise.resolve()})),{setReady:function(){return e.call("callAppMethod","setReady")},isInstalled:function(){return e.call("callAppMethod","isInstalled")},getParameters:function(){return e.call("callAppMethod","getParameters")},getCurrentState:function(){return e.call("callAppMethod","getCurrentState")},onConfigure:function(e){r(m,e)},onConfigurationCompleted:function(e){r(E,e)}}}var b,L={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP_CONFIG:"app-config"},O=function(e){return function(t){return e.call("CMAAdapterCall",t)}};function S(e){return{makeRequest:O(e)}}var H=[P,x,function(e,t){var n=t.field;if(!n)throw new Error('FieldAPI called for location without "field" property defined.');return{field:new l(e,n)}},R,D],N=((b={})[L.LOCATION_ENTRY_FIELD]=H,b[L.LOCATION_ENTRY_FIELD_SIDEBAR]=H,b[L.LOCATION_ENTRY_SIDEBAR]=[P,x,R,D],b[L.LOCATION_ENTRY_EDITOR]=[P,x,R],b[L.LOCATION_DIALOG]=[P,function(e){return{close:function(t){return e.send("closeDialog",t)}}},D],b[L.LOCATION_PAGE]=[P],b[L.LOCATION_APP_CONFIG]=[P,function(e){return{app:I(e)}}],b);function P(e,t){var n=t.user,r=t.parameters,o=t.locales,i=t.ids,a=t.initialContentTypes,s=t.location||L.LOCATION_ENTRY_FIELD;return{cmaAdapter:S(e),location:{is:function(e){return s===e}},user:n,parameters:r,locales:{available:o.available,default:o.default,names:o.names,fallbacks:o.fallbacks,optional:o.optional,direction:o.direction},space:h(e,a),dialogs:v(e,i),navigator:_(e,i),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})}},ids:i,access:{can:function(t,n,r){return e.call("checkAccess",t,n,r)},canEditAppConfig:function(){return e.call("checkAppConfigAccess")}}}}function D(e,t,n){return{window:c(n,e)}}function R(e,t){return{editor:y(e,t.editorInterface)}}function x(e,t){var n=t.locales,r=t.contentType,o=t.entry,i=t.fieldInfo;return{contentType:r,entry:p(e,o,i,(function(t){return new u(e,t,n.default)}))}}var k,F,M,V,j=(k=window,F=function(e,t,n){return(N[t.location]||H).reduce((function(o,i){return r(r({},o),i(e,t,n))}),{})},(M={promise:null,resolve:null}).promise=new Promise((function(e){M.resolve=e})),(V=M).promise.then((function(e){var t=e[0],n=k.document;n.addEventListener("focus",(function(){return t.send("setActive",!0)}),!0),n.addEventListener("blur",(function(){return t.send("setActive",!1)}),!0)})),function(e,t){!function(e,t){function n(r){var o=r.data;"connect"===o.method&&(e.removeEventListener("message",n),t.apply(void 0,o.params))}e.addEventListener("message",n)}(e,(function(n,r){var o=new s(n.id,e);t(o,n,r)}))}(k,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V.resolve(e)})),function(e,t){var n=void 0===t?{supressIframeWarning:!1}:t,r=n.makeCustomApi;n.supressIframeWarning||k.self!==k.top||console.error("Cannot use ui-extension-sdk outside of Contenful:\n\nIn order for the ui-extension-sdk to function correctly, your app needs to be run in an iframe in the Contentful Web App.\n\nLearn more about local development with the ui-extension-sdk here:\n https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/#how-can-i-use-the-ui-extension-sdk-locally"),V.promise.then((function(t){var n,o=t[0],i=t[1],a=t[2],s=F(o,i,k);"function"==typeof r&&(n=r(o,i)),a.forEach((function(e){o._handleMessage(e)})),e(s,n)}))});e.init=j,e.locations=L,Object.defineProperty(e,"__esModule",{value:!0})})),window.contentfulApp=window.contentfulExtension;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentType, EditorInterface, SpaceMembership, Role, ContentTypeField, Metadata } from './entities';
|
|
1
|
+
import { ContentType, EditorInterface, SpaceMembership, Role, ContentTypeField, Metadata, Entry, Task, Asset } from './entities';
|
|
2
2
|
import { EntryAPI } from './entry.types';
|
|
3
3
|
import { SpaceAPI } from './space.types';
|
|
4
4
|
import { WindowAPI } from './window.types';
|
|
@@ -107,17 +107,26 @@ export interface SharedEditorSDK {
|
|
|
107
107
|
declare type CrudAction = 'create' | 'read' | 'update' | 'delete';
|
|
108
108
|
declare type PublishableAction = 'publish' | 'unpublish';
|
|
109
109
|
declare type ArchiveableAction = 'archive' | 'unarchive';
|
|
110
|
+
export declare type JSONPatchItem = {
|
|
111
|
+
op: 'remove' | 'replace' | 'add';
|
|
112
|
+
path: string;
|
|
113
|
+
value?: any;
|
|
114
|
+
};
|
|
115
|
+
declare type PatchEntity = Entry | Task | Asset;
|
|
110
116
|
export interface AccessAPI {
|
|
111
117
|
can(action: 'read' | 'update', entity: 'EditorInterface' | EditorInterface): Promise<boolean>;
|
|
112
118
|
can<T = Object>(action: CrudAction, entity: 'ContentType' | ContentType | 'Asset' | 'Entry' | T): Promise<boolean>;
|
|
113
119
|
can<T = Object>(action: PublishableAction, entity: 'ContentType' | ContentType | 'Asset' | 'Entry' | T): Promise<boolean>;
|
|
114
120
|
can<T = Object>(action: ArchiveableAction, entity: 'Asset' | 'Entry' | T): Promise<boolean>;
|
|
121
|
+
can(action: 'update', entity: PatchEntity, patch: JSONPatchItem[]): Promise<boolean>;
|
|
115
122
|
/** Whether the current user can edit app config */
|
|
116
123
|
canEditAppConfig: () => Promise<boolean>;
|
|
117
124
|
}
|
|
118
125
|
declare type EntryScopedIds = 'field' | 'entry' | 'contentType';
|
|
119
126
|
export interface BaseExtensionSDK {
|
|
120
|
-
/**
|
|
127
|
+
/** @deprecated since version 4.0.0 consider using the CMA instead
|
|
128
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
129
|
+
*/
|
|
121
130
|
space: SpaceAPI;
|
|
122
131
|
/** Information about the current user and roles */
|
|
123
132
|
user: UserAPI;
|
|
@@ -20,14 +20,11 @@ interface AppStateEditorInterfaceItem {
|
|
|
20
20
|
export interface AppState {
|
|
21
21
|
EditorInterface: Record<ContentType['sys']['id'], AppStateEditorInterfaceItem>;
|
|
22
22
|
}
|
|
23
|
-
export declare type OnConfigureHandlerReturn =
|
|
24
|
-
parameters?: KeyValueMap | null;
|
|
25
|
-
targetState?: AppState | null;
|
|
26
|
-
}> | {
|
|
23
|
+
export declare type OnConfigureHandlerReturn = {
|
|
27
24
|
parameters?: KeyValueMap | null;
|
|
28
25
|
targetState?: AppState | null;
|
|
29
26
|
} | false;
|
|
30
|
-
export declare type OnConfigureHandler = () => OnConfigureHandlerReturn
|
|
27
|
+
export declare type OnConfigureHandler = () => OnConfigureHandlerReturn | Promise<OnConfigureHandlerReturn>;
|
|
31
28
|
export interface AppConfigAPI {
|
|
32
29
|
/** Tells the web app that the app is loaded */
|
|
33
30
|
setReady: () => Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AccessAPI, AppExtensionSDK, BaseExtensionSDK, ConnectMessage, ContentTypeAPI, DialogExtensionSDK, EditorExtensionSDK, EditorLocaleSettings, FieldExtensionSDK, IdsAPI, KnownSDK, LocalesAPI, LocationAPI, Locations, NotifierAPI, PageExtensionSDK, ParametersAPI, SharedEditorSDK, SidebarExtensionSDK, UserAPI, } from './api.types';
|
|
1
|
+
export type { AccessAPI, AppExtensionSDK, BaseExtensionSDK, ConnectMessage, ContentTypeAPI, DialogExtensionSDK, EditorExtensionSDK, EditorLocaleSettings, FieldExtensionSDK, IdsAPI, KnownSDK, LocalesAPI, LocationAPI, Locations, NotifierAPI, PageExtensionSDK, ParametersAPI, SharedEditorSDK, SidebarExtensionSDK, UserAPI, JSONPatchItem, } from './api.types';
|
|
2
2
|
export type { AppConfigAPI, AppState, OnConfigureHandler, OnConfigureHandlerReturn, } from './app.types';
|
|
3
3
|
export type { DialogsAPI, EntityDialogOptions, OpenAlertOptions, OpenConfirmOptions, OpenCustomWidgetOptions, } from './dialogs.types';
|
|
4
4
|
export type { User, Asset, ContentType, CanonicalRequest, EditorInterface, ContentTypeField, ScheduledAction, SpaceMembership, Tag, TagVisibility, Task, Entry, Role, Metadata, } from './entities';
|
|
@@ -17,49 +17,256 @@ declare type Snapshot<T> = {
|
|
|
17
17
|
snapshot: T;
|
|
18
18
|
};
|
|
19
19
|
export interface SpaceAPI {
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated since version 4.0.0
|
|
22
|
+
* Please using `cma.contentType.getMany` instead
|
|
23
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
24
|
+
*/
|
|
20
25
|
getCachedContentTypes: () => ContentType[];
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated since version 4.0.0
|
|
28
|
+
* Consider using `cma.contentType.get` instead
|
|
29
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
30
|
+
*/
|
|
21
31
|
getContentType: (id: string) => Promise<ContentType>;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated since version 4.0.0
|
|
34
|
+
* Consider using `cma.contentType.getMany` instead
|
|
35
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
36
|
+
*/
|
|
22
37
|
getContentTypes: <Query extends SearchQuery = SearchQuery>(query?: Query) => Promise<CollectionResponse<ContentType>>;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated since version 4.0.0
|
|
40
|
+
* Consider using `cma.contentType.create` or `cma.contentType.createWithId` instead
|
|
41
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
42
|
+
*/
|
|
23
43
|
createContentType: (data: WithOptionalId<ContentType>) => Promise<ContentType>;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated since version 4.0.0
|
|
46
|
+
* Consider using `cma.contentType.update` instead
|
|
47
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
48
|
+
*/
|
|
24
49
|
updateContentType: (data: ContentType) => Promise<ContentType>;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated since version 4.0.0
|
|
52
|
+
* Consider using `cma.contentType.delete` instead
|
|
53
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
54
|
+
*/
|
|
25
55
|
deleteContentType: (contentTypeId: string) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated since version 4.0.0
|
|
58
|
+
* Consider using `cma.entry.get` instead
|
|
59
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
60
|
+
*/
|
|
26
61
|
getEntry: <Fields extends KeyValueMap = KeyValueMap>(id: string) => Promise<Entry<Fields>>;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated since version 4.0.0
|
|
64
|
+
* Consider using `cma.snapshot.getForEntry` instead
|
|
65
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
66
|
+
*/
|
|
27
67
|
getEntrySnapshots: <Fields extends KeyValueMap = KeyValueMap>(id: string) => Promise<CollectionResponse<Snapshot<Entry<Fields>>>>;
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated since version 4.0.0
|
|
70
|
+
* Consider using `cma.entry.getMany` instead
|
|
71
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
72
|
+
*/
|
|
28
73
|
getEntries: <Fields, Query extends SearchQuery = SearchQuery>(query?: Query) => Promise<CollectionResponse<Entry<Fields>>>;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated since version 4.0.0
|
|
76
|
+
* Consider using `cma.entry.create` or `cma.entry.createWithId` instead
|
|
77
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
78
|
+
*/
|
|
29
79
|
createEntry: <Fields>(contentTypeId: string, data: WithOptionalId<Entry<Fields>>) => Promise<Entry<Fields>>;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated since version 4.0.0
|
|
82
|
+
* Consider using `cma.entry.update` instead
|
|
83
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
84
|
+
*/
|
|
30
85
|
updateEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<Entry<Fields>>;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated since version 4.0.0
|
|
88
|
+
* Consider using `cma.entry.publish` instead
|
|
89
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
90
|
+
*/
|
|
31
91
|
publishEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<Entry<Fields>>;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated since version 4.0.0
|
|
94
|
+
* Consider using `cma.entry.unpublish` instead
|
|
95
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
96
|
+
*/
|
|
32
97
|
unpublishEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<Entry<Fields>>;
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated since version 4.0.0
|
|
100
|
+
* Consider using `cma.entry.archive` instead
|
|
101
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
102
|
+
*/
|
|
33
103
|
archiveEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<Entry<Fields>>;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated since version 4.0.0
|
|
106
|
+
* Consider using `cma.entry.unarchive` instead
|
|
107
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
108
|
+
*/
|
|
34
109
|
unarchiveEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<Entry<Fields>>;
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated since version 4.0.0
|
|
112
|
+
* Consider using `cma.entry.delete` instead
|
|
113
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
114
|
+
*/
|
|
35
115
|
deleteEntry: <Fields extends KeyValueMap = KeyValueMap>(data: Entry<Fields>) => Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated since version 4.0.0
|
|
118
|
+
* Consider using `cma.entry.getMany` instead
|
|
119
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
120
|
+
*/
|
|
36
121
|
getPublishedEntries: <Fields, Query extends SearchQuery = SearchQuery>(query?: Query) => Promise<CollectionResponse<Entry<Fields>>>;
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated since version 4.0.0
|
|
124
|
+
* Consider using `cma.asset.get` instead
|
|
125
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
126
|
+
*/
|
|
37
127
|
getAsset: (id: string) => Promise<Asset>;
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated since version 4.0.0
|
|
130
|
+
* Consider using `cma.asset.getMany` instead
|
|
131
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
132
|
+
*/
|
|
38
133
|
getAssets: <Query extends SearchQuery = SearchQuery>(query?: Query) => Promise<CollectionResponse<Asset>>;
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated since version 4.0.0
|
|
136
|
+
* Consider using `cma.asset.create` instead
|
|
137
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
138
|
+
*/
|
|
39
139
|
createAsset: (data: WithOptionalId<Asset>) => Promise<Asset>;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated since version 4.0.0
|
|
142
|
+
* Consider using `cma.asset.update` instead
|
|
143
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
144
|
+
*/
|
|
40
145
|
updateAsset: (data: Asset) => Promise<Asset>;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated since version 4.0.0
|
|
148
|
+
* Consider using `cma.asset.delete` instead
|
|
149
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
150
|
+
*/
|
|
41
151
|
deleteAsset: (data: Asset) => Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated since version 4.0.0
|
|
154
|
+
* Consider using `cma.asset.publish` instead
|
|
155
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
156
|
+
*/
|
|
42
157
|
publishAsset: (data: Asset) => Promise<Asset>;
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated since version 4.0.0
|
|
160
|
+
* Consider using `cma.asset.unpublish` instead
|
|
161
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
162
|
+
*/
|
|
43
163
|
unpublishAsset: (data: Asset) => Promise<Asset>;
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated since version 4.0.0
|
|
166
|
+
* Consider using `cma.asset.archive` instead
|
|
167
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
168
|
+
*/
|
|
44
169
|
archiveAsset: (data: Asset) => Promise<Asset>;
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated since version 4.0.0
|
|
172
|
+
* Consider using `cma.asset.processForLocale` instead
|
|
173
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
174
|
+
*/
|
|
45
175
|
processAsset: (data: Asset, locale: string) => Promise<Asset>;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated since version 4.0.0
|
|
178
|
+
* Consider using `cma.asset.unarchive` instead
|
|
179
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
180
|
+
*/
|
|
46
181
|
unarchiveAsset: (data: Asset) => Promise<Asset>;
|
|
182
|
+
/**
|
|
183
|
+
* @deprecated since version 4.0.0
|
|
184
|
+
* Consider using `cma.asset.getMany` instead
|
|
185
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
186
|
+
*/
|
|
47
187
|
getPublishedAssets: <Query extends SearchQuery = SearchQuery>(query?: Query) => Promise<CollectionResponse<Asset>>;
|
|
188
|
+
/**
|
|
189
|
+
* @deprecated since version 4.0.0
|
|
190
|
+
* Consider using `cma.upload.create` instead
|
|
191
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
192
|
+
*/
|
|
48
193
|
createUpload: (base64data: string) => Promise<Upload>;
|
|
194
|
+
/**
|
|
195
|
+
* @deprecated since version 4.0.0
|
|
196
|
+
* Consider polling `cma.asset.get` instead
|
|
197
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
198
|
+
*/
|
|
49
199
|
waitUntilAssetProcessed: (assetId: string, locale: string) => Promise<Asset>;
|
|
50
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated since version 4.0.0
|
|
202
|
+
* Consider using `cma.user.getManyForSpace` instead
|
|
203
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
204
|
+
* Returns all users who belong to the space.
|
|
205
|
+
*/
|
|
51
206
|
getUsers: () => Promise<CollectionResponse<User>>;
|
|
52
|
-
/**
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated since version 4.0.0
|
|
209
|
+
* Consider using `cma.editorInterface.get` instead
|
|
210
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
211
|
+
* Returns editor interface for a given content type
|
|
212
|
+
*/
|
|
53
213
|
getEditorInterface: (contentTypeId: string) => Promise<EditorInterface>;
|
|
54
|
-
/**
|
|
214
|
+
/**
|
|
215
|
+
* @deprecated since version 4.0.0
|
|
216
|
+
* Consider using `cma.editorInterface.getMany` instead
|
|
217
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
218
|
+
* Returns editor interfaces for a given environment
|
|
219
|
+
*/
|
|
55
220
|
getEditorInterfaces: () => Promise<CollectionResponse<EditorInterface>>;
|
|
221
|
+
/**
|
|
222
|
+
* @deprecated since version 4.0.0
|
|
223
|
+
* Consider using `cma.scheduledActions.getMany` instead
|
|
224
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
225
|
+
* Returns a list of scheduled actions for a given entity
|
|
226
|
+
*/
|
|
56
227
|
getEntityScheduledActions: (entityType: ContentEntityType, entityId: string) => Promise<ScheduledAction[]>;
|
|
228
|
+
/**
|
|
229
|
+
* @deprecated since version 4.0.0
|
|
230
|
+
* Consider using `cma.scheduledActions.getMany` instead
|
|
231
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
232
|
+
* Returns a list of scheduled actions for the currenst space & environment
|
|
233
|
+
*/
|
|
57
234
|
getAllScheduledActions: () => Promise<ScheduledAction[]>;
|
|
235
|
+
/**
|
|
236
|
+
* @deprecated since version 4.0.0
|
|
237
|
+
* Consider using `cma.appSignedRequest.create` instead
|
|
238
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
239
|
+
*/
|
|
58
240
|
signRequest: (request: CanonicalRequest) => Promise<Record<string, string>>;
|
|
241
|
+
/**
|
|
242
|
+
* @deprecated since version 4.0.0
|
|
243
|
+
* Consider using `cma.tag.create` instead
|
|
244
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
245
|
+
*/
|
|
59
246
|
createTag: (id: string, name: string, visibility?: TagVisibility) => Promise<Tag>;
|
|
247
|
+
/**
|
|
248
|
+
* @deprecated since version 4.0.0
|
|
249
|
+
* Consider using `cma.tag.getMany` instead
|
|
250
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
251
|
+
*/
|
|
60
252
|
readTags: (skip: number, limit: number) => Promise<CollectionResponse<Tag>>;
|
|
253
|
+
/**
|
|
254
|
+
* @deprecated since version 4.0.0
|
|
255
|
+
* Consider using `cma.tag.update` instead
|
|
256
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
257
|
+
*/
|
|
61
258
|
updateTag: (id: string, name: string, version: number) => Promise<Tag>;
|
|
259
|
+
/**
|
|
260
|
+
* @deprecated since version 4.0.0
|
|
261
|
+
* Consider using `cma.tag.delete` instead
|
|
262
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
263
|
+
*/
|
|
62
264
|
deleteTag: (id: string, version: number) => Promise<boolean>;
|
|
265
|
+
/**
|
|
266
|
+
* @deprecated since version 4.0.0
|
|
267
|
+
* Consider using `cma.team.get` instead
|
|
268
|
+
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
269
|
+
*/
|
|
63
270
|
getTeams: (query: QueryOptions) => Promise<CollectionResponse<Team>>;
|
|
64
271
|
}
|
|
65
272
|
export {};
|
package/package.json
CHANGED