contentful-management 11.52.1 → 12.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -48
- package/dist/contentful-management.browser.js +23913 -28421
- package/dist/contentful-management.browser.min.js +1 -2
- package/dist/contentful-management.cjs +37008 -0
- package/dist/{es-modules → esm}/adapters/REST/endpoints/access-token.js +20 -22
- package/dist/esm/adapters/REST/endpoints/ai-action-invocation.js +7 -0
- package/dist/esm/adapters/REST/endpoints/ai-action.js +44 -0
- package/dist/esm/adapters/REST/endpoints/api-key.js +41 -0
- package/dist/esm/adapters/REST/endpoints/app-access-token.js +7 -0
- package/dist/esm/adapters/REST/endpoints/app-action-call.js +61 -0
- package/dist/esm/adapters/REST/endpoints/app-action.js +35 -0
- package/dist/esm/adapters/REST/endpoints/app-bundle.js +34 -0
- package/dist/esm/adapters/REST/endpoints/app-definition.js +39 -0
- package/dist/esm/adapters/REST/endpoints/app-details.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-event-subscription.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-installation.js +35 -0
- package/dist/esm/adapters/REST/endpoints/app-key.js +16 -0
- package/dist/esm/adapters/REST/endpoints/app-signed-request.js +7 -0
- package/dist/esm/adapters/REST/endpoints/app-signing-secret.js +13 -0
- package/dist/esm/adapters/REST/endpoints/app-upload.js +24 -0
- package/dist/esm/adapters/REST/endpoints/asset-key.js +31 -0
- package/dist/esm/adapters/REST/endpoints/asset.js +170 -0
- package/dist/esm/adapters/REST/endpoints/bulk-action.js +16 -0
- package/dist/esm/adapters/REST/endpoints/comment.js +85 -0
- package/dist/esm/adapters/REST/endpoints/concept-scheme.js +35 -0
- package/dist/esm/adapters/REST/endpoints/concept.js +54 -0
- package/dist/esm/adapters/REST/endpoints/content-type.js +47 -0
- package/dist/esm/adapters/REST/endpoints/editor-interface.js +20 -0
- package/dist/esm/adapters/REST/endpoints/entry.js +90 -0
- package/dist/esm/adapters/REST/endpoints/environment-alias.js +38 -0
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +20 -0
- package/dist/esm/adapters/REST/endpoints/environment-template.js +38 -0
- package/dist/esm/adapters/REST/endpoints/environment.js +40 -0
- package/dist/esm/adapters/REST/endpoints/extension.js +36 -0
- package/dist/esm/adapters/REST/endpoints/function-log.js +20 -0
- package/dist/esm/adapters/REST/endpoints/function.js +21 -0
- package/dist/esm/adapters/REST/endpoints/http.js +22 -0
- package/dist/esm/adapters/REST/endpoints/index.js +137 -0
- package/dist/esm/adapters/REST/endpoints/locale.js +31 -0
- package/dist/{es-modules → esm}/adapters/REST/endpoints/oauth-application.js +21 -22
- package/dist/esm/adapters/REST/endpoints/organization-invitation.js +20 -0
- package/dist/esm/adapters/REST/endpoints/organization-membership.js +27 -0
- package/dist/esm/adapters/REST/endpoints/organization.js +25 -0
- package/dist/esm/adapters/REST/endpoints/personal-access-token.js +32 -0
- package/dist/esm/adapters/REST/endpoints/preview-api-key.js +12 -0
- package/dist/esm/adapters/REST/endpoints/raw.js +37 -0
- package/dist/esm/adapters/REST/endpoints/release-action.js +17 -0
- package/dist/esm/adapters/REST/endpoints/release.js +50 -0
- package/dist/esm/adapters/REST/endpoints/resource-provider.js +14 -0
- package/dist/esm/adapters/REST/endpoints/resource-type.js +24 -0
- package/dist/esm/adapters/REST/endpoints/resource.js +8 -0
- package/dist/esm/adapters/REST/endpoints/role.js +40 -0
- package/dist/esm/adapters/REST/endpoints/scheduled-action.js +38 -0
- package/dist/esm/adapters/REST/endpoints/snapshot.js +25 -0
- package/dist/esm/adapters/REST/endpoints/space-member.js +8 -0
- package/dist/esm/adapters/REST/endpoints/space-membership.js +51 -0
- package/dist/esm/adapters/REST/endpoints/space.js +27 -0
- package/dist/esm/adapters/REST/endpoints/tag.js +31 -0
- package/dist/esm/adapters/REST/endpoints/task.js +33 -0
- package/dist/esm/adapters/REST/endpoints/team-membership.js +28 -0
- package/dist/esm/adapters/REST/endpoints/team-space-membership.js +38 -0
- package/dist/esm/adapters/REST/endpoints/team.js +29 -0
- package/dist/esm/adapters/REST/endpoints/ui-config.js +19 -0
- package/dist/esm/adapters/REST/endpoints/upload-credentials.js +14 -0
- package/dist/esm/adapters/REST/endpoints/upload.js +38 -0
- package/dist/esm/adapters/REST/endpoints/usage.js +14 -0
- package/dist/esm/adapters/REST/endpoints/user-ui-config.js +19 -0
- package/dist/esm/adapters/REST/endpoints/user.js +21 -0
- package/dist/esm/adapters/REST/endpoints/utils.js +17 -0
- package/dist/esm/adapters/REST/endpoints/webhook.js +82 -0
- package/dist/esm/adapters/REST/endpoints/workflow-definition.js +35 -0
- package/dist/esm/adapters/REST/endpoints/workflow.js +42 -0
- package/dist/esm/adapters/REST/endpoints/workflows-changelog.js +9 -0
- package/dist/esm/adapters/REST/make-request.js +17 -0
- package/dist/esm/adapters/REST/rest-adapter.js +30 -0
- package/dist/esm/common-types.js +6 -0
- package/dist/esm/common-utils.js +32 -0
- package/dist/esm/constants/editor-interface-defaults/controls-defaults.js +153 -0
- package/dist/esm/constants/editor-interface-defaults/editors-defaults.js +37 -0
- package/dist/esm/constants/editor-interface-defaults/index.js +12 -0
- package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.js +68 -0
- package/dist/esm/constants/editor-interface-defaults/types.js +15 -0
- package/dist/esm/create-adapter.js +19 -0
- package/dist/esm/create-app-definition-api.js +252 -0
- package/dist/esm/create-contentful-api.js +590 -0
- package/dist/esm/create-entry-api.js +479 -0
- package/dist/esm/create-environment-api.js +2401 -0
- package/dist/esm/create-environment-template-api.js +268 -0
- package/dist/esm/create-organization-api.js +1134 -0
- package/dist/esm/create-space-api.js +1589 -0
- package/dist/esm/create-ui-config-api.js +53 -0
- package/dist/esm/create-user-ui-config-api.js +53 -0
- package/dist/{es-modules → esm}/enhance-with-methods.js +13 -11
- package/dist/esm/entities/access-token.js +33 -0
- package/dist/esm/entities/ai-action-invocation.js +42 -0
- package/dist/esm/entities/ai-action.js +91 -0
- package/dist/esm/entities/api-key.js +56 -0
- package/dist/esm/entities/app-access-token.js +15 -0
- package/dist/esm/entities/app-action-call.js +61 -0
- package/dist/esm/entities/app-action.js +45 -0
- package/dist/esm/entities/app-bundle.js +45 -0
- package/dist/esm/entities/app-definition.js +26 -0
- package/dist/esm/entities/app-details.js +37 -0
- package/dist/esm/entities/app-event-subscription.js +32 -0
- package/dist/esm/entities/app-installation.js +52 -0
- package/dist/esm/entities/app-key.js +41 -0
- package/dist/{es-modules → esm}/entities/app-signed-request.js +7 -4
- package/dist/esm/entities/app-signing-secret.js +32 -0
- package/dist/esm/entities/app-upload.js +44 -0
- package/dist/{es-modules → esm}/entities/asset-key.js +7 -4
- package/dist/esm/entities/asset.js +121 -0
- package/dist/esm/entities/bulk-action.js +58 -0
- package/dist/esm/entities/comment.js +57 -0
- package/dist/esm/entities/concept-scheme.js +1 -0
- package/dist/esm/entities/concept.js +1 -0
- package/dist/esm/entities/content-type.js +117 -0
- package/dist/esm/entities/editor-interface.js +47 -0
- package/dist/esm/entities/entry.js +24 -0
- package/dist/esm/entities/environment-alias.js +55 -0
- package/dist/esm/entities/environment-template-installation.js +20 -0
- package/dist/esm/entities/environment-template.js +15 -0
- package/dist/esm/entities/environment.js +31 -0
- package/dist/esm/entities/extension.js +51 -0
- package/dist/{es-modules → esm}/entities/function-log.js +9 -7
- package/dist/esm/entities/function.js +63 -0
- package/dist/esm/entities/index.js +129 -0
- package/dist/esm/entities/locale.js +54 -0
- package/dist/esm/entities/oauth-application.js +63 -0
- package/dist/esm/entities/organization-invitation.js +15 -0
- package/dist/esm/entities/organization-membership.js +50 -0
- package/dist/esm/entities/organization.js +29 -0
- package/dist/esm/entities/personal-access-token.js +33 -0
- package/dist/esm/entities/preview-api-key.js +28 -0
- package/dist/esm/entities/release-action.js +52 -0
- package/dist/esm/entities/release.js +107 -0
- package/dist/esm/entities/resource-provider.js +137 -0
- package/dist/esm/entities/resource-type.js +94 -0
- package/dist/esm/entities/resource.js +10 -0
- package/dist/esm/entities/role.js +50 -0
- package/dist/esm/entities/scheduled-action.js +148 -0
- package/dist/esm/entities/snapshot.js +33 -0
- package/dist/esm/entities/space-member.js +20 -0
- package/dist/esm/entities/space-membership.js +50 -0
- package/dist/esm/entities/space.js +30 -0
- package/dist/esm/entities/tag.js +50 -0
- package/dist/esm/entities/task.js +51 -0
- package/dist/esm/entities/team-membership.js +51 -0
- package/dist/esm/entities/team-space-membership.js +50 -0
- package/dist/esm/entities/team.js +50 -0
- package/dist/esm/entities/ui-config.js +18 -0
- package/dist/esm/entities/upload.js +36 -0
- package/dist/esm/entities/usage.js +22 -0
- package/dist/esm/entities/user-ui-config.js +18 -0
- package/dist/esm/entities/user.js +25 -0
- package/dist/esm/entities/webhook.js +74 -0
- package/dist/esm/entities/workflow-definition.js +73 -0
- package/dist/esm/index.js +36 -0
- package/dist/esm/methods/action.js +49 -0
- package/dist/esm/methods/content-type.js +49 -0
- package/dist/esm/methods/utils.js +9 -0
- package/dist/esm/plain/as-iterator.js +30 -0
- package/dist/esm/plain/checks.js +10 -0
- package/dist/esm/plain/pagination-helper.js +54 -0
- package/dist/esm/plain/plain-client.js +514 -0
- package/dist/esm/plain/wrappers/wrap.js +24 -0
- package/dist/esm/upload-http-client.js +15 -0
- package/dist/stats-browser-min.html +4842 -0
- package/dist/{typings → types}/adapters/REST/endpoints/concept-scheme.d.ts +0 -1
- package/dist/{typings → types}/adapters/REST/endpoints/concept.d.ts +0 -1
- package/dist/{typings → types}/common-types.d.ts +22 -39
- package/dist/{typings → types}/create-contentful-api.d.ts +3 -2
- package/dist/{typings → types}/create-environment-api.d.ts +3 -3
- package/dist/{typings → types}/create-organization-api.d.ts +90 -90
- package/dist/{typings → types}/create-ui-config-api.d.ts +1 -1
- package/dist/{typings → types}/create-user-ui-config-api.d.ts +1 -1
- package/dist/{typings → types}/entities/access-token.d.ts +3 -3
- package/dist/{typings → types}/entities/ai-action-invocation.d.ts +4 -4
- package/dist/{typings → types}/entities/ai-action.d.ts +4 -21
- package/dist/{typings → types}/entities/api-key.d.ts +4 -8
- package/dist/{typings → types}/entities/app-access-token.d.ts +5 -5
- package/dist/{typings → types}/entities/app-action-call.d.ts +6 -6
- package/dist/{typings → types}/entities/app-action.d.ts +4 -4
- package/dist/{typings → types}/entities/app-bundle.d.ts +4 -4
- package/dist/{typings → types}/entities/app-definition.d.ts +3 -3
- package/dist/{typings → types}/entities/app-details.d.ts +4 -4
- package/dist/{typings → types}/entities/app-event-subscription.d.ts +4 -4
- package/dist/{typings → types}/entities/app-installation.d.ts +6 -6
- package/dist/{typings → types}/entities/app-key.d.ts +4 -4
- package/dist/{typings → types}/entities/app-signed-request.d.ts +5 -5
- package/dist/{typings → types}/entities/app-signing-secret.d.ts +4 -4
- package/dist/{typings → types}/entities/app-upload.d.ts +3 -3
- package/dist/{typings → types}/entities/asset.d.ts +1 -2
- package/dist/{typings → types}/entities/comment.d.ts +4 -4
- package/dist/{typings → types}/entities/content-type.d.ts +4 -4
- package/dist/{typings → types}/entities/editor-interface.d.ts +5 -11
- package/dist/{typings → types}/entities/entry.d.ts +5 -1
- package/dist/{typings → types}/entities/environment-alias.d.ts +4 -6
- package/dist/{typings → types}/entities/environment-template-installation.d.ts +1 -1
- package/dist/{typings → types}/entities/environment-template.d.ts +1 -1
- package/dist/{typings → types}/entities/environment.d.ts +6 -6
- package/dist/{typings → types}/entities/extension.d.ts +4 -4
- package/dist/{typings → types}/entities/locale.d.ts +4 -4
- package/dist/{typings → types}/entities/oauth-application.d.ts +1 -1
- package/dist/{typings → types}/entities/organization-invitation.d.ts +3 -5
- package/dist/{typings → types}/entities/organization-membership.d.ts +3 -5
- package/dist/{typings → types}/entities/organization.d.ts +1 -1
- package/dist/{typings → types}/entities/personal-access-token.d.ts +1 -1
- package/dist/{typings → types}/entities/preview-api-key.d.ts +1 -1
- package/dist/{typings → types}/entities/resource-provider.d.ts +5 -5
- package/dist/{typings → types}/entities/resource-type.d.ts +5 -5
- package/dist/{typings → types}/entities/resource.d.ts +4 -4
- package/dist/{typings → types}/entities/role.d.ts +3 -3
- package/dist/{typings → types}/entities/scheduled-action.d.ts +3 -5
- package/dist/{typings → types}/entities/snapshot.d.ts +1 -1
- package/dist/{typings → types}/entities/space-member.d.ts +3 -5
- package/dist/{typings → types}/entities/space-membership.d.ts +6 -6
- package/dist/{typings → types}/entities/space.d.ts +1 -1
- package/dist/{typings → types}/entities/tag.d.ts +4 -4
- package/dist/{typings → types}/entities/task.d.ts +4 -4
- package/dist/{typings → types}/entities/team-membership.d.ts +5 -11
- package/dist/{typings → types}/entities/team-space-membership.d.ts +5 -11
- package/dist/{typings → types}/entities/team.d.ts +3 -5
- package/dist/{typings → types}/entities/ui-config.d.ts +5 -5
- package/dist/{typings → types}/entities/upload-credential.d.ts +4 -4
- package/dist/{typings → types}/entities/upload.d.ts +4 -4
- package/dist/{typings → types}/entities/usage.d.ts +7 -7
- package/dist/{typings → types}/entities/user-ui-config.d.ts +5 -5
- package/dist/{typings → types}/entities/user.d.ts +1 -1
- package/dist/{typings → types}/entities/webhook.d.ts +10 -16
- package/dist/{typings → types}/entities/workflow-definition.d.ts +4 -4
- package/dist/{typings → types}/entities/workflow.d.ts +6 -6
- package/dist/{typings → types}/entities/workflows-changelog-entry.d.ts +2 -2
- package/dist/{typings → types}/export-types.d.ts +1 -1
- package/dist/{typings/contentful-management.d.ts → types/index.d.ts} +1 -1
- package/dist/types/plain/checks.d.ts +13 -0
- package/dist/{typings → types}/plain/common-types.d.ts +3 -2
- package/dist/{typings → types}/plain/entities/concept-scheme.d.ts +3 -20
- package/dist/{typings → types}/plain/entities/concept.d.ts +4 -21
- package/dist/{typings → types}/plain/entities/upload-credential.d.ts +1 -1
- package/package.json +49 -45
- package/dist/contentful-management.browser.js.map +0 -1
- package/dist/contentful-management.node.js +0 -32624
- package/dist/contentful-management.node.js.map +0 -1
- package/dist/contentful-management.node.min.js +0 -2
- package/dist/es-modules/adapters/REST/endpoints/ai-action-invocation.js +0 -6
- package/dist/es-modules/adapters/REST/endpoints/ai-action.js +0 -61
- package/dist/es-modules/adapters/REST/endpoints/api-key.js +0 -47
- package/dist/es-modules/adapters/REST/endpoints/app-access-token.js +0 -8
- package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +0 -69
- package/dist/es-modules/adapters/REST/endpoints/app-action.js +0 -32
- package/dist/es-modules/adapters/REST/endpoints/app-bundle.js +0 -36
- package/dist/es-modules/adapters/REST/endpoints/app-definition.js +0 -45
- package/dist/es-modules/adapters/REST/endpoints/app-details.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-event-subscription.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-installation.js +0 -39
- package/dist/es-modules/adapters/REST/endpoints/app-key.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/app-signed-request.js +0 -4
- package/dist/es-modules/adapters/REST/endpoints/app-signing-secret.js +0 -10
- package/dist/es-modules/adapters/REST/endpoints/app-upload.js +0 -23
- package/dist/es-modules/adapters/REST/endpoints/asset-key.js +0 -33
- package/dist/es-modules/adapters/REST/endpoints/asset.js +0 -220
- package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/comment.js +0 -101
- package/dist/es-modules/adapters/REST/endpoints/concept-scheme.js +0 -52
- package/dist/es-modules/adapters/REST/endpoints/concept.js +0 -85
- package/dist/es-modules/adapters/REST/endpoints/content-type.js +0 -61
- package/dist/es-modules/adapters/REST/endpoints/editor-interface.js +0 -24
- package/dist/es-modules/adapters/REST/endpoints/entry.js +0 -113
- package/dist/es-modules/adapters/REST/endpoints/environment-alias.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/environment-template-installation.js +0 -43
- package/dist/es-modules/adapters/REST/endpoints/environment-template.js +0 -88
- package/dist/es-modules/adapters/REST/endpoints/environment.js +0 -42
- package/dist/es-modules/adapters/REST/endpoints/extension.js +0 -44
- package/dist/es-modules/adapters/REST/endpoints/function-log.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/function.js +0 -20
- package/dist/es-modules/adapters/REST/endpoints/http.js +0 -39
- package/dist/es-modules/adapters/REST/endpoints/index.js +0 -134
- package/dist/es-modules/adapters/REST/endpoints/locale.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/organization-invitation.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/organization-membership.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/organization.js +0 -26
- package/dist/es-modules/adapters/REST/endpoints/personal-access-token.js +0 -33
- package/dist/es-modules/adapters/REST/endpoints/preview-api-key.js +0 -9
- package/dist/es-modules/adapters/REST/endpoints/raw.js +0 -42
- package/dist/es-modules/adapters/REST/endpoints/release-action.js +0 -21
- package/dist/es-modules/adapters/REST/endpoints/release.js +0 -58
- package/dist/es-modules/adapters/REST/endpoints/resource-provider.js +0 -13
- package/dist/es-modules/adapters/REST/endpoints/resource-type.js +0 -23
- package/dist/es-modules/adapters/REST/endpoints/resource.js +0 -5
- package/dist/es-modules/adapters/REST/endpoints/role.js +0 -44
- package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/snapshot.js +0 -22
- package/dist/es-modules/adapters/REST/endpoints/space-member.js +0 -5
- package/dist/es-modules/adapters/REST/endpoints/space-membership.js +0 -55
- package/dist/es-modules/adapters/REST/endpoints/space.js +0 -32
- package/dist/es-modules/adapters/REST/endpoints/tag.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/task.js +0 -47
- package/dist/es-modules/adapters/REST/endpoints/team-membership.js +0 -34
- package/dist/es-modules/adapters/REST/endpoints/team-space-membership.js +0 -45
- package/dist/es-modules/adapters/REST/endpoints/team.js +0 -35
- package/dist/es-modules/adapters/REST/endpoints/ui-config.js +0 -16
- package/dist/es-modules/adapters/REST/endpoints/upload-credentials.js +0 -11
- package/dist/es-modules/adapters/REST/endpoints/upload.js +0 -37
- package/dist/es-modules/adapters/REST/endpoints/usage.js +0 -11
- package/dist/es-modules/adapters/REST/endpoints/user-ui-config.js +0 -16
- package/dist/es-modules/adapters/REST/endpoints/user.js +0 -20
- package/dist/es-modules/adapters/REST/endpoints/utils.js +0 -28
- package/dist/es-modules/adapters/REST/endpoints/webhook.js +0 -93
- package/dist/es-modules/adapters/REST/endpoints/workflow-definition.js +0 -46
- package/dist/es-modules/adapters/REST/endpoints/workflow.js +0 -59
- package/dist/es-modules/adapters/REST/endpoints/workflows-changelog.js +0 -6
- package/dist/es-modules/adapters/REST/make-request.js +0 -28
- package/dist/es-modules/adapters/REST/rest-adapter.js +0 -42
- package/dist/es-modules/adapters/REST/types.js +0 -1
- package/dist/es-modules/common-types.js +0 -61
- package/dist/es-modules/common-utils.js +0 -30
- package/dist/es-modules/constants/editor-interface-defaults/controls-defaults.js +0 -255
- package/dist/es-modules/constants/editor-interface-defaults/editors-defaults.js +0 -34
- package/dist/es-modules/constants/editor-interface-defaults/index.js +0 -9
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +0 -57
- package/dist/es-modules/constants/editor-interface-defaults/types.js +0 -14
- package/dist/es-modules/contentful-management.js +0 -66
- package/dist/es-modules/create-adapter.js +0 -16
- package/dist/es-modules/create-app-definition-api.js +0 -263
- package/dist/es-modules/create-contentful-api.js +0 -663
- package/dist/es-modules/create-entry-api.js +0 -548
- package/dist/es-modules/create-environment-api.js +0 -2525
- package/dist/es-modules/create-environment-template-api.js +0 -316
- package/dist/es-modules/create-organization-api.js +0 -1306
- package/dist/es-modules/create-space-api.js +0 -1750
- package/dist/es-modules/create-ui-config-api.js +0 -60
- package/dist/es-modules/create-user-ui-config-api.js +0 -60
- package/dist/es-modules/entities/access-token.js +0 -38
- package/dist/es-modules/entities/ai-action-invocation.js +0 -46
- package/dist/es-modules/entities/ai-action.js +0 -88
- package/dist/es-modules/entities/api-key.js +0 -55
- package/dist/es-modules/entities/app-access-token.js +0 -12
- package/dist/es-modules/entities/app-action-call.js +0 -70
- package/dist/es-modules/entities/app-action.js +0 -53
- package/dist/es-modules/entities/app-bundle.js +0 -44
- package/dist/es-modules/entities/app-definition.js +0 -24
- package/dist/es-modules/entities/app-details.js +0 -35
- package/dist/es-modules/entities/app-event-subscription.js +0 -30
- package/dist/es-modules/entities/app-installation.js +0 -51
- package/dist/es-modules/entities/app-key.js +0 -40
- package/dist/es-modules/entities/app-signing-secret.js +0 -30
- package/dist/es-modules/entities/app-upload.js +0 -43
- package/dist/es-modules/entities/asset.js +0 -131
- package/dist/es-modules/entities/bulk-action.js +0 -61
- package/dist/es-modules/entities/comment.js +0 -77
- package/dist/es-modules/entities/concept-scheme.js +0 -1
- package/dist/es-modules/entities/concept.js +0 -1
- package/dist/es-modules/entities/content-type-fields.js +0 -1
- package/dist/es-modules/entities/content-type.js +0 -146
- package/dist/es-modules/entities/editor-interface.js +0 -46
- package/dist/es-modules/entities/entry.js +0 -22
- package/dist/es-modules/entities/environment-alias.js +0 -54
- package/dist/es-modules/entities/environment-template-installation.js +0 -17
- package/dist/es-modules/entities/environment-template.js +0 -12
- package/dist/es-modules/entities/environment.js +0 -29
- package/dist/es-modules/entities/extension.js +0 -50
- package/dist/es-modules/entities/field-type.js +0 -1
- package/dist/es-modules/entities/function.js +0 -61
- package/dist/es-modules/entities/index.js +0 -126
- package/dist/es-modules/entities/locale.js +0 -53
- package/dist/es-modules/entities/oauth-application.js +0 -62
- package/dist/es-modules/entities/organization-invitation.js +0 -12
- package/dist/es-modules/entities/organization-membership.js +0 -49
- package/dist/es-modules/entities/organization.js +0 -32
- package/dist/es-modules/entities/personal-access-token.js +0 -38
- package/dist/es-modules/entities/preview-api-key.js +0 -27
- package/dist/es-modules/entities/release-action.js +0 -53
- package/dist/es-modules/entities/release.js +0 -105
- package/dist/es-modules/entities/resource-provider.js +0 -139
- package/dist/es-modules/entities/resource-type.js +0 -93
- package/dist/es-modules/entities/resource.js +0 -7
- package/dist/es-modules/entities/role.js +0 -49
- package/dist/es-modules/entities/scheduled-action.js +0 -155
- package/dist/es-modules/entities/snapshot.js +0 -31
- package/dist/es-modules/entities/space-member.js +0 -18
- package/dist/es-modules/entities/space-membership.js +0 -49
- package/dist/es-modules/entities/space.js +0 -28
- package/dist/es-modules/entities/tag.js +0 -56
- package/dist/es-modules/entities/task.js +0 -57
- package/dist/es-modules/entities/team-membership.js +0 -50
- package/dist/es-modules/entities/team-space-membership.js +0 -49
- package/dist/es-modules/entities/team.js +0 -49
- package/dist/es-modules/entities/ui-config.js +0 -15
- package/dist/es-modules/entities/upload-credential.js +0 -33
- package/dist/es-modules/entities/upload.js +0 -34
- package/dist/es-modules/entities/usage.js +0 -20
- package/dist/es-modules/entities/user-ui-config.js +0 -15
- package/dist/es-modules/entities/user.js +0 -23
- package/dist/es-modules/entities/utils.js +0 -1
- package/dist/es-modules/entities/webhook.js +0 -80
- package/dist/es-modules/entities/widget-parameters.js +0 -1
- package/dist/es-modules/entities/workflow-definition.js +0 -87
- package/dist/es-modules/entities/workflow.js +0 -76
- package/dist/es-modules/entities/workflows-changelog-entry.js +0 -24
- package/dist/es-modules/export-types.js +0 -3
- package/dist/es-modules/methods/action.js +0 -54
- package/dist/es-modules/methods/bulk-action.js +0 -15
- package/dist/es-modules/methods/content-type.js +0 -47
- package/dist/es-modules/methods/release-action.js +0 -17
- package/dist/es-modules/methods/utils.js +0 -7
- package/dist/es-modules/plain/as-iterator.js +0 -47
- package/dist/es-modules/plain/checks.js +0 -8
- package/dist/es-modules/plain/common-types.js +0 -1
- package/dist/es-modules/plain/entities/ai-action-invocation.js +0 -1
- package/dist/es-modules/plain/entities/ai-action.js +0 -1
- package/dist/es-modules/plain/entities/app-access-token.js +0 -1
- package/dist/es-modules/plain/entities/app-action-call.js +0 -1
- package/dist/es-modules/plain/entities/app-action.js +0 -1
- package/dist/es-modules/plain/entities/app-bundle.js +0 -1
- package/dist/es-modules/plain/entities/app-definition.js +0 -1
- package/dist/es-modules/plain/entities/app-details.js +0 -1
- package/dist/es-modules/plain/entities/app-event-subscription.js +0 -1
- package/dist/es-modules/plain/entities/app-installation.js +0 -1
- package/dist/es-modules/plain/entities/app-key.js +0 -1
- package/dist/es-modules/plain/entities/app-signed-request.js +0 -1
- package/dist/es-modules/plain/entities/app-signing-secret.js +0 -1
- package/dist/es-modules/plain/entities/app-upload.js +0 -1
- package/dist/es-modules/plain/entities/comment.js +0 -1
- package/dist/es-modules/plain/entities/concept-scheme.js +0 -1
- package/dist/es-modules/plain/entities/concept.js +0 -1
- package/dist/es-modules/plain/entities/editor-interface.js +0 -1
- package/dist/es-modules/plain/entities/environment-alias.js +0 -1
- package/dist/es-modules/plain/entities/environment.js +0 -1
- package/dist/es-modules/plain/entities/extension.js +0 -1
- package/dist/es-modules/plain/entities/function-log.js +0 -1
- package/dist/es-modules/plain/entities/function.js +0 -1
- package/dist/es-modules/plain/entities/locale.js +0 -1
- package/dist/es-modules/plain/entities/oauth-application.js +0 -1
- package/dist/es-modules/plain/entities/organization.js +0 -1
- package/dist/es-modules/plain/entities/resource-provider.js +0 -1
- package/dist/es-modules/plain/entities/resource-type.js +0 -1
- package/dist/es-modules/plain/entities/resource.js +0 -1
- package/dist/es-modules/plain/entities/role.js +0 -1
- package/dist/es-modules/plain/entities/space-member.js +0 -1
- package/dist/es-modules/plain/entities/space-membership.js +0 -1
- package/dist/es-modules/plain/entities/space.js +0 -1
- package/dist/es-modules/plain/entities/tag.js +0 -1
- package/dist/es-modules/plain/entities/task.js +0 -1
- package/dist/es-modules/plain/entities/team-membership.js +0 -1
- package/dist/es-modules/plain/entities/team-space-membership.js +0 -1
- package/dist/es-modules/plain/entities/team.js +0 -1
- package/dist/es-modules/plain/entities/ui-config.js +0 -1
- package/dist/es-modules/plain/entities/upload-credential.js +0 -1
- package/dist/es-modules/plain/entities/upload.js +0 -1
- package/dist/es-modules/plain/entities/usage.js +0 -1
- package/dist/es-modules/plain/entities/user-ui-config.js +0 -1
- package/dist/es-modules/plain/entities/user.js +0 -1
- package/dist/es-modules/plain/entities/webhook.js +0 -1
- package/dist/es-modules/plain/entities/workflow-definition.js +0 -1
- package/dist/es-modules/plain/entities/workflow.js +0 -1
- package/dist/es-modules/plain/entities/workflows-changelog.js +0 -1
- package/dist/es-modules/plain/pagination-helper.js +0 -76
- package/dist/es-modules/plain/plain-client.js +0 -544
- package/dist/es-modules/plain/wrappers/wrap.js +0 -46
- package/dist/es-modules/plain/wrappers/wrap.test-d.js +0 -15
- package/dist/es-modules/upload-http-client.js +0 -17
- package/dist/typings/plain/checks.d.ts +0 -13
- /package/dist/{typings → types}/adapters/REST/endpoints/access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ai-action-invocation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ai-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/api-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-action-call.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-bundle.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-definition.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-details.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-event-subscription.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-installation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-signed-request.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-signing-secret.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/app-upload.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/asset-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/asset.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/comment.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/content-type.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/editor-interface.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/entry.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-alias.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-template-installation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment-template.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/environment.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/extension.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/function-log.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/function.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/http.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/index.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/locale.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/oauth-application.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization-invitation.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/organization.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/personal-access-token.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/preview-api-key.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/raw.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/release-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/release.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource-provider.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource-type.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/resource.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/role.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/scheduled-action.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/snapshot.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space-member.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/space.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/tag.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/task.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team-space-membership.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/team.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/ui-config.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/upload-credentials.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/upload.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/usage.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/user-ui-config.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/user.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/utils.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/webhook.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflow-definition.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflow.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/workflows-changelog.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/make-request.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/rest-adapter.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/types.d.ts +0 -0
- /package/dist/{typings → types}/common-utils.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/controls-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/editors-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/index.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/sidebar-defaults.d.ts +0 -0
- /package/dist/{typings → types}/constants/editor-interface-defaults/types.d.ts +0 -0
- /package/dist/{typings → types}/create-adapter.d.ts +0 -0
- /package/dist/{typings → types}/create-app-definition-api.d.ts +0 -0
- /package/dist/{typings → types}/create-entry-api.d.ts +0 -0
- /package/dist/{typings → types}/create-environment-template-api.d.ts +0 -0
- /package/dist/{typings → types}/create-space-api.d.ts +0 -0
- /package/dist/{typings → types}/enhance-with-methods.d.ts +0 -0
- /package/dist/{typings → types}/entities/asset-key.d.ts +0 -0
- /package/dist/{typings → types}/entities/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/concept-scheme.d.ts +0 -0
- /package/dist/{typings → types}/entities/concept.d.ts +0 -0
- /package/dist/{typings → types}/entities/content-type-fields.d.ts +0 -0
- /package/dist/{typings → types}/entities/field-type.d.ts +0 -0
- /package/dist/{typings → types}/entities/function-log.d.ts +0 -0
- /package/dist/{typings → types}/entities/function.d.ts +0 -0
- /package/dist/{typings → types}/entities/index.d.ts +0 -0
- /package/dist/{typings → types}/entities/release-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/release.d.ts +0 -0
- /package/dist/{typings → types}/entities/utils.d.ts +0 -0
- /package/dist/{typings → types}/entities/widget-parameters.d.ts +0 -0
- /package/dist/{typings → types}/methods/action.d.ts +0 -0
- /package/dist/{typings → types}/methods/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/methods/content-type.d.ts +0 -0
- /package/dist/{typings → types}/methods/release-action.d.ts +0 -0
- /package/dist/{typings → types}/methods/utils.d.ts +0 -0
- /package/dist/{typings → types}/plain/as-iterator.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ai-action-invocation.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ai-action.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-access-token.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-action-call.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-action.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-bundle.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-definition.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-details.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-event-subscription.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-installation.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-key.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-signed-request.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-signing-secret.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/app-upload.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/comment.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/editor-interface.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/environment-alias.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/environment.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/extension.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/function-log.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/function.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/locale.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/oauth-application.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/organization.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource-provider.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource-type.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/resource.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/role.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space-member.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/space.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/tag.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/task.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team-space-membership.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/team.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/ui-config.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/upload.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/usage.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/user-ui-config.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/user.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/webhook.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflow-definition.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflow.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/workflows-changelog.d.ts +0 -0
- /package/dist/{typings → types}/plain/pagination-helper.d.ts +0 -0
- /package/dist/{typings → types}/plain/plain-client.d.ts +0 -0
- /package/dist/{typings → types}/plain/wrappers/wrap.d.ts +0 -0
- /package/dist/{typings → types}/plain/wrappers/wrap.test-d.d.ts +0 -0
- /package/dist/{typings → types}/upload-http-client.d.ts +0 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { createRequestConfig } from 'contentful-sdk-core';
|
|
3
|
+
import entities from './entities/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
function createClientApi(makeRequest) {
|
|
9
|
+
const { wrapSpace, wrapSpaceCollection } = entities.space;
|
|
10
|
+
const { wrapUser } = entities.user;
|
|
11
|
+
const { wrapPersonalAccessToken, wrapPersonalAccessTokenCollection } = entities.personalAccessToken;
|
|
12
|
+
const { wrapAccessToken, wrapAccessTokenCollection } = entities.accessToken;
|
|
13
|
+
const { wrapOrganization, wrapOrganizationCollection } = entities.organization;
|
|
14
|
+
const { wrapUsageCollection } = entities.usage;
|
|
15
|
+
const { wrapAppDefinition } = entities.appDefinition;
|
|
16
|
+
const { wrapEnvironmentTemplate, wrapEnvironmentTemplateCollection } = entities.environmentTemplate;
|
|
17
|
+
const { wrapOAuthApplication, wrapOAuthApplicationCollection } = entities.oauthApplication;
|
|
18
|
+
return {
|
|
19
|
+
version: "12.0.0-beta.1",
|
|
20
|
+
/**
|
|
21
|
+
* Gets all environment templates for a given organization with the lasted version
|
|
22
|
+
* @param organizationId - Organization ID
|
|
23
|
+
* @return Promise for a collection of EnvironmentTemplates
|
|
24
|
+
* ```javascript
|
|
25
|
+
* const contentful = require('contentful-management')
|
|
26
|
+
*
|
|
27
|
+
* const client = contentful.createClient({
|
|
28
|
+
* accessToken: '<content_management_api_key>'
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* client.getEnvironmentTemplates('<organization_id>')
|
|
32
|
+
* .then((response) => console.log(response.items))
|
|
33
|
+
* .catch(console.error)
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
getEnvironmentTemplates: function getEnvironmentTemplates(organizationId, query = {}) {
|
|
37
|
+
return makeRequest({
|
|
38
|
+
entityType: 'EnvironmentTemplate',
|
|
39
|
+
action: 'getMany',
|
|
40
|
+
params: { organizationId, query: createRequestConfig({ query }).params },
|
|
41
|
+
}).then((data) => wrapEnvironmentTemplateCollection(makeRequest, data, organizationId));
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Gets the lasted version environment template if params.version is not specified
|
|
45
|
+
* @param params.organizationId - Organization ID
|
|
46
|
+
* @param params.environmentTemplateId - Environment template ID
|
|
47
|
+
* @param [params.version] - Template version number to return a specific version of the environment template
|
|
48
|
+
* @return Promise for a EnvironmentTemplate
|
|
49
|
+
* ```javascript
|
|
50
|
+
* const contentful = require('contentful-management')
|
|
51
|
+
*
|
|
52
|
+
* const client = contentful.createClient({
|
|
53
|
+
* accessToken: '<content_management_api_key>'
|
|
54
|
+
* })
|
|
55
|
+
*
|
|
56
|
+
* client.getEnvironmentTemplate({
|
|
57
|
+
* organizationId: '<organization_id>',
|
|
58
|
+
* environmentTemplateId: '<environment_template_id>',
|
|
59
|
+
* version: version>
|
|
60
|
+
* })
|
|
61
|
+
* .then((space) => console.log(space))
|
|
62
|
+
* .catch(console.error)
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
getEnvironmentTemplate: function getEnvironmentTemplate({ organizationId, environmentTemplateId, version, query = {}, }) {
|
|
66
|
+
return makeRequest({
|
|
67
|
+
entityType: 'EnvironmentTemplate',
|
|
68
|
+
action: 'get',
|
|
69
|
+
params: {
|
|
70
|
+
organizationId,
|
|
71
|
+
environmentTemplateId,
|
|
72
|
+
version,
|
|
73
|
+
query: createRequestConfig({ query }).params,
|
|
74
|
+
},
|
|
75
|
+
}).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId));
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Creates an environment template
|
|
79
|
+
* @param organizationId - Organization ID
|
|
80
|
+
* @param environmentTemplateData - Object representation of the environment template to be created
|
|
81
|
+
* @return Promise for the newly created EnvironmentTemplate
|
|
82
|
+
* @example ```javascript
|
|
83
|
+
* const contentful = require('contentful-management')
|
|
84
|
+
*
|
|
85
|
+
* const client = contentful.createClient({
|
|
86
|
+
* accessToken: '<content_management_api_key>'
|
|
87
|
+
* })
|
|
88
|
+
*
|
|
89
|
+
* client.createEnvironmentTemplate('<organization_id>', {<environment_template_date>})
|
|
90
|
+
* .then((environmentTemplate) => console.log(environmentTemplate))
|
|
91
|
+
* .catch(console.error)
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
createEnvironmentTemplate: function createEnvironmentTemplate(organizationId, environmentTemplateData) {
|
|
95
|
+
return makeRequest({
|
|
96
|
+
entityType: 'EnvironmentTemplate',
|
|
97
|
+
action: 'create',
|
|
98
|
+
params: { organizationId },
|
|
99
|
+
payload: environmentTemplateData,
|
|
100
|
+
}).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId));
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Gets all spaces
|
|
104
|
+
* @return Promise for a collection of Spaces
|
|
105
|
+
* ```javascript
|
|
106
|
+
* const contentful = require('contentful-management')
|
|
107
|
+
*
|
|
108
|
+
* const client = contentful.createClient({
|
|
109
|
+
* accessToken: '<content_management_api_key>'
|
|
110
|
+
* })
|
|
111
|
+
*
|
|
112
|
+
* client.getSpaces()
|
|
113
|
+
* .then((response) => console.log(response.items))
|
|
114
|
+
* .catch(console.error)
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
getSpaces: function getSpaces(query = {}) {
|
|
118
|
+
return makeRequest({
|
|
119
|
+
entityType: 'Space',
|
|
120
|
+
action: 'getMany',
|
|
121
|
+
params: { query: createRequestConfig({ query: query }).params },
|
|
122
|
+
}).then((data) => wrapSpaceCollection(makeRequest, data));
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Gets a space
|
|
126
|
+
* @param spaceId - Space ID
|
|
127
|
+
* @return Promise for a Space
|
|
128
|
+
* ```javascript
|
|
129
|
+
* const contentful = require('contentful-management')
|
|
130
|
+
*
|
|
131
|
+
* const client = contentful.createClient({
|
|
132
|
+
* accessToken: '<content_management_api_key>'
|
|
133
|
+
* })
|
|
134
|
+
*
|
|
135
|
+
* client.getSpace('<space_id>')
|
|
136
|
+
* .then((space) => console.log(space))
|
|
137
|
+
* .catch(console.error)
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
getSpace: function getSpace(spaceId) {
|
|
141
|
+
return makeRequest({
|
|
142
|
+
entityType: 'Space',
|
|
143
|
+
action: 'get',
|
|
144
|
+
params: { spaceId },
|
|
145
|
+
}).then((data) => wrapSpace(makeRequest, data));
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Creates a space
|
|
149
|
+
* @param spaceData - Object representation of the Space to be created
|
|
150
|
+
* @param organizationId - Organization ID, if the associated token can manage more than one organization.
|
|
151
|
+
* @return Promise for the newly created Space
|
|
152
|
+
* @example ```javascript
|
|
153
|
+
* const contentful = require('contentful-management')
|
|
154
|
+
*
|
|
155
|
+
* const client = contentful.createClient({
|
|
156
|
+
* accessToken: '<content_management_api_key>'
|
|
157
|
+
* })
|
|
158
|
+
*
|
|
159
|
+
* client.createSpace({
|
|
160
|
+
* name: 'Name of new space'
|
|
161
|
+
* })
|
|
162
|
+
* .then((space) => console.log(space))
|
|
163
|
+
* .catch(console.error)
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
createSpace: function createSpace(spaceData, organizationId) {
|
|
167
|
+
return makeRequest({
|
|
168
|
+
entityType: 'Space',
|
|
169
|
+
action: 'create',
|
|
170
|
+
params: { organizationId },
|
|
171
|
+
payload: spaceData,
|
|
172
|
+
}).then((data) => wrapSpace(makeRequest, data));
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Gets an organization
|
|
176
|
+
* @param id - Organization ID
|
|
177
|
+
* @return Promise for a Organization
|
|
178
|
+
* @example ```javascript
|
|
179
|
+
* const contentful = require('contentful-management')
|
|
180
|
+
*
|
|
181
|
+
* const client = contentful.createClient({
|
|
182
|
+
* accessToken: '<content_management_api_key>'
|
|
183
|
+
* })
|
|
184
|
+
*
|
|
185
|
+
* client.getOrganization('<org_id>')
|
|
186
|
+
* .then((org) => console.log(org))
|
|
187
|
+
* .catch(console.error)
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
getOrganization: function getOrganization(id) {
|
|
191
|
+
return makeRequest({
|
|
192
|
+
entityType: 'Organization',
|
|
193
|
+
action: 'get',
|
|
194
|
+
params: { organizationId: id },
|
|
195
|
+
}).then((data) => wrapOrganization(makeRequest, data));
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* Gets a collection of Organizations
|
|
199
|
+
* @return Promise for a collection of Organizations
|
|
200
|
+
* @example ```javascript
|
|
201
|
+
* const contentful = require('contentful-management')
|
|
202
|
+
*
|
|
203
|
+
* const client = contentful.createClient({
|
|
204
|
+
* accessToken: '<content_management_api_key>'
|
|
205
|
+
* })
|
|
206
|
+
*
|
|
207
|
+
* client.getOrganizations()
|
|
208
|
+
* .then(result => console.log(result.items))
|
|
209
|
+
* .catch(console.error)
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
getOrganizations: function getOrganizations(query = {}) {
|
|
213
|
+
return makeRequest({
|
|
214
|
+
entityType: 'Organization',
|
|
215
|
+
action: 'getMany',
|
|
216
|
+
params: { query: createRequestConfig({ query }).params },
|
|
217
|
+
}).then((data) => wrapOrganizationCollection(makeRequest, data));
|
|
218
|
+
},
|
|
219
|
+
/**
|
|
220
|
+
* Gets the authenticated user
|
|
221
|
+
* @return Promise for a User
|
|
222
|
+
* @example ```javascript
|
|
223
|
+
* const contentful = require('contentful-management')
|
|
224
|
+
*
|
|
225
|
+
* const client = contentful.createClient({
|
|
226
|
+
* accessToken: '<content_management_api_key>'
|
|
227
|
+
* })
|
|
228
|
+
*
|
|
229
|
+
* client.getCurrentUser()
|
|
230
|
+
* .then(user => console.log(user.firstName))
|
|
231
|
+
* .catch(console.error)
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
getCurrentUser: function getCurrentUser(params) {
|
|
235
|
+
return makeRequest({
|
|
236
|
+
entityType: 'User',
|
|
237
|
+
action: 'getCurrent',
|
|
238
|
+
params,
|
|
239
|
+
}).then((data) => wrapUser(makeRequest, data));
|
|
240
|
+
},
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @param params
|
|
244
|
+
* @returns Promise of a OAuthApplication
|
|
245
|
+
* @example ```javascript
|
|
246
|
+
* const contentful = require('contentful-management')
|
|
247
|
+
*
|
|
248
|
+
* const client = contentful.createClient({
|
|
249
|
+
* accessToken: '<content_management_api_key>'
|
|
250
|
+
* })
|
|
251
|
+
*
|
|
252
|
+
* client.getOAuthApplication({
|
|
253
|
+
* userId: '<user_id>'
|
|
254
|
+
* oauthApplicationId: '<oauth_application_id>'
|
|
255
|
+
* }).then(oauthApplication => console.log(oauthApplication))
|
|
256
|
+
* .catch(console.error)
|
|
257
|
+
*/
|
|
258
|
+
getOAuthApplication: function getOAuthApplication(params) {
|
|
259
|
+
const { userId } = params;
|
|
260
|
+
return makeRequest({
|
|
261
|
+
entityType: 'OAuthApplication',
|
|
262
|
+
action: 'get',
|
|
263
|
+
params,
|
|
264
|
+
}).then((data) => wrapOAuthApplication(makeRequest, data, userId));
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* @param params
|
|
269
|
+
* @returns Promise of list of user's OAuthApplications
|
|
270
|
+
* @example ```javascript
|
|
271
|
+
* const contentful = require('contentful-management')
|
|
272
|
+
*
|
|
273
|
+
* const client = contentful.createClient({
|
|
274
|
+
* accessToken: '<content_management_api_key>'
|
|
275
|
+
* })
|
|
276
|
+
*
|
|
277
|
+
* client.getOAuthApplications({
|
|
278
|
+
* userId: '<user_id>'}).then(oauthApplications => console.log(oauthApplications))
|
|
279
|
+
* .catch(console.error)
|
|
280
|
+
*/
|
|
281
|
+
getOAuthApplications: function getOAuthApplications(params) {
|
|
282
|
+
const { userId } = params;
|
|
283
|
+
return makeRequest({
|
|
284
|
+
entityType: 'OAuthApplication',
|
|
285
|
+
action: 'getManyForUser',
|
|
286
|
+
params,
|
|
287
|
+
}).then((data) => wrapOAuthApplicationCollection(makeRequest, data, userId));
|
|
288
|
+
},
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @param params
|
|
292
|
+
* @returns Promise of a new OAuth application.
|
|
293
|
+
* @example ```javascript
|
|
294
|
+
* const contentful = require('contentful-management')
|
|
295
|
+
*
|
|
296
|
+
* const client = contentful.createClient({
|
|
297
|
+
* accessToken: '<content_management_api_key>'
|
|
298
|
+
* })
|
|
299
|
+
*
|
|
300
|
+
* client.createOAuthApplication({
|
|
301
|
+
* userId: '<user_id>'},
|
|
302
|
+
* { name: '<name>',
|
|
303
|
+
* description: '<description>',
|
|
304
|
+
* scopes: ['scope'],
|
|
305
|
+
* redirectUri: '<redirectUri>',
|
|
306
|
+
* confidential: '<true/false>'}).then(oauthApplications => console.log(oauthApplications))
|
|
307
|
+
* .catch(console.error)
|
|
308
|
+
*/
|
|
309
|
+
createOAuthApplication: function createOAuthApplication(params, rawData) {
|
|
310
|
+
const { userId } = params;
|
|
311
|
+
return makeRequest({
|
|
312
|
+
entityType: 'OAuthApplication',
|
|
313
|
+
action: 'create',
|
|
314
|
+
params,
|
|
315
|
+
payload: rawData,
|
|
316
|
+
}).then((data) => wrapOAuthApplication(makeRequest, data, userId));
|
|
317
|
+
},
|
|
318
|
+
/**
|
|
319
|
+
* Gets App Definition
|
|
320
|
+
* @return Promise for App Definition
|
|
321
|
+
* @param organizationId - Id of the organization where the app is installed
|
|
322
|
+
* @param appDefinitionId - Id of the app that will be returned
|
|
323
|
+
* @example ```javascript
|
|
324
|
+
* const contentful = require('contentful-management')
|
|
325
|
+
*
|
|
326
|
+
* const client = contentful.createClient({
|
|
327
|
+
* accessToken: '<content_management_api_key>'
|
|
328
|
+
* })
|
|
329
|
+
*
|
|
330
|
+
* client.getAppDefinition(<'org_id'>, <'app_id'>)
|
|
331
|
+
* .then(appDefinition => console.log(appDefinition.name))
|
|
332
|
+
* .catch(console.error)
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
getAppDefinition: function getAppDefinition(params) {
|
|
336
|
+
return makeRequest({
|
|
337
|
+
entityType: 'AppDefinition',
|
|
338
|
+
action: 'get',
|
|
339
|
+
params,
|
|
340
|
+
}).then((data) => wrapAppDefinition(makeRequest, data));
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* Creates a personal access token
|
|
344
|
+
* @param data - personal access token config
|
|
345
|
+
* @return Promise for a Token
|
|
346
|
+
* @example ```javascript
|
|
347
|
+
* const contentful = require('contentful-management')
|
|
348
|
+
*
|
|
349
|
+
* const client = contentful.createClient({
|
|
350
|
+
* accessToken: '<content_management_api_key>'
|
|
351
|
+
* })
|
|
352
|
+
*
|
|
353
|
+
* client.createPersonalAccessToken(
|
|
354
|
+
* {
|
|
355
|
+
* "name": "My Token",
|
|
356
|
+
* "scope": [
|
|
357
|
+
* "content_management_manage"
|
|
358
|
+
* ]
|
|
359
|
+
* }
|
|
360
|
+
* )
|
|
361
|
+
* .then(personalAccessToken => console.log(personalAccessToken.token))
|
|
362
|
+
* .catch(console.error)
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
createPersonalAccessToken: function createPersonalAccessToken(data) {
|
|
366
|
+
return makeRequest({
|
|
367
|
+
/**
|
|
368
|
+
* When the `PersonalAccessToken` entity is removed, replace the `entityType` with `AccessToken`
|
|
369
|
+
* and update the action to `createPersonalToken` to ultilize the new entity called AccessToken.
|
|
370
|
+
*/
|
|
371
|
+
entityType: 'PersonalAccessToken',
|
|
372
|
+
action: 'create',
|
|
373
|
+
params: {},
|
|
374
|
+
payload: data,
|
|
375
|
+
}).then((response) => wrapPersonalAccessToken(makeRequest, response));
|
|
376
|
+
},
|
|
377
|
+
/**
|
|
378
|
+
* @deprecated - use getAccessToken instead
|
|
379
|
+
*
|
|
380
|
+
* Gets a personal access token
|
|
381
|
+
* @param data - personal access token config
|
|
382
|
+
* @return Promise for a Token
|
|
383
|
+
* @example ```javascript
|
|
384
|
+
* const contentful = require('contentful-management')
|
|
385
|
+
*
|
|
386
|
+
* const client = contentful.createClient({
|
|
387
|
+
* accessToken: '<content_management_api_key>'
|
|
388
|
+
* })
|
|
389
|
+
*
|
|
390
|
+
* client.getPersonalAccessToken(tokenId)
|
|
391
|
+
* .then(token => console.log(token.token))
|
|
392
|
+
* .catch(console.error)
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
getPersonalAccessToken: function getPersonalAccessToken(tokenId) {
|
|
396
|
+
return makeRequest({
|
|
397
|
+
entityType: 'PersonalAccessToken',
|
|
398
|
+
action: 'get',
|
|
399
|
+
params: { tokenId },
|
|
400
|
+
}).then((data) => wrapPersonalAccessToken(makeRequest, data));
|
|
401
|
+
},
|
|
402
|
+
/**
|
|
403
|
+
* @deprecated - use getAccessTokens instead
|
|
404
|
+
*
|
|
405
|
+
* Gets all personal access tokens
|
|
406
|
+
* @return Promise for a Token
|
|
407
|
+
* @example ```javascript
|
|
408
|
+
* const contentful = require('contentful-management')
|
|
409
|
+
*
|
|
410
|
+
* const client = contentful.createClient({
|
|
411
|
+
* accessToken: '<content_management_api_key>'
|
|
412
|
+
* })
|
|
413
|
+
*
|
|
414
|
+
* client.getPersonalAccessTokens()
|
|
415
|
+
* .then(response => console.log(reponse.items))
|
|
416
|
+
* .catch(console.error)
|
|
417
|
+
* ```
|
|
418
|
+
*/
|
|
419
|
+
getPersonalAccessTokens: function getPersonalAccessTokens() {
|
|
420
|
+
return makeRequest({
|
|
421
|
+
entityType: 'PersonalAccessToken',
|
|
422
|
+
action: 'getMany',
|
|
423
|
+
params: {},
|
|
424
|
+
}).then((data) => wrapPersonalAccessTokenCollection(makeRequest, data));
|
|
425
|
+
},
|
|
426
|
+
/**
|
|
427
|
+
* Gets a users access token
|
|
428
|
+
* @param data - users access token config
|
|
429
|
+
* @return Promise for a Token
|
|
430
|
+
* @example ```javascript
|
|
431
|
+
* const contentful = require('contentful-management')
|
|
432
|
+
*
|
|
433
|
+
* const client = contentful.createClient({
|
|
434
|
+
* accessToken: '<content_management_api_key>'
|
|
435
|
+
* })
|
|
436
|
+
*
|
|
437
|
+
* client.getAccessToken(tokenId)
|
|
438
|
+
* .then(token => console.log(token.token))
|
|
439
|
+
* .catch(console.error)
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
442
|
+
getAccessToken: function getAccessToken(tokenId) {
|
|
443
|
+
return makeRequest({
|
|
444
|
+
entityType: 'AccessToken',
|
|
445
|
+
action: 'get',
|
|
446
|
+
params: { tokenId },
|
|
447
|
+
}).then((data) => wrapAccessToken(makeRequest, data));
|
|
448
|
+
},
|
|
449
|
+
/**
|
|
450
|
+
* Gets all user access tokens
|
|
451
|
+
* @return Promise for a Token
|
|
452
|
+
* @example ```javascript
|
|
453
|
+
* const contentful = require('contentful-management')
|
|
454
|
+
*
|
|
455
|
+
* const client = contentful.createClient({
|
|
456
|
+
* accessToken: '<content_management_api_key>'
|
|
457
|
+
* })
|
|
458
|
+
*
|
|
459
|
+
* client.getAccessTokens()
|
|
460
|
+
* .then(response => console.log(reponse.items))
|
|
461
|
+
* .catch(console.error)
|
|
462
|
+
* ```
|
|
463
|
+
*/
|
|
464
|
+
getAccessTokens: function getAccessTokens() {
|
|
465
|
+
return makeRequest({
|
|
466
|
+
entityType: 'AccessToken',
|
|
467
|
+
action: 'getMany',
|
|
468
|
+
params: {},
|
|
469
|
+
}).then((data) => wrapAccessTokenCollection(makeRequest, data));
|
|
470
|
+
},
|
|
471
|
+
/**
|
|
472
|
+
* Retrieves a list of redacted versions of access tokens for an organization, accessible to owners or administrators of an organization.
|
|
473
|
+
*
|
|
474
|
+
* @return Promise for a Token
|
|
475
|
+
* @example ```javascript
|
|
476
|
+
* const contentful = require('contentful-management')
|
|
477
|
+
*
|
|
478
|
+
* const client = contentful.createClient({
|
|
479
|
+
* accessToken: '<content_management_api_key>'
|
|
480
|
+
* })
|
|
481
|
+
*
|
|
482
|
+
* client.getOrganizationAccessTokens(organizationId)
|
|
483
|
+
* .then(response => console.log(reponse.items))
|
|
484
|
+
* .catch(console.error)
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
getOrganizationAccessTokens: function getOrganizationAccessTokens(organizationId, query = {}) {
|
|
488
|
+
return makeRequest({
|
|
489
|
+
entityType: 'AccessToken',
|
|
490
|
+
action: 'getManyForOrganization',
|
|
491
|
+
params: { organizationId, query },
|
|
492
|
+
}).then((data) => wrapAccessTokenCollection(makeRequest, data));
|
|
493
|
+
},
|
|
494
|
+
/**
|
|
495
|
+
* Get organization usage grouped by {@link UsageMetricEnum metric}
|
|
496
|
+
*
|
|
497
|
+
* @param organizationId - Id of an organization
|
|
498
|
+
* @param query - Query parameters
|
|
499
|
+
* @return Promise of a collection of usages
|
|
500
|
+
* @example ```javascript
|
|
501
|
+
*
|
|
502
|
+
* const contentful = require('contentful-management')
|
|
503
|
+
*
|
|
504
|
+
* const client = contentful.createClient({
|
|
505
|
+
* accessToken: '<content_management_api_key>'
|
|
506
|
+
* })
|
|
507
|
+
*
|
|
508
|
+
* client.getOrganizationUsage('<organizationId>', {
|
|
509
|
+
* 'metric[in]': 'cma,gql',
|
|
510
|
+
* 'dateRange.startAt': '2019-10-22',
|
|
511
|
+
* 'dateRange.endAt': '2019-11-10'
|
|
512
|
+
* }
|
|
513
|
+
* })
|
|
514
|
+
* .then(result => console.log(result.items))
|
|
515
|
+
* .catch(console.error)
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
getOrganizationUsage: function getOrganizationUsage(organizationId, query = {}) {
|
|
519
|
+
return makeRequest({
|
|
520
|
+
entityType: 'Usage',
|
|
521
|
+
action: 'getManyForOrganization',
|
|
522
|
+
params: { organizationId, query },
|
|
523
|
+
}).then((data) => wrapUsageCollection(makeRequest, data));
|
|
524
|
+
},
|
|
525
|
+
/**
|
|
526
|
+
* Get organization usage grouped by space and metric
|
|
527
|
+
*
|
|
528
|
+
* @param organizationId - Id of an organization
|
|
529
|
+
* @param query - Query parameters
|
|
530
|
+
* @return Promise of a collection of usages
|
|
531
|
+
* ```javascript
|
|
532
|
+
* const contentful = require('contentful-management')
|
|
533
|
+
*
|
|
534
|
+
* const client = contentful.createClient({
|
|
535
|
+
* accessToken: '<content_management_api_key>'
|
|
536
|
+
* })
|
|
537
|
+
*
|
|
538
|
+
* client.getSpaceUsage('<organizationId>', {
|
|
539
|
+
* skip: 0,
|
|
540
|
+
* limit: 10,
|
|
541
|
+
* 'metric[in]': 'cda,cpa,gql',
|
|
542
|
+
* 'dateRange.startAt': '2019-10-22',
|
|
543
|
+
* 'dateRange.endAt': '2020-11-30'
|
|
544
|
+
* }
|
|
545
|
+
* })
|
|
546
|
+
* .then(result => console.log(result.items))
|
|
547
|
+
* .catch(console.error)
|
|
548
|
+
* ```
|
|
549
|
+
*/
|
|
550
|
+
getSpaceUsage: function getSpaceUsage(organizationId, query = {}) {
|
|
551
|
+
return makeRequest({
|
|
552
|
+
entityType: 'Usage',
|
|
553
|
+
action: 'getManyForSpace',
|
|
554
|
+
params: {
|
|
555
|
+
organizationId,
|
|
556
|
+
query,
|
|
557
|
+
},
|
|
558
|
+
}).then((data) => wrapUsageCollection(makeRequest, data));
|
|
559
|
+
},
|
|
560
|
+
/**
|
|
561
|
+
* Make a custom request to the Contentful management API's /spaces endpoint
|
|
562
|
+
* @param opts - axios request options (https://github.com/mzabriskie/axios)
|
|
563
|
+
* @return Promise for the response data
|
|
564
|
+
* ```javascript
|
|
565
|
+
* const contentful = require('contentful-management')
|
|
566
|
+
*
|
|
567
|
+
* const client = contentful.createClient({
|
|
568
|
+
* accessToken: '<content_management_api_key>'
|
|
569
|
+
* })
|
|
570
|
+
*
|
|
571
|
+
* client.rawRequest({
|
|
572
|
+
* method: 'GET',
|
|
573
|
+
* url: '/custom/path'
|
|
574
|
+
* })
|
|
575
|
+
* .then((responseData) => console.log(responseData))
|
|
576
|
+
* .catch(console.error)
|
|
577
|
+
* ```
|
|
578
|
+
*/
|
|
579
|
+
rawRequest: function rawRequest(_a) {
|
|
580
|
+
var { url } = _a, config = __rest(_a, ["url"]);
|
|
581
|
+
return makeRequest({
|
|
582
|
+
entityType: 'Http',
|
|
583
|
+
action: 'request',
|
|
584
|
+
params: { url, config },
|
|
585
|
+
});
|
|
586
|
+
},
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export { createClientApi as default };
|