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,50 @@
|
|
|
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 };
|
|
@@ -0,0 +1,51 @@
|
|
|
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 };
|
|
@@ -0,0 +1,51 @@
|
|
|
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 createTeamMembershipApi(makeRequest) {
|
|
10
|
+
const getParams = (data) => ({
|
|
11
|
+
teamMembershipId: data.sys.id,
|
|
12
|
+
teamId: data.sys.team.sys.id,
|
|
13
|
+
organizationId: data.sys.organization.sys.id,
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
update: function () {
|
|
17
|
+
const raw = this.toPlainObject();
|
|
18
|
+
return makeRequest({
|
|
19
|
+
entityType: 'TeamMembership',
|
|
20
|
+
action: 'update',
|
|
21
|
+
params: getParams(raw),
|
|
22
|
+
payload: raw,
|
|
23
|
+
}).then((data) => wrapTeamMembership(makeRequest, data));
|
|
24
|
+
},
|
|
25
|
+
delete: function del() {
|
|
26
|
+
const raw = this.toPlainObject();
|
|
27
|
+
return makeRequest({
|
|
28
|
+
entityType: 'TeamMembership',
|
|
29
|
+
action: 'delete',
|
|
30
|
+
params: getParams(raw),
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
* @param makeRequest - function to make requests via an adapter
|
|
38
|
+
* @param data - Raw team membership data
|
|
39
|
+
* @return Wrapped team membership data
|
|
40
|
+
*/
|
|
41
|
+
function wrapTeamMembership(makeRequest, data) {
|
|
42
|
+
const teamMembership = toPlainObject(copy(data));
|
|
43
|
+
const teamMembershipWithMethods = enhanceWithMethods(teamMembership, createTeamMembershipApi(makeRequest));
|
|
44
|
+
return freezeSys(teamMembershipWithMethods);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
const wrapTeamMembershipCollection = wrapCollection(wrapTeamMembership);
|
|
50
|
+
|
|
51
|
+
export { wrapTeamMembership, wrapTeamMembershipCollection };
|
|
@@ -0,0 +1,50 @@
|
|
|
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 createTeamSpaceMembershipApi(makeRequest) {
|
|
10
|
+
const getParams = (data) => ({
|
|
11
|
+
teamSpaceMembershipId: data.sys.id,
|
|
12
|
+
spaceId: data.sys.space.sys.id,
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
update: function () {
|
|
16
|
+
const raw = this.toPlainObject();
|
|
17
|
+
return makeRequest({
|
|
18
|
+
entityType: 'TeamSpaceMembership',
|
|
19
|
+
action: 'update',
|
|
20
|
+
params: getParams(raw),
|
|
21
|
+
payload: raw,
|
|
22
|
+
}).then((data) => wrapTeamSpaceMembership(makeRequest, data));
|
|
23
|
+
},
|
|
24
|
+
delete: function del() {
|
|
25
|
+
const data = this.toPlainObject();
|
|
26
|
+
return makeRequest({
|
|
27
|
+
entityType: 'TeamSpaceMembership',
|
|
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 team space membership data
|
|
39
|
+
*/
|
|
40
|
+
function wrapTeamSpaceMembership(makeRequest, data) {
|
|
41
|
+
const teamSpaceMembership = toPlainObject(copy(data));
|
|
42
|
+
const teamSpaceMembershipWithMethods = enhanceWithMethods(teamSpaceMembership, createTeamSpaceMembershipApi(makeRequest));
|
|
43
|
+
return freezeSys(teamSpaceMembershipWithMethods);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
const wrapTeamSpaceMembershipCollection = wrapCollection(wrapTeamSpaceMembership);
|
|
49
|
+
|
|
50
|
+
export { wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection };
|
|
@@ -0,0 +1,50 @@
|
|
|
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 createTeamApi(makeRequest) {
|
|
10
|
+
const getParams = (data) => ({
|
|
11
|
+
teamId: data.sys.id,
|
|
12
|
+
organizationId: data.sys.organization.sys.id,
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
update: function update() {
|
|
16
|
+
const raw = this.toPlainObject();
|
|
17
|
+
return makeRequest({
|
|
18
|
+
entityType: 'Team',
|
|
19
|
+
action: 'update',
|
|
20
|
+
params: getParams(raw),
|
|
21
|
+
payload: raw,
|
|
22
|
+
}).then((data) => wrapTeam(makeRequest, data));
|
|
23
|
+
},
|
|
24
|
+
delete: function del() {
|
|
25
|
+
const raw = this.toPlainObject();
|
|
26
|
+
return makeRequest({
|
|
27
|
+
entityType: 'Team',
|
|
28
|
+
action: 'delete',
|
|
29
|
+
params: getParams(raw),
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
* @param makeRequest - function to make requests via an adapter
|
|
37
|
+
* @param data - Raw team data
|
|
38
|
+
* @return Wrapped team data
|
|
39
|
+
*/
|
|
40
|
+
function wrapTeam(makeRequest, data) {
|
|
41
|
+
const team = toPlainObject(copy(data));
|
|
42
|
+
const teamWithMethods = enhanceWithMethods(team, createTeamApi(makeRequest));
|
|
43
|
+
return freezeSys(teamWithMethods);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
const wrapTeamCollection = wrapCollection(wrapTeam);
|
|
49
|
+
|
|
50
|
+
export { wrapTeam, wrapTeamCollection };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
|
+
import createUIConfigApi from '../create-ui-config-api.js';
|
|
4
|
+
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @param makeRequest - function to make requests via an adapter
|
|
9
|
+
* @param data - Raw data
|
|
10
|
+
* @return Wrapped UIConfig
|
|
11
|
+
*/
|
|
12
|
+
function wrapUIConfig(makeRequest, data) {
|
|
13
|
+
const user = toPlainObject(copy(data));
|
|
14
|
+
const userWithMethods = enhanceWithMethods(user, createUIConfigApi(makeRequest));
|
|
15
|
+
return freezeSys(userWithMethods);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { wrapUIConfig };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import copy from 'fast-copy';
|
|
2
|
+
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
3
|
+
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
function createUploadApi(makeRequest) {
|
|
9
|
+
return {
|
|
10
|
+
delete: async function del() {
|
|
11
|
+
const raw = this.toPlainObject();
|
|
12
|
+
await makeRequest({
|
|
13
|
+
entityType: 'Upload',
|
|
14
|
+
action: 'delete',
|
|
15
|
+
params: {
|
|
16
|
+
spaceId: raw.sys.space.sys.id,
|
|
17
|
+
environmentId: raw.sys.id,
|
|
18
|
+
uploadId: raw.sys.id,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @private
|
|
26
|
+
* @param {function} makeRequest - function to make requests via an adapter
|
|
27
|
+
* @param {object} data - Raw upload data
|
|
28
|
+
* @return {Upload} Wrapped upload data
|
|
29
|
+
*/
|
|
30
|
+
function wrapUpload(makeRequest, data) {
|
|
31
|
+
const upload = toPlainObject(copy(data));
|
|
32
|
+
const uploadWithMethods = enhanceWithMethods(upload, createUploadApi(makeRequest));
|
|
33
|
+
return freezeSys(uploadWithMethods);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { wrapUpload };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* @param makeRequest - function to make requests via an adapter
|
|
9
|
+
* @param data - Raw data
|
|
10
|
+
* @return Normalized usage
|
|
11
|
+
*/
|
|
12
|
+
function wrapUsage(_makeRequest, data) {
|
|
13
|
+
const usage = toPlainObject(copy(data));
|
|
14
|
+
const usageWithMethods = enhanceWithMethods(usage, {});
|
|
15
|
+
return freezeSys(usageWithMethods);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
const wrapUsageCollection = wrapCollection(wrapUsage);
|
|
21
|
+
|
|
22
|
+
export { wrapUsage, wrapUsageCollection };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
|
+
import createUserUIConfigApi from '../create-user-ui-config-api.js';
|
|
4
|
+
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @param makeRequest - function to make requests via an adapter
|
|
9
|
+
* @param data - Raw data
|
|
10
|
+
* @return Wrapped UserUIConfig
|
|
11
|
+
*/
|
|
12
|
+
function wrapUserUIConfig(makeRequest, data) {
|
|
13
|
+
const user = toPlainObject(copy(data));
|
|
14
|
+
const userWithMethods = enhanceWithMethods(user, createUserUIConfigApi(makeRequest));
|
|
15
|
+
return freezeSys(userWithMethods);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { wrapUserUIConfig };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
+
import copy from 'fast-copy';
|
|
3
|
+
import enhanceWithMethods from '../enhance-with-methods.js';
|
|
4
|
+
import { wrapCollection } from '../common-utils.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @param makeRequest - function to make requests via an adapter
|
|
9
|
+
* @param data - Raw data
|
|
10
|
+
* @return Normalized user
|
|
11
|
+
*/
|
|
12
|
+
function wrapUser(_makeRequest, data) {
|
|
13
|
+
const user = toPlainObject(copy(data));
|
|
14
|
+
const userWithMethods = enhanceWithMethods(user, {});
|
|
15
|
+
return freezeSys(userWithMethods);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
* @param makeRequest - function to make requests via an adapter
|
|
20
|
+
* @param data - Raw data collection
|
|
21
|
+
* @return Normalized user collection
|
|
22
|
+
*/
|
|
23
|
+
const wrapUserCollection = wrapCollection(wrapUser);
|
|
24
|
+
|
|
25
|
+
export { wrapUser, wrapUserCollection };
|
|
@@ -0,0 +1,74 @@
|
|
|
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 createWebhookApi(makeRequest) {
|
|
10
|
+
const getParams = (data) => ({
|
|
11
|
+
spaceId: data.sys.space.sys.id,
|
|
12
|
+
webhookDefinitionId: data.sys.id,
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
update: function update() {
|
|
16
|
+
const data = this.toPlainObject();
|
|
17
|
+
return makeRequest({
|
|
18
|
+
entityType: 'Webhook',
|
|
19
|
+
action: 'update',
|
|
20
|
+
params: getParams(data),
|
|
21
|
+
payload: data,
|
|
22
|
+
}).then((data) => wrapWebhook(makeRequest, data));
|
|
23
|
+
},
|
|
24
|
+
delete: function del() {
|
|
25
|
+
const data = this.toPlainObject();
|
|
26
|
+
return makeRequest({
|
|
27
|
+
entityType: 'Webhook',
|
|
28
|
+
action: 'delete',
|
|
29
|
+
params: getParams(data),
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
getCalls: function getCalls() {
|
|
33
|
+
const data = this.toPlainObject();
|
|
34
|
+
return makeRequest({
|
|
35
|
+
entityType: 'Webhook',
|
|
36
|
+
action: 'getManyCallDetails',
|
|
37
|
+
params: getParams(data),
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
getCall: function getCall(id) {
|
|
41
|
+
const data = this.toPlainObject();
|
|
42
|
+
return makeRequest({
|
|
43
|
+
entityType: 'Webhook',
|
|
44
|
+
action: 'getCallDetails',
|
|
45
|
+
params: Object.assign(Object.assign({}, getParams(data)), { callId: id }),
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
getHealth: function getHealth() {
|
|
49
|
+
const data = this.toPlainObject();
|
|
50
|
+
return makeRequest({
|
|
51
|
+
entityType: 'Webhook',
|
|
52
|
+
action: 'getHealthStatus',
|
|
53
|
+
params: getParams(data),
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @private
|
|
60
|
+
* @param makeRequest - function to make requests via an adapter
|
|
61
|
+
* @param data - Raw webhook data
|
|
62
|
+
* @return Wrapped webhook data
|
|
63
|
+
*/
|
|
64
|
+
function wrapWebhook(makeRequest, data) {
|
|
65
|
+
const webhook = toPlainObject(copy(data));
|
|
66
|
+
const webhookWithMethods = enhanceWithMethods(webhook, createWebhookApi(makeRequest));
|
|
67
|
+
return freezeSys(webhookWithMethods);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
const wrapWebhookCollection = wrapCollection(wrapWebhook);
|
|
73
|
+
|
|
74
|
+
export { wrapWebhook, wrapWebhookCollection };
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
var WorkflowStepPermissionType;
|
|
7
|
+
(function (WorkflowStepPermissionType) {
|
|
8
|
+
WorkflowStepPermissionType["EntityPermission"] = "entity_permission";
|
|
9
|
+
WorkflowStepPermissionType["WorkflowPermission"] = "workflow_permission";
|
|
10
|
+
})(WorkflowStepPermissionType || (WorkflowStepPermissionType = {}));
|
|
11
|
+
var WorkflowStepPermissionAction;
|
|
12
|
+
(function (WorkflowStepPermissionAction) {
|
|
13
|
+
WorkflowStepPermissionAction["Edit"] = "edit";
|
|
14
|
+
WorkflowStepPermissionAction["Publish"] = "publish";
|
|
15
|
+
WorkflowStepPermissionAction["Delete"] = "delete";
|
|
16
|
+
})(WorkflowStepPermissionAction || (WorkflowStepPermissionAction = {}));
|
|
17
|
+
var WorkflowStepPermissionEffect;
|
|
18
|
+
(function (WorkflowStepPermissionEffect) {
|
|
19
|
+
WorkflowStepPermissionEffect["Allow"] = "allow";
|
|
20
|
+
WorkflowStepPermissionEffect["Deny"] = "deny";
|
|
21
|
+
})(WorkflowStepPermissionEffect || (WorkflowStepPermissionEffect = {}));
|
|
22
|
+
/* Workflow Step Action */
|
|
23
|
+
var WorkflowStepActionType;
|
|
24
|
+
(function (WorkflowStepActionType) {
|
|
25
|
+
WorkflowStepActionType["App"] = "app";
|
|
26
|
+
WorkflowStepActionType["Email"] = "email";
|
|
27
|
+
WorkflowStepActionType["Task"] = "task";
|
|
28
|
+
})(WorkflowStepActionType || (WorkflowStepActionType = {}));
|
|
29
|
+
/**
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
function createWorkflowDefinitionApi(makeRequest) {
|
|
33
|
+
const getParams = (workflowDefinition) => ({
|
|
34
|
+
spaceId: workflowDefinition.sys.space.sys.id,
|
|
35
|
+
environmentId: workflowDefinition.sys.environment.sys.id,
|
|
36
|
+
workflowDefinitionId: workflowDefinition.sys.id,
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
update: function () {
|
|
40
|
+
const raw = this.toPlainObject();
|
|
41
|
+
return makeRequest({
|
|
42
|
+
entityType: 'WorkflowDefinition',
|
|
43
|
+
action: 'update',
|
|
44
|
+
params: getParams(raw),
|
|
45
|
+
payload: raw,
|
|
46
|
+
}).then((data) => wrapWorkflowDefinition(makeRequest, data));
|
|
47
|
+
},
|
|
48
|
+
delete: function () {
|
|
49
|
+
const raw = this.toPlainObject();
|
|
50
|
+
return makeRequest({
|
|
51
|
+
entityType: 'WorkflowDefinition',
|
|
52
|
+
action: 'delete',
|
|
53
|
+
params: Object.assign(Object.assign({}, getParams(raw)), { version: raw.sys.version }),
|
|
54
|
+
}).then(() => {
|
|
55
|
+
// noop
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
function wrapWorkflowDefinition(makeRequest, data) {
|
|
64
|
+
const workflowDefinition = toPlainObject(copy(data));
|
|
65
|
+
const workflowDefinitionWithMethods = enhanceWithMethods(workflowDefinition, createWorkflowDefinitionApi(makeRequest));
|
|
66
|
+
return freezeSys(workflowDefinitionWithMethods);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
const wrapWorkflowDefinitionCollection = wrapCollection(wrapWorkflowDefinition);
|
|
72
|
+
|
|
73
|
+
export { WorkflowStepActionType, WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowStepPermissionType, createWorkflowDefinitionApi as default, wrapWorkflowDefinition, wrapWorkflowDefinitionCollection };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getUserAgentHeader } from 'contentful-sdk-core';
|
|
2
|
+
import { createAdapter } from './create-adapter.js';
|
|
3
|
+
import createClientApi from './create-contentful-api.js';
|
|
4
|
+
import { createPlainClient } from './plain/plain-client.js';
|
|
5
|
+
import * as index from './constants/editor-interface-defaults/index.js';
|
|
6
|
+
export { index as editorInterfaceDefaults };
|
|
7
|
+
export { asIterator } from './plain/as-iterator.js';
|
|
8
|
+
export { fetchAll } from './plain/pagination-helper.js';
|
|
9
|
+
export { isDraft, isPublished, isUpdated } from './plain/checks.js';
|
|
10
|
+
export { RestAdapter } from './adapters/REST/rest-adapter.js';
|
|
11
|
+
export { makeRequest } from './adapters/REST/make-request.js';
|
|
12
|
+
export { ScheduledActionReferenceFilters } from './common-types.js';
|
|
13
|
+
export { WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowStepPermissionType } from './entities/workflow-definition.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Contentful Management API SDK. Allows you to create instances of a client
|
|
17
|
+
* with access to the Contentful Content Management API.
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
function createClient(params, opts = {}) {
|
|
21
|
+
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
22
|
+
const userAgent = getUserAgentHeader(`${sdkMain}/${"12.0.0-beta.1"}`, params.application, params.integration, params.feature);
|
|
23
|
+
const adapter = createAdapter(Object.assign(Object.assign({}, params), { userAgent }));
|
|
24
|
+
// Parameters<?> and ReturnType<?> only return the types of the last overload
|
|
25
|
+
// https://github.com/microsoft/TypeScript/issues/26591
|
|
26
|
+
// @ts-expect-error
|
|
27
|
+
const makeRequest = (options) => adapter.makeRequest(Object.assign(Object.assign({}, options), { userAgent }));
|
|
28
|
+
if (opts.type === 'plain') {
|
|
29
|
+
return createPlainClient(makeRequest, opts.defaults);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return createClientApi(makeRequest);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { createClient };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { sleep } from './utils.js';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
const DEFAULT_MAX_RETRIES = 30;
|
|
5
|
+
const DEFAULT_INITIAL_DELAY_MS = 1000;
|
|
6
|
+
const DEFAULT_RETRY_INTERVAL_MS = 2000;
|
|
7
|
+
class AsyncActionProcessingError extends Error {
|
|
8
|
+
constructor(message, action) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.action = action;
|
|
11
|
+
this.name = this.constructor.name;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class AsyncActionFailedError extends AsyncActionProcessingError {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @description Waits for an Action to be completed and to be in one of the final states (failed or succeeded)
|
|
18
|
+
* @param {Function} actionFunction - GET function that will be called every interval to fetch an Action status
|
|
19
|
+
* @throws {ActionFailedError} throws an error if `throwOnFailedExecution = true` with the Action that failed.
|
|
20
|
+
* @throws {AsyncActionProcessingError} throws an error with a Action when processing takes too long.
|
|
21
|
+
*/
|
|
22
|
+
async function pollAsyncActionStatus(actionFunction, options) {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
let retryCount = 0;
|
|
25
|
+
let done = false;
|
|
26
|
+
let action;
|
|
27
|
+
const maxRetries = (_a = options === null || options === void 0 ? void 0 : options.retryCount) !== null && _a !== void 0 ? _a : DEFAULT_MAX_RETRIES;
|
|
28
|
+
const retryIntervalMs = (_b = options === null || options === void 0 ? void 0 : options.retryIntervalMs) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_INTERVAL_MS;
|
|
29
|
+
const initialDelayMs = (_c = options === null || options === void 0 ? void 0 : options.initialDelayMs) !== null && _c !== void 0 ? _c : DEFAULT_INITIAL_DELAY_MS;
|
|
30
|
+
const throwOnFailedExecution = (_d = options === null || options === void 0 ? void 0 : options.throwOnFailedExecution) !== null && _d !== void 0 ? _d : true;
|
|
31
|
+
// Initial delay for short-running Actions
|
|
32
|
+
await sleep(initialDelayMs);
|
|
33
|
+
while (retryCount < maxRetries && !done) {
|
|
34
|
+
action = await actionFunction();
|
|
35
|
+
// Terminal states
|
|
36
|
+
if (action && ['succeeded', 'failed'].includes(action.sys.status)) {
|
|
37
|
+
done = true;
|
|
38
|
+
if (action.sys.status === 'failed' && throwOnFailedExecution) {
|
|
39
|
+
throw new AsyncActionFailedError(`${action.sys.type} failed to execute.`, action);
|
|
40
|
+
}
|
|
41
|
+
return action;
|
|
42
|
+
}
|
|
43
|
+
await sleep(retryIntervalMs);
|
|
44
|
+
retryCount += 1;
|
|
45
|
+
}
|
|
46
|
+
throw new AsyncActionProcessingError(`${action === null || action === void 0 ? void 0 : action.sys.type} didn't finish processing within the expected timeframe.`, action);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { AsyncActionFailedError, AsyncActionProcessingError, pollAsyncActionStatus };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* @param id - unique ID of the field
|
|
6
|
+
* @param key - the attribute on the field to change
|
|
7
|
+
* @param value - the value to set the attribute to
|
|
8
|
+
*/
|
|
9
|
+
const findAndUpdateField = function (contentType, fieldId, omitOrDelete) {
|
|
10
|
+
const field = contentType.fields.find((field) => field.id === fieldId);
|
|
11
|
+
if (!field) {
|
|
12
|
+
return Promise.reject(new Error(`Tried to omitAndDeleteField on a nonexistent field, ${fieldId}, on the content type ${contentType.name}.`));
|
|
13
|
+
}
|
|
14
|
+
field[omitOrDelete] = true;
|
|
15
|
+
return Promise.resolve(contentType);
|
|
16
|
+
};
|
|
17
|
+
const omitAndDeleteField = (makeRequest, _a, contentType) => {
|
|
18
|
+
var { fieldId } = _a, params = __rest(_a, ["fieldId"]);
|
|
19
|
+
return findAndUpdateField(contentType, fieldId, 'omitted')
|
|
20
|
+
.then((newContentType) => {
|
|
21
|
+
return makeRequest({
|
|
22
|
+
entityType: 'ContentType',
|
|
23
|
+
action: 'update',
|
|
24
|
+
params,
|
|
25
|
+
payload: newContentType,
|
|
26
|
+
});
|
|
27
|
+
})
|
|
28
|
+
.then((newContentType) => {
|
|
29
|
+
return makeRequest({
|
|
30
|
+
entityType: 'ContentType',
|
|
31
|
+
action: 'publish',
|
|
32
|
+
params,
|
|
33
|
+
payload: newContentType,
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
.then((newContentType) => {
|
|
37
|
+
return findAndUpdateField(newContentType, fieldId, 'deleted');
|
|
38
|
+
})
|
|
39
|
+
.then((newContentType) => {
|
|
40
|
+
return makeRequest({
|
|
41
|
+
entityType: 'ContentType',
|
|
42
|
+
action: 'update',
|
|
43
|
+
params,
|
|
44
|
+
payload: newContentType,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { omitAndDeleteField };
|