contentful-management 11.44.0 → 11.45.0-beta.2
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 +72 -47
- package/dist/contentful-management.browser.js +23103 -27220
- package/dist/contentful-management.browser.min.js +1 -2
- package/dist/contentful-management.cjs +36200 -0
- package/dist/{es-modules → esm}/adapters/REST/endpoints/access-token.js +20 -22
- 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 +40 -0
- package/dist/esm/adapters/REST/endpoints/concept.js +59 -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 +131 -0
- package/dist/esm/adapters/REST/endpoints/locale.js +31 -0
- 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/rest-adapter.js +40 -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 +512 -0
- package/dist/esm/create-entry-api.js +479 -0
- package/dist/esm/create-environment-api.js +2337 -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 +1436 -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/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/esm/entities/function-log.js +23 -0
- package/dist/esm/entities/function.js +63 -0
- package/dist/esm/entities/index.js +123 -0
- package/dist/esm/entities/locale.js +54 -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 +35 -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 +496 -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/types/adapters/REST/endpoints/function-log.d.ts +3 -0
- package/dist/{typings → types}/adapters/REST/endpoints/index.d.ts +2 -0
- package/dist/{typings → types}/common-types.d.ts +50 -2
- package/dist/{typings → types}/create-contentful-api.d.ts +1 -0
- package/dist/{typings → types}/create-environment-api.d.ts +80 -3
- package/dist/{typings → types}/create-organization-api.d.ts +29 -1
- 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/types/entities/function-log.d.ts +46 -0
- package/dist/{typings → types}/entities/function.d.ts +2 -10
- package/dist/{typings → types}/entities/index.d.ts +2 -0
- package/dist/{typings → types}/entities/ui-config.d.ts +1 -1
- package/dist/{typings → types}/entities/user-ui-config.d.ts +1 -1
- package/dist/{typings/contentful-management.d.ts → types/index.d.ts} +1 -1
- package/dist/{typings → types}/plain/common-types.d.ts +5 -2
- package/dist/types/plain/entities/function-log.d.ts +39 -0
- package/dist/{typings → types}/plain/entities/function.d.ts +5 -3
- package/package.json +52 -44
- package/dist/contentful-management.browser.js.map +0 -1
- package/dist/contentful-management.node.js +0 -31428
- 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/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.js +0 -16
- package/dist/es-modules/adapters/REST/endpoints/http.js +0 -39
- package/dist/es-modules/adapters/REST/endpoints/index.js +0 -126
- 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/rest-adapter.js +0 -58
- package/dist/es-modules/adapters/REST/types.js +0 -1
- package/dist/es-modules/common-types.js +0 -50
- 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 -65
- 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 -576
- package/dist/es-modules/create-entry-api.js +0 -548
- package/dist/es-modules/create-environment-api.js +0 -2335
- package/dist/es-modules/create-environment-template-api.js +0 -316
- package/dist/es-modules/create-function-api.js +0 -115
- package/dist/es-modules/create-organization-api.js +0 -1252
- package/dist/es-modules/create-space-api.js +0 -1565
- 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/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 -44
- 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 -24
- package/dist/es-modules/entities/index.js +0 -118
- package/dist/es-modules/entities/locale.js +0 -53
- 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/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.js +0 -1
- package/dist/es-modules/plain/entities/locale.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 -520
- 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/create-function-api.d.ts +0 -78
- /package/dist/{typings → types}/adapters/REST/endpoints/access-token.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/concept-scheme.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/concept.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.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/http.d.ts +0 -0
- /package/dist/{typings → types}/adapters/REST/endpoints/locale.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/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/access-token.d.ts +0 -0
- /package/dist/{typings → types}/entities/api-key.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-access-token.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-action-call.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-bundle.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-definition.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-details.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-event-subscription.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-installation.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-key.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-signed-request.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-signing-secret.d.ts +0 -0
- /package/dist/{typings → types}/entities/app-upload.d.ts +0 -0
- /package/dist/{typings → types}/entities/asset-key.d.ts +0 -0
- /package/dist/{typings → types}/entities/asset.d.ts +0 -0
- /package/dist/{typings → types}/entities/bulk-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/comment.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/content-type.d.ts +0 -0
- /package/dist/{typings → types}/entities/editor-interface.d.ts +0 -0
- /package/dist/{typings → types}/entities/entry.d.ts +0 -0
- /package/dist/{typings → types}/entities/environment-alias.d.ts +0 -0
- /package/dist/{typings → types}/entities/environment-template-installation.d.ts +0 -0
- /package/dist/{typings → types}/entities/environment-template.d.ts +0 -0
- /package/dist/{typings → types}/entities/environment.d.ts +0 -0
- /package/dist/{typings → types}/entities/extension.d.ts +0 -0
- /package/dist/{typings → types}/entities/field-type.d.ts +0 -0
- /package/dist/{typings → types}/entities/locale.d.ts +0 -0
- /package/dist/{typings → types}/entities/organization-invitation.d.ts +0 -0
- /package/dist/{typings → types}/entities/organization-membership.d.ts +0 -0
- /package/dist/{typings → types}/entities/organization.d.ts +0 -0
- /package/dist/{typings → types}/entities/personal-access-token.d.ts +0 -0
- /package/dist/{typings → types}/entities/preview-api-key.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/resource-provider.d.ts +0 -0
- /package/dist/{typings → types}/entities/resource-type.d.ts +0 -0
- /package/dist/{typings → types}/entities/resource.d.ts +0 -0
- /package/dist/{typings → types}/entities/role.d.ts +0 -0
- /package/dist/{typings → types}/entities/scheduled-action.d.ts +0 -0
- /package/dist/{typings → types}/entities/snapshot.d.ts +0 -0
- /package/dist/{typings → types}/entities/space-member.d.ts +0 -0
- /package/dist/{typings → types}/entities/space-membership.d.ts +0 -0
- /package/dist/{typings → types}/entities/space.d.ts +0 -0
- /package/dist/{typings → types}/entities/tag.d.ts +0 -0
- /package/dist/{typings → types}/entities/task.d.ts +0 -0
- /package/dist/{typings → types}/entities/team-membership.d.ts +0 -0
- /package/dist/{typings → types}/entities/team-space-membership.d.ts +0 -0
- /package/dist/{typings → types}/entities/team.d.ts +0 -0
- /package/dist/{typings → types}/entities/upload-credential.d.ts +0 -0
- /package/dist/{typings → types}/entities/upload.d.ts +0 -0
- /package/dist/{typings → types}/entities/usage.d.ts +0 -0
- /package/dist/{typings → types}/entities/user.d.ts +0 -0
- /package/dist/{typings → types}/entities/utils.d.ts +0 -0
- /package/dist/{typings → types}/entities/webhook.d.ts +0 -0
- /package/dist/{typings → types}/entities/widget-parameters.d.ts +0 -0
- /package/dist/{typings → types}/entities/workflow-definition.d.ts +0 -0
- /package/dist/{typings → types}/entities/workflow.d.ts +0 -0
- /package/dist/{typings → types}/entities/workflows-changelog-entry.d.ts +0 -0
- /package/dist/{typings → types}/export-types.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/checks.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/concept-scheme.d.ts +0 -0
- /package/dist/{typings → types}/plain/entities/concept.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/locale.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-credential.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
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils';
|
|
4
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
5
|
-
import createFunctionApi from '../create-function-api';
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
* @param makeRequest - (real) function to make requests via an adapter
|
|
9
|
-
* @param data - raw contentful-Function data
|
|
10
|
-
* @return Wrapped Function data
|
|
11
|
-
*/
|
|
12
|
-
export function wrapFunction(makeRequest, data) {
|
|
13
|
-
const appAction = toPlainObject(copy(data));
|
|
14
|
-
const appActionWithMethods = enhanceWithMethods(appAction, createFunctionApi(makeRequest));
|
|
15
|
-
return freezeSys(appActionWithMethods);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @private
|
|
20
|
-
* @param makeRequest - real) function to make requests via an adapter
|
|
21
|
-
* @param data - raw contentful-function data
|
|
22
|
-
* @return Wrapped App Function collection data
|
|
23
|
-
*/
|
|
24
|
-
export const wrapFunctionCollection = wrapCollection(wrapFunction);
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as apiKey from './api-key';
|
|
2
|
-
import * as appAction from './app-action';
|
|
3
|
-
import * as appActionCall from './app-action-call';
|
|
4
|
-
import * as appBundle from './app-bundle';
|
|
5
|
-
import * as appDefinition from './app-definition';
|
|
6
|
-
import * as appDetails from './app-details';
|
|
7
|
-
import * as appInstallation from './app-installation';
|
|
8
|
-
import * as appSignedRequest from './app-signed-request';
|
|
9
|
-
import * as appSigningSecret from './app-signing-secret';
|
|
10
|
-
import * as appEventSubscription from './app-event-subscription';
|
|
11
|
-
import * as appKey from './app-key';
|
|
12
|
-
import * as appAccessToken from './app-access-token';
|
|
13
|
-
import * as appUpload from './app-upload';
|
|
14
|
-
import * as asset from './asset';
|
|
15
|
-
import * as assetKey from './asset-key';
|
|
16
|
-
import * as bulkAction from './bulk-action';
|
|
17
|
-
import * as comment from './comment';
|
|
18
|
-
import * as contentType from './content-type';
|
|
19
|
-
import * as editorInterface from './editor-interface';
|
|
20
|
-
import * as entry from './entry';
|
|
21
|
-
import * as environment from './environment';
|
|
22
|
-
import * as environmentAlias from './environment-alias';
|
|
23
|
-
import * as environmentTemplate from './environment-template';
|
|
24
|
-
import * as environmentTemplateInstallation from './environment-template-installation';
|
|
25
|
-
import * as extension from './extension';
|
|
26
|
-
import * as func from './function';
|
|
27
|
-
import * as locale from './locale';
|
|
28
|
-
import * as organization from './organization';
|
|
29
|
-
import * as organizationInvitation from './organization-invitation';
|
|
30
|
-
import * as organizationMembership from './organization-membership';
|
|
31
|
-
import * as personalAccessToken from './personal-access-token';
|
|
32
|
-
import * as accessToken from './access-token';
|
|
33
|
-
import * as previewApiKey from './preview-api-key';
|
|
34
|
-
import * as release from './release';
|
|
35
|
-
import * as releaseAction from './release-action';
|
|
36
|
-
import * as role from './role';
|
|
37
|
-
import * as scheduledAction from './scheduled-action';
|
|
38
|
-
import * as snapshot from './snapshot';
|
|
39
|
-
import * as space from './space';
|
|
40
|
-
import * as spaceMember from './space-member';
|
|
41
|
-
import * as spaceMembership from './space-membership';
|
|
42
|
-
import * as tag from './tag';
|
|
43
|
-
import * as task from './task';
|
|
44
|
-
import * as team from './team';
|
|
45
|
-
import * as teamMembership from './team-membership';
|
|
46
|
-
import * as teamSpaceMembership from './team-space-membership';
|
|
47
|
-
import * as uiConfig from './ui-config';
|
|
48
|
-
import * as upload from './upload';
|
|
49
|
-
import * as usage from './usage';
|
|
50
|
-
import * as user from './user';
|
|
51
|
-
import * as userUIConfig from './user-ui-config';
|
|
52
|
-
import * as webhook from './webhook';
|
|
53
|
-
import * as workflowDefinition from './workflow-definition';
|
|
54
|
-
import * as concept from './concept';
|
|
55
|
-
import * as conceptScheme from './concept-scheme';
|
|
56
|
-
import * as resourceProvider from './resource-provider';
|
|
57
|
-
import * as resourceType from './resource-type';
|
|
58
|
-
import * as resource from './resource';
|
|
59
|
-
export default {
|
|
60
|
-
accessToken,
|
|
61
|
-
appAction,
|
|
62
|
-
appActionCall,
|
|
63
|
-
appBundle,
|
|
64
|
-
apiKey,
|
|
65
|
-
appDefinition,
|
|
66
|
-
appInstallation,
|
|
67
|
-
appUpload,
|
|
68
|
-
appDetails,
|
|
69
|
-
appSignedRequest,
|
|
70
|
-
appSigningSecret,
|
|
71
|
-
appEventSubscription,
|
|
72
|
-
appKey,
|
|
73
|
-
appAccessToken,
|
|
74
|
-
asset,
|
|
75
|
-
assetKey,
|
|
76
|
-
bulkAction,
|
|
77
|
-
comment,
|
|
78
|
-
concept,
|
|
79
|
-
conceptScheme,
|
|
80
|
-
contentType,
|
|
81
|
-
editorInterface,
|
|
82
|
-
entry,
|
|
83
|
-
environment,
|
|
84
|
-
environmentAlias,
|
|
85
|
-
environmentTemplate,
|
|
86
|
-
environmentTemplateInstallation,
|
|
87
|
-
extension,
|
|
88
|
-
func,
|
|
89
|
-
locale,
|
|
90
|
-
organization,
|
|
91
|
-
organizationInvitation,
|
|
92
|
-
organizationMembership,
|
|
93
|
-
personalAccessToken,
|
|
94
|
-
previewApiKey,
|
|
95
|
-
release,
|
|
96
|
-
releaseAction,
|
|
97
|
-
resourceProvider,
|
|
98
|
-
resourceType,
|
|
99
|
-
resource,
|
|
100
|
-
role,
|
|
101
|
-
scheduledAction,
|
|
102
|
-
snapshot,
|
|
103
|
-
space,
|
|
104
|
-
spaceMember,
|
|
105
|
-
spaceMembership,
|
|
106
|
-
tag,
|
|
107
|
-
task,
|
|
108
|
-
team,
|
|
109
|
-
teamMembership,
|
|
110
|
-
teamSpaceMembership,
|
|
111
|
-
uiConfig,
|
|
112
|
-
upload,
|
|
113
|
-
usage,
|
|
114
|
-
user,
|
|
115
|
-
userUIConfig,
|
|
116
|
-
webhook,
|
|
117
|
-
workflowDefinition
|
|
118
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
|
-
import { wrapCollection } from '../common-utils';
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
function createLocaleApi(makeRequest) {
|
|
9
|
-
const getParams = locale => ({
|
|
10
|
-
spaceId: locale.sys.space.sys.id,
|
|
11
|
-
environmentId: locale.sys.environment.sys.id,
|
|
12
|
-
localeId: locale.sys.id
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
update: function () {
|
|
16
|
-
const raw = this.toPlainObject();
|
|
17
|
-
return makeRequest({
|
|
18
|
-
entityType: 'Locale',
|
|
19
|
-
action: 'update',
|
|
20
|
-
params: getParams(raw),
|
|
21
|
-
payload: raw
|
|
22
|
-
}).then(data => wrapLocale(makeRequest, data));
|
|
23
|
-
},
|
|
24
|
-
delete: function () {
|
|
25
|
-
const raw = this.toPlainObject();
|
|
26
|
-
return makeRequest({
|
|
27
|
-
entityType: 'Locale',
|
|
28
|
-
action: 'delete',
|
|
29
|
-
params: getParams(raw)
|
|
30
|
-
}).then(() => {
|
|
31
|
-
// noop
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @private
|
|
39
|
-
* @param makeRequest - function to make requests via an adapter
|
|
40
|
-
* @param data - Raw locale data
|
|
41
|
-
* @return Wrapped locale data
|
|
42
|
-
*/
|
|
43
|
-
export function wrapLocale(makeRequest, data) {
|
|
44
|
-
delete data.internal_code;
|
|
45
|
-
const locale = toPlainObject(copy(data));
|
|
46
|
-
const localeWithMethods = enhanceWithMethods(locale, createLocaleApi(makeRequest));
|
|
47
|
-
return freezeSys(localeWithMethods);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
export const wrapLocaleCollection = wrapCollection(wrapLocale);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
/**
|
|
4
|
-
* @private
|
|
5
|
-
* @param makeRequest - function to make requests via an adapter
|
|
6
|
-
* @param data - Raw invitation data
|
|
7
|
-
* @return {OrganizationInvitation} Wrapped Inviation data
|
|
8
|
-
*/
|
|
9
|
-
export function wrapOrganizationInvitation(_makeRequest, data) {
|
|
10
|
-
const invitation = toPlainObject(copy(data));
|
|
11
|
-
return freezeSys(invitation);
|
|
12
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
|
-
import { wrapCollection } from '../common-utils';
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
function createOrganizationMembershipApi(makeRequest, organizationId) {
|
|
9
|
-
const getParams = data => ({
|
|
10
|
-
organizationMembershipId: data.sys.id,
|
|
11
|
-
organizationId
|
|
12
|
-
});
|
|
13
|
-
return {
|
|
14
|
-
update: function () {
|
|
15
|
-
const raw = this.toPlainObject();
|
|
16
|
-
return makeRequest({
|
|
17
|
-
entityType: 'OrganizationMembership',
|
|
18
|
-
action: 'update',
|
|
19
|
-
params: getParams(raw),
|
|
20
|
-
payload: raw
|
|
21
|
-
}).then(data => wrapOrganizationMembership(makeRequest, data, organizationId));
|
|
22
|
-
},
|
|
23
|
-
delete: function del() {
|
|
24
|
-
const raw = this.toPlainObject();
|
|
25
|
-
return makeRequest({
|
|
26
|
-
entityType: 'OrganizationMembership',
|
|
27
|
-
action: 'delete',
|
|
28
|
-
params: getParams(raw)
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
* @param {function} makeRequest - function to make requests via an adapter
|
|
37
|
-
* @param {Object} data - Raw organization membership data
|
|
38
|
-
* @return {OrganizationMembership} Wrapped organization membership data
|
|
39
|
-
*/
|
|
40
|
-
export function wrapOrganizationMembership(makeRequest, data, organizationId) {
|
|
41
|
-
const organizationMembership = toPlainObject(copy(data));
|
|
42
|
-
const organizationMembershipWithMethods = enhanceWithMethods(organizationMembership, createOrganizationMembershipApi(makeRequest, organizationId));
|
|
43
|
-
return freezeSys(organizationMembershipWithMethods);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
export const wrapOrganizationMembershipCollection = wrapCollection(wrapOrganizationMembership);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
|
-
import createOrganizationApi from '../create-organization-api';
|
|
5
|
-
import { wrapCollection } from '../common-utils';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use `OrganizationProps` instead.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* This method creates the API for the given organization with all the methods for
|
|
13
|
-
* reading and creating other entities. It also passes down a clone of the
|
|
14
|
-
* http client with an organization id, so the base path for requests now has the
|
|
15
|
-
* organization id already set.
|
|
16
|
-
* @private
|
|
17
|
-
* @param makeRequest - function to make requests via an adapter
|
|
18
|
-
* @param data - API response for an Organization
|
|
19
|
-
* @return {Organization}
|
|
20
|
-
*/
|
|
21
|
-
export function wrapOrganization(makeRequest, data) {
|
|
22
|
-
const org = toPlainObject(copy(data));
|
|
23
|
-
const orgApi = createOrganizationApi(makeRequest);
|
|
24
|
-
const enhancedOrganization = enhanceWithMethods(org, orgApi);
|
|
25
|
-
return freezeSys(enhancedOrganization);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* This method normalizes each organization in a collection.
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
export const wrapOrganizationCollection = wrapCollection(wrapOrganization);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import copy from 'fast-copy';
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
|
-
import { wrapCollection } from '../common-utils';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use `PersonalAccessTokenProps` instead.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @private
|
|
12
|
-
* @param makeRequest - function to make requests via an adapter
|
|
13
|
-
* @param data - Raw personal access token data
|
|
14
|
-
* @return Wrapped personal access token
|
|
15
|
-
*/
|
|
16
|
-
export function wrapPersonalAccessToken(makeRequest, data) {
|
|
17
|
-
const personalAccessToken = toPlainObject(copy(data));
|
|
18
|
-
const personalAccessTokenWithMethods = enhanceWithMethods(personalAccessToken, {
|
|
19
|
-
revoke: function () {
|
|
20
|
-
return makeRequest({
|
|
21
|
-
entityType: 'PersonalAccessToken',
|
|
22
|
-
action: 'revoke',
|
|
23
|
-
params: {
|
|
24
|
-
tokenId: data.sys.id
|
|
25
|
-
}
|
|
26
|
-
}).then(data => wrapPersonalAccessToken(makeRequest, data));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return freezeSys(personalAccessTokenWithMethods);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @private
|
|
34
|
-
* @param makeRequest - function to make requests via an adapter
|
|
35
|
-
* @param data - Raw personal access collection data
|
|
36
|
-
* @return Wrapped personal access token collection data
|
|
37
|
-
*/
|
|
38
|
-
export const wrapPersonalAccessTokenCollection = wrapCollection(wrapPersonalAccessToken);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import { wrapCollection } from '../common-utils';
|
|
4
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
function createPreviewApiKeyApi() {
|
|
9
|
-
return {};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* @param makeRequest - function to make requests via an adapter
|
|
15
|
-
* @param data - Raw api key data
|
|
16
|
-
* @return Wrapped preview api key data
|
|
17
|
-
*/
|
|
18
|
-
export function wrapPreviewApiKey(_makeRequest, data) {
|
|
19
|
-
const previewApiKey = toPlainObject(copy(data));
|
|
20
|
-
const previewApiKeyWithMethods = enhanceWithMethods(previewApiKey, createPreviewApiKeyApi());
|
|
21
|
-
return freezeSys(previewApiKeyWithMethods);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
export const wrapPreviewApiKeyCollection = wrapCollection(wrapPreviewApiKey);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import copy from 'fast-copy';
|
|
4
|
-
import { wrapCollection } from '../common-utils';
|
|
5
|
-
import { pollAsyncActionStatus } from '../methods/action';
|
|
6
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
7
|
-
|
|
8
|
-
/** The object returned by the Releases API */
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
function createReleaseActionApi(makeRequest) {
|
|
14
|
-
const getParams = self => {
|
|
15
|
-
const action = self.toPlainObject();
|
|
16
|
-
return {
|
|
17
|
-
spaceId: action.sys.space.sys.id,
|
|
18
|
-
environmentId: action.sys.environment.sys.id,
|
|
19
|
-
releaseId: action.sys.release.sys.id,
|
|
20
|
-
actionId: action.sys.id
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
return {
|
|
24
|
-
async get() {
|
|
25
|
-
const params = getParams(this);
|
|
26
|
-
return makeRequest({
|
|
27
|
-
entityType: 'ReleaseAction',
|
|
28
|
-
action: 'get',
|
|
29
|
-
params
|
|
30
|
-
}).then(releaseAction => wrapReleaseAction(makeRequest, releaseAction));
|
|
31
|
-
},
|
|
32
|
-
/** Waits for a Release Action to complete */
|
|
33
|
-
async waitProcessing(options) {
|
|
34
|
-
return pollAsyncActionStatus(async () => this.get(), options);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
* @param makeRequest - function to make requests via an adapter
|
|
41
|
-
* @param data - Raw Release data
|
|
42
|
-
* @return Wrapped Release data
|
|
43
|
-
*/
|
|
44
|
-
export function wrapReleaseAction(makeRequest, data) {
|
|
45
|
-
const releaseAction = toPlainObject(copy(data));
|
|
46
|
-
const releaseActionWithApiMethods = enhanceWithMethods(releaseAction, createReleaseActionApi(makeRequest));
|
|
47
|
-
return freezeSys(releaseActionWithApiMethods);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
export const wrapReleaseActionCollection = wrapCollection(wrapReleaseAction);
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
3
|
-
import copy from 'fast-copy';
|
|
4
|
-
import { ScheduledActionReferenceFilters } from '../common-types';
|
|
5
|
-
import { wrapCursorPaginatedCollection } from '../common-utils';
|
|
6
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
7
|
-
import { wrapReleaseAction } from './release-action';
|
|
8
|
-
|
|
9
|
-
/** Entity types supported by the Release API */
|
|
10
|
-
|
|
11
|
-
export const ReleaseReferenceFilters = ScheduledActionReferenceFilters;
|
|
12
|
-
|
|
13
|
-
/** The object returned by the Releases API */
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
function createReleaseApi(makeRequest) {
|
|
19
|
-
const getParams = self => {
|
|
20
|
-
const release = self.toPlainObject();
|
|
21
|
-
return {
|
|
22
|
-
spaceId: release.sys.space.sys.id,
|
|
23
|
-
environmentId: release.sys.environment.sys.id,
|
|
24
|
-
releaseId: release.sys.id,
|
|
25
|
-
version: release.sys.version
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
async archive() {
|
|
30
|
-
const params = getParams(this);
|
|
31
|
-
return makeRequest({
|
|
32
|
-
entityType: 'Release',
|
|
33
|
-
action: 'archive',
|
|
34
|
-
params
|
|
35
|
-
}).then(release => wrapRelease(makeRequest, release));
|
|
36
|
-
},
|
|
37
|
-
async unarchive() {
|
|
38
|
-
const params = getParams(this);
|
|
39
|
-
return makeRequest({
|
|
40
|
-
entityType: 'Release',
|
|
41
|
-
action: 'unarchive',
|
|
42
|
-
params
|
|
43
|
-
}).then(release => wrapRelease(makeRequest, release));
|
|
44
|
-
},
|
|
45
|
-
async update(payload) {
|
|
46
|
-
const params = getParams(this);
|
|
47
|
-
return makeRequest({
|
|
48
|
-
entityType: 'Release',
|
|
49
|
-
action: 'update',
|
|
50
|
-
params,
|
|
51
|
-
payload
|
|
52
|
-
}).then(release => wrapRelease(makeRequest, release));
|
|
53
|
-
},
|
|
54
|
-
async delete() {
|
|
55
|
-
const params = getParams(this);
|
|
56
|
-
await makeRequest({
|
|
57
|
-
entityType: 'Release',
|
|
58
|
-
action: 'delete',
|
|
59
|
-
params
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
async publish(options) {
|
|
63
|
-
const params = getParams(this);
|
|
64
|
-
return makeRequest({
|
|
65
|
-
entityType: 'Release',
|
|
66
|
-
action: 'publish',
|
|
67
|
-
params
|
|
68
|
-
}).then(data => wrapReleaseAction(makeRequest, data)).then(action => action.waitProcessing(options));
|
|
69
|
-
},
|
|
70
|
-
async unpublish(options) {
|
|
71
|
-
const params = getParams(this);
|
|
72
|
-
return makeRequest({
|
|
73
|
-
entityType: 'Release',
|
|
74
|
-
action: 'unpublish',
|
|
75
|
-
params
|
|
76
|
-
}).then(data => wrapReleaseAction(makeRequest, data)).then(action => action.waitProcessing(options));
|
|
77
|
-
},
|
|
78
|
-
async validate(options) {
|
|
79
|
-
const params = getParams(this);
|
|
80
|
-
return makeRequest({
|
|
81
|
-
entityType: 'Release',
|
|
82
|
-
action: 'validate',
|
|
83
|
-
params,
|
|
84
|
-
payload: options === null || options === void 0 ? void 0 : options.payload
|
|
85
|
-
}).then(data => wrapReleaseAction(makeRequest, data)).then(action => action.waitProcessing(options === null || options === void 0 ? void 0 : options.processingOptions));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Return a Release object enhanced with its own API helper functions.
|
|
91
|
-
* @private
|
|
92
|
-
* @param makeRequest - function to make requests via an adapter
|
|
93
|
-
* @param data - Raw Release data
|
|
94
|
-
* @return Wrapped Release data
|
|
95
|
-
*/
|
|
96
|
-
export function wrapRelease(makeRequest, data) {
|
|
97
|
-
const release = toPlainObject(copy(data));
|
|
98
|
-
const releaseWithApiMethods = enhanceWithMethods(release, createReleaseApi(makeRequest));
|
|
99
|
-
return freezeSys(releaseWithApiMethods);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* @private
|
|
104
|
-
*/
|
|
105
|
-
export const wrapReleaseCollection = wrapCursorPaginatedCollection(wrapRelease);
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
|
|
2
|
-
import copy from 'fast-copy';
|
|
3
|
-
import enhanceWithMethods from '../enhance-with-methods';
|
|
4
|
-
import entities from '.';
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
function createResourceProviderApi(makeRequest) {
|
|
9
|
-
const {
|
|
10
|
-
wrapResourceType
|
|
11
|
-
} = entities.resourceType;
|
|
12
|
-
return {
|
|
13
|
-
/**
|
|
14
|
-
* Sends an update to the server with any changes made to the object's properties
|
|
15
|
-
* @return Object returned from the server with updated changes.
|
|
16
|
-
* @example ```javascript
|
|
17
|
-
* const contentful = require('contentful-management')
|
|
18
|
-
*
|
|
19
|
-
* const client = contentful.createClient({
|
|
20
|
-
* accessToken: '<content_management_api_key>'
|
|
21
|
-
* })
|
|
22
|
-
*
|
|
23
|
-
* client.getOrganization('<org_id>')
|
|
24
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
25
|
-
* .then((appDefinition) => appDefinition.getResourceProvider())
|
|
26
|
-
* .then((resourceProvider) => {
|
|
27
|
-
* resourceProvider.function.sys.id = '<new_contentful_function_id>'
|
|
28
|
-
* return resourceProvider.upsert()
|
|
29
|
-
* })
|
|
30
|
-
* .catch(console.error)
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
upsert: function upsert() {
|
|
34
|
-
const data = this.toPlainObject();
|
|
35
|
-
return makeRequest({
|
|
36
|
-
entityType: 'ResourceProvider',
|
|
37
|
-
action: 'upsert',
|
|
38
|
-
params: getParams(data),
|
|
39
|
-
headers: {},
|
|
40
|
-
payload: getUpsertParams(data)
|
|
41
|
-
}).then(data => wrapResourceProvider(makeRequest, data));
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* Deletes this object on the server.
|
|
45
|
-
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
46
|
-
* @example ```javascript
|
|
47
|
-
* const contentful = require('contentful-management')
|
|
48
|
-
*
|
|
49
|
-
* const client = contentful.createClient({
|
|
50
|
-
* accessToken: '<content_management_api_key>'
|
|
51
|
-
* })
|
|
52
|
-
*
|
|
53
|
-
* client.getOrganization('<org_id>')
|
|
54
|
-
* .then((org) => org.getAppDefinition('<app_def_id>'))
|
|
55
|
-
* .then((appDefinition) => appDefinition.getResourceProvider())
|
|
56
|
-
* .then((resourceProvider) => resourceProvider.delete())
|
|
57
|
-
* .catch(console.error)
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
delete: function del() {
|
|
61
|
-
const data = this.toPlainObject();
|
|
62
|
-
return makeRequest({
|
|
63
|
-
entityType: 'ResourceProvider',
|
|
64
|
-
action: 'delete',
|
|
65
|
-
params: getParams(data)
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
getResourceType: function getResourceType(id) {
|
|
69
|
-
return makeRequest({
|
|
70
|
-
entityType: 'ResourceType',
|
|
71
|
-
action: 'get',
|
|
72
|
-
params: {
|
|
73
|
-
organizationId: this.sys.organization.sys.id,
|
|
74
|
-
appDefinitionId: this.sys.appDefinition.sys.id,
|
|
75
|
-
resourceTypeId: id
|
|
76
|
-
}
|
|
77
|
-
}).then(data => wrapResourceType(makeRequest, data));
|
|
78
|
-
},
|
|
79
|
-
upsertResourceType: function upsertResourceType(id, data) {
|
|
80
|
-
return makeRequest({
|
|
81
|
-
entityType: 'ResourceType',
|
|
82
|
-
action: 'upsert',
|
|
83
|
-
params: {
|
|
84
|
-
organizationId: this.sys.organization.sys.id,
|
|
85
|
-
appDefinitionId: this.sys.appDefinition.sys.id,
|
|
86
|
-
resourceTypeId: id
|
|
87
|
-
},
|
|
88
|
-
headers: {},
|
|
89
|
-
payload: data
|
|
90
|
-
}).then(data => wrapResourceType(makeRequest, data));
|
|
91
|
-
},
|
|
92
|
-
getResourceTypes: function getResourceTypes() {
|
|
93
|
-
return makeRequest({
|
|
94
|
-
entityType: 'ResourceType',
|
|
95
|
-
action: 'getMany',
|
|
96
|
-
params: {
|
|
97
|
-
organizationId: this.sys.organization.sys.id,
|
|
98
|
-
appDefinitionId: this.sys.appDefinition.sys.id
|
|
99
|
-
}
|
|
100
|
-
}).then(data => {
|
|
101
|
-
data.items = data.items.map(item => wrapResourceType(makeRequest, item));
|
|
102
|
-
return data;
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @private
|
|
109
|
-
* @param data - raw ResourceProvider Object
|
|
110
|
-
* @return Object containing the http params for the ResourceProvider request: organizationId and appDefinitionId
|
|
111
|
-
*/
|
|
112
|
-
const getParams = data => ({
|
|
113
|
-
organizationId: data.sys.organization.sys.id,
|
|
114
|
-
appDefinitionId: data.sys.appDefinition.sys.id
|
|
115
|
-
});
|
|
116
|
-
/**
|
|
117
|
-
* @private
|
|
118
|
-
* @param data - raw ResourceProvider Object
|
|
119
|
-
* @return UpsertResourceProviderProps
|
|
120
|
-
*/
|
|
121
|
-
const getUpsertParams = data => ({
|
|
122
|
-
sys: {
|
|
123
|
-
id: data.sys.id
|
|
124
|
-
},
|
|
125
|
-
type: data.type,
|
|
126
|
-
function: data.function
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @private
|
|
131
|
-
* @param makeRequest - function to make requests via an adapter
|
|
132
|
-
* @param data - Raw Resource Provider data
|
|
133
|
-
* @return Wrapped Resource Provider data
|
|
134
|
-
*/
|
|
135
|
-
export function wrapResourceProvider(makeRequest, data) {
|
|
136
|
-
const resourceProvider = toPlainObject(copy(data));
|
|
137
|
-
const ResourceProviderWithMethods = enhanceWithMethods(resourceProvider, createResourceProviderApi(makeRequest));
|
|
138
|
-
return freezeSys(ResourceProviderWithMethods);
|
|
139
|
-
}
|