contentful-management 12.0.0-beta.11 → 12.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/{contentful-management.browser.js → contentful-management.bundle.browser.js} +4 -4
- package/dist/contentful-management.bundle.browser.js.map +1 -0
- package/dist/{contentful-management.browser.min.js → contentful-management.bundle.browser.min.js} +2 -2
- package/dist/contentful-management.bundle.browser.min.js.map +1 -0
- package/dist/{contentful-management.node.cjs → contentful-management.bundle.node.cjs} +4 -4
- package/dist/contentful-management.bundle.node.cjs.map +1 -0
- package/dist/esm/create-contentful-api.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plain/plain-client.js +1 -1
- package/dist/stats-browser-min.html +1 -1
- package/dist/types/adapters/REST/endpoints/access-token.js +1 -0
- package/dist/types/adapters/REST/endpoints/access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action-invocation.js +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action-invocation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action.js +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/api-key.js +1 -0
- package/dist/types/adapters/REST/endpoints/api-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-access-token.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-action-call.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-action-call.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-action.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-bundle.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-bundle.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-definition.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-definition.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-details.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-details.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-event-subscription.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-event-subscription.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-installation.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-installation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-key.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-signed-request.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-signed-request.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-signing-secret.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-signing-secret.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-upload.js +1 -0
- package/dist/types/adapters/REST/endpoints/app-upload.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/asset-key.js +1 -0
- package/dist/types/adapters/REST/endpoints/asset-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/asset.js +1 -0
- package/dist/types/adapters/REST/endpoints/asset.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/bulk-action.js +1 -0
- package/dist/types/adapters/REST/endpoints/bulk-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/comment.js +1 -0
- package/dist/types/adapters/REST/endpoints/comment.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/concept-scheme.js +1 -0
- package/dist/types/adapters/REST/endpoints/concept-scheme.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/concept.js +1 -0
- package/dist/types/adapters/REST/endpoints/concept.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/content-type.js +1 -0
- package/dist/types/adapters/REST/endpoints/content-type.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/editor-interface.js +1 -0
- package/dist/types/adapters/REST/endpoints/editor-interface.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/entry.js +1 -0
- package/dist/types/adapters/REST/endpoints/entry.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-alias.js +1 -0
- package/dist/types/adapters/REST/endpoints/environment-alias.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template.js +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment.js +1 -0
- package/dist/types/adapters/REST/endpoints/environment.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/extension.js +1 -0
- package/dist/types/adapters/REST/endpoints/extension.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/function-log.js +1 -0
- package/dist/types/adapters/REST/endpoints/function-log.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/function.js +1 -0
- package/dist/types/adapters/REST/endpoints/function.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/http.js +1 -0
- package/dist/types/adapters/REST/endpoints/http.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/index.js +1 -0
- package/dist/types/adapters/REST/endpoints/index.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/locale.js +1 -0
- package/dist/types/adapters/REST/endpoints/locale.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/oauth-application.js +1 -0
- package/dist/types/adapters/REST/endpoints/oauth-application.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization-invitation.js +1 -0
- package/dist/types/adapters/REST/endpoints/organization-invitation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization-membership.js +1 -0
- package/dist/types/adapters/REST/endpoints/organization-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization.js +1 -0
- package/dist/types/adapters/REST/endpoints/organization.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/personal-access-token.js +1 -0
- package/dist/types/adapters/REST/endpoints/personal-access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/preview-api-key.js +1 -0
- package/dist/types/adapters/REST/endpoints/preview-api-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/raw.js +1 -0
- package/dist/types/adapters/REST/endpoints/raw.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-action.js +1 -0
- package/dist/types/adapters/REST/endpoints/release-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-asset.js +1 -0
- package/dist/types/adapters/REST/endpoints/release-asset.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-entry.js +1 -0
- package/dist/types/adapters/REST/endpoints/release-entry.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release.js +1 -0
- package/dist/types/adapters/REST/endpoints/release.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource-provider.js +1 -0
- package/dist/types/adapters/REST/endpoints/resource-provider.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource-type.js +1 -0
- package/dist/types/adapters/REST/endpoints/resource-type.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource.js +1 -0
- package/dist/types/adapters/REST/endpoints/resource.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/role.js +1 -0
- package/dist/types/adapters/REST/endpoints/role.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/scheduled-action.js +1 -0
- package/dist/types/adapters/REST/endpoints/scheduled-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/snapshot.js +1 -0
- package/dist/types/adapters/REST/endpoints/snapshot.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space-member.js +1 -0
- package/dist/types/adapters/REST/endpoints/space-member.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space-membership.js +1 -0
- package/dist/types/adapters/REST/endpoints/space-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space.js +1 -0
- package/dist/types/adapters/REST/endpoints/space.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/tag.js +1 -0
- package/dist/types/adapters/REST/endpoints/tag.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/task.js +1 -0
- package/dist/types/adapters/REST/endpoints/task.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team-membership.js +1 -0
- package/dist/types/adapters/REST/endpoints/team-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team-space-membership.js +1 -0
- package/dist/types/adapters/REST/endpoints/team-space-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team.js +1 -0
- package/dist/types/adapters/REST/endpoints/team.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ui-config.js +1 -0
- package/dist/types/adapters/REST/endpoints/ui-config.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/upload-credentials.js +1 -0
- package/dist/types/adapters/REST/endpoints/upload-credentials.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/upload.js +1 -0
- package/dist/types/adapters/REST/endpoints/upload.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/usage.js +1 -0
- package/dist/types/adapters/REST/endpoints/usage.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/user-ui-config.js +1 -0
- package/dist/types/adapters/REST/endpoints/user-ui-config.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/user.js +1 -0
- package/dist/types/adapters/REST/endpoints/user.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/utils.js +1 -0
- package/dist/types/adapters/REST/endpoints/utils.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/webhook.js +1 -0
- package/dist/types/adapters/REST/endpoints/webhook.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflow-definition.js +1 -0
- package/dist/types/adapters/REST/endpoints/workflow-definition.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflow.js +1 -0
- package/dist/types/adapters/REST/endpoints/workflow.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflows-changelog.js +1 -0
- package/dist/types/adapters/REST/endpoints/workflows-changelog.js.map +1 -0
- package/dist/types/adapters/REST/make-request.js +1 -0
- package/dist/types/adapters/REST/make-request.js.map +1 -0
- package/dist/types/adapters/REST/rest-adapter.js +1 -0
- package/dist/types/adapters/REST/rest-adapter.js.map +1 -0
- package/dist/types/common-types.js +1 -0
- package/dist/types/common-types.js.map +1 -0
- package/dist/types/common-utils.js +1 -0
- package/dist/types/common-utils.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/controls-defaults.js +1 -0
- package/dist/types/constants/editor-interface-defaults/controls-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/editors-defaults.js +1 -0
- package/dist/types/constants/editor-interface-defaults/editors-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/index.js +1 -0
- package/dist/types/constants/editor-interface-defaults/index.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js +1 -0
- package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/types.js +1 -0
- package/dist/types/constants/editor-interface-defaults/types.js.map +1 -0
- package/dist/types/create-adapter.js +1 -0
- package/dist/types/create-adapter.js.map +1 -0
- package/dist/types/create-app-definition-api.js +1 -0
- package/dist/types/create-app-definition-api.js.map +1 -0
- package/dist/types/create-contentful-api.js +1 -0
- package/dist/types/create-contentful-api.js.map +1 -0
- package/dist/types/create-entry-api.js +1 -0
- package/dist/types/create-entry-api.js.map +1 -0
- package/dist/types/create-environment-api.js +1 -0
- package/dist/types/create-environment-api.js.map +1 -0
- package/dist/types/create-environment-template-api.js +1 -0
- package/dist/types/create-environment-template-api.js.map +1 -0
- package/dist/types/create-organization-api.js +1 -0
- package/dist/types/create-organization-api.js.map +1 -0
- package/dist/types/create-space-api.js +1 -0
- package/dist/types/create-space-api.js.map +1 -0
- package/dist/types/create-ui-config-api.js +1 -0
- package/dist/types/create-ui-config-api.js.map +1 -0
- package/dist/types/create-user-ui-config-api.js +1 -0
- package/dist/types/create-user-ui-config-api.js.map +1 -0
- package/dist/types/enhance-with-methods.js +1 -0
- package/dist/types/enhance-with-methods.js.map +1 -0
- package/dist/types/entities/access-token.js +1 -0
- package/dist/types/entities/access-token.js.map +1 -0
- package/dist/types/entities/ai-action-invocation.js +1 -0
- package/dist/types/entities/ai-action-invocation.js.map +1 -0
- package/dist/types/entities/ai-action.js +1 -0
- package/dist/types/entities/ai-action.js.map +1 -0
- package/dist/types/entities/api-key.js +1 -0
- package/dist/types/entities/api-key.js.map +1 -0
- package/dist/types/entities/app-access-token.js +1 -0
- package/dist/types/entities/app-access-token.js.map +1 -0
- package/dist/types/entities/app-action-call.js +1 -0
- package/dist/types/entities/app-action-call.js.map +1 -0
- package/dist/types/entities/app-action.js +1 -0
- package/dist/types/entities/app-action.js.map +1 -0
- package/dist/types/entities/app-bundle.js +1 -0
- package/dist/types/entities/app-bundle.js.map +1 -0
- package/dist/types/entities/app-definition.js +1 -0
- package/dist/types/entities/app-definition.js.map +1 -0
- package/dist/types/entities/app-details.js +1 -0
- package/dist/types/entities/app-details.js.map +1 -0
- package/dist/types/entities/app-event-subscription.js +1 -0
- package/dist/types/entities/app-event-subscription.js.map +1 -0
- package/dist/types/entities/app-installation.js +1 -0
- package/dist/types/entities/app-installation.js.map +1 -0
- package/dist/types/entities/app-key.js +1 -0
- package/dist/types/entities/app-key.js.map +1 -0
- package/dist/types/entities/app-signed-request.js +1 -0
- package/dist/types/entities/app-signed-request.js.map +1 -0
- package/dist/types/entities/app-signing-secret.js +1 -0
- package/dist/types/entities/app-signing-secret.js.map +1 -0
- package/dist/types/entities/app-upload.js +1 -0
- package/dist/types/entities/app-upload.js.map +1 -0
- package/dist/types/entities/asset-key.js +1 -0
- package/dist/types/entities/asset-key.js.map +1 -0
- package/dist/types/entities/asset.js +1 -0
- package/dist/types/entities/asset.js.map +1 -0
- package/dist/types/entities/bulk-action.js +1 -0
- package/dist/types/entities/bulk-action.js.map +1 -0
- package/dist/types/entities/comment.js +1 -0
- package/dist/types/entities/comment.js.map +1 -0
- package/dist/types/entities/content-type.js +1 -0
- package/dist/types/entities/content-type.js.map +1 -0
- package/dist/types/entities/editor-interface.js +1 -0
- package/dist/types/entities/editor-interface.js.map +1 -0
- package/dist/types/entities/entry.js +1 -0
- package/dist/types/entities/entry.js.map +1 -0
- package/dist/types/entities/environment-alias.js +1 -0
- package/dist/types/entities/environment-alias.js.map +1 -0
- package/dist/types/entities/environment-template-installation.js +1 -0
- package/dist/types/entities/environment-template-installation.js.map +1 -0
- package/dist/types/entities/environment-template.js +1 -0
- package/dist/types/entities/environment-template.js.map +1 -0
- package/dist/types/entities/environment.js +1 -0
- package/dist/types/entities/environment.js.map +1 -0
- package/dist/types/entities/extension.js +1 -0
- package/dist/types/entities/extension.js.map +1 -0
- package/dist/types/entities/function-log.js +1 -0
- package/dist/types/entities/function-log.js.map +1 -0
- package/dist/types/entities/function.js +1 -0
- package/dist/types/entities/function.js.map +1 -0
- package/dist/types/entities/locale.js +1 -0
- package/dist/types/entities/locale.js.map +1 -0
- package/dist/types/entities/oauth-application.js +1 -0
- package/dist/types/entities/oauth-application.js.map +1 -0
- package/dist/types/entities/organization-invitation.js +1 -0
- package/dist/types/entities/organization-invitation.js.map +1 -0
- package/dist/types/entities/organization-membership.js +1 -0
- package/dist/types/entities/organization-membership.js.map +1 -0
- package/dist/types/entities/organization.js +1 -0
- package/dist/types/entities/organization.js.map +1 -0
- package/dist/types/entities/personal-access-token.js +1 -0
- package/dist/types/entities/personal-access-token.js.map +1 -0
- package/dist/types/entities/preview-api-key.js +1 -0
- package/dist/types/entities/preview-api-key.js.map +1 -0
- package/dist/types/entities/release-action.js +1 -0
- package/dist/types/entities/release-action.js.map +1 -0
- package/dist/types/entities/release.js +1 -0
- package/dist/types/entities/release.js.map +1 -0
- package/dist/types/entities/resource-provider.js +1 -0
- package/dist/types/entities/resource-provider.js.map +1 -0
- package/dist/types/entities/resource-type.js +1 -0
- package/dist/types/entities/resource-type.js.map +1 -0
- package/dist/types/entities/resource.js +1 -0
- package/dist/types/entities/resource.js.map +1 -0
- package/dist/types/entities/role.js +1 -0
- package/dist/types/entities/role.js.map +1 -0
- package/dist/types/entities/scheduled-action.js +1 -0
- package/dist/types/entities/scheduled-action.js.map +1 -0
- package/dist/types/entities/snapshot.js +1 -0
- package/dist/types/entities/snapshot.js.map +1 -0
- package/dist/types/entities/space-member.js +1 -0
- package/dist/types/entities/space-member.js.map +1 -0
- package/dist/types/entities/space-membership.js +1 -0
- package/dist/types/entities/space-membership.js.map +1 -0
- package/dist/types/entities/space.js +1 -0
- package/dist/types/entities/space.js.map +1 -0
- package/dist/types/entities/tag.js +1 -0
- package/dist/types/entities/tag.js.map +1 -0
- package/dist/types/entities/task.js +1 -0
- package/dist/types/entities/task.js.map +1 -0
- package/dist/types/entities/team-membership.js +1 -0
- package/dist/types/entities/team-membership.js.map +1 -0
- package/dist/types/entities/team-space-membership.js +1 -0
- package/dist/types/entities/team-space-membership.js.map +1 -0
- package/dist/types/entities/team.js +1 -0
- package/dist/types/entities/team.js.map +1 -0
- package/dist/types/entities/ui-config.js +1 -0
- package/dist/types/entities/ui-config.js.map +1 -0
- package/dist/types/entities/upload.js +1 -0
- package/dist/types/entities/upload.js.map +1 -0
- package/dist/types/entities/usage.js +1 -0
- package/dist/types/entities/usage.js.map +1 -0
- package/dist/types/entities/user-ui-config.js +1 -0
- package/dist/types/entities/user-ui-config.js.map +1 -0
- package/dist/types/entities/user.js +1 -0
- package/dist/types/entities/user.js.map +1 -0
- package/dist/types/entities/webhook.js +1 -0
- package/dist/types/entities/webhook.js.map +1 -0
- package/dist/types/entities/workflow-definition.js +1 -0
- package/dist/types/entities/workflow-definition.js.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/methods/action.js +1 -0
- package/dist/types/methods/action.js.map +1 -0
- package/dist/types/methods/content-type.js +1 -0
- package/dist/types/methods/content-type.js.map +1 -0
- package/dist/types/methods/utils.js +1 -0
- package/dist/types/methods/utils.js.map +1 -0
- package/dist/types/plain/as-iterator.js +1 -0
- package/dist/types/plain/as-iterator.js.map +1 -0
- package/dist/types/plain/checks.js +1 -0
- package/dist/types/plain/checks.js.map +1 -0
- package/dist/types/plain/pagination-helper.js +1 -0
- package/dist/types/plain/pagination-helper.js.map +1 -0
- package/dist/types/plain/plain-client.js +1 -0
- package/dist/types/plain/plain-client.js.map +1 -0
- package/dist/types/plain/wrappers/wrap.js +1 -0
- package/dist/types/plain/wrappers/wrap.js.map +1 -0
- package/dist/types/upload-http-client.js +1 -0
- package/dist/types/upload-http-client.js.map +1 -0
- package/package.json +9 -12
- package/dist/cjs/adapters/REST/endpoints/access-token.cjs +0 -137
- package/dist/cjs/adapters/REST/endpoints/access-token.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs +0 -10
- package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/ai-action.cjs +0 -58
- package/dist/cjs/adapters/REST/endpoints/ai-action.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/api-key.cjs +0 -51
- package/dist/cjs/adapters/REST/endpoints/api-key.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs +0 -10
- package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs +0 -119
- package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-action.cjs +0 -43
- package/dist/cjs/adapters/REST/endpoints/app-action.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs +0 -40
- package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-definition.cjs +0 -53
- package/dist/cjs/adapters/REST/endpoints/app-definition.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-details.cjs +0 -18
- package/dist/cjs/adapters/REST/endpoints/app-details.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs +0 -18
- package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-installation.cjs +0 -49
- package/dist/cjs/adapters/REST/endpoints/app-installation.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-key.cjs +0 -22
- package/dist/cjs/adapters/REST/endpoints/app-key.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs +0 -10
- package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs +0 -18
- package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/app-upload.cjs +0 -29
- package/dist/cjs/adapters/REST/endpoints/app-upload.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/asset-key.cjs +0 -35
- package/dist/cjs/adapters/REST/endpoints/asset-key.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/asset.cjs +0 -223
- package/dist/cjs/adapters/REST/endpoints/asset.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs +0 -22
- package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/comment.cjs +0 -98
- package/dist/cjs/adapters/REST/endpoints/comment.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs +0 -55
- package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/concept.cjs +0 -73
- package/dist/cjs/adapters/REST/endpoints/concept.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/content-type.cjs +0 -62
- package/dist/cjs/adapters/REST/endpoints/content-type.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs +0 -27
- package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/entry.cjs +0 -128
- package/dist/cjs/adapters/REST/endpoints/entry.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs +0 -47
- package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs +0 -24
- package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/environment-template.cjs +0 -52
- package/dist/cjs/adapters/REST/endpoints/environment-template.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/environment.cjs +0 -53
- package/dist/cjs/adapters/REST/endpoints/environment.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/extension.cjs +0 -47
- package/dist/cjs/adapters/REST/endpoints/extension.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/function-log.cjs +0 -28
- package/dist/cjs/adapters/REST/endpoints/function-log.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/function.cjs +0 -26
- package/dist/cjs/adapters/REST/endpoints/function.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/http.cjs +0 -30
- package/dist/cjs/adapters/REST/endpoints/http.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/index.cjs +0 -144
- package/dist/cjs/adapters/REST/endpoints/index.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/locale.cjs +0 -40
- package/dist/cjs/adapters/REST/endpoints/locale.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs +0 -148
- package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs +0 -30
- package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs +0 -35
- package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/organization.cjs +0 -29
- package/dist/cjs/adapters/REST/endpoints/organization.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs +0 -38
- package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs +0 -16
- package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/raw.cjs +0 -62
- package/dist/cjs/adapters/REST/endpoints/raw.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/release-action.cjs +0 -25
- package/dist/cjs/adapters/REST/endpoints/release-action.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/release-asset.cjs +0 -152
- package/dist/cjs/adapters/REST/endpoints/release-asset.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/release-entry.cjs +0 -63
- package/dist/cjs/adapters/REST/endpoints/release-entry.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/release.cjs +0 -84
- package/dist/cjs/adapters/REST/endpoints/release.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs +0 -19
- package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/resource-type.cjs +0 -31
- package/dist/cjs/adapters/REST/endpoints/resource-type.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/resource.cjs +0 -11
- package/dist/cjs/adapters/REST/endpoints/resource.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/role.cjs +0 -51
- package/dist/cjs/adapters/REST/endpoints/role.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs +0 -44
- package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/snapshot.cjs +0 -31
- package/dist/cjs/adapters/REST/endpoints/snapshot.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/space-member.cjs +0 -12
- package/dist/cjs/adapters/REST/endpoints/space-member.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/space-membership.cjs +0 -63
- package/dist/cjs/adapters/REST/endpoints/space-membership.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/space.cjs +0 -38
- package/dist/cjs/adapters/REST/endpoints/space.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/tag.cjs +0 -37
- package/dist/cjs/adapters/REST/endpoints/tag.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/task.cjs +0 -41
- package/dist/cjs/adapters/REST/endpoints/task.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/team-membership.cjs +0 -39
- package/dist/cjs/adapters/REST/endpoints/team-membership.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs +0 -54
- package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/team.cjs +0 -39
- package/dist/cjs/adapters/REST/endpoints/team.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/ui-config.cjs +0 -22
- package/dist/cjs/adapters/REST/endpoints/ui-config.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs +0 -16
- package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/upload.cjs +0 -43
- package/dist/cjs/adapters/REST/endpoints/upload.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/usage.cjs +0 -18
- package/dist/cjs/adapters/REST/endpoints/usage.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs +0 -22
- package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/user.cjs +0 -28
- package/dist/cjs/adapters/REST/endpoints/user.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/utils.cjs +0 -25
- package/dist/cjs/adapters/REST/endpoints/utils.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/webhook.cjs +0 -101
- package/dist/cjs/adapters/REST/endpoints/webhook.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs +0 -42
- package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/workflow.cjs +0 -49
- package/dist/cjs/adapters/REST/endpoints/workflow.cjs.map +0 -1
- package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs +0 -12
- package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs.map +0 -1
- package/dist/cjs/adapters/REST/make-request.cjs +0 -23
- package/dist/cjs/adapters/REST/make-request.cjs.map +0 -1
- package/dist/cjs/adapters/REST/rest-adapter.cjs +0 -44
- package/dist/cjs/adapters/REST/rest-adapter.cjs.map +0 -1
- package/dist/cjs/common-types.cjs +0 -7
- package/dist/cjs/common-types.cjs.map +0 -1
- package/dist/cjs/common-utils.cjs +0 -39
- package/dist/cjs/common-utils.cjs.map +0 -1
- package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs +0 -168
- package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs.map +0 -1
- package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs +0 -35
- package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs.map +0 -1
- package/dist/cjs/constants/editor-interface-defaults/index.cjs +0 -15
- package/dist/cjs/constants/editor-interface-defaults/index.cjs.map +0 -1
- package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs +0 -68
- package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs.map +0 -1
- package/dist/cjs/constants/editor-interface-defaults/types.cjs +0 -19
- package/dist/cjs/constants/editor-interface-defaults/types.cjs.map +0 -1
- package/dist/cjs/create-adapter.cjs +0 -22
- package/dist/cjs/create-adapter.cjs.map +0 -1
- package/dist/cjs/create-app-definition-api.cjs +0 -254
- package/dist/cjs/create-app-definition-api.cjs.map +0 -1
- package/dist/cjs/create-contentful-api.cjs +0 -590
- package/dist/cjs/create-contentful-api.cjs.map +0 -1
- package/dist/cjs/create-entry-api.cjs +0 -490
- package/dist/cjs/create-entry-api.cjs.map +0 -1
- package/dist/cjs/create-environment-api.cjs +0 -2442
- package/dist/cjs/create-environment-api.cjs.map +0 -1
- package/dist/cjs/create-environment-template-api.cjs +0 -271
- package/dist/cjs/create-environment-template-api.cjs.map +0 -1
- package/dist/cjs/create-organization-api.cjs +0 -1139
- package/dist/cjs/create-organization-api.cjs.map +0 -1
- package/dist/cjs/create-space-api.cjs +0 -1590
- package/dist/cjs/create-space-api.cjs.map +0 -1
- package/dist/cjs/create-ui-config-api.cjs +0 -55
- package/dist/cjs/create-ui-config-api.cjs.map +0 -1
- package/dist/cjs/create-user-ui-config-api.cjs +0 -55
- package/dist/cjs/create-user-ui-config-api.cjs.map +0 -1
- package/dist/cjs/enhance-with-methods.cjs +0 -27
- package/dist/cjs/enhance-with-methods.cjs.map +0 -1
- package/dist/cjs/entities/access-token.cjs +0 -37
- package/dist/cjs/entities/access-token.cjs.map +0 -1
- package/dist/cjs/entities/ai-action-invocation.cjs +0 -19
- package/dist/cjs/entities/ai-action-invocation.cjs.map +0 -1
- package/dist/cjs/entities/ai-action.cjs +0 -76
- package/dist/cjs/entities/ai-action.cjs.map +0 -1
- package/dist/cjs/entities/api-key.cjs +0 -57
- package/dist/cjs/entities/api-key.cjs.map +0 -1
- package/dist/cjs/entities/app-access-token.cjs +0 -18
- package/dist/cjs/entities/app-access-token.cjs.map +0 -1
- package/dist/cjs/entities/app-action-call.cjs +0 -69
- package/dist/cjs/entities/app-action-call.cjs.map +0 -1
- package/dist/cjs/entities/app-action.cjs +0 -49
- package/dist/cjs/entities/app-action.cjs.map +0 -1
- package/dist/cjs/entities/app-bundle.cjs +0 -49
- package/dist/cjs/entities/app-bundle.cjs.map +0 -1
- package/dist/cjs/entities/app-definition.cjs +0 -30
- package/dist/cjs/entities/app-definition.cjs.map +0 -1
- package/dist/cjs/entities/app-details.cjs +0 -40
- package/dist/cjs/entities/app-details.cjs.map +0 -1
- package/dist/cjs/entities/app-event-subscription.cjs +0 -35
- package/dist/cjs/entities/app-event-subscription.cjs.map +0 -1
- package/dist/cjs/entities/app-installation.cjs +0 -56
- package/dist/cjs/entities/app-installation.cjs.map +0 -1
- package/dist/cjs/entities/app-key.cjs +0 -45
- package/dist/cjs/entities/app-key.cjs.map +0 -1
- package/dist/cjs/entities/app-signed-request.cjs +0 -18
- package/dist/cjs/entities/app-signed-request.cjs.map +0 -1
- package/dist/cjs/entities/app-signing-secret.cjs +0 -35
- package/dist/cjs/entities/app-signing-secret.cjs.map +0 -1
- package/dist/cjs/entities/app-upload.cjs +0 -39
- package/dist/cjs/entities/app-upload.cjs.map +0 -1
- package/dist/cjs/entities/asset-key.cjs +0 -18
- package/dist/cjs/entities/asset-key.cjs.map +0 -1
- package/dist/cjs/entities/asset.cjs +0 -133
- package/dist/cjs/entities/asset.cjs.map +0 -1
- package/dist/cjs/entities/bulk-action.cjs +0 -61
- package/dist/cjs/entities/bulk-action.cjs.map +0 -1
- package/dist/cjs/entities/comment.cjs +0 -64
- package/dist/cjs/entities/comment.cjs.map +0 -1
- package/dist/cjs/entities/content-type.cjs +0 -121
- package/dist/cjs/entities/content-type.cjs.map +0 -1
- package/dist/cjs/entities/editor-interface.cjs +0 -51
- package/dist/cjs/entities/editor-interface.cjs.map +0 -1
- package/dist/cjs/entities/entry.cjs +0 -28
- package/dist/cjs/entities/entry.cjs.map +0 -1
- package/dist/cjs/entities/environment-alias.cjs +0 -59
- package/dist/cjs/entities/environment-alias.cjs.map +0 -1
- package/dist/cjs/entities/environment-template-installation.cjs +0 -24
- package/dist/cjs/entities/environment-template-installation.cjs.map +0 -1
- package/dist/cjs/entities/environment-template.cjs +0 -19
- package/dist/cjs/entities/environment-template.cjs.map +0 -1
- package/dist/cjs/entities/environment.cjs +0 -35
- package/dist/cjs/entities/environment.cjs.map +0 -1
- package/dist/cjs/entities/extension.cjs +0 -55
- package/dist/cjs/entities/extension.cjs.map +0 -1
- package/dist/cjs/entities/function-log.cjs +0 -27
- package/dist/cjs/entities/function-log.cjs.map +0 -1
- package/dist/cjs/entities/function.cjs +0 -67
- package/dist/cjs/entities/function.cjs.map +0 -1
- package/dist/cjs/entities/locale.cjs +0 -58
- package/dist/cjs/entities/locale.cjs.map +0 -1
- package/dist/cjs/entities/oauth-application.cjs +0 -67
- package/dist/cjs/entities/oauth-application.cjs.map +0 -1
- package/dist/cjs/entities/organization-invitation.cjs +0 -18
- package/dist/cjs/entities/organization-invitation.cjs.map +0 -1
- package/dist/cjs/entities/organization-membership.cjs +0 -54
- package/dist/cjs/entities/organization-membership.cjs.map +0 -1
- package/dist/cjs/entities/organization.cjs +0 -33
- package/dist/cjs/entities/organization.cjs.map +0 -1
- package/dist/cjs/entities/personal-access-token.cjs +0 -37
- package/dist/cjs/entities/personal-access-token.cjs.map +0 -1
- package/dist/cjs/entities/preview-api-key.cjs +0 -32
- package/dist/cjs/entities/preview-api-key.cjs.map +0 -1
- package/dist/cjs/entities/release-action.cjs +0 -56
- package/dist/cjs/entities/release-action.cjs.map +0 -1
- package/dist/cjs/entities/release.cjs +0 -110
- package/dist/cjs/entities/release.cjs.map +0 -1
- package/dist/cjs/entities/resource-provider.cjs +0 -139
- package/dist/cjs/entities/resource-provider.cjs.map +0 -1
- package/dist/cjs/entities/resource-type.cjs +0 -99
- package/dist/cjs/entities/resource-type.cjs.map +0 -1
- package/dist/cjs/entities/resource.cjs +0 -14
- package/dist/cjs/entities/resource.cjs.map +0 -1
- package/dist/cjs/entities/role.cjs +0 -54
- package/dist/cjs/entities/role.cjs.map +0 -1
- package/dist/cjs/entities/scheduled-action.cjs +0 -151
- package/dist/cjs/entities/scheduled-action.cjs.map +0 -1
- package/dist/cjs/entities/snapshot.cjs +0 -37
- package/dist/cjs/entities/snapshot.cjs.map +0 -1
- package/dist/cjs/entities/space-member.cjs +0 -24
- package/dist/cjs/entities/space-member.cjs.map +0 -1
- package/dist/cjs/entities/space-membership.cjs +0 -54
- package/dist/cjs/entities/space-membership.cjs.map +0 -1
- package/dist/cjs/entities/space.cjs +0 -34
- package/dist/cjs/entities/space.cjs.map +0 -1
- package/dist/cjs/entities/tag.cjs +0 -57
- package/dist/cjs/entities/tag.cjs.map +0 -1
- package/dist/cjs/entities/task.cjs +0 -58
- package/dist/cjs/entities/task.cjs.map +0 -1
- package/dist/cjs/entities/team-membership.cjs +0 -55
- package/dist/cjs/entities/team-membership.cjs.map +0 -1
- package/dist/cjs/entities/team-space-membership.cjs +0 -54
- package/dist/cjs/entities/team-space-membership.cjs.map +0 -1
- package/dist/cjs/entities/team.cjs +0 -54
- package/dist/cjs/entities/team.cjs.map +0 -1
- package/dist/cjs/entities/ui-config.cjs +0 -21
- package/dist/cjs/entities/ui-config.cjs.map +0 -1
- package/dist/cjs/entities/upload.cjs +0 -39
- package/dist/cjs/entities/upload.cjs.map +0 -1
- package/dist/cjs/entities/usage.cjs +0 -26
- package/dist/cjs/entities/usage.cjs.map +0 -1
- package/dist/cjs/entities/user-ui-config.cjs +0 -21
- package/dist/cjs/entities/user-ui-config.cjs.map +0 -1
- package/dist/cjs/entities/user.cjs +0 -29
- package/dist/cjs/entities/user.cjs.map +0 -1
- package/dist/cjs/entities/webhook.cjs +0 -78
- package/dist/cjs/entities/webhook.cjs.map +0 -1
- package/dist/cjs/entities/workflow-definition.cjs +0 -29
- package/dist/cjs/entities/workflow-definition.cjs.map +0 -1
- package/dist/cjs/index.cjs +0 -66
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/methods/action.cjs +0 -53
- package/dist/cjs/methods/action.cjs.map +0 -1
- package/dist/cjs/methods/content-type.cjs +0 -49
- package/dist/cjs/methods/content-type.cjs.map +0 -1
- package/dist/cjs/methods/utils.cjs +0 -12
- package/dist/cjs/methods/utils.cjs.map +0 -1
- package/dist/cjs/plain/as-iterator.cjs +0 -39
- package/dist/cjs/plain/as-iterator.cjs.map +0 -1
- package/dist/cjs/plain/checks.cjs +0 -16
- package/dist/cjs/plain/checks.cjs.map +0 -1
- package/dist/cjs/plain/pagination-helper.cjs +0 -70
- package/dist/cjs/plain/pagination-helper.cjs.map +0 -1
- package/dist/cjs/plain/plain-client.cjs +0 -561
- package/dist/cjs/plain/plain-client.cjs.map +0 -1
- package/dist/cjs/plain/wrappers/wrap.cjs +0 -27
- package/dist/cjs/plain/wrappers/wrap.cjs.map +0 -1
- package/dist/cjs/upload-http-client.cjs +0 -17
- package/dist/cjs/upload-http-client.cjs.map +0 -1
- package/dist/contentful-management.browser.js.map +0 -1
- package/dist/contentful-management.browser.min.js.map +0 -1
- package/dist/contentful-management.node.cjs.map +0 -1
- package/dist/contentful-management.react-native.js +0 -22285
- package/dist/contentful-management.react-native.js.map +0 -1
|
@@ -1,1590 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var contentfulSdkCore = require('contentful-sdk-core');
|
|
4
|
-
var apiKey = require('./entities/api-key.cjs');
|
|
5
|
-
var environment = require('./entities/environment.cjs');
|
|
6
|
-
var environmentAlias = require('./entities/environment-alias.cjs');
|
|
7
|
-
var role = require('./entities/role.cjs');
|
|
8
|
-
var scheduledAction = require('./entities/scheduled-action.cjs');
|
|
9
|
-
var space = require('./entities/space.cjs');
|
|
10
|
-
var spaceMembership = require('./entities/space-membership.cjs');
|
|
11
|
-
var teamSpaceMembership = require('./entities/team-space-membership.cjs');
|
|
12
|
-
var webhook = require('./entities/webhook.cjs');
|
|
13
|
-
var aiAction = require('./entities/ai-action.cjs');
|
|
14
|
-
var previewApiKey = require('./entities/preview-api-key.cjs');
|
|
15
|
-
var spaceMember = require('./entities/space-member.cjs');
|
|
16
|
-
var team = require('./entities/team.cjs');
|
|
17
|
-
var user = require('./entities/user.cjs');
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Contentful Space API. Contains methods to access any operations at a space
|
|
21
|
-
* level, such as creating and reading entities contained in a space.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Creates API object with methods to access the Space API
|
|
25
|
-
* @param {MakeRequest} makeRequest - function to make requests via an adapter
|
|
26
|
-
* @return {ContentfulSpaceAPI}
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
function createSpaceApi(makeRequest) {
|
|
30
|
-
return {
|
|
31
|
-
/**
|
|
32
|
-
* Deletes the space
|
|
33
|
-
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
34
|
-
* @example ```javascript
|
|
35
|
-
* const contentful = require('contentful-management')
|
|
36
|
-
*
|
|
37
|
-
* const client = contentful.createClient({
|
|
38
|
-
* accessToken: '<content_management_api_key>'
|
|
39
|
-
* })
|
|
40
|
-
*
|
|
41
|
-
* client.getSpace('<space_id>')
|
|
42
|
-
* .then((space) => space.delete())
|
|
43
|
-
* .then(() => console.log('Space deleted.'))
|
|
44
|
-
* .catch(console.error)
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
delete: function deleteSpace() {
|
|
48
|
-
const raw = this.toPlainObject();
|
|
49
|
-
return makeRequest({
|
|
50
|
-
entityType: 'Space',
|
|
51
|
-
action: 'delete',
|
|
52
|
-
params: { spaceId: raw.sys.id },
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Updates the space
|
|
57
|
-
* @return Promise for the updated space.
|
|
58
|
-
* @example ```javascript
|
|
59
|
-
* const contentful = require('contentful-management')
|
|
60
|
-
*
|
|
61
|
-
* const client = contentful.createClient({
|
|
62
|
-
* accessToken: '<content_management_api_key>'
|
|
63
|
-
* })
|
|
64
|
-
*
|
|
65
|
-
* client.getSpace('<space_id>')
|
|
66
|
-
* .then((space) => {
|
|
67
|
-
* space.name = 'New name'
|
|
68
|
-
* return space.update()
|
|
69
|
-
* })
|
|
70
|
-
* .then((space) => console.log(`Space ${space.sys.id} renamed.`)
|
|
71
|
-
* .catch(console.error)
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
update: function updateSpace() {
|
|
75
|
-
const raw = this.toPlainObject();
|
|
76
|
-
return makeRequest({
|
|
77
|
-
entityType: 'Space',
|
|
78
|
-
action: 'update',
|
|
79
|
-
params: { spaceId: raw.sys.id },
|
|
80
|
-
payload: raw,
|
|
81
|
-
headers: {},
|
|
82
|
-
}).then((data) => space.wrapSpace(makeRequest, data));
|
|
83
|
-
},
|
|
84
|
-
/**
|
|
85
|
-
* Gets an environment
|
|
86
|
-
* @param id - Environment ID
|
|
87
|
-
* @return Promise for an Environment
|
|
88
|
-
* @example ```javascript
|
|
89
|
-
* const contentful = require('contentful-management')
|
|
90
|
-
*
|
|
91
|
-
* const client = contentful.createClient({
|
|
92
|
-
* accessToken: '<content_management_api_key>'
|
|
93
|
-
* })
|
|
94
|
-
*
|
|
95
|
-
* client.getSpace('<space_id>')
|
|
96
|
-
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
97
|
-
* .then((environment) => console.log(environment))
|
|
98
|
-
* .catch(console.error)
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
getEnvironment(environmentId) {
|
|
102
|
-
const raw = this.toPlainObject();
|
|
103
|
-
return makeRequest({
|
|
104
|
-
entityType: 'Environment',
|
|
105
|
-
action: 'get',
|
|
106
|
-
params: { spaceId: raw.sys.id, environmentId },
|
|
107
|
-
}).then((data) => environment.wrapEnvironment(makeRequest, data));
|
|
108
|
-
},
|
|
109
|
-
/**
|
|
110
|
-
* Gets a collection of Environments
|
|
111
|
-
* @return Promise for a collection of Environment
|
|
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.getEnvironments())
|
|
121
|
-
* .then((response) => console.log(response.items))
|
|
122
|
-
* .catch(console.error)
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
getEnvironments(query = {}) {
|
|
126
|
-
const raw = this.toPlainObject();
|
|
127
|
-
return makeRequest({
|
|
128
|
-
entityType: 'Environment',
|
|
129
|
-
action: 'getMany',
|
|
130
|
-
params: { spaceId: raw.sys.id, query },
|
|
131
|
-
}).then((data) => environment.wrapEnvironmentCollection(makeRequest, data));
|
|
132
|
-
},
|
|
133
|
-
/**
|
|
134
|
-
* Creates an environment
|
|
135
|
-
* @param data - Object representation of the Environment to be created
|
|
136
|
-
* @return Promise for the newly created Environment
|
|
137
|
-
* @example ```javascript
|
|
138
|
-
* const contentful = require('contentful-management')
|
|
139
|
-
*
|
|
140
|
-
* const client = contentful.createClient({
|
|
141
|
-
* accessToken: '<content_management_api_key>'
|
|
142
|
-
* })
|
|
143
|
-
*
|
|
144
|
-
* client.getSpace('<space_id>')
|
|
145
|
-
* .then((space) => space.createEnvironment({ name: 'Staging' }))
|
|
146
|
-
* .then((environment) => console.log(environment))
|
|
147
|
-
* .catch(console.error)
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
createEnvironment(data = {}) {
|
|
151
|
-
const raw = this.toPlainObject();
|
|
152
|
-
return makeRequest({
|
|
153
|
-
entityType: 'Environment',
|
|
154
|
-
action: 'create',
|
|
155
|
-
params: {
|
|
156
|
-
spaceId: raw.sys.id,
|
|
157
|
-
},
|
|
158
|
-
payload: data,
|
|
159
|
-
}).then((response) => environment.wrapEnvironment(makeRequest, response));
|
|
160
|
-
},
|
|
161
|
-
/**
|
|
162
|
-
* Creates an Environment with a custom ID
|
|
163
|
-
* @param id - Environment ID
|
|
164
|
-
* @param data - Object representation of the Environment to be created
|
|
165
|
-
* @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master"
|
|
166
|
-
* @return Promise for the newly created Environment
|
|
167
|
-
* @example ```javascript
|
|
168
|
-
* const contentful = require('contentful-management')
|
|
169
|
-
*
|
|
170
|
-
* const client = contentful.createClient({
|
|
171
|
-
* accessToken: '<content_management_api_key>'
|
|
172
|
-
* })
|
|
173
|
-
*
|
|
174
|
-
* client.getSpace('<space_id>')
|
|
175
|
-
* .then((space) => space.createEnvironmentWithId('<environment-id>', { name: 'Staging'}, 'master'))
|
|
176
|
-
* .then((environment) => console.log(environment))
|
|
177
|
-
* .catch(console.error)
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
createEnvironmentWithId(id, data, sourceEnvironmentId) {
|
|
181
|
-
const raw = this.toPlainObject();
|
|
182
|
-
return makeRequest({
|
|
183
|
-
entityType: 'Environment',
|
|
184
|
-
action: 'createWithId',
|
|
185
|
-
params: {
|
|
186
|
-
spaceId: raw.sys.id,
|
|
187
|
-
environmentId: id,
|
|
188
|
-
sourceEnvironmentId,
|
|
189
|
-
},
|
|
190
|
-
payload: data,
|
|
191
|
-
}).then((response) => environment.wrapEnvironment(makeRequest, response));
|
|
192
|
-
},
|
|
193
|
-
/**
|
|
194
|
-
* Gets a Webhook
|
|
195
|
-
* @param id - Webhook ID
|
|
196
|
-
* @return Promise for a Webhook
|
|
197
|
-
* @example ```javascript
|
|
198
|
-
* const contentful = require('contentful-management')
|
|
199
|
-
*
|
|
200
|
-
* const client = contentful.createClient({
|
|
201
|
-
* accessToken: '<content_management_api_key>'
|
|
202
|
-
* })
|
|
203
|
-
*
|
|
204
|
-
* client.getSpace('<space_id>')
|
|
205
|
-
* .then((space) => space.getWebhook('<webhook_id>'))
|
|
206
|
-
* .then((webhook) => console.log(webhook))
|
|
207
|
-
* .catch(console.error)
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
getWebhook(id) {
|
|
211
|
-
const raw = this.toPlainObject();
|
|
212
|
-
return makeRequest({
|
|
213
|
-
entityType: 'Webhook',
|
|
214
|
-
action: 'get',
|
|
215
|
-
params: { spaceId: raw.sys.id, webhookDefinitionId: id },
|
|
216
|
-
}).then((data) => webhook.wrapWebhook(makeRequest, data));
|
|
217
|
-
},
|
|
218
|
-
/**
|
|
219
|
-
* Gets a collection of Webhooks
|
|
220
|
-
* @return Promise for a collection of Webhooks
|
|
221
|
-
* @example ```javascript
|
|
222
|
-
* const contentful = require('contentful-management')
|
|
223
|
-
*
|
|
224
|
-
* const client = contentful.createClient({
|
|
225
|
-
* accessToken: '<content_management_api_key>'
|
|
226
|
-
* })
|
|
227
|
-
*
|
|
228
|
-
* client.getSpace('<space_id>')
|
|
229
|
-
* .then((space) => space.getWebhooks())
|
|
230
|
-
* .then((response) => console.log(response.items))
|
|
231
|
-
* .catch(console.error)
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
getWebhooks() {
|
|
235
|
-
const raw = this.toPlainObject();
|
|
236
|
-
return makeRequest({
|
|
237
|
-
entityType: 'Webhook',
|
|
238
|
-
action: 'getMany',
|
|
239
|
-
params: { spaceId: raw.sys.id },
|
|
240
|
-
}).then((data) => webhook.wrapWebhookCollection(makeRequest, data));
|
|
241
|
-
},
|
|
242
|
-
/**
|
|
243
|
-
* Fetch a webhook signing secret
|
|
244
|
-
* @returns Promise for the redacted webhook signing secret in this space
|
|
245
|
-
* @example ```javascript
|
|
246
|
-
* const contentful = require('contentful-management')
|
|
247
|
-
*
|
|
248
|
-
* const client = contentful.createClient({
|
|
249
|
-
* accessToken: '<content_management_api_key>'
|
|
250
|
-
* })
|
|
251
|
-
*
|
|
252
|
-
* client.getSpace('<space_id>')
|
|
253
|
-
* .then((space) => space.getWebhookSigningSecret())
|
|
254
|
-
* .then((response) => console.log(response.redactedValue))
|
|
255
|
-
* .catch(console.error)
|
|
256
|
-
* ```
|
|
257
|
-
*/
|
|
258
|
-
getWebhookSigningSecret: function getSigningSecret() {
|
|
259
|
-
const raw = this.toPlainObject();
|
|
260
|
-
return makeRequest({
|
|
261
|
-
entityType: 'Webhook',
|
|
262
|
-
action: 'getSigningSecret',
|
|
263
|
-
params: { spaceId: raw.sys.id },
|
|
264
|
-
});
|
|
265
|
-
},
|
|
266
|
-
/**
|
|
267
|
-
* Fetch a webhook retry policy
|
|
268
|
-
* @returns Promise for the redacted webhook retry policy in this space
|
|
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.getRetryPolicy())
|
|
278
|
-
* .then((response) => console.log(response.redactedValue))
|
|
279
|
-
* .catch(console.error)
|
|
280
|
-
* ```
|
|
281
|
-
*/
|
|
282
|
-
getWebhookRetryPolicy: function getWebhookRetryPolicy() {
|
|
283
|
-
const raw = this.toPlainObject();
|
|
284
|
-
return makeRequest({
|
|
285
|
-
entityType: 'Webhook',
|
|
286
|
-
action: 'getRetryPolicy',
|
|
287
|
-
params: { spaceId: raw.sys.id },
|
|
288
|
-
});
|
|
289
|
-
},
|
|
290
|
-
/**
|
|
291
|
-
* Creates a Webhook
|
|
292
|
-
* @param data - Object representation of the Webhook to be created
|
|
293
|
-
* @return Promise for the newly created Webhook
|
|
294
|
-
* @example ```javascript
|
|
295
|
-
* const contentful = require('contentful-management')
|
|
296
|
-
*
|
|
297
|
-
* client.getSpace('<space_id>')
|
|
298
|
-
* .then((space) => space.createWebhook({
|
|
299
|
-
* 'name': 'My webhook',
|
|
300
|
-
* 'url': 'https://www.example.com/test',
|
|
301
|
-
* 'topics': [
|
|
302
|
-
* 'Entry.create',
|
|
303
|
-
* 'ContentType.create',
|
|
304
|
-
* '*.publish',
|
|
305
|
-
* 'Asset.*'
|
|
306
|
-
* ]
|
|
307
|
-
* }))
|
|
308
|
-
* .then((webhook) => console.log(webhook))
|
|
309
|
-
* .catch(console.error)
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
createWebhook(data) {
|
|
313
|
-
const raw = this.toPlainObject();
|
|
314
|
-
return makeRequest({
|
|
315
|
-
entityType: 'Webhook',
|
|
316
|
-
action: 'create',
|
|
317
|
-
params: { spaceId: raw.sys.id },
|
|
318
|
-
payload: data,
|
|
319
|
-
}).then((data) => webhook.wrapWebhook(makeRequest, data));
|
|
320
|
-
},
|
|
321
|
-
/**
|
|
322
|
-
* Creates a Webhook with a custom ID
|
|
323
|
-
* @param id - Webhook ID
|
|
324
|
-
* @param data - Object representation of the Webhook to be created
|
|
325
|
-
* @return Promise for the newly created Webhook
|
|
326
|
-
* @example ```javascript
|
|
327
|
-
* const contentful = require('contentful-management')
|
|
328
|
-
*
|
|
329
|
-
* client.getSpace('<space_id>')
|
|
330
|
-
* .then((space) => space.createWebhookWithId('<webhook_id>', {
|
|
331
|
-
* 'name': 'My webhook',
|
|
332
|
-
* 'url': 'https://www.example.com/test',
|
|
333
|
-
* 'topics': [
|
|
334
|
-
* 'Entry.create',
|
|
335
|
-
* 'ContentType.create',
|
|
336
|
-
* '*.publish',
|
|
337
|
-
* 'Asset.*'
|
|
338
|
-
* ]
|
|
339
|
-
* }))
|
|
340
|
-
* .then((webhook) => console.log(webhook))
|
|
341
|
-
* .catch(console.error)
|
|
342
|
-
* ```
|
|
343
|
-
*/
|
|
344
|
-
createWebhookWithId(id, data) {
|
|
345
|
-
const raw = this.toPlainObject();
|
|
346
|
-
return makeRequest({
|
|
347
|
-
entityType: 'Webhook',
|
|
348
|
-
action: 'createWithId',
|
|
349
|
-
params: { spaceId: raw.sys.id, webhookDefinitionId: id },
|
|
350
|
-
payload: data,
|
|
351
|
-
}).then((data) => webhook.wrapWebhook(makeRequest, data));
|
|
352
|
-
},
|
|
353
|
-
/**
|
|
354
|
-
* Create or update the webhook signing secret for this space
|
|
355
|
-
* @param data 64 character string that will be used to sign the webhook calls
|
|
356
|
-
* @returns Promise for the redacted webhook signing secret that was created or updated
|
|
357
|
-
* @example ```javascript
|
|
358
|
-
* const contentful = require('contentful-management')
|
|
359
|
-
* const crypto = require('crypto')
|
|
360
|
-
*
|
|
361
|
-
* const client = contentful.createClient({
|
|
362
|
-
* accessToken: '<content_management_api_key>'
|
|
363
|
-
* })
|
|
364
|
-
*
|
|
365
|
-
* const signingSecret = client.getSpace('<space_id>')
|
|
366
|
-
* .then((space) => space.upsertWebhookSigningSecret({
|
|
367
|
-
* value: crypto.randomBytes(32).toString('hex')
|
|
368
|
-
* }))
|
|
369
|
-
* .then((response) => console.log(response.redactedValue))
|
|
370
|
-
* .catch(console.error)
|
|
371
|
-
* ```
|
|
372
|
-
*/
|
|
373
|
-
upsertWebhookSigningSecret: function getSigningSecret(data) {
|
|
374
|
-
const raw = this.toPlainObject();
|
|
375
|
-
return makeRequest({
|
|
376
|
-
entityType: 'Webhook',
|
|
377
|
-
action: 'upsertSigningSecret',
|
|
378
|
-
params: { spaceId: raw.sys.id },
|
|
379
|
-
payload: data,
|
|
380
|
-
});
|
|
381
|
-
},
|
|
382
|
-
/**
|
|
383
|
-
* Create or update the webhook retry policy for this space
|
|
384
|
-
* @param data the maxRetries with integer value >= 2 and <= 99 value to set in the Retry Policy
|
|
385
|
-
* @returns Promise for the redacted webhook retry policy that was created or updated
|
|
386
|
-
* @example ```javascript
|
|
387
|
-
* const contentful = require('contentful-management')
|
|
388
|
-
*
|
|
389
|
-
* const client = contentful.createClient({
|
|
390
|
-
* accessToken: '<content_management_api_key>'
|
|
391
|
-
* })
|
|
392
|
-
*
|
|
393
|
-
* const retryPolicy = client.getSpace('<space_id>')
|
|
394
|
-
* .then((space) => space.upsertWebhookRetryPolicy({
|
|
395
|
-
* maxRetries: 15
|
|
396
|
-
* }))
|
|
397
|
-
* .then((response) => console.log(response.redactedValue))
|
|
398
|
-
* .catch(console.error)
|
|
399
|
-
* ```
|
|
400
|
-
*/
|
|
401
|
-
upsertWebhookRetryPolicy: function upsertWebhookRetryPolicy(data) {
|
|
402
|
-
const raw = this.toPlainObject();
|
|
403
|
-
return makeRequest({
|
|
404
|
-
entityType: 'Webhook',
|
|
405
|
-
action: 'upsertRetryPolicy',
|
|
406
|
-
params: { spaceId: raw.sys.id },
|
|
407
|
-
payload: data,
|
|
408
|
-
});
|
|
409
|
-
},
|
|
410
|
-
/**
|
|
411
|
-
* Delete the webhook signing secret for this space
|
|
412
|
-
* @returns Promise<void>
|
|
413
|
-
* @example ```javascript
|
|
414
|
-
* const contentful = require('contentful-management')
|
|
415
|
-
*
|
|
416
|
-
* const client = contentful.createClient({
|
|
417
|
-
* accessToken: '<content_management_api_key>'
|
|
418
|
-
* })
|
|
419
|
-
*
|
|
420
|
-
* client.getSpace('<space_id>')
|
|
421
|
-
* .then((space) => space.deleteWebhookSigningSecret())
|
|
422
|
-
* .then(() => console.log("success"))
|
|
423
|
-
* .catch(console.error)
|
|
424
|
-
* ```
|
|
425
|
-
*/
|
|
426
|
-
deleteWebhookSigningSecret: function getSigningSecret() {
|
|
427
|
-
const raw = this.toPlainObject();
|
|
428
|
-
return makeRequest({
|
|
429
|
-
entityType: 'Webhook',
|
|
430
|
-
action: 'deleteSigningSecret',
|
|
431
|
-
params: { spaceId: raw.sys.id },
|
|
432
|
-
});
|
|
433
|
-
},
|
|
434
|
-
/**
|
|
435
|
-
* Delete the webhook retry policy for this space
|
|
436
|
-
* @returns Promise<void>
|
|
437
|
-
* @example ```javascript
|
|
438
|
-
* const contentful = require('contentful-management')
|
|
439
|
-
*
|
|
440
|
-
* const client = contentful.createClient({
|
|
441
|
-
* accessToken: '<content_management_api_key>'
|
|
442
|
-
* })
|
|
443
|
-
*
|
|
444
|
-
* client.getSpace('<space_id>')
|
|
445
|
-
* .then((space) => space.deleteWebhookRetryPolicy())
|
|
446
|
-
* .then(() => console.log("success"))
|
|
447
|
-
* .catch(console.error)
|
|
448
|
-
* ```
|
|
449
|
-
*/
|
|
450
|
-
deleteWebhookRetryPolicy: function deleteRetryPolicy() {
|
|
451
|
-
const raw = this.toPlainObject();
|
|
452
|
-
return makeRequest({
|
|
453
|
-
entityType: 'Webhook',
|
|
454
|
-
action: 'deleteRetryPolicy',
|
|
455
|
-
params: { spaceId: raw.sys.id },
|
|
456
|
-
});
|
|
457
|
-
},
|
|
458
|
-
/**
|
|
459
|
-
* Gets a Role
|
|
460
|
-
* @param id - Role ID
|
|
461
|
-
* @return Promise for a Role
|
|
462
|
-
* @example ```javascript
|
|
463
|
-
* const contentful = require('contentful-management')
|
|
464
|
-
*
|
|
465
|
-
* const client = contentful.createClient({
|
|
466
|
-
* accessToken: '<content_management_api_key>'
|
|
467
|
-
* })
|
|
468
|
-
*
|
|
469
|
-
* client.getSpace('<space_id>')
|
|
470
|
-
* .then((space) => space.createRole({
|
|
471
|
-
* fields: {
|
|
472
|
-
* title: {
|
|
473
|
-
* 'en-US': 'Role title'
|
|
474
|
-
* }
|
|
475
|
-
* }
|
|
476
|
-
* }))
|
|
477
|
-
* .then((role) => console.log(role))
|
|
478
|
-
* .catch(console.error)
|
|
479
|
-
* ```
|
|
480
|
-
*/
|
|
481
|
-
getRole(id) {
|
|
482
|
-
const raw = this.toPlainObject();
|
|
483
|
-
return makeRequest({
|
|
484
|
-
entityType: 'Role',
|
|
485
|
-
action: 'get',
|
|
486
|
-
params: { spaceId: raw.sys.id, roleId: id },
|
|
487
|
-
}).then((data) => role.wrapRole(makeRequest, data));
|
|
488
|
-
},
|
|
489
|
-
/**
|
|
490
|
-
* Gets a collection of Roles
|
|
491
|
-
* @return Promise for a collection of Roles
|
|
492
|
-
* @example ```javascript
|
|
493
|
-
* const contentful = require('contentful-management')
|
|
494
|
-
*
|
|
495
|
-
* const client = contentful.createClient({
|
|
496
|
-
* accessToken: '<content_management_api_key>'
|
|
497
|
-
* })
|
|
498
|
-
*
|
|
499
|
-
* client.getSpace('<space_id>')
|
|
500
|
-
* .then((space) => space.getRoles())
|
|
501
|
-
* .then((response) => console.log(response.items))
|
|
502
|
-
* .catch(console.error)
|
|
503
|
-
* ```
|
|
504
|
-
*/
|
|
505
|
-
getRoles(query = {}) {
|
|
506
|
-
const raw = this.toPlainObject();
|
|
507
|
-
return makeRequest({
|
|
508
|
-
entityType: 'Role',
|
|
509
|
-
action: 'getMany',
|
|
510
|
-
params: { spaceId: raw.sys.id, query: contentfulSdkCore.createRequestConfig({ query }).params },
|
|
511
|
-
}).then((data) => role.wrapRoleCollection(makeRequest, data));
|
|
512
|
-
},
|
|
513
|
-
/**
|
|
514
|
-
* Creates a Role
|
|
515
|
-
* @param data - Object representation of the Role to be created
|
|
516
|
-
* @return Promise for the newly created Role
|
|
517
|
-
* @example ```javascript
|
|
518
|
-
* const contentful = require('contentful-management')
|
|
519
|
-
*
|
|
520
|
-
* const client = contentful.createClient({
|
|
521
|
-
* accessToken: '<content_management_api_key>'
|
|
522
|
-
* })
|
|
523
|
-
* client.getSpace('<space_id>')
|
|
524
|
-
* .then((space) => space.createRole({
|
|
525
|
-
* name: 'My Role',
|
|
526
|
-
* description: 'foobar role',
|
|
527
|
-
* permissions: {
|
|
528
|
-
* ContentDelivery: 'all',
|
|
529
|
-
* ContentModel: ['read'],
|
|
530
|
-
* Settings: []
|
|
531
|
-
* },
|
|
532
|
-
* policies: [
|
|
533
|
-
* {
|
|
534
|
-
* effect: 'allow',
|
|
535
|
-
* actions: 'all',
|
|
536
|
-
* constraint: {
|
|
537
|
-
* and: [
|
|
538
|
-
* {
|
|
539
|
-
* equals: [
|
|
540
|
-
* { doc: 'sys.type' },
|
|
541
|
-
* 'Entry'
|
|
542
|
-
* ]
|
|
543
|
-
* },
|
|
544
|
-
* {
|
|
545
|
-
* equals: [
|
|
546
|
-
* { doc: 'sys.type' },
|
|
547
|
-
* 'Asset'
|
|
548
|
-
* ]
|
|
549
|
-
* }
|
|
550
|
-
* ]
|
|
551
|
-
* }
|
|
552
|
-
* }
|
|
553
|
-
* ]
|
|
554
|
-
* }))
|
|
555
|
-
* .then((role) => console.log(role))
|
|
556
|
-
* .catch(console.error)
|
|
557
|
-
* ```
|
|
558
|
-
*/
|
|
559
|
-
createRole(data) {
|
|
560
|
-
const raw = this.toPlainObject();
|
|
561
|
-
return makeRequest({
|
|
562
|
-
entityType: 'Role',
|
|
563
|
-
action: 'create',
|
|
564
|
-
params: { spaceId: raw.sys.id },
|
|
565
|
-
payload: data,
|
|
566
|
-
}).then((data) => role.wrapRole(makeRequest, data));
|
|
567
|
-
},
|
|
568
|
-
/**
|
|
569
|
-
* Creates a Role with a custom ID
|
|
570
|
-
* @param id - Role ID
|
|
571
|
-
* @param data - Object representation of the Role to be created
|
|
572
|
-
* @return Promise for the newly created Role
|
|
573
|
-
* @example ```javascript
|
|
574
|
-
* const contentful = require('contentful-management')
|
|
575
|
-
*
|
|
576
|
-
* const client = contentful.createClient({
|
|
577
|
-
* accessToken: '<content_management_api_key>'
|
|
578
|
-
* })
|
|
579
|
-
* client.getSpace('<space_id>')
|
|
580
|
-
* .then((space) => space.createRoleWithId('<role-id>', {
|
|
581
|
-
* name: 'My Role',
|
|
582
|
-
* description: 'foobar role',
|
|
583
|
-
* permissions: {
|
|
584
|
-
* ContentDelivery: 'all',
|
|
585
|
-
* ContentModel: ['read'],
|
|
586
|
-
* Settings: []
|
|
587
|
-
* },
|
|
588
|
-
* policies: [
|
|
589
|
-
* {
|
|
590
|
-
* effect: 'allow',
|
|
591
|
-
* actions: 'all',
|
|
592
|
-
* constraint: {
|
|
593
|
-
* and: [
|
|
594
|
-
* {
|
|
595
|
-
* equals: [
|
|
596
|
-
* { doc: 'sys.type' },
|
|
597
|
-
* 'Entry'
|
|
598
|
-
* ]
|
|
599
|
-
* },
|
|
600
|
-
* {
|
|
601
|
-
* equals: [
|
|
602
|
-
* { doc: 'sys.type' },
|
|
603
|
-
* 'Asset'
|
|
604
|
-
* ]
|
|
605
|
-
* }
|
|
606
|
-
* ]
|
|
607
|
-
* }
|
|
608
|
-
* }
|
|
609
|
-
* ]
|
|
610
|
-
* }))
|
|
611
|
-
* .then((role) => console.log(role))
|
|
612
|
-
* .catch(console.error)
|
|
613
|
-
* ```
|
|
614
|
-
*/
|
|
615
|
-
createRoleWithId(id, roleData) {
|
|
616
|
-
const raw = this.toPlainObject();
|
|
617
|
-
return makeRequest({
|
|
618
|
-
entityType: 'Role',
|
|
619
|
-
action: 'createWithId',
|
|
620
|
-
params: { spaceId: raw.sys.id, roleId: id },
|
|
621
|
-
payload: roleData,
|
|
622
|
-
}).then((data) => role.wrapRole(makeRequest, data));
|
|
623
|
-
},
|
|
624
|
-
/**
|
|
625
|
-
* Gets a User
|
|
626
|
-
* @param userId - User ID
|
|
627
|
-
* @return Promise for a User
|
|
628
|
-
* @example ```javascript
|
|
629
|
-
* const contentful = require('contentful-management')
|
|
630
|
-
*
|
|
631
|
-
* client.getSpace('<space_id>')
|
|
632
|
-
* .then((space) => space.getSpaceUser('id'))
|
|
633
|
-
* .then((user) => console.log(user))
|
|
634
|
-
* .catch(console.error)
|
|
635
|
-
* ```
|
|
636
|
-
*/
|
|
637
|
-
getSpaceUser(userId) {
|
|
638
|
-
const raw = this.toPlainObject();
|
|
639
|
-
return makeRequest({
|
|
640
|
-
entityType: 'User',
|
|
641
|
-
action: 'getForSpace',
|
|
642
|
-
params: {
|
|
643
|
-
spaceId: raw.sys.id,
|
|
644
|
-
userId,
|
|
645
|
-
},
|
|
646
|
-
}).then((data) => user.wrapUser(makeRequest, data));
|
|
647
|
-
},
|
|
648
|
-
/**
|
|
649
|
-
* Gets a collection of Users in a space
|
|
650
|
-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
651
|
-
* @return Promise a collection of Users in a space
|
|
652
|
-
* @example ```javascript
|
|
653
|
-
* const contentful = require('contentful-management')
|
|
654
|
-
*
|
|
655
|
-
* client.getSpace('<space_id>')
|
|
656
|
-
* .then((space) => space.getSpaceUsers(query))
|
|
657
|
-
* .then((data) => console.log(data))
|
|
658
|
-
* .catch(console.error)
|
|
659
|
-
* ```
|
|
660
|
-
*/
|
|
661
|
-
getSpaceUsers(query = {}) {
|
|
662
|
-
const raw = this.toPlainObject();
|
|
663
|
-
return makeRequest({
|
|
664
|
-
entityType: 'User',
|
|
665
|
-
action: 'getManyForSpace',
|
|
666
|
-
params: {
|
|
667
|
-
spaceId: raw.sys.id,
|
|
668
|
-
query: contentfulSdkCore.createRequestConfig({ query }).params,
|
|
669
|
-
},
|
|
670
|
-
}).then((data) => user.wrapUserCollection(makeRequest, data));
|
|
671
|
-
},
|
|
672
|
-
/**
|
|
673
|
-
* Gets a collection of teams for a space
|
|
674
|
-
* @param query
|
|
675
|
-
* @return Promise for a collection of teams for a space
|
|
676
|
-
* @example ```javascript
|
|
677
|
-
* const contentful = require('contentful-management')
|
|
678
|
-
*
|
|
679
|
-
* client.getSpace('<space_id>')
|
|
680
|
-
* .then((space) => space.getTeams())
|
|
681
|
-
* .then((teamsCollection) => console.log(teamsCollection))
|
|
682
|
-
* .catch(console.error)
|
|
683
|
-
* ```
|
|
684
|
-
*/
|
|
685
|
-
getTeams(query = { limit: 100 }) {
|
|
686
|
-
const raw = this.toPlainObject();
|
|
687
|
-
return makeRequest({
|
|
688
|
-
entityType: 'Team',
|
|
689
|
-
action: 'getManyForSpace',
|
|
690
|
-
params: {
|
|
691
|
-
spaceId: raw.sys.id,
|
|
692
|
-
query: contentfulSdkCore.createRequestConfig({ query }).params,
|
|
693
|
-
},
|
|
694
|
-
}).then((data) => team.wrapTeamCollection(makeRequest, data));
|
|
695
|
-
},
|
|
696
|
-
/**
|
|
697
|
-
* Gets a Space Member
|
|
698
|
-
* @param id Get Space Member by user_id
|
|
699
|
-
* @return Promise for a Space Member
|
|
700
|
-
* @example ```javascript
|
|
701
|
-
* const contentful = require('contentful-management')
|
|
702
|
-
*
|
|
703
|
-
* client.getSpace('<space_id>')
|
|
704
|
-
* .then((space) => space.getSpaceMember(id))
|
|
705
|
-
* .then((spaceMember) => console.log(spaceMember))
|
|
706
|
-
* .catch(console.error)
|
|
707
|
-
* ```
|
|
708
|
-
*/
|
|
709
|
-
getSpaceMember(id) {
|
|
710
|
-
const raw = this.toPlainObject();
|
|
711
|
-
return makeRequest({
|
|
712
|
-
entityType: 'SpaceMember',
|
|
713
|
-
action: 'get',
|
|
714
|
-
params: { spaceId: raw.sys.id, spaceMemberId: id },
|
|
715
|
-
}).then((data) => spaceMember.wrapSpaceMember(makeRequest, data));
|
|
716
|
-
},
|
|
717
|
-
/**
|
|
718
|
-
* Gets a collection of Space Members
|
|
719
|
-
* @param query
|
|
720
|
-
* @return Promise for a collection of Space Members
|
|
721
|
-
* @example ```javascript
|
|
722
|
-
* const contentful = require('contentful-management')
|
|
723
|
-
*
|
|
724
|
-
* client.getSpace('<space_id>')
|
|
725
|
-
* .then((space) => space.getSpaceMembers({'limit': 100}))
|
|
726
|
-
* .then((spaceMemberCollection) => console.log(spaceMemberCollection))
|
|
727
|
-
* .catch(console.error)
|
|
728
|
-
* ```
|
|
729
|
-
*/
|
|
730
|
-
getSpaceMembers(query = {}) {
|
|
731
|
-
const raw = this.toPlainObject();
|
|
732
|
-
return makeRequest({
|
|
733
|
-
entityType: 'SpaceMember',
|
|
734
|
-
action: 'getMany',
|
|
735
|
-
params: {
|
|
736
|
-
spaceId: raw.sys.id,
|
|
737
|
-
query: contentfulSdkCore.createRequestConfig({ query }).params,
|
|
738
|
-
},
|
|
739
|
-
}).then((data) => spaceMember.wrapSpaceMemberCollection(makeRequest, data));
|
|
740
|
-
},
|
|
741
|
-
/**
|
|
742
|
-
* Gets a Space Membership
|
|
743
|
-
* Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
|
|
744
|
-
* @param id - Space Membership ID
|
|
745
|
-
* @return Promise for a Space Membership
|
|
746
|
-
* @example ```javascript
|
|
747
|
-
* const contentful = require('contentful-management')
|
|
748
|
-
*
|
|
749
|
-
* client.getSpace('<space_id>')
|
|
750
|
-
* .then((space) => space.getSpaceMembership('id'))
|
|
751
|
-
* .then((spaceMembership) => console.log(spaceMembership))
|
|
752
|
-
* .catch(console.error)
|
|
753
|
-
* ```
|
|
754
|
-
*/
|
|
755
|
-
getSpaceMembership(id) {
|
|
756
|
-
const raw = this.toPlainObject();
|
|
757
|
-
return makeRequest({
|
|
758
|
-
entityType: 'SpaceMembership',
|
|
759
|
-
action: 'get',
|
|
760
|
-
params: { spaceId: raw.sys.id, spaceMembershipId: id },
|
|
761
|
-
}).then((data) => spaceMembership.wrapSpaceMembership(makeRequest, data));
|
|
762
|
-
},
|
|
763
|
-
/**
|
|
764
|
-
* Gets a collection of Space Memberships
|
|
765
|
-
* Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
|
|
766
|
-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
767
|
-
* @return Promise for a collection of Space Memberships
|
|
768
|
-
* @example ```javascript
|
|
769
|
-
* const contentful = require('contentful-management')
|
|
770
|
-
*
|
|
771
|
-
* client.getSpace('<space_id>')
|
|
772
|
-
* .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
|
|
773
|
-
* .then((response) => console.log(response.items))
|
|
774
|
-
* .catch(console.error)
|
|
775
|
-
* ```
|
|
776
|
-
*/
|
|
777
|
-
getSpaceMemberships(query = {}) {
|
|
778
|
-
const raw = this.toPlainObject();
|
|
779
|
-
return makeRequest({
|
|
780
|
-
entityType: 'SpaceMembership',
|
|
781
|
-
action: 'getMany',
|
|
782
|
-
params: {
|
|
783
|
-
spaceId: raw.sys.id,
|
|
784
|
-
query: contentfulSdkCore.createRequestConfig({ query }).params,
|
|
785
|
-
},
|
|
786
|
-
}).then((data) => spaceMembership.wrapSpaceMembershipCollection(makeRequest, data));
|
|
787
|
-
},
|
|
788
|
-
/**
|
|
789
|
-
* Creates a Space Membership
|
|
790
|
-
* Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
|
|
791
|
-
* @param data - Object representation of the Space Membership to be created
|
|
792
|
-
* @return Promise for the newly created Space Membership
|
|
793
|
-
* @example ```javascript
|
|
794
|
-
* const contentful = require('contentful-management')
|
|
795
|
-
*
|
|
796
|
-
* const client = contentful.createClient({
|
|
797
|
-
* accessToken: '<content_management_api_key>'
|
|
798
|
-
* })
|
|
799
|
-
*
|
|
800
|
-
* client.getSpace('<space_id>')
|
|
801
|
-
* .then((space) => space.createSpaceMembership({
|
|
802
|
-
* admin: false,
|
|
803
|
-
* roles: [
|
|
804
|
-
* {
|
|
805
|
-
* type: 'Link',
|
|
806
|
-
* linkType: 'Role',
|
|
807
|
-
* id: '<role_id>'
|
|
808
|
-
* }
|
|
809
|
-
* ],
|
|
810
|
-
* email: 'foo@example.com'
|
|
811
|
-
* }))
|
|
812
|
-
* .then((spaceMembership) => console.log(spaceMembership))
|
|
813
|
-
* .catch(console.error)
|
|
814
|
-
* ```
|
|
815
|
-
*/
|
|
816
|
-
createSpaceMembership(data) {
|
|
817
|
-
const raw = this.toPlainObject();
|
|
818
|
-
return makeRequest({
|
|
819
|
-
entityType: 'SpaceMembership',
|
|
820
|
-
action: 'create',
|
|
821
|
-
params: {
|
|
822
|
-
spaceId: raw.sys.id,
|
|
823
|
-
},
|
|
824
|
-
payload: data,
|
|
825
|
-
}).then((response) => spaceMembership.wrapSpaceMembership(makeRequest, response));
|
|
826
|
-
},
|
|
827
|
-
/**
|
|
828
|
-
* Creates a Space Membership with a custom ID
|
|
829
|
-
* Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
|
|
830
|
-
* @param id - Space Membership ID
|
|
831
|
-
* @param data - Object representation of the Space Membership to be created
|
|
832
|
-
* @return Promise for the newly created Space Membership
|
|
833
|
-
* @example ```javascript
|
|
834
|
-
* const contentful = require('contentful-management')
|
|
835
|
-
*
|
|
836
|
-
* const client = contentful.createClient({
|
|
837
|
-
* accessToken: '<content_management_api_key>'
|
|
838
|
-
* })
|
|
839
|
-
*
|
|
840
|
-
* client.getSpace('<space_id>')
|
|
841
|
-
* .then((space) => space.createSpaceMembershipWithId('<space-membership-id>', {
|
|
842
|
-
* admin: false,
|
|
843
|
-
* roles: [
|
|
844
|
-
* {
|
|
845
|
-
* type: 'Link',
|
|
846
|
-
* linkType: 'Role',
|
|
847
|
-
* id: '<role_id>'
|
|
848
|
-
* }
|
|
849
|
-
* ],
|
|
850
|
-
* email: 'foo@example.com'
|
|
851
|
-
* }))
|
|
852
|
-
* .then((spaceMembership) => console.log(spaceMembership))
|
|
853
|
-
* .catch(console.error)
|
|
854
|
-
* ```
|
|
855
|
-
*/
|
|
856
|
-
createSpaceMembershipWithId(id, data) {
|
|
857
|
-
const raw = this.toPlainObject();
|
|
858
|
-
return makeRequest({
|
|
859
|
-
entityType: 'SpaceMembership',
|
|
860
|
-
action: 'createWithId',
|
|
861
|
-
params: {
|
|
862
|
-
spaceId: raw.sys.id,
|
|
863
|
-
spaceMembershipId: id,
|
|
864
|
-
},
|
|
865
|
-
payload: data,
|
|
866
|
-
}).then((response) => spaceMembership.wrapSpaceMembership(makeRequest, response));
|
|
867
|
-
},
|
|
868
|
-
/**
|
|
869
|
-
* Gets a Team Space Membership
|
|
870
|
-
* @param id - Team Space Membership ID
|
|
871
|
-
* @return Promise for a Team Space Membership
|
|
872
|
-
* @example ```javascript
|
|
873
|
-
* const contentful = require('contentful-management')
|
|
874
|
-
*
|
|
875
|
-
* client.getSpace('<space_id>')
|
|
876
|
-
* .then((space) => space.getTeamSpaceMembership('team_space_membership_id'))
|
|
877
|
-
* .then((teamSpaceMembership) => console.log(teamSpaceMembership))
|
|
878
|
-
* .catch(console.error)
|
|
879
|
-
* ```
|
|
880
|
-
*/
|
|
881
|
-
getTeamSpaceMembership(teamSpaceMembershipId) {
|
|
882
|
-
const raw = this.toPlainObject();
|
|
883
|
-
return makeRequest({
|
|
884
|
-
entityType: 'TeamSpaceMembership',
|
|
885
|
-
action: 'get',
|
|
886
|
-
params: {
|
|
887
|
-
spaceId: raw.sys.id,
|
|
888
|
-
teamSpaceMembershipId,
|
|
889
|
-
},
|
|
890
|
-
}).then((data) => teamSpaceMembership.wrapTeamSpaceMembership(makeRequest, data));
|
|
891
|
-
},
|
|
892
|
-
/**
|
|
893
|
-
* Gets a collection of Team Space Memberships
|
|
894
|
-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
895
|
-
* @return Promise for a collection of Team Space Memberships
|
|
896
|
-
* @example ```javascript
|
|
897
|
-
* const contentful = require('contentful-management')
|
|
898
|
-
*
|
|
899
|
-
* client.getSpace('<space_id>')
|
|
900
|
-
* .then((space) => space.getTeamSpaceMemberships())
|
|
901
|
-
* .then((response) => console.log(response.items))
|
|
902
|
-
* .catch(console.error)
|
|
903
|
-
* ```
|
|
904
|
-
*/
|
|
905
|
-
getTeamSpaceMemberships(query = {}) {
|
|
906
|
-
const raw = this.toPlainObject();
|
|
907
|
-
return makeRequest({
|
|
908
|
-
entityType: 'TeamSpaceMembership',
|
|
909
|
-
action: 'getMany',
|
|
910
|
-
params: {
|
|
911
|
-
spaceId: raw.sys.id,
|
|
912
|
-
query: contentfulSdkCore.createRequestConfig({ query: query }).params,
|
|
913
|
-
},
|
|
914
|
-
}).then((data) => teamSpaceMembership.wrapTeamSpaceMembershipCollection(makeRequest, data));
|
|
915
|
-
},
|
|
916
|
-
/**
|
|
917
|
-
* Creates a Team Space Membership
|
|
918
|
-
* @param id - Team ID
|
|
919
|
-
* @param data - Object representation of the Team Space Membership to be created
|
|
920
|
-
* @return Promise for the newly created Team Space Membership
|
|
921
|
-
* @example ```javascript
|
|
922
|
-
* const contentful = require('contentful-management')
|
|
923
|
-
*
|
|
924
|
-
* const client = contentful.createClient({
|
|
925
|
-
* accessToken: '<content_management_api_key>'
|
|
926
|
-
* })
|
|
927
|
-
*
|
|
928
|
-
* client.getSpace('<space_id>')
|
|
929
|
-
* .then((space) => space.createTeamSpaceMembership('team_id', {
|
|
930
|
-
* admin: false,
|
|
931
|
-
* roles: [
|
|
932
|
-
* {
|
|
933
|
-
sys: {
|
|
934
|
-
* type: 'Link',
|
|
935
|
-
* linkType: 'Role',
|
|
936
|
-
* id: '<role_id>'
|
|
937
|
-
* }
|
|
938
|
-
* }
|
|
939
|
-
* ],
|
|
940
|
-
* }))
|
|
941
|
-
* .then((teamSpaceMembership) => console.log(teamSpaceMembership))
|
|
942
|
-
* .catch(console.error)
|
|
943
|
-
* ```
|
|
944
|
-
*/
|
|
945
|
-
createTeamSpaceMembership(teamId, data) {
|
|
946
|
-
const raw = this.toPlainObject();
|
|
947
|
-
return makeRequest({
|
|
948
|
-
entityType: 'TeamSpaceMembership',
|
|
949
|
-
action: 'create',
|
|
950
|
-
params: {
|
|
951
|
-
spaceId: raw.sys.id,
|
|
952
|
-
teamId,
|
|
953
|
-
},
|
|
954
|
-
payload: data,
|
|
955
|
-
}).then((response) => teamSpaceMembership.wrapTeamSpaceMembership(makeRequest, response));
|
|
956
|
-
},
|
|
957
|
-
/**
|
|
958
|
-
* Gets a Api Key
|
|
959
|
-
* @param id - API Key ID
|
|
960
|
-
* @return Promise for a Api Key
|
|
961
|
-
* @example ```javascript
|
|
962
|
-
* const contentful = require('contentful-management')
|
|
963
|
-
*
|
|
964
|
-
* const client = contentful.createClient({
|
|
965
|
-
* accessToken: '<content_management_api_key>'
|
|
966
|
-
* })
|
|
967
|
-
*
|
|
968
|
-
* client.getSpace('<space_id>')
|
|
969
|
-
* .then((space) => space.getApiKey('<apikey-id>'))
|
|
970
|
-
* .then((apikey) => console.log(apikey))
|
|
971
|
-
* .catch(console.error)
|
|
972
|
-
* ```
|
|
973
|
-
*/
|
|
974
|
-
getApiKey(id) {
|
|
975
|
-
const raw = this.toPlainObject();
|
|
976
|
-
return makeRequest({
|
|
977
|
-
entityType: 'ApiKey',
|
|
978
|
-
action: 'get',
|
|
979
|
-
params: {
|
|
980
|
-
spaceId: raw.sys.id,
|
|
981
|
-
apiKeyId: id,
|
|
982
|
-
},
|
|
983
|
-
}).then((data) => apiKey.wrapApiKey(makeRequest, data));
|
|
984
|
-
},
|
|
985
|
-
/**
|
|
986
|
-
* Gets a collection of Api Keys
|
|
987
|
-
* @return Promise for a collection of Api Keys
|
|
988
|
-
* @example ```javascript
|
|
989
|
-
* const contentful = require('contentful-management')
|
|
990
|
-
*
|
|
991
|
-
* const client = contentful.createClient({
|
|
992
|
-
* accessToken: '<content_management_api_key>'
|
|
993
|
-
* })
|
|
994
|
-
*
|
|
995
|
-
* client.getSpace('<space_id>')
|
|
996
|
-
* .then((space) => space.getApiKeys())
|
|
997
|
-
* .then((response) => console.log(response.items))
|
|
998
|
-
* .catch(console.error)
|
|
999
|
-
* ```
|
|
1000
|
-
*/
|
|
1001
|
-
getApiKeys() {
|
|
1002
|
-
const raw = this.toPlainObject();
|
|
1003
|
-
return makeRequest({
|
|
1004
|
-
entityType: 'ApiKey',
|
|
1005
|
-
action: 'getMany',
|
|
1006
|
-
params: {
|
|
1007
|
-
spaceId: raw.sys.id,
|
|
1008
|
-
},
|
|
1009
|
-
}).then((data) => apiKey.wrapApiKeyCollection(makeRequest, data));
|
|
1010
|
-
},
|
|
1011
|
-
/**
|
|
1012
|
-
* Gets a collection of preview Api Keys
|
|
1013
|
-
* @return Promise for a collection of Preview Api Keys
|
|
1014
|
-
* @example ```javascript
|
|
1015
|
-
* const contentful = require('contentful-management')
|
|
1016
|
-
*
|
|
1017
|
-
* const client = contentful.createClient({
|
|
1018
|
-
* accessToken: '<content_management_api_key>'
|
|
1019
|
-
* })
|
|
1020
|
-
*
|
|
1021
|
-
* client.getSpace('<space_id>')
|
|
1022
|
-
* .then((space) => space.getPreviewApiKeys())
|
|
1023
|
-
* .then((response) => console.log(response.items))
|
|
1024
|
-
* .catch(console.error)
|
|
1025
|
-
* ```
|
|
1026
|
-
*/
|
|
1027
|
-
getPreviewApiKeys() {
|
|
1028
|
-
const raw = this.toPlainObject();
|
|
1029
|
-
return makeRequest({
|
|
1030
|
-
entityType: 'PreviewApiKey',
|
|
1031
|
-
action: 'getMany',
|
|
1032
|
-
params: {
|
|
1033
|
-
spaceId: raw.sys.id,
|
|
1034
|
-
},
|
|
1035
|
-
}).then((data) => previewApiKey.wrapPreviewApiKeyCollection(makeRequest, data));
|
|
1036
|
-
},
|
|
1037
|
-
/**
|
|
1038
|
-
* Gets a preview Api Key
|
|
1039
|
-
* @param id - Preview API Key ID
|
|
1040
|
-
* @return Promise for a Preview Api Key
|
|
1041
|
-
* @example ```javascript
|
|
1042
|
-
* const contentful = require('contentful-management')
|
|
1043
|
-
*
|
|
1044
|
-
* const client = contentful.createClient({
|
|
1045
|
-
* accessToken: '<content_management_api_key>'
|
|
1046
|
-
* })
|
|
1047
|
-
*
|
|
1048
|
-
* client.getSpace('<space_id>')
|
|
1049
|
-
* .then((space) => space.getPreviewApiKey('<preview-apikey-id>'))
|
|
1050
|
-
* .then((previewApikey) => console.log(previewApikey))
|
|
1051
|
-
* .catch(console.error)
|
|
1052
|
-
* ```
|
|
1053
|
-
*/
|
|
1054
|
-
getPreviewApiKey(id) {
|
|
1055
|
-
const raw = this.toPlainObject();
|
|
1056
|
-
return makeRequest({
|
|
1057
|
-
entityType: 'PreviewApiKey',
|
|
1058
|
-
action: 'get',
|
|
1059
|
-
params: {
|
|
1060
|
-
spaceId: raw.sys.id,
|
|
1061
|
-
previewApiKeyId: id,
|
|
1062
|
-
},
|
|
1063
|
-
}).then((data) => previewApiKey.wrapPreviewApiKey(makeRequest, data));
|
|
1064
|
-
},
|
|
1065
|
-
/**
|
|
1066
|
-
* Creates a Api Key
|
|
1067
|
-
* @param payload - Object representation of the Api Key to be created
|
|
1068
|
-
* @return Promise for the newly created Api Key
|
|
1069
|
-
* @example ```javascript
|
|
1070
|
-
* const contentful = require('contentful-management')
|
|
1071
|
-
*
|
|
1072
|
-
* const client = contentful.createClient({
|
|
1073
|
-
* accessToken: '<content_management_api_key>'
|
|
1074
|
-
* })
|
|
1075
|
-
*
|
|
1076
|
-
* client.getSpace('<space_id>')
|
|
1077
|
-
* .then((space) => space.createApiKey({
|
|
1078
|
-
* name: 'API Key name',
|
|
1079
|
-
* environments:[
|
|
1080
|
-
* {
|
|
1081
|
-
* sys: {
|
|
1082
|
-
* type: 'Link'
|
|
1083
|
-
* linkType: 'Environment',
|
|
1084
|
-
* id:'<environment_id>'
|
|
1085
|
-
* }
|
|
1086
|
-
* }
|
|
1087
|
-
* ]
|
|
1088
|
-
* }
|
|
1089
|
-
* }))
|
|
1090
|
-
* .then((apiKey) => console.log(apiKey))
|
|
1091
|
-
* .catch(console.error)
|
|
1092
|
-
* ```
|
|
1093
|
-
*/
|
|
1094
|
-
createApiKey: function createApiKey(payload) {
|
|
1095
|
-
const raw = this.toPlainObject();
|
|
1096
|
-
return makeRequest({
|
|
1097
|
-
entityType: 'ApiKey',
|
|
1098
|
-
action: 'create',
|
|
1099
|
-
params: { spaceId: raw.sys.id },
|
|
1100
|
-
payload,
|
|
1101
|
-
}).then((data) => apiKey.wrapApiKey(makeRequest, data));
|
|
1102
|
-
},
|
|
1103
|
-
/**
|
|
1104
|
-
* Creates a Api Key with a custom ID
|
|
1105
|
-
* @param id - Api Key ID
|
|
1106
|
-
* @param payload - Object representation of the Api Key to be created
|
|
1107
|
-
* @return Promise for the newly created Api Key
|
|
1108
|
-
* @example ```javascript
|
|
1109
|
-
* const contentful = require('contentful-management')
|
|
1110
|
-
*
|
|
1111
|
-
* const client = contentful.createClient({
|
|
1112
|
-
* accessToken: '<content_management_api_key>'
|
|
1113
|
-
* })
|
|
1114
|
-
*
|
|
1115
|
-
* client.getSpace('<space_id>')
|
|
1116
|
-
* .then((space) => space.createApiKeyWithId('<api-key-id>', {
|
|
1117
|
-
* name: 'API Key name'
|
|
1118
|
-
* environments:[
|
|
1119
|
-
* {
|
|
1120
|
-
* sys: {
|
|
1121
|
-
* type: 'Link'
|
|
1122
|
-
* linkType: 'Environment',
|
|
1123
|
-
* id:'<environment_id>'
|
|
1124
|
-
* }
|
|
1125
|
-
* }
|
|
1126
|
-
* ]
|
|
1127
|
-
* }
|
|
1128
|
-
* }))
|
|
1129
|
-
* .then((apiKey) => console.log(apiKey))
|
|
1130
|
-
* .catch(console.error)
|
|
1131
|
-
* ```
|
|
1132
|
-
*/
|
|
1133
|
-
createApiKeyWithId(id, payload) {
|
|
1134
|
-
const raw = this.toPlainObject();
|
|
1135
|
-
return makeRequest({
|
|
1136
|
-
entityType: 'ApiKey',
|
|
1137
|
-
action: 'createWithId',
|
|
1138
|
-
params: { spaceId: raw.sys.id, apiKeyId: id },
|
|
1139
|
-
payload,
|
|
1140
|
-
}).then((data) => apiKey.wrapApiKey(makeRequest, data));
|
|
1141
|
-
},
|
|
1142
|
-
/**
|
|
1143
|
-
* Creates an EnvironmentAlias with a custom ID
|
|
1144
|
-
* @param environmentAliasId - EnvironmentAlias ID
|
|
1145
|
-
* @param data - Object representation of the EnvironmentAlias to be created
|
|
1146
|
-
* @return Promise for the newly created EnvironmentAlias
|
|
1147
|
-
* @example ```javascript
|
|
1148
|
-
* const contentful = require('contentful-management')
|
|
1149
|
-
*
|
|
1150
|
-
* const client = contentful.createClient({
|
|
1151
|
-
* accessToken: '<content_management_api_key>'
|
|
1152
|
-
* })
|
|
1153
|
-
*
|
|
1154
|
-
* client.getSpace('<space_id>')
|
|
1155
|
-
* .then((space) => space.createEnvironmentAliasWithId('<environment-alias-id>', {
|
|
1156
|
-
* environment: {
|
|
1157
|
-
* sys: { type: 'Link', linkType: 'Environment', id: 'targetEnvironment' }
|
|
1158
|
-
* }
|
|
1159
|
-
* }))
|
|
1160
|
-
* .then((environmentAlias) => console.log(environmentAlias))
|
|
1161
|
-
* .catch(console.error)
|
|
1162
|
-
* ```
|
|
1163
|
-
*/
|
|
1164
|
-
createEnvironmentAliasWithId(environmentAliasId, data) {
|
|
1165
|
-
const raw = this.toPlainObject();
|
|
1166
|
-
return makeRequest({
|
|
1167
|
-
entityType: 'EnvironmentAlias',
|
|
1168
|
-
action: 'createWithId',
|
|
1169
|
-
params: { spaceId: raw.sys.id, environmentAliasId },
|
|
1170
|
-
payload: data,
|
|
1171
|
-
}).then((response) => environmentAlias.wrapEnvironmentAlias(makeRequest, response));
|
|
1172
|
-
},
|
|
1173
|
-
/**
|
|
1174
|
-
* Gets an Environment Alias
|
|
1175
|
-
* @param Environment Alias ID
|
|
1176
|
-
* @return Promise for an Environment Alias
|
|
1177
|
-
* @example ```javascript
|
|
1178
|
-
* const contentful = require('contentful-management')
|
|
1179
|
-
*
|
|
1180
|
-
* const client = contentful.createClient({
|
|
1181
|
-
* accessToken: '<content_management_api_key>'
|
|
1182
|
-
* })
|
|
1183
|
-
*
|
|
1184
|
-
* client.getSpace('<space_id>')
|
|
1185
|
-
* .then((space) => space.getEnvironmentAlias('<alias-id>'))
|
|
1186
|
-
* .then((alias) => console.log(alias))
|
|
1187
|
-
* .catch(console.error)
|
|
1188
|
-
* ```
|
|
1189
|
-
*/
|
|
1190
|
-
getEnvironmentAlias(environmentAliasId) {
|
|
1191
|
-
const raw = this.toPlainObject();
|
|
1192
|
-
return makeRequest({
|
|
1193
|
-
entityType: 'EnvironmentAlias',
|
|
1194
|
-
action: 'get',
|
|
1195
|
-
params: { spaceId: raw.sys.id, environmentAliasId },
|
|
1196
|
-
}).then((data) => environmentAlias.wrapEnvironmentAlias(makeRequest, data));
|
|
1197
|
-
},
|
|
1198
|
-
/**
|
|
1199
|
-
* Gets a collection of Environment Aliases
|
|
1200
|
-
* @return Promise for a collection of Environment Aliases
|
|
1201
|
-
* @example ```javascript
|
|
1202
|
-
* const contentful = require('contentful-management')
|
|
1203
|
-
*
|
|
1204
|
-
* const client = contentful.createClient({
|
|
1205
|
-
* accessToken: '<content_management_api_key>'
|
|
1206
|
-
* })
|
|
1207
|
-
*
|
|
1208
|
-
* client.getSpace('<space_id>')
|
|
1209
|
-
* .then((space) => space.getEnvironmentAliases()
|
|
1210
|
-
* .then((response) => console.log(response.items))
|
|
1211
|
-
* .catch(console.error)
|
|
1212
|
-
* ```
|
|
1213
|
-
*/
|
|
1214
|
-
getEnvironmentAliases() {
|
|
1215
|
-
const raw = this.toPlainObject();
|
|
1216
|
-
return makeRequest({
|
|
1217
|
-
entityType: 'EnvironmentAlias',
|
|
1218
|
-
action: 'getMany',
|
|
1219
|
-
params: {
|
|
1220
|
-
spaceId: raw.sys.id,
|
|
1221
|
-
},
|
|
1222
|
-
}).then((data) => environmentAlias.wrapEnvironmentAliasCollection(makeRequest, data));
|
|
1223
|
-
},
|
|
1224
|
-
/**
|
|
1225
|
-
* Query for scheduled actions in space.
|
|
1226
|
-
* @param query - Object with search parameters. The enviroment id field is mandatory. Check the <a href="https://www.contentful.com/developers/docs/references/content-management-api/#/reference/scheduled-actions/scheduled-actions-collection">REST API reference</a> for more details.
|
|
1227
|
-
* @return Promise for the scheduled actions query
|
|
1228
|
-
*
|
|
1229
|
-
* @example ```javascript
|
|
1230
|
-
* const contentful = require('contentful-management');
|
|
1231
|
-
*
|
|
1232
|
-
* const client = contentful.createClient({
|
|
1233
|
-
* accessToken: '<content_management_api_key>'
|
|
1234
|
-
* })
|
|
1235
|
-
*
|
|
1236
|
-
* client.getSpace('<space_id>')
|
|
1237
|
-
* .then((space) => space.getScheduledActions({
|
|
1238
|
-
* 'environment.sys.id': '<environment_id>',
|
|
1239
|
-
* 'sys.status': 'scheduled'
|
|
1240
|
-
* }))
|
|
1241
|
-
* .then((scheduledActionCollection) => console.log(scheduledActionCollection.items))
|
|
1242
|
-
* .catch(console.error)
|
|
1243
|
-
* ```
|
|
1244
|
-
*/
|
|
1245
|
-
getScheduledActions(query) {
|
|
1246
|
-
const raw = this.toPlainObject();
|
|
1247
|
-
return makeRequest({
|
|
1248
|
-
entityType: 'ScheduledAction',
|
|
1249
|
-
action: 'getMany',
|
|
1250
|
-
params: { spaceId: raw.sys.id, query },
|
|
1251
|
-
}).then((response) => scheduledAction.wrapScheduledActionCollection(makeRequest, response));
|
|
1252
|
-
},
|
|
1253
|
-
/**
|
|
1254
|
-
* Get a Scheduled Action in the current space by environment and ID.
|
|
1255
|
-
*
|
|
1256
|
-
* @throws if the Scheduled Action cannot be found or the user doesn't have permission to read schedules from the entity of the scheduled action itself.
|
|
1257
|
-
* @returns Promise with the Scheduled Action
|
|
1258
|
-
* @example ```javascript
|
|
1259
|
-
* const contentful = require('contentful-management');
|
|
1260
|
-
*
|
|
1261
|
-
* const client = contentful.createClient({
|
|
1262
|
-
* accessToken: '<content_management_api_key>'
|
|
1263
|
-
* })
|
|
1264
|
-
*
|
|
1265
|
-
* client.getSpace('<space_id>')
|
|
1266
|
-
* .then((space) => space.getScheduledAction({
|
|
1267
|
-
* scheduledActionId: '<scheduled-action-id>',
|
|
1268
|
-
* environmentId: '<environmentId>'
|
|
1269
|
-
* }))
|
|
1270
|
-
* .then((scheduledAction) => console.log(scheduledAction))
|
|
1271
|
-
* .catch(console.error)
|
|
1272
|
-
* ```
|
|
1273
|
-
*/
|
|
1274
|
-
getScheduledAction({ scheduledActionId, environmentId, }) {
|
|
1275
|
-
const space = this.toPlainObject();
|
|
1276
|
-
return makeRequest({
|
|
1277
|
-
entityType: 'ScheduledAction',
|
|
1278
|
-
action: 'get',
|
|
1279
|
-
params: {
|
|
1280
|
-
spaceId: space.sys.id,
|
|
1281
|
-
environmentId,
|
|
1282
|
-
scheduledActionId,
|
|
1283
|
-
},
|
|
1284
|
-
}).then((scheduledAction$1) => scheduledAction.wrapScheduledAction(makeRequest, scheduledAction$1));
|
|
1285
|
-
},
|
|
1286
|
-
/**
|
|
1287
|
-
* Creates a scheduled action
|
|
1288
|
-
* @param data - Object representation of the scheduled action to be created
|
|
1289
|
-
* @return Promise for the newly created scheduled actions
|
|
1290
|
-
* @example ```javascript
|
|
1291
|
-
* const contentful = require('contentful-management');
|
|
1292
|
-
*
|
|
1293
|
-
* const client = contentful.createClient({
|
|
1294
|
-
* accessToken: '<content_management_api_key>'
|
|
1295
|
-
* })
|
|
1296
|
-
*
|
|
1297
|
-
* client.getSpace('<space_id>')
|
|
1298
|
-
* .then((space) => space.createScheduledAction({
|
|
1299
|
-
* entity: {
|
|
1300
|
-
* sys: {
|
|
1301
|
-
* type: 'Link',
|
|
1302
|
-
* linkType: 'Entry',
|
|
1303
|
-
* id: '<entry_id>'
|
|
1304
|
-
* }
|
|
1305
|
-
* },
|
|
1306
|
-
* environment: {
|
|
1307
|
-
* sys: {
|
|
1308
|
-
* type: 'Link',
|
|
1309
|
-
* linkType: 'Environment',
|
|
1310
|
-
* id: '<environment_id>'
|
|
1311
|
-
* }
|
|
1312
|
-
* },
|
|
1313
|
-
* action: 'publish',
|
|
1314
|
-
* scheduledFor: {
|
|
1315
|
-
* datetime: <ISO_date_string>,
|
|
1316
|
-
* timezone: 'Europe/Berlin'
|
|
1317
|
-
* }
|
|
1318
|
-
* }))
|
|
1319
|
-
* .then((scheduledAction) => console.log(scheduledAction))
|
|
1320
|
-
* .catch(console.error)
|
|
1321
|
-
* ```
|
|
1322
|
-
*/
|
|
1323
|
-
createScheduledAction(data) {
|
|
1324
|
-
const raw = this.toPlainObject();
|
|
1325
|
-
return makeRequest({
|
|
1326
|
-
entityType: 'ScheduledAction',
|
|
1327
|
-
action: 'create',
|
|
1328
|
-
params: { spaceId: raw.sys.id },
|
|
1329
|
-
payload: data,
|
|
1330
|
-
}).then((response) => scheduledAction.wrapScheduledAction(makeRequest, response));
|
|
1331
|
-
},
|
|
1332
|
-
/**
|
|
1333
|
-
* Update a scheduled action
|
|
1334
|
-
* @param {object} options
|
|
1335
|
-
* @param options.scheduledActionId the id of the scheduled action to update
|
|
1336
|
-
* @param options.version the sys.version of the scheduled action to be updated
|
|
1337
|
-
* @param payload the scheduled actions object with updates, omitting sys object
|
|
1338
|
-
* @returns Promise containing a wrapped scheduled action with helper methods
|
|
1339
|
-
* @example ```javascript
|
|
1340
|
-
* const contentful = require('contentful-management');
|
|
1341
|
-
*
|
|
1342
|
-
* const client = contentful.createClient({
|
|
1343
|
-
* accessToken: '<content_management_api_key>'
|
|
1344
|
-
* })
|
|
1345
|
-
*
|
|
1346
|
-
* client.getSpace('<space_id>')
|
|
1347
|
-
* .then((space) => {
|
|
1348
|
-
* return space.createScheduledAction({
|
|
1349
|
-
* entity: {
|
|
1350
|
-
* sys: {
|
|
1351
|
-
* type: 'Link',
|
|
1352
|
-
* linkType: 'Entry',
|
|
1353
|
-
* id: '<entry_id>'
|
|
1354
|
-
* }
|
|
1355
|
-
* },
|
|
1356
|
-
* environment: {
|
|
1357
|
-
* sys: {
|
|
1358
|
-
* type: 'Link',
|
|
1359
|
-
* linkType: 'Environment',
|
|
1360
|
-
* id: '<environment_id>'
|
|
1361
|
-
* }
|
|
1362
|
-
* },
|
|
1363
|
-
* action: 'publish',
|
|
1364
|
-
* scheduledFor: {
|
|
1365
|
-
* datetime: <ISO_date_string>,
|
|
1366
|
-
* timezone: 'Europe/Berlin'
|
|
1367
|
-
* }
|
|
1368
|
-
* })
|
|
1369
|
-
* .then((scheduledAction) => {
|
|
1370
|
-
* const { _sys, ...payload } = scheduledAction;
|
|
1371
|
-
* return space.updateScheduledAction({
|
|
1372
|
-
* ...payload,
|
|
1373
|
-
* scheduledFor: {
|
|
1374
|
-
* ...payload.scheduledFor,
|
|
1375
|
-
* timezone: 'Europe/Paris'
|
|
1376
|
-
* }
|
|
1377
|
-
* })
|
|
1378
|
-
* })
|
|
1379
|
-
* .then((scheduledAction) => console.log(scheduledAction))
|
|
1380
|
-
* .catch(console.error);
|
|
1381
|
-
* ```
|
|
1382
|
-
*/
|
|
1383
|
-
updateScheduledAction({ scheduledActionId, payload, version, }) {
|
|
1384
|
-
const spaceProps = this.toPlainObject();
|
|
1385
|
-
return makeRequest({
|
|
1386
|
-
entityType: 'ScheduledAction',
|
|
1387
|
-
action: 'update',
|
|
1388
|
-
params: {
|
|
1389
|
-
spaceId: spaceProps.sys.id,
|
|
1390
|
-
version,
|
|
1391
|
-
scheduledActionId,
|
|
1392
|
-
},
|
|
1393
|
-
payload,
|
|
1394
|
-
}).then((response) => scheduledAction.wrapScheduledAction(makeRequest, response));
|
|
1395
|
-
},
|
|
1396
|
-
/**
|
|
1397
|
-
* Cancels a Scheduled Action.
|
|
1398
|
-
* Only cancels actions that have not yet executed.
|
|
1399
|
-
*
|
|
1400
|
-
* @param {object} options
|
|
1401
|
-
* @param options.scheduledActionId the id of the scheduled action to be canceled
|
|
1402
|
-
* @param options.environmentId the environment ID of the scheduled action to be canceled
|
|
1403
|
-
* @throws if the Scheduled Action cannot be found or the user doesn't have permissions in the entity in the action.
|
|
1404
|
-
* @returns Promise containing a wrapped Scheduled Action with helper methods
|
|
1405
|
-
* @example ```javascript
|
|
1406
|
-
* const contentful = require('contentful-management');
|
|
1407
|
-
*
|
|
1408
|
-
* const client = contentful.createClient({
|
|
1409
|
-
* accessToken: '<content_management_api_key>'
|
|
1410
|
-
* })
|
|
1411
|
-
*
|
|
1412
|
-
* // Given that an Scheduled Action is scheduled
|
|
1413
|
-
* client.getSpace('<space_id>')
|
|
1414
|
-
* .then((space) => space.deleteScheduledAction({
|
|
1415
|
-
* environmentId: '<environment-id>',
|
|
1416
|
-
* scheduledActionId: '<scheduled-action-id>'
|
|
1417
|
-
* }))
|
|
1418
|
-
* // The scheduled Action sys.status is now 'canceled'
|
|
1419
|
-
* .then((scheduledAction) => console.log(scheduledAction))
|
|
1420
|
-
* .catch(console.error);
|
|
1421
|
-
* ```
|
|
1422
|
-
*/
|
|
1423
|
-
deleteScheduledAction({ scheduledActionId, environmentId, }) {
|
|
1424
|
-
const spaceProps = this.toPlainObject();
|
|
1425
|
-
return makeRequest({
|
|
1426
|
-
entityType: 'ScheduledAction',
|
|
1427
|
-
action: 'delete',
|
|
1428
|
-
params: {
|
|
1429
|
-
spaceId: spaceProps.sys.id,
|
|
1430
|
-
environmentId,
|
|
1431
|
-
scheduledActionId,
|
|
1432
|
-
},
|
|
1433
|
-
}).then((response) => scheduledAction.wrapScheduledAction(makeRequest, response));
|
|
1434
|
-
},
|
|
1435
|
-
/**
|
|
1436
|
-
* Gets a single AI Action.
|
|
1437
|
-
* @param aiActionId - AI Action ID
|
|
1438
|
-
* @return Promise for an AI Action
|
|
1439
|
-
* @example
|
|
1440
|
-
* ```javascript
|
|
1441
|
-
* client.getSpace('<space_id>')
|
|
1442
|
-
* .then((space) => space.getAiAction('<ai_action_id>'))
|
|
1443
|
-
* .then((aiAction) => console.log(aiAction))
|
|
1444
|
-
* .catch(console.error)
|
|
1445
|
-
* ```
|
|
1446
|
-
*/
|
|
1447
|
-
getAiAction(aiActionId) {
|
|
1448
|
-
const raw = this.toPlainObject();
|
|
1449
|
-
return makeRequest({
|
|
1450
|
-
entityType: 'AiAction',
|
|
1451
|
-
action: 'get',
|
|
1452
|
-
params: { spaceId: raw.sys.id, aiActionId },
|
|
1453
|
-
}).then((data) => aiAction.wrapAiAction(makeRequest, data));
|
|
1454
|
-
},
|
|
1455
|
-
/**
|
|
1456
|
-
* Gets a collection of AI Actions.
|
|
1457
|
-
* @param query - Object with search parameters.
|
|
1458
|
-
* @return Promise for a collection of AI Actions
|
|
1459
|
-
* @example
|
|
1460
|
-
* ```javascript
|
|
1461
|
-
* client.getSpace('<space_id>')
|
|
1462
|
-
* .then((space) => space.getAiActions({ limit: 10 }))
|
|
1463
|
-
* .then((response) => console.log(response.items))
|
|
1464
|
-
* .catch(console.error)
|
|
1465
|
-
* ```
|
|
1466
|
-
*/
|
|
1467
|
-
getAiActions(query = {}) {
|
|
1468
|
-
const raw = this.toPlainObject();
|
|
1469
|
-
return makeRequest({
|
|
1470
|
-
entityType: 'AiAction',
|
|
1471
|
-
action: 'getMany',
|
|
1472
|
-
params: { spaceId: raw.sys.id, query },
|
|
1473
|
-
}).then((data) => aiAction.wrapAiActionCollection(makeRequest, data));
|
|
1474
|
-
},
|
|
1475
|
-
/**
|
|
1476
|
-
* Creates an AI Action.
|
|
1477
|
-
* @param data - Object representation of the AI Action to be created
|
|
1478
|
-
* @return Promise for the newly created AI Action
|
|
1479
|
-
* @example
|
|
1480
|
-
* ```javascript
|
|
1481
|
-
* client.getSpace('<space_id>')
|
|
1482
|
-
* .then((space) => space.createAiAction({
|
|
1483
|
-
* name: 'My AI Action',
|
|
1484
|
-
* description: 'Description here',
|
|
1485
|
-
* configuration: { modelType: 'model-x', modelTemperature: 0.7 },
|
|
1486
|
-
* instruction: { template: 'Do something: {{var.input}}', variables: [], conditions: [] },
|
|
1487
|
-
* testCases: []
|
|
1488
|
-
* }))
|
|
1489
|
-
* .then((aiAction) => console.log(aiAction))
|
|
1490
|
-
* .catch(console.error)
|
|
1491
|
-
* ```
|
|
1492
|
-
*/
|
|
1493
|
-
createAiAction(data) {
|
|
1494
|
-
const raw = this.toPlainObject();
|
|
1495
|
-
return makeRequest({
|
|
1496
|
-
entityType: 'AiAction',
|
|
1497
|
-
action: 'create',
|
|
1498
|
-
params: { spaceId: raw.sys.id },
|
|
1499
|
-
payload: data,
|
|
1500
|
-
}).then((response) => aiAction.wrapAiAction(makeRequest, response));
|
|
1501
|
-
},
|
|
1502
|
-
/**
|
|
1503
|
-
* Updates an AI Action.
|
|
1504
|
-
* @param aiActionId - AI Action ID
|
|
1505
|
-
* @param data - Object representation of the AI Action update
|
|
1506
|
-
* @return Promise for the updated AI Action
|
|
1507
|
-
* @example
|
|
1508
|
-
* ```javascript
|
|
1509
|
-
* client.getSpace('<space_id>')
|
|
1510
|
-
* .then((space) => space.updateAiAction('<ai_action_id>', { name: 'New Name', ... }))
|
|
1511
|
-
* .then((aiAction) => console.log(aiAction))
|
|
1512
|
-
* .catch(console.error)
|
|
1513
|
-
* ```
|
|
1514
|
-
*/
|
|
1515
|
-
updateAiAction(aiActionId, data) {
|
|
1516
|
-
const raw = this.toPlainObject();
|
|
1517
|
-
return makeRequest({
|
|
1518
|
-
entityType: 'AiAction',
|
|
1519
|
-
action: 'update',
|
|
1520
|
-
params: { spaceId: raw.sys.id, aiActionId },
|
|
1521
|
-
payload: data,
|
|
1522
|
-
headers: { 'X-Contentful-Version': data.sys.version ?? 0 },
|
|
1523
|
-
}).then((response) => aiAction.wrapAiAction(makeRequest, response));
|
|
1524
|
-
},
|
|
1525
|
-
/**
|
|
1526
|
-
* Publishes an AI Action.
|
|
1527
|
-
* @param aiActionId - AI Action ID
|
|
1528
|
-
* @param data - Object representation of the AI Action to be published
|
|
1529
|
-
* @return Promise for the published AI Action
|
|
1530
|
-
* @example
|
|
1531
|
-
* ```javascript
|
|
1532
|
-
* client.getSpace('<space_id>')
|
|
1533
|
-
* .then((space) => space.publishAiAction('<ai_action_id>', { ... }))
|
|
1534
|
-
* .then((aiAction) => console.log(aiAction))
|
|
1535
|
-
* .catch(console.error)
|
|
1536
|
-
* ```
|
|
1537
|
-
*/
|
|
1538
|
-
publishAiAction(aiActionId, { version }) {
|
|
1539
|
-
const raw = this.toPlainObject();
|
|
1540
|
-
return makeRequest({
|
|
1541
|
-
entityType: 'AiAction',
|
|
1542
|
-
action: 'publish',
|
|
1543
|
-
params: { spaceId: raw.sys.id, aiActionId, version },
|
|
1544
|
-
}).then((response) => aiAction.wrapAiAction(makeRequest, response));
|
|
1545
|
-
},
|
|
1546
|
-
/**
|
|
1547
|
-
* Unpublishes an AI Action.
|
|
1548
|
-
* @param aiActionId - AI Action ID
|
|
1549
|
-
* @return Promise for the unpublished AI Action
|
|
1550
|
-
* @example
|
|
1551
|
-
* ```javascript
|
|
1552
|
-
* client.getSpace('<space_id>')
|
|
1553
|
-
* .then((space) => space.unpublishAiAction('<ai_action_id>'))
|
|
1554
|
-
* .then((aiAction) => console.log(aiAction))
|
|
1555
|
-
* .catch(console.error)
|
|
1556
|
-
* ```
|
|
1557
|
-
*/
|
|
1558
|
-
unpublishAiAction(aiActionId) {
|
|
1559
|
-
const raw = this.toPlainObject();
|
|
1560
|
-
return makeRequest({
|
|
1561
|
-
entityType: 'AiAction',
|
|
1562
|
-
action: 'unpublish',
|
|
1563
|
-
params: { spaceId: raw.sys.id, aiActionId },
|
|
1564
|
-
}).then((response) => aiAction.wrapAiAction(makeRequest, response));
|
|
1565
|
-
},
|
|
1566
|
-
/**
|
|
1567
|
-
* Deletes an AI Action.
|
|
1568
|
-
* @param aiActionId - AI Action ID
|
|
1569
|
-
* @return Promise for deletion (void)
|
|
1570
|
-
* @example
|
|
1571
|
-
* ```javascript
|
|
1572
|
-
* client.getSpace('<space_id>')
|
|
1573
|
-
* .then((space) => space.deleteAiAction('<ai_action_id>'))
|
|
1574
|
-
* .then(() => console.log('AI Action deleted'))
|
|
1575
|
-
* .catch(console.error)
|
|
1576
|
-
* ```
|
|
1577
|
-
*/
|
|
1578
|
-
deleteAiAction(aiActionId) {
|
|
1579
|
-
const raw = this.toPlainObject();
|
|
1580
|
-
return makeRequest({
|
|
1581
|
-
entityType: 'AiAction',
|
|
1582
|
-
action: 'delete',
|
|
1583
|
-
params: { spaceId: raw.sys.id, aiActionId },
|
|
1584
|
-
});
|
|
1585
|
-
},
|
|
1586
|
-
};
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
module.exports = createSpaceApi;
|
|
1590
|
-
//# sourceMappingURL=create-space-api.cjs.map
|