contentful-management 11.52.1 → 12.0.0-beta.1
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 +73 -48
- package/dist/contentful-management.browser.js +23913 -28421
- package/dist/contentful-management.browser.min.js +1 -2
- package/dist/contentful-management.cjs +37008 -0
- package/dist/{es-modules → esm}/adapters/REST/endpoints/access-token.js +20 -22
- package/dist/esm/adapters/REST/endpoints/ai-action-invocation.js +7 -0
- package/dist/esm/adapters/REST/endpoints/ai-action.js +44 -0
- package/dist/esm/adapters/REST/endpoints/api-key.js +41 -0
- package/dist/esm/adapters/REST/endpoints/app-access-token.js +7 -0
- package/dist/esm/adapters/REST/endpoints/app-action-call.js +61 -0
- package/dist/esm/adapters/REST/endpoints/app-action.js +35 -0
- package/dist/esm/adapters/REST/endpoints/app-bundle.js +34 -0
- package/dist/esm/adapters/REST/endpoints/app-definition.js +39 -0
- package/dist/esm/adapters/REST/endpoints/app-details.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-event-subscription.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-installation.js +35 -0
- package/dist/esm/adapters/REST/endpoints/app-key.js +16 -0
- package/dist/esm/adapters/REST/endpoints/app-signed-request.js +7 -0
- package/dist/esm/adapters/REST/endpoints/app-signing-secret.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-upload.js +24 -0
- package/dist/esm/adapters/REST/endpoints/asset-key.js +31 -0
- package/dist/esm/adapters/REST/endpoints/asset.js +170 -0
- package/dist/esm/adapters/REST/endpoints/bulk-action.js +16 -0
- package/dist/esm/adapters/REST/endpoints/comment.js +85 -0
- package/dist/esm/adapters/REST/endpoints/concept-scheme.js +35 -0
- package/dist/esm/adapters/REST/endpoints/concept.js +54 -0
- package/dist/esm/adapters/REST/endpoints/content-type.js +47 -0
- package/dist/esm/adapters/REST/endpoints/editor-interface.js +20 -0
- package/dist/esm/adapters/REST/endpoints/entry.js +90 -0
- package/dist/esm/adapters/REST/endpoints/environment-alias.js +38 -0
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +20 -0
- package/dist/esm/adapters/REST/endpoints/environment-template.js +38 -0
- package/dist/esm/adapters/REST/endpoints/environment.js +40 -0
- package/dist/esm/adapters/REST/endpoints/extension.js +36 -0
- package/dist/esm/adapters/REST/endpoints/function-log.js +20 -0
- package/dist/esm/adapters/REST/endpoints/function.js +21 -0
- package/dist/esm/adapters/REST/endpoints/http.js +22 -0
- package/dist/esm/adapters/REST/endpoints/index.js +137 -0
- package/dist/esm/adapters/REST/endpoints/locale.js +31 -0
- package/dist/{es-modules → esm}/adapters/REST/endpoints/oauth-application.js +21 -22
- package/dist/esm/adapters/REST/endpoints/organization-invitation.js +20 -0
- package/dist/esm/adapters/REST/endpoints/organization-membership.js +27 -0
- package/dist/esm/adapters/REST/endpoints/organization.js +25 -0
- package/dist/esm/adapters/REST/endpoints/personal-access-token.js +32 -0
- package/dist/esm/adapters/REST/endpoints/preview-api-key.js +12 -0
- package/dist/esm/adapters/REST/endpoints/raw.js +37 -0
- package/dist/esm/adapters/REST/endpoints/release-action.js +17 -0
- package/dist/esm/adapters/REST/endpoints/release.js +50 -0
- package/dist/esm/adapters/REST/endpoints/resource-provider.js +14 -0
- package/dist/esm/adapters/REST/endpoints/resource-type.js +24 -0
- package/dist/esm/adapters/REST/endpoints/resource.js +8 -0
- package/dist/esm/adapters/REST/endpoints/role.js +40 -0
- package/dist/esm/adapters/REST/endpoints/scheduled-action.js +38 -0
- package/dist/esm/adapters/REST/endpoints/snapshot.js +25 -0
- package/dist/esm/adapters/REST/endpoints/space-member.js +8 -0
- package/dist/esm/adapters/REST/endpoints/space-membership.js +51 -0
- package/dist/esm/adapters/REST/endpoints/space.js +27 -0
- package/dist/esm/adapters/REST/endpoints/tag.js +31 -0
- package/dist/esm/adapters/REST/endpoints/task.js +33 -0
- package/dist/esm/adapters/REST/endpoints/team-membership.js +28 -0
- package/dist/esm/adapters/REST/endpoints/team-space-membership.js +38 -0
- package/dist/esm/adapters/REST/endpoints/team.js +29 -0
- package/dist/esm/adapters/REST/endpoints/ui-config.js +19 -0
- package/dist/esm/adapters/REST/endpoints/upload-credentials.js +14 -0
- package/dist/esm/adapters/REST/endpoints/upload.js +38 -0
- package/dist/esm/adapters/REST/endpoints/usage.js +14 -0
- package/dist/esm/adapters/REST/endpoints/user-ui-config.js +19 -0
- package/dist/esm/adapters/REST/endpoints/user.js +21 -0
- package/dist/esm/adapters/REST/endpoints/utils.js +17 -0
- package/dist/esm/adapters/REST/endpoints/webhook.js +82 -0
- package/dist/esm/adapters/REST/endpoints/workflow-definition.js +35 -0
- package/dist/esm/adapters/REST/endpoints/workflow.js +42 -0
- package/dist/esm/adapters/REST/endpoints/workflows-changelog.js +9 -0
- package/dist/esm/adapters/REST/make-request.js +17 -0
- package/dist/esm/adapters/REST/rest-adapter.js +30 -0
- package/dist/esm/common-types.js +6 -0
- package/dist/esm/common-utils.js +32 -0
- package/dist/esm/constants/editor-interface-defaults/controls-defaults.js +153 -0
- package/dist/esm/constants/editor-interface-defaults/editors-defaults.js +37 -0
- package/dist/esm/constants/editor-interface-defaults/index.js +12 -0
- package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.js +68 -0
- package/dist/esm/constants/editor-interface-defaults/types.js +15 -0
- package/dist/esm/create-adapter.js +19 -0
- package/dist/esm/create-app-definition-api.js +252 -0
- package/dist/esm/create-contentful-api.js +590 -0
- package/dist/esm/create-entry-api.js +479 -0
- package/dist/esm/create-environment-api.js +2401 -0
- package/dist/esm/create-environment-template-api.js +268 -0
- package/dist/esm/create-organization-api.js +1134 -0
- package/dist/esm/create-space-api.js +1589 -0
- package/dist/esm/create-ui-config-api.js +53 -0
- package/dist/esm/create-user-ui-config-api.js +53 -0
- package/dist/{es-modules → esm}/enhance-with-methods.js +13 -11
- package/dist/esm/entities/access-token.js +33 -0
- package/dist/esm/entities/ai-action-invocation.js +42 -0
- package/dist/esm/entities/ai-action.js +91 -0
- package/dist/esm/entities/api-key.js +56 -0
- package/dist/esm/entities/app-access-token.js +15 -0
- package/dist/esm/entities/app-action-call.js +61 -0
- package/dist/esm/entities/app-action.js +45 -0
- package/dist/esm/entities/app-bundle.js +45 -0
- package/dist/esm/entities/app-definition.js +26 -0
- package/dist/esm/entities/app-details.js +37 -0
- package/dist/esm/entities/app-event-subscription.js +32 -0
- package/dist/esm/entities/app-installation.js +52 -0
- package/dist/esm/entities/app-key.js +41 -0
- package/dist/{es-modules → esm}/entities/app-signed-request.js +7 -4
- package/dist/esm/entities/app-signing-secret.js +32 -0
- package/dist/esm/entities/app-upload.js +44 -0
- package/dist/{es-modules → esm}/entities/asset-key.js +7 -4
- package/dist/esm/entities/asset.js +121 -0
- package/dist/esm/entities/bulk-action.js +58 -0
- package/dist/esm/entities/comment.js +57 -0
- package/dist/esm/entities/concept-scheme.js +1 -0
- package/dist/esm/entities/concept.js +1 -0
- package/dist/esm/entities/content-type.js +117 -0
- package/dist/esm/entities/editor-interface.js +47 -0
- package/dist/esm/entities/entry.js +24 -0
- package/dist/esm/entities/environment-alias.js +55 -0
- package/dist/esm/entities/environment-template-installation.js +20 -0
- package/dist/esm/entities/environment-template.js +15 -0
- package/dist/esm/entities/environment.js +31 -0
- package/dist/esm/entities/extension.js +51 -0
- package/dist/{es-modules → esm}/entities/function-log.js +9 -7
- package/dist/esm/entities/function.js +63 -0
- package/dist/esm/entities/index.js +129 -0
- package/dist/esm/entities/locale.js +54 -0
- package/dist/esm/entities/oauth-application.js +63 -0
- package/dist/esm/entities/organization-invitation.js +15 -0
- package/dist/esm/entities/organization-membership.js +50 -0
- package/dist/esm/entities/organization.js +29 -0
- package/dist/esm/entities/personal-access-token.js +33 -0
- package/dist/esm/entities/preview-api-key.js +28 -0
- package/dist/esm/entities/release-action.js +52 -0
- package/dist/esm/entities/release.js +107 -0
- package/dist/esm/entities/resource-provider.js +137 -0
- package/dist/esm/entities/resource-type.js +94 -0
- package/dist/esm/entities/resource.js +10 -0
- package/dist/esm/entities/role.js +50 -0
- package/dist/esm/entities/scheduled-action.js +148 -0
- package/dist/esm/entities/snapshot.js +33 -0
- package/dist/esm/entities/space-member.js +20 -0
- package/dist/esm/entities/space-membership.js +50 -0
- package/dist/esm/entities/space.js +30 -0
- package/dist/esm/entities/tag.js +50 -0
- package/dist/esm/entities/task.js +51 -0
- package/dist/esm/entities/team-membership.js +51 -0
- package/dist/esm/entities/team-space-membership.js +50 -0
- package/dist/esm/entities/team.js +50 -0
- package/dist/esm/entities/ui-config.js +18 -0
- package/dist/esm/entities/upload.js +36 -0
- package/dist/esm/entities/usage.js +22 -0
- package/dist/esm/entities/user-ui-config.js +18 -0
- package/dist/esm/entities/user.js +25 -0
- package/dist/esm/entities/webhook.js +74 -0
- package/dist/esm/entities/workflow-definition.js +73 -0
- package/dist/esm/index.js +36 -0
- package/dist/esm/methods/action.js +49 -0
- package/dist/esm/methods/content-type.js +49 -0
- package/dist/esm/methods/utils.js +9 -0
- package/dist/esm/plain/as-iterator.js +30 -0
- package/dist/esm/plain/checks.js +10 -0
- package/dist/esm/plain/pagination-helper.js +54 -0
- package/dist/esm/plain/plain-client.js +514 -0
- package/dist/esm/plain/wrappers/wrap.js +24 -0
- package/dist/esm/upload-http-client.js +15 -0
- package/dist/stats-browser-min.html +4842 -0
- package/dist/{typings → types}/adapters/REST/endpoints/concept-scheme.d.ts +0 -1
- package/dist/{typings → types}/adapters/REST/endpoints/concept.d.ts +0 -1
- package/dist/{typings → types}/common-types.d.ts +22 -39
- package/dist/{typings → types}/create-contentful-api.d.ts +3 -2
- package/dist/{typings → types}/create-environment-api.d.ts +3 -3
- package/dist/{typings → types}/create-organization-api.d.ts +90 -90
- package/dist/{typings → types}/create-ui-config-api.d.ts +1 -1
- package/dist/{typings → types}/create-user-ui-config-api.d.ts +1 -1
- package/dist/{typings → types}/entities/access-token.d.ts +3 -3
- package/dist/{typings → types}/entities/ai-action-invocation.d.ts +4 -4
- package/dist/{typings → types}/entities/ai-action.d.ts +4 -21
- package/dist/{typings → types}/entities/api-key.d.ts +4 -8
- package/dist/{typings → types}/entities/app-access-token.d.ts +5 -5
- package/dist/{typings → types}/entities/app-action-call.d.ts +6 -6
- package/dist/{typings → types}/entities/app-action.d.ts +4 -4
- package/dist/{typings → types}/entities/app-bundle.d.ts +4 -4
- package/dist/{typings → types}/entities/app-definition.d.ts +3 -3
- package/dist/{typings → types}/entities/app-details.d.ts +4 -4
- package/dist/{typings → types}/entities/app-event-subscription.d.ts +4 -4
- package/dist/{typings → types}/entities/app-installation.d.ts +6 -6
- package/dist/{typings → types}/entities/app-key.d.ts +4 -4
- package/dist/{typings → types}/entities/app-signed-request.d.ts +5 -5
- package/dist/{typings → types}/entities/app-signing-secret.d.ts +4 -4
- package/dist/{typings → types}/entities/app-upload.d.ts +3 -3
- package/dist/{typings → types}/entities/asset.d.ts +1 -2
- package/dist/{typings → types}/entities/comment.d.ts +4 -4
- package/dist/{typings → types}/entities/content-type.d.ts +4 -4
- package/dist/{typings → types}/entities/editor-interface.d.ts +5 -11
- package/dist/{typings → types}/entities/entry.d.ts +5 -1
- package/dist/{typings → types}/entities/environment-alias.d.ts +4 -6
- package/dist/{typings → types}/entities/environment-template-installation.d.ts +1 -1
- package/dist/{typings → types}/entities/environment-template.d.ts +1 -1
- package/dist/{typings → types}/entities/environment.d.ts +6 -6
- package/dist/{typings → types}/entities/extension.d.ts +4 -4
- package/dist/{typings → types}/entities/locale.d.ts +4 -4
- package/dist/{typings → types}/entities/oauth-application.d.ts +1 -1
- package/dist/{typings → types}/entities/organization-invitation.d.ts +3 -5
- package/dist/{typings → types}/entities/organization-membership.d.ts +3 -5
- package/dist/{typings → types}/entities/organization.d.ts +1 -1
- package/dist/{typings → types}/entities/personal-access-token.d.ts +1 -1
- package/dist/{typings → types}/entities/preview-api-key.d.ts +1 -1
- package/dist/{typings → types}/entities/resource-provider.d.ts +5 -5
- package/dist/{typings → types}/entities/resource-type.d.ts +5 -5
- package/dist/{typings → types}/entities/resource.d.ts +4 -4
- package/dist/{typings → types}/entities/role.d.ts +3 -3
- package/dist/{typings → types}/entities/scheduled-action.d.ts +3 -5
- package/dist/{typings → types}/entities/snapshot.d.ts +1 -1
- package/dist/{typings → types}/entities/space-member.d.ts +3 -5
- package/dist/{typings → types}/entities/space-membership.d.ts +6 -6
- package/dist/{typings → types}/entities/space.d.ts +1 -1
- package/dist/{typings → types}/entities/tag.d.ts +4 -4
- package/dist/{typings → types}/entities/task.d.ts +4 -4
- package/dist/{typings → types}/entities/team-membership.d.ts +5 -11
- package/dist/{typings → types}/entities/team-space-membership.d.ts +5 -11
- package/dist/{typings → types}/entities/team.d.ts +3 -5
- package/dist/{typings → types}/entities/ui-config.d.ts +5 -5
- package/dist/{typings → types}/entities/upload-credential.d.ts +4 -4
- package/dist/{typings → types}/entities/upload.d.ts +4 -4
- package/dist/{typings → types}/entities/usage.d.ts +7 -7
- package/dist/{typings → types}/entities/user-ui-config.d.ts +5 -5
- package/dist/{typings → types}/entities/user.d.ts +1 -1
- package/dist/{typings → types}/entities/webhook.d.ts +10 -16
- package/dist/{typings → types}/entities/workflow-definition.d.ts +4 -4
- package/dist/{typings → types}/entities/workflow.d.ts +6 -6
- package/dist/{typings → types}/entities/workflows-changelog-entry.d.ts +2 -2
- package/dist/{typings → types}/export-types.d.ts +1 -1
- package/dist/{typings/contentful-management.d.ts → types/index.d.ts} +1 -1
- package/dist/types/plain/checks.d.ts +13 -0
- package/dist/{typings → types}/plain/common-types.d.ts +3 -2
- package/dist/{typings → types}/plain/entities/concept-scheme.d.ts +3 -20
- package/dist/{typings → types}/plain/entities/concept.d.ts +4 -21
- package/dist/{typings → types}/plain/entities/upload-credential.d.ts +1 -1
- package/package.json +49 -45
- package/dist/contentful-management.browser.js.map +0 -1
- package/dist/contentful-management.node.js +0 -32624
- package/dist/contentful-management.node.js.map +0 -1
- package/dist/contentful-management.node.min.js +0 -2
- package/dist/es-modules/adapters/REST/endpoints/ai-action-invocation.js +0 -6
- package/dist/es-modules/adapters/REST/endpoints/ai-action.js +0 -61
- package/dist/es-modules/adapters/REST/endpoints/api-key.js +0 -47
- package/dist/es-modules/adapters/REST/endpoints/app-access-token.js +0 -8
- package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +0 -69
- package/dist/es-modules/adapters/REST/endpoints/app-action.js +0 -32
- package/dist/es-modules/adapters/REST/endpoints/app-bundle.js +0 -36
- package/dist/es-modules/adapters/REST/endpoints/app-definition.js +0 -45
- package/dist/es-modules/adapters/REST/endpoints/app-details.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-event-subscription.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-installation.js +0 -39
- package/dist/es-modules/adapters/REST/endpoints/app-key.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/app-signed-request.js +0 -4
- package/dist/es-modules/adapters/REST/endpoints/app-signing-secret.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-upload.js +0 -23
- package/dist/es-modules/adapters/REST/endpoints/asset-key.js +0 -33
- package/dist/es-modules/adapters/REST/endpoints/asset.js +0 -220
- package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/comment.js +0 -101
- package/dist/es-modules/adapters/REST/endpoints/concept-scheme.js +0 -52
- package/dist/es-modules/adapters/REST/endpoints/concept.js +0 -85
- package/dist/es-modules/adapters/REST/endpoints/content-type.js +0 -61
- package/dist/es-modules/adapters/REST/endpoints/editor-interface.js +0 -24
- package/dist/es-modules/adapters/REST/endpoints/entry.js +0 -113
- package/dist/es-modules/adapters/REST/endpoints/environment-alias.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/environment-template-installation.js +0 -43
- package/dist/es-modules/adapters/REST/endpoints/environment-template.js +0 -88
- package/dist/es-modules/adapters/REST/endpoints/environment.js +0 -42
- package/dist/es-modules/adapters/REST/endpoints/extension.js +0 -44
- package/dist/es-modules/adapters/REST/endpoints/function-log.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/function.js +0 -20
- package/dist/es-modules/adapters/REST/endpoints/http.js +0 -39
- package/dist/es-modules/adapters/REST/endpoints/index.js +0 -134
- package/dist/es-modules/adapters/REST/endpoints/locale.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/organization-invitation.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/organization-membership.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/organization.js +0 -26
- package/dist/es-modules/adapters/REST/endpoints/personal-access-token.js +0 -33
- package/dist/es-modules/adapters/REST/endpoints/preview-api-key.js +0 -9
- package/dist/es-modules/adapters/REST/endpoints/raw.js +0 -42
- package/dist/es-modules/adapters/REST/endpoints/release-action.js +0 -21
- package/dist/es-modules/adapters/REST/endpoints/release.js +0 -58
- package/dist/es-modules/adapters/REST/endpoints/resource-provider.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/resource-type.js +0 -23
- package/dist/es-modules/adapters/REST/endpoints/resource.js +0 -5
- package/dist/es-modules/adapters/REST/endpoints/role.js +0 -44
- package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/snapshot.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/space-member.js +0 -5
- package/dist/es-modules/adapters/REST/endpoints/space-membership.js +0 -55
- package/dist/es-modules/adapters/REST/endpoints/space.js +0 -32
- package/dist/es-modules/adapters/REST/endpoints/tag.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/task.js +0 -47
- package/dist/es-modules/adapters/REST/endpoints/team-membership.js +0 -34
- package/dist/es-modules/adapters/REST/endpoints/team-space-membership.js +0 -45
- package/dist/es-modules/adapters/REST/endpoints/team.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/ui-config.js +0 -16
- package/dist/es-modules/adapters/REST/endpoints/upload-credentials.js +0 -11
- package/dist/es-modules/adapters/REST/endpoints/upload.js +0 -37
- package/dist/es-modules/adapters/REST/endpoints/usage.js +0 -11
- package/dist/es-modules/adapters/REST/endpoints/user-ui-config.js +0 -16
- package/dist/es-modules/adapters/REST/endpoints/user.js +0 -20
- package/dist/es-modules/adapters/REST/endpoints/utils.js +0 -28
- package/dist/es-modules/adapters/REST/endpoints/webhook.js +0 -93
- package/dist/es-modules/adapters/REST/endpoints/workflow-definition.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/workflow.js +0 -59
- package/dist/es-modules/adapters/REST/endpoints/workflows-changelog.js +0 -6
- package/dist/es-modules/adapters/REST/make-request.js +0 -28
- package/dist/es-modules/adapters/REST/rest-adapter.js +0 -42
- package/dist/es-modules/adapters/REST/types.js +0 -1
- package/dist/es-modules/common-types.js +0 -61
- package/dist/es-modules/common-utils.js +0 -30
- package/dist/es-modules/constants/editor-interface-defaults/controls-defaults.js +0 -255
- package/dist/es-modules/constants/editor-interface-defaults/editors-defaults.js +0 -34
- package/dist/es-modules/constants/editor-interface-defaults/index.js +0 -9
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +0 -57
- package/dist/es-modules/constants/editor-interface-defaults/types.js +0 -14
- package/dist/es-modules/contentful-management.js +0 -66
- package/dist/es-modules/create-adapter.js +0 -16
- package/dist/es-modules/create-app-definition-api.js +0 -263
- package/dist/es-modules/create-contentful-api.js +0 -663
- package/dist/es-modules/create-entry-api.js +0 -548
- package/dist/es-modules/create-environment-api.js +0 -2525
- package/dist/es-modules/create-environment-template-api.js +0 -316
- package/dist/es-modules/create-organization-api.js +0 -1306
- package/dist/es-modules/create-space-api.js +0 -1750
- package/dist/es-modules/create-ui-config-api.js +0 -60
- package/dist/es-modules/create-user-ui-config-api.js +0 -60
- package/dist/es-modules/entities/access-token.js +0 -38
- package/dist/es-modules/entities/ai-action-invocation.js +0 -46
- package/dist/es-modules/entities/ai-action.js +0 -88
- package/dist/es-modules/entities/api-key.js +0 -55
- package/dist/es-modules/entities/app-access-token.js +0 -12
- package/dist/es-modules/entities/app-action-call.js +0 -70
- package/dist/es-modules/entities/app-action.js +0 -53
- package/dist/es-modules/entities/app-bundle.js +0 -44
- package/dist/es-modules/entities/app-definition.js +0 -24
- package/dist/es-modules/entities/app-details.js +0 -35
- package/dist/es-modules/entities/app-event-subscription.js +0 -30
- package/dist/es-modules/entities/app-installation.js +0 -51
- package/dist/es-modules/entities/app-key.js +0 -40
- package/dist/es-modules/entities/app-signing-secret.js +0 -30
- package/dist/es-modules/entities/app-upload.js +0 -43
- package/dist/es-modules/entities/asset.js +0 -131
- package/dist/es-modules/entities/bulk-action.js +0 -61
- package/dist/es-modules/entities/comment.js +0 -77
- package/dist/es-modules/entities/concept-scheme.js +0 -1
- package/dist/es-modules/entities/concept.js +0 -1
- package/dist/es-modules/entities/content-type-fields.js +0 -1
- package/dist/es-modules/entities/content-type.js +0 -146
- package/dist/es-modules/entities/editor-interface.js +0 -46
- package/dist/es-modules/entities/entry.js +0 -22
- package/dist/es-modules/entities/environment-alias.js +0 -54
- package/dist/es-modules/entities/environment-template-installation.js +0 -17
- package/dist/es-modules/entities/environment-template.js +0 -12
- package/dist/es-modules/entities/environment.js +0 -29
- package/dist/es-modules/entities/extension.js +0 -50
- package/dist/es-modules/entities/field-type.js +0 -1
- package/dist/es-modules/entities/function.js +0 -61
- package/dist/es-modules/entities/index.js +0 -126
- package/dist/es-modules/entities/locale.js +0 -53
- package/dist/es-modules/entities/oauth-application.js +0 -62
- package/dist/es-modules/entities/organization-invitation.js +0 -12
- package/dist/es-modules/entities/organization-membership.js +0 -49
- package/dist/es-modules/entities/organization.js +0 -32
- package/dist/es-modules/entities/personal-access-token.js +0 -38
- package/dist/es-modules/entities/preview-api-key.js +0 -27
- package/dist/es-modules/entities/release-action.js +0 -53
- package/dist/es-modules/entities/release.js +0 -105
- package/dist/es-modules/entities/resource-provider.js +0 -139
- package/dist/es-modules/entities/resource-type.js +0 -93
- package/dist/es-modules/entities/resource.js +0 -7
- package/dist/es-modules/entities/role.js +0 -49
- package/dist/es-modules/entities/scheduled-action.js +0 -155
- package/dist/es-modules/entities/snapshot.js +0 -31
- package/dist/es-modules/entities/space-member.js +0 -18
- package/dist/es-modules/entities/space-membership.js +0 -49
- package/dist/es-modules/entities/space.js +0 -28
- package/dist/es-modules/entities/tag.js +0 -56
- package/dist/es-modules/entities/task.js +0 -57
- package/dist/es-modules/entities/team-membership.js +0 -50
- package/dist/es-modules/entities/team-space-membership.js +0 -49
- package/dist/es-modules/entities/team.js +0 -49
- package/dist/es-modules/entities/ui-config.js +0 -15
- package/dist/es-modules/entities/upload-credential.js +0 -33
- package/dist/es-modules/entities/upload.js +0 -34
- package/dist/es-modules/entities/usage.js +0 -20
- package/dist/es-modules/entities/user-ui-config.js +0 -15
- package/dist/es-modules/entities/user.js +0 -23
- package/dist/es-modules/entities/utils.js +0 -1
- package/dist/es-modules/entities/webhook.js +0 -80
- package/dist/es-modules/entities/widget-parameters.js +0 -1
- package/dist/es-modules/entities/workflow-definition.js +0 -87
- package/dist/es-modules/entities/workflow.js +0 -76
- package/dist/es-modules/entities/workflows-changelog-entry.js +0 -24
- package/dist/es-modules/export-types.js +0 -3
- package/dist/es-modules/methods/action.js +0 -54
- package/dist/es-modules/methods/bulk-action.js +0 -15
- package/dist/es-modules/methods/content-type.js +0 -47
- package/dist/es-modules/methods/release-action.js +0 -17
- package/dist/es-modules/methods/utils.js +0 -7
- package/dist/es-modules/plain/as-iterator.js +0 -47
- package/dist/es-modules/plain/checks.js +0 -8
- package/dist/es-modules/plain/common-types.js +0 -1
- package/dist/es-modules/plain/entities/ai-action-invocation.js +0 -1
- package/dist/es-modules/plain/entities/ai-action.js +0 -1
- package/dist/es-modules/plain/entities/app-access-token.js +0 -1
- package/dist/es-modules/plain/entities/app-action-call.js +0 -1
- package/dist/es-modules/plain/entities/app-action.js +0 -1
- package/dist/es-modules/plain/entities/app-bundle.js +0 -1
- package/dist/es-modules/plain/entities/app-definition.js +0 -1
- package/dist/es-modules/plain/entities/app-details.js +0 -1
- package/dist/es-modules/plain/entities/app-event-subscription.js +0 -1
- package/dist/es-modules/plain/entities/app-installation.js +0 -1
- package/dist/es-modules/plain/entities/app-key.js +0 -1
- package/dist/es-modules/plain/entities/app-signed-request.js +0 -1
- package/dist/es-modules/plain/entities/app-signing-secret.js +0 -1
- package/dist/es-modules/plain/entities/app-upload.js +0 -1
- package/dist/es-modules/plain/entities/comment.js +0 -1
- package/dist/es-modules/plain/entities/concept-scheme.js +0 -1
- package/dist/es-modules/plain/entities/concept.js +0 -1
- package/dist/es-modules/plain/entities/editor-interface.js +0 -1
- package/dist/es-modules/plain/entities/environment-alias.js +0 -1
- package/dist/es-modules/plain/entities/environment.js +0 -1
- package/dist/es-modules/plain/entities/extension.js +0 -1
- package/dist/es-modules/plain/entities/function-log.js +0 -1
- package/dist/es-modules/plain/entities/function.js +0 -1
- package/dist/es-modules/plain/entities/locale.js +0 -1
- package/dist/es-modules/plain/entities/oauth-application.js +0 -1
- package/dist/es-modules/plain/entities/organization.js +0 -1
- package/dist/es-modules/plain/entities/resource-provider.js +0 -1
- package/dist/es-modules/plain/entities/resource-type.js +0 -1
- package/dist/es-modules/plain/entities/resource.js +0 -1
- package/dist/es-modules/plain/entities/role.js +0 -1
- package/dist/es-modules/plain/entities/space-member.js +0 -1
- package/dist/es-modules/plain/entities/space-membership.js +0 -1
- package/dist/es-modules/plain/entities/space.js +0 -1
- package/dist/es-modules/plain/entities/tag.js +0 -1
- package/dist/es-modules/plain/entities/task.js +0 -1
- package/dist/es-modules/plain/entities/team-membership.js +0 -1
- package/dist/es-modules/plain/entities/team-space-membership.js +0 -1
- package/dist/es-modules/plain/entities/team.js +0 -1
- package/dist/es-modules/plain/entities/ui-config.js +0 -1
- package/dist/es-modules/plain/entities/upload-credential.js +0 -1
- package/dist/es-modules/plain/entities/upload.js +0 -1
- package/dist/es-modules/plain/entities/usage.js +0 -1
- package/dist/es-modules/plain/entities/user-ui-config.js +0 -1
- package/dist/es-modules/plain/entities/user.js +0 -1
- package/dist/es-modules/plain/entities/webhook.js +0 -1
- package/dist/es-modules/plain/entities/workflow-definition.js +0 -1
- package/dist/es-modules/plain/entities/workflow.js +0 -1
- package/dist/es-modules/plain/entities/workflows-changelog.js +0 -1
- package/dist/es-modules/plain/pagination-helper.js +0 -76
- package/dist/es-modules/plain/plain-client.js +0 -544
- package/dist/es-modules/plain/wrappers/wrap.js +0 -46
- package/dist/es-modules/plain/wrappers/wrap.test-d.js +0 -15
- package/dist/es-modules/upload-http-client.js +0 -17
- package/dist/typings/plain/checks.d.ts +0 -13
- /package/dist/{typings → types}/adapters/REST/endpoints/access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ai-action-invocation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ai-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/api-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-action-call.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-bundle.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-definition.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-details.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-event-subscription.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-installation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-signed-request.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-signing-secret.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-upload.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/asset-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/asset.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/comment.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/content-type.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/editor-interface.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/entry.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-alias.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-template-installation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-template.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/extension.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/function-log.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/function.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/http.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/index.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/locale.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/oauth-application.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization-invitation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/personal-access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/preview-api-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/raw.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/release-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/release.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource-provider.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource-type.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/role.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/scheduled-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/snapshot.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space-member.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/tag.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/task.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team-space-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ui-config.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/upload-credentials.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/upload.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/usage.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/user-ui-config.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/user.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/utils.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/webhook.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflow-definition.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflow.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflows-changelog.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/make-request.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/rest-adapter.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/types.d.ts +0 -0
- /package/dist/{typings → types}/common-utils.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/controls-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/editors-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/index.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/sidebar-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/types.d.ts +0 -0
- /package/dist/{typings → types}/create-adapter.d.ts +0 -0
- /package/dist/{typings → types}/create-app-definition-api.d.ts +0 -0
- /package/dist/{typings → types}/create-entry-api.d.ts +0 -0
- /package/dist/{typings → types}/create-environment-template-api.d.ts +0 -0
- /package/dist/{typings → types}/create-space-api.d.ts +0 -0
- /package/dist/{typings → types}/enhance-with-methods.d.ts +0 -0
- /package/dist/{typings → types}/entities/asset-key.d.ts +0 -0
- /package/dist/{typings → types}/entities/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/concept-scheme.d.ts +0 -0
- /package/dist/{typings → types}/entities/concept.d.ts +0 -0
- /package/dist/{typings → types}/entities/content-type-fields.d.ts +0 -0
- /package/dist/{typings → types}/entities/field-type.d.ts +0 -0
- /package/dist/{typings → types}/entities/function-log.d.ts +0 -0
- /package/dist/{typings → types}/entities/function.d.ts +0 -0
- /package/dist/{typings → types}/entities/index.d.ts +0 -0
- /package/dist/{typings → types}/entities/release-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/release.d.ts +0 -0
- /package/dist/{typings → types}/entities/utils.d.ts +0 -0
- /package/dist/{typings → types}/entities/widget-parameters.d.ts +0 -0
- /package/dist/{typings → types}/methods/action.d.ts +0 -0
- /package/dist/{typings → types}/methods/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/methods/content-type.d.ts +0 -0
- /package/dist/{typings → types}/methods/release-action.d.ts +0 -0
- /package/dist/{typings → types}/methods/utils.d.ts +0 -0
- /package/dist/{typings → types}/plain/as-iterator.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ai-action-invocation.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ai-action.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-access-token.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-action-call.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-action.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-bundle.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-definition.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-details.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-event-subscription.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-installation.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-key.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-signed-request.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-signing-secret.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-upload.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/comment.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/editor-interface.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/environment-alias.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/environment.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/extension.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/function-log.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/function.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/locale.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/oauth-application.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/organization.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource-provider.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource-type.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/role.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space-member.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/tag.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/task.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team-space-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ui-config.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/upload.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/usage.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/user-ui-config.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/user.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/webhook.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflow-definition.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflow.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflows-changelog.d.ts +0 -0
- /package/dist/{typings → types}/plain/pagination-helper.d.ts +0 -0
- /package/dist/{typings → types}/plain/plain-client.d.ts +0 -0
- /package/dist/{typings → types}/plain/wrappers/wrap.d.ts +0 -0
- /package/dist/{typings → types}/plain/wrappers/wrap.test-d.d.ts +0 -0
- /package/dist/{typings → types}/upload-http-client.d.ts +0 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { isPublished, isUpdated, isDraft, isArchived } from './plain/checks.js';
|
|
2
|
+
import entities from './entities/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
function createEntryApi(makeRequest) {
|
|
8
|
+
const { wrapEntry, wrapEntryCollection } = entities.entry;
|
|
9
|
+
const { wrapSnapshot, wrapSnapshotCollection } = entities.snapshot;
|
|
10
|
+
const { wrapTask, wrapTaskCollection } = entities.task;
|
|
11
|
+
const { wrapComment, wrapCommentCollection } = entities.comment;
|
|
12
|
+
const getParams = (self) => {
|
|
13
|
+
const entry = self.toPlainObject();
|
|
14
|
+
return {
|
|
15
|
+
params: {
|
|
16
|
+
spaceId: entry.sys.space.sys.id,
|
|
17
|
+
environmentId: entry.sys.environment.sys.id,
|
|
18
|
+
entryId: entry.sys.id,
|
|
19
|
+
},
|
|
20
|
+
raw: entry,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
/**
|
|
25
|
+
* Sends an update to the server with any changes made to the object's properties
|
|
26
|
+
* @return Object returned from the server with updated changes.
|
|
27
|
+
* @example ```javascript
|
|
28
|
+
* const contentful = require('contentful-management')
|
|
29
|
+
*
|
|
30
|
+
* const client = contentful.createClient({
|
|
31
|
+
* accessToken: '<content_management_api_key>'
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* client.getSpace('<space_id>')
|
|
35
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
36
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
37
|
+
* .then((entry) => {
|
|
38
|
+
* entry.fields.title['en-US'] = 'New entry title'
|
|
39
|
+
* return entry.update()
|
|
40
|
+
* })
|
|
41
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} updated.`))
|
|
42
|
+
* .catch(console.error)
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
update: function update() {
|
|
46
|
+
const { raw, params } = getParams(this);
|
|
47
|
+
return makeRequest({
|
|
48
|
+
entityType: 'Entry',
|
|
49
|
+
action: 'update',
|
|
50
|
+
params,
|
|
51
|
+
payload: raw,
|
|
52
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Sends an JSON patch to the server with any changes made to the object's properties
|
|
56
|
+
* @return Object returned from the server with updated changes.
|
|
57
|
+
* @example ```javascript
|
|
58
|
+
* const contentful = require('contentful-management')
|
|
59
|
+
*
|
|
60
|
+
* const client = contentful.createClient({
|
|
61
|
+
* accessToken: '<content_management_api_key>'
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* client.getSpace('<space_id>')
|
|
65
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
66
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
67
|
+
* .then((entry) => entry.patch([
|
|
68
|
+
* {
|
|
69
|
+
* op: 'replace',
|
|
70
|
+
* path: '/fields/title/en-US',
|
|
71
|
+
* value: 'New entry title'
|
|
72
|
+
* }
|
|
73
|
+
* ]))
|
|
74
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} updated.`))
|
|
75
|
+
* .catch(console.error)
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
patch: function patch(ops) {
|
|
79
|
+
const { raw, params } = getParams(this);
|
|
80
|
+
return makeRequest({
|
|
81
|
+
entityType: 'Entry',
|
|
82
|
+
action: 'patch',
|
|
83
|
+
params: Object.assign(Object.assign({}, params), { version: raw.sys.version }),
|
|
84
|
+
payload: ops,
|
|
85
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Deletes this object on the server.
|
|
89
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
90
|
+
* @example ```javascript
|
|
91
|
+
* const contentful = require('contentful-management')
|
|
92
|
+
*
|
|
93
|
+
* const client = contentful.createClient({
|
|
94
|
+
* accessToken: '<content_management_api_key>'
|
|
95
|
+
* })
|
|
96
|
+
*
|
|
97
|
+
* client.getSpace('<space_id>')
|
|
98
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
99
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
100
|
+
* .then((entry) => entry.delete())
|
|
101
|
+
* .then(() => console.log(`Entry deleted.`))
|
|
102
|
+
* .catch(console.error)
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
delete: function del() {
|
|
106
|
+
const { params } = getParams(this);
|
|
107
|
+
return makeRequest({ entityType: 'Entry', action: 'delete', params });
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Publishes the object
|
|
111
|
+
* @return Object returned from the server with updated metadata.
|
|
112
|
+
* @example ```javascript
|
|
113
|
+
* const contentful = require('contentful-management')
|
|
114
|
+
*
|
|
115
|
+
* const client = contentful.createClient({
|
|
116
|
+
* accessToken: '<content_management_api_key>'
|
|
117
|
+
* })
|
|
118
|
+
*
|
|
119
|
+
* client.getSpace('<space_id>')
|
|
120
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
121
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
122
|
+
* .then((entry) => entry.publish())
|
|
123
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} published.`))
|
|
124
|
+
* .catch(console.error)
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
publish: function publish() {
|
|
128
|
+
const { raw, params } = getParams(this);
|
|
129
|
+
return makeRequest({
|
|
130
|
+
entityType: 'Entry',
|
|
131
|
+
action: 'publish',
|
|
132
|
+
params,
|
|
133
|
+
payload: raw,
|
|
134
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Unpublishes the object
|
|
138
|
+
* @return Object returned from the server with updated metadata.
|
|
139
|
+
* @example ```javascript
|
|
140
|
+
* const contentful = require('contentful-management')
|
|
141
|
+
*
|
|
142
|
+
* const client = contentful.createClient({
|
|
143
|
+
* accessToken: '<content_management_api_key>'
|
|
144
|
+
* })
|
|
145
|
+
*
|
|
146
|
+
* client.getSpace('<space_id>')
|
|
147
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
148
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
149
|
+
* .then((entry) => entry.unpublish())
|
|
150
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} unpublished.`))
|
|
151
|
+
* .catch(console.error)
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
unpublish: function unpublish() {
|
|
155
|
+
const { params } = getParams(this);
|
|
156
|
+
return makeRequest({
|
|
157
|
+
entityType: 'Entry',
|
|
158
|
+
action: 'unpublish',
|
|
159
|
+
params,
|
|
160
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
161
|
+
},
|
|
162
|
+
/**
|
|
163
|
+
* Archives the object
|
|
164
|
+
* @return Object returned from the server with updated metadata.
|
|
165
|
+
* @example ```javascript
|
|
166
|
+
* const contentful = require('contentful-management')
|
|
167
|
+
*
|
|
168
|
+
* const client = contentful.createClient({
|
|
169
|
+
* accessToken: '<content_management_api_key>'
|
|
170
|
+
* })
|
|
171
|
+
*
|
|
172
|
+
* client.getSpace('<space_id>')
|
|
173
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
174
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
175
|
+
* .then((entry) => entry.archive())
|
|
176
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} archived.`))
|
|
177
|
+
* .catch(console.error)
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
archive: function archive() {
|
|
181
|
+
const { params } = getParams(this);
|
|
182
|
+
return makeRequest({
|
|
183
|
+
entityType: 'Entry',
|
|
184
|
+
action: 'archive',
|
|
185
|
+
params,
|
|
186
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Unarchives the object
|
|
190
|
+
* @return Object returned from the server with updated metadata.
|
|
191
|
+
* @example ```javascript
|
|
192
|
+
* const contentful = require('contentful-management')
|
|
193
|
+
*
|
|
194
|
+
* const client = contentful.createClient({
|
|
195
|
+
* accessToken: '<content_management_api_key>'
|
|
196
|
+
* })
|
|
197
|
+
*
|
|
198
|
+
* client.getSpace('<space_id>')
|
|
199
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
200
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
201
|
+
* .then((entry) => entry.unarchive())
|
|
202
|
+
* .then((entry) => console.log(`Entry ${entry.sys.id} unarchived.`))
|
|
203
|
+
* .catch(console.error)
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
unarchive: function unarchive() {
|
|
207
|
+
const { params } = getParams(this);
|
|
208
|
+
return makeRequest({
|
|
209
|
+
entityType: 'Entry',
|
|
210
|
+
action: 'unarchive',
|
|
211
|
+
params,
|
|
212
|
+
}).then((data) => wrapEntry(makeRequest, data));
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Gets all snapshots of an entry
|
|
216
|
+
* @example ```javascript
|
|
217
|
+
* const contentful = require('contentful-management')
|
|
218
|
+
*
|
|
219
|
+
* const client = contentful.createClient({
|
|
220
|
+
* accessToken: '<content_management_api_key>'
|
|
221
|
+
* })
|
|
222
|
+
*
|
|
223
|
+
* client.getSpace('<space_id>')
|
|
224
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
225
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
226
|
+
* .then((entry) => entry.getSnapshots())
|
|
227
|
+
* .then((snapshots) => console.log(snapshots.items))
|
|
228
|
+
* .catch(console.error)
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
getSnapshots: function (query = {}) {
|
|
232
|
+
const { params } = getParams(this);
|
|
233
|
+
return makeRequest({
|
|
234
|
+
entityType: 'Snapshot',
|
|
235
|
+
action: 'getManyForEntry',
|
|
236
|
+
params: Object.assign(Object.assign({}, params), { query }),
|
|
237
|
+
}).then((data) => wrapSnapshotCollection(makeRequest, data));
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* Gets a snapshot of an entry
|
|
241
|
+
* @param snapshotId - Id of the snapshot
|
|
242
|
+
* @example ```javascript
|
|
243
|
+
* const contentful = require('contentful-management')
|
|
244
|
+
*
|
|
245
|
+
* const client = contentful.createClient({
|
|
246
|
+
* accessToken: '<content_management_api_key>'
|
|
247
|
+
* })
|
|
248
|
+
*
|
|
249
|
+
* client.getSpace('<space_id>')
|
|
250
|
+
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
251
|
+
* .then((environment) => environment.getEntry('<entry_id>'))
|
|
252
|
+
* .then((entry) => entry.getSnapshot('<snapshot_id>'))
|
|
253
|
+
* .then((snapshot) => console.log(snapshot))
|
|
254
|
+
* .catch(console.error)
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
getSnapshot: function (snapshotId) {
|
|
258
|
+
const { params } = getParams(this);
|
|
259
|
+
return makeRequest({
|
|
260
|
+
entityType: 'Snapshot',
|
|
261
|
+
action: 'getForEntry',
|
|
262
|
+
params: Object.assign(Object.assign({}, params), { snapshotId }),
|
|
263
|
+
}).then((data) => wrapSnapshot(makeRequest, data));
|
|
264
|
+
},
|
|
265
|
+
/**
|
|
266
|
+
* Creates a new comment for an entry
|
|
267
|
+
* @param data Object representation of the Comment to be created
|
|
268
|
+
* @returns Promise for the newly created Comment
|
|
269
|
+
* @example ```javascript
|
|
270
|
+
* const contentful = require('contentful-management')
|
|
271
|
+
*
|
|
272
|
+
* const client = contentful.createClient({
|
|
273
|
+
* accessToken: '<content_management_api_key>'
|
|
274
|
+
* })
|
|
275
|
+
*
|
|
276
|
+
* client.getSpace('<space_id>')
|
|
277
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
278
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
279
|
+
* .then((entry) => entry.createComment({
|
|
280
|
+
* body: 'Something left to do'
|
|
281
|
+
* }))
|
|
282
|
+
* .then((comment) => console.log(comment))
|
|
283
|
+
* .catch(console.error)
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
createComment: function (data) {
|
|
287
|
+
const { params } = getParams(this);
|
|
288
|
+
return makeRequest({
|
|
289
|
+
entityType: 'Comment',
|
|
290
|
+
action: 'create',
|
|
291
|
+
params: {
|
|
292
|
+
spaceId: params.spaceId,
|
|
293
|
+
environmentId: params.environmentId,
|
|
294
|
+
parentEntityId: params.entryId,
|
|
295
|
+
parentEntityType: 'Entry',
|
|
296
|
+
},
|
|
297
|
+
payload: data,
|
|
298
|
+
}).then((data) => wrapComment(makeRequest, data));
|
|
299
|
+
},
|
|
300
|
+
/**
|
|
301
|
+
* Gets all comments of an entry
|
|
302
|
+
* @returns
|
|
303
|
+
* const contentful = require('contentful-management')
|
|
304
|
+
*
|
|
305
|
+
* const client = contentful.createClient({
|
|
306
|
+
* accessToken: '<content_management_api_key>'
|
|
307
|
+
* })
|
|
308
|
+
*
|
|
309
|
+
* client.getSpace('<space_id>')
|
|
310
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
311
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
312
|
+
* .then((entry) => entry.getComments())
|
|
313
|
+
* .then((comments) => console.log(comments))
|
|
314
|
+
* .catch(console.error)
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
getComments: function () {
|
|
318
|
+
const { params } = getParams(this);
|
|
319
|
+
return makeRequest({
|
|
320
|
+
entityType: 'Comment',
|
|
321
|
+
action: 'getMany',
|
|
322
|
+
params,
|
|
323
|
+
}).then((data) => wrapCommentCollection(makeRequest, data));
|
|
324
|
+
},
|
|
325
|
+
/**
|
|
326
|
+
* Gets a comment of an entry
|
|
327
|
+
* @returns
|
|
328
|
+
* const contentful = require('contentful-management')
|
|
329
|
+
*
|
|
330
|
+
* const client = contentful.createClient({
|
|
331
|
+
* accessToken: '<content_management_api_key>'
|
|
332
|
+
* })
|
|
333
|
+
*
|
|
334
|
+
* client.getSpace('<space_id>')
|
|
335
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
336
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
337
|
+
* .then((entry) => entry.getComment(`<comment-id>`))
|
|
338
|
+
* .then((comment) => console.log(comment))
|
|
339
|
+
* .catch(console.error)
|
|
340
|
+
* ```
|
|
341
|
+
*/
|
|
342
|
+
getComment: function (id) {
|
|
343
|
+
const { params } = getParams(this);
|
|
344
|
+
return makeRequest({
|
|
345
|
+
entityType: 'Comment',
|
|
346
|
+
action: 'get',
|
|
347
|
+
params: Object.assign(Object.assign({}, params), { commentId: id }),
|
|
348
|
+
}).then((data) => wrapComment(makeRequest, data));
|
|
349
|
+
},
|
|
350
|
+
/**
|
|
351
|
+
* Creates a new task for an entry
|
|
352
|
+
* @param data Object representation of the Task to be created
|
|
353
|
+
* @returns Promise for the newly created Task
|
|
354
|
+
* @example ```javascript
|
|
355
|
+
* const contentful = require('contentful-management')
|
|
356
|
+
*
|
|
357
|
+
* const client = contentful.createClient({
|
|
358
|
+
* accessToken: '<content_management_api_key>'
|
|
359
|
+
* })
|
|
360
|
+
*
|
|
361
|
+
* client.getSpace('<space_id>')
|
|
362
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
363
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
364
|
+
* .then((entry) => entry.createTask({
|
|
365
|
+
* body: 'Something left to do',
|
|
366
|
+
* assignedTo: '<user-id>',
|
|
367
|
+
* status: 'active'
|
|
368
|
+
* }))
|
|
369
|
+
* .then((task) => console.log(task))
|
|
370
|
+
* .catch(console.error)
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
createTask: function (data) {
|
|
374
|
+
const { params } = getParams(this);
|
|
375
|
+
return makeRequest({
|
|
376
|
+
entityType: 'Task',
|
|
377
|
+
action: 'create',
|
|
378
|
+
params,
|
|
379
|
+
payload: data,
|
|
380
|
+
}).then((data) => wrapTask(makeRequest, data));
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* Gets all tasks of an entry
|
|
384
|
+
* @returns
|
|
385
|
+
* const contentful = require('contentful-management')
|
|
386
|
+
*
|
|
387
|
+
* const client = contentful.createClient({
|
|
388
|
+
* accessToken: '<content_management_api_key>'
|
|
389
|
+
* })
|
|
390
|
+
*
|
|
391
|
+
* client.getSpace('<space_id>')
|
|
392
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
393
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
394
|
+
* .then((entry) => entry.getTasks())
|
|
395
|
+
* .then((tasks) => console.log(tasks))
|
|
396
|
+
* .catch(console.error)
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
getTasks: function (query = {}) {
|
|
400
|
+
const { params } = getParams(this);
|
|
401
|
+
return makeRequest({
|
|
402
|
+
entityType: 'Task',
|
|
403
|
+
action: 'getMany',
|
|
404
|
+
params: Object.assign(Object.assign({}, params), { query }),
|
|
405
|
+
}).then((data) => wrapTaskCollection(makeRequest, data));
|
|
406
|
+
},
|
|
407
|
+
/**
|
|
408
|
+
* Gets a task of an entry
|
|
409
|
+
* @returns
|
|
410
|
+
* const contentful = require('contentful-management')
|
|
411
|
+
*
|
|
412
|
+
* const client = contentful.createClient({
|
|
413
|
+
* accessToken: '<content_management_api_key>'
|
|
414
|
+
* })
|
|
415
|
+
*
|
|
416
|
+
* client.getSpace('<space_id>')
|
|
417
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
418
|
+
* .then((environment) => environment.getEntry('<entry-id>'))
|
|
419
|
+
* .then((entry) => entry.getTask(`<task-id>`))
|
|
420
|
+
* .then((task) => console.log(task))
|
|
421
|
+
* .catch(console.error)
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
getTask: function (id) {
|
|
425
|
+
const { params } = getParams(this);
|
|
426
|
+
return makeRequest({
|
|
427
|
+
entityType: 'Task',
|
|
428
|
+
action: 'get',
|
|
429
|
+
params: Object.assign(Object.assign({}, params), { taskId: id }),
|
|
430
|
+
}).then((data) => wrapTask(makeRequest, data));
|
|
431
|
+
},
|
|
432
|
+
/**
|
|
433
|
+
* Checks if the entry is published. A published entry might have unpublished changes
|
|
434
|
+
*/
|
|
435
|
+
isPublished: function isPublished$1() {
|
|
436
|
+
const raw = this.toPlainObject();
|
|
437
|
+
return isPublished(raw);
|
|
438
|
+
},
|
|
439
|
+
/**
|
|
440
|
+
* Checks if the entry is updated. This means the entry was previously published but has unpublished changes.
|
|
441
|
+
*/
|
|
442
|
+
isUpdated: function isUpdated$1() {
|
|
443
|
+
const raw = this.toPlainObject();
|
|
444
|
+
return isUpdated(raw);
|
|
445
|
+
},
|
|
446
|
+
/**
|
|
447
|
+
* Checks if the entry is in draft mode. This means it is not published.
|
|
448
|
+
*/
|
|
449
|
+
isDraft: function isDraft$1() {
|
|
450
|
+
const raw = this.toPlainObject();
|
|
451
|
+
return isDraft(raw);
|
|
452
|
+
},
|
|
453
|
+
/**
|
|
454
|
+
* Checks if entry is archived. This means it's not exposed to the Delivery/Preview APIs.
|
|
455
|
+
*/
|
|
456
|
+
isArchived: function isArchived$1() {
|
|
457
|
+
const raw = this.toPlainObject();
|
|
458
|
+
return isArchived(raw);
|
|
459
|
+
},
|
|
460
|
+
/**
|
|
461
|
+
* Recursively collects references of an entry and their descendants
|
|
462
|
+
*/
|
|
463
|
+
references: function references(options) {
|
|
464
|
+
const raw = this.toPlainObject();
|
|
465
|
+
return makeRequest({
|
|
466
|
+
entityType: 'Entry',
|
|
467
|
+
action: 'references',
|
|
468
|
+
params: {
|
|
469
|
+
spaceId: raw.sys.space.sys.id,
|
|
470
|
+
environmentId: raw.sys.environment.sys.id,
|
|
471
|
+
entryId: raw.sys.id,
|
|
472
|
+
include: options === null || options === void 0 ? void 0 : options.include,
|
|
473
|
+
},
|
|
474
|
+
}).then((response) => wrapEntryCollection(makeRequest, response));
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export { createEntryApi as default };
|