contentful-management 12.0.0-new-beta.3 → 12.0.0-new-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +23417 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/index.min.js +2 -0
- package/dist/browser/index.min.js.map +1 -0
- package/dist/cjs/index.cjs +14186 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/access-token.mjs +131 -0
- package/dist/esm/adapters/REST/endpoints/access-token.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/ai-action-invocation.mjs +8 -0
- package/dist/esm/adapters/REST/endpoints/ai-action-invocation.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/ai-action.mjs +49 -0
- package/dist/esm/adapters/REST/endpoints/ai-action.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/api-key.mjs +44 -0
- package/dist/esm/adapters/REST/endpoints/api-key.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-access-token.mjs +8 -0
- package/dist/esm/adapters/REST/endpoints/app-access-token.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-action-call.mjs +112 -0
- package/dist/esm/adapters/REST/endpoints/app-action-call.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-action.mjs +36 -0
- package/dist/esm/adapters/REST/endpoints/app-action.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-bundle.mjs +35 -0
- package/dist/esm/adapters/REST/endpoints/app-bundle.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-definition.mjs +45 -0
- package/dist/esm/adapters/REST/endpoints/app-definition.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-details.mjs +14 -0
- package/dist/esm/adapters/REST/endpoints/app-details.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-event-subscription.mjs +14 -0
- package/dist/esm/adapters/REST/endpoints/app-event-subscription.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-installation.mjs +42 -0
- package/dist/esm/adapters/REST/endpoints/app-installation.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-key.mjs +17 -0
- package/dist/esm/adapters/REST/endpoints/app-key.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-signed-request.mjs +8 -0
- package/dist/esm/adapters/REST/endpoints/app-signed-request.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-signing-secret.mjs +14 -0
- package/dist/esm/adapters/REST/endpoints/app-signing-secret.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/app-upload.mjs +25 -0
- package/dist/esm/adapters/REST/endpoints/app-upload.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/asset-key.mjs +32 -0
- package/dist/esm/adapters/REST/endpoints/asset-key.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/asset.mjs +208 -0
- package/dist/esm/adapters/REST/endpoints/asset.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/bulk-action.mjs +29 -0
- package/dist/esm/adapters/REST/endpoints/bulk-action.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/comment.mjs +91 -0
- package/dist/esm/adapters/REST/endpoints/comment.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/concept-scheme.mjs +54 -0
- package/dist/esm/adapters/REST/endpoints/concept-scheme.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/concept.mjs +70 -0
- package/dist/esm/adapters/REST/endpoints/concept.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/content-type.mjs +53 -0
- package/dist/esm/adapters/REST/endpoints/content-type.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/editor-interface.mjs +23 -0
- package/dist/esm/adapters/REST/endpoints/editor-interface.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/entry.mjs +114 -0
- package/dist/esm/adapters/REST/endpoints/entry.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/environment-alias.mjs +41 -0
- package/dist/esm/adapters/REST/endpoints/environment-alias.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.mjs +21 -0
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/environment-template.mjs +41 -0
- package/dist/esm/adapters/REST/endpoints/environment-template.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/environment.mjs +46 -0
- package/dist/esm/adapters/REST/endpoints/environment.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/extension.mjs +39 -0
- package/dist/esm/adapters/REST/endpoints/extension.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/function-log.mjs +25 -0
- package/dist/esm/adapters/REST/endpoints/function-log.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/function.mjs +22 -0
- package/dist/esm/adapters/REST/endpoints/function.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/http.mjs +23 -0
- package/dist/esm/adapters/REST/endpoints/http.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/index.mjs +142 -0
- package/dist/esm/adapters/REST/endpoints/index.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/locale.mjs +34 -0
- package/dist/esm/adapters/REST/endpoints/locale.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/oauth-application.mjs +142 -0
- package/dist/esm/adapters/REST/endpoints/oauth-application.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/organization-invitation.mjs +27 -0
- package/dist/esm/adapters/REST/endpoints/organization-invitation.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/organization-membership.mjs +30 -0
- package/dist/esm/adapters/REST/endpoints/organization-membership.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/organization.mjs +26 -0
- package/dist/esm/adapters/REST/endpoints/organization.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/personal-access-token.mjs +33 -0
- package/dist/esm/adapters/REST/endpoints/personal-access-token.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/preview-api-key.mjs +13 -0
- package/dist/esm/adapters/REST/endpoints/preview-api-key.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/raw.mjs +55 -0
- package/dist/esm/adapters/REST/endpoints/raw.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/release-action.mjs +21 -0
- package/dist/esm/adapters/REST/endpoints/release-action.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/release-asset.mjs +143 -0
- package/dist/esm/adapters/REST/endpoints/release-asset.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/release-entry.mjs +56 -0
- package/dist/esm/adapters/REST/endpoints/release-entry.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/release.mjs +73 -0
- package/dist/esm/adapters/REST/endpoints/release.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/resource-provider.mjs +15 -0
- package/dist/esm/adapters/REST/endpoints/resource-provider.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/resource-type.mjs +25 -0
- package/dist/esm/adapters/REST/endpoints/resource-type.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/resource.mjs +9 -0
- package/dist/esm/adapters/REST/endpoints/resource.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/role.mjs +43 -0
- package/dist/esm/adapters/REST/endpoints/role.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/scheduled-action.mjs +38 -0
- package/dist/esm/adapters/REST/endpoints/scheduled-action.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/snapshot.mjs +26 -0
- package/dist/esm/adapters/REST/endpoints/snapshot.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/space-member.mjs +9 -0
- package/dist/esm/adapters/REST/endpoints/space-member.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/space-membership.mjs +54 -0
- package/dist/esm/adapters/REST/endpoints/space-membership.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/space.mjs +31 -0
- package/dist/esm/adapters/REST/endpoints/space.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/tag.mjs +31 -0
- package/dist/esm/adapters/REST/endpoints/tag.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/task.mjs +34 -0
- package/dist/esm/adapters/REST/endpoints/task.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/team-membership.mjs +32 -0
- package/dist/esm/adapters/REST/endpoints/team-membership.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/team-space-membership.mjs +46 -0
- package/dist/esm/adapters/REST/endpoints/team-space-membership.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/team.mjs +32 -0
- package/dist/esm/adapters/REST/endpoints/team.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/ui-config.mjs +19 -0
- package/dist/esm/adapters/REST/endpoints/ui-config.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/upload-credentials.mjs +14 -0
- package/dist/esm/adapters/REST/endpoints/upload-credentials.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/upload.mjs +39 -0
- package/dist/esm/adapters/REST/endpoints/upload.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/usage.mjs +15 -0
- package/dist/esm/adapters/REST/endpoints/usage.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/user-ui-config.mjs +19 -0
- package/dist/esm/adapters/REST/endpoints/user-ui-config.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/user.mjs +22 -0
- package/dist/esm/adapters/REST/endpoints/user.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/utils.mjs +22 -0
- package/dist/esm/adapters/REST/endpoints/utils.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/webhook.mjs +85 -0
- package/dist/esm/adapters/REST/endpoints/webhook.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/workflow-definition.mjs +36 -0
- package/dist/esm/adapters/REST/endpoints/workflow-definition.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/workflow.mjs +42 -0
- package/dist/esm/adapters/REST/endpoints/workflow.mjs.map +1 -0
- package/dist/esm/adapters/REST/endpoints/workflows-changelog.mjs +10 -0
- package/dist/esm/adapters/REST/endpoints/workflows-changelog.mjs.map +1 -0
- package/dist/esm/adapters/REST/make-request.mjs +21 -0
- package/dist/esm/adapters/REST/make-request.mjs.map +1 -0
- package/dist/esm/adapters/REST/rest-adapter.mjs +42 -0
- package/dist/esm/adapters/REST/rest-adapter.mjs.map +1 -0
- package/dist/esm/common-types.mjs +7 -0
- package/dist/esm/common-types.mjs.map +1 -0
- package/dist/esm/common-utils.mjs +33 -0
- package/dist/esm/common-utils.mjs.map +1 -0
- package/dist/esm/constants/editor-interface-defaults/controls-defaults.mjs +162 -0
- package/dist/esm/constants/editor-interface-defaults/controls-defaults.mjs.map +1 -0
- package/dist/esm/constants/editor-interface-defaults/editors-defaults.mjs +32 -0
- package/dist/esm/constants/editor-interface-defaults/editors-defaults.mjs.map +1 -0
- package/dist/esm/constants/editor-interface-defaults/index.mjs +13 -0
- package/dist/esm/constants/editor-interface-defaults/index.mjs.map +1 -0
- package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.mjs +65 -0
- package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.mjs.map +1 -0
- package/dist/esm/constants/editor-interface-defaults/types.mjs +16 -0
- package/dist/esm/constants/editor-interface-defaults/types.mjs.map +1 -0
- package/dist/esm/create-adapter.mjs +20 -0
- package/dist/esm/create-adapter.mjs.map +1 -0
- package/dist/esm/create-app-definition-api.mjs +253 -0
- package/dist/esm/create-app-definition-api.mjs.map +1 -0
- package/dist/esm/create-contentful-api.mjs +588 -0
- package/dist/esm/create-contentful-api.mjs.map +1 -0
- package/dist/esm/create-entry-api.mjs +489 -0
- package/dist/esm/create-entry-api.mjs.map +1 -0
- package/dist/esm/create-environment-api.mjs +2441 -0
- package/dist/esm/create-environment-api.mjs.map +1 -0
- package/dist/esm/create-environment-template-api.mjs +272 -0
- package/dist/esm/create-environment-template-api.mjs.map +1 -0
- package/dist/esm/create-organization-api.mjs +1138 -0
- package/dist/esm/create-organization-api.mjs.map +1 -0
- package/dist/esm/create-space-api.mjs +1589 -0
- package/dist/esm/create-space-api.mjs.map +1 -0
- package/dist/esm/create-ui-config-api.mjs +54 -0
- package/dist/esm/create-ui-config-api.mjs.map +1 -0
- package/dist/esm/create-user-ui-config-api.mjs +54 -0
- package/dist/esm/create-user-ui-config-api.mjs.map +1 -0
- package/dist/esm/enhance-with-methods.mjs +25 -0
- package/dist/esm/enhance-with-methods.mjs.map +1 -0
- package/dist/esm/entities/access-token.mjs +34 -0
- package/dist/esm/entities/access-token.mjs.map +1 -0
- package/dist/esm/entities/ai-action-invocation.mjs +17 -0
- package/dist/esm/entities/ai-action-invocation.mjs.map +1 -0
- package/dist/esm/entities/ai-action.mjs +73 -0
- package/dist/esm/entities/ai-action.mjs.map +1 -0
- package/dist/esm/entities/api-key.mjs +54 -0
- package/dist/esm/entities/api-key.mjs.map +1 -0
- package/dist/esm/entities/app-access-token.mjs +16 -0
- package/dist/esm/entities/app-access-token.mjs.map +1 -0
- package/dist/esm/entities/app-action-call.mjs +66 -0
- package/dist/esm/entities/app-action-call.mjs.map +1 -0
- package/dist/esm/entities/app-action.mjs +46 -0
- package/dist/esm/entities/app-action.mjs.map +1 -0
- package/dist/esm/entities/app-bundle.mjs +46 -0
- package/dist/esm/entities/app-bundle.mjs.map +1 -0
- package/dist/esm/entities/app-definition.mjs +27 -0
- package/dist/esm/entities/app-definition.mjs.map +1 -0
- package/dist/esm/entities/app-details.mjs +38 -0
- package/dist/esm/entities/app-details.mjs.map +1 -0
- package/dist/esm/entities/app-event-subscription.mjs +33 -0
- package/dist/esm/entities/app-event-subscription.mjs.map +1 -0
- package/dist/esm/entities/app-installation.mjs +53 -0
- package/dist/esm/entities/app-installation.mjs.map +1 -0
- package/dist/esm/entities/app-key.mjs +42 -0
- package/dist/esm/entities/app-key.mjs.map +1 -0
- package/dist/esm/entities/app-signed-request.mjs +16 -0
- package/dist/esm/entities/app-signed-request.mjs.map +1 -0
- package/dist/esm/entities/app-signing-secret.mjs +33 -0
- package/dist/esm/entities/app-signing-secret.mjs.map +1 -0
- package/dist/esm/entities/app-upload.mjs +45 -0
- package/dist/esm/entities/app-upload.mjs.map +1 -0
- package/dist/esm/entities/asset-key.mjs +16 -0
- package/dist/esm/entities/asset-key.mjs.map +1 -0
- package/dist/esm/entities/asset.mjs +130 -0
- package/dist/esm/entities/asset.mjs.map +1 -0
- package/dist/esm/entities/bulk-action.mjs +59 -0
- package/dist/esm/entities/bulk-action.mjs.map +1 -0
- package/dist/esm/entities/comment.mjs +61 -0
- package/dist/esm/entities/comment.mjs.map +1 -0
- package/dist/esm/entities/content-type.mjs +118 -0
- package/dist/esm/entities/content-type.mjs.map +1 -0
- package/dist/esm/entities/editor-interface.mjs +48 -0
- package/dist/esm/entities/editor-interface.mjs.map +1 -0
- package/dist/esm/entities/entry.mjs +25 -0
- package/dist/esm/entities/entry.mjs.map +1 -0
- package/dist/esm/entities/environment-alias.mjs +56 -0
- package/dist/esm/entities/environment-alias.mjs.map +1 -0
- package/dist/esm/entities/environment-template-installation.mjs +21 -0
- package/dist/esm/entities/environment-template-installation.mjs.map +1 -0
- package/dist/esm/entities/environment-template.mjs +16 -0
- package/dist/esm/entities/environment-template.mjs.map +1 -0
- package/dist/esm/entities/environment.mjs +32 -0
- package/dist/esm/entities/environment.mjs.map +1 -0
- package/dist/esm/entities/extension.mjs +52 -0
- package/dist/esm/entities/extension.mjs.map +1 -0
- package/dist/esm/entities/function-log.mjs +24 -0
- package/dist/esm/entities/function-log.mjs.map +1 -0
- package/dist/esm/entities/function.mjs +64 -0
- package/dist/esm/entities/function.mjs.map +1 -0
- package/dist/esm/entities/index.mjs +117 -0
- package/dist/esm/entities/index.mjs.map +1 -0
- package/dist/esm/entities/locale.mjs +55 -0
- package/dist/esm/entities/locale.mjs.map +1 -0
- package/dist/esm/entities/oauth-application.mjs +64 -0
- package/dist/esm/entities/oauth-application.mjs.map +1 -0
- package/dist/esm/entities/organization-invitation.mjs +16 -0
- package/dist/esm/entities/organization-invitation.mjs.map +1 -0
- package/dist/esm/entities/organization-membership.mjs +51 -0
- package/dist/esm/entities/organization-membership.mjs.map +1 -0
- package/dist/esm/entities/organization.mjs +30 -0
- package/dist/esm/entities/organization.mjs.map +1 -0
- package/dist/esm/entities/personal-access-token.mjs +34 -0
- package/dist/esm/entities/personal-access-token.mjs.map +1 -0
- package/dist/esm/entities/preview-api-key.mjs +29 -0
- package/dist/esm/entities/preview-api-key.mjs.map +1 -0
- package/dist/esm/entities/release-action.mjs +53 -0
- package/dist/esm/entities/release-action.mjs.map +1 -0
- package/dist/esm/entities/release.mjs +107 -0
- package/dist/esm/entities/release.mjs.map +1 -0
- package/dist/esm/entities/resource-provider.mjs +138 -0
- package/dist/esm/entities/resource-provider.mjs.map +1 -0
- package/dist/esm/entities/resource-type.mjs +95 -0
- package/dist/esm/entities/resource-type.mjs.map +1 -0
- package/dist/esm/entities/resource.mjs +11 -0
- package/dist/esm/entities/resource.mjs.map +1 -0
- package/dist/esm/entities/role.mjs +51 -0
- package/dist/esm/entities/role.mjs.map +1 -0
- package/dist/esm/entities/scheduled-action.mjs +147 -0
- package/dist/esm/entities/scheduled-action.mjs.map +1 -0
- package/dist/esm/entities/snapshot.mjs +34 -0
- package/dist/esm/entities/snapshot.mjs.map +1 -0
- package/dist/esm/entities/space-member.mjs +21 -0
- package/dist/esm/entities/space-member.mjs.map +1 -0
- package/dist/esm/entities/space-membership.mjs +51 -0
- package/dist/esm/entities/space-membership.mjs.map +1 -0
- package/dist/esm/entities/space.mjs +31 -0
- package/dist/esm/entities/space.mjs.map +1 -0
- package/dist/esm/entities/tag.mjs +54 -0
- package/dist/esm/entities/tag.mjs.map +1 -0
- package/dist/esm/entities/task.mjs +55 -0
- package/dist/esm/entities/task.mjs.map +1 -0
- package/dist/esm/entities/team-membership.mjs +52 -0
- package/dist/esm/entities/team-membership.mjs.map +1 -0
- package/dist/esm/entities/team-space-membership.mjs +51 -0
- package/dist/esm/entities/team-space-membership.mjs.map +1 -0
- package/dist/esm/entities/team.mjs +51 -0
- package/dist/esm/entities/team.mjs.map +1 -0
- package/dist/esm/entities/ui-config.mjs +19 -0
- package/dist/esm/entities/ui-config.mjs.map +1 -0
- package/dist/esm/entities/upload.mjs +37 -0
- package/dist/esm/entities/upload.mjs.map +1 -0
- package/dist/esm/entities/usage.mjs +23 -0
- package/dist/esm/entities/usage.mjs.map +1 -0
- package/dist/esm/entities/user-ui-config.mjs +19 -0
- package/dist/esm/entities/user-ui-config.mjs.map +1 -0
- package/dist/esm/entities/user.mjs +26 -0
- package/dist/esm/entities/user.mjs.map +1 -0
- package/dist/esm/entities/webhook.mjs +75 -0
- package/dist/esm/entities/webhook.mjs.map +1 -0
- package/dist/esm/entities/workflow-definition.mjs +29 -0
- package/dist/esm/entities/workflow-definition.mjs.map +1 -0
- package/dist/esm/index.mjs +40 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/methods/action.mjs +49 -0
- package/dist/esm/methods/action.mjs.map +1 -0
- package/dist/esm/methods/content-type.mjs +47 -0
- package/dist/esm/methods/content-type.mjs.map +1 -0
- package/dist/esm/methods/utils.mjs +10 -0
- package/dist/esm/methods/utils.mjs.map +1 -0
- package/dist/esm/plain/as-iterator.mjs +37 -0
- package/dist/esm/plain/as-iterator.mjs.map +1 -0
- package/dist/esm/plain/checks.mjs +11 -0
- package/dist/esm/plain/checks.mjs.map +1 -0
- package/dist/esm/plain/pagination-helper.mjs +68 -0
- package/dist/esm/plain/pagination-helper.mjs.map +1 -0
- package/dist/esm/plain/plain-client.mjs +564 -0
- package/dist/esm/plain/plain-client.mjs.map +1 -0
- package/dist/esm/plain/wrappers/wrap.mjs +25 -0
- package/dist/esm/plain/wrappers/wrap.mjs.map +1 -0
- package/dist/esm/upload-http-client.mjs +15 -0
- package/dist/esm/upload-http-client.mjs.map +1 -0
- package/dist/types/adapters/REST/endpoints/access-token.d.ts +111 -0
- package/dist/types/adapters/REST/endpoints/access-token.js +131 -0
- package/dist/types/adapters/REST/endpoints/access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action-invocation.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/ai-action-invocation.js +8 -0
- package/dist/types/adapters/REST/endpoints/ai-action-invocation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ai-action.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/ai-action.js +49 -0
- package/dist/types/adapters/REST/endpoints/ai-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/api-key.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/api-key.js +44 -0
- package/dist/types/adapters/REST/endpoints/api-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-access-token.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/app-access-token.js +8 -0
- package/dist/types/adapters/REST/endpoints/app-access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-action-call.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/app-action-call.js +112 -0
- package/dist/types/adapters/REST/endpoints/app-action-call.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-action.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/app-action.js +36 -0
- package/dist/types/adapters/REST/endpoints/app-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-bundle.d.ts +5 -0
- package/dist/types/adapters/REST/endpoints/app-bundle.js +35 -0
- package/dist/types/adapters/REST/endpoints/app-bundle.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-definition.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/app-definition.js +45 -0
- package/dist/types/adapters/REST/endpoints/app-definition.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-details.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/app-details.js +14 -0
- package/dist/types/adapters/REST/endpoints/app-details.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-event-subscription.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/app-event-subscription.js +14 -0
- package/dist/types/adapters/REST/endpoints/app-event-subscription.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-installation.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/app-installation.js +42 -0
- package/dist/types/adapters/REST/endpoints/app-installation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-key.d.ts +5 -0
- package/dist/types/adapters/REST/endpoints/app-key.js +17 -0
- package/dist/types/adapters/REST/endpoints/app-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-signed-request.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/app-signed-request.js +8 -0
- package/dist/types/adapters/REST/endpoints/app-signed-request.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-signing-secret.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/app-signing-secret.js +14 -0
- package/dist/types/adapters/REST/endpoints/app-signing-secret.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/app-upload.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/app-upload.js +25 -0
- package/dist/types/adapters/REST/endpoints/app-upload.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/asset-key.d.ts +5 -0
- package/dist/types/adapters/REST/endpoints/asset-key.js +32 -0
- package/dist/types/adapters/REST/endpoints/asset-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/asset.d.ts +15 -0
- package/dist/types/adapters/REST/endpoints/asset.js +208 -0
- package/dist/types/adapters/REST/endpoints/asset.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/bulk-action.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/bulk-action.js +29 -0
- package/dist/types/adapters/REST/endpoints/bulk-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/comment.d.ts +10 -0
- package/dist/types/adapters/REST/endpoints/comment.js +91 -0
- package/dist/types/adapters/REST/endpoints/comment.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/concept-scheme.d.ts +10 -0
- package/dist/types/adapters/REST/endpoints/concept-scheme.js +54 -0
- package/dist/types/adapters/REST/endpoints/concept-scheme.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/concept.d.ts +12 -0
- package/dist/types/adapters/REST/endpoints/concept.js +70 -0
- package/dist/types/adapters/REST/endpoints/concept.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/content-type.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/content-type.js +53 -0
- package/dist/types/adapters/REST/endpoints/content-type.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/editor-interface.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/editor-interface.js +23 -0
- package/dist/types/adapters/REST/endpoints/editor-interface.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/entry.d.ts +14 -0
- package/dist/types/adapters/REST/endpoints/entry.js +114 -0
- package/dist/types/adapters/REST/endpoints/entry.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-alias.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/environment-alias.js +41 -0
- package/dist/types/adapters/REST/endpoints/environment-alias.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template-installation.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js +21 -0
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment-template.d.ts +11 -0
- package/dist/types/adapters/REST/endpoints/environment-template.js +41 -0
- package/dist/types/adapters/REST/endpoints/environment-template.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/environment.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/environment.js +46 -0
- package/dist/types/adapters/REST/endpoints/environment.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/extension.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/extension.js +39 -0
- package/dist/types/adapters/REST/endpoints/extension.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/function-log.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/function-log.js +25 -0
- package/dist/types/adapters/REST/endpoints/function-log.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/function.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/function.js +22 -0
- package/dist/types/adapters/REST/endpoints/function.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/http.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/http.js +23 -0
- package/dist/types/adapters/REST/endpoints/http.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/index.d.ts +139 -0
- package/dist/types/adapters/REST/endpoints/index.js +142 -0
- package/dist/types/adapters/REST/endpoints/index.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/locale.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/locale.js +34 -0
- package/dist/types/adapters/REST/endpoints/locale.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/oauth-application.d.ts +122 -0
- package/dist/types/adapters/REST/endpoints/oauth-application.js +142 -0
- package/dist/types/adapters/REST/endpoints/oauth-application.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization-invitation.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/organization-invitation.js +27 -0
- package/dist/types/adapters/REST/endpoints/organization-invitation.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization-membership.d.ts +5 -0
- package/dist/types/adapters/REST/endpoints/organization-membership.js +30 -0
- package/dist/types/adapters/REST/endpoints/organization-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/organization.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/organization.js +26 -0
- package/dist/types/adapters/REST/endpoints/organization.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/personal-access-token.d.ts +17 -0
- package/dist/types/adapters/REST/endpoints/personal-access-token.js +33 -0
- package/dist/types/adapters/REST/endpoints/personal-access-token.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/preview-api-key.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/preview-api-key.js +13 -0
- package/dist/types/adapters/REST/endpoints/preview-api-key.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/raw.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/raw.js +55 -0
- package/dist/types/adapters/REST/endpoints/raw.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-action.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/release-action.js +21 -0
- package/dist/types/adapters/REST/endpoints/release-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-asset.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/release-asset.js +143 -0
- package/dist/types/adapters/REST/endpoints/release-asset.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release-entry.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/release-entry.js +56 -0
- package/dist/types/adapters/REST/endpoints/release-entry.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/release.d.ts +11 -0
- package/dist/types/adapters/REST/endpoints/release.js +73 -0
- package/dist/types/adapters/REST/endpoints/release.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource-provider.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/resource-provider.js +15 -0
- package/dist/types/adapters/REST/endpoints/resource-provider.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource-type.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/resource-type.js +25 -0
- package/dist/types/adapters/REST/endpoints/resource-type.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/resource.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/resource.js +9 -0
- package/dist/types/adapters/REST/endpoints/resource.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/role.d.ts +12 -0
- package/dist/types/adapters/REST/endpoints/role.js +43 -0
- package/dist/types/adapters/REST/endpoints/role.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/scheduled-action.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/scheduled-action.js +38 -0
- package/dist/types/adapters/REST/endpoints/scheduled-action.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/snapshot.d.ts +5 -0
- package/dist/types/adapters/REST/endpoints/snapshot.js +26 -0
- package/dist/types/adapters/REST/endpoints/snapshot.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space-member.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/space-member.js +9 -0
- package/dist/types/adapters/REST/endpoints/space-member.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space-membership.d.ts +9 -0
- package/dist/types/adapters/REST/endpoints/space-membership.js +54 -0
- package/dist/types/adapters/REST/endpoints/space-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/space.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/space.js +31 -0
- package/dist/types/adapters/REST/endpoints/space.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/tag.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/tag.js +31 -0
- package/dist/types/adapters/REST/endpoints/tag.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/task.d.ts +10 -0
- package/dist/types/adapters/REST/endpoints/task.js +34 -0
- package/dist/types/adapters/REST/endpoints/task.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team-membership.d.ts +10 -0
- package/dist/types/adapters/REST/endpoints/team-membership.js +32 -0
- package/dist/types/adapters/REST/endpoints/team-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team-space-membership.d.ts +8 -0
- package/dist/types/adapters/REST/endpoints/team-space-membership.js +46 -0
- package/dist/types/adapters/REST/endpoints/team-space-membership.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/team.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/team.js +32 -0
- package/dist/types/adapters/REST/endpoints/team.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/ui-config.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/ui-config.js +19 -0
- package/dist/types/adapters/REST/endpoints/ui-config.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/upload-credentials.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/upload-credentials.js +14 -0
- package/dist/types/adapters/REST/endpoints/upload-credentials.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/upload.d.ts +4 -0
- package/dist/types/adapters/REST/endpoints/upload.js +39 -0
- package/dist/types/adapters/REST/endpoints/upload.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/usage.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/usage.js +15 -0
- package/dist/types/adapters/REST/endpoints/usage.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/user-ui-config.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/user-ui-config.js +19 -0
- package/dist/types/adapters/REST/endpoints/user-ui-config.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/user.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/user.js +22 -0
- package/dist/types/adapters/REST/endpoints/user.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/utils.d.ts +3 -0
- package/dist/types/adapters/REST/endpoints/utils.js +22 -0
- package/dist/types/adapters/REST/endpoints/utils.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/webhook.d.ts +29 -0
- package/dist/types/adapters/REST/endpoints/webhook.js +85 -0
- package/dist/types/adapters/REST/endpoints/webhook.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflow-definition.d.ts +6 -0
- package/dist/types/adapters/REST/endpoints/workflow-definition.js +36 -0
- package/dist/types/adapters/REST/endpoints/workflow-definition.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflow.d.ts +7 -0
- package/dist/types/adapters/REST/endpoints/workflow.js +42 -0
- package/dist/types/adapters/REST/endpoints/workflow.js.map +1 -0
- package/dist/types/adapters/REST/endpoints/workflows-changelog.d.ts +2 -0
- package/dist/types/adapters/REST/endpoints/workflows-changelog.js +10 -0
- package/dist/types/adapters/REST/endpoints/workflows-changelog.js.map +1 -0
- package/dist/types/adapters/REST/make-request.d.ts +7 -0
- package/dist/types/adapters/REST/make-request.js +21 -0
- package/dist/types/adapters/REST/make-request.js.map +1 -0
- package/dist/types/adapters/REST/rest-adapter.d.ts +25 -0
- package/dist/types/adapters/REST/rest-adapter.js +42 -0
- package/dist/types/adapters/REST/rest-adapter.js.map +1 -0
- package/dist/types/adapters/REST/types.d.ts +6 -0
- package/dist/types/common-types.d.ts +2951 -0
- package/dist/types/common-types.js +7 -0
- package/dist/types/common-types.js.map +1 -0
- package/dist/types/common-utils.d.ts +9 -0
- package/dist/types/common-utils.js +33 -0
- package/dist/types/common-utils.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/controls-defaults.d.ts +244 -0
- package/dist/types/constants/editor-interface-defaults/controls-defaults.js +162 -0
- package/dist/types/constants/editor-interface-defaults/controls-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/editors-defaults.d.ts +23 -0
- package/dist/types/constants/editor-interface-defaults/editors-defaults.js +32 -0
- package/dist/types/constants/editor-interface-defaults/editors-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/index.d.ts +22 -0
- package/dist/types/constants/editor-interface-defaults/index.js +13 -0
- package/dist/types/constants/editor-interface-defaults/index.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/sidebar-defaults.d.ts +13 -0
- package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js +65 -0
- package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js.map +1 -0
- package/dist/types/constants/editor-interface-defaults/types.d.ts +12 -0
- package/dist/types/constants/editor-interface-defaults/types.js +16 -0
- package/dist/types/constants/editor-interface-defaults/types.js.map +1 -0
- package/dist/types/create-adapter.d.ts +13 -0
- package/dist/types/create-adapter.js +20 -0
- package/dist/types/create-adapter.js.map +1 -0
- package/dist/types/create-app-definition-api.d.ts +169 -0
- package/dist/types/create-app-definition-api.js +253 -0
- package/dist/types/create-app-definition-api.js.map +1 -0
- package/dist/types/create-contentful-api.d.ts +445 -0
- package/dist/types/create-contentful-api.js +588 -0
- package/dist/types/create-contentful-api.js.map +1 -0
- package/dist/types/create-entry-api.d.ts +331 -0
- package/dist/types/create-entry-api.js +489 -0
- package/dist/types/create-entry-api.js.map +1 -0
- package/dist/types/create-environment-api.d.ts +1688 -0
- package/dist/types/create-environment-api.js +2441 -0
- package/dist/types/create-environment-api.js.map +1 -0
- package/dist/types/create-environment-template-api.d.ts +198 -0
- package/dist/types/create-environment-template-api.js +272 -0
- package/dist/types/create-environment-template-api.js.map +1 -0
- package/dist/types/create-organization-api.d.ts +1180 -0
- package/dist/types/create-organization-api.js +1138 -0
- package/dist/types/create-organization-api.js.map +1 -0
- package/dist/types/create-space-api.d.ts +1150 -0
- package/dist/types/create-space-api.js +1589 -0
- package/dist/types/create-space-api.js.map +1 -0
- package/dist/types/create-ui-config-api.d.ts +34 -0
- package/dist/types/create-ui-config-api.js +54 -0
- package/dist/types/create-ui-config-api.js.map +1 -0
- package/dist/types/create-user-ui-config-api.d.ts +34 -0
- package/dist/types/create-user-ui-config-api.js +54 -0
- package/dist/types/create-user-ui-config-api.js.map +1 -0
- package/dist/types/enhance-with-methods.d.ts +12 -0
- package/dist/types/enhance-with-methods.js +25 -0
- package/dist/types/enhance-with-methods.js.map +1 -0
- package/dist/types/entities/access-token.d.ts +61 -0
- package/dist/types/entities/access-token.js +34 -0
- package/dist/types/entities/access-token.js.map +1 -0
- package/dist/types/entities/ai-action-invocation.d.ts +82 -0
- package/dist/types/entities/ai-action-invocation.js +17 -0
- package/dist/types/entities/ai-action-invocation.js.map +1 -0
- package/dist/types/entities/ai-action.d.ts +75 -0
- package/dist/types/entities/ai-action.js +73 -0
- package/dist/types/entities/ai-action.js.map +1 -0
- package/dist/types/entities/api-key.d.ts +70 -0
- package/dist/types/entities/api-key.js +54 -0
- package/dist/types/entities/api-key.js.map +1 -0
- package/dist/types/entities/app-access-token.d.ts +34 -0
- package/dist/types/entities/app-access-token.js +16 -0
- package/dist/types/entities/app-access-token.js.map +1 -0
- package/dist/types/entities/app-action-call.d.ts +92 -0
- package/dist/types/entities/app-action-call.js +66 -0
- package/dist/types/entities/app-action-call.js.map +1 -0
- package/dist/types/entities/app-action.d.ts +161 -0
- package/dist/types/entities/app-action.js +46 -0
- package/dist/types/entities/app-action.js.map +1 -0
- package/dist/types/entities/app-bundle.d.ts +86 -0
- package/dist/types/entities/app-bundle.js +46 -0
- package/dist/types/entities/app-bundle.js.map +1 -0
- package/dist/types/entities/app-definition.d.ts +88 -0
- package/dist/types/entities/app-definition.js +27 -0
- package/dist/types/entities/app-definition.js.map +1 -0
- package/dist/types/entities/app-details.d.ts +54 -0
- package/dist/types/entities/app-details.js +38 -0
- package/dist/types/entities/app-details.js.map +1 -0
- package/dist/types/entities/app-event-subscription.d.ts +50 -0
- package/dist/types/entities/app-event-subscription.js +33 -0
- package/dist/types/entities/app-event-subscription.js.map +1 -0
- package/dist/types/entities/app-installation.d.ts +70 -0
- package/dist/types/entities/app-installation.js +53 -0
- package/dist/types/entities/app-installation.js.map +1 -0
- package/dist/types/entities/app-key.d.ts +77 -0
- package/dist/types/entities/app-key.js +42 -0
- package/dist/types/entities/app-key.js.map +1 -0
- package/dist/types/entities/app-signed-request.d.ts +42 -0
- package/dist/types/entities/app-signed-request.js +16 -0
- package/dist/types/entities/app-signed-request.js.map +1 -0
- package/dist/types/entities/app-signing-secret.d.ts +45 -0
- package/dist/types/entities/app-signing-secret.js +33 -0
- package/dist/types/entities/app-signing-secret.js.map +1 -0
- package/dist/types/entities/app-upload.d.ts +44 -0
- package/dist/types/entities/app-upload.js +45 -0
- package/dist/types/entities/app-upload.js.map +1 -0
- package/dist/types/entities/asset-key.d.ts +20 -0
- package/dist/types/entities/asset-key.js +16 -0
- package/dist/types/entities/asset-key.js.map +1 -0
- package/dist/types/entities/asset.d.ts +278 -0
- package/dist/types/entities/asset.js +130 -0
- package/dist/types/entities/asset.js.map +1 -0
- package/dist/types/entities/bulk-action.d.ts +122 -0
- package/dist/types/entities/bulk-action.js +59 -0
- package/dist/types/entities/bulk-action.js.map +1 -0
- package/dist/types/entities/comment.d.ts +102 -0
- package/dist/types/entities/comment.js +61 -0
- package/dist/types/entities/comment.js.map +1 -0
- package/dist/types/entities/concept-scheme.d.ts +22 -0
- package/dist/types/entities/concept.d.ts +30 -0
- package/dist/types/entities/content-type-fields.d.ts +81 -0
- package/dist/types/entities/content-type.d.ts +213 -0
- package/dist/types/entities/content-type.js +118 -0
- package/dist/types/entities/content-type.js.map +1 -0
- package/dist/types/entities/editor-interface.d.ts +168 -0
- package/dist/types/entities/editor-interface.js +48 -0
- package/dist/types/entities/editor-interface.js.map +1 -0
- package/dist/types/entities/entry.d.ts +53 -0
- package/dist/types/entities/entry.js +25 -0
- package/dist/types/entities/entry.js.map +1 -0
- package/dist/types/entities/environment-alias.d.ts +74 -0
- package/dist/types/entities/environment-alias.js +56 -0
- package/dist/types/entities/environment-alias.js.map +1 -0
- package/dist/types/entities/environment-template-installation.d.ts +57 -0
- package/dist/types/entities/environment-template-installation.js +21 -0
- package/dist/types/entities/environment-template-installation.js.map +1 -0
- package/dist/types/entities/environment-template.d.ts +40 -0
- package/dist/types/entities/environment-template.js +16 -0
- package/dist/types/entities/environment-template.js.map +1 -0
- package/dist/types/entities/environment.d.ts +38 -0
- package/dist/types/entities/environment.js +32 -0
- package/dist/types/entities/environment.js.map +1 -0
- package/dist/types/entities/extension.d.ts +103 -0
- package/dist/types/entities/extension.js +52 -0
- package/dist/types/entities/extension.js.map +1 -0
- package/dist/types/entities/field-type.d.ts +51 -0
- package/dist/types/entities/function-log.d.ts +46 -0
- package/dist/types/entities/function-log.js +24 -0
- package/dist/types/entities/function-log.js.map +1 -0
- package/dist/types/entities/function.d.ts +32 -0
- package/dist/types/entities/function.js +64 -0
- package/dist/types/entities/function.js.map +1 -0
- package/dist/types/entities/index.d.ts +127 -0
- package/dist/types/entities/index.js +117 -0
- package/dist/types/entities/index.js.map +1 -0
- package/dist/types/entities/locale.d.ts +95 -0
- package/dist/types/entities/locale.js +55 -0
- package/dist/types/entities/locale.js.map +1 -0
- package/dist/types/entities/oauth-application.d.ts +56 -0
- package/dist/types/entities/oauth-application.js +64 -0
- package/dist/types/entities/oauth-application.js.map +1 -0
- package/dist/types/entities/organization-invitation.d.ts +25 -0
- package/dist/types/entities/organization-invitation.js +16 -0
- package/dist/types/entities/organization-invitation.js.map +1 -0
- package/dist/types/entities/organization-membership.d.ts +69 -0
- package/dist/types/entities/organization-membership.js +51 -0
- package/dist/types/entities/organization-membership.js.map +1 -0
- package/dist/types/entities/organization.d.ts +33 -0
- package/dist/types/entities/organization.js +30 -0
- package/dist/types/entities/organization.js.map +1 -0
- package/dist/types/entities/personal-access-token.d.ts +51 -0
- package/dist/types/entities/personal-access-token.js +34 -0
- package/dist/types/entities/personal-access-token.js.map +1 -0
- package/dist/types/entities/preview-api-key.d.ts +20 -0
- package/dist/types/entities/preview-api-key.js +29 -0
- package/dist/types/entities/preview-api-key.js.map +1 -0
- package/dist/types/entities/release-action.d.ts +58 -0
- package/dist/types/entities/release-action.js +53 -0
- package/dist/types/entities/release-action.js.map +1 -0
- package/dist/types/entities/release.d.ts +142 -0
- package/dist/types/entities/release.js +107 -0
- package/dist/types/entities/release.js.map +1 -0
- package/dist/types/entities/resource-provider.d.ts +38 -0
- package/dist/types/entities/resource-provider.js +138 -0
- package/dist/types/entities/resource-provider.js.map +1 -0
- package/dist/types/entities/resource-type.d.ts +52 -0
- package/dist/types/entities/resource-type.js +95 -0
- package/dist/types/entities/resource-type.js.map +1 -0
- package/dist/types/entities/resource.d.ts +38 -0
- package/dist/types/entities/resource.js +11 -0
- package/dist/types/entities/resource.js.map +1 -0
- package/dist/types/entities/role.d.ts +85 -0
- package/dist/types/entities/role.js +51 -0
- package/dist/types/entities/role.js.map +1 -0
- package/dist/types/entities/scheduled-action.d.ts +112 -0
- package/dist/types/entities/scheduled-action.js +147 -0
- package/dist/types/entities/scheduled-action.js.map +1 -0
- package/dist/types/entities/snapshot.d.ts +24 -0
- package/dist/types/entities/snapshot.js +34 -0
- package/dist/types/entities/snapshot.js.map +1 -0
- package/dist/types/entities/space-member.d.ts +31 -0
- package/dist/types/entities/space-member.js +21 -0
- package/dist/types/entities/space-member.js.map +1 -0
- package/dist/types/entities/space-membership.d.ts +64 -0
- package/dist/types/entities/space-membership.js +51 -0
- package/dist/types/entities/space-membership.js.map +1 -0
- package/dist/types/entities/space.d.ts +31 -0
- package/dist/types/entities/space.js +31 -0
- package/dist/types/entities/space.js.map +1 -0
- package/dist/types/entities/tag.d.ts +51 -0
- package/dist/types/entities/tag.js +54 -0
- package/dist/types/entities/tag.js.map +1 -0
- package/dist/types/entities/task.d.ts +43 -0
- package/dist/types/entities/task.js +55 -0
- package/dist/types/entities/task.js.map +1 -0
- package/dist/types/entities/team-membership.d.ts +78 -0
- package/dist/types/entities/team-membership.js +52 -0
- package/dist/types/entities/team-membership.js.map +1 -0
- package/dist/types/entities/team-space-membership.d.ts +88 -0
- package/dist/types/entities/team-space-membership.js +51 -0
- package/dist/types/entities/team-space-membership.js.map +1 -0
- package/dist/types/entities/team.d.ts +73 -0
- package/dist/types/entities/team.js +51 -0
- package/dist/types/entities/team.js.map +1 -0
- package/dist/types/entities/ui-config.d.ts +59 -0
- package/dist/types/entities/ui-config.js +19 -0
- package/dist/types/entities/ui-config.js.map +1 -0
- package/dist/types/entities/upload-credential.d.ts +43 -0
- package/dist/types/entities/upload.d.ts +41 -0
- package/dist/types/entities/upload.js +37 -0
- package/dist/types/entities/upload.js.map +1 -0
- package/dist/types/entities/usage.d.ts +55 -0
- package/dist/types/entities/usage.js +23 -0
- package/dist/types/entities/usage.js.map +1 -0
- package/dist/types/entities/user-ui-config.d.ts +46 -0
- package/dist/types/entities/user-ui-config.js +19 -0
- package/dist/types/entities/user-ui-config.js.map +1 -0
- package/dist/types/entities/user.d.ts +57 -0
- package/dist/types/entities/user.js +26 -0
- package/dist/types/entities/user.js.map +1 -0
- package/dist/types/entities/utils.d.ts +5 -0
- package/dist/types/entities/webhook.d.ts +279 -0
- package/dist/types/entities/webhook.js +75 -0
- package/dist/types/entities/webhook.js.map +1 -0
- package/dist/types/entities/widget-parameters.d.ts +21 -0
- package/dist/types/entities/workflow-definition.d.ts +118 -0
- package/dist/types/entities/workflow-definition.js +29 -0
- package/dist/types/entities/workflow-definition.js.map +1 -0
- package/dist/types/entities/workflow.d.ts +64 -0
- package/dist/types/entities/workflows-changelog-entry.d.ts +33 -0
- package/dist/types/export-types.d.ts +70 -0
- package/dist/types/index.d.ts +66 -0
- package/dist/types/index.js +40 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/methods/action.d.ts +42 -0
- package/dist/types/methods/action.js +49 -0
- package/dist/types/methods/action.js.map +1 -0
- package/dist/types/methods/content-type.d.ts +5 -0
- package/dist/types/methods/content-type.js +47 -0
- package/dist/types/methods/content-type.js.map +1 -0
- package/dist/types/methods/release-action.d.ts +15 -0
- package/dist/types/methods/utils.d.ts +5 -0
- package/dist/types/methods/utils.js +10 -0
- package/dist/types/methods/utils.js.map +1 -0
- package/dist/types/plain/as-iterator.d.ts +5 -0
- package/dist/types/plain/as-iterator.js +37 -0
- package/dist/types/plain/as-iterator.js.map +1 -0
- package/dist/types/plain/checks.d.ts +13 -0
- package/dist/types/plain/checks.js +11 -0
- package/dist/types/plain/checks.js.map +1 -0
- package/dist/types/plain/common-types.d.ts +464 -0
- package/dist/types/plain/entities/ai-action-invocation.d.ts +18 -0
- package/dist/types/plain/entities/ai-action.d.ts +84 -0
- package/dist/types/plain/entities/app-access-token.d.ts +29 -0
- package/dist/types/plain/entities/app-action-call.d.ts +147 -0
- package/dist/types/plain/entities/app-action.d.ts +157 -0
- package/dist/types/plain/entities/app-bundle.d.ts +67 -0
- package/dist/types/plain/entities/app-definition.d.ts +100 -0
- package/dist/types/plain/entities/app-details.d.ts +56 -0
- package/dist/types/plain/entities/app-event-subscription.d.ts +75 -0
- package/dist/types/plain/entities/app-installation.d.ts +87 -0
- package/dist/types/plain/entities/app-key.d.ts +91 -0
- package/dist/types/plain/entities/app-signed-request.d.ts +34 -0
- package/dist/types/plain/entities/app-signing-secret.d.ts +49 -0
- package/dist/types/plain/entities/app-upload.d.ts +55 -0
- package/dist/types/plain/entities/comment.d.ts +198 -0
- package/dist/types/plain/entities/concept-scheme.d.ts +136 -0
- package/dist/types/plain/entities/concept.d.ts +164 -0
- package/dist/types/plain/entities/editor-interface.d.ts +67 -0
- package/dist/types/plain/entities/environment-alias.d.ts +99 -0
- package/dist/types/plain/entities/environment.d.ts +116 -0
- package/dist/types/plain/entities/extension.d.ts +157 -0
- package/dist/types/plain/entities/function-log.d.ts +51 -0
- package/dist/types/plain/entities/function.d.ts +51 -0
- package/dist/types/plain/entities/locale.d.ts +112 -0
- package/dist/types/plain/entities/oauth-application.d.ts +90 -0
- package/dist/types/plain/entities/organization.d.ts +33 -0
- package/dist/types/plain/entities/resource-provider.d.ts +59 -0
- package/dist/types/plain/entities/resource-type.d.ts +14 -0
- package/dist/types/plain/entities/resource.d.ts +40 -0
- package/dist/types/plain/entities/role.d.ts +206 -0
- package/dist/types/plain/entities/space-member.d.ts +32 -0
- package/dist/types/plain/entities/space-membership.d.ts +155 -0
- package/dist/types/plain/entities/space.d.ts +102 -0
- package/dist/types/plain/entities/tag.d.ts +103 -0
- package/dist/types/plain/entities/task.d.ts +114 -0
- package/dist/types/plain/entities/team-membership.d.ts +110 -0
- package/dist/types/plain/entities/team-space-membership.d.ts +127 -0
- package/dist/types/plain/entities/team.d.ts +105 -0
- package/dist/types/plain/entities/ui-config.d.ts +44 -0
- package/dist/types/plain/entities/upload-credential.d.ts +38 -0
- package/dist/types/plain/entities/upload.d.ts +57 -0
- package/dist/types/plain/entities/usage.d.ts +49 -0
- package/dist/types/plain/entities/user-ui-config.d.ts +44 -0
- package/dist/types/plain/entities/user.d.ts +80 -0
- package/dist/types/plain/entities/webhook.d.ts +186 -0
- package/dist/types/plain/entities/workflow-definition.d.ts +90 -0
- package/dist/types/plain/entities/workflow.d.ts +118 -0
- package/dist/types/plain/entities/workflows-changelog.d.ts +26 -0
- package/dist/types/plain/pagination-helper.d.ts +22 -0
- package/dist/types/plain/pagination-helper.js +68 -0
- package/dist/types/plain/pagination-helper.js.map +1 -0
- package/dist/types/plain/plain-client.d.ts +8 -0
- package/dist/types/plain/plain-client.js +564 -0
- package/dist/types/plain/plain-client.js.map +1 -0
- package/dist/types/plain/wrappers/wrap.d.ts +32 -0
- package/dist/types/plain/wrappers/wrap.js +25 -0
- package/dist/types/plain/wrappers/wrap.js.map +1 -0
- package/dist/types/plain/wrappers/wrap.test-d.d.ts +1 -0
- package/dist/types/upload-http-client.d.ts +9 -0
- package/dist/types/upload-http-client.js +15 -0
- package/dist/types/upload-http-client.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1138 @@
|
|
|
1
|
+
import { createRequestConfig } from 'contentful-sdk-core';
|
|
2
|
+
import entities from './entities/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates API object with methods to access the Organization API
|
|
6
|
+
* @param {MakeRequest} makeRequest - function to make requests via an adapter
|
|
7
|
+
* @return {ContentfulOrganizationAPI}
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
function createOrganizationApi(makeRequest) {
|
|
11
|
+
const { wrapAppDefinition, wrapAppDefinitionCollection } = entities.appDefinition;
|
|
12
|
+
const { wrapUser, wrapUserCollection } = entities.user;
|
|
13
|
+
const { wrapOrganizationMembership, wrapOrganizationMembershipCollection } = entities.organizationMembership;
|
|
14
|
+
const { wrapTeamMembership, wrapTeamMembershipCollection } = entities.teamMembership;
|
|
15
|
+
const { wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection } = entities.teamSpaceMembership;
|
|
16
|
+
const { wrapTeam, wrapTeamCollection } = entities.team;
|
|
17
|
+
const { wrapSpaceMembership, wrapSpaceMembershipCollection } = entities.spaceMembership;
|
|
18
|
+
const { wrapOrganizationInvitation } = entities.organizationInvitation;
|
|
19
|
+
const { wrapAppUpload } = entities.appUpload;
|
|
20
|
+
const { wrapAppSigningSecret } = entities.appSigningSecret;
|
|
21
|
+
const { wrapAppEventSubscription } = entities.appEventSubscription;
|
|
22
|
+
const { wrapAppKey, wrapAppKeyCollection } = entities.appKey;
|
|
23
|
+
const { wrapAppDetails } = entities.appDetails;
|
|
24
|
+
const { wrapAppAction, wrapAppActionCollection } = entities.appAction;
|
|
25
|
+
const { wrapFunction, wrapFunctionCollection } = entities.func;
|
|
26
|
+
const { wrapRoleCollection } = entities.role;
|
|
27
|
+
const { wrapSpaceCollection } = entities.space;
|
|
28
|
+
return {
|
|
29
|
+
/**
|
|
30
|
+
* Gets a collection of spaces in the organization
|
|
31
|
+
* @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.
|
|
32
|
+
* @return Promise a collection of Spaces in the organization
|
|
33
|
+
* @example ```javascript
|
|
34
|
+
* const contentful = require('contentful-management')
|
|
35
|
+
* const client = contentful.createClient({
|
|
36
|
+
* accessToken: '<content_management_api_key>'
|
|
37
|
+
* })
|
|
38
|
+
*
|
|
39
|
+
* client.getOrganization('<organization_id>')
|
|
40
|
+
* .then((organization) => organization.getSpaces())
|
|
41
|
+
* .then((spaces) => console.log(spaces))
|
|
42
|
+
* .catch(console.error)
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
getSpaces(query = {}) {
|
|
46
|
+
const raw = this.toPlainObject();
|
|
47
|
+
return makeRequest({
|
|
48
|
+
entityType: 'Space',
|
|
49
|
+
action: 'getManyForOrganization',
|
|
50
|
+
params: {
|
|
51
|
+
organizationId: raw.sys.id,
|
|
52
|
+
query: createRequestConfig({ query }).params,
|
|
53
|
+
},
|
|
54
|
+
}).then((data) => wrapSpaceCollection(makeRequest, data));
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Gets a User
|
|
58
|
+
* @return Promise for a User
|
|
59
|
+
* @example ```javascript
|
|
60
|
+
* const contentful = require('contentful-management')
|
|
61
|
+
* const client = contentful.createClient({
|
|
62
|
+
* accessToken: '<content_management_api_key>'
|
|
63
|
+
* })
|
|
64
|
+
*
|
|
65
|
+
* client.getOrganization('<organization_id>')
|
|
66
|
+
* .then((organization) => organization.getUser('id'))
|
|
67
|
+
* .then((user) => console.log(user))
|
|
68
|
+
* .catch(console.error)
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
getUser(id) {
|
|
72
|
+
const raw = this.toPlainObject();
|
|
73
|
+
return makeRequest({
|
|
74
|
+
entityType: 'User',
|
|
75
|
+
action: 'getForOrganization',
|
|
76
|
+
params: { organizationId: raw.sys.id, userId: id },
|
|
77
|
+
}).then((data) => wrapUser(makeRequest, data));
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Gets a collection of Users in organization
|
|
81
|
+
* @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.
|
|
82
|
+
* @return Promise a collection of Users in organization
|
|
83
|
+
* @example ```javascript
|
|
84
|
+
* const contentful = require('contentful-management')
|
|
85
|
+
* const client = contentful.createClient({
|
|
86
|
+
* accessToken: '<content_management_api_key>'
|
|
87
|
+
* })
|
|
88
|
+
*
|
|
89
|
+
* client.getOrganization('<organization_id>')
|
|
90
|
+
* .then((organization) => organization.getUsers())
|
|
91
|
+
* .then((users) => console.log(users))
|
|
92
|
+
* .catch(console.error)
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
getUsers(query = {}) {
|
|
96
|
+
const raw = this.toPlainObject();
|
|
97
|
+
return makeRequest({
|
|
98
|
+
entityType: 'User',
|
|
99
|
+
action: 'getManyForOrganization',
|
|
100
|
+
params: {
|
|
101
|
+
organizationId: raw.sys.id,
|
|
102
|
+
query: createRequestConfig({ query: query }).params,
|
|
103
|
+
},
|
|
104
|
+
}).then((data) => wrapUserCollection(makeRequest, data));
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Gets an Organization Membership
|
|
108
|
+
* @param id - Organization Membership ID
|
|
109
|
+
* @return Promise for an Organization Membership
|
|
110
|
+
* @example ```javascript
|
|
111
|
+
* const contentful = require('contentful-management')
|
|
112
|
+
* const client = contentful.createClient({
|
|
113
|
+
* accessToken: '<content_management_api_key>'
|
|
114
|
+
* })
|
|
115
|
+
*
|
|
116
|
+
* client.getOrganization('organization_id')
|
|
117
|
+
* .then((organization) => organization.getOrganizationMembership('organizationMembership_id'))
|
|
118
|
+
* .then((organizationMembership) => console.log(organizationMembership))
|
|
119
|
+
* .catch(console.error)
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
getOrganizationMembership(id) {
|
|
123
|
+
const raw = this.toPlainObject();
|
|
124
|
+
const organizationId = raw.sys.id;
|
|
125
|
+
return makeRequest({
|
|
126
|
+
entityType: 'OrganizationMembership',
|
|
127
|
+
action: 'get',
|
|
128
|
+
params: {
|
|
129
|
+
organizationId,
|
|
130
|
+
organizationMembershipId: id,
|
|
131
|
+
},
|
|
132
|
+
}).then((data) => wrapOrganizationMembership(makeRequest, data, organizationId));
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* Gets a collection of Organization Memberships
|
|
136
|
+
* @param params - 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.
|
|
137
|
+
* @return Promise for a collection of Organization Memberships
|
|
138
|
+
* @example ```javascript
|
|
139
|
+
* const contentful = require('contentful-management')
|
|
140
|
+
* const client = contentful.createClient({
|
|
141
|
+
* accessToken: '<content_management_api_key>'
|
|
142
|
+
* })
|
|
143
|
+
*
|
|
144
|
+
* client.getOrganization('organization_id')
|
|
145
|
+
* .then((organization) => organization.getOrganizationMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
|
|
146
|
+
* .then((response) => console.log(response.items))
|
|
147
|
+
* .catch(console.error)
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
getOrganizationMemberships(params = {}) {
|
|
151
|
+
const raw = this.toPlainObject();
|
|
152
|
+
return makeRequest({
|
|
153
|
+
entityType: 'OrganizationMembership',
|
|
154
|
+
action: 'getMany',
|
|
155
|
+
params: {
|
|
156
|
+
organizationId: raw.sys.id,
|
|
157
|
+
...params,
|
|
158
|
+
},
|
|
159
|
+
}).then((data) => wrapOrganizationMembershipCollection(makeRequest, data, raw.sys.id));
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Creates a Team
|
|
163
|
+
* @param data representation of the Team to be created
|
|
164
|
+
* @example ```javascript
|
|
165
|
+
* const contentful = require('contentful-management')
|
|
166
|
+
* const client = contentful.createClient({
|
|
167
|
+
* accessToken: '<content_management_api_key>'
|
|
168
|
+
* })
|
|
169
|
+
*
|
|
170
|
+
* client.getOrganization('<org_id>')
|
|
171
|
+
* .then((org) => org.createTeam({
|
|
172
|
+
* name: 'new team',
|
|
173
|
+
* description: 'new team description'
|
|
174
|
+
* }))
|
|
175
|
+
* .then((team) => console.log(team))
|
|
176
|
+
* .catch(console.error)
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
createTeam(data) {
|
|
180
|
+
const raw = this.toPlainObject();
|
|
181
|
+
return makeRequest({
|
|
182
|
+
entityType: 'Team',
|
|
183
|
+
action: 'create',
|
|
184
|
+
params: { organizationId: raw.sys.id },
|
|
185
|
+
payload: data,
|
|
186
|
+
}).then((data) => wrapTeam(makeRequest, data));
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Gets an Team
|
|
190
|
+
* @example ```javascript
|
|
191
|
+
* const contentful = require('contentful-management')
|
|
192
|
+
* const client = contentful.createClient({
|
|
193
|
+
* accessToken: '<content_management_api_key>'
|
|
194
|
+
* })
|
|
195
|
+
*
|
|
196
|
+
* client.getOrganization('orgId')
|
|
197
|
+
* .then((organization) => organization.getTeam('teamId'))
|
|
198
|
+
* .then((team) => console.log(team))
|
|
199
|
+
* .catch(console.error)
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
getTeam(teamId) {
|
|
203
|
+
const raw = this.toPlainObject();
|
|
204
|
+
return makeRequest({
|
|
205
|
+
entityType: 'Team',
|
|
206
|
+
action: 'get',
|
|
207
|
+
params: { organizationId: raw.sys.id, teamId },
|
|
208
|
+
}).then((data) => wrapTeam(makeRequest, data));
|
|
209
|
+
},
|
|
210
|
+
/**
|
|
211
|
+
* Gets all Teams in an organization
|
|
212
|
+
* @example ```javascript
|
|
213
|
+
* const contentful = require('contentful-management')
|
|
214
|
+
* const client = contentful.createClient({
|
|
215
|
+
* accessToken: '<content_management_api_key>'
|
|
216
|
+
* })
|
|
217
|
+
*
|
|
218
|
+
* client.getOrganization('orgId')
|
|
219
|
+
* .then((organization) => organization.getTeams())
|
|
220
|
+
* .then((teams) => console.log(teams))
|
|
221
|
+
* .catch(console.error)
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
getTeams(query = {}) {
|
|
225
|
+
const raw = this.toPlainObject();
|
|
226
|
+
return makeRequest({
|
|
227
|
+
entityType: 'Team',
|
|
228
|
+
action: 'getMany',
|
|
229
|
+
params: {
|
|
230
|
+
organizationId: raw.sys.id,
|
|
231
|
+
query: createRequestConfig({ query }).params,
|
|
232
|
+
},
|
|
233
|
+
}).then((data) => wrapTeamCollection(makeRequest, data));
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* Creates a Team membership
|
|
237
|
+
* @param teamId - Id of the team the membership will be created in
|
|
238
|
+
* @param data - Object representation of the Team Membership to be created
|
|
239
|
+
* @return Promise for the newly created TeamMembership
|
|
240
|
+
* @example ```javascript
|
|
241
|
+
* const contentful = require('contentful-management')
|
|
242
|
+
* const client = contentful.createClient({
|
|
243
|
+
* accessToken: '<content_management_api_key>'
|
|
244
|
+
* })
|
|
245
|
+
*
|
|
246
|
+
* client.getOrganization('organizationId')
|
|
247
|
+
* .then((org) => org.createTeamMembership('teamId', {
|
|
248
|
+
* admin: true,
|
|
249
|
+
* organizationMembershipId: 'organizationMembershipId'
|
|
250
|
+
* }))
|
|
251
|
+
* .then((teamMembership) => console.log(teamMembership))
|
|
252
|
+
* .catch(console.error)
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
createTeamMembership(teamId, data) {
|
|
256
|
+
const raw = this.toPlainObject();
|
|
257
|
+
return makeRequest({
|
|
258
|
+
entityType: 'TeamMembership',
|
|
259
|
+
action: 'create',
|
|
260
|
+
params: { organizationId: raw.sys.id, teamId },
|
|
261
|
+
payload: data,
|
|
262
|
+
}).then((data) => wrapTeamMembership(makeRequest, data));
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Gets an Team Membership from the team with given teamId
|
|
266
|
+
* @return Promise for an Team Membership
|
|
267
|
+
* @example ```javascript
|
|
268
|
+
* const contentful = require('contentful-management')
|
|
269
|
+
* const client = contentful.createClient({
|
|
270
|
+
* accessToken: '<content_management_api_key>'
|
|
271
|
+
* })
|
|
272
|
+
*
|
|
273
|
+
* client.getOrganization('organizationId')
|
|
274
|
+
* .then((organization) => organization.getTeamMembership('teamId', 'teamMembership_id'))
|
|
275
|
+
* .then((teamMembership) => console.log(teamMembership))
|
|
276
|
+
* .catch(console.error)
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
getTeamMembership(teamId, teamMembershipId) {
|
|
280
|
+
const raw = this.toPlainObject();
|
|
281
|
+
return makeRequest({
|
|
282
|
+
entityType: 'TeamMembership',
|
|
283
|
+
action: 'get',
|
|
284
|
+
params: { organizationId: raw.sys.id, teamId, teamMembershipId },
|
|
285
|
+
}).then((data) => wrapTeamMembership(makeRequest, data));
|
|
286
|
+
},
|
|
287
|
+
/**
|
|
288
|
+
* Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization.
|
|
289
|
+
* @return Promise for a Team Membership Collection
|
|
290
|
+
* @example ```javascript
|
|
291
|
+
* const contentful = require('contentful-management')
|
|
292
|
+
* const client = contentful.createClient({
|
|
293
|
+
* accessToken: '<content_management_api_key>'
|
|
294
|
+
* })
|
|
295
|
+
*
|
|
296
|
+
* client.getOrganization('organizationId')
|
|
297
|
+
* .then((organization) => organization.getTeamMemberships('teamId'))
|
|
298
|
+
* .then((teamMemberships) => console.log(teamMemberships))
|
|
299
|
+
* .catch(console.error)
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
getTeamMemberships(opts = {}) {
|
|
303
|
+
const { teamId, query = {} } = opts;
|
|
304
|
+
const raw = this.toPlainObject();
|
|
305
|
+
if (teamId) {
|
|
306
|
+
return makeRequest({
|
|
307
|
+
entityType: 'TeamMembership',
|
|
308
|
+
action: 'getManyForTeam',
|
|
309
|
+
params: {
|
|
310
|
+
organizationId: raw.sys.id,
|
|
311
|
+
teamId,
|
|
312
|
+
query: createRequestConfig({ query }).params,
|
|
313
|
+
},
|
|
314
|
+
}).then((data) => wrapTeamMembershipCollection(makeRequest, data));
|
|
315
|
+
}
|
|
316
|
+
return makeRequest({
|
|
317
|
+
entityType: 'TeamMembership',
|
|
318
|
+
action: 'getManyForOrganization',
|
|
319
|
+
params: {
|
|
320
|
+
organizationId: raw.sys.id,
|
|
321
|
+
query: createRequestConfig({ query }).params,
|
|
322
|
+
},
|
|
323
|
+
}).then((data) => wrapTeamMembershipCollection(makeRequest, data));
|
|
324
|
+
},
|
|
325
|
+
/**
|
|
326
|
+
* Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization.
|
|
327
|
+
* @return Promise for a Team Space Membership Collection
|
|
328
|
+
* @example ```javascript
|
|
329
|
+
* const contentful = require('contentful-management')
|
|
330
|
+
* const client = contentful.createClient({
|
|
331
|
+
* accessToken: '<content_management_api_key>'
|
|
332
|
+
* })
|
|
333
|
+
*
|
|
334
|
+
* client.getOrganization('organizationId')
|
|
335
|
+
* .then((organization) => organization.getTeamSpaceMemberships('teamId'))
|
|
336
|
+
* .then((teamSpaceMemberships) => console.log(teamSpaceMemberships))
|
|
337
|
+
* .catch(console.error)
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
getTeamSpaceMemberships(opts = {}) {
|
|
341
|
+
const raw = this.toPlainObject();
|
|
342
|
+
return makeRequest({
|
|
343
|
+
entityType: 'TeamSpaceMembership',
|
|
344
|
+
action: 'getManyForOrganization',
|
|
345
|
+
params: {
|
|
346
|
+
organizationId: raw.sys.id,
|
|
347
|
+
query: createRequestConfig({ query: opts.query || {} }).params,
|
|
348
|
+
teamId: opts.teamId,
|
|
349
|
+
},
|
|
350
|
+
}).then((data) => wrapTeamSpaceMembershipCollection(makeRequest, data));
|
|
351
|
+
},
|
|
352
|
+
/**
|
|
353
|
+
* Get a Team Space Membership with given teamSpaceMembershipId
|
|
354
|
+
* @return Promise for a Team Space Membership
|
|
355
|
+
* @example ```javascript
|
|
356
|
+
* const contentful = require('contentful-management')
|
|
357
|
+
* const client = contentful.createClient({
|
|
358
|
+
* accessToken: '<content_management_api_key>'
|
|
359
|
+
* })
|
|
360
|
+
*
|
|
361
|
+
* client.getOrganization('organizationId')
|
|
362
|
+
* .then((organization) => organization.getTeamSpaceMembership('teamSpaceMembershipId'))
|
|
363
|
+
* .then((teamSpaceMembership) => console.log(teamSpaceMembership))
|
|
364
|
+
* .catch(console.error)]
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
getTeamSpaceMembership(teamSpaceMembershipId) {
|
|
368
|
+
const raw = this.toPlainObject();
|
|
369
|
+
return makeRequest({
|
|
370
|
+
entityType: 'TeamSpaceMembership',
|
|
371
|
+
action: 'getForOrganization',
|
|
372
|
+
params: {
|
|
373
|
+
organizationId: raw.sys.id,
|
|
374
|
+
teamSpaceMembershipId,
|
|
375
|
+
},
|
|
376
|
+
}).then((data) => wrapTeamSpaceMembership(makeRequest, data));
|
|
377
|
+
},
|
|
378
|
+
/**
|
|
379
|
+
* Gets an Space Membership in Organization
|
|
380
|
+
* @param id - Organiztion Space Membership ID
|
|
381
|
+
* @return Promise for a Space Membership in an organization
|
|
382
|
+
* @example ```javascript
|
|
383
|
+
* const contentful = require('contentful-management')
|
|
384
|
+
* const client = contentful.createClient({
|
|
385
|
+
* accessToken: '<content_management_api_key>'
|
|
386
|
+
* })
|
|
387
|
+
*
|
|
388
|
+
* client.getOrganization('organization_id')
|
|
389
|
+
* .then((organization) => organization.getOrganizationSpaceMembership('organizationSpaceMembership_id'))
|
|
390
|
+
* .then((organizationMembership) => console.log(organizationMembership))
|
|
391
|
+
* .catch(console.error)
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
getOrganizationSpaceMembership(id) {
|
|
395
|
+
const raw = this.toPlainObject();
|
|
396
|
+
return makeRequest({
|
|
397
|
+
entityType: 'SpaceMembership',
|
|
398
|
+
action: 'getForOrganization',
|
|
399
|
+
params: {
|
|
400
|
+
organizationId: raw.sys.id,
|
|
401
|
+
spaceMembershipId: id,
|
|
402
|
+
},
|
|
403
|
+
}).then((data) => wrapSpaceMembership(makeRequest, data));
|
|
404
|
+
},
|
|
405
|
+
/**
|
|
406
|
+
* Gets a collection Space Memberships in organization
|
|
407
|
+
* @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.
|
|
408
|
+
* @return Promise for a Space Membership collection across all spaces in the organization
|
|
409
|
+
* @example ```javascript
|
|
410
|
+
* const contentful = require('contentful-management')
|
|
411
|
+
* const client = contentful.createClient({
|
|
412
|
+
* accessToken: '<content_management_api_key>'
|
|
413
|
+
* })
|
|
414
|
+
*
|
|
415
|
+
* client.getOrganization('organization_id')
|
|
416
|
+
* .then((organization) => organization.getOrganizationSpaceMemberships()) // you can add queries like 'limit': 100
|
|
417
|
+
* .then((response) => console.log(response.items))
|
|
418
|
+
* .catch(console.error)
|
|
419
|
+
* ```
|
|
420
|
+
*/
|
|
421
|
+
getOrganizationSpaceMemberships(query = {}) {
|
|
422
|
+
const raw = this.toPlainObject();
|
|
423
|
+
return makeRequest({
|
|
424
|
+
entityType: 'SpaceMembership',
|
|
425
|
+
action: 'getManyForOrganization',
|
|
426
|
+
params: {
|
|
427
|
+
organizationId: raw.sys.id,
|
|
428
|
+
query: createRequestConfig({ query }).params,
|
|
429
|
+
},
|
|
430
|
+
}).then((data) => wrapSpaceMembershipCollection(makeRequest, data));
|
|
431
|
+
},
|
|
432
|
+
/**
|
|
433
|
+
* Gets an Invitation in Organization
|
|
434
|
+
* @return Promise for a OrganizationInvitation in an organization
|
|
435
|
+
* @example ```javascript
|
|
436
|
+
* const contentful = require('contentful-management')
|
|
437
|
+
* const client = contentful.createClient({
|
|
438
|
+
* accessToken: '<content_management_api_key>'
|
|
439
|
+
* })
|
|
440
|
+
*
|
|
441
|
+
* client.getOrganization('<org_id>')
|
|
442
|
+
* .then((organization) => organization.getOrganizationInvitation('invitation_id'))
|
|
443
|
+
* .then((invitation) => console.log(invitation))
|
|
444
|
+
* .catch(console.error)
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
getOrganizationInvitation(invitationId) {
|
|
448
|
+
const raw = this.toPlainObject();
|
|
449
|
+
return makeRequest({
|
|
450
|
+
entityType: 'OrganizationInvitation',
|
|
451
|
+
action: 'get',
|
|
452
|
+
params: {
|
|
453
|
+
organizationId: raw.sys.id,
|
|
454
|
+
invitationId,
|
|
455
|
+
},
|
|
456
|
+
}).then((data) => wrapOrganizationInvitation(makeRequest, data));
|
|
457
|
+
},
|
|
458
|
+
/**
|
|
459
|
+
* Create an Invitation in Organization
|
|
460
|
+
* @return Promise for a OrganizationInvitation in an organization
|
|
461
|
+
* @example ```javascript
|
|
462
|
+
* const contentful = require('contentful-management')
|
|
463
|
+
* const client = contentful.createClient({
|
|
464
|
+
* accessToken: '<content_management_api_key>'
|
|
465
|
+
* })
|
|
466
|
+
*
|
|
467
|
+
* client.getOrganization('<org_id>')
|
|
468
|
+
* .then((organization) => organization.createOrganizationInvitation({
|
|
469
|
+
* email: 'user.email@example.com'
|
|
470
|
+
* firstName: 'User First Name'
|
|
471
|
+
* lastName: 'User Last Name'
|
|
472
|
+
* role: 'developer'
|
|
473
|
+
* })
|
|
474
|
+
* .catch(console.error)
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
createOrganizationInvitation(data) {
|
|
478
|
+
const raw = this.toPlainObject();
|
|
479
|
+
return makeRequest({
|
|
480
|
+
entityType: 'OrganizationInvitation',
|
|
481
|
+
action: 'create',
|
|
482
|
+
params: {
|
|
483
|
+
organizationId: raw.sys.id,
|
|
484
|
+
},
|
|
485
|
+
payload: data,
|
|
486
|
+
}).then((data) => wrapOrganizationInvitation(makeRequest, data));
|
|
487
|
+
},
|
|
488
|
+
/**
|
|
489
|
+
* Gets a collection of Roles
|
|
490
|
+
* @return Promise for a collection of Roles
|
|
491
|
+
* @example ```javascript
|
|
492
|
+
* const contentful = require('contentful-management')
|
|
493
|
+
*
|
|
494
|
+
* const client = contentful.createClient({
|
|
495
|
+
* accessToken: '<content_management_api_key>'
|
|
496
|
+
* })
|
|
497
|
+
*
|
|
498
|
+
* client.getOrganization('<org_id>')
|
|
499
|
+
* .then((org) => org.getRoles())
|
|
500
|
+
* .then((response) => console.log(response.items))
|
|
501
|
+
* .catch(console.error)
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
getRoles(query = {}) {
|
|
505
|
+
const raw = this.toPlainObject();
|
|
506
|
+
return makeRequest({
|
|
507
|
+
entityType: 'Role',
|
|
508
|
+
action: 'getManyForOrganization',
|
|
509
|
+
params: { organizationId: raw.sys.id, query: createRequestConfig({ query }).params },
|
|
510
|
+
}).then((data) => wrapRoleCollection(makeRequest, data));
|
|
511
|
+
},
|
|
512
|
+
/**
|
|
513
|
+
* Creates an app definition
|
|
514
|
+
* @param Object representation of the App Definition to be created
|
|
515
|
+
* @return Promise for the newly created AppDefinition
|
|
516
|
+
* @example ```javascript
|
|
517
|
+
* const contentful = require('contentful-management')
|
|
518
|
+
* const client = contentful.createClient({
|
|
519
|
+
* accessToken: '<content_management_api_key>'
|
|
520
|
+
* })
|
|
521
|
+
*
|
|
522
|
+
* client.getOrganization('<org_id>')
|
|
523
|
+
* .then((org) => org.createAppDefinition({
|
|
524
|
+
* name: 'Example app',
|
|
525
|
+
* locations: [{ location: 'app-config' }],
|
|
526
|
+
* src: "http://my-app-host.com/my-app"
|
|
527
|
+
* }))
|
|
528
|
+
* .then((appDefinition) => console.log(appDefinition))
|
|
529
|
+
* .catch(console.error)
|
|
530
|
+
* ```
|
|
531
|
+
*/
|
|
532
|
+
createAppDefinition(data) {
|
|
533
|
+
const raw = this.toPlainObject();
|
|
534
|
+
return makeRequest({
|
|
535
|
+
entityType: 'AppDefinition',
|
|
536
|
+
action: 'create',
|
|
537
|
+
params: { organizationId: raw.sys.id },
|
|
538
|
+
payload: data,
|
|
539
|
+
}).then((data) => wrapAppDefinition(makeRequest, data));
|
|
540
|
+
},
|
|
541
|
+
/**
|
|
542
|
+
* Gets all app definitions
|
|
543
|
+
* @return Promise for a collection of App Definitions
|
|
544
|
+
* @example ```javascript
|
|
545
|
+
* const contentful = require('contentful-management')
|
|
546
|
+
* const client = contentful.createClient({
|
|
547
|
+
* accessToken: '<content_management_api_key>'
|
|
548
|
+
* })
|
|
549
|
+
*
|
|
550
|
+
* client.getOrganization('<org_id>')
|
|
551
|
+
* .then((org) => org.getAppDefinitions())
|
|
552
|
+
* .then((response) => console.log(response.items))
|
|
553
|
+
* .catch(console.error)
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
getAppDefinitions(query = {}) {
|
|
557
|
+
const raw = this.toPlainObject();
|
|
558
|
+
return makeRequest({
|
|
559
|
+
entityType: 'AppDefinition',
|
|
560
|
+
action: 'getMany',
|
|
561
|
+
params: { organizationId: raw.sys.id, query: query },
|
|
562
|
+
}).then((data) => wrapAppDefinitionCollection(makeRequest, data));
|
|
563
|
+
},
|
|
564
|
+
/**
|
|
565
|
+
* Gets an app definition
|
|
566
|
+
* @return Promise for an App Definition
|
|
567
|
+
* @example ```javascript
|
|
568
|
+
* const contentful = require('contentful-management')
|
|
569
|
+
* const client = contentful.createClient({
|
|
570
|
+
* accessToken: '<content_management_api_key>'
|
|
571
|
+
* })
|
|
572
|
+
*
|
|
573
|
+
* client.getOrganization('<org_id>')
|
|
574
|
+
* .then((org) => org.getAppDefinition('<app_definition_id>'))
|
|
575
|
+
* .then((appDefinition) => console.log(appDefinition))
|
|
576
|
+
* .catch(console.error)
|
|
577
|
+
* ```
|
|
578
|
+
*/
|
|
579
|
+
getAppDefinition(id) {
|
|
580
|
+
const raw = this.toPlainObject();
|
|
581
|
+
return makeRequest({
|
|
582
|
+
entityType: 'AppDefinition',
|
|
583
|
+
action: 'get',
|
|
584
|
+
params: { organizationId: raw.sys.id, appDefinitionId: id },
|
|
585
|
+
}).then((data) => wrapAppDefinition(makeRequest, data));
|
|
586
|
+
},
|
|
587
|
+
/**
|
|
588
|
+
* Gets an app upload
|
|
589
|
+
* @return Promise for an App Upload
|
|
590
|
+
* @example ```javascript
|
|
591
|
+
* const contentful = require('contentful-management')
|
|
592
|
+
* const client = contentful.createClient({
|
|
593
|
+
* accessToken: '<content_management_api_key>'
|
|
594
|
+
* })
|
|
595
|
+
*
|
|
596
|
+
* client.getOrganization('<org_id>')
|
|
597
|
+
* .then((org) => org.getAppUpload('<app_upload_id>'))
|
|
598
|
+
* .then((appUpload) => console.log(appUpload))
|
|
599
|
+
* .catch(console.error)
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
getAppUpload(appUploadId) {
|
|
603
|
+
const raw = this.toPlainObject();
|
|
604
|
+
return makeRequest({
|
|
605
|
+
entityType: 'AppUpload',
|
|
606
|
+
action: 'get',
|
|
607
|
+
params: { organizationId: raw.sys.id, appUploadId },
|
|
608
|
+
}).then((data) => wrapAppUpload(makeRequest, data));
|
|
609
|
+
},
|
|
610
|
+
/**
|
|
611
|
+
* Creates an app upload
|
|
612
|
+
* @return Promise for an App Upload
|
|
613
|
+
* @example ```javascript
|
|
614
|
+
* const contentful = require('contentful-management')
|
|
615
|
+
* const client = contentful.createClient({
|
|
616
|
+
* accessToken: '<content_management_api_key>'
|
|
617
|
+
* })
|
|
618
|
+
*
|
|
619
|
+
* client.getOrganization('<org_id>')
|
|
620
|
+
* .then((org) => org.createAppUpload('some_zip_file'))
|
|
621
|
+
* .then((appUpload) => console.log(appUpload))
|
|
622
|
+
* .catch(console.error)
|
|
623
|
+
* ```
|
|
624
|
+
*/
|
|
625
|
+
createAppUpload(file) {
|
|
626
|
+
const raw = this.toPlainObject();
|
|
627
|
+
return makeRequest({
|
|
628
|
+
entityType: 'AppUpload',
|
|
629
|
+
action: 'create',
|
|
630
|
+
params: { organizationId: raw.sys.id },
|
|
631
|
+
payload: { file },
|
|
632
|
+
}).then((data) => wrapAppUpload(makeRequest, data));
|
|
633
|
+
},
|
|
634
|
+
/**
|
|
635
|
+
* Creates or updates an app signing secret
|
|
636
|
+
* @return Promise for an App SigningSecret
|
|
637
|
+
* @example ```javascript
|
|
638
|
+
* const contentful = require('contentful-management')
|
|
639
|
+
* const client = contentful.createClient({
|
|
640
|
+
* accessToken: '<content_management_api_key>'
|
|
641
|
+
* })
|
|
642
|
+
*
|
|
643
|
+
* client.getOrganization('<org_id>')
|
|
644
|
+
* .then((org) => org.upsertAppSigningSecret('app_definition_id', { value: 'tsren3s1....wn1e' }))
|
|
645
|
+
* .then((appSigningSecret) => console.log(appSigningSecret))
|
|
646
|
+
* .catch(console.error)
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
upsertAppSigningSecret(appDefinitionId, data) {
|
|
650
|
+
const raw = this.toPlainObject();
|
|
651
|
+
return makeRequest({
|
|
652
|
+
entityType: 'AppSigningSecret',
|
|
653
|
+
action: 'upsert',
|
|
654
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
655
|
+
payload: data,
|
|
656
|
+
}).then((payload) => wrapAppSigningSecret(makeRequest, payload));
|
|
657
|
+
},
|
|
658
|
+
/**
|
|
659
|
+
* Gets an app signing secret
|
|
660
|
+
* @return Promise for an App SigningSecret
|
|
661
|
+
* @example ```javascript
|
|
662
|
+
* const contentful = require('contentful-management')
|
|
663
|
+
* const client = contentful.createClient({
|
|
664
|
+
* accessToken: '<content_management_api_key>'
|
|
665
|
+
* })
|
|
666
|
+
*
|
|
667
|
+
* client.getOrganization('<org_id>')
|
|
668
|
+
* .then((org) => org.getAppSigningSecret('app_definition_id'))
|
|
669
|
+
* .then((appSigningSecret) => console.log(appSigningSecret))
|
|
670
|
+
* .catch(console.error)
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
getAppSigningSecret(appDefinitionId) {
|
|
674
|
+
const raw = this.toPlainObject();
|
|
675
|
+
return makeRequest({
|
|
676
|
+
entityType: 'AppSigningSecret',
|
|
677
|
+
action: 'get',
|
|
678
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
679
|
+
}).then((payload) => wrapAppSigningSecret(makeRequest, payload));
|
|
680
|
+
},
|
|
681
|
+
/**
|
|
682
|
+
* Deletes an app signing secret
|
|
683
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
684
|
+
* @example ```javascript
|
|
685
|
+
* const contentful = require('contentful-management')
|
|
686
|
+
* const client = contentful.createClient({
|
|
687
|
+
* accessToken: '<content_management_api_key>'
|
|
688
|
+
* })
|
|
689
|
+
*
|
|
690
|
+
* client.getOrganization('<org_id>')
|
|
691
|
+
* .then((org) => org.deleteAppSigningSecret('app_definition_id'))
|
|
692
|
+
* .then((result) => console.log(result))
|
|
693
|
+
* .catch(console.error)
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
deleteAppSigningSecret(appDefinitionId) {
|
|
697
|
+
const raw = this.toPlainObject();
|
|
698
|
+
return makeRequest({
|
|
699
|
+
entityType: 'AppSigningSecret',
|
|
700
|
+
action: 'delete',
|
|
701
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
702
|
+
}).then(() => {
|
|
703
|
+
/* noop*/
|
|
704
|
+
});
|
|
705
|
+
},
|
|
706
|
+
/**
|
|
707
|
+
* Creates or updates an app event subscription
|
|
708
|
+
* @return Promise for an App Event Subscription
|
|
709
|
+
* @example ```javascript
|
|
710
|
+
* const contentful = require('contentful-management')
|
|
711
|
+
* const client = contentful.createClient({
|
|
712
|
+
* accessToken: '<content_management_api_key>'
|
|
713
|
+
* })
|
|
714
|
+
*
|
|
715
|
+
* client.getOrganization('<org_id>')
|
|
716
|
+
* .then((org) => org.upsertAppEventSubscription('app_definition_id', { targetUrl: '<target_url>', topics: ['<topic>'] }))
|
|
717
|
+
* .then((appEventSubscription) => console.log(appEventSubscription))
|
|
718
|
+
* .catch(console.error)
|
|
719
|
+
* ```
|
|
720
|
+
*/
|
|
721
|
+
upsertAppEventSubscription(appDefinitionId, data) {
|
|
722
|
+
const raw = this.toPlainObject();
|
|
723
|
+
return makeRequest({
|
|
724
|
+
entityType: 'AppEventSubscription',
|
|
725
|
+
action: 'upsert',
|
|
726
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
727
|
+
payload: data,
|
|
728
|
+
}).then((payload) => wrapAppEventSubscription(makeRequest, payload));
|
|
729
|
+
},
|
|
730
|
+
/**
|
|
731
|
+
* Gets an app event subscription
|
|
732
|
+
* @return Promise for an App Event Subscription
|
|
733
|
+
* @example ```javascript
|
|
734
|
+
* const contentful = require('contentful-management')
|
|
735
|
+
* const client = contentful.createClient({
|
|
736
|
+
* accessToken: '<content_management_api_key>'
|
|
737
|
+
* })
|
|
738
|
+
*
|
|
739
|
+
* client.getOrganization('<org_id>')
|
|
740
|
+
* .then((org) => org.getAppEventSubscription('app_definition_id'))
|
|
741
|
+
* .then((appEventSubscription) => console.log(appEventSubscription))
|
|
742
|
+
* .catch(console.error)
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
745
|
+
getAppEventSubscription(appDefinitionId) {
|
|
746
|
+
const raw = this.toPlainObject();
|
|
747
|
+
return makeRequest({
|
|
748
|
+
entityType: 'AppEventSubscription',
|
|
749
|
+
action: 'get',
|
|
750
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
751
|
+
}).then((payload) => wrapAppEventSubscription(makeRequest, payload));
|
|
752
|
+
},
|
|
753
|
+
/**
|
|
754
|
+
* Deletes the current App Event Subscription for the given App
|
|
755
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
756
|
+
* @example ```javascript
|
|
757
|
+
* const contentful = require('contentful-management')
|
|
758
|
+
* const client = contentful.createClient({
|
|
759
|
+
* accessToken: '<content_management_api_key>'
|
|
760
|
+
* })
|
|
761
|
+
*
|
|
762
|
+
* client.getOrganization('<org_id>')
|
|
763
|
+
* .then((org) => org.deleteAppEventSubscription('app_definition_id'))
|
|
764
|
+
* .then((result) => console.log(result))
|
|
765
|
+
* .catch(console.error)
|
|
766
|
+
* ```
|
|
767
|
+
*/
|
|
768
|
+
deleteAppEventSubscription(appDefinitionId) {
|
|
769
|
+
const raw = this.toPlainObject();
|
|
770
|
+
return makeRequest({
|
|
771
|
+
entityType: 'AppEventSubscription',
|
|
772
|
+
action: 'delete',
|
|
773
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
774
|
+
}).then(() => {
|
|
775
|
+
/* noop*/
|
|
776
|
+
});
|
|
777
|
+
},
|
|
778
|
+
/**
|
|
779
|
+
* Creates or updates an app event subscription
|
|
780
|
+
* @return Promise for an App Event Subscription
|
|
781
|
+
* @example ```javascript
|
|
782
|
+
* const contentful = require('contentful-management')
|
|
783
|
+
* const client = contentful.createClient({
|
|
784
|
+
* accessToken: '<content_management_api_key>'
|
|
785
|
+
* })
|
|
786
|
+
*
|
|
787
|
+
* // generate a new private key
|
|
788
|
+
* client.getOrganization('<org_id>')
|
|
789
|
+
* .then((org) => org.upsertAppEventSubscription('app_definition_id', { generate: true }))
|
|
790
|
+
* .then((appEventSubscription) => console.log(appEventSubscription))
|
|
791
|
+
* .catch(console.error)
|
|
792
|
+
*
|
|
793
|
+
* // or use an existing JSON Web Key
|
|
794
|
+
* client.getOrganization('<org_id>')
|
|
795
|
+
* .then((org) => org.upsertAppEventSubscription('app_definition_id', { jwk: 'jwk' }))
|
|
796
|
+
* .then((appEventSubscription) => console.log(appEventSubscription))
|
|
797
|
+
* .catch(console.error)
|
|
798
|
+
* ```
|
|
799
|
+
*/
|
|
800
|
+
createAppKey(appDefinitionId, data) {
|
|
801
|
+
const raw = this.toPlainObject();
|
|
802
|
+
return makeRequest({
|
|
803
|
+
entityType: 'AppKey',
|
|
804
|
+
action: 'create',
|
|
805
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
806
|
+
payload: data,
|
|
807
|
+
}).then((payload) => wrapAppKey(makeRequest, payload));
|
|
808
|
+
},
|
|
809
|
+
/**
|
|
810
|
+
* Gets an app key by fingerprint
|
|
811
|
+
* @return Promise for an App Key
|
|
812
|
+
* @example ```javascript
|
|
813
|
+
* const contentful = require('contentful-management')
|
|
814
|
+
* const client = contentful.createClient({
|
|
815
|
+
* accessToken: '<content_management_api_key>'
|
|
816
|
+
* })
|
|
817
|
+
*
|
|
818
|
+
* client.getOrganization('<org_id>')
|
|
819
|
+
* .then((org) => org.getAppKey('app_definition_id', 'fingerprint'))
|
|
820
|
+
* .then((appKey) => console.log(appKey))
|
|
821
|
+
* .catch(console.error)
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
824
|
+
getAppKey(appDefinitionId, fingerprint) {
|
|
825
|
+
const raw = this.toPlainObject();
|
|
826
|
+
return makeRequest({
|
|
827
|
+
entityType: 'AppKey',
|
|
828
|
+
action: 'get',
|
|
829
|
+
params: { organizationId: raw.sys.id, appDefinitionId, fingerprint },
|
|
830
|
+
}).then((payload) => wrapAppKey(makeRequest, payload));
|
|
831
|
+
},
|
|
832
|
+
/**
|
|
833
|
+
* Gets all keys for the given app
|
|
834
|
+
* @return Promise for an array of App Keys
|
|
835
|
+
* @example ```javascript
|
|
836
|
+
* const contentful = require('contentful-management')
|
|
837
|
+
* const client = contentful.createClient({
|
|
838
|
+
* accessToken: '<content_management_api_key>'
|
|
839
|
+
* })
|
|
840
|
+
*
|
|
841
|
+
* // with default pagination
|
|
842
|
+
* client.getOrganization('<org_id>')
|
|
843
|
+
* .then((org) => org.getAppKeys('app_definition_id'))
|
|
844
|
+
* .then((appKeys) => console.log(appKeys))
|
|
845
|
+
* .catch(console.error)
|
|
846
|
+
*
|
|
847
|
+
* // with explicit pagination
|
|
848
|
+
* client.getOrganization('<org_id>')
|
|
849
|
+
* .then((org) => org.getAppKeys('app_definition_id', { skip: 'skip', limit: 'limit' }))
|
|
850
|
+
* .then((appKeys) => console.log(appKeys))
|
|
851
|
+
* .catch(console.error)
|
|
852
|
+
* ```
|
|
853
|
+
*/
|
|
854
|
+
getAppKeys(appDefinitionId, query = {}) {
|
|
855
|
+
const raw = this.toPlainObject();
|
|
856
|
+
return makeRequest({
|
|
857
|
+
entityType: 'AppKey',
|
|
858
|
+
action: 'getMany',
|
|
859
|
+
params: {
|
|
860
|
+
organizationId: raw.sys.id,
|
|
861
|
+
appDefinitionId,
|
|
862
|
+
query: createRequestConfig({ query }).params,
|
|
863
|
+
},
|
|
864
|
+
}).then((payload) => wrapAppKeyCollection(makeRequest, payload));
|
|
865
|
+
},
|
|
866
|
+
/**
|
|
867
|
+
* Deletes an app key by fingerprint.
|
|
868
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
869
|
+
* @example ```javascript
|
|
870
|
+
* const contentful = require('contentful-management')
|
|
871
|
+
* const client = contentful.createClient({
|
|
872
|
+
* accessToken: '<content_management_api_key>'
|
|
873
|
+
* })
|
|
874
|
+
*
|
|
875
|
+
* client.getOrganization('<org_id>')
|
|
876
|
+
* .then((org) => org.deleteAppKey('app_definition_id', 'fingerprint'))
|
|
877
|
+
* .then((result) => console.log(result))
|
|
878
|
+
* .catch(console.error)
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
deleteAppKey(appDefinitionId, fingerprint) {
|
|
882
|
+
const raw = this.toPlainObject();
|
|
883
|
+
return makeRequest({
|
|
884
|
+
entityType: 'AppKey',
|
|
885
|
+
action: 'delete',
|
|
886
|
+
params: { organizationId: raw.sys.id, appDefinitionId, fingerprint },
|
|
887
|
+
}).then(() => {
|
|
888
|
+
/* noop*/
|
|
889
|
+
});
|
|
890
|
+
},
|
|
891
|
+
/**
|
|
892
|
+
* Creates or updates an app details entity
|
|
893
|
+
* @return Promise for an App Details
|
|
894
|
+
* @example ```javascript
|
|
895
|
+
* const contentful = require('contentful-management')
|
|
896
|
+
* const client = contentful.createClient({
|
|
897
|
+
* accessToken: '<content_management_api_key>'
|
|
898
|
+
* })
|
|
899
|
+
*
|
|
900
|
+
* client.getOrganization('<org_id>')
|
|
901
|
+
* .then((org) => org.upsertAppDetails('app_definition_id',
|
|
902
|
+
* { icon: { value: 'base_64_image', type: 'base64' }}
|
|
903
|
+
* ))
|
|
904
|
+
* .then((appDetails) => console.log(appDetails))
|
|
905
|
+
* .catch(console.error)
|
|
906
|
+
* ```
|
|
907
|
+
*/
|
|
908
|
+
upsertAppDetails(appDefinitionId, data) {
|
|
909
|
+
const raw = this.toPlainObject();
|
|
910
|
+
return makeRequest({
|
|
911
|
+
entityType: 'AppDetails',
|
|
912
|
+
action: 'upsert',
|
|
913
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
914
|
+
payload: data,
|
|
915
|
+
}).then((payload) => wrapAppDetails(makeRequest, payload));
|
|
916
|
+
},
|
|
917
|
+
/**
|
|
918
|
+
* Gets an app details entity
|
|
919
|
+
* @return Promise for an App Details
|
|
920
|
+
* @example ```javascript
|
|
921
|
+
* const contentful = require('contentful-management')
|
|
922
|
+
* const client = contentful.createClient({
|
|
923
|
+
* accessToken: '<content_management_api_key>'
|
|
924
|
+
* })
|
|
925
|
+
*
|
|
926
|
+
* client.getOrganization('<org_id>')
|
|
927
|
+
* .then((org) => org.getAppDetails('app_definition_id'))
|
|
928
|
+
* .then((appDetails) => console.log(appDetails))
|
|
929
|
+
* .catch(console.error)
|
|
930
|
+
* ```
|
|
931
|
+
*/
|
|
932
|
+
getAppDetails(appDefinitionId) {
|
|
933
|
+
const raw = this.toPlainObject();
|
|
934
|
+
return makeRequest({
|
|
935
|
+
entityType: 'AppDetails',
|
|
936
|
+
action: 'get',
|
|
937
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
938
|
+
}).then((payload) => wrapAppDetails(makeRequest, payload));
|
|
939
|
+
},
|
|
940
|
+
/**
|
|
941
|
+
* Deletes an app details entity.
|
|
942
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
943
|
+
* @example ```javascript
|
|
944
|
+
* const contentful = require('contentful-management')
|
|
945
|
+
* const client = contentful.createClient({
|
|
946
|
+
* accessToken: '<content_management_api_key>'
|
|
947
|
+
* })
|
|
948
|
+
*
|
|
949
|
+
* client.getOrganization('<org_id>')
|
|
950
|
+
* .then((org) => org.deleteAppDetails('app_definition_id'))
|
|
951
|
+
* .then((result) => console.log(result))
|
|
952
|
+
* .catch(console.error)
|
|
953
|
+
* ```
|
|
954
|
+
*/
|
|
955
|
+
deleteAppDetails(appDefinitionId) {
|
|
956
|
+
const raw = this.toPlainObject();
|
|
957
|
+
return makeRequest({
|
|
958
|
+
entityType: 'AppDetails',
|
|
959
|
+
action: 'delete',
|
|
960
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
961
|
+
}).then(() => {
|
|
962
|
+
/* noop*/
|
|
963
|
+
});
|
|
964
|
+
},
|
|
965
|
+
/**
|
|
966
|
+
* Creates an app action entity.
|
|
967
|
+
* @return Promise that resolves an App Action entity
|
|
968
|
+
* @example ```javascript
|
|
969
|
+
* const contentful = require('contentful-management')
|
|
970
|
+
* const client = contentful.createClient({
|
|
971
|
+
* accessToken: '<content_management_api_key>'
|
|
972
|
+
* })
|
|
973
|
+
*
|
|
974
|
+
* client.getOrganization('<org_id>')
|
|
975
|
+
* .then((org) => org.createAppAction('app_definition_id', {
|
|
976
|
+
* type: 'endpoint',
|
|
977
|
+
* name: 'my nice new app action',
|
|
978
|
+
* url: 'https://www.somewhere.com/action'
|
|
979
|
+
* }))
|
|
980
|
+
* .then((appAction) => console.log(appAction))
|
|
981
|
+
* .catch(console.error)
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
createAppAction(appDefinitionId, data) {
|
|
985
|
+
const raw = this.toPlainObject();
|
|
986
|
+
return makeRequest({
|
|
987
|
+
entityType: 'AppAction',
|
|
988
|
+
action: 'create',
|
|
989
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
990
|
+
payload: data,
|
|
991
|
+
}).then((payload) => wrapAppAction(makeRequest, payload));
|
|
992
|
+
},
|
|
993
|
+
/**
|
|
994
|
+
* Updates an existing app action entity.
|
|
995
|
+
* @return Promise that resolves an App Action entity
|
|
996
|
+
* @example ```javascript
|
|
997
|
+
* const contentful = require('contentful-management')
|
|
998
|
+
* const client = contentful.createClient({
|
|
999
|
+
* accessToken: '<content_management_api_key>'
|
|
1000
|
+
* })
|
|
1001
|
+
*
|
|
1002
|
+
* client.getOrganization('<org_id>')
|
|
1003
|
+
* .then((org) => org.updateAppAction('app_definition_id', 'app_action_id', {
|
|
1004
|
+
* type: 'endpoint',
|
|
1005
|
+
* name: 'my nice updated app action',
|
|
1006
|
+
* url: 'https://www.somewhere-else.com/action'
|
|
1007
|
+
* }))
|
|
1008
|
+
* .then((appAction) => console.log(appAction))
|
|
1009
|
+
* .catch(console.error)
|
|
1010
|
+
* ```
|
|
1011
|
+
*/
|
|
1012
|
+
updateAppAction(appDefinitionId, appActionId, data) {
|
|
1013
|
+
const raw = this.toPlainObject();
|
|
1014
|
+
return makeRequest({
|
|
1015
|
+
entityType: 'AppAction',
|
|
1016
|
+
action: 'update',
|
|
1017
|
+
params: { organizationId: raw.sys.id, appDefinitionId, appActionId },
|
|
1018
|
+
payload: data,
|
|
1019
|
+
}).then((payload) => wrapAppAction(makeRequest, payload));
|
|
1020
|
+
},
|
|
1021
|
+
/**
|
|
1022
|
+
* Deletes an app action entity.
|
|
1023
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
1024
|
+
* @example ```javascript
|
|
1025
|
+
* const contentful = require('contentful-management')
|
|
1026
|
+
* const client = contentful.createClient({
|
|
1027
|
+
* accessToken: '<content_management_api_key>'
|
|
1028
|
+
* })
|
|
1029
|
+
*
|
|
1030
|
+
* client.getOrganization('<org_id>')
|
|
1031
|
+
* .then((org) => org.deleteAppAction('app_definition_id', 'app_action_id'))
|
|
1032
|
+
* .then((result) => console.log(result))
|
|
1033
|
+
* .catch(console.error)
|
|
1034
|
+
* ```
|
|
1035
|
+
*/
|
|
1036
|
+
deleteAppAction(appDefinitionId, appActionId) {
|
|
1037
|
+
const raw = this.toPlainObject();
|
|
1038
|
+
return makeRequest({
|
|
1039
|
+
entityType: 'AppAction',
|
|
1040
|
+
action: 'delete',
|
|
1041
|
+
params: { organizationId: raw.sys.id, appDefinitionId, appActionId },
|
|
1042
|
+
}).then(() => {
|
|
1043
|
+
/* noop*/
|
|
1044
|
+
});
|
|
1045
|
+
},
|
|
1046
|
+
/**
|
|
1047
|
+
* Gets an existing app action entity.
|
|
1048
|
+
* @return Promise that resolves an App Action entity
|
|
1049
|
+
* @example ```javascript
|
|
1050
|
+
* const contentful = require('contentful-management')
|
|
1051
|
+
* const client = contentful.createClient({
|
|
1052
|
+
* accessToken: '<content_management_api_key>'
|
|
1053
|
+
* })
|
|
1054
|
+
*
|
|
1055
|
+
* client.getOrganization('<org_id>')
|
|
1056
|
+
* .then((org) => org.getAppAction('app_definition_id', 'app_action_id'))
|
|
1057
|
+
* .then((appAction) => console.log(appAction))
|
|
1058
|
+
* .catch(console.error)
|
|
1059
|
+
* ```
|
|
1060
|
+
*/
|
|
1061
|
+
getAppAction(appDefinitionId, appActionId) {
|
|
1062
|
+
const raw = this.toPlainObject();
|
|
1063
|
+
return makeRequest({
|
|
1064
|
+
entityType: 'AppAction',
|
|
1065
|
+
action: 'get',
|
|
1066
|
+
params: { organizationId: raw.sys.id, appDefinitionId, appActionId },
|
|
1067
|
+
}).then((payload) => wrapAppAction(makeRequest, payload));
|
|
1068
|
+
},
|
|
1069
|
+
/**
|
|
1070
|
+
* Gets existing app actions for an App Definition.
|
|
1071
|
+
* @return Promise that resolves an App Action entity
|
|
1072
|
+
* @example ```javascript
|
|
1073
|
+
* const contentful = require('contentful-management')
|
|
1074
|
+
* const client = contentful.createClient({
|
|
1075
|
+
* accessToken: '<content_management_api_key>'
|
|
1076
|
+
* })
|
|
1077
|
+
*
|
|
1078
|
+
* client.getOrganization('<org_id>')
|
|
1079
|
+
* .then((org) => org.getAppActions('app_definition_id'))
|
|
1080
|
+
* .then((appActions) => console.log(appActions))
|
|
1081
|
+
* .catch(console.error)
|
|
1082
|
+
* ```
|
|
1083
|
+
*/
|
|
1084
|
+
getAppActions(appDefinitionId) {
|
|
1085
|
+
const raw = this.toPlainObject();
|
|
1086
|
+
return makeRequest({
|
|
1087
|
+
entityType: 'AppAction',
|
|
1088
|
+
action: 'getMany',
|
|
1089
|
+
params: { organizationId: raw.sys.id, appDefinitionId },
|
|
1090
|
+
}).then((payload) => wrapAppActionCollection(makeRequest, payload));
|
|
1091
|
+
},
|
|
1092
|
+
/**
|
|
1093
|
+
* Gets an app function
|
|
1094
|
+
* @param appDefinitionId
|
|
1095
|
+
* @param functionId
|
|
1096
|
+
* @returns Promise for a Function
|
|
1097
|
+
* @example ```javascript
|
|
1098
|
+
* const contentful = require('contentful-management')
|
|
1099
|
+
* const client = contentful.createClient({
|
|
1100
|
+
* accessToken: '<content_management_api_key>'
|
|
1101
|
+
* })
|
|
1102
|
+
* const org = await client.getOrganization('<org_id>')
|
|
1103
|
+
* const functions = await org.getFunction('<app_definition_id>', '<function_id>')
|
|
1104
|
+
*/
|
|
1105
|
+
getFunction(appDefinitionId, functionId) {
|
|
1106
|
+
const raw = this.toPlainObject();
|
|
1107
|
+
return makeRequest({
|
|
1108
|
+
entityType: 'Function',
|
|
1109
|
+
action: 'get',
|
|
1110
|
+
params: { organizationId: raw.sys.id, appDefinitionId, functionId },
|
|
1111
|
+
}).then((payload) => wrapFunction(makeRequest, payload));
|
|
1112
|
+
},
|
|
1113
|
+
/**
|
|
1114
|
+
* Gets a collection of app functions.
|
|
1115
|
+
* @param appDefinitionId
|
|
1116
|
+
* @param {import('../common-types').AcceptsQueryOptions} query - optional query parameter for filtering functions by action
|
|
1117
|
+
* @returns Promise for a Function
|
|
1118
|
+
* @example ```javascript
|
|
1119
|
+
* const contentful = require('contentful-management')
|
|
1120
|
+
* const client = contentful.createClient({
|
|
1121
|
+
* accessToken: '<content_management_api_key>'
|
|
1122
|
+
* })
|
|
1123
|
+
* const org = await client.getOrganization('<org_id>')
|
|
1124
|
+
* const functions = await org.getFunctions('<app_definition_id>', { 'accepts[all]': '<action>' })
|
|
1125
|
+
*/
|
|
1126
|
+
getFunctions(appDefinitionId, query) {
|
|
1127
|
+
const raw = this.toPlainObject();
|
|
1128
|
+
return makeRequest({
|
|
1129
|
+
entityType: 'Function',
|
|
1130
|
+
action: 'getMany',
|
|
1131
|
+
params: { organizationId: raw.sys.id, appDefinitionId, query },
|
|
1132
|
+
}).then((payload) => wrapFunctionCollection(makeRequest, payload));
|
|
1133
|
+
},
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export { createOrganizationApi as default };
|
|
1138
|
+
//# sourceMappingURL=create-organization-api.js.map
|