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,29 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { get as get$1, post, put, del as del$1 } from './raw.js';
|
|
3
|
-
import { normalizeSelect } from './utils.js';
|
|
4
|
-
|
|
5
|
-
const getBaseUrl = (params) => `/organizations/${params.organizationId}/teams`;
|
|
6
|
-
const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.teamId}`;
|
|
7
|
-
const get = (http, params) => get$1(http, getEntityUrl(params));
|
|
8
|
-
const getMany = (http, params) => get$1(http, getBaseUrl(params), {
|
|
9
|
-
params: normalizeSelect(params.query),
|
|
10
|
-
});
|
|
11
|
-
const getManyForSpace = (http, params) => {
|
|
12
|
-
return get$1(http, `/spaces/${params.spaceId}/teams`, {
|
|
13
|
-
params: normalizeSelect(params.query),
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
const create = (http, params, rawData, headers) => {
|
|
17
|
-
return post(http, getBaseUrl(params), rawData, { headers });
|
|
18
|
-
};
|
|
19
|
-
const update = (http, params, rawData, headers) => {
|
|
20
|
-
var _a;
|
|
21
|
-
const data = copy(rawData);
|
|
22
|
-
delete data.sys;
|
|
23
|
-
return put(http, getEntityUrl(params), data, {
|
|
24
|
-
headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const del = (http, params) => del$1(http, getEntityUrl(params));
|
|
28
|
-
|
|
29
|
-
export { create, del, get, getMany, getManyForSpace, update };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { get as get$1, put } from './raw.js';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
|
|
4
|
-
const getUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/ui_config`;
|
|
5
|
-
const get = (http, params) => {
|
|
6
|
-
return get$1(http, getUrl(params));
|
|
7
|
-
};
|
|
8
|
-
const update = (http, params, rawData) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const data = copy(rawData);
|
|
11
|
-
delete data.sys;
|
|
12
|
-
return put(http, getUrl(params), data, {
|
|
13
|
-
headers: {
|
|
14
|
-
'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { get, update };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getUploadHttpClient } from '../../../upload-http-client.js';
|
|
2
|
-
import { post } from './raw.js';
|
|
3
|
-
|
|
4
|
-
const getBaseUrl = (params) => {
|
|
5
|
-
var _a;
|
|
6
|
-
return `/spaces/${params.spaceId}/environments/${(_a = params.environmentId) !== null && _a !== void 0 ? _a : 'master'}/upload_credentials`;
|
|
7
|
-
};
|
|
8
|
-
const create = (http, params) => {
|
|
9
|
-
const httpUpload = getUploadHttpClient(http);
|
|
10
|
-
const path = getBaseUrl(params);
|
|
11
|
-
return post(httpUpload, path);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { create };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getUploadHttpClient } from '../../../upload-http-client.js';
|
|
2
|
-
import { post, del as del$1, get as get$1 } from './raw.js';
|
|
3
|
-
|
|
4
|
-
const getBaseUploadUrl = (params) => {
|
|
5
|
-
const spacePath = `/spaces/${params.spaceId}/uploads`;
|
|
6
|
-
const environmentPath = `/spaces/${params.spaceId}/environments/${params.environmentId}/uploads`;
|
|
7
|
-
const path = params.environmentId ? environmentPath : spacePath;
|
|
8
|
-
return path;
|
|
9
|
-
};
|
|
10
|
-
const getEntityUploadUrl = (params) => {
|
|
11
|
-
const path = getBaseUploadUrl(params);
|
|
12
|
-
return path + `/${params.uploadId}`;
|
|
13
|
-
};
|
|
14
|
-
const create = (http, params, data) => {
|
|
15
|
-
const httpUpload = getUploadHttpClient(http);
|
|
16
|
-
const { file } = data;
|
|
17
|
-
if (!file) {
|
|
18
|
-
return Promise.reject(new Error('Unable to locate a file to upload.'));
|
|
19
|
-
}
|
|
20
|
-
const path = getBaseUploadUrl(params);
|
|
21
|
-
return post(httpUpload, path, file, {
|
|
22
|
-
headers: {
|
|
23
|
-
'Content-Type': 'application/octet-stream',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const del = (http, params) => {
|
|
28
|
-
const httpUpload = getUploadHttpClient(http);
|
|
29
|
-
const path = getEntityUploadUrl(params);
|
|
30
|
-
return del$1(httpUpload, path);
|
|
31
|
-
};
|
|
32
|
-
const get = (http, params) => {
|
|
33
|
-
const httpUpload = getUploadHttpClient(http);
|
|
34
|
-
const path = getEntityUploadUrl(params);
|
|
35
|
-
return get$1(httpUpload, path);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { create, del, get };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { get } from './raw.js';
|
|
2
|
-
|
|
3
|
-
const getManyForSpace = (http, params) => {
|
|
4
|
-
return get(http, `/organizations/${params.organizationId}/space_periodic_usages`, {
|
|
5
|
-
params: params.query,
|
|
6
|
-
});
|
|
7
|
-
};
|
|
8
|
-
const getManyForOrganization = (http, params) => {
|
|
9
|
-
return get(http, `/organizations/${params.organizationId}/organization_periodic_usages`, {
|
|
10
|
-
params: params.query,
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { getManyForOrganization, getManyForSpace };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { get as get$1, put } from './raw.js';
|
|
3
|
-
|
|
4
|
-
const getUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/ui_config/me`;
|
|
5
|
-
const get = (http, params) => {
|
|
6
|
-
return get$1(http, getUrl(params));
|
|
7
|
-
};
|
|
8
|
-
const update = (http, params, rawData) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const data = copy(rawData);
|
|
11
|
-
delete data.sys;
|
|
12
|
-
return put(http, getUrl(params), data, {
|
|
13
|
-
headers: {
|
|
14
|
-
'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { get, update };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { get } from './raw.js';
|
|
2
|
-
|
|
3
|
-
const getForSpace = (http, params) => {
|
|
4
|
-
return get(http, `/spaces/${params.spaceId}/users/${params.userId}`);
|
|
5
|
-
};
|
|
6
|
-
const getCurrent = (http, params) => get(http, `/users/me`, { params: params === null || params === void 0 ? void 0 : params.query });
|
|
7
|
-
const getManyForSpace = (http, params) => {
|
|
8
|
-
return get(http, `/spaces/${params.spaceId}/users`, {
|
|
9
|
-
params: params.query,
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
const getForOrganization = (http, params) => {
|
|
13
|
-
return get(http, `/organizations/${params.organizationId}/users/${params.userId}`);
|
|
14
|
-
};
|
|
15
|
-
const getManyForOrganization = (http, params) => {
|
|
16
|
-
return get(http, `/organizations/${params.organizationId}/users`, {
|
|
17
|
-
params: params.query,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { getCurrent, getForOrganization, getForSpace, getManyForOrganization, getManyForSpace };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
|
|
3
|
-
function normalizeSelect(query) {
|
|
4
|
-
if (query && query.select && !/sys/i.test(query.select)) {
|
|
5
|
-
return Object.assign(Object.assign({}, query), { select: query.select + ',sys' });
|
|
6
|
-
}
|
|
7
|
-
return query;
|
|
8
|
-
}
|
|
9
|
-
function normalizeSpaceId(query) {
|
|
10
|
-
if (query && query.spaceId) {
|
|
11
|
-
const { spaceId } = query, rest = __rest(query, ["spaceId"]);
|
|
12
|
-
return Object.assign(Object.assign({}, rest), { 'sys.space.sys.id[in]': spaceId });
|
|
13
|
-
}
|
|
14
|
-
return query;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { normalizeSelect, normalizeSpaceId };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { get as get$1, post, put, del as del$1 } from './raw.js';
|
|
3
|
-
import { normalizeSelect } from './utils.js';
|
|
4
|
-
|
|
5
|
-
const getBaseUrl = (params) => `/spaces/${params.spaceId}/webhook_definitions`;
|
|
6
|
-
const getWebhookCallBaseUrl = (params) => `/spaces/${params.spaceId}/webhooks`;
|
|
7
|
-
const getWebhookUrl = (params) => `${getBaseUrl(params)}/${params.webhookDefinitionId}`;
|
|
8
|
-
const getWebhookCallUrl = (params) => `${getWebhookCallBaseUrl(params)}/${params.webhookDefinitionId}/calls`;
|
|
9
|
-
const getWebhookCallDetailsUrl = (params) => `${getWebhookCallBaseUrl(params)}/${params.webhookDefinitionId}/calls/${params.callId}`;
|
|
10
|
-
const getWebhookHealthUrl = (params) => `${getWebhookCallBaseUrl(params)}/${params.webhookDefinitionId}/health`;
|
|
11
|
-
const getWebhookSettingsUrl = (params) => `/spaces/${params.spaceId}/webhook_settings`;
|
|
12
|
-
const getWebhookSigningSecretUrl = (params) => `${getWebhookSettingsUrl(params)}/signing_secret`;
|
|
13
|
-
const getWebhookRetryPolicyUrl = (params) => `${getWebhookSettingsUrl(params)}/retry_policy`;
|
|
14
|
-
const get = (http, params) => {
|
|
15
|
-
return get$1(http, getWebhookUrl(params));
|
|
16
|
-
};
|
|
17
|
-
const getManyCallDetails = (http, params) => {
|
|
18
|
-
return get$1(http, getWebhookCallUrl(params), {
|
|
19
|
-
params: normalizeSelect(params.query),
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const getCallDetails = (http, params) => {
|
|
23
|
-
return get$1(http, getWebhookCallDetailsUrl(params));
|
|
24
|
-
};
|
|
25
|
-
const getHealthStatus = (http, params) => {
|
|
26
|
-
return get$1(http, getWebhookHealthUrl(params));
|
|
27
|
-
};
|
|
28
|
-
const getMany = (http, params) => {
|
|
29
|
-
return get$1(http, getBaseUrl(params), {
|
|
30
|
-
params: normalizeSelect(params.query),
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
const getSigningSecret = (http, params) => {
|
|
34
|
-
return get$1(http, getWebhookSigningSecretUrl(params));
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
|
|
38
|
-
*/
|
|
39
|
-
const getRetryPolicy = (http, params) => {
|
|
40
|
-
return get$1(http, getWebhookRetryPolicyUrl(params));
|
|
41
|
-
};
|
|
42
|
-
const create = (http, params, rawData, headers) => {
|
|
43
|
-
const data = copy(rawData);
|
|
44
|
-
return post(http, getBaseUrl(params), data, { headers });
|
|
45
|
-
};
|
|
46
|
-
const createWithId = (http, params, rawData, headers) => {
|
|
47
|
-
const data = copy(rawData);
|
|
48
|
-
return put(http, getWebhookUrl(params), data, { headers });
|
|
49
|
-
};
|
|
50
|
-
const update = async (http, params, rawData, headers) => {
|
|
51
|
-
var _a;
|
|
52
|
-
const data = copy(rawData);
|
|
53
|
-
delete data.sys;
|
|
54
|
-
return put(http, getWebhookUrl(params), data, {
|
|
55
|
-
headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
const upsertSigningSecret = async (http, params, rawData) => {
|
|
59
|
-
const data = copy(rawData);
|
|
60
|
-
return put(http, getWebhookSigningSecretUrl(params), data);
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
|
|
64
|
-
*/
|
|
65
|
-
const upsertRetryPolicy = async (http, params, rawData) => {
|
|
66
|
-
const data = copy(rawData);
|
|
67
|
-
return put(http, getWebhookRetryPolicyUrl(params), data);
|
|
68
|
-
};
|
|
69
|
-
const del = (http, params) => {
|
|
70
|
-
return del$1(http, getWebhookUrl(params));
|
|
71
|
-
};
|
|
72
|
-
const deleteSigningSecret = async (http, params) => {
|
|
73
|
-
return del$1(http, getWebhookSigningSecretUrl(params));
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
|
|
77
|
-
*/
|
|
78
|
-
const deleteRetryPolicy = async (http, params) => {
|
|
79
|
-
return del$1(http, getWebhookRetryPolicyUrl(params));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export { create, createWithId, del, deleteRetryPolicy, deleteSigningSecret, get, getCallDetails, getHealthStatus, getMany, getManyCallDetails, getRetryPolicy, getSigningSecret, update, upsertRetryPolicy, upsertSigningSecret };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { get as get$1, post, put, del as del$1 } from './raw.js';
|
|
4
|
-
|
|
5
|
-
const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/workflow_definitions`;
|
|
6
|
-
const getWorkflowDefinitionUrl = (params) => `${getBaseUrl(params)}/${params.workflowDefinitionId}`;
|
|
7
|
-
const get = (http, params, headers) => get$1(http, getWorkflowDefinitionUrl(params), {
|
|
8
|
-
headers,
|
|
9
|
-
});
|
|
10
|
-
const getMany = (http, params, headers) => get$1(http, getBaseUrl(params), {
|
|
11
|
-
headers,
|
|
12
|
-
params: params.query,
|
|
13
|
-
});
|
|
14
|
-
const create = (http, params, rawData, headers) => {
|
|
15
|
-
const data = copy(rawData);
|
|
16
|
-
return post(http, getBaseUrl(params), data, {
|
|
17
|
-
headers,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const update = (http, params, rawData, headers) => {
|
|
21
|
-
var _a;
|
|
22
|
-
const data = copy(rawData);
|
|
23
|
-
delete data.sys;
|
|
24
|
-
return put(http, getWorkflowDefinitionUrl(params), data, {
|
|
25
|
-
headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
const del = (http, _a, headers) => {
|
|
29
|
-
var { version } = _a, params = __rest(_a, ["version"]);
|
|
30
|
-
return del$1(http, getWorkflowDefinitionUrl(params), {
|
|
31
|
-
headers: Object.assign({ 'X-Contentful-Version': version }, headers),
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export { create, del, get, getMany, update };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { get as get$1, post, put, del as del$1 } from './raw.js';
|
|
4
|
-
|
|
5
|
-
const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/workflows`;
|
|
6
|
-
const getWorkflowUrl = (params) => `${getBaseUrl(params)}/${params.workflowId}`;
|
|
7
|
-
const completeWorkflowUrl = (params) => `${getWorkflowUrl(params)}/complete`;
|
|
8
|
-
const getMany = (http, params, headers) => get$1(http, getBaseUrl(params), {
|
|
9
|
-
headers,
|
|
10
|
-
params: params.query,
|
|
11
|
-
});
|
|
12
|
-
const get = (http, params, headers) => get$1(http, getWorkflowUrl(params), {
|
|
13
|
-
headers,
|
|
14
|
-
});
|
|
15
|
-
const create = (http, params, rawData, headers) => {
|
|
16
|
-
const data = copy(rawData);
|
|
17
|
-
return post(http, getBaseUrl(params), data, {
|
|
18
|
-
headers,
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
const update = (http, params, rawData, headers) => {
|
|
22
|
-
var _a;
|
|
23
|
-
const data = copy(rawData);
|
|
24
|
-
delete data.sys;
|
|
25
|
-
return put(http, getWorkflowUrl(params), data, {
|
|
26
|
-
headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const del = (http, _a, headers) => {
|
|
30
|
-
var { version } = _a, params = __rest(_a, ["version"]);
|
|
31
|
-
return del$1(http, getWorkflowUrl(params), {
|
|
32
|
-
headers: Object.assign({ 'X-Contentful-Version': version }, headers),
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const complete = (http, _a, headers) => {
|
|
36
|
-
var { version } = _a, params = __rest(_a, ["version"]);
|
|
37
|
-
return put(http, completeWorkflowUrl(params), null, {
|
|
38
|
-
headers: Object.assign({ 'X-Contentful-Version': version }, headers),
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { complete, create, del, get, getMany, update };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { get } from './raw.js';
|
|
2
|
-
|
|
3
|
-
const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/workflows_changelog`;
|
|
4
|
-
const getMany = (http, params, headers) => get(http, getBaseUrl(params), {
|
|
5
|
-
headers,
|
|
6
|
-
params: params.query,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export { getMany };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import endpoints from './endpoints/index.js';
|
|
2
|
-
|
|
3
|
-
const makeRequest = async ({ axiosInstance, entityType, action: actionInput, params, payload, headers, userAgent, }) => {
|
|
4
|
-
var _a;
|
|
5
|
-
// `delete` is a reserved keyword. Therefore, the methods are called `del`.
|
|
6
|
-
const action = actionInput === 'delete' ? 'del' : actionInput;
|
|
7
|
-
const endpoint =
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
(_a = endpoints[entityType]) === null || _a === void 0 ? void 0 : _a[action];
|
|
11
|
-
if (endpoint === undefined) {
|
|
12
|
-
throw new Error('Unknown endpoint');
|
|
13
|
-
}
|
|
14
|
-
return await endpoint(axiosInstance, params, payload, Object.assign(Object.assign({}, headers), (userAgent ? { 'X-Contentful-User-Agent': userAgent } : {})));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { makeRequest };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { createHttpClient } from 'contentful-sdk-core';
|
|
3
|
-
import copy from 'fast-copy';
|
|
4
|
-
import { makeRequest } from './make-request.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
const defaultHostParameters = {
|
|
10
|
-
defaultHostname: 'api.contentful.com',
|
|
11
|
-
defaultHostnameUpload: 'upload.contentful.com',
|
|
12
|
-
};
|
|
13
|
-
class RestAdapter {
|
|
14
|
-
constructor(params) {
|
|
15
|
-
if (!params.accessToken) {
|
|
16
|
-
throw new TypeError('Expected parameter accessToken');
|
|
17
|
-
}
|
|
18
|
-
const copiedParams = copy(params);
|
|
19
|
-
// httpAgent and httpsAgent cannot be copied because they can contain private fields
|
|
20
|
-
copiedParams.httpAgent = params.httpAgent;
|
|
21
|
-
copiedParams.httpsAgent = params.httpsAgent;
|
|
22
|
-
this.params = Object.assign(Object.assign({}, defaultHostParameters), copiedParams);
|
|
23
|
-
this.axiosInstance = createHttpClient(axios, Object.assign(Object.assign({}, this.params), { headers: Object.assign(Object.assign({ 'Content-Type': 'application/vnd.contentful.management.v1+json' }, (params.userAgent ? { 'X-Contentful-User-Agent': params.userAgent } : {})), this.params.headers) }));
|
|
24
|
-
}
|
|
25
|
-
async makeRequest(opts) {
|
|
26
|
-
return makeRequest(Object.assign(Object.assign({}, opts), { axiosInstance: this.axiosInstance }));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { RestAdapter };
|
package/dist/esm/common-types.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var ScheduledActionReferenceFilters;
|
|
2
|
-
(function (ScheduledActionReferenceFilters) {
|
|
3
|
-
ScheduledActionReferenceFilters["contentTypeAnnotationNotIn"] = "sys.contentType.metadata.annotations.ContentType[nin]";
|
|
4
|
-
})(ScheduledActionReferenceFilters || (ScheduledActionReferenceFilters = {}));
|
|
5
|
-
|
|
6
|
-
export { ScheduledActionReferenceFilters };
|
package/dist/esm/common-utils.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { toPlainObject } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
const wrapCollection = (fn) => (makeRequest, data, ...rest) => {
|
|
9
|
-
const collectionData = toPlainObject(copy(data));
|
|
10
|
-
// @ts-expect-error
|
|
11
|
-
collectionData.items = collectionData.items.map((entity) => fn(makeRequest, entity, ...rest));
|
|
12
|
-
// @ts-expect-error
|
|
13
|
-
return collectionData;
|
|
14
|
-
};
|
|
15
|
-
const wrapCursorPaginatedCollection = (fn) => (makeRequest, data, ...rest) => {
|
|
16
|
-
const collectionData = toPlainObject(copy(data));
|
|
17
|
-
// @ts-expect-error
|
|
18
|
-
collectionData.items = collectionData.items.map((entity) => fn(makeRequest, entity, ...rest));
|
|
19
|
-
// @ts-expect-error
|
|
20
|
-
return collectionData;
|
|
21
|
-
};
|
|
22
|
-
function isSuccessful(statusCode) {
|
|
23
|
-
return statusCode < 300;
|
|
24
|
-
}
|
|
25
|
-
function shouldRePoll(statusCode) {
|
|
26
|
-
return [404, 422, 429, 400].includes(statusCode);
|
|
27
|
-
}
|
|
28
|
-
async function waitFor(ms = 1000) {
|
|
29
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { isSuccessful, shouldRePoll, waitFor, wrapCollection, wrapCursorPaginatedCollection };
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { in_ } from './types.js';
|
|
2
|
-
|
|
3
|
-
const DROPDOWN_TYPES = ['Text', 'Symbol', 'Integer', 'Number', 'Boolean'];
|
|
4
|
-
const INTERNAL_TO_API = {
|
|
5
|
-
Symbol: { type: 'Symbol' },
|
|
6
|
-
Text: { type: 'Text' },
|
|
7
|
-
RichText: { type: 'RichText' },
|
|
8
|
-
Integer: { type: 'Integer' },
|
|
9
|
-
Number: { type: 'Number' },
|
|
10
|
-
Boolean: { type: 'Boolean' },
|
|
11
|
-
Date: { type: 'Date' },
|
|
12
|
-
Location: { type: 'Location' },
|
|
13
|
-
Object: { type: 'Object' },
|
|
14
|
-
File: { type: 'File' },
|
|
15
|
-
Entry: { type: 'Link', linkType: 'Entry' },
|
|
16
|
-
Asset: { type: 'Link', linkType: 'Asset' },
|
|
17
|
-
Resource: { type: 'ResourceLink' },
|
|
18
|
-
Symbols: { type: 'Array', items: { type: 'Symbol' } },
|
|
19
|
-
Entries: { type: 'Array', items: { type: 'Link', linkType: 'Entry' } },
|
|
20
|
-
Assets: { type: 'Array', items: { type: 'Link', linkType: 'Asset' } },
|
|
21
|
-
Resources: { type: 'Array', items: { type: 'ResourceLink' } },
|
|
22
|
-
};
|
|
23
|
-
const FIELD_TYPES = Object.keys(INTERNAL_TO_API);
|
|
24
|
-
/**
|
|
25
|
-
* Returns an internal string identifier for an API field object.
|
|
26
|
-
*
|
|
27
|
-
* We use this string as a simplified reference to field types.
|
|
28
|
-
* Possible values are:
|
|
29
|
-
*
|
|
30
|
-
* - Symbol
|
|
31
|
-
* - Symbols
|
|
32
|
-
* - Text
|
|
33
|
-
* - RichText
|
|
34
|
-
* - Integer
|
|
35
|
-
* - Number
|
|
36
|
-
* - Boolean
|
|
37
|
-
* - Date
|
|
38
|
-
* - Location
|
|
39
|
-
* - Object
|
|
40
|
-
* - Entry
|
|
41
|
-
* - Entries
|
|
42
|
-
* - Asset
|
|
43
|
-
* - Assets
|
|
44
|
-
* - File
|
|
45
|
-
*/
|
|
46
|
-
function toInternalFieldType(api) {
|
|
47
|
-
return FIELD_TYPES.find((key) => {
|
|
48
|
-
const internalApi = INTERNAL_TO_API[key];
|
|
49
|
-
const stripped = {
|
|
50
|
-
type: api.type,
|
|
51
|
-
linkType: api.linkType,
|
|
52
|
-
items: api.items,
|
|
53
|
-
};
|
|
54
|
-
if (stripped.items) {
|
|
55
|
-
stripped.items = { type: stripped.items.type, linkType: stripped.items.linkType };
|
|
56
|
-
}
|
|
57
|
-
if (internalApi.type === 'Link') {
|
|
58
|
-
return internalApi.linkType === stripped.linkType;
|
|
59
|
-
}
|
|
60
|
-
if (internalApi.type === 'Array' && internalApi.items && stripped.items) {
|
|
61
|
-
if (internalApi.items.type === 'Link') {
|
|
62
|
-
return internalApi.items.linkType === stripped.items.linkType;
|
|
63
|
-
}
|
|
64
|
-
return internalApi.items.type === stripped.items.type;
|
|
65
|
-
}
|
|
66
|
-
return internalApi.type === stripped.type;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const DEFAULTS_WIDGET = {
|
|
70
|
-
Text: { widgetId: 'markdown' },
|
|
71
|
-
Symbol: { widgetId: 'singleLine' },
|
|
72
|
-
Integer: { widgetId: 'numberEditor' },
|
|
73
|
-
Number: { widgetId: 'numberEditor' },
|
|
74
|
-
Boolean: { widgetId: 'boolean' },
|
|
75
|
-
Date: { widgetId: 'datePicker' },
|
|
76
|
-
Location: { widgetId: 'locationEditor' },
|
|
77
|
-
Object: { widgetId: 'objectEditor' },
|
|
78
|
-
RichText: { widgetId: 'richTextEditor' },
|
|
79
|
-
Entry: { widgetId: 'entryLinkEditor' },
|
|
80
|
-
Asset: { widgetId: 'assetLinkEditor' },
|
|
81
|
-
Symbols: { widgetId: 'tagEditor' },
|
|
82
|
-
Entries: { widgetId: 'entryLinksEditor' },
|
|
83
|
-
Assets: { widgetId: 'assetLinksEditor' },
|
|
84
|
-
File: { widgetId: 'fileEditor' },
|
|
85
|
-
Resource: { widgetId: 'resourceLinkEditor' },
|
|
86
|
-
Resources: { widgetId: 'resourceLinksEditor' },
|
|
87
|
-
};
|
|
88
|
-
const DEFAULTS_SETTINGS = {
|
|
89
|
-
Boolean: {
|
|
90
|
-
falseLabel: 'No',
|
|
91
|
-
helpText: null,
|
|
92
|
-
trueLabel: 'Yes',
|
|
93
|
-
},
|
|
94
|
-
Date: {
|
|
95
|
-
helpText: null,
|
|
96
|
-
ampm: '24',
|
|
97
|
-
format: 'timeZ',
|
|
98
|
-
},
|
|
99
|
-
Entry: {
|
|
100
|
-
helpText: null,
|
|
101
|
-
showCreateEntityAction: true,
|
|
102
|
-
showLinkEntityAction: true,
|
|
103
|
-
},
|
|
104
|
-
Asset: {
|
|
105
|
-
helpText: null,
|
|
106
|
-
showCreateEntityAction: true,
|
|
107
|
-
showLinkEntityAction: true,
|
|
108
|
-
},
|
|
109
|
-
Entries: {
|
|
110
|
-
helpText: null,
|
|
111
|
-
bulkEditing: false,
|
|
112
|
-
showCreateEntityAction: true,
|
|
113
|
-
showLinkEntityAction: true,
|
|
114
|
-
},
|
|
115
|
-
Assets: {
|
|
116
|
-
helpText: null,
|
|
117
|
-
showCreateEntityAction: true,
|
|
118
|
-
showLinkEntityAction: true,
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
function getDefaultWidget(field, fieldId) {
|
|
122
|
-
const defaultWidget = Object.assign(Object.assign({}, DEFAULTS_WIDGET[field]), { settings: {
|
|
123
|
-
helpText: null,
|
|
124
|
-
}, widgetNamespace: 'builtin', fieldId });
|
|
125
|
-
if (in_(field, DEFAULTS_SETTINGS)) {
|
|
126
|
-
defaultWidget.settings = Object.assign(Object.assign({}, defaultWidget.settings), DEFAULTS_SETTINGS[field]);
|
|
127
|
-
}
|
|
128
|
-
return defaultWidget;
|
|
129
|
-
}
|
|
130
|
-
/*
|
|
131
|
-
* Gets the default widget ID for a field:
|
|
132
|
-
* - If a field allows predefined values then `dropdown` widget is used
|
|
133
|
-
* in the presence of the `in` validation.
|
|
134
|
-
* - If a Text field is a title then the `singleLine` widget is used.
|
|
135
|
-
* - Otherwise a simple type-to-editor mapping is used.
|
|
136
|
-
*/
|
|
137
|
-
function getDefaultControlOfField(field) {
|
|
138
|
-
const fieldType = toInternalFieldType(field);
|
|
139
|
-
if (!fieldType) {
|
|
140
|
-
throw new Error('Invalid field type');
|
|
141
|
-
}
|
|
142
|
-
const hasInValidation = (field.validations || []).find((v) => 'in' in v);
|
|
143
|
-
if (hasInValidation && DROPDOWN_TYPES.includes(fieldType)) {
|
|
144
|
-
return {
|
|
145
|
-
widgetId: 'dropdown',
|
|
146
|
-
fieldId: field.id,
|
|
147
|
-
widgetNamespace: 'builtin',
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return getDefaultWidget(fieldType, field.id);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export { DEFAULTS_SETTINGS, DEFAULTS_WIDGET, FIELD_TYPES, getDefaultControlOfField as default, toInternalFieldType };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { WidgetNamespace, DEFAULT_EDITOR_ID } from './types.js';
|
|
2
|
-
|
|
3
|
-
const EntryEditorWidgetTypes = {
|
|
4
|
-
DEFAULT_EDITOR: {
|
|
5
|
-
name: 'Editor',
|
|
6
|
-
id: DEFAULT_EDITOR_ID,
|
|
7
|
-
icon: 'Entry',
|
|
8
|
-
},
|
|
9
|
-
REFERENCE_TREE: {
|
|
10
|
-
name: 'References',
|
|
11
|
-
id: 'reference-tree',
|
|
12
|
-
icon: 'References',
|
|
13
|
-
},
|
|
14
|
-
TAGS_EDITOR: {
|
|
15
|
-
name: 'Tags',
|
|
16
|
-
id: 'tags-editor',
|
|
17
|
-
icon: 'Tags',
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const DefaultEntryEditor = {
|
|
21
|
-
widgetId: EntryEditorWidgetTypes.DEFAULT_EDITOR.id,
|
|
22
|
-
widgetNamespace: WidgetNamespace.EDITOR_BUILTIN,
|
|
23
|
-
name: EntryEditorWidgetTypes.DEFAULT_EDITOR.name,
|
|
24
|
-
};
|
|
25
|
-
const ReferencesEntryEditor = {
|
|
26
|
-
widgetId: EntryEditorWidgetTypes.REFERENCE_TREE.id,
|
|
27
|
-
widgetNamespace: WidgetNamespace.EDITOR_BUILTIN,
|
|
28
|
-
name: EntryEditorWidgetTypes.REFERENCE_TREE.name,
|
|
29
|
-
};
|
|
30
|
-
const TagsEditor = {
|
|
31
|
-
widgetId: EntryEditorWidgetTypes.TAGS_EDITOR.id,
|
|
32
|
-
widgetNamespace: WidgetNamespace.EDITOR_BUILTIN,
|
|
33
|
-
name: EntryEditorWidgetTypes.TAGS_EDITOR.name,
|
|
34
|
-
};
|
|
35
|
-
const EntryConfiguration = [DefaultEntryEditor, ReferencesEntryEditor, TagsEditor];
|
|
36
|
-
|
|
37
|
-
export { EntryConfiguration, EntryEditorWidgetTypes };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SidebarEntryConfiguration, SidebarAssetConfiguration } from './sidebar-defaults.js';
|
|
2
|
-
import { EntryConfiguration } from './editors-defaults.js';
|
|
3
|
-
import getDefaultControlOfField from './controls-defaults.js';
|
|
4
|
-
|
|
5
|
-
var index = {
|
|
6
|
-
SidebarEntryConfiguration,
|
|
7
|
-
SidebarAssetConfiguration,
|
|
8
|
-
EntryConfiguration,
|
|
9
|
-
getDefaultControlOfField,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { index as default };
|