contentful-management 11.49.0-beta.2 → 11.49.0
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 +48 -73
- package/dist/contentful-management.browser.js +28443 -23461
- package/dist/contentful-management.browser.js.map +1 -0
- package/dist/contentful-management.browser.min.js +2 -1
- package/dist/contentful-management.node.js +32614 -0
- package/dist/contentful-management.node.js.map +1 -0
- package/dist/contentful-management.node.min.js +2 -0
- package/dist/{esm → es-modules}/adapters/REST/endpoints/access-token.js +22 -20
- package/dist/es-modules/adapters/REST/endpoints/ai-action-invocation.js +6 -0
- package/dist/es-modules/adapters/REST/endpoints/ai-action.js +61 -0
- package/dist/es-modules/adapters/REST/endpoints/api-key.js +47 -0
- package/dist/es-modules/adapters/REST/endpoints/app-access-token.js +8 -0
- package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +69 -0
- package/dist/es-modules/adapters/REST/endpoints/app-action.js +32 -0
- package/dist/es-modules/adapters/REST/endpoints/app-bundle.js +36 -0
- package/dist/es-modules/adapters/REST/endpoints/app-definition.js +45 -0
- package/dist/es-modules/adapters/REST/endpoints/app-details.js +10 -0
- package/dist/es-modules/adapters/REST/endpoints/app-event-subscription.js +10 -0
- package/dist/es-modules/adapters/REST/endpoints/app-installation.js +39 -0
- package/dist/es-modules/adapters/REST/endpoints/app-key.js +13 -0
- package/dist/es-modules/adapters/REST/endpoints/app-signed-request.js +4 -0
- package/dist/es-modules/adapters/REST/endpoints/app-signing-secret.js +10 -0
- package/dist/es-modules/adapters/REST/endpoints/app-upload.js +23 -0
- package/dist/es-modules/adapters/REST/endpoints/asset-key.js +33 -0
- package/dist/es-modules/adapters/REST/endpoints/asset.js +220 -0
- package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +13 -0
- package/dist/es-modules/adapters/REST/endpoints/comment.js +101 -0
- package/dist/es-modules/adapters/REST/endpoints/concept-scheme.js +52 -0
- package/dist/es-modules/adapters/REST/endpoints/concept.js +85 -0
- package/dist/es-modules/adapters/REST/endpoints/content-type.js +61 -0
- package/dist/es-modules/adapters/REST/endpoints/editor-interface.js +24 -0
- package/dist/es-modules/adapters/REST/endpoints/entry.js +113 -0
- package/dist/es-modules/adapters/REST/endpoints/environment-alias.js +46 -0
- package/dist/es-modules/adapters/REST/endpoints/environment-template-installation.js +43 -0
- package/dist/es-modules/adapters/REST/endpoints/environment-template.js +88 -0
- package/dist/es-modules/adapters/REST/endpoints/environment.js +42 -0
- package/dist/es-modules/adapters/REST/endpoints/extension.js +44 -0
- package/dist/es-modules/adapters/REST/endpoints/function-log.js +22 -0
- package/dist/es-modules/adapters/REST/endpoints/function.js +20 -0
- package/dist/es-modules/adapters/REST/endpoints/http.js +39 -0
- package/dist/es-modules/adapters/REST/endpoints/index.js +134 -0
- package/dist/es-modules/adapters/REST/endpoints/locale.js +35 -0
- package/dist/{esm → es-modules}/adapters/REST/endpoints/oauth-application.js +22 -21
- package/dist/es-modules/adapters/REST/endpoints/organization-invitation.js +22 -0
- package/dist/es-modules/adapters/REST/endpoints/organization-membership.js +35 -0
- package/dist/es-modules/adapters/REST/endpoints/organization.js +26 -0
- package/dist/es-modules/adapters/REST/endpoints/personal-access-token.js +33 -0
- package/dist/es-modules/adapters/REST/endpoints/preview-api-key.js +9 -0
- package/dist/es-modules/adapters/REST/endpoints/raw.js +42 -0
- package/dist/es-modules/adapters/REST/endpoints/release-action.js +21 -0
- package/dist/es-modules/adapters/REST/endpoints/release.js +58 -0
- package/dist/es-modules/adapters/REST/endpoints/resource-provider.js +13 -0
- package/dist/es-modules/adapters/REST/endpoints/resource-type.js +23 -0
- package/dist/es-modules/adapters/REST/endpoints/resource.js +5 -0
- package/dist/es-modules/adapters/REST/endpoints/role.js +44 -0
- package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +35 -0
- package/dist/es-modules/adapters/REST/endpoints/snapshot.js +22 -0
- package/dist/es-modules/adapters/REST/endpoints/space-member.js +5 -0
- package/dist/es-modules/adapters/REST/endpoints/space-membership.js +55 -0
- package/dist/es-modules/adapters/REST/endpoints/space.js +32 -0
- package/dist/es-modules/adapters/REST/endpoints/tag.js +46 -0
- package/dist/es-modules/adapters/REST/endpoints/task.js +47 -0
- package/dist/es-modules/adapters/REST/endpoints/team-membership.js +34 -0
- package/dist/es-modules/adapters/REST/endpoints/team-space-membership.js +45 -0
- package/dist/es-modules/adapters/REST/endpoints/team.js +35 -0
- package/dist/es-modules/adapters/REST/endpoints/ui-config.js +16 -0
- package/dist/es-modules/adapters/REST/endpoints/upload-credentials.js +11 -0
- package/dist/es-modules/adapters/REST/endpoints/upload.js +37 -0
- package/dist/es-modules/adapters/REST/endpoints/usage.js +11 -0
- package/dist/es-modules/adapters/REST/endpoints/user-ui-config.js +16 -0
- package/dist/es-modules/adapters/REST/endpoints/user.js +20 -0
- package/dist/es-modules/adapters/REST/endpoints/utils.js +28 -0
- package/dist/es-modules/adapters/REST/endpoints/webhook.js +93 -0
- package/dist/es-modules/adapters/REST/endpoints/workflow-definition.js +46 -0
- package/dist/es-modules/adapters/REST/endpoints/workflow.js +59 -0
- package/dist/es-modules/adapters/REST/endpoints/workflows-changelog.js +6 -0
- package/dist/es-modules/adapters/REST/make-request.js +28 -0
- package/dist/es-modules/adapters/REST/rest-adapter.js +42 -0
- package/dist/es-modules/adapters/REST/types.js +1 -0
- package/dist/es-modules/common-types.js +61 -0
- package/dist/es-modules/common-utils.js +30 -0
- package/dist/es-modules/constants/editor-interface-defaults/controls-defaults.js +255 -0
- package/dist/es-modules/constants/editor-interface-defaults/editors-defaults.js +34 -0
- package/dist/es-modules/constants/editor-interface-defaults/index.js +9 -0
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +57 -0
- package/dist/es-modules/constants/editor-interface-defaults/types.js +14 -0
- package/dist/es-modules/contentful-management.js +66 -0
- package/dist/es-modules/create-adapter.js +16 -0
- package/dist/es-modules/create-app-definition-api.js +263 -0
- package/dist/es-modules/create-contentful-api.js +663 -0
- package/dist/es-modules/create-entry-api.js +548 -0
- package/dist/es-modules/create-environment-api.js +2525 -0
- package/dist/es-modules/create-environment-template-api.js +316 -0
- package/dist/es-modules/create-organization-api.js +1306 -0
- package/dist/es-modules/create-space-api.js +1751 -0
- package/dist/es-modules/create-ui-config-api.js +60 -0
- package/dist/es-modules/create-user-ui-config-api.js +60 -0
- package/dist/{esm → es-modules}/enhance-with-methods.js +11 -13
- package/dist/es-modules/entities/access-token.js +38 -0
- package/dist/es-modules/entities/ai-action-invocation.js +46 -0
- package/dist/es-modules/entities/ai-action.js +85 -0
- package/dist/es-modules/entities/api-key.js +55 -0
- package/dist/es-modules/entities/app-access-token.js +12 -0
- package/dist/es-modules/entities/app-action-call.js +70 -0
- package/dist/es-modules/entities/app-action.js +53 -0
- package/dist/es-modules/entities/app-bundle.js +44 -0
- package/dist/es-modules/entities/app-definition.js +24 -0
- package/dist/es-modules/entities/app-details.js +35 -0
- package/dist/es-modules/entities/app-event-subscription.js +30 -0
- package/dist/es-modules/entities/app-installation.js +51 -0
- package/dist/es-modules/entities/app-key.js +40 -0
- package/dist/{esm → es-modules}/entities/app-signed-request.js +4 -7
- package/dist/es-modules/entities/app-signing-secret.js +30 -0
- package/dist/es-modules/entities/app-upload.js +43 -0
- package/dist/{esm → es-modules}/entities/asset-key.js +4 -7
- package/dist/es-modules/entities/asset.js +131 -0
- package/dist/es-modules/entities/bulk-action.js +61 -0
- package/dist/es-modules/entities/comment.js +77 -0
- package/dist/es-modules/entities/concept-scheme.js +1 -0
- package/dist/es-modules/entities/concept.js +1 -0
- package/dist/es-modules/entities/content-type-fields.js +1 -0
- package/dist/es-modules/entities/content-type.js +146 -0
- package/dist/es-modules/entities/editor-interface.js +46 -0
- package/dist/es-modules/entities/entry.js +22 -0
- package/dist/es-modules/entities/environment-alias.js +54 -0
- package/dist/es-modules/entities/environment-template-installation.js +17 -0
- package/dist/es-modules/entities/environment-template.js +12 -0
- package/dist/es-modules/entities/environment.js +29 -0
- package/dist/es-modules/entities/extension.js +50 -0
- package/dist/es-modules/entities/field-type.js +1 -0
- package/dist/{esm → es-modules}/entities/function-log.js +7 -9
- package/dist/es-modules/entities/function.js +61 -0
- package/dist/es-modules/entities/index.js +126 -0
- package/dist/es-modules/entities/locale.js +53 -0
- package/dist/es-modules/entities/oauth-application.js +62 -0
- package/dist/es-modules/entities/organization-invitation.js +12 -0
- package/dist/es-modules/entities/organization-membership.js +49 -0
- package/dist/es-modules/entities/organization.js +32 -0
- package/dist/es-modules/entities/personal-access-token.js +38 -0
- package/dist/es-modules/entities/preview-api-key.js +27 -0
- package/dist/es-modules/entities/release-action.js +53 -0
- package/dist/es-modules/entities/release.js +105 -0
- package/dist/es-modules/entities/resource-provider.js +139 -0
- package/dist/es-modules/entities/resource-type.js +93 -0
- package/dist/es-modules/entities/resource.js +7 -0
- package/dist/es-modules/entities/role.js +49 -0
- package/dist/es-modules/entities/scheduled-action.js +155 -0
- package/dist/es-modules/entities/snapshot.js +31 -0
- package/dist/es-modules/entities/space-member.js +18 -0
- package/dist/es-modules/entities/space-membership.js +49 -0
- package/dist/es-modules/entities/space.js +28 -0
- package/dist/es-modules/entities/tag.js +56 -0
- package/dist/es-modules/entities/task.js +57 -0
- package/dist/es-modules/entities/team-membership.js +50 -0
- package/dist/es-modules/entities/team-space-membership.js +49 -0
- package/dist/es-modules/entities/team.js +49 -0
- package/dist/es-modules/entities/ui-config.js +15 -0
- package/dist/es-modules/entities/upload-credential.js +33 -0
- package/dist/es-modules/entities/upload.js +34 -0
- package/dist/es-modules/entities/usage.js +20 -0
- package/dist/es-modules/entities/user-ui-config.js +15 -0
- package/dist/es-modules/entities/user.js +23 -0
- package/dist/es-modules/entities/utils.js +1 -0
- package/dist/es-modules/entities/webhook.js +80 -0
- package/dist/es-modules/entities/widget-parameters.js +1 -0
- package/dist/es-modules/entities/workflow-definition.js +87 -0
- package/dist/es-modules/entities/workflow.js +76 -0
- package/dist/es-modules/entities/workflows-changelog-entry.js +24 -0
- package/dist/es-modules/export-types.js +3 -0
- package/dist/es-modules/methods/action.js +54 -0
- package/dist/es-modules/methods/bulk-action.js +15 -0
- package/dist/es-modules/methods/content-type.js +47 -0
- package/dist/es-modules/methods/release-action.js +17 -0
- package/dist/es-modules/methods/utils.js +7 -0
- package/dist/es-modules/plain/as-iterator.js +47 -0
- package/dist/es-modules/plain/checks.js +8 -0
- package/dist/es-modules/plain/common-types.js +1 -0
- package/dist/es-modules/plain/entities/ai-action-invocation.js +1 -0
- package/dist/es-modules/plain/entities/ai-action.js +1 -0
- package/dist/es-modules/plain/entities/app-access-token.js +1 -0
- package/dist/es-modules/plain/entities/app-action-call.js +1 -0
- package/dist/es-modules/plain/entities/app-action.js +1 -0
- package/dist/es-modules/plain/entities/app-bundle.js +1 -0
- package/dist/es-modules/plain/entities/app-definition.js +1 -0
- package/dist/es-modules/plain/entities/app-details.js +1 -0
- package/dist/es-modules/plain/entities/app-event-subscription.js +1 -0
- package/dist/es-modules/plain/entities/app-installation.js +1 -0
- package/dist/es-modules/plain/entities/app-key.js +1 -0
- package/dist/es-modules/plain/entities/app-signed-request.js +1 -0
- package/dist/es-modules/plain/entities/app-signing-secret.js +1 -0
- package/dist/es-modules/plain/entities/app-upload.js +1 -0
- package/dist/es-modules/plain/entities/comment.js +1 -0
- package/dist/es-modules/plain/entities/concept-scheme.js +1 -0
- package/dist/es-modules/plain/entities/concept.js +1 -0
- package/dist/es-modules/plain/entities/editor-interface.js +1 -0
- package/dist/es-modules/plain/entities/environment-alias.js +1 -0
- package/dist/es-modules/plain/entities/environment.js +1 -0
- package/dist/es-modules/plain/entities/extension.js +1 -0
- package/dist/es-modules/plain/entities/function-log.js +1 -0
- package/dist/es-modules/plain/entities/function.js +1 -0
- package/dist/es-modules/plain/entities/locale.js +1 -0
- package/dist/es-modules/plain/entities/oauth-application.js +1 -0
- package/dist/es-modules/plain/entities/organization.js +1 -0
- package/dist/es-modules/plain/entities/resource-provider.js +1 -0
- package/dist/es-modules/plain/entities/resource-type.js +1 -0
- package/dist/es-modules/plain/entities/resource.js +1 -0
- package/dist/es-modules/plain/entities/role.js +1 -0
- package/dist/es-modules/plain/entities/space-member.js +1 -0
- package/dist/es-modules/plain/entities/space-membership.js +1 -0
- package/dist/es-modules/plain/entities/space.js +1 -0
- package/dist/es-modules/plain/entities/tag.js +1 -0
- package/dist/es-modules/plain/entities/task.js +1 -0
- package/dist/es-modules/plain/entities/team-membership.js +1 -0
- package/dist/es-modules/plain/entities/team-space-membership.js +1 -0
- package/dist/es-modules/plain/entities/team.js +1 -0
- package/dist/es-modules/plain/entities/ui-config.js +1 -0
- package/dist/es-modules/plain/entities/upload-credential.js +1 -0
- package/dist/es-modules/plain/entities/upload.js +1 -0
- package/dist/es-modules/plain/entities/usage.js +1 -0
- package/dist/es-modules/plain/entities/user-ui-config.js +1 -0
- package/dist/es-modules/plain/entities/user.js +1 -0
- package/dist/es-modules/plain/entities/webhook.js +1 -0
- package/dist/es-modules/plain/entities/workflow-definition.js +1 -0
- package/dist/es-modules/plain/entities/workflow.js +1 -0
- package/dist/es-modules/plain/entities/workflows-changelog.js +1 -0
- package/dist/es-modules/plain/pagination-helper.js +76 -0
- package/dist/es-modules/plain/plain-client.js +544 -0
- package/dist/es-modules/plain/wrappers/wrap.js +46 -0
- package/dist/es-modules/plain/wrappers/wrap.test-d.js +15 -0
- package/dist/es-modules/upload-http-client.js +17 -0
- package/dist/typings/adapters/REST/endpoints/ai-action-invocation.d.ts +2 -0
- package/dist/typings/adapters/REST/endpoints/ai-action.d.ts +9 -0
- package/dist/{types → typings}/adapters/REST/endpoints/index.d.ts +4 -0
- package/dist/{types → typings}/common-types.d.ts +75 -0
- package/dist/{types → typings}/constants/editor-interface-defaults/controls-defaults.d.ts +1 -1
- package/dist/{types/index.d.ts → typings/contentful-management.d.ts} +1 -1
- package/dist/{types → typings}/create-contentful-api.d.ts +0 -1
- package/dist/{types → typings}/create-environment-api.d.ts +39 -2
- package/dist/{types → typings}/create-space-api.d.ts +100 -0
- package/dist/{types → typings}/create-ui-config-api.d.ts +1 -1
- package/dist/{types → typings}/create-user-ui-config-api.d.ts +1 -1
- package/dist/typings/entities/ai-action-invocation.d.ts +90 -0
- package/dist/typings/entities/ai-action.d.ts +97 -0
- package/dist/{types → typings}/entities/index.d.ts +4 -0
- package/dist/{types → typings}/entities/ui-config.d.ts +1 -1
- package/dist/{types → typings}/entities/user-ui-config.d.ts +1 -1
- package/dist/{types → typings}/export-types.d.ts +2 -0
- package/dist/{types → typings}/plain/common-types.d.ts +4 -1
- package/dist/typings/plain/entities/ai-action-invocation.d.ts +18 -0
- package/dist/typings/plain/entities/ai-action.d.ts +84 -0
- package/package.json +45 -49
- package/dist/contentful-management.cjs +0 -36550
- package/dist/esm/adapters/REST/endpoints/api-key.js +0 -41
- package/dist/esm/adapters/REST/endpoints/app-access-token.js +0 -7
- package/dist/esm/adapters/REST/endpoints/app-action-call.js +0 -61
- package/dist/esm/adapters/REST/endpoints/app-action.js +0 -35
- package/dist/esm/adapters/REST/endpoints/app-bundle.js +0 -34
- package/dist/esm/adapters/REST/endpoints/app-definition.js +0 -39
- package/dist/esm/adapters/REST/endpoints/app-details.js +0 -13
- package/dist/esm/adapters/REST/endpoints/app-event-subscription.js +0 -13
- package/dist/esm/adapters/REST/endpoints/app-installation.js +0 -35
- package/dist/esm/adapters/REST/endpoints/app-key.js +0 -16
- package/dist/esm/adapters/REST/endpoints/app-signed-request.js +0 -7
- package/dist/esm/adapters/REST/endpoints/app-signing-secret.js +0 -13
- package/dist/esm/adapters/REST/endpoints/app-upload.js +0 -24
- package/dist/esm/adapters/REST/endpoints/asset-key.js +0 -31
- package/dist/esm/adapters/REST/endpoints/asset.js +0 -170
- package/dist/esm/adapters/REST/endpoints/bulk-action.js +0 -16
- package/dist/esm/adapters/REST/endpoints/comment.js +0 -85
- package/dist/esm/adapters/REST/endpoints/concept-scheme.js +0 -40
- package/dist/esm/adapters/REST/endpoints/concept.js +0 -59
- package/dist/esm/adapters/REST/endpoints/content-type.js +0 -47
- package/dist/esm/adapters/REST/endpoints/editor-interface.js +0 -20
- package/dist/esm/adapters/REST/endpoints/entry.js +0 -90
- package/dist/esm/adapters/REST/endpoints/environment-alias.js +0 -38
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +0 -20
- package/dist/esm/adapters/REST/endpoints/environment-template.js +0 -38
- package/dist/esm/adapters/REST/endpoints/environment.js +0 -40
- package/dist/esm/adapters/REST/endpoints/extension.js +0 -36
- package/dist/esm/adapters/REST/endpoints/function-log.js +0 -20
- package/dist/esm/adapters/REST/endpoints/function.js +0 -21
- package/dist/esm/adapters/REST/endpoints/http.js +0 -22
- package/dist/esm/adapters/REST/endpoints/index.js +0 -133
- package/dist/esm/adapters/REST/endpoints/locale.js +0 -31
- package/dist/esm/adapters/REST/endpoints/organization-invitation.js +0 -20
- package/dist/esm/adapters/REST/endpoints/organization-membership.js +0 -27
- package/dist/esm/adapters/REST/endpoints/organization.js +0 -25
- package/dist/esm/adapters/REST/endpoints/personal-access-token.js +0 -32
- package/dist/esm/adapters/REST/endpoints/preview-api-key.js +0 -12
- package/dist/esm/adapters/REST/endpoints/raw.js +0 -37
- package/dist/esm/adapters/REST/endpoints/release-action.js +0 -17
- package/dist/esm/adapters/REST/endpoints/release.js +0 -50
- package/dist/esm/adapters/REST/endpoints/resource-provider.js +0 -14
- package/dist/esm/adapters/REST/endpoints/resource-type.js +0 -24
- package/dist/esm/adapters/REST/endpoints/resource.js +0 -8
- package/dist/esm/adapters/REST/endpoints/role.js +0 -40
- package/dist/esm/adapters/REST/endpoints/scheduled-action.js +0 -38
- package/dist/esm/adapters/REST/endpoints/snapshot.js +0 -25
- package/dist/esm/adapters/REST/endpoints/space-member.js +0 -8
- package/dist/esm/adapters/REST/endpoints/space-membership.js +0 -51
- package/dist/esm/adapters/REST/endpoints/space.js +0 -27
- package/dist/esm/adapters/REST/endpoints/tag.js +0 -31
- package/dist/esm/adapters/REST/endpoints/task.js +0 -33
- package/dist/esm/adapters/REST/endpoints/team-membership.js +0 -28
- package/dist/esm/adapters/REST/endpoints/team-space-membership.js +0 -38
- package/dist/esm/adapters/REST/endpoints/team.js +0 -29
- package/dist/esm/adapters/REST/endpoints/ui-config.js +0 -19
- package/dist/esm/adapters/REST/endpoints/upload-credentials.js +0 -14
- package/dist/esm/adapters/REST/endpoints/upload.js +0 -38
- package/dist/esm/adapters/REST/endpoints/usage.js +0 -14
- package/dist/esm/adapters/REST/endpoints/user-ui-config.js +0 -19
- package/dist/esm/adapters/REST/endpoints/user.js +0 -21
- package/dist/esm/adapters/REST/endpoints/utils.js +0 -17
- package/dist/esm/adapters/REST/endpoints/webhook.js +0 -82
- package/dist/esm/adapters/REST/endpoints/workflow-definition.js +0 -35
- package/dist/esm/adapters/REST/endpoints/workflow.js +0 -42
- package/dist/esm/adapters/REST/endpoints/workflows-changelog.js +0 -9
- package/dist/esm/adapters/REST/make-request.js +0 -17
- package/dist/esm/adapters/REST/rest-adapter.js +0 -30
- package/dist/esm/common-types.js +0 -6
- package/dist/esm/common-utils.js +0 -32
- package/dist/esm/constants/editor-interface-defaults/controls-defaults.js +0 -153
- package/dist/esm/constants/editor-interface-defaults/editors-defaults.js +0 -37
- package/dist/esm/constants/editor-interface-defaults/index.js +0 -12
- package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.js +0 -68
- package/dist/esm/constants/editor-interface-defaults/types.js +0 -15
- package/dist/esm/create-adapter.js +0 -19
- package/dist/esm/create-app-definition-api.js +0 -252
- package/dist/esm/create-contentful-api.js +0 -590
- package/dist/esm/create-entry-api.js +0 -479
- package/dist/esm/create-environment-api.js +0 -2347
- package/dist/esm/create-environment-template-api.js +0 -268
- package/dist/esm/create-organization-api.js +0 -1134
- package/dist/esm/create-space-api.js +0 -1436
- package/dist/esm/create-ui-config-api.js +0 -53
- package/dist/esm/create-user-ui-config-api.js +0 -53
- package/dist/esm/entities/access-token.js +0 -33
- package/dist/esm/entities/api-key.js +0 -56
- package/dist/esm/entities/app-access-token.js +0 -15
- package/dist/esm/entities/app-action-call.js +0 -61
- package/dist/esm/entities/app-action.js +0 -45
- package/dist/esm/entities/app-bundle.js +0 -45
- package/dist/esm/entities/app-definition.js +0 -26
- package/dist/esm/entities/app-details.js +0 -37
- package/dist/esm/entities/app-event-subscription.js +0 -32
- package/dist/esm/entities/app-installation.js +0 -52
- package/dist/esm/entities/app-key.js +0 -41
- package/dist/esm/entities/app-signing-secret.js +0 -32
- package/dist/esm/entities/app-upload.js +0 -44
- package/dist/esm/entities/asset.js +0 -121
- package/dist/esm/entities/bulk-action.js +0 -58
- package/dist/esm/entities/comment.js +0 -57
- package/dist/esm/entities/concept-scheme.js +0 -1
- package/dist/esm/entities/concept.js +0 -1
- package/dist/esm/entities/content-type.js +0 -117
- package/dist/esm/entities/editor-interface.js +0 -47
- package/dist/esm/entities/entry.js +0 -24
- package/dist/esm/entities/environment-alias.js +0 -55
- package/dist/esm/entities/environment-template-installation.js +0 -20
- package/dist/esm/entities/environment-template.js +0 -15
- package/dist/esm/entities/environment.js +0 -31
- package/dist/esm/entities/extension.js +0 -51
- package/dist/esm/entities/function.js +0 -63
- package/dist/esm/entities/index.js +0 -125
- package/dist/esm/entities/locale.js +0 -54
- package/dist/esm/entities/oauth-application.js +0 -63
- package/dist/esm/entities/organization-invitation.js +0 -15
- package/dist/esm/entities/organization-membership.js +0 -50
- package/dist/esm/entities/organization.js +0 -29
- package/dist/esm/entities/personal-access-token.js +0 -33
- package/dist/esm/entities/preview-api-key.js +0 -28
- package/dist/esm/entities/release-action.js +0 -52
- package/dist/esm/entities/release.js +0 -107
- package/dist/esm/entities/resource-provider.js +0 -137
- package/dist/esm/entities/resource-type.js +0 -94
- package/dist/esm/entities/resource.js +0 -10
- package/dist/esm/entities/role.js +0 -50
- package/dist/esm/entities/scheduled-action.js +0 -148
- package/dist/esm/entities/snapshot.js +0 -33
- package/dist/esm/entities/space-member.js +0 -20
- package/dist/esm/entities/space-membership.js +0 -50
- package/dist/esm/entities/space.js +0 -30
- package/dist/esm/entities/tag.js +0 -50
- package/dist/esm/entities/task.js +0 -51
- package/dist/esm/entities/team-membership.js +0 -51
- package/dist/esm/entities/team-space-membership.js +0 -50
- package/dist/esm/entities/team.js +0 -50
- package/dist/esm/entities/ui-config.js +0 -18
- package/dist/esm/entities/upload.js +0 -36
- package/dist/esm/entities/usage.js +0 -22
- package/dist/esm/entities/user-ui-config.js +0 -18
- package/dist/esm/entities/user.js +0 -25
- package/dist/esm/entities/webhook.js +0 -74
- package/dist/esm/entities/workflow-definition.js +0 -73
- package/dist/esm/index.js +0 -36
- package/dist/esm/methods/action.js +0 -49
- package/dist/esm/methods/content-type.js +0 -49
- package/dist/esm/methods/utils.js +0 -9
- package/dist/esm/plain/as-iterator.js +0 -30
- package/dist/esm/plain/checks.js +0 -10
- package/dist/esm/plain/pagination-helper.js +0 -54
- package/dist/esm/plain/plain-client.js +0 -503
- package/dist/esm/plain/wrappers/wrap.js +0 -24
- package/dist/esm/upload-http-client.js +0 -15
- package/dist/stats-browser-min.html +0 -4842
- /package/dist/{types → typings}/adapters/REST/endpoints/access-token.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/api-key.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-access-token.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-action-call.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-action.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-bundle.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-definition.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-details.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-event-subscription.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-installation.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-key.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-signed-request.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-signing-secret.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/app-upload.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/asset-key.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/asset.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/bulk-action.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/comment.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/concept-scheme.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/concept.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/content-type.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/editor-interface.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/entry.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/environment-alias.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/environment-template-installation.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/environment-template.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/environment.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/extension.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/function-log.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/function.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/http.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/locale.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/oauth-application.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/organization-invitation.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/organization-membership.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/organization.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/personal-access-token.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/preview-api-key.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/raw.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/release-action.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/release.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/resource-provider.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/resource-type.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/resource.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/role.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/scheduled-action.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/snapshot.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/space-member.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/space-membership.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/space.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/tag.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/task.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/team-membership.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/team-space-membership.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/team.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/ui-config.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/upload-credentials.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/upload.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/usage.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/user-ui-config.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/user.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/utils.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/webhook.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/workflow-definition.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/workflow.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/endpoints/workflows-changelog.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/make-request.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/rest-adapter.d.ts +0 -0
- /package/dist/{types → typings}/adapters/REST/types.d.ts +0 -0
- /package/dist/{types → typings}/common-utils.d.ts +0 -0
- /package/dist/{types → typings}/constants/editor-interface-defaults/editors-defaults.d.ts +0 -0
- /package/dist/{types → typings}/constants/editor-interface-defaults/index.d.ts +0 -0
- /package/dist/{types → typings}/constants/editor-interface-defaults/sidebar-defaults.d.ts +0 -0
- /package/dist/{types → typings}/constants/editor-interface-defaults/types.d.ts +0 -0
- /package/dist/{types → typings}/create-adapter.d.ts +0 -0
- /package/dist/{types → typings}/create-app-definition-api.d.ts +0 -0
- /package/dist/{types → typings}/create-entry-api.d.ts +0 -0
- /package/dist/{types → typings}/create-environment-template-api.d.ts +0 -0
- /package/dist/{types → typings}/create-organization-api.d.ts +0 -0
- /package/dist/{types → typings}/enhance-with-methods.d.ts +0 -0
- /package/dist/{types → typings}/entities/access-token.d.ts +0 -0
- /package/dist/{types → typings}/entities/api-key.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-access-token.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-action-call.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-action.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-bundle.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-definition.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-details.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-event-subscription.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-installation.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-key.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-signed-request.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-signing-secret.d.ts +0 -0
- /package/dist/{types → typings}/entities/app-upload.d.ts +0 -0
- /package/dist/{types → typings}/entities/asset-key.d.ts +0 -0
- /package/dist/{types → typings}/entities/asset.d.ts +0 -0
- /package/dist/{types → typings}/entities/bulk-action.d.ts +0 -0
- /package/dist/{types → typings}/entities/comment.d.ts +0 -0
- /package/dist/{types → typings}/entities/concept-scheme.d.ts +0 -0
- /package/dist/{types → typings}/entities/concept.d.ts +0 -0
- /package/dist/{types → typings}/entities/content-type-fields.d.ts +0 -0
- /package/dist/{types → typings}/entities/content-type.d.ts +0 -0
- /package/dist/{types → typings}/entities/editor-interface.d.ts +0 -0
- /package/dist/{types → typings}/entities/entry.d.ts +0 -0
- /package/dist/{types → typings}/entities/environment-alias.d.ts +0 -0
- /package/dist/{types → typings}/entities/environment-template-installation.d.ts +0 -0
- /package/dist/{types → typings}/entities/environment-template.d.ts +0 -0
- /package/dist/{types → typings}/entities/environment.d.ts +0 -0
- /package/dist/{types → typings}/entities/extension.d.ts +0 -0
- /package/dist/{types → typings}/entities/field-type.d.ts +0 -0
- /package/dist/{types → typings}/entities/function-log.d.ts +0 -0
- /package/dist/{types → typings}/entities/function.d.ts +0 -0
- /package/dist/{types → typings}/entities/locale.d.ts +0 -0
- /package/dist/{types → typings}/entities/oauth-application.d.ts +0 -0
- /package/dist/{types → typings}/entities/organization-invitation.d.ts +0 -0
- /package/dist/{types → typings}/entities/organization-membership.d.ts +0 -0
- /package/dist/{types → typings}/entities/organization.d.ts +0 -0
- /package/dist/{types → typings}/entities/personal-access-token.d.ts +0 -0
- /package/dist/{types → typings}/entities/preview-api-key.d.ts +0 -0
- /package/dist/{types → typings}/entities/release-action.d.ts +0 -0
- /package/dist/{types → typings}/entities/release.d.ts +0 -0
- /package/dist/{types → typings}/entities/resource-provider.d.ts +0 -0
- /package/dist/{types → typings}/entities/resource-type.d.ts +0 -0
- /package/dist/{types → typings}/entities/resource.d.ts +0 -0
- /package/dist/{types → typings}/entities/role.d.ts +0 -0
- /package/dist/{types → typings}/entities/scheduled-action.d.ts +0 -0
- /package/dist/{types → typings}/entities/snapshot.d.ts +0 -0
- /package/dist/{types → typings}/entities/space-member.d.ts +0 -0
- /package/dist/{types → typings}/entities/space-membership.d.ts +0 -0
- /package/dist/{types → typings}/entities/space.d.ts +0 -0
- /package/dist/{types → typings}/entities/tag.d.ts +0 -0
- /package/dist/{types → typings}/entities/task.d.ts +0 -0
- /package/dist/{types → typings}/entities/team-membership.d.ts +0 -0
- /package/dist/{types → typings}/entities/team-space-membership.d.ts +0 -0
- /package/dist/{types → typings}/entities/team.d.ts +0 -0
- /package/dist/{types → typings}/entities/upload-credential.d.ts +0 -0
- /package/dist/{types → typings}/entities/upload.d.ts +0 -0
- /package/dist/{types → typings}/entities/usage.d.ts +0 -0
- /package/dist/{types → typings}/entities/user.d.ts +0 -0
- /package/dist/{types → typings}/entities/utils.d.ts +0 -0
- /package/dist/{types → typings}/entities/webhook.d.ts +0 -0
- /package/dist/{types → typings}/entities/widget-parameters.d.ts +0 -0
- /package/dist/{types → typings}/entities/workflow-definition.d.ts +0 -0
- /package/dist/{types → typings}/entities/workflow.d.ts +0 -0
- /package/dist/{types → typings}/entities/workflows-changelog-entry.d.ts +0 -0
- /package/dist/{types → typings}/methods/action.d.ts +0 -0
- /package/dist/{types → typings}/methods/bulk-action.d.ts +0 -0
- /package/dist/{types → typings}/methods/content-type.d.ts +0 -0
- /package/dist/{types → typings}/methods/release-action.d.ts +0 -0
- /package/dist/{types → typings}/methods/utils.d.ts +0 -0
- /package/dist/{types → typings}/plain/as-iterator.d.ts +0 -0
- /package/dist/{types → typings}/plain/checks.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-access-token.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-action-call.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-action.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-bundle.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-definition.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-details.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-event-subscription.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-installation.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-key.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-signed-request.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-signing-secret.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/app-upload.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/comment.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/concept-scheme.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/concept.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/editor-interface.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/environment-alias.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/environment.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/extension.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/function-log.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/function.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/locale.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/oauth-application.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/organization.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/resource-provider.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/resource-type.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/resource.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/role.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/space-member.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/space-membership.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/space.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/tag.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/task.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/team-membership.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/team-space-membership.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/team.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/ui-config.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/upload-credential.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/upload.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/usage.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/user-ui-config.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/user.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/webhook.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/workflow-definition.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/workflow.d.ts +0 -0
- /package/dist/{types → typings}/plain/entities/workflows-changelog.d.ts +0 -0
- /package/dist/{types → typings}/plain/pagination-helper.d.ts +0 -0
- /package/dist/{types → typings}/plain/plain-client.d.ts +0 -0
- /package/dist/{types → typings}/plain/wrappers/wrap.d.ts +0 -0
- /package/dist/{types → typings}/plain/wrappers/wrap.test-d.d.ts +0 -0
- /package/dist/{types → typings}/upload-http-client.d.ts +0 -0
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
-
import entities from './index.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createResourceProviderApi(makeRequest) {
|
|
10
|
-
const { wrapResourceType } = entities.resourceType;
|
|
11
|
-
return {
|
|
12
|
-
/**
|
|
13
|
-
* Sends an update to the server with any changes made to the object's properties
|
|
14
|
-
* @return Object returned from the server with updated changes.
|
|
15
|
-
* @example ```javascript
|
|
16
|
-
* const contentful = require('contentful-management')
|
|
17
|
-
*
|
|
18
|
-
* const client = contentful.createClient({
|
|
19
|
-
* accessToken: '<content_management_api_key>'
|
|
20
|
-
* })
|
|
21
|
-
*
|
|
22
|
-
* client.getOrganization('<org_id>')
|
|
23
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
24
|
-
* .then((appDefinition) => appDefinition.getResourceProvider())
|
|
25
|
-
* .then((resourceProvider) => {
|
|
26
|
-
* resourceProvider.function.sys.id = '<new_contentful_function_id>'
|
|
27
|
-
* return resourceProvider.upsert()
|
|
28
|
-
* })
|
|
29
|
-
* .catch(console.error)
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
upsert: function upsert() {
|
|
33
|
-
const data = this.toPlainObject();
|
|
34
|
-
return makeRequest({
|
|
35
|
-
entityType: 'ResourceProvider',
|
|
36
|
-
action: 'upsert',
|
|
37
|
-
params: getParams(data),
|
|
38
|
-
headers: {},
|
|
39
|
-
payload: getUpsertParams(data),
|
|
40
|
-
}).then((data) => wrapResourceProvider(makeRequest, data));
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* Deletes this object on the server.
|
|
44
|
-
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
45
|
-
* @example ```javascript
|
|
46
|
-
* const contentful = require('contentful-management')
|
|
47
|
-
*
|
|
48
|
-
* const client = contentful.createClient({
|
|
49
|
-
* accessToken: '<content_management_api_key>'
|
|
50
|
-
* })
|
|
51
|
-
*
|
|
52
|
-
* client.getOrganization('<org_id>')
|
|
53
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
54
|
-
* .then((appDefinition) => appDefinition.getResourceProvider())
|
|
55
|
-
* .then((resourceProvider) => resourceProvider.delete())
|
|
56
|
-
* .catch(console.error)
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
delete: function del() {
|
|
60
|
-
const data = this.toPlainObject();
|
|
61
|
-
return makeRequest({
|
|
62
|
-
entityType: 'ResourceProvider',
|
|
63
|
-
action: 'delete',
|
|
64
|
-
params: getParams(data),
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
getResourceType: function getResourceType(id) {
|
|
68
|
-
return makeRequest({
|
|
69
|
-
entityType: 'ResourceType',
|
|
70
|
-
action: 'get',
|
|
71
|
-
params: {
|
|
72
|
-
organizationId: this.sys.organization.sys.id,
|
|
73
|
-
appDefinitionId: this.sys.appDefinition.sys.id,
|
|
74
|
-
resourceTypeId: id,
|
|
75
|
-
},
|
|
76
|
-
}).then((data) => wrapResourceType(makeRequest, data));
|
|
77
|
-
},
|
|
78
|
-
upsertResourceType: function upsertResourceType(id, data) {
|
|
79
|
-
return makeRequest({
|
|
80
|
-
entityType: 'ResourceType',
|
|
81
|
-
action: 'upsert',
|
|
82
|
-
params: {
|
|
83
|
-
organizationId: this.sys.organization.sys.id,
|
|
84
|
-
appDefinitionId: this.sys.appDefinition.sys.id,
|
|
85
|
-
resourceTypeId: id,
|
|
86
|
-
},
|
|
87
|
-
headers: {},
|
|
88
|
-
payload: data,
|
|
89
|
-
}).then((data) => wrapResourceType(makeRequest, data));
|
|
90
|
-
},
|
|
91
|
-
getResourceTypes: function getResourceTypes() {
|
|
92
|
-
return makeRequest({
|
|
93
|
-
entityType: 'ResourceType',
|
|
94
|
-
action: 'getMany',
|
|
95
|
-
params: {
|
|
96
|
-
organizationId: this.sys.organization.sys.id,
|
|
97
|
-
appDefinitionId: this.sys.appDefinition.sys.id,
|
|
98
|
-
},
|
|
99
|
-
}).then((data) => {
|
|
100
|
-
data.items = data.items.map((item) => wrapResourceType(makeRequest, item));
|
|
101
|
-
return data;
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* @private
|
|
108
|
-
* @param data - raw ResourceProvider Object
|
|
109
|
-
* @return Object containing the http params for the ResourceProvider request: organizationId and appDefinitionId
|
|
110
|
-
*/
|
|
111
|
-
const getParams = (data) => ({
|
|
112
|
-
organizationId: data.sys.organization.sys.id,
|
|
113
|
-
appDefinitionId: data.sys.appDefinition.sys.id,
|
|
114
|
-
});
|
|
115
|
-
/**
|
|
116
|
-
* @private
|
|
117
|
-
* @param data - raw ResourceProvider Object
|
|
118
|
-
* @return UpsertResourceProviderProps
|
|
119
|
-
*/
|
|
120
|
-
const getUpsertParams = (data) => ({
|
|
121
|
-
sys: { id: data.sys.id },
|
|
122
|
-
type: data.type,
|
|
123
|
-
function: data.function,
|
|
124
|
-
});
|
|
125
|
-
/**
|
|
126
|
-
* @private
|
|
127
|
-
* @param makeRequest - function to make requests via an adapter
|
|
128
|
-
* @param data - Raw Resource Provider data
|
|
129
|
-
* @return Wrapped Resource Provider data
|
|
130
|
-
*/
|
|
131
|
-
function wrapResourceProvider(makeRequest, data) {
|
|
132
|
-
const resourceProvider = toPlainObject(copy(data));
|
|
133
|
-
const ResourceProviderWithMethods = enhanceWithMethods(resourceProvider, createResourceProviderApi(makeRequest));
|
|
134
|
-
return freezeSys(ResourceProviderWithMethods);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export { wrapResourceProvider };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
-
import { wrapCursorPaginatedCollection } from '../common-utils.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createResourceTypeApi(makeRequest) {
|
|
10
|
-
return {
|
|
11
|
-
/**
|
|
12
|
-
* Sends an update to the server with any changes made to the object's properties
|
|
13
|
-
* @return Object returned from the server with updated changes.
|
|
14
|
-
* @example ```javascript
|
|
15
|
-
* const contentful = require('contentful-management')
|
|
16
|
-
*
|
|
17
|
-
* const client = contentful.createClient({
|
|
18
|
-
* accessToken: '<content_management_api_key>'
|
|
19
|
-
* })
|
|
20
|
-
*
|
|
21
|
-
* client.getOrganization('<org_id>')
|
|
22
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
23
|
-
* .then((appDefinition) => appDefinition.getResourceType())
|
|
24
|
-
* .then((resourceType) => {
|
|
25
|
-
* resourceType.name = '<new_name>'
|
|
26
|
-
* return resourceType.upsert()
|
|
27
|
-
* })
|
|
28
|
-
* .catch(console.error)
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
upsert: function upsert() {
|
|
32
|
-
const data = this.toPlainObject();
|
|
33
|
-
return makeRequest({
|
|
34
|
-
entityType: 'ResourceType',
|
|
35
|
-
action: 'upsert',
|
|
36
|
-
params: getParams(data),
|
|
37
|
-
headers: {},
|
|
38
|
-
payload: getUpsertParams(data),
|
|
39
|
-
}).then((data) => wrapResourceType(makeRequest, data));
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* Deletes this object on the server.
|
|
43
|
-
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
44
|
-
* @example ```javascript
|
|
45
|
-
* const contentful = require('contentful-management')
|
|
46
|
-
*
|
|
47
|
-
* const client = contentful.createClient({
|
|
48
|
-
* accessToken: '<content_management_api_key>'
|
|
49
|
-
* })
|
|
50
|
-
*
|
|
51
|
-
* client.getOrganization('<org_id>')
|
|
52
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
53
|
-
* .then((appDefinition) => appDefinition.getResourceType())
|
|
54
|
-
* .then((resourceType) => resourceType.delete())
|
|
55
|
-
* .catch(console.error)
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
delete: function del() {
|
|
59
|
-
const data = this.toPlainObject();
|
|
60
|
-
return makeRequest({
|
|
61
|
-
entityType: 'ResourceType',
|
|
62
|
-
action: 'delete',
|
|
63
|
-
params: getParams(data),
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const getParams = (data) => ({
|
|
69
|
-
organizationId: data.sys.organization.sys.id,
|
|
70
|
-
appDefinitionId: data.sys.appDefinition.sys.id,
|
|
71
|
-
resourceTypeId: data.sys.id,
|
|
72
|
-
});
|
|
73
|
-
const getUpsertParams = (data) => ({
|
|
74
|
-
name: data.name,
|
|
75
|
-
defaultFieldMapping: data.defaultFieldMapping,
|
|
76
|
-
});
|
|
77
|
-
/**
|
|
78
|
-
* @private
|
|
79
|
-
* @param makeRequest - function to make requests via an adapter
|
|
80
|
-
* @param data - Raw Resource Type data
|
|
81
|
-
* @return Wrapped Resource Type data
|
|
82
|
-
*/
|
|
83
|
-
function wrapResourceType(makeRequest, data) {
|
|
84
|
-
const resourceType = toPlainObject(copy(data));
|
|
85
|
-
const ResourceTypeWithMethods = enhanceWithMethods(resourceType, createResourceTypeApi(makeRequest));
|
|
86
|
-
return freezeSys(ResourceTypeWithMethods);
|
|
87
|
-
}
|
|
88
|
-
function wrapResourceTypeforEnvironment(makeRequest, data) {
|
|
89
|
-
const resourceType = toPlainObject(data);
|
|
90
|
-
return freezeSys(resourceType);
|
|
91
|
-
}
|
|
92
|
-
const wrapResourceTypesForEnvironmentCollection = wrapCursorPaginatedCollection(wrapResourceTypeforEnvironment);
|
|
93
|
-
|
|
94
|
-
export { wrapResourceType, wrapResourceTypeforEnvironment, wrapResourceTypesForEnvironmentCollection };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { wrapCursorPaginatedCollection } from '../common-utils.js';
|
|
2
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
-
|
|
4
|
-
function wrapResource(makeRequest, data) {
|
|
5
|
-
const resource = toPlainObject(data);
|
|
6
|
-
return freezeSys(resource);
|
|
7
|
-
}
|
|
8
|
-
const wrapResourceCollection = wrapCursorPaginatedCollection(wrapResource);
|
|
9
|
-
|
|
10
|
-
export { wrapResource, wrapResourceCollection };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
-
import { wrapCollection } from '../common-utils.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createRoleApi(makeRequest) {
|
|
10
|
-
const getParams = (data) => ({
|
|
11
|
-
spaceId: data.sys.space.sys.id,
|
|
12
|
-
roleId: data.sys.id,
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
update: function update() {
|
|
16
|
-
const data = this.toPlainObject();
|
|
17
|
-
return makeRequest({
|
|
18
|
-
entityType: 'Role',
|
|
19
|
-
action: 'update',
|
|
20
|
-
params: getParams(data),
|
|
21
|
-
payload: data,
|
|
22
|
-
}).then((data) => wrapRole(makeRequest, data));
|
|
23
|
-
},
|
|
24
|
-
delete: function del() {
|
|
25
|
-
const data = this.toPlainObject();
|
|
26
|
-
return makeRequest({
|
|
27
|
-
entityType: 'Role',
|
|
28
|
-
action: 'delete',
|
|
29
|
-
params: getParams(data),
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
* @param makeRequest - function to make requests via an adapter
|
|
37
|
-
* @param data - Raw role data
|
|
38
|
-
* @return Wrapped role data
|
|
39
|
-
*/
|
|
40
|
-
function wrapRole(makeRequest, data) {
|
|
41
|
-
const role = toPlainObject(copy(data));
|
|
42
|
-
const roleWithMethods = enhanceWithMethods(role, createRoleApi(makeRequest));
|
|
43
|
-
return freezeSys(roleWithMethods);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @private
|
|
47
|
-
*/
|
|
48
|
-
const wrapRoleCollection = wrapCollection(wrapRole);
|
|
49
|
-
|
|
50
|
-
export { wrapRole, wrapRoleCollection };
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
-
import copy from 'fast-copy';
|
|
4
|
-
import { wrapCollection } from '../common-utils.js';
|
|
5
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Represents that state of the scheduled action
|
|
9
|
-
*/
|
|
10
|
-
var ScheduledActionStatus;
|
|
11
|
-
(function (ScheduledActionStatus) {
|
|
12
|
-
/** action is pending execution */
|
|
13
|
-
ScheduledActionStatus["scheduled"] = "scheduled";
|
|
14
|
-
/** action has been started and pending completion */
|
|
15
|
-
ScheduledActionStatus["inProgress"] = "inProgress";
|
|
16
|
-
/** action was completed successfully (terminal state) */
|
|
17
|
-
ScheduledActionStatus["succeeded"] = "succeeded";
|
|
18
|
-
/** action failed to complete (terminal state) */
|
|
19
|
-
ScheduledActionStatus["failed"] = "failed";
|
|
20
|
-
/** action was canceled by a user (terminal state) */
|
|
21
|
-
ScheduledActionStatus["canceled"] = "canceled";
|
|
22
|
-
})(ScheduledActionStatus || (ScheduledActionStatus = {}));
|
|
23
|
-
function getInstanceMethods(makeRequest) {
|
|
24
|
-
const getParams = (self) => {
|
|
25
|
-
var _a;
|
|
26
|
-
const scheduledAction = self.toPlainObject();
|
|
27
|
-
return {
|
|
28
|
-
spaceId: scheduledAction.sys.space.sys.id,
|
|
29
|
-
environmentId: (_a = scheduledAction.environment) === null || _a === void 0 ? void 0 : _a.sys.id,
|
|
30
|
-
scheduledActionId: scheduledAction.sys.id,
|
|
31
|
-
version: scheduledAction.sys.version,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
/**
|
|
36
|
-
* Cancels the current Scheduled Action schedule.
|
|
37
|
-
*
|
|
38
|
-
* @example ```javascript
|
|
39
|
-
* const contentful = require('contentful-management');
|
|
40
|
-
*
|
|
41
|
-
* const client = contentful.createClient({
|
|
42
|
-
* accessToken: '<content_management_api_key>'
|
|
43
|
-
* })
|
|
44
|
-
*
|
|
45
|
-
* client.getSpace('<space_id>')
|
|
46
|
-
* .then((space) => {
|
|
47
|
-
* return space.createScheduledAction({
|
|
48
|
-
* entity: {
|
|
49
|
-
* sys: {
|
|
50
|
-
* type: 'Link',
|
|
51
|
-
* linkType: 'Entry',
|
|
52
|
-
* id: '<entry_id>'
|
|
53
|
-
* }
|
|
54
|
-
* },
|
|
55
|
-
* environment: {
|
|
56
|
-
* sys: {
|
|
57
|
-
* type: 'Link',
|
|
58
|
-
* linkType: 'Environment',
|
|
59
|
-
* id: '<environment_id>'
|
|
60
|
-
* }
|
|
61
|
-
* },
|
|
62
|
-
* action: 'publish',
|
|
63
|
-
* scheduledFor: {
|
|
64
|
-
* datetime: <ISO_date_string>,
|
|
65
|
-
* timezone: 'Europe/Berlin'
|
|
66
|
-
* }
|
|
67
|
-
* })
|
|
68
|
-
* .then((scheduledAction) => scheduledAction.delete())
|
|
69
|
-
* .then((deletedScheduledAction) => console.log(deletedScheduledAction))
|
|
70
|
-
* .catch(console.error);
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
async delete() {
|
|
74
|
-
const params = getParams(this);
|
|
75
|
-
return makeRequest({
|
|
76
|
-
entityType: 'ScheduledAction',
|
|
77
|
-
action: 'delete',
|
|
78
|
-
params,
|
|
79
|
-
}).then((data) => wrapScheduledAction(makeRequest, data));
|
|
80
|
-
},
|
|
81
|
-
/**
|
|
82
|
-
* Update the current scheduled action. Currently, only changes made to the `scheduledFor` property will be saved.
|
|
83
|
-
*
|
|
84
|
-
* @example ```javascript
|
|
85
|
-
* const contentful = require('contentful-management');
|
|
86
|
-
*
|
|
87
|
-
* const client = contentful.createClient({
|
|
88
|
-
* accessToken: '<content_management_api_key>'
|
|
89
|
-
* })
|
|
90
|
-
*
|
|
91
|
-
* client.getSpace('<space_id>')
|
|
92
|
-
* .then((space) => {
|
|
93
|
-
* return space.createScheduledAction({
|
|
94
|
-
* entity: {
|
|
95
|
-
* sys: {
|
|
96
|
-
* type: 'Link',
|
|
97
|
-
* linkType: 'Entry',
|
|
98
|
-
* id: '<entry_id>'
|
|
99
|
-
* }
|
|
100
|
-
* },
|
|
101
|
-
* environment: {
|
|
102
|
-
* sys: {
|
|
103
|
-
* type: 'Link',
|
|
104
|
-
* linkType: 'Environment',
|
|
105
|
-
* id: '<environment_id>'
|
|
106
|
-
* }
|
|
107
|
-
* },
|
|
108
|
-
* action: 'publish',
|
|
109
|
-
* scheduledFor: {
|
|
110
|
-
* datetime: <ISO_date_string>,
|
|
111
|
-
* timezone: 'Europe/Berlin'
|
|
112
|
-
* }
|
|
113
|
-
* })
|
|
114
|
-
* .then((scheduledAction) => {
|
|
115
|
-
* scheduledAction.scheduledFor.timezone = 'Europe/Paris';
|
|
116
|
-
* return scheduledAction.update();
|
|
117
|
-
* })
|
|
118
|
-
* .then((scheduledAction) => console.log(scheduledAction))
|
|
119
|
-
* .catch(console.error);
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
async update() {
|
|
123
|
-
const params = getParams(this);
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
125
|
-
const _a = this.toPlainObject(), payload = __rest(_a, ["sys"]);
|
|
126
|
-
return makeRequest({
|
|
127
|
-
entityType: 'ScheduledAction',
|
|
128
|
-
action: 'update',
|
|
129
|
-
params,
|
|
130
|
-
payload,
|
|
131
|
-
}).then((data) => wrapScheduledAction(makeRequest, data));
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* @private
|
|
137
|
-
*/
|
|
138
|
-
function wrapScheduledAction(makeRequest, data) {
|
|
139
|
-
const scheduledAction = toPlainObject(copy(data));
|
|
140
|
-
const scheduledActionWithMethods = enhanceWithMethods(scheduledAction, getInstanceMethods(makeRequest));
|
|
141
|
-
return freezeSys(scheduledActionWithMethods);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* @private
|
|
145
|
-
*/
|
|
146
|
-
const wrapScheduledActionCollection = wrapCollection(wrapScheduledAction);
|
|
147
|
-
|
|
148
|
-
export { ScheduledActionStatus, getInstanceMethods as default, wrapScheduledAction, wrapScheduledActionCollection };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
-
import { wrapCollection } from '../common-utils.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createSnapshotApi() {
|
|
10
|
-
return {
|
|
11
|
-
/* In case the snapshot object evolve later */
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @private
|
|
16
|
-
* @param makeRequest - function to make requests via an adapter
|
|
17
|
-
* @param data - Raw snapshot data
|
|
18
|
-
* @return Wrapped snapshot data
|
|
19
|
-
*/
|
|
20
|
-
function wrapSnapshot(_makeRequest, data) {
|
|
21
|
-
const snapshot = toPlainObject(copy(data));
|
|
22
|
-
const snapshotWithMethods = enhanceWithMethods(snapshot, createSnapshotApi());
|
|
23
|
-
return freezeSys(snapshotWithMethods);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
* @param makeRequest - function to make requests via an adapter
|
|
28
|
-
* @param data - Raw snapshot collection data
|
|
29
|
-
* @return Wrapped snapshot collection data
|
|
30
|
-
*/
|
|
31
|
-
const wrapSnapshotCollection = wrapCollection(wrapSnapshot);
|
|
32
|
-
|
|
33
|
-
export { wrapSnapshot, wrapSnapshotCollection };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
* @param makeRequest - function to make requests via an adapter
|
|
8
|
-
* @param data - Raw space member data
|
|
9
|
-
* @return Wrapped space member data
|
|
10
|
-
*/
|
|
11
|
-
function wrapSpaceMember(_makeRequest, data) {
|
|
12
|
-
const spaceMember = toPlainObject(copy(data));
|
|
13
|
-
return freezeSys(spaceMember);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
const wrapSpaceMemberCollection = wrapCollection(wrapSpaceMember);
|
|
19
|
-
|
|
20
|
-
export { wrapSpaceMember, wrapSpaceMemberCollection };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
-
import { wrapCollection } from '../common-utils.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createSpaceMembershipApi(makeRequest) {
|
|
10
|
-
const getParams = (data) => ({
|
|
11
|
-
spaceId: data.sys.space.sys.id,
|
|
12
|
-
spaceMembershipId: data.sys.id,
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
update: function update() {
|
|
16
|
-
const data = this.toPlainObject();
|
|
17
|
-
return makeRequest({
|
|
18
|
-
entityType: 'SpaceMembership',
|
|
19
|
-
action: 'update',
|
|
20
|
-
params: getParams(data),
|
|
21
|
-
payload: data,
|
|
22
|
-
}).then((data) => wrapSpaceMembership(makeRequest, data));
|
|
23
|
-
},
|
|
24
|
-
delete: function del() {
|
|
25
|
-
const data = this.toPlainObject();
|
|
26
|
-
return makeRequest({
|
|
27
|
-
entityType: 'SpaceMembership',
|
|
28
|
-
action: 'delete',
|
|
29
|
-
params: getParams(data),
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
* @param makeRequest - function to make requests via an adapter
|
|
37
|
-
* @param data - Raw space membership data
|
|
38
|
-
* @return Wrapped space membership data
|
|
39
|
-
*/
|
|
40
|
-
function wrapSpaceMembership(makeRequest, data) {
|
|
41
|
-
const spaceMembership = toPlainObject(copy(data));
|
|
42
|
-
const spaceMembershipWithMethods = enhanceWithMethods(spaceMembership, createSpaceMembershipApi(makeRequest));
|
|
43
|
-
return freezeSys(spaceMembershipWithMethods);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @private
|
|
47
|
-
*/
|
|
48
|
-
const wrapSpaceMembershipCollection = wrapCollection(wrapSpaceMembership);
|
|
49
|
-
|
|
50
|
-
export { wrapSpaceMembership, wrapSpaceMembershipCollection };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils.js';
|
|
4
|
-
import createSpaceApi from '../create-space-api.js';
|
|
5
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This method creates the API for the given space with all the methods for
|
|
9
|
-
* reading and creating other entities. It also passes down a clone of the
|
|
10
|
-
* http client with a space id, so the base path for requests now has the
|
|
11
|
-
* space id already set.
|
|
12
|
-
* @private
|
|
13
|
-
* @param makeRequest - function to make requests via an adapter
|
|
14
|
-
* @param data - API response for a Space
|
|
15
|
-
* @return {Space}
|
|
16
|
-
*/
|
|
17
|
-
function wrapSpace(makeRequest, data) {
|
|
18
|
-
const space = toPlainObject(copy(data));
|
|
19
|
-
const spaceApi = createSpaceApi(makeRequest);
|
|
20
|
-
const enhancedSpace = enhanceWithMethods(space, spaceApi);
|
|
21
|
-
return freezeSys(enhancedSpace);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* This method wraps each space in a collection with the space API. See wrapSpace
|
|
25
|
-
* above for more details.
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
const wrapSpaceCollection = wrapCollection(wrapSpace);
|
|
29
|
-
|
|
30
|
-
export { wrapSpace, wrapSpaceCollection };
|
package/dist/esm/entities/tag.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils.js';
|
|
4
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createTagApi(makeRequest) {
|
|
10
|
-
const getParams = (tag) => ({
|
|
11
|
-
spaceId: tag.sys.space.sys.id,
|
|
12
|
-
environmentId: tag.sys.environment.sys.id,
|
|
13
|
-
tagId: tag.sys.id,
|
|
14
|
-
});
|
|
15
|
-
return {
|
|
16
|
-
update: function () {
|
|
17
|
-
const raw = this.toPlainObject();
|
|
18
|
-
return makeRequest({
|
|
19
|
-
entityType: 'Tag',
|
|
20
|
-
action: 'update',
|
|
21
|
-
params: getParams(raw),
|
|
22
|
-
payload: raw,
|
|
23
|
-
}).then((data) => wrapTag(makeRequest, data));
|
|
24
|
-
},
|
|
25
|
-
delete: function () {
|
|
26
|
-
const raw = this.toPlainObject();
|
|
27
|
-
return makeRequest({
|
|
28
|
-
entityType: 'Tag',
|
|
29
|
-
action: 'delete',
|
|
30
|
-
params: Object.assign(Object.assign({}, getParams(raw)), { version: raw.sys.version }),
|
|
31
|
-
}).then(() => {
|
|
32
|
-
// noop
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
function wrapTag(makeRequest, data) {
|
|
41
|
-
const tag = toPlainObject(copy(data));
|
|
42
|
-
const tagWithMethods = enhanceWithMethods(tag, createTagApi(makeRequest));
|
|
43
|
-
return freezeSys(tagWithMethods);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @private
|
|
47
|
-
*/
|
|
48
|
-
const wrapTagCollection = wrapCollection(wrapTag);
|
|
49
|
-
|
|
50
|
-
export { createTagApi as default, wrapTag, wrapTagCollection };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils.js';
|
|
4
|
-
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
function createTaskApi(makeRequest) {
|
|
10
|
-
const getParams = (task) => ({
|
|
11
|
-
spaceId: task.sys.space.sys.id,
|
|
12
|
-
environmentId: task.sys.environment.sys.id,
|
|
13
|
-
entryId: task.sys.parentEntity.sys.id,
|
|
14
|
-
taskId: task.sys.id,
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
update: function () {
|
|
18
|
-
const raw = this.toPlainObject();
|
|
19
|
-
return makeRequest({
|
|
20
|
-
entityType: 'Task',
|
|
21
|
-
action: 'update',
|
|
22
|
-
params: getParams(raw),
|
|
23
|
-
payload: raw,
|
|
24
|
-
}).then((data) => wrapTask(makeRequest, data));
|
|
25
|
-
},
|
|
26
|
-
delete: function () {
|
|
27
|
-
const raw = this.toPlainObject();
|
|
28
|
-
return makeRequest({
|
|
29
|
-
entityType: 'Task',
|
|
30
|
-
action: 'delete',
|
|
31
|
-
params: Object.assign(Object.assign({}, getParams(raw)), { version: raw.sys.version }),
|
|
32
|
-
}).then(() => {
|
|
33
|
-
// noop
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
function wrapTask(makeRequest, data) {
|
|
42
|
-
const task = toPlainObject(copy(data));
|
|
43
|
-
const taskWithMethods = enhanceWithMethods(task, createTaskApi(makeRequest));
|
|
44
|
-
return freezeSys(taskWithMethods);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
const wrapTaskCollection = wrapCollection(wrapTask);
|
|
50
|
-
|
|
51
|
-
export { createTaskApi as default, wrapTask, wrapTaskCollection };
|