From 30b498a41b58850eb9416e16202ad15599c863ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Fri, 28 Feb 2025 15:11:59 +0100 Subject: [PATCH 01/21] fix: upgrade typedoc, include missing types and plenty of tsdoc fixes --- README.md | 54 +- lib/adapters/REST/endpoints/access-token.ts | 15 +- .../REST/endpoints/oauth-application.ts | 15 +- lib/create-app-definition-api.ts | 24 +- lib/create-contentful-api.ts | 57 +- lib/create-entry-api.ts | 33 +- lib/create-environment-api.ts | 171 +++-- lib/create-environment-template-api.ts | 3 +- lib/create-organization-api.ts | 129 ++-- lib/create-space-api.ts | 138 ++-- lib/create-ui-config-api.ts | 3 +- lib/create-user-ui-config-api.ts | 3 +- lib/entities/access-token.ts | 3 +- lib/entities/api-key.ts | 6 +- lib/entities/app-action.ts | 3 +- lib/entities/app-bundle.ts | 3 +- lib/entities/app-details.ts | 3 +- lib/entities/app-event-subscription.ts | 3 +- lib/entities/app-installation.ts | 6 +- lib/entities/app-key.ts | 3 +- lib/entities/app-signing-secret.ts | 3 +- lib/entities/app-upload.ts | 3 +- lib/entities/asset.ts | 26 +- lib/entities/content-type.ts | 21 +- lib/entities/environment-alias.ts | 4 - lib/entities/extension.ts | 6 +- lib/entities/locale.ts | 6 +- lib/entities/organization-membership.ts | 3 +- lib/entities/personal-access-token.ts | 3 +- lib/entities/release-action.ts | 2 +- lib/entities/release.ts | 8 +- lib/entities/resource-provider.ts | 6 +- lib/entities/resource-type.ts | 6 +- lib/entities/role.ts | 8 +- lib/entities/scheduled-action.ts | 6 +- lib/entities/space-membership.ts | 6 +- lib/entities/team-membership.ts | 6 +- lib/entities/team-space-membership.ts | 6 +- lib/entities/team.ts | 6 +- lib/entities/workflow.ts | 2 +- lib/methods/action.ts | 6 +- lib/plain/entities/comment.ts | 8 +- lib/plain/entities/function-log.ts | 4 - lib/plain/entities/function.ts | 7 - lib/plain/entities/space-member.ts | 6 +- lib/plain/entities/space-membership.ts | 24 +- lib/plain/entities/space.ts | 18 +- lib/plain/entities/workflow-definition.ts | 2 +- package-lock.json | 615 ++---------------- package.json | 9 +- typedoc.json | 29 + 51 files changed, 671 insertions(+), 869 deletions(-) create mode 100644 typedoc.json diff --git a/README.md b/README.md index 00e605ebf5..82ad51ffe8 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@

Readme · Setup · - Migration · Changelog · Contributing

@@ -43,29 +42,44 @@ -- [Features](#features) -- [Supported Environments](#supported-environments) -- [Getting Started](#getting-started) +- [Getting started](#getting-started) - [Installation](#installation) - - [Node](#node-) - - [Browser](#browser-) - - [Typings](#typings) + - [Node:](#node) + - [Browser:](#browser) + - [Typings](#typings) - [Authentication](#authentication) - [Using ES6 import](#using-es6-import) - - [Your first Request](#your-first-request) - - [Alternative plain API](#alternative-plain-api) -- [App Framework](#app-framework) -- [Troubleshooting](#troubleshooting) -- [Documentation/References](#documentationreferences) + - [Your first request](#your-first-request) + - [Legacy Client Interface](#legacy-client-interface) + - [App Framework](#app-framework) + - [Troubleshooting](#troubleshooting) + - [Documentation/References](#documentationreferences) - [Configuration](#configuration) - - [Reference Documentation](#reference-documentation) - - [Contentful Javascript resources](#contentful-javascript-resources) - - [REST API reference](#rest-api-reference) -- [Versioning](#versioning) -- [Reach out to us](#reach-out-to-us) -- [Get involved](#get-involved) -- [License](#license) -- [Code of Conduct](#code-of-conduct) + - [accessToken (required, when `apiAdapter` is not set)](#accesstoken-required-when-apiadapter-is-not-set) + - [host (default: `'api.contentful.com'`)](#host-default-apicontentfulcom) + - [hostUpload (default: `'upload.contentful.com'`)](#hostupload-default-uploadcontentfulcom) + - [basePath (default: \`\`)](#basepath-default-) + - [httpAgent (default: `undefined`)](#httpagent-default-undefined) + - [httpsAgent (default: `undefined`)](#httpsagent-default-undefined) + - [headers (default: `{}`)](#headers-default-) + - [proxy (default: `undefined`)](#proxy-default-undefined) + - [retryOnError (default: `true`)](#retryonerror-default-true) + - [logHandler (default: `function (level, data) {}`)](#loghandler-default-function-level-data-) + - [requestLogger (default: `function (config) {}`)](#requestlogger-default-function-config-) + - [responseLogger (default: `function (response) {}`)](#responselogger-default-function-response-) + - [apiAdapter (default: `new RestAdapter(configuration)`)](#apiadapter-default-new-restadapterconfiguration) + - [throttle (default: `0`)](#throttle-default-0) + - [Reference documentation](#reference-documentation) + - [Contentful JavaScript resources](#contentful-javascript-resources) + - [REST API reference](#rest-api-reference) + - [Versioning](#versioning) + - [Reach out to us](#reach-out-to-us) + - [You have questions about how to use this library?](#you-have-questions-about-how-to-use-this-library) + - [You found a bug or want to propose a feature?](#you-found-a-bug-or-want-to-propose-a-feature) + - [You need to share confidential information or have other questions?](#you-need-to-share-confidential-information-or-have-other-questions) + - [Get involved](#get-involved) + - [License](#license) + - [Code of Conduct](#code-of-conduct) diff --git a/lib/adapters/REST/endpoints/access-token.ts b/lib/adapters/REST/endpoints/access-token.ts index 408f0de343..904901f24c 100644 --- a/lib/adapters/REST/endpoints/access-token.ts +++ b/lib/adapters/REST/endpoints/access-token.ts @@ -15,7 +15,8 @@ import * as raw from './raw' * @param {Object} params - Parameters for the request. * @param {string} params.tokenId - The unique token ID of the access token to retrieve. * @returns {Promise} A Promise that resolves with the retrieved access token information. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -42,7 +43,8 @@ export const get: RestEndpoint<'AccessToken', 'get'> = ( * @param {AxiosInstance} http - An Axios HTTP client instance. * @param {QueryParams} params - Query parameters to filter and customize the request. * @returns {Promise>} A Promise that resolves with a collection of access token properties. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -73,7 +75,8 @@ export const getMany: RestEndpoint<'AccessToken', 'getMany'> = ( * @param {CreatePersonalAccessTokenProps} rawData - Data for creating the personal access token. * @param {RawAxiosRequestHeaders} [headers] - Optional HTTP headers for the request. * @returns {Promise} A Promise that resolves with the created personal access token. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -105,7 +108,8 @@ export const createPersonalAccessToken: RestEndpoint<'AccessToken', 'createPerso * @param {Object} params - The parameters for revoking the access token. * @param {string} params.tokenId - The unique identifier of the access token to revoke. * @returns {Promise} A Promise that resolves with the updated access token information after revocation. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -133,7 +137,8 @@ export const revoke: RestEndpoint<'AccessToken', 'revoke'> = ( * @param {GetOrganizationParams & QueryParams} params - Parameters for the request, including organization ID and query parameters. * @param {string} params.organizationId - The unique identifier of the organization. * @returns {Promise>} A promise that resolves to a collection of access tokens. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( diff --git a/lib/adapters/REST/endpoints/oauth-application.ts b/lib/adapters/REST/endpoints/oauth-application.ts index 6d72f687d2..07dc409007 100644 --- a/lib/adapters/REST/endpoints/oauth-application.ts +++ b/lib/adapters/REST/endpoints/oauth-application.ts @@ -22,7 +22,8 @@ import type { * @param {string} params.userId - The unique user ID of the user. * @param {string} params.oauthApplicationId - The unique application ID of the OAuth application. * @returns {Promise} A Promise that resolves with the retrieved OAuth Application. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -54,7 +55,8 @@ export const get: RestEndpoint<'OAuthApplication', 'get'> = ( * @param {string} params.userId - The unique user ID of the user. * @param {QueryParams} params - Query parameters to filter and customize the request. * @returns {Promise>} A Promise that resolves with a collection of oauth application properties. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -89,7 +91,8 @@ export const getManyForUser: RestEndpoint<'OAuthApplication', 'getManyForUser'> * @param {string} params.userId - The unique user ID of the user. * @param {RawAxiosRequestHeaders} [headers] - Optional HTTP headers for the request. * @returns {Promise} A Promise that resolves with the created oauth application. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -130,7 +133,8 @@ export const create: RestEndpoint<'OAuthApplication', 'create'> = ( * @param {string} params.userId - The unique user ID of the user. * @param {string} params.oauthApplicationId - The unique application ID of the OAuth application. * @returns {Promise} A Promise that resolves with the updated oauth application. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( @@ -171,7 +175,8 @@ export const update: RestEndpoint<'OAuthApplication', 'update'> = ( * @param {string} params.userId - The unique user ID of the user. * @param {string} params.oauthApplicationId - The unique application ID of the OAuth application. * @returns {Promise} - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const plainClient = contentful.createClient( diff --git a/lib/create-app-definition-api.ts b/lib/create-app-definition-api.ts index 081e9dec2a..d4a7cfd5c0 100644 --- a/lib/create-app-definition-api.ts +++ b/lib/create-app-definition-api.ts @@ -26,7 +26,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -57,7 +58,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -84,7 +86,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { * Gets an app bundle * @param id - AppBundle ID * @return Promise for an AppBundle - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -113,7 +116,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets a collection of AppBundles * @return Promise for a collection of AppBundles - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -139,7 +143,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { * Creates an app bundle * @param Object representation of the App Bundle to be created * @return Promise for the newly created AppBundle - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -168,7 +173,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { * Gets a list of App Installations across an org for given organization and App Definition * If a spaceId is provided in the query object, it will return the App Installations for that specific space. * @return Promise for the newly created AppBundle - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -197,7 +203,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { * Creates or updates a resource provider * @param data representation of the ResourceProvider * @return Promise for the newly created or updated ResourceProvider - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -238,7 +245,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets a Resource Provider * @return Promise for a Resource Provider - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' diff --git a/lib/create-contentful-api.ts b/lib/create-contentful-api.ts index 6693030457..c0aa9c0785 100644 --- a/lib/create-contentful-api.ts +++ b/lib/create-contentful-api.ts @@ -79,6 +79,7 @@ export default function createClientApi(makeRequest: MakeRequest) { }, /** * Gets the lasted version environment template if params.version is not specified + * @param params * @param params.organizationId - Organization ID * @param params.environmentTemplateId - Environment template ID * @param [params.version] - Template version number to return a specific version of the environment template @@ -93,7 +94,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * client.getEnvironmentTemplate({ * organizationId: '', * environmentTemplateId: '', - * version: version> + * version: * }) * .then((space) => console.log(space)) * .catch(console.error) @@ -124,7 +125,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * @param organizationId - Organization ID * @param environmentTemplateData - Object representation of the environment template to be created * @return Promise for the newly created EnvironmentTemplate - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -201,7 +203,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * @param spaceData - Object representation of the Space to be created * @param organizationId - Organization ID, if the associated token can manage more than one organization. * @return Promise for the newly created Space - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -231,7 +234,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * Gets an organization * @param id - Organization ID * @return Promise for a Organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -254,7 +258,8 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a collection of Organizations * @return Promise for a collection of Organizations - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -279,7 +284,8 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets the authenticated user * @return Promise for a User - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -303,7 +309,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * * @param params * @returns Promise of a OAuthApplication - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -331,7 +338,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * * @param params * @returns Promise of list of user's OAuthApplications - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -357,7 +365,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * * @param params * @returns Promise of a new OAuth application. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -388,9 +397,8 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets App Definition * @return Promise for App Definition - * @param organizationId - Id of the organization where the app is installed - * @param appDefinitionId - Id of the app that will be returned - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -417,7 +425,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * Creates a personal access token * @param data - personal access token config * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -455,9 +464,10 @@ export default function createClientApi(makeRequest: MakeRequest) { * @deprecated - use getAccessToken instead * * Gets a personal access token - * @param data - personal access token config + * @param tokenId - personal access token config * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -482,7 +492,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * * Gets all personal access tokens * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -504,9 +515,10 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a users access token - * @param data - users access token config + * @param tokenId - users access token config * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -529,7 +541,8 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets all user access tokens * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -553,7 +566,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * Retrieves a list of redacted versions of access tokens for an organization, accessible to owners or administrators of an organization. * * @return Promise for a Token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -582,7 +596,8 @@ export default function createClientApi(makeRequest: MakeRequest) { * @param organizationId - Id of an organization * @param query - Query parameters * @return Promise of a collection of usages - * @example ```javascript + * @example + * ```javascript * * const contentful = require('contentful-management') * diff --git a/lib/create-entry-api.ts b/lib/create-entry-api.ts index bbc3f8cbe1..9d4efd16b5 100644 --- a/lib/create-entry-api.ts +++ b/lib/create-entry-api.ts @@ -37,7 +37,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -69,7 +70,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Sends an JSON patch to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -107,7 +109,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -131,7 +134,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Publishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -160,7 +164,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unpublishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -189,7 +194,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Archives the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -217,7 +223,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unarchives the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -244,7 +251,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Gets all snapshots of an entry - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -272,7 +280,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Gets a snapshot of an entry * @param snapshotId - Id of the snapshot - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -301,7 +310,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { * Creates a new comment for an entry * @param data Object representation of the Comment to be created * @returns Promise for the newly created Comment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -392,7 +402,8 @@ export default function createEntryApi(makeRequest: MakeRequest) { * Creates a new task for an entry * @param data Object representation of the Task to be created * @returns Promise for the newly created Task - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/create-environment-api.ts b/lib/create-environment-api.ts index 4d373a81d4..c40ca0bac2 100644 --- a/lib/create-environment-api.ts +++ b/lib/create-environment-api.ts @@ -91,7 +91,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Deletes the environment * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -118,7 +119,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Updates the environment * @return Promise for the updated environment. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -150,7 +152,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates SDK Entry object (locally) from entry data * @param entryData - Entry Data * @return Entry - * @example ```javascript + * @example + * ```javascript * environment.getEntry('entryId').then(entry => { * * // Build a plainObject in order to make it usable for React (saving in state or redux) @@ -183,7 +186,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates SDK Asset object (locally) from entry data * @param assetData - Asset ID * @return Asset - * @example ```javascript + * @example + * ```javascript * environment.getAsset('asset_id').then(asset => { * * // Build a plainObject in order to make it usable for React (saving in state or redux) @@ -220,7 +224,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param bulkActionId - ID of the BulkAction to fetch * @returns - Promise with the BulkAction * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -429,7 +434,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a Content Type * @param contentTypeId - Content Type ID * @return Promise for a Content Type - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -461,7 +467,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of Content Types * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Content Types - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -491,7 +498,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Content Type * @param data - Object representation of the Content Type to be created * @return Promise for the newly created Content Type - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -534,7 +542,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param contentTypeId - Content Type ID * @param data - Object representation of the Content Type to be created * @return Promise for the newly created Content Type - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -578,7 +587,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets an EditorInterface for a ContentType * @param contentTypeId - Content Type ID * @return Promise for an EditorInterface - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -608,7 +618,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets all EditorInterfaces * @return Promise for a collection of EditorInterface - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -641,7 +652,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param id - Entry ID * @param query - Object with search parameters. In this method it's only useful for `locale`. * @return Promise for an Entry - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -673,7 +685,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Deletes an Entry of this environment * @param id - Entry ID * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -708,7 +721,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * from your entry in the backend * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Entries - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -739,7 +753,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of published Entries * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of published Entries - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -771,7 +786,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param contentTypeId - The Content Type ID of the newly created Entry * @param data - Object representation of the Entry to be created * @return Promise for the newly created Entry - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -811,7 +827,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param id - Entry ID * @param data - Object representation of the Entry to be created * @return Promise for the newly created Entry - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -852,7 +869,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param entryId - Entry ID * @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum * @returns Promise of Entry references - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -890,7 +908,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param id - Asset ID * @param query - Object with search parameters. In this method it's only useful for `locale`. * @return Promise for an Asset - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -924,7 +943,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * from your entry in the backend * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Assets - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -954,7 +974,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of published Assets * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of published Assets - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -984,7 +1005,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing. * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished. * @return Promise for the newly created Asset - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1028,7 +1050,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param id - Asset ID * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished. * @return Promise for the newly created Asset - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1071,7 +1094,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param data - Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished. * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream. * @return Promise for the newly created Asset - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1116,7 +1140,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param data Object with request payload * @param data.expiresAt number a UNIX timestamp in the future (but not more than 48 hours from time of calling) * @return Promise for the newly created AssetKey - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1148,7 +1173,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets an Upload * @param id - Upload ID * @return Promise for an Upload - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1178,7 +1204,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param data - Object with file information. * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream. * @return Upload object containing information about the uploaded file. - * @example ```javascript + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1207,7 +1234,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a Locale * @param localeId - Locale ID * @return Promise for an Locale - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1237,7 +1265,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of Locales * @return Promise for a collection of Locales - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1267,7 +1296,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Locale * @param data - Object representation of the Locale to be created * @return Promise for the newly created Locale - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1303,7 +1333,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets an UI Extension * @param id - Extension ID * @return Promise for an UI Extension - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1332,7 +1363,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of UI Extension * @return Promise for a collection of UI Extensions - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1361,7 +1393,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a UI Extension * @param data - Object representation of the UI Extension to be created * @return Promise for the newly created UI Extension - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1406,7 +1439,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param id - Extension ID * @param data - Object representation of the UI Extension to be created * @return Promise for the newly created UI Extension - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1454,7 +1488,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param data - AppInstallation data * @param options.acceptAllTerms - Flag for accepting Apps' Marketplace EULA, Terms, and Privacy policy (need to pass `{acceptAllTerms: true}` to install a marketplace app) * @return Promise for an App Installation - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1494,7 +1529,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets an App Installation * @param id - AppDefintion ID * @return Promise for an App Installation - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1523,7 +1559,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of App Installation * @return Promise for a collection of App Installations - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1554,7 +1591,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appActionId - action ID * @param data - App Action Call data * @return Promise for an App Action Call - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1600,7 +1638,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appDefinitionId - AppDefinition ID * @param data - SignedRequest data * @return Promise for a Signed Request - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1641,7 +1680,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appDefinitionId - AppDefinition ID * @param data - Json Web Token * @return Promise for an app access token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const { sign } = require('jsonwebtoken') * @@ -1680,7 +1720,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appInstallationId * @param {import('../common-types').AcceptsQueryOptions} query - optional query parameter for filtering functions by action * @return Promise containing wrapped collection of Functions in an environment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1714,7 +1755,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param functionId * @param {import('../common-types').CursorBasedParams} query - optional query parameter for pagination (limit, nextPage, prevPage) * @return Promise containing wrapped collection of FunctionLogs - * * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1770,7 +1812,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param functionId * @param logId * @return Promise containing a wrapped FunctionLog - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1812,7 +1855,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param entryId - Entry ID * @param query - query additional query paramaters * @return Promise for a collection of Entry Snapshots - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1845,7 +1889,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param contentTypeId - Content Type ID * @param query - query additional query paramaters * @return Promise for a collection of Content Type Snapshots - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1922,7 +1967,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Retrieves a Release by ID * @param releaseId * @returns Promise containing a wrapped Release - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1954,7 +2000,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a Collection of Releases, * @param {ReleaseQueryOptions} query filtering options for the collection result * @returns Promise containing a wrapped Release Collection - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1986,7 +2033,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a new Release with the entities and title in the payload * @param payload Object containing the payload in order to create a Release * @returns Promise containing a wrapped Release, that has other helper methods within. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2032,7 +2080,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param options.version Release sys.version that to be updated * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2086,7 +2135,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param releaseId the ID of the release * * @returns Promise containing a wrapped Release, that has helper methods within. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2119,7 +2169,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param options.version the version of the release that is to be published * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2153,7 +2204,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param options.version the version of the release that is to be published * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2188,7 +2240,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2228,7 +2281,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param options.version the version of the release that is to be archived * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2262,7 +2316,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param options.version the version of the release that is to be unarchived * @returns Promise containing a wrapped Release, that has helper methods within. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2295,7 +2350,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param params.releaseId The ID of a Release * @param params.actionId The ID of a Release Action * @returns Promise containing a wrapped ReleaseAction - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -2330,7 +2386,8 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param {ReleaseQueryOptions} params.query filtering options for the collection result * @returns Promise containing a wrapped ReleaseAction Collection * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/create-environment-template-api.ts b/lib/create-environment-template-api.ts index d192c4395f..c884480db1 100644 --- a/lib/create-environment-template-api.ts +++ b/lib/create-environment-template-api.ts @@ -87,7 +87,8 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat /** * Deletes the environment template * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/create-organization-api.ts b/lib/create-organization-api.ts index d54ea7885a..a5bbe82ceb 100644 --- a/lib/create-organization-api.ts +++ b/lib/create-organization-api.ts @@ -57,7 +57,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets a collection of spaces in the organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise a collection of Spaces in the organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -84,7 +85,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a User * @return Promise for a User - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -108,7 +110,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets a collection of Users in organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise a collection of Users in organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -135,7 +138,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets an Organization Membership * @param id - Organization Membership ID * @return Promise for an Organization Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -163,7 +167,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets a collection of Organization Memberships * @param params - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Organization Memberships - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -190,7 +195,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates a Team * @param data representation of the Team to be created - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -217,7 +223,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Team - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -240,7 +247,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets all Teams in an organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -269,7 +277,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * @param teamId - Id of the team the membership will be created in * @param data - Object representation of the Team Membership to be created * @return Promise for the newly created TeamMembership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -297,7 +306,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an Team Membership from the team with given teamId * @return Promise for an Team Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -321,7 +331,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization. * @return Promise for a Team Membership Collection - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -362,7 +373,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization. * @return Promise for a Team Space Membership Collection - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -390,7 +402,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get a Team Space Membership with given teamSpaceMembershipId * @return Promise for a Team Space Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -418,7 +431,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets an Space Membership in Organization * @param id - Organiztion Space Membership ID * @return Promise for a Space Membership in an organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -445,7 +459,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Gets a collection Space Memberships in organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a Space Membership collection across all spaces in the organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -471,7 +486,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an Invitation in Organization * @return Promise for a OrganizationInvitation in an organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -497,7 +513,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Create an Invitation in Organization * @return Promise for a OrganizationInvitation in an organization - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -527,7 +544,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a collection of Roles * @return Promise for a collection of Roles - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -552,7 +570,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Creates an app definition * @param Object representation of the App Definition to be created * @return Promise for the newly created AppDefinition - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -580,7 +599,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets all app definitions * @return Promise for a collection of App Definitions - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -604,7 +624,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app definition * @return Promise for an App Definition - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -628,7 +649,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app upload * @return Promise for an App Upload - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -653,7 +675,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates an app upload * @return Promise for an App Upload - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -678,7 +701,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates or updates an app signing secret * @return Promise for an App SigningSecret - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -703,7 +727,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app signing secret * @return Promise for an App SigningSecret - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -727,7 +752,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Deletes an app signing secret * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -753,7 +779,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates or updates an app event subscription * @return Promise for an App Event Subscription - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -778,7 +805,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app event subscription * @return Promise for an App Event Subscription - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -802,7 +830,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Deletes the current App Event Subscription for the given App * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -828,7 +857,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates or updates an app event subscription * @return Promise for an App Event Subscription - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -860,7 +890,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app key by fingerprint * @return Promise for an App Key - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -884,7 +915,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets all keys for the given app * @return Promise for an array of App Keys - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -919,7 +951,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Deletes an app key by fingerprint. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -945,7 +978,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates or updates an app details entity * @return Promise for an App Details - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -972,7 +1006,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app details entity * @return Promise for an App Details - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -996,7 +1031,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Deletes an app details entity. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1022,7 +1058,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates an app action entity. * @return Promise that resolves an App Action entity - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1051,7 +1088,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Updates an existing app action entity. * @return Promise that resolves an App Action entity - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1080,7 +1118,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Deletes an app action entity. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1106,7 +1145,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an existing app action entity. * @return Promise that resolves an App Action entity - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1130,7 +1170,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets existing app actions for an App Definition. * @return Promise that resolves an App Action entity - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1156,7 +1197,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * @param appDefinitionId * @param functionId * @returns Promise for a Function - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1179,7 +1221,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * @param appDefinitionId * @param {import('../common-types').AcceptsQueryOptions} query - optional query parameter for filtering functions by action * @returns Promise for a Function - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' diff --git a/lib/create-space-api.ts b/lib/create-space-api.ts index 8b94bff1ca..debe0f5e28 100644 --- a/lib/create-space-api.ts +++ b/lib/create-space-api.ts @@ -51,7 +51,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Deletes the space * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -75,7 +76,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Updates the space * @return Promise for the updated space. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -105,7 +107,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets an environment * @param id - Environment ID * @return Promise for an Environment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -131,7 +134,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Environments * @return Promise for a collection of Environment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -157,7 +161,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates an environment * @param data - Object representation of the Environment to be created * @return Promise for the newly created Environment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -188,7 +193,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param data - Object representation of the Environment to be created * @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master" * @return Promise for the newly created Environment - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -223,7 +229,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Webhook * @param id - Webhook ID * @return Promise for a Webhook - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -248,7 +255,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Webhooks * @return Promise for a collection of Webhooks - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -273,7 +281,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Fetch a webhook signing secret * @returns Promise for the redacted webhook signing secret in this space - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -298,7 +307,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Fetch a webhook retry policy * @returns Promise for the redacted webhook retry policy in this space - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -324,7 +334,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Webhook * @param data - Object representation of the Webhook to be created * @return Promise for the newly created Webhook - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -357,7 +368,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Webhook ID * @param data - Object representation of the Webhook to be created * @return Promise for the newly created Webhook - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -389,7 +401,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Create or update the webhook signing secret for this space * @param data 64 character string that will be used to sign the webhook calls * @returns Promise for the redacted webhook signing secret that was created or updated - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const crypto = require('crypto') * @@ -418,7 +431,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Create or update the webhook retry policy for this space * @param data the maxRetries with integer value >= 2 and <= 99 value to set in the Retry Policy * @returns Promise for the redacted webhook retry policy that was created or updated - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -446,7 +460,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Delete the webhook signing secret for this space * @returns Promise - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -470,7 +485,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Delete the webhook retry policy for this space * @returns Promise - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -496,7 +512,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Role * @param id - Role ID * @return Promise for a Role - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -526,7 +543,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Roles * @return Promise for a collection of Roles - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -552,7 +570,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Role * @param data - Object representation of the Role to be created * @return Promise for the newly created Role - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -608,7 +627,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Role ID * @param data - Object representation of the Role to be created * @return Promise for the newly created Role - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -663,7 +683,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a User * @param userId - User ID * @return Promise for a User - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -687,7 +708,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a collection of Users in a space * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise a collection of Users in a space - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -712,7 +734,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a collection of teams for a space * @param query * @return Promise for a collection of teams for a space - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -736,7 +759,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Space Member * @param id Get Space Member by user_id * @return Promise for a Space Member - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -757,7 +781,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a collection of Space Members * @param query * @return Promise for a collection of Space Members - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -782,7 +807,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param id - Space Membership ID * @return Promise for a Space Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -804,7 +830,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Space Memberships - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -830,7 +857,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param data - Object representation of the Space Membership to be created * @return Promise for the newly created Space Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -870,7 +898,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Space Membership ID * @param data - Object representation of the Space Membership to be created * @return Promise for the newly created Space Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -910,7 +939,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Team Space Membership * @param id - Team Space Membership ID * @return Promise for a Team Space Membership - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -935,7 +965,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a collection of Team Space Memberships * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. * @return Promise for a collection of Team Space Memberships - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -960,7 +991,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Team ID * @param data - Object representation of the Team Space Membership to be created * @return Promise for the newly created Team Space Membership - * @example ```javascript + * @example +* ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1000,7 +1032,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Api Key * @param id - API Key ID * @return Promise for a Api Key - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1027,7 +1060,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Api Keys * @return Promise for a collection of Api Keys - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1053,7 +1087,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of preview Api Keys * @return Promise for a collection of Preview Api Keys - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1080,7 +1115,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a preview Api Key * @param id - Preview API Key ID * @return Promise for a Preview Api Key - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1108,7 +1144,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Api Key * @param payload - Object representation of the Api Key to be created * @return Promise for the newly created Api Key - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1147,7 +1184,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Api Key ID * @param payload - Object representation of the Api Key to be created * @return Promise for the newly created Api Key - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1187,7 +1225,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param environmentAliasId - EnvironmentAlias ID * @param data - Object representation of the EnvironmentAlias to be created * @return Promise for the newly created EnvironmentAlias - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1218,7 +1257,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets an Environment Alias * @param Environment Alias ID * @return Promise for an Environment Alias - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1242,7 +1282,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Environment Aliases * @return Promise for a collection of Environment Aliases - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1270,7 +1311,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param query - Object with search parameters. The enviroment id field is mandatory. Check the REST API reference for more details. * @return Promise for the scheduled actions query * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1299,7 +1341,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * * @throws if the Scheduled Action cannot be found or the user doesn't have permission to read schedules from the entity of the scheduled action itself. * @returns Promise with the Scheduled Action - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1339,7 +1382,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a scheduled action * @param data - Object representation of the scheduled action to be created * @return Promise for the newly created scheduled actions - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1388,7 +1432,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param options.version the sys.version of the scheduled action to be updated * @param payload the scheduled actions object with updates, omitting sys object * @returns Promise containing a wrapped scheduled action with helper methods - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1462,7 +1507,8 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param options.environmentId the environment ID of the scheduled action to be canceled * @throws if the Scheduled Action cannot be found or the user doesn't have permissions in the entity in the action. * @returns Promise containing a wrapped Scheduled Action with helper methods - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ diff --git a/lib/create-ui-config-api.ts b/lib/create-ui-config-api.ts index 7cde502af8..152a4bfa71 100644 --- a/lib/create-ui-config-api.ts +++ b/lib/create-ui-config-api.ts @@ -29,7 +29,8 @@ export default function createUIConfigApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/create-user-ui-config-api.ts b/lib/create-user-ui-config-api.ts index e18e7d5bfc..7b9ee1208f 100644 --- a/lib/create-user-ui-config-api.ts +++ b/lib/create-user-ui-config-api.ts @@ -29,7 +29,8 @@ export default function createUserUIConfigApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/access-token.ts b/lib/entities/access-token.ts index baee1e0760..95b55db26f 100644 --- a/lib/entities/access-token.ts +++ b/lib/entities/access-token.ts @@ -38,7 +38,8 @@ export interface AccessToken extends AccessTokenProps, DefaultElements { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -39,7 +40,8 @@ export interface ApiKey extends ApiKeyProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/app-action.ts b/lib/entities/app-action.ts index 361e1b813a..9b7a0a1e6e 100644 --- a/lib/entities/app-action.ts +++ b/lib/entities/app-action.ts @@ -140,7 +140,8 @@ export type AppAction = AppActionProps & /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/app-bundle.ts b/lib/entities/app-bundle.ts index 5c4e635e5c..beaa87d21c 100644 --- a/lib/entities/app-bundle.ts +++ b/lib/entities/app-bundle.ts @@ -60,7 +60,8 @@ export interface AppBundle extends AppBundleProps, DefaultElements { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/app-signing-secret.ts b/lib/entities/app-signing-secret.ts index d7840ba078..aedac4fc34 100644 --- a/lib/entities/app-signing-secret.ts +++ b/lib/entities/app-signing-secret.ts @@ -29,7 +29,8 @@ export interface AppSigningSecret /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/app-upload.ts b/lib/entities/app-upload.ts index 8b36b14f7b..3652db3f34 100644 --- a/lib/entities/app-upload.ts +++ b/lib/entities/app-upload.ts @@ -18,7 +18,8 @@ export interface AppUpload extends AppUploadProps, DefaultElements + processForLocale(locale: string, options?: AssetProcessingForLocale): Promise /** * Publishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -157,7 +160,8 @@ type AssetApi = { /** * Archives the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -176,7 +180,8 @@ type AssetApi = { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -195,7 +200,8 @@ type AssetApi = { /** * Unarchives the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -214,7 +220,8 @@ type AssetApi = { /** * Unpublishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -233,7 +240,8 @@ type AssetApi = { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/content-type.ts b/lib/entities/content-type.ts index 3a19bc7cf1..523884957c 100644 --- a/lib/entities/content-type.ts +++ b/lib/entities/content-type.ts @@ -68,7 +68,8 @@ type ContentTypeApi = { * API reference for more reasoning. Alternatively, * you may use the convenience method omitAndDeleteField to do both steps at once. * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -91,7 +92,8 @@ type ContentTypeApi = { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -110,7 +112,8 @@ type ContentTypeApi = { /** * Publishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -129,7 +132,8 @@ type ContentTypeApi = { /** * Unpublishes the object * @return Object returned from the server with updated metadata. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -150,7 +154,8 @@ type ContentTypeApi = { * Important note: The editor interface only represent a published contentType.
* To get the most recent representation of the contentType make sure to publish it first * @return Object returned from the server with the current editor interface. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -189,7 +194,8 @@ type ContentTypeApi = { /** * Gets a snapshot of a contentType * @param snapshotId - Id of the snapshot - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -207,7 +213,8 @@ type ContentTypeApi = { getSnapshot(snapshotId: string): Promise> /** * Gets all snapshots of a contentType - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/environment-alias.ts b/lib/entities/environment-alias.ts index a26a972aac..e818747ce0 100644 --- a/lib/entities/environment-alias.ts +++ b/lib/entities/environment-alias.ts @@ -25,8 +25,6 @@ export interface EnvironmentAlias DefaultElements { /** * Sends an update to the server with any changes made to the object's properties. Currently, you can only change the id of the alias's underlying environment. See the example below. - * @memberof EnvironmentAlias - * @func update * @return {Promise} Object returned from the server with updated changes. * ```javascript * const contentful = require('contentful-management') @@ -49,8 +47,6 @@ export interface EnvironmentAlias /** * Deletes this object on the server. - * @memberof EnvironmentAlias - * @func delete * @return {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. * ```javascript * const contentful = require('contentful-management') diff --git a/lib/entities/extension.ts b/lib/entities/extension.ts index e76a5f535b..9cbbe73ae9 100644 --- a/lib/entities/extension.ts +++ b/lib/entities/extension.ts @@ -65,7 +65,8 @@ export interface Extension extends ExtensionProps, DefaultElements { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -72,7 +73,8 @@ export interface Locale extends LocaleProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/organization-membership.ts b/lib/entities/organization-membership.ts index e152bcaa41..caf28ddd03 100644 --- a/lib/entities/organization-membership.ts +++ b/lib/entities/organization-membership.ts @@ -27,7 +27,8 @@ export interface OrganizationMembership /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/personal-access-token.ts b/lib/entities/personal-access-token.ts index 7a260b4621..61f8c9e79c 100644 --- a/lib/entities/personal-access-token.ts +++ b/lib/entities/personal-access-token.ts @@ -27,7 +27,8 @@ export interface PersonalAccessToken /** * Revokes a personal access token * @return Object the revoked personal access token - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/release-action.ts b/lib/entities/release-action.ts index ab8758c804..f199ebceca 100644 --- a/lib/entities/release-action.ts +++ b/lib/entities/release-action.ts @@ -44,7 +44,7 @@ export interface ReleaseActionQueryOptions { /** * Limit of how many records are returned in the query result * @default 100 - * */ + **/ limit?: number } diff --git a/lib/entities/release.ts b/lib/entities/release.ts index 274bc2acfd..775c57a22e 100644 --- a/lib/entities/release.ts +++ b/lib/entities/release.ts @@ -54,7 +54,7 @@ export interface ReleaseQueryOptions { /** * Limit how many records are returned in the result * @default 100 - * */ + **/ limit?: number /** * Order releases @@ -63,7 +63,7 @@ export interface ReleaseQueryOptions { * - `sys.updatedAt`, `-sys.updatedAt` * - `sys.createdAt`, `-sys.createdAt` * @default -sys.updatedAt - * */ + **/ order?: string } @@ -119,13 +119,13 @@ export interface ReleaseApiMethods { * Archives a release and locks any actions such as adding new entities or publishing/unpublishing. * This operation increases the sys.version property * @throws {BadRequest} if the release is already archived - * */ + **/ archive(): Promise /** * Unarchives an `archived` release and unlocks operations on the Release. This operation increases the sys.version property * @throws {BadRequest} if the release is not archived - * */ + **/ unarchive(): Promise /** Updates a Release and returns the updated Release object */ update(payload: ReleasePayload): Promise diff --git a/lib/entities/resource-provider.ts b/lib/entities/resource-provider.ts index 32a9776e5f..8034022881 100644 --- a/lib/entities/resource-provider.ts +++ b/lib/entities/resource-provider.ts @@ -53,7 +53,8 @@ function createResourceProviderApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -83,7 +84,8 @@ function createResourceProviderApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/resource-type.ts b/lib/entities/resource-type.ts index 31e0cfd53d..33a55686ca 100644 --- a/lib/entities/resource-type.ts +++ b/lib/entities/resource-type.ts @@ -76,7 +76,8 @@ function createResourceTypeApi(makeRequest: MakeRequest) { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -107,7 +108,8 @@ function createResourceTypeApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/role.ts b/lib/entities/role.ts index 87181fd0d6..f1f5b775b3 100644 --- a/lib/entities/role.ts +++ b/lib/entities/role.ts @@ -46,10 +46,9 @@ export type CreateRoleProps = Omit export interface Role extends RoleProps, DefaultElements { /** * Deletes this object on the server. - * @memberof Role - * @func delete * @return {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -67,7 +66,8 @@ export interface Role extends RoleProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/scheduled-action.ts b/lib/entities/scheduled-action.ts index 40124c13bf..0273c4a8cf 100644 --- a/lib/entities/scheduled-action.ts +++ b/lib/entities/scheduled-action.ts @@ -143,7 +143,8 @@ export default function getInstanceMethods(makeRequest: MakeRequest): ScheduledA /** * Cancels the current Scheduled Action schedule. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -190,7 +191,8 @@ export default function getInstanceMethods(makeRequest: MakeRequest): ScheduledA /** * Update the current scheduled action. Currently, only changes made to the `scheduledFor` property will be saved. * - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ diff --git a/lib/entities/space-membership.ts b/lib/entities/space-membership.ts index 69ab5fb9e7..b40aa59d48 100644 --- a/lib/entities/space-membership.ts +++ b/lib/entities/space-membership.ts @@ -21,7 +21,8 @@ export interface SpaceMembership /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -39,7 +40,8 @@ export interface SpaceMembership /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/team-membership.ts b/lib/entities/team-membership.ts index 117c313258..cbddc9c6ea 100644 --- a/lib/entities/team-membership.ts +++ b/lib/entities/team-membership.ts @@ -31,7 +31,8 @@ export interface TeamMembership extends TeamMembershipProps, DefaultElements { /** * Deletes this object on the server. * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -47,7 +48,8 @@ export interface Team extends TeamProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties * @return Object returned from the server with updated changes. - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ diff --git a/lib/entities/workflow.ts b/lib/entities/workflow.ts index cbbb013301..186b8fe066 100644 --- a/lib/entities/workflow.ts +++ b/lib/entities/workflow.ts @@ -67,7 +67,7 @@ export type WorkflowQueryOptions = Omit & { /** * Order workflows by * @default -sys.createdAt - * */ + **/ order?: OrderQueryParam } diff --git a/lib/methods/action.ts b/lib/methods/action.ts index ef796107b1..4d897237b3 100644 --- a/lib/methods/action.ts +++ b/lib/methods/action.ts @@ -28,17 +28,17 @@ export class AsyncActionFailedError extends AsyncActionProcessingError {} export type AsyncActionProcessingOptions = { /** The amount of times to retry. * @default 30 - * */ + **/ retryCount?: number /** The interval between retries, in milliseconds (ms). * @default 2000 (2s) - * */ + **/ retryIntervalMs?: number /** * Initial delay in milliseconds when performing the first check. * This is used to prevent short running bulkActions of waiting too long for a result. * @default 1000 (1s) - * */ + **/ initialDelayMs?: number /** * Throws an error if the Action does not complete with a successful (succeeded) status. diff --git a/lib/plain/entities/comment.ts b/lib/plain/entities/comment.ts index 06ca929b6f..643e28b675 100644 --- a/lib/plain/entities/comment.ts +++ b/lib/plain/entities/comment.ts @@ -31,7 +31,7 @@ export type CommentPlainClientAPI = { * bodyFormat: 'plain-text', * }); * ``` - * */ + **/ get(params: OptionalDefaults & PlainTextBodyFormat): Promise /** Fetches a rich text comment * @@ -48,7 +48,7 @@ export type CommentPlainClientAPI = { * bodyFormat: 'rich-text', * }); * ``` - * */ + **/ get( params: OptionalDefaults & RichTextBodyFormat ): Promise @@ -69,7 +69,7 @@ export type CommentPlainClientAPI = { * } * }); * ``` - * */ + **/ getMany( params: OptionalDefaults ): Promise> @@ -90,7 +90,7 @@ export type CommentPlainClientAPI = { * } * }); * ``` - * */ + **/ getMany( params: OptionalDefaults ): Promise> diff --git a/lib/plain/entities/function-log.ts b/lib/plain/entities/function-log.ts index 676213e4e9..9cd13f97ca 100644 --- a/lib/plain/entities/function-log.ts +++ b/lib/plain/entities/function-log.ts @@ -9,8 +9,6 @@ import type { OptionalDefaults } from '../wrappers/wrap' export type FunctionLogPlainClientAPI = { /** * Fetches the specified FunctionLog - * @params spaceId, environmentId, appInstallationId, functionId, logId - * @returns the FunctionLog * @throws if the request fails, or the FunctionLog is not found * @example * ```javascript @@ -27,8 +25,6 @@ export type FunctionLogPlainClientAPI = { /** * Fetches all FunctionLogs for the given function - * @params spaceId, environmentId, appInstallationId, functionId, query - * @returns an object containing an array of FunctionLogs * @throws if the request fails, or the FunctionLogs are not found * @example * ```javascript diff --git a/lib/plain/entities/function.ts b/lib/plain/entities/function.ts index 2d765e2aa6..3de89a4017 100644 --- a/lib/plain/entities/function.ts +++ b/lib/plain/entities/function.ts @@ -3,7 +3,6 @@ import type { GetFunctionParams, GetFunctionForEnvParams, GetManyFunctionParams, - AcceptsQueryParams, } from '../../common-types' import type { FunctionProps } from '../../entities/function' import type { OptionalDefaults } from '../wrappers/wrap' @@ -11,8 +10,6 @@ import type { OptionalDefaults } from '../wrappers/wrap' export type FunctionPlainClientAPI = { /** * Fetches the specified Function - * @params organizationId, appDefinitionId, functionId - * @returns the Function * @throws if the request fails, or the Function is not found * @example * ```javascript @@ -27,8 +24,6 @@ export type FunctionPlainClientAPI = { /** * Fetches all Functions for the given app - * @params organizationId, appDefinitionId, query - * @returns an object containing an array of Functions * @throws if the request fails, or the App is not found * @example * ```javascript @@ -43,8 +38,6 @@ export type FunctionPlainClientAPI = { /** * Fetches all Functions for the given environment - * @params spaceId, environmentId, appInstallationId, query - * @returns an object containing an array of Functions * @throws if the request fails, or the Environment is not found * @example * ```javascript diff --git a/lib/plain/entities/space-member.ts b/lib/plain/entities/space-member.ts index 3a97780d99..7249ea2e0c 100644 --- a/lib/plain/entities/space-member.ts +++ b/lib/plain/entities/space-member.ts @@ -8,7 +8,8 @@ export type SpaceMemberPlainClientAPI = { * @param params the space and member IDs * @returns the space member * @throws if the request fails, or the space member is not found - * @example ```javascript + * @example + * ```javascript * const spaceMember = await client.spaceMember.get({ * spaceId: '', * spaceMemberId: '', @@ -23,7 +24,8 @@ export type SpaceMemberPlainClientAPI = { * @param params a space ID and query parameters * @returns a collection of space members * @throws if the request fails, the space is not found, or the query parameters are malformed - * @example ```javascript + * @example + * ```javascript * const spaceMember = await client.spaceMember.getMany({ * spaceId: '', * }); diff --git a/lib/plain/entities/space-membership.ts b/lib/plain/entities/space-membership.ts index 5a388b66df..983e46f765 100644 --- a/lib/plain/entities/space-membership.ts +++ b/lib/plain/entities/space-membership.ts @@ -18,7 +18,8 @@ export type SpaceMembershipPlainClientAPI = { * @param params the space and membership IDs * @returns the space membership * @throws if the request fails, or the space membership is not found - * @example ```javascript + * @example + * ```javascript * const spaceMembership = await client.spaceMembership.get({ * spaceId: '', * spaceMembershipId: '', @@ -31,7 +32,8 @@ export type SpaceMembershipPlainClientAPI = { * @param params a space ID * @returns a collection of space memberships * @throws if the request fails, the space is not found, or the query parameters are malformed - * @example ```javascript + * @example + * ```javascript * const spaceMemberships = await client.spaceMembership.getMany({ * spaceId: '', * spaceMembershipId: '', @@ -46,7 +48,8 @@ export type SpaceMembershipPlainClientAPI = { * @param params the organization and membership IDs * @returns the space membership * @throws if the request fails, or the organization or the space membership is not found - * @example ```javascript + * @example + * ```javascript * const spaceMembership = await client.spaceMembership.getForOrganization({ * spaceId: '', * spaceMembershipId: '', @@ -61,7 +64,8 @@ export type SpaceMembershipPlainClientAPI = { * @param params the organization and query parameterss * @returns a collection of space memberships * @throws if the request fails, the organization is not found, or the query parameters are malformed - * @example ```javascript + * @example + * ```javascript * const spaceMemberships = await client.spaceMembership.getManyForOrganization({ * organizationId: '', * spaceMembershipId: '', @@ -77,7 +81,8 @@ export type SpaceMembershipPlainClientAPI = { * @param data the space membership data * @returns the created space membership * @throws if the request fails, the space cannot be found, or the data is malformed - * @example ```javascript + * @example + * ```javascript * const spaceMembership = await client.spaceMembership.create( * { * spaceId: '', @@ -109,7 +114,8 @@ export type SpaceMembershipPlainClientAPI = { * @param data the space membership data * @returns the created space membership * @throws if the request fails, the space cannot be found, or the data is malformed - * @example ```javascript + * @example + * ```javascript * const spaceMembership = await client.spaceMembership.createWithId( * { * spaceId: '', @@ -142,7 +148,8 @@ export type SpaceMembershipPlainClientAPI = { * @param rawData the space membership update * @returns the updated space membership * @throws if the request fails, the space membership is not found, or the payload is malformed - * @example ```javascript + * @example + * ```javascript * let spaceMembership = await client.spaceMembership.get({ * spaceId: '', * spaceMembershipId: '', @@ -170,7 +177,8 @@ export type SpaceMembershipPlainClientAPI = { * @param params the space and membership IDs * @returns void * @throws if the request fails, or the space membership is not found - * @example ```javascript + * @example + * ```javascript * await client.spaceMembership.delete({ * spaceId: '', * spaceMembershipId: '', diff --git a/lib/plain/entities/space.ts b/lib/plain/entities/space.ts index ad79052682..61b923f0b7 100644 --- a/lib/plain/entities/space.ts +++ b/lib/plain/entities/space.ts @@ -14,7 +14,8 @@ export type SpacePlainClientAPI = { * @param params the space ID * @returns the space * @throws if the request fails, or the space is not found - * @example ```javascript + * @example + * ```javascript * const space = await client.space.get({ * spaceId: '', * }); @@ -26,7 +27,8 @@ export type SpacePlainClientAPI = { * @param params (optional) filter and pagination query parameters * @returns a collection of spaces * @throws if the request fails, or the query parameters are malformed - * @example ```javascript + * @example + * ```javascript * const space = await client.space.getMany({ * query: { * limit: 10, @@ -40,7 +42,8 @@ export type SpacePlainClientAPI = { * @param params the organization ID and query parameters * @returns a collection of spaces * @throws if the request fails, the organization is not found, or the query parameters are malformed - * @example ```javascript + * @example + * ```javascript * const space = await client.space.getManyForOrganization({ * organizationId: '', * query: { @@ -58,7 +61,8 @@ export type SpacePlainClientAPI = { * @param payload the space to create * @returns the created space * @throws if the request fails, or the payload is malformed - * @example ```javascript + * @example + * ```javascript * const space = await client.space.create( * { * organizationId: '', @@ -80,7 +84,8 @@ export type SpacePlainClientAPI = { * @param payload the space update * @returns the updated space * @throws if the request fails, the space is not found, or the payload is malformed - * @example ```javascript + * @example + * ```javascript * let space = await client.space.get({ * spaceId: '', * }); @@ -106,7 +111,8 @@ export type SpacePlainClientAPI = { * @param params the space ID * @returns void * @throws if the request fails, or the space is not found - * @example ```javascript + * @example + * ```javascript * await client.space.delete({ * spaceId: '', * }); diff --git a/lib/plain/entities/workflow-definition.ts b/lib/plain/entities/workflow-definition.ts index d090191225..00853e4e14 100644 --- a/lib/plain/entities/workflow-definition.ts +++ b/lib/plain/entities/workflow-definition.ts @@ -49,7 +49,7 @@ export type WorkflowDefinitionPlainClientAPI = { * } * }); * ``` - * */ + **/ getMany( params: OptionalDefaults< GetSpaceEnvironmentParams & { query?: WorkflowDefinitionQueryOptions } diff --git a/package-lock.json b/package-lock.json index f62a5fadd5..24c889c8d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,10 @@ "axios": "^1.7.9", "contentful-sdk-core": "^9.0.1", "fast-copy": "^3.0.0", - "globals": "^15.15.0" + "globals": "^15.15.0", + "typedoc-github-theme": "^0.2.1", + "typedoc-plugin-markdown": "^4.4.2", + "typedoc-plugin-missing-exports": "^3.1.0" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -56,7 +59,7 @@ "semantic-release": "^22.0.12", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.26.2", + "typedoc": "^0.27.9", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5", @@ -2662,6 +2665,17 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "1.27.2", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", + "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^1.27.2", + "@shikijs/types": "^1.27.2", + "@shikijs/vscode-textmate": "^10.0.1" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -3925,69 +3939,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@shikijs/core": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.29.1.tgz", - "integrity": "sha512-Mo1gGGkuOYjDu5H8YwzmOuly9vNr8KDVkqj9xiKhhhFS8jisAtDSEWB9hzqRHLVQgFdA310e8XRJcW4tYhRB2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/engine-javascript": "1.29.1", - "@shikijs/engine-oniguruma": "1.29.1", - "@shikijs/types": "1.29.1", - "@shikijs/vscode-textmate": "^10.0.1", - "@types/hast": "^3.0.4", - "hast-util-to-html": "^9.0.4" - } - }, - "node_modules/@shikijs/engine-javascript": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.29.1.tgz", - "integrity": "sha512-Hpi8k9x77rCQ7F/7zxIOUruNkNidMyBnP5qAGbLFqg4kRrg1HZhkB8btib5EXbQWTtLb5gBHOdBwshk20njD7Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "1.29.1", - "@shikijs/vscode-textmate": "^10.0.1", - "oniguruma-to-es": "^2.2.0" - } - }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.1.tgz", - "integrity": "sha512-gSt2WhLNgEeLstcweQOSp+C+MhOpTsgdNXRqr3zP6M+BUBZ8Md9OU2BYwUYsALBxHza7hwaIWtFHjQ/aOOychw==", - "dev": true, + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz", + "integrity": "sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==", "license": "MIT", "dependencies": { - "@shikijs/types": "1.29.1", + "@shikijs/types": "1.29.2", "@shikijs/vscode-textmate": "^10.0.1" } }, - "node_modules/@shikijs/langs": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-1.29.1.tgz", - "integrity": "sha512-iERn4HlyuT044/FgrvLOaZgKVKf3PozjKjyV/RZ5GnlyYEAZFcgwHGkYboeBv2IybQG1KVS/e7VGgiAU4JY2Gw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "1.29.1" - } - }, - "node_modules/@shikijs/themes": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-1.29.1.tgz", - "integrity": "sha512-lb11zf72Vc9uxkl+aec2oW1HVTHJ2LtgZgumb4Rr6By3y/96VmlU44bkxEb8WBWH3RUtbqAJEN0jljD9cF7H7g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "1.29.1" - } - }, "node_modules/@shikijs/types": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.1.tgz", - "integrity": "sha512-aBqAuhYRp5vSir3Pc9+QPu9WESBOjUo03ao0IHLC4TyTioSsp/SkbAZSrIH4ghYYC1T1KTEpRSBa83bas4RnPA==", - "dev": true, + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.2.tgz", + "integrity": "sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.1", @@ -3995,10 +3960,9 @@ } }, "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", - "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", - "dev": true, + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", "license": "MIT" }, "node_modules/@sindresorhus/is": { @@ -4132,7 +4096,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, "license": "MIT", "dependencies": { "@types/unist": "*" @@ -4159,16 +4122,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, "node_modules/@types/node": { "version": "20.17.17", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.17.tgz", @@ -4204,7 +4157,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -4426,13 +4378,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", - "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", - "dev": true, - "license": "ISC" - }, "node_modules/@vitest/browser": { "version": "2.1.9", "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-2.1.9.tgz", @@ -5040,7 +4985,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, "license": "Python-2.0" }, "node_modules/argv-formatter": { @@ -5394,7 +5338,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -5754,17 +5697,6 @@ "cdl": "bin/cdl.js" } }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/chai": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", @@ -5809,28 +5741,6 @@ "node": ">=10" } }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -6095,17 +6005,6 @@ "node": ">= 0.8" } }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/commander": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", @@ -6870,20 +6769,6 @@ "node": ">=8" } }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", - "dev": true, - "license": "MIT", - "dependencies": { - "dequal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -7026,13 +6911,6 @@ "dev": true, "license": "MIT" }, - "node_modules/emoji-regex-xs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz", - "integrity": "sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==", - "dev": true, - "license": "MIT" - }, "node_modules/emojilib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", @@ -7078,7 +6956,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -8736,44 +8613,6 @@ "node": ">= 0.4" } }, - "node_modules/hast-util-to-html": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.4.tgz", - "integrity": "sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-whitespace": "^3.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "stringify-entities": "^4.0.0", - "zwitch": "^2.0.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/headers-polyfill": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz", @@ -8834,17 +8673,6 @@ "dev": true, "license": "MIT" }, - "node_modules/html-void-elements": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", - "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -10212,7 +10040,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "dev": true, "license": "MIT", "dependencies": { "uc.micro": "^2.0.0" @@ -10847,7 +10674,6 @@ "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true, "license": "MIT" }, "node_modules/lz-string": { @@ -10910,7 +10736,6 @@ "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1", @@ -10993,33 +10818,10 @@ "node": ">= 0.4" } }, - "node_modules/mdast-util-to-hast": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", - "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "trim-lines": "^3.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "dev": true, "license": "MIT" }, "node_modules/media-typer": { @@ -11089,100 +10891,6 @@ "node": ">= 0.6" } }, - "node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-encode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", - "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", - "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz", - "integrity": "sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -14483,18 +14191,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/oniguruma-to-es": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-2.3.0.tgz", - "integrity": "sha512-bwALDxriqfKGfUufKGGepCzu9x7nJQuoRoAFp4AnwehhC2crqrDIAP/uN2qdlsAvSMpeRC3+Yzhqc7hLmle5+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex-xs": "^1.0.0", - "regex": "^5.1.1", - "regex-recursion": "^5.1.1" - } - }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -15230,17 +14926,6 @@ "dev": true, "license": "MIT" }, - "node_modules/property-information": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", - "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -15302,7 +14987,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -15595,34 +15279,6 @@ "@babel/runtime": "^7.8.4" } }, - "node_modules/regex": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/regex/-/regex-5.1.1.tgz", - "integrity": "sha512-dN5I359AVGPnwzJm2jN1k0W9LPZ+ePvoOeVMMfqIMFz53sSwXkxaJoxr50ptnsC771lK95BnTrVSZxq0b9yCGw==", - "dev": true, - "license": "MIT", - "dependencies": { - "regex-utilities": "^2.3.0" - } - }, - "node_modules/regex-recursion": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-5.1.1.tgz", - "integrity": "sha512-ae7SBCbzVNrIjgSbh7wMznPcQel1DNlDtzensnFxpiNpXt1U2ju/bHugH422r+4LAVS1FpW1YCwilmnNsjum9w==", - "dev": true, - "license": "MIT", - "dependencies": { - "regex": "^5.1.1", - "regex-utilities": "^2.3.0" - } - }, - "node_modules/regex-utilities": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", - "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", - "dev": true, - "license": "MIT" - }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", @@ -16577,23 +16233,6 @@ "node": ">=8" } }, - "node_modules/shiki": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.29.1.tgz", - "integrity": "sha512-TghWKV9pJTd/N+IgAIVJtr0qZkB7FfFCUrrEJc0aRmZupo3D1OCVRknQWVRVA7AX/M0Ld7QfoAruPzr3CnUJuw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/core": "1.29.1", - "@shikijs/engine-javascript": "1.29.1", - "@shikijs/engine-oniguruma": "1.29.1", - "@shikijs/langs": "1.29.1", - "@shikijs/themes": "1.29.1", - "@shikijs/types": "1.29.1", - "@shikijs/vscode-textmate": "^10.0.1", - "@types/hast": "^3.0.4" - } - }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -16969,17 +16608,6 @@ "source-map": "^0.6.0" } }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/spawn-error-forwarder": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", @@ -17245,21 +16873,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/stringify-entities": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", - "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", - "dev": true, - "license": "MIT", - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -17816,17 +17429,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/ts-api-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", @@ -17966,17 +17568,16 @@ } }, "node_modules/typedoc": { - "version": "0.26.11", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.11.tgz", - "integrity": "sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==", - "dev": true, + "version": "0.27.9", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", + "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", "license": "Apache-2.0", "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", - "shiki": "^1.16.2", - "yaml": "^2.5.1" + "yaml": "^2.6.1" }, "bin": { "typedoc": "bin/typedoc" @@ -17985,14 +17586,46 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" + } + }, + "node_modules/typedoc-github-theme": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/typedoc-github-theme/-/typedoc-github-theme-0.2.1.tgz", + "integrity": "sha512-pOgsS9CVAOO3JxQ1V0ocDkrPCULpoWg1OzRmn/mOlyG+vEYwUAp5DAoKrGECdNIomycxcisc8ovcMX0nHDgWTA==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "typedoc": "^0.27.6" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.4.2.tgz", + "integrity": "sha512-kJVkU2Wd+AXQpyL6DlYXXRrfNrHrEIUgiABWH8Z+2Lz5Sq6an4dQ/hfvP75bbokjNDUskOdFlEEm/0fSVyC7eg==", + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.27.x" + } + }, + "node_modules/typedoc-plugin-missing-exports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-3.1.0.tgz", + "integrity": "sha512-Sogbaj+qDa21NjB3SlIw4JXSwmcl/WOjwiPNaVEcPhpNG/MiRTtpwV81cT7h1cbu9StpONFPbddYWR0KV/fTWA==", + "license": "MIT", + "peerDependencies": { + "typedoc": "0.26.x || 0.27.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -18002,7 +17635,6 @@ "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -18018,7 +17650,6 @@ "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", - "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -18055,7 +17686,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "dev": true, "license": "MIT" }, "node_modules/uglify-js": { @@ -18188,79 +17818,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/universal-user-agent": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", @@ -18401,36 +17958,6 @@ "node": ">= 0.8" } }, - "node_modules/vfile": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", - "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-message": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", - "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/vite": { "version": "5.4.14", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz", @@ -19125,7 +18652,6 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", - "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -19188,17 +18714,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zwitch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", - "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } } } } diff --git a/package.json b/package.json index 702be96431..fe3257fc82 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "build:standalone": "webpack && NODE_ENV=production webpack", "build:standalone:log": "NODE_ENV=production WEBPACK_MODE=log webpack --json --profile --progress > webpack-build-log.json && webpack-bundle-analyzer webpack-build-log.json", "build:types": "rimraf dist/typings && tsc --declaration --noEmit false --emitDeclarationOnly true --allowJs false", - "build:docs": "typedoc", + "build:docs": "typedoc --options typedoc.json", "docs:dev": "npm run build && npm run build:docs", "docs:watch": "nodemon --exec npm run docs:dev -w lib typings", "docs:publish": "npm run build:docs && ./node_modules/contentful-sdk-jsdoc/bin/publish-docs.sh contentful-management.js contentful-management", @@ -70,7 +70,10 @@ "axios": "^1.7.9", "contentful-sdk-core": "^9.0.1", "fast-copy": "^3.0.0", - "globals": "^15.15.0" + "globals": "^15.15.0", + "typedoc-github-theme": "^0.2.1", + "typedoc-plugin-markdown": "^4.4.2", + "typedoc-plugin-missing-exports": "^3.1.0" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -113,7 +116,7 @@ "semantic-release": "^22.0.12", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.26.2", + "typedoc": "^0.27.9", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5", diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 0000000000..1eddfb06f1 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,29 @@ +{ + "name": "contentful-management.js", + "entryPoints": [ + "lib/contentful-management.ts", + "lib/plain/plain-client.ts", + "lib/plain/wrappers/wrap.ts", + "lib/contentful-management.ts", + "lib/create-adapter.ts", + "lib/create-contentful-api.ts", + "lib/entities/app-action.ts", + "lib/entities/environment-template-installation.ts" + ], + "out": "out", + "includeVersion": true, + "categorizeByGroup": true, + "categoryOrder": ["Core", "Clients", "Entities", "Utilities", "*"], + "readme": "README.md", + "excludePrivate": false, + "excludeInternal": false, + "excludeProtected": false, + "treatWarningsAsErrors": true, + "sort": ["source-order"], + "plugin": [ + "typedoc-plugin-missing-exports", + "typedoc-github-theme" + //"typedoc-plugin-markdown" + ], + "theme": "typedoc-github-theme" +} From eec30644b32305de820cb7d35f9db666c091b3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Thu, 20 Mar 2025 13:31:10 +0100 Subject: [PATCH 02/21] dx: simplify doc scripts to essentials --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fe3257fc82..50bfe73efa 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,8 @@ "build:standalone": "webpack && NODE_ENV=production webpack", "build:standalone:log": "NODE_ENV=production WEBPACK_MODE=log webpack --json --profile --progress > webpack-build-log.json && webpack-bundle-analyzer webpack-build-log.json", "build:types": "rimraf dist/typings && tsc --declaration --noEmit false --emitDeclarationOnly true --allowJs false", - "build:docs": "typedoc --options typedoc.json", - "docs:dev": "npm run build && npm run build:docs", - "docs:watch": "nodemon --exec npm run docs:dev -w lib typings", + "docs:build": "typedoc --options typedoc.json", + "docs:dev": "npm run docs:build -- --watch", "docs:publish": "npm run build:docs && ./node_modules/contentful-sdk-jsdoc/bin/publish-docs.sh contentful-management.js contentful-management", "check-types": "tsc", "lint": "eslint lib test", From 3153cceb1d55bfb26bef93d3613e9c9235c0fa78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Thu, 20 Mar 2025 14:56:14 +0100 Subject: [PATCH 03/21] refactor: further improving and cleaning up typedocs config --- package-lock.json | 16 ++++++++++++++ package.json | 11 +++++----- tsconfig.json | 12 +---------- typedoc.json | 53 +++++++++++++++++++++++++++++++++++------------ 4 files changed, 62 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24c889c8d3..15ed432da3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13020,6 +13020,10 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/agent": { + "extraneous": true, + "inBundle": true + }, "node_modules/npm/node_modules/node-gyp/node_modules/chownr": { "version": "3.0.0", "dev": true, @@ -13057,6 +13061,10 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/ssri": { + "extraneous": true, + "inBundle": true + }, "node_modules/npm/node_modules/node-gyp/node_modules/tar": { "version": "7.4.3", "dev": true, @@ -13074,6 +13082,14 @@ "node": ">=18" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/unique-filename": { + "extraneous": true, + "inBundle": true + }, + "node_modules/npm/node_modules/node-gyp/node_modules/unique-slug": { + "extraneous": true, + "inBundle": true + }, "node_modules/npm/node_modules/node-gyp/node_modules/yallist": { "version": "5.0.0", "dev": true, diff --git a/package.json b/package.json index 50bfe73efa..052f315c8a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "build:standalone": "webpack && NODE_ENV=production webpack", "build:standalone:log": "NODE_ENV=production WEBPACK_MODE=log webpack --json --profile --progress > webpack-build-log.json && webpack-bundle-analyzer webpack-build-log.json", "build:types": "rimraf dist/typings && tsc --declaration --noEmit false --emitDeclarationOnly true --allowJs false", - "docs:build": "typedoc --options typedoc.json", + "docs:build": "typedoc", "docs:dev": "npm run docs:build -- --watch", "docs:publish": "npm run build:docs && ./node_modules/contentful-sdk-jsdoc/bin/publish-docs.sh contentful-management.js contentful-management", "check-types": "tsc", @@ -69,10 +69,7 @@ "axios": "^1.7.9", "contentful-sdk-core": "^9.0.1", "fast-copy": "^3.0.0", - "globals": "^15.15.0", - "typedoc-github-theme": "^0.2.1", - "typedoc-plugin-markdown": "^4.4.2", - "typedoc-plugin-missing-exports": "^3.1.0" + "globals": "^15.15.0" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -115,7 +112,9 @@ "semantic-release": "^22.0.12", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.27.9", + "typedoc": "^0.28.1", + "typedoc-github-theme": "^0.2.1", + "typedoc-plugin-missing-exports": "^3.1.0", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5", diff --git a/tsconfig.json b/tsconfig.json index e21df64f4c..2344ffccfd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,15 +12,5 @@ "typeRoots": ["node_modules/@types"], "skipLibCheck": true }, - "include": ["lib", "global-types"], - "typedocOptions": { - "out": "./out", - "entryPoints": ["./lib/contentful-management.ts"], - "readme": "README.md", - "name": "contentful-management.js", - "exclude": ["./lib/adapters/REST/endpoints/*"], - "includeVersion": true, - "hideGenerator": true, - "excludePrivate": true - } + "include": ["lib", "global-types"] } diff --git a/typedoc.json b/typedoc.json index 1eddfb06f1..200dd2105e 100644 --- a/typedoc.json +++ b/typedoc.json @@ -2,28 +2,55 @@ "name": "contentful-management.js", "entryPoints": [ "lib/contentful-management.ts", - "lib/plain/plain-client.ts", - "lib/plain/wrappers/wrap.ts", - "lib/contentful-management.ts", - "lib/create-adapter.ts", - "lib/create-contentful-api.ts", - "lib/entities/app-action.ts", - "lib/entities/environment-template-installation.ts" + // "lib/plain/plain-client.ts", + // "lib/plain/wrappers/wrap.ts", + // "lib/contentful-management.ts", + // "lib/create-adapter.ts", + // "lib/create-contentful-api.ts", + // "lib/entities/app-action.ts", + // "lib/entities/environment-template-installation.ts" ], "out": "out", "includeVersion": true, - "categorizeByGroup": true, - "categoryOrder": ["Core", "Clients", "Entities", "Utilities", "*"], + // "categorizeByGroup": true, + // "categoryOrder": ["Core", "Clients", "Entities", "Utilities", "*"], + "categoryOrder": ["createClient", "ClientParams", "ContentType", "Entry", "*"], + // "groupOrder": ["Variables", "Functions", "*"], + "kindSortOrder": [ + "Reference", + "Project", + "Module", + "Namespace", + "Constructor", + "Property", + "Function", + "Enum", + "EnumMember", + "Class", + "Interface", + "TypeAlias", + "Variable", + "Accessor", + "Method", + "Parameter", + "TypeParameter", + "TypeLiteral", + "CallSignature", + "ConstructorSignature", + "IndexSignature", + "GetSignature", + "SetSignature" + ], + "sortEntryPoints": false, "readme": "README.md", "excludePrivate": false, "excludeInternal": false, "excludeProtected": false, - "treatWarningsAsErrors": true, + "treatWarningsAsErrors": false, "sort": ["source-order"], "plugin": [ "typedoc-plugin-missing-exports", "typedoc-github-theme" - //"typedoc-plugin-markdown" ], - "theme": "typedoc-github-theme" -} + "hideGenerator": true, +} \ No newline at end of file From e12b6de9d3edbd69c0c4eaecddd0a43f0d16bba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Thu, 20 Mar 2025 14:57:22 +0100 Subject: [PATCH 04/21] refactor: use @returns instead of @return to match typedocs standard --- lib/create-app-definition-api.ts | 16 ++--- lib/create-contentful-api.ts | 38 +++++----- lib/create-entry-api.ts | 14 ++-- lib/create-environment-api.ts | 94 ++++++++++++------------- lib/create-environment-template-api.ts | 16 ++--- lib/create-organization-api.ts | 78 ++++++++++---------- lib/create-space-api.ts | 76 ++++++++++---------- lib/create-ui-config-api.ts | 2 +- lib/create-user-ui-config-api.ts | 2 +- lib/entities/access-token.ts | 6 +- lib/entities/api-key.ts | 6 +- lib/entities/app-access-token.ts | 2 +- lib/entities/app-action-call.ts | 4 +- lib/entities/app-action.ts | 6 +- lib/entities/app-bundle.ts | 6 +- lib/entities/app-definition.ts | 4 +- lib/entities/app-details.ts | 6 +- lib/entities/app-event-subscription.ts | 4 +- lib/entities/app-installation.ts | 6 +- lib/entities/app-key.ts | 6 +- lib/entities/app-signed-request.ts | 2 +- lib/entities/app-signing-secret.ts | 4 +- lib/entities/app-upload.ts | 6 +- lib/entities/asset-key.ts | 2 +- lib/entities/asset.ts | 18 ++--- lib/entities/bulk-action.ts | 2 +- lib/entities/content-type.ts | 14 ++-- lib/entities/editor-interface.ts | 4 +- lib/entities/entry.ts | 2 +- lib/entities/environment-alias.ts | 8 +-- lib/entities/extension.ts | 6 +- lib/entities/function-log.ts | 4 +- lib/entities/function.ts | 2 +- lib/entities/locale.ts | 6 +- lib/entities/oauth-application.ts | 10 +-- lib/entities/organization-invitation.ts | 2 +- lib/entities/organization-membership.ts | 4 +- lib/entities/organization.ts | 2 +- lib/entities/personal-access-token.ts | 6 +- lib/entities/preview-api-key.ts | 2 +- lib/entities/release-action.ts | 2 +- lib/entities/release.ts | 2 +- lib/entities/resource-provider.ts | 10 +-- lib/entities/resource-type.ts | 6 +- lib/entities/role.ts | 6 +- lib/entities/snapshot.ts | 4 +- lib/entities/space-member.ts | 2 +- lib/entities/space-membership.ts | 6 +- lib/entities/space.ts | 2 +- lib/entities/team-membership.ts | 6 +- lib/entities/team-space-membership.ts | 6 +- lib/entities/team.ts | 6 +- lib/entities/ui-config.ts | 2 +- lib/entities/upload-credential.ts | 4 +- lib/entities/upload.ts | 4 +- lib/entities/usage.ts | 2 +- lib/entities/user-ui-config.ts | 2 +- lib/entities/user.ts | 4 +- lib/entities/webhook.ts | 12 ++-- 59 files changed, 293 insertions(+), 293 deletions(-) diff --git a/lib/create-app-definition-api.ts b/lib/create-app-definition-api.ts index d4a7cfd5c0..ad8be2d98f 100644 --- a/lib/create-app-definition-api.ts +++ b/lib/create-app-definition-api.ts @@ -25,7 +25,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -57,7 +57,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -85,7 +85,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets an app bundle * @param id - AppBundle ID - * @return Promise for an AppBundle + * @returns Promise for an AppBundle * @example * ```javascript * const contentful = require('contentful-management') @@ -115,7 +115,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets a collection of AppBundles - * @return Promise for a collection of AppBundles + * @returns Promise for a collection of AppBundles * @example * ```javascript * const contentful = require('contentful-management') @@ -142,7 +142,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Creates an app bundle * @param Object representation of the App Bundle to be created - * @return Promise for the newly created AppBundle + * @returns Promise for the newly created AppBundle * @example * ```javascript * const contentful = require('contentful-management') @@ -172,7 +172,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets a list of App Installations across an org for given organization and App Definition * If a spaceId is provided in the query object, it will return the App Installations for that specific space. - * @return Promise for the newly created AppBundle + * @returns Promise for the newly created AppBundle * @example * ```javascript * const contentful = require('contentful-management') @@ -202,7 +202,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Creates or updates a resource provider * @param data representation of the ResourceProvider - * @return Promise for the newly created or updated ResourceProvider + * @returns Promise for the newly created or updated ResourceProvider * @example * ```javascript * const contentful = require('contentful-management') @@ -244,7 +244,7 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { }, /** * Gets a Resource Provider - * @return Promise for a Resource Provider + * @returns Promise for a Resource Provider * @example * ```javascript * const contentful = require('contentful-management') diff --git a/lib/create-contentful-api.ts b/lib/create-contentful-api.ts index c0aa9c0785..e4b27743e1 100644 --- a/lib/create-contentful-api.ts +++ b/lib/create-contentful-api.ts @@ -54,7 +54,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets all environment templates for a given organization with the lasted version * @param organizationId - Organization ID - * @return Promise for a collection of EnvironmentTemplates + * @returns Promise for a collection of EnvironmentTemplates * ```javascript * const contentful = require('contentful-management') * @@ -83,7 +83,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * @param params.organizationId - Organization ID * @param params.environmentTemplateId - Environment template ID * @param [params.version] - Template version number to return a specific version of the environment template - * @return Promise for a EnvironmentTemplate + * @returns Promise for a EnvironmentTemplate * ```javascript * const contentful = require('contentful-management') * @@ -124,7 +124,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * Creates an environment template * @param organizationId - Organization ID * @param environmentTemplateData - Object representation of the environment template to be created - * @return Promise for the newly created EnvironmentTemplate + * @returns Promise for the newly created EnvironmentTemplate * @example * ```javascript * const contentful = require('contentful-management') @@ -151,7 +151,7 @@ export default function createClientApi(makeRequest: MakeRequest) { }, /** * Gets all spaces - * @return Promise for a collection of Spaces + * @returns Promise for a collection of Spaces * ```javascript * const contentful = require('contentful-management') * @@ -177,7 +177,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a space * @param spaceId - Space ID - * @return Promise for a Space + * @returns Promise for a Space * ```javascript * const contentful = require('contentful-management') * @@ -202,7 +202,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * Creates a space * @param spaceData - Object representation of the Space to be created * @param organizationId - Organization ID, if the associated token can manage more than one organization. - * @return Promise for the newly created Space + * @returns Promise for the newly created Space * @example * ```javascript * const contentful = require('contentful-management') @@ -233,7 +233,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets an organization * @param id - Organization ID - * @return Promise for a Organization + * @returns Promise for a Organization * @example * ```javascript * const contentful = require('contentful-management') @@ -257,7 +257,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a collection of Organizations - * @return Promise for a collection of Organizations + * @returns Promise for a collection of Organizations * @example * ```javascript * const contentful = require('contentful-management') @@ -283,7 +283,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets the authenticated user - * @return Promise for a User + * @returns Promise for a User * @example * ```javascript * const contentful = require('contentful-management') @@ -396,7 +396,7 @@ export default function createClientApi(makeRequest: MakeRequest) { }, /** * Gets App Definition - * @return Promise for App Definition + * @returns Promise for App Definition * @example * ```javascript * const contentful = require('contentful-management') @@ -424,7 +424,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Creates a personal access token * @param data - personal access token config - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -465,7 +465,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * * Gets a personal access token * @param tokenId - personal access token config - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -491,7 +491,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * @deprecated - use getAccessTokens instead * * Gets all personal access tokens - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -516,7 +516,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a users access token * @param tokenId - users access token config - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -540,7 +540,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets all user access tokens - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -565,7 +565,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Retrieves a list of redacted versions of access tokens for an organization, accessible to owners or administrators of an organization. * - * @return Promise for a Token + * @returns Promise for a Token * @example * ```javascript * const contentful = require('contentful-management') @@ -595,7 +595,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * * @param organizationId - Id of an organization * @param query - Query parameters - * @return Promise of a collection of usages + * @returns Promise of a collection of usages * @example * ```javascript * @@ -631,7 +631,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * * @param organizationId - Id of an organization * @param query - Query parameters - * @return Promise of a collection of usages + * @returns Promise of a collection of usages * ```javascript * const contentful = require('contentful-management') * @@ -665,7 +665,7 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Make a custom request to the Contentful management API's /spaces endpoint * @param opts - axios request options (https://github.com/mzabriskie/axios) - * @return Promise for the response data + * @returns Promise for the response data * ```javascript * const contentful = require('contentful-management') * diff --git a/lib/create-entry-api.ts b/lib/create-entry-api.ts index 9d4efd16b5..6118c70306 100644 --- a/lib/create-entry-api.ts +++ b/lib/create-entry-api.ts @@ -36,7 +36,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -69,7 +69,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Sends an JSON patch to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -108,7 +108,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -133,7 +133,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Publishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -163,7 +163,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unpublishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -193,7 +193,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Archives the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -222,7 +222,7 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unarchives the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') diff --git a/lib/create-environment-api.ts b/lib/create-environment-api.ts index c40ca0bac2..69671d24e0 100644 --- a/lib/create-environment-api.ts +++ b/lib/create-environment-api.ts @@ -65,7 +65,7 @@ export type ContentfulEnvironmentAPI = ReturnType /** * Creates API object with methods to access the Environment API * @param {ContentfulEnvironmentAPI} makeRequest - function to make requests via an adapter - * @return {ContentfulSpaceAPI} + * @returns {ContentfulSpaceAPI} * @private */ export default function createEnvironmentApi(makeRequest: MakeRequest) { @@ -90,7 +90,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { return { /** * Deletes the environment - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -118,7 +118,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Updates the environment - * @return Promise for the updated environment. + * @returns Promise for the updated environment. * @example * ```javascript * const contentful = require('contentful-management') @@ -151,7 +151,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates SDK Entry object (locally) from entry data * @param entryData - Entry Data - * @return Entry + * @returns Entry * @example * ```javascript * environment.getEntry('entryId').then(entry => { @@ -185,7 +185,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates SDK Asset object (locally) from entry data * @param assetData - Asset ID - * @return Asset + * @returns Asset * @example * ```javascript * environment.getAsset('asset_id').then(asset => { @@ -433,7 +433,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a Content Type * @param contentTypeId - Content Type ID - * @return Promise for a Content Type + * @returns Promise for a Content Type * @example * ```javascript * const contentful = require('contentful-management') @@ -466,7 +466,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of Content Types * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Content Types + * @returns Promise for a collection of Content Types * @example * ```javascript * const contentful = require('contentful-management') @@ -497,7 +497,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates a Content Type * @param data - Object representation of the Content Type to be created - * @return Promise for the newly created Content Type + * @returns Promise for the newly created Content Type * @example * ```javascript * const contentful = require('contentful-management') @@ -541,7 +541,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Content Type with a custom ID * @param contentTypeId - Content Type ID * @param data - Object representation of the Content Type to be created - * @return Promise for the newly created Content Type + * @returns Promise for the newly created Content Type * @example * ```javascript * const contentful = require('contentful-management') @@ -586,7 +586,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an EditorInterface for a ContentType * @param contentTypeId - Content Type ID - * @return Promise for an EditorInterface + * @returns Promise for an EditorInterface * @example * ```javascript * const contentful = require('contentful-management') @@ -617,7 +617,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets all EditorInterfaces - * @return Promise for a collection of EditorInterface + * @returns Promise for a collection of EditorInterface * @example * ```javascript * const contentful = require('contentful-management') @@ -651,7 +651,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * from your entry in the backend * @param id - Entry ID * @param query - Object with search parameters. In this method it's only useful for `locale`. - * @return Promise for an Entry + * @returns Promise for an Entry * @example * ```javascript * const contentful = require('contentful-management') @@ -684,7 +684,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Deletes an Entry of this environment * @param id - Entry ID - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -720,7 +720,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Warning: if you are using the select operator, when saving, any field that was not selected will be removed * from your entry in the backend * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Entries + * @returns Promise for a collection of Entries * @example * ```javascript * const contentful = require('contentful-management') @@ -752,7 +752,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of published Entries * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of published Entries + * @returns Promise for a collection of published Entries * @example * ```javascript * const contentful = require('contentful-management') @@ -785,7 +785,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Entry * @param contentTypeId - The Content Type ID of the newly created Entry * @param data - Object representation of the Entry to be created - * @return Promise for the newly created Entry + * @returns Promise for the newly created Entry * @example * ```javascript * const contentful = require('contentful-management') @@ -826,7 +826,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param contentTypeId - The Content Type of the newly created Entry * @param id - Entry ID * @param data - Object representation of the Entry to be created - * @return Promise for the newly created Entry + * @returns Promise for the newly created Entry * @example * ```javascript * const contentful = require('contentful-management') @@ -907,7 +907,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * from your entry in the backend * @param id - Asset ID * @param query - Object with search parameters. In this method it's only useful for `locale`. - * @return Promise for an Asset + * @returns Promise for an Asset * @example * ```javascript * const contentful = require('contentful-management') @@ -942,7 +942,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Warning: if you are using the select operator, when saving, any field that was not selected will be removed * from your entry in the backend * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Assets + * @returns Promise for a collection of Assets * @example * ```javascript * const contentful = require('contentful-management') @@ -973,7 +973,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of published Assets * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of published Assets + * @returns Promise for a collection of published Assets * @example * ```javascript * const contentful = require('contentful-management') @@ -1004,7 +1004,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing. * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished. - * @return Promise for the newly created Asset + * @returns Promise for the newly created Asset * @example * ```javascript * const client = contentful.createClient({ @@ -1049,7 +1049,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing. * @param id - Asset ID * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished. - * @return Promise for the newly created Asset + * @returns Promise for the newly created Asset * @example * ```javascript * const client = contentful.createClient({ @@ -1093,7 +1093,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing. * @param data - Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished. * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream. - * @return Promise for the newly created Asset + * @returns Promise for the newly created Asset * @example * ```javascript * const client = contentful.createClient({ @@ -1139,7 +1139,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates an asset key for signing asset URLs (Embargoed Assets) * @param data Object with request payload * @param data.expiresAt number a UNIX timestamp in the future (but not more than 48 hours from time of calling) - * @return Promise for the newly created AssetKey + * @returns Promise for the newly created AssetKey * @example * ```javascript * const client = contentful.createClient({ @@ -1172,7 +1172,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an Upload * @param id - Upload ID - * @return Promise for an Upload + * @returns Promise for an Upload * @example * ```javascript * const client = contentful.createClient({ @@ -1203,7 +1203,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a Upload. * @param data - Object with file information. * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream. - * @return Upload object containing information about the uploaded file. + * @returns Upload object containing information about the uploaded file. * @example * ```javascript * const client = contentful.createClient({ @@ -1233,7 +1233,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a Locale * @param localeId - Locale ID - * @return Promise for an Locale + * @returns Promise for an Locale * @example * ```javascript * const contentful = require('contentful-management') @@ -1264,7 +1264,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of Locales - * @return Promise for a collection of Locales + * @returns Promise for a collection of Locales * @example * ```javascript * const contentful = require('contentful-management') @@ -1295,7 +1295,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates a Locale * @param data - Object representation of the Locale to be created - * @return Promise for the newly created Locale + * @returns Promise for the newly created Locale * @example * ```javascript * const contentful = require('contentful-management') @@ -1332,7 +1332,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an UI Extension * @param id - Extension ID - * @return Promise for an UI Extension + * @returns Promise for an UI Extension * @example * ```javascript * const contentful = require('contentful-management') @@ -1362,7 +1362,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Gets a collection of UI Extension - * @return Promise for a collection of UI Extensions + * @returns Promise for a collection of UI Extensions * @example * ```javascript * const contentful = require('contentful-management') @@ -1392,7 +1392,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates a UI Extension * @param data - Object representation of the UI Extension to be created - * @return Promise for the newly created UI Extension + * @returns Promise for the newly created UI Extension * @example * ```javascript * const contentful = require('contentful-management') @@ -1438,7 +1438,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates a UI Extension with a custom ID * @param id - Extension ID * @param data - Object representation of the UI Extension to be created - * @return Promise for the newly created UI Extension + * @returns Promise for the newly created UI Extension * @example * ```javascript * const contentful = require('contentful-management') @@ -1487,7 +1487,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appDefinitionId - AppDefinition ID * @param data - AppInstallation data * @param options.acceptAllTerms - Flag for accepting Apps' Marketplace EULA, Terms, and Privacy policy (need to pass `{acceptAllTerms: true}` to install a marketplace app) - * @return Promise for an App Installation + * @returns Promise for an App Installation * @example * ```javascript * const contentful = require('contentful-management') @@ -1528,7 +1528,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an App Installation * @param id - AppDefintion ID - * @return Promise for an App Installation + * @returns Promise for an App Installation * @example * ```javascript * const contentful = require('contentful-management') @@ -1558,7 +1558,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Gets a collection of App Installation - * @return Promise for a collection of App Installations + * @returns Promise for a collection of App Installations * @example * ```javascript * const contentful = require('contentful-management') @@ -1590,7 +1590,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appDefinitionId - AppDefinition ID * @param appActionId - action ID * @param data - App Action Call data - * @return Promise for an App Action Call + * @returns Promise for an App Action Call * @example * ```javascript * const contentful = require('contentful-management') @@ -1637,7 +1637,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates an app signed request * @param appDefinitionId - AppDefinition ID * @param data - SignedRequest data - * @return Promise for a Signed Request + * @returns Promise for a Signed Request * @example * ```javascript * const contentful = require('contentful-management') @@ -1679,7 +1679,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Creates an app access token * @param appDefinitionId - AppDefinition ID * @param data - Json Web Token - * @return Promise for an app access token + * @returns Promise for an app access token * @example * ```javascript * const contentful = require('contentful-management') @@ -1719,7 +1719,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of Functions for a given environment * @param appInstallationId * @param {import('../common-types').AcceptsQueryOptions} query - optional query parameter for filtering functions by action - * @return Promise containing wrapped collection of Functions in an environment + * @returns Promise containing wrapped collection of Functions in an environment * @example * ```javascript * const contentful = require('contentful-management') @@ -1754,7 +1754,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appInstallationId * @param functionId * @param {import('../common-types').CursorBasedParams} query - optional query parameter for pagination (limit, nextPage, prevPage) - * @return Promise containing wrapped collection of FunctionLogs + * @returns Promise containing wrapped collection of FunctionLogs * @example * ```javascript * const contentful = require('contentful-management') @@ -1811,7 +1811,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appInstallationId * @param functionId * @param logId - * @return Promise containing a wrapped FunctionLog + * @returns Promise containing a wrapped FunctionLog * @example * ```javascript * const contentful = require('contentful-management') @@ -1854,7 +1854,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @func getEntrySnapshots * @param entryId - Entry ID * @param query - query additional query paramaters - * @return Promise for a collection of Entry Snapshots + * @returns Promise for a collection of Entry Snapshots * @example * ```javascript * const contentful = require('contentful-management') @@ -1888,7 +1888,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @func getContentTypeSnapshots * @param contentTypeId - Content Type ID * @param query - query additional query paramaters - * @return Promise for a collection of Content Type Snapshots + * @returns Promise for a collection of Content Type Snapshots * @example * ```javascript * const contentful = require('contentful-management') @@ -2447,7 +2447,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of all environment template installations in the environment for a given template * @param environmentTemplateId - Environment template ID to return installations for * @param [options.installationId] - Installation ID to filter for a specific installation - * @return Promise for a collection of EnvironmentTemplateInstallations + * @returns Promise for a collection of EnvironmentTemplateInstallations * ```javascript * const contentful = require('contentful-management') * @@ -2484,7 +2484,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of all resource types based on native external references app installations in the environment * @param query - BasicCursorPaginationOptions - * @return Promise for a collection of ResourceTypes + * @returns Promise for a collection of ResourceTypes * ```javascript * const contentful = require('contentful-management') * @@ -2517,7 +2517,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * Gets a collection of all resources for a given resource type based on native external references app installations in the environment * @param resourceTypeId - Id of the resourceType to get its resources * @param query - Either LookupQuery options with 'sys.urn[in]' param or a Search query with 'query' param, in both cases you can add pagination options - * @return Promise for a collection of Resources for a given resourceTypeId + * @returns Promise for a collection of Resources for a given resourceTypeId * ```javascript * const contentful = require('contentful-management') * diff --git a/lib/create-environment-template-api.ts b/lib/create-environment-template-api.ts index c884480db1..4ac9eccf22 100644 --- a/lib/create-environment-template-api.ts +++ b/lib/create-environment-template-api.ts @@ -18,7 +18,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat return { /** * Updates a environment template - * @return Promise for new version of the template + * @returns Promise for new version of the template * ```javascript * const contentful = require('contentful-management') * @@ -49,7 +49,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat * Updates environment template version data * @param version.versionName - Name of the environment template version * @param version.versionDescription - Description of the environment template version - * @return Promise for an updated EnvironmentTemplate + * @returns Promise for an updated EnvironmentTemplate * ```javascript * const contentful = require('contentful-management') * @@ -86,7 +86,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat }, /** * Deletes the environment template - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -111,7 +111,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat }, /** * Gets a collection of all versions for the environment template - * @return Promise for a EnvironmentTemplate + * @returns Promise for a EnvironmentTemplate * ```javascript * const contentful = require('contentful-management') * @@ -139,7 +139,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat * Gets a collection of all installations for the environment template * @param [installationParams.spaceId] - Space ID to filter installations by space and environment * @param [installationParams.environmentId] - Environment ID to filter installations by space and environment - * @return Promise for a collection of EnvironmentTemplateInstallations + * @returns Promise for a collection of EnvironmentTemplateInstallations * ```javascript * const contentful = require('contentful-management') * @@ -183,7 +183,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat * @param [params.version] - Version of the template * @param [params.installation.takeover] - Already existing Content types to takeover in the target environment * @param [params.changeSet] - Change set which should be applied - * @return Promise for a EnvironmentTemplateValidation + * @returns Promise for a EnvironmentTemplateValidation * ```javascript * const contentful = require('contentful-management') * @@ -235,7 +235,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat * @param params.installation.version- Template version which should be installed * @param [params.installation.takeover] - Already existing Content types tp takeover in the target environment * @param [params.changeSet] - Change set which should be applied - * @return Promise for a EnvironmentTemplateInstallation + * @returns Promise for a EnvironmentTemplateInstallation * ```javascript * const contentful = require('contentful-management') * @@ -280,7 +280,7 @@ export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizat * Disconnects the template from a given environment * @param params.spaceId - Space ID where the template should be installed into * @param params.environmentId - Environment ID where the template should be installed into - * @return Promise for the disconnection with no data + * @returns Promise for the disconnection with no data * ```javascript * const contentful = require('contentful-management') * diff --git a/lib/create-organization-api.ts b/lib/create-organization-api.ts index a5bbe82ceb..1c610b5637 100644 --- a/lib/create-organization-api.ts +++ b/lib/create-organization-api.ts @@ -28,7 +28,7 @@ export type ContentfulOrganizationAPI = ReturnType /** * Creates API object with methods to access the Organization API * @param {MakeRequest} makeRequest - function to make requests via an adapter - * @return {ContentfulOrganizationAPI} + * @returns {ContentfulOrganizationAPI} * @private */ export default function createOrganizationApi(makeRequest: MakeRequest) { @@ -56,7 +56,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a collection of spaces in the organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise a collection of Spaces in the organization + * @returns Promise a collection of Spaces in the organization * @example * ```javascript * const contentful = require('contentful-management') @@ -84,7 +84,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a User - * @return Promise for a User + * @returns Promise for a User * @example * ```javascript * const contentful = require('contentful-management') @@ -109,7 +109,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a collection of Users in organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise a collection of Users in organization + * @returns Promise a collection of Users in organization * @example * ```javascript * const contentful = require('contentful-management') @@ -137,7 +137,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an Organization Membership * @param id - Organization Membership ID - * @return Promise for an Organization Membership + * @returns Promise for an Organization Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -166,7 +166,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a collection of Organization Memberships * @param params - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Organization Memberships + * @returns Promise for a collection of Organization Memberships * @example * ```javascript * const contentful = require('contentful-management') @@ -276,7 +276,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { * Creates a Team membership * @param teamId - Id of the team the membership will be created in * @param data - Object representation of the Team Membership to be created - * @return Promise for the newly created TeamMembership + * @returns Promise for the newly created TeamMembership * @example * ```javascript * const contentful = require('contentful-management') @@ -305,7 +305,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Team Membership from the team with given teamId - * @return Promise for an Team Membership + * @returns Promise for an Team Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -330,7 +330,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization. - * @return Promise for a Team Membership Collection + * @returns Promise for a Team Membership Collection * @example * ```javascript * const contentful = require('contentful-management') @@ -372,7 +372,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization. - * @return Promise for a Team Space Membership Collection + * @returns Promise for a Team Space Membership Collection * @example * ```javascript * const contentful = require('contentful-management') @@ -401,7 +401,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get a Team Space Membership with given teamSpaceMembershipId - * @return Promise for a Team Space Membership + * @returns Promise for a Team Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -430,7 +430,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an Space Membership in Organization * @param id - Organiztion Space Membership ID - * @return Promise for a Space Membership in an organization + * @returns Promise for a Space Membership in an organization * @example * ```javascript * const contentful = require('contentful-management') @@ -458,7 +458,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a collection Space Memberships in organization * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a Space Membership collection across all spaces in the organization + * @returns Promise for a Space Membership collection across all spaces in the organization * @example * ```javascript * const contentful = require('contentful-management') @@ -485,7 +485,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Invitation in Organization - * @return Promise for a OrganizationInvitation in an organization + * @returns Promise for a OrganizationInvitation in an organization * @example * ```javascript * const contentful = require('contentful-management') @@ -512,7 +512,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Create an Invitation in Organization - * @return Promise for a OrganizationInvitation in an organization + * @returns Promise for a OrganizationInvitation in an organization * @example * ```javascript * const contentful = require('contentful-management') @@ -543,7 +543,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Roles - * @return Promise for a collection of Roles + * @returns Promise for a collection of Roles * @example * ```javascript * const contentful = require('contentful-management') @@ -569,7 +569,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates an app definition * @param Object representation of the App Definition to be created - * @return Promise for the newly created AppDefinition + * @returns Promise for the newly created AppDefinition * @example * ```javascript * const contentful = require('contentful-management') @@ -598,7 +598,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets all app definitions - * @return Promise for a collection of App Definitions + * @returns Promise for a collection of App Definitions * @example * ```javascript * const contentful = require('contentful-management') @@ -623,7 +623,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app definition - * @return Promise for an App Definition + * @returns Promise for an App Definition * @example * ```javascript * const contentful = require('contentful-management') @@ -648,7 +648,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app upload - * @return Promise for an App Upload + * @returns Promise for an App Upload * @example * ```javascript * const contentful = require('contentful-management') @@ -674,7 +674,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates an app upload - * @return Promise for an App Upload + * @returns Promise for an App Upload * @example * ```javascript * const contentful = require('contentful-management') @@ -700,7 +700,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app signing secret - * @return Promise for an App SigningSecret + * @returns Promise for an App SigningSecret * @example * ```javascript * const contentful = require('contentful-management') @@ -726,7 +726,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app signing secret - * @return Promise for an App SigningSecret + * @returns Promise for an App SigningSecret * @example * ```javascript * const contentful = require('contentful-management') @@ -751,7 +751,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Deletes an app signing secret - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -778,7 +778,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app event subscription - * @return Promise for an App Event Subscription + * @returns Promise for an App Event Subscription * @example * ```javascript * const contentful = require('contentful-management') @@ -804,7 +804,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app event subscription - * @return Promise for an App Event Subscription + * @returns Promise for an App Event Subscription * @example * ```javascript * const contentful = require('contentful-management') @@ -829,7 +829,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Deletes the current App Event Subscription for the given App - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -856,7 +856,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app event subscription - * @return Promise for an App Event Subscription + * @returns Promise for an App Event Subscription * @example * ```javascript * const contentful = require('contentful-management') @@ -889,7 +889,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app key by fingerprint - * @return Promise for an App Key + * @returns Promise for an App Key * @example * ```javascript * const contentful = require('contentful-management') @@ -914,7 +914,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets all keys for the given app - * @return Promise for an array of App Keys + * @returns Promise for an array of App Keys * @example * ```javascript * const contentful = require('contentful-management') @@ -950,7 +950,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Deletes an app key by fingerprint. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -977,7 +977,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app details entity - * @return Promise for an App Details + * @returns Promise for an App Details * @example * ```javascript * const contentful = require('contentful-management') @@ -1005,7 +1005,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app details entity - * @return Promise for an App Details + * @returns Promise for an App Details * @example * ```javascript * const contentful = require('contentful-management') @@ -1030,7 +1030,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Deletes an app details entity. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -1057,7 +1057,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates an app action entity. - * @return Promise that resolves an App Action entity + * @returns Promise that resolves an App Action entity * @example * ```javascript * const contentful = require('contentful-management') @@ -1087,7 +1087,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Updates an existing app action entity. - * @return Promise that resolves an App Action entity + * @returns Promise that resolves an App Action entity * @example * ```javascript * const contentful = require('contentful-management') @@ -1117,7 +1117,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Deletes an app action entity. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -1144,7 +1144,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an existing app action entity. - * @return Promise that resolves an App Action entity + * @returns Promise that resolves an App Action entity * @example * ```javascript * const contentful = require('contentful-management') @@ -1169,7 +1169,7 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets existing app actions for an App Definition. - * @return Promise that resolves an App Action entity + * @returns Promise that resolves an App Action entity * @example * ```javascript * const contentful = require('contentful-management') diff --git a/lib/create-space-api.ts b/lib/create-space-api.ts index debe0f5e28..074fecb3df 100644 --- a/lib/create-space-api.ts +++ b/lib/create-space-api.ts @@ -28,7 +28,7 @@ export type ContentfulSpaceAPI = ReturnType /** * Creates API object with methods to access the Space API * @param {MakeRequest} makeRequest - function to make requests via an adapter - * @return {ContentfulSpaceAPI} + * @returns {ContentfulSpaceAPI} * @private */ export default function createSpaceApi(makeRequest: MakeRequest) { @@ -50,7 +50,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { return { /** * Deletes the space - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -75,7 +75,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Updates the space - * @return Promise for the updated space. + * @returns Promise for the updated space. * @example * ```javascript * const contentful = require('contentful-management') @@ -106,7 +106,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets an environment * @param id - Environment ID - * @return Promise for an Environment + * @returns Promise for an Environment * @example * ```javascript * const contentful = require('contentful-management') @@ -133,7 +133,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Environments - * @return Promise for a collection of Environment + * @returns Promise for a collection of Environment * @example * ```javascript * const contentful = require('contentful-management') @@ -160,7 +160,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Creates an environment * @param data - Object representation of the Environment to be created - * @return Promise for the newly created Environment + * @returns Promise for the newly created Environment * @example * ```javascript * const contentful = require('contentful-management') @@ -192,7 +192,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * @param id - Environment ID * @param data - Object representation of the Environment to be created * @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master" - * @return Promise for the newly created Environment + * @returns Promise for the newly created Environment * @example * ```javascript * const contentful = require('contentful-management') @@ -228,7 +228,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Webhook * @param id - Webhook ID - * @return Promise for a Webhook + * @returns Promise for a Webhook * @example * ```javascript * const contentful = require('contentful-management') @@ -254,7 +254,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Webhooks - * @return Promise for a collection of Webhooks + * @returns Promise for a collection of Webhooks * @example * ```javascript * const contentful = require('contentful-management') @@ -333,7 +333,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Creates a Webhook * @param data - Object representation of the Webhook to be created - * @return Promise for the newly created Webhook + * @returns Promise for the newly created Webhook * @example * ```javascript * const contentful = require('contentful-management') @@ -367,7 +367,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Webhook with a custom ID * @param id - Webhook ID * @param data - Object representation of the Webhook to be created - * @return Promise for the newly created Webhook + * @returns Promise for the newly created Webhook * @example * ```javascript * const contentful = require('contentful-management') @@ -511,7 +511,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Role * @param id - Role ID - * @return Promise for a Role + * @returns Promise for a Role * @example * ```javascript * const contentful = require('contentful-management') @@ -542,7 +542,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Roles - * @return Promise for a collection of Roles + * @returns Promise for a collection of Roles * @example * ```javascript * const contentful = require('contentful-management') @@ -569,7 +569,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Creates a Role * @param data - Object representation of the Role to be created - * @return Promise for the newly created Role + * @returns Promise for the newly created Role * @example * ```javascript * const contentful = require('contentful-management') @@ -626,7 +626,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Role with a custom ID * @param id - Role ID * @param data - Object representation of the Role to be created - * @return Promise for the newly created Role + * @returns Promise for the newly created Role * @example * ```javascript * const contentful = require('contentful-management') @@ -682,7 +682,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a User * @param userId - User ID - * @return Promise for a User + * @returns Promise for a User * @example * ```javascript * const contentful = require('contentful-management') @@ -707,7 +707,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Users in a space * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise a collection of Users in a space + * @returns Promise a collection of Users in a space * @example * ```javascript * const contentful = require('contentful-management') @@ -733,7 +733,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of teams for a space * @param query - * @return Promise for a collection of teams for a space + * @returns Promise for a collection of teams for a space * @example * ```javascript * const contentful = require('contentful-management') @@ -758,7 +758,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Space Member * @param id Get Space Member by user_id - * @return Promise for a Space Member + * @returns Promise for a Space Member * @example * ```javascript * const contentful = require('contentful-management') @@ -780,7 +780,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Space Members * @param query - * @return Promise for a collection of Space Members + * @returns Promise for a collection of Space Members * @example * ```javascript * const contentful = require('contentful-management') @@ -806,7 +806,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a Space Membership * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param id - Space Membership ID - * @return Promise for a Space Membership + * @returns Promise for a Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -829,7 +829,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Gets a collection of Space Memberships * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Space Memberships + * @returns Promise for a collection of Space Memberships * @example * ```javascript * const contentful = require('contentful-management') @@ -856,7 +856,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Space Membership * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param data - Object representation of the Space Membership to be created - * @return Promise for the newly created Space Membership + * @returns Promise for the newly created Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -897,7 +897,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user). * @param id - Space Membership ID * @param data - Object representation of the Space Membership to be created - * @return Promise for the newly created Space Membership + * @returns Promise for the newly created Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -938,7 +938,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Team Space Membership * @param id - Team Space Membership ID - * @return Promise for a Team Space Membership + * @returns Promise for a Team Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -964,7 +964,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Team Space Memberships * @param query - Object with search parameters. Check the JS SDK tutorial and the REST API reference for more details. - * @return Promise for a collection of Team Space Memberships + * @returns Promise for a collection of Team Space Memberships * @example * ```javascript * const contentful = require('contentful-management') @@ -990,7 +990,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Team Space Membership * @param id - Team ID * @param data - Object representation of the Team Space Membership to be created - * @return Promise for the newly created Team Space Membership + * @returns Promise for the newly created Team Space Membership * @example * ```javascript * const contentful = require('contentful-management') @@ -1031,7 +1031,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Api Key * @param id - API Key ID - * @return Promise for a Api Key + * @returns Promise for a Api Key * @example * ```javascript * const contentful = require('contentful-management') @@ -1059,7 +1059,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Api Keys - * @return Promise for a collection of Api Keys + * @returns Promise for a collection of Api Keys * @example * ```javascript * const contentful = require('contentful-management') @@ -1086,7 +1086,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of preview Api Keys - * @return Promise for a collection of Preview Api Keys + * @returns Promise for a collection of Preview Api Keys * @example * ```javascript * const contentful = require('contentful-management') @@ -1114,7 +1114,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a preview Api Key * @param id - Preview API Key ID - * @return Promise for a Preview Api Key + * @returns Promise for a Preview Api Key * @example * ```javascript * const contentful = require('contentful-management') @@ -1143,7 +1143,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Creates a Api Key * @param payload - Object representation of the Api Key to be created - * @return Promise for the newly created Api Key + * @returns Promise for the newly created Api Key * @example * ```javascript * const contentful = require('contentful-management') @@ -1183,7 +1183,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates a Api Key with a custom ID * @param id - Api Key ID * @param payload - Object representation of the Api Key to be created - * @return Promise for the newly created Api Key + * @returns Promise for the newly created Api Key * @example * ```javascript * const contentful = require('contentful-management') @@ -1224,7 +1224,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { * Creates an EnvironmentAlias with a custom ID * @param environmentAliasId - EnvironmentAlias ID * @param data - Object representation of the EnvironmentAlias to be created - * @return Promise for the newly created EnvironmentAlias + * @returns Promise for the newly created EnvironmentAlias * @example * ```javascript * const contentful = require('contentful-management') @@ -1256,7 +1256,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets an Environment Alias * @param Environment Alias ID - * @return Promise for an Environment Alias + * @returns Promise for an Environment Alias * @example * ```javascript * const contentful = require('contentful-management') @@ -1281,7 +1281,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Environment Aliases - * @return Promise for a collection of Environment Aliases + * @returns Promise for a collection of Environment Aliases * @example * ```javascript * const contentful = require('contentful-management') @@ -1309,7 +1309,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Query for scheduled actions in space. * @param query - Object with search parameters. The enviroment id field is mandatory. Check the REST API reference for more details. - * @return Promise for the scheduled actions query + * @returns Promise for the scheduled actions query * * @example * ```javascript @@ -1381,7 +1381,7 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Creates a scheduled action * @param data - Object representation of the scheduled action to be created - * @return Promise for the newly created scheduled actions + * @returns Promise for the newly created scheduled actions * @example * ```javascript * const contentful = require('contentful-management'); diff --git a/lib/create-ui-config-api.ts b/lib/create-ui-config-api.ts index 152a4bfa71..c012a86602 100644 --- a/lib/create-ui-config-api.ts +++ b/lib/create-ui-config-api.ts @@ -28,7 +28,7 @@ export default function createUIConfigApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') diff --git a/lib/create-user-ui-config-api.ts b/lib/create-user-ui-config-api.ts index 7b9ee1208f..0ae28af783 100644 --- a/lib/create-user-ui-config-api.ts +++ b/lib/create-user-ui-config-api.ts @@ -28,7 +28,7 @@ export default function createUserUIConfigApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') diff --git a/lib/entities/access-token.ts b/lib/entities/access-token.ts index 95b55db26f..15714b2c66 100644 --- a/lib/entities/access-token.ts +++ b/lib/entities/access-token.ts @@ -37,7 +37,7 @@ export type CreatePersonalAccessTokenProps = Pick { /** * Revokes access token - * @return Object the revoked access token + * @returns Object the revoked access token * @example * ```javascript * const contentful = require('contentful-management') @@ -60,7 +60,7 @@ export interface AccessToken extends AccessTokenProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -39,7 +39,7 @@ export interface ApiKey extends ApiKeyProps, DefaultElements { delete(): Promise /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -107,6 +107,6 @@ export function wrapApiKey(makeRequest: MakeRequest, data: ApiKeyProps): ApiKey * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw api key collection data - * @return Wrapped api key collection data + * @returns Wrapped api key collection data */ export const wrapApiKeyCollection = wrapCollection(wrapApiKey) diff --git a/lib/entities/app-access-token.ts b/lib/entities/app-access-token.ts index 6993822144..72435c5d72 100644 --- a/lib/entities/app-access-token.ts +++ b/lib/entities/app-access-token.ts @@ -34,7 +34,7 @@ export interface AppAccessToken extends AppAccessTokenProps, DefaultElements & { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -184,7 +184,7 @@ function createAppActionApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle data - * @return Wrapped App Bundle data + * @returns Wrapped App Bundle data */ export function wrapAppAction(makeRequest: MakeRequest, data: AppActionProps): AppAction { const appAction = toPlainObject(copy(data)) @@ -198,6 +198,6 @@ export function wrapAppAction(makeRequest: MakeRequest, data: AppActionProps): A * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle collection data - * @return Wrapped App Bundle collection data + * @returns Wrapped App Bundle collection data */ export const wrapAppActionCollection = wrapCollection(wrapAppAction) diff --git a/lib/entities/app-bundle.ts b/lib/entities/app-bundle.ts index beaa87d21c..2ff7af7b84 100644 --- a/lib/entities/app-bundle.ts +++ b/lib/entities/app-bundle.ts @@ -59,7 +59,7 @@ export type AppBundleProps = { export interface AppBundle extends AppBundleProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -104,7 +104,7 @@ function createAppBundleApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle data - * @return Wrapped App Bundle data + * @returns Wrapped App Bundle data */ export function wrapAppBundle(makeRequest: MakeRequest, data: AppBundleProps): AppBundle { const appBundle = toPlainObject(copy(data)) @@ -118,6 +118,6 @@ export function wrapAppBundle(makeRequest: MakeRequest, data: AppBundleProps): A * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Bundle collection data - * @return Wrapped App Bundle collection data + * @returns Wrapped App Bundle collection data */ export const wrapAppBundleCollection = wrapCollection(wrapAppBundle) diff --git a/lib/entities/app-definition.ts b/lib/entities/app-definition.ts index a76713f1ad..c6933d9977 100644 --- a/lib/entities/app-definition.ts +++ b/lib/entities/app-definition.ts @@ -96,7 +96,7 @@ export type AppInstallationsForOrganizationProps = { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Definition data - * @return Wrapped App Definition data + * @returns Wrapped App Definition data */ export function wrapAppDefinition( makeRequest: MakeRequest, @@ -114,6 +114,6 @@ export function wrapAppDefinition( * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Definition collection data - * @return Wrapped App Definition collection data + * @returns Wrapped App Definition collection data */ export const wrapAppDefinitionCollection = wrapCollection(wrapAppDefinition) diff --git a/lib/entities/app-details.ts b/lib/entities/app-details.ts index 9bf2a1500d..5819b1ceed 100644 --- a/lib/entities/app-details.ts +++ b/lib/entities/app-details.ts @@ -36,7 +36,7 @@ export type CreateAppDetailsProps = { export interface AppDetails extends AppDetailsProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -57,7 +57,7 @@ export interface AppDetails extends AppDetailsProps, DefaultElements ({ @@ -81,7 +81,7 @@ function createAppDetailsApi(makeRequest: MakeRequest) { * @private * @param http - HTTP client instance * @param data - Raw AppDetails data - * @return Wrapped AppDetails data + * @returns Wrapped AppDetails data */ export function wrapAppDetails(makeRequest: MakeRequest, data: AppDetailsProps): AppDetails { const appDetails = toPlainObject(copy(data)) diff --git a/lib/entities/app-event-subscription.ts b/lib/entities/app-event-subscription.ts index 3bec776d3d..bde38b6796 100644 --- a/lib/entities/app-event-subscription.ts +++ b/lib/entities/app-event-subscription.ts @@ -27,7 +27,7 @@ export interface AppEventSubscription DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -67,7 +67,7 @@ function createEventSubscriptionApi(makeRequest: MakeRequest) { * @private * @param http - HTTP client instance * @param data - Raw AppEventSubscription data - * @return Wrapped AppEventSubscription data + * @returns Wrapped AppEventSubscription data */ export function wrapAppEventSubscription( makeRequest: MakeRequest, diff --git a/lib/entities/app-installation.ts b/lib/entities/app-installation.ts index aa6f0a1cb1..34ed0df828 100644 --- a/lib/entities/app-installation.ts +++ b/lib/entities/app-installation.ts @@ -26,7 +26,7 @@ export interface AppInstallation DefaultElements { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -49,7 +49,7 @@ export interface AppInstallation update(): Promise /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -106,7 +106,7 @@ function createAppInstallationApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Installation data - * @return Wrapped App installation data + * @returns Wrapped App installation data */ export function wrapAppInstallation( makeRequest: MakeRequest, diff --git a/lib/entities/app-key.ts b/lib/entities/app-key.ts index b7b79db772..773248c90c 100644 --- a/lib/entities/app-key.ts +++ b/lib/entities/app-key.ts @@ -53,7 +53,7 @@ export type CreateAppKeyProps = { export interface AppKey extends AppKeyProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -94,7 +94,7 @@ function createKeyApi(makeRequest: MakeRequest) { * @private * @param http - HTTP client instance * @param data - Raw AppKey data - * @return Wrapped AppKey data + * @returns Wrapped AppKey data */ export function wrapAppKey(makeRequest: MakeRequest, data: AppKeyProps): AppKey { const key = toPlainObject(copy(data)) @@ -105,6 +105,6 @@ export function wrapAppKey(makeRequest: MakeRequest, data: AppKeyProps): AppKey * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Key collection data - * @return Wrapped App Key collection data + * @returns Wrapped App Key collection data */ export const wrapAppKeyCollection = wrapCollection(wrapAppKey) diff --git a/lib/entities/app-signed-request.ts b/lib/entities/app-signed-request.ts index 58966ee689..9afa925cfc 100644 --- a/lib/entities/app-signed-request.ts +++ b/lib/entities/app-signed-request.ts @@ -44,7 +44,7 @@ export interface AppSignedRequest * @private * @param http - HTTP client instance * @param data - Raw AppSignedRequest data - * @return Wrapped AppSignedRequest data + * @returns Wrapped AppSignedRequest data */ export function wrapAppSignedRequest( _makeRequest: MakeRequest, diff --git a/lib/entities/app-signing-secret.ts b/lib/entities/app-signing-secret.ts index aedac4fc34..e0ab6bb2b3 100644 --- a/lib/entities/app-signing-secret.ts +++ b/lib/entities/app-signing-secret.ts @@ -28,7 +28,7 @@ export interface AppSigningSecret DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -68,7 +68,7 @@ function createSigningSecretApi(makeRequest: MakeRequest) { * @private * @param http - HTTP client instance * @param data - Raw AppSigningSecret data - * @return Wrapped AppSigningSecret data + * @returns Wrapped AppSigningSecret data */ export function wrapAppSigningSecret( makeRequest: MakeRequest, diff --git a/lib/entities/app-upload.ts b/lib/entities/app-upload.ts index 3652db3f34..9245ee376c 100644 --- a/lib/entities/app-upload.ts +++ b/lib/entities/app-upload.ts @@ -17,7 +17,7 @@ export type AppUploadProps = { export interface AppUpload extends AppUploadProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -61,7 +61,7 @@ function createAppUploadApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Upload data - * @return Wrapped App Upload data + * @returns Wrapped App Upload data */ export function wrapAppUpload(makeRequest: MakeRequest, data: AppUploadProps): AppUpload { const appUpload = toPlainObject(copy(data)) @@ -74,6 +74,6 @@ export function wrapAppUpload(makeRequest: MakeRequest, data: AppUploadProps): A * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw App Upload collection data - * @return Wrapped App Upload collection data + * @returns Wrapped App Upload collection data */ export const wrapAppUploadCollection = wrapCollection(wrapAppUpload) diff --git a/lib/entities/asset-key.ts b/lib/entities/asset-key.ts index b3e1df6e55..6713e5d000 100644 --- a/lib/entities/asset-key.ts +++ b/lib/entities/asset-key.ts @@ -20,7 +20,7 @@ export interface AssetKey extends AssetKeyProps, DefaultElements * @private * @param http - HTTP client instance * @param data - Raw asset key data - * @return Wrapped asset key data + * @returns Wrapped asset key data */ export function wrapAssetKey(_makeRequest: MakeRequest, data: AssetKeyProps): AssetKey { const assetKey = toPlainObject(copy(data)) diff --git a/lib/entities/asset.ts b/lib/entities/asset.ts index 723a958b5f..0f8f268b74 100644 --- a/lib/entities/asset.ts +++ b/lib/entities/asset.ts @@ -67,7 +67,7 @@ type AssetApi = { * @param options - Additional options for processing * @prop options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms) * @prop options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5) - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @throws {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged. * @example * ```javascript @@ -108,7 +108,7 @@ type AssetApi = { * @param options - Additional options for processing * @prop options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms) * @prop options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5) - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @throws {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged. * @example * ```javascript @@ -139,7 +139,7 @@ type AssetApi = { processForLocale(locale: string, options?: AssetProcessingForLocale): Promise /** * Publishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -159,7 +159,7 @@ type AssetApi = { publish(): Promise /** * Archives the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -179,7 +179,7 @@ type AssetApi = { archive(): Promise /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -199,7 +199,7 @@ type AssetApi = { delete(): Promise /** * Unarchives the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -219,7 +219,7 @@ type AssetApi = { unarchive(): Promise /** * Unpublishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -239,7 +239,7 @@ type AssetApi = { unpublish(): Promise /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -406,7 +406,7 @@ function createAssetApi(makeRequest: MakeRequest): AssetApi { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw asset data - * @return Wrapped asset data + * @returns Wrapped asset data */ export function wrapAsset(makeRequest: MakeRequest, data: AssetProps): Asset { const asset = toPlainObject(copy(data)) diff --git a/lib/entities/bulk-action.ts b/lib/entities/bulk-action.ts index ca697c513b..4c86037d5f 100644 --- a/lib/entities/bulk-action.ts +++ b/lib/entities/bulk-action.ts @@ -137,7 +137,7 @@ export interface BulkAction * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw BulkAction data - * @return Wrapped BulkAction data + * @returns Wrapped BulkAction data */ export function wrapBulkAction( makeRequest: MakeRequest, diff --git a/lib/entities/content-type.ts b/lib/entities/content-type.ts index 523884957c..fb5cd73a41 100644 --- a/lib/entities/content-type.ts +++ b/lib/entities/content-type.ts @@ -67,7 +67,7 @@ type ContentTypeApi = { * delete it by setting the attribute "deleted" to true. See the "Deleting fields" section in the * API reference for more reasoning. Alternatively, * you may use the convenience method omitAndDeleteField to do both steps at once. - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -91,7 +91,7 @@ type ContentTypeApi = { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -111,7 +111,7 @@ type ContentTypeApi = { delete(): Promise /** * Publishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -131,7 +131,7 @@ type ContentTypeApi = { publish(): Promise /** * Unpublishes the object - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. * @example * ```javascript * const contentful = require('contentful-management') @@ -153,7 +153,7 @@ type ContentTypeApi = { * Gets the editor interface for the object
* Important note: The editor interface only represent a published contentType.
* To get the most recent representation of the contentType make sure to publish it first - * @return Object returned from the server with the current editor interface. + * @returns Object returned from the server with the current editor interface. * @example * ```javascript * const contentful = require('contentful-management') @@ -187,7 +187,7 @@ type ContentTypeApi = { /** * Omits and deletes a field if it exists on the contentType. This is a convenience method which does both operations at once and potentially less * safe than the standard way. See note about deleting fields on the Update method. - * @return Object returned from the server with updated metadata. + * @returns Object returned from the server with updated metadata. */ omitAndDeleteField(id: string): Promise @@ -354,7 +354,7 @@ function createContentTypeApi(makeRequest: MakeRequest): ContentTypeApi { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw content type data - * @return Wrapped content type data + * @returns Wrapped content type data */ export function wrapContentType(makeRequest: MakeRequest, data: ContentTypeProps): ContentType { const contentType = toPlainObject(copy(data)) diff --git a/lib/entities/editor-interface.ts b/lib/entities/editor-interface.ts index da0c55827b..c7d94e9bf2 100644 --- a/lib/entities/editor-interface.ts +++ b/lib/entities/editor-interface.ts @@ -121,7 +121,7 @@ export interface EditorInterface DefaultElements { /** * Gets a control for a specific field - * @return control object for specific field + * @returns control object for specific field * ```javascript * const contentful = require('contentful-management') * @@ -143,7 +143,7 @@ export interface EditorInterface getControlForField(id: string): null | Control /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * ```javascript * const contentful = require('contentful-management') * diff --git a/lib/entities/entry.ts b/lib/entities/entry.ts index 3bcd8ec8c7..6b0c772872 100644 --- a/lib/entities/entry.ts +++ b/lib/entities/entry.ts @@ -58,7 +58,7 @@ export type WithResourceName = T extends { sys: infe * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw entry data - * @return Wrapped entry data + * @returns Wrapped entry data */ export function wrapEntry(makeRequest: MakeRequest, data: EntryProps): Entry { const entry = toPlainObject(copy(data)) diff --git a/lib/entities/environment-alias.ts b/lib/entities/environment-alias.ts index e818747ce0..d80aae3e06 100644 --- a/lib/entities/environment-alias.ts +++ b/lib/entities/environment-alias.ts @@ -25,7 +25,7 @@ export interface EnvironmentAlias DefaultElements { /** * Sends an update to the server with any changes made to the object's properties. Currently, you can only change the id of the alias's underlying environment. See the example below. - * @return {Promise} Object returned from the server with updated changes. + * @returns {Promise} Object returned from the server with updated changes. * ```javascript * const contentful = require('contentful-management') * @@ -47,7 +47,7 @@ export interface EnvironmentAlias /** * Deletes this object on the server. - * @return {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. * ```javascript * const contentful = require('contentful-management') * @@ -104,7 +104,7 @@ function createEnvironmentAliasApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw environment alias data - * @return Wrapped environment alias data + * @returns Wrapped environment alias data */ export function wrapEnvironmentAlias( makeRequest: MakeRequest, @@ -119,6 +119,6 @@ export function wrapEnvironmentAlias( * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw environment alias collection data - * @return Wrapped environment alias collection data + * @returns Wrapped environment alias collection data */ export const wrapEnvironmentAliasCollection = wrapCollection(wrapEnvironmentAlias) diff --git a/lib/entities/extension.ts b/lib/entities/extension.ts index 9cbbe73ae9..7a92a5c0c9 100644 --- a/lib/entities/extension.ts +++ b/lib/entities/extension.ts @@ -64,7 +64,7 @@ export type CreateExtensionProps = { export interface Extension extends ExtensionProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -87,7 +87,7 @@ export interface Extension extends ExtensionProps, DefaultElements /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -142,7 +142,7 @@ function createExtensionApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw UI Extension data - * @return Wrapped UI Extension data + * @returns Wrapped UI Extension data */ export function wrapExtension(makeRequest: MakeRequest, data: ExtensionProps): Extension { const extension = toPlainObject(copy(data)) diff --git a/lib/entities/function-log.ts b/lib/entities/function-log.ts index 7d2a8bf1b2..6f8a0b6325 100644 --- a/lib/entities/function-log.ts +++ b/lib/entities/function-log.ts @@ -40,7 +40,7 @@ export interface FunctionLog extends FunctionLogProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -72,7 +72,7 @@ export interface Locale extends LocaleProps, DefaultElements { delete(): Promise /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -133,7 +133,7 @@ function createLocaleApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw locale data - * @return Wrapped locale data + * @returns Wrapped locale data */ export function wrapLocale(makeRequest: MakeRequest, data: LocaleProps): Locale { delete (data as SetOptional).internal_code diff --git a/lib/entities/oauth-application.ts b/lib/entities/oauth-application.ts index 8dbacc89bd..b46b5d30df 100644 --- a/lib/entities/oauth-application.ts +++ b/lib/entities/oauth-application.ts @@ -45,12 +45,12 @@ export interface OAuthApplication DefaultElements { /** * Deletes an OAuth application - * @return Promise for the deleted OAuth application + * @returns Promise for the deleted OAuth application */ delete(): Promise /** * Updates an OAuth application - * @return Promise for the updated OAuth application + * @returns Promise for the updated OAuth application */ update(): Promise } @@ -67,7 +67,7 @@ function createOAuthApplicationApi(makeRequest: MakeRequest, userId: string) { return { /** * Updates an OAuth application - * @return Promise for the updated OAuth application + * @returns Promise for the updated OAuth application */ async update(): Promise { const raw = this.toPlainObject() as OAuthApplicationProps @@ -81,7 +81,7 @@ function createOAuthApplicationApi(makeRequest: MakeRequest, userId: string) { /** * Deletes an OAuth application - * @return Promise for the deleted OAuth application + * @returns Promise for the deleted OAuth application */ async delete(): Promise { const raw = this.toPlainObject() as OAuthApplicationProps @@ -98,7 +98,7 @@ function createOAuthApplicationApi(makeRequest: MakeRequest, userId: string) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw OAuth application data - * @return Wrapped OAuth application data + * @returns Wrapped OAuth application data */ export function wrapOAuthApplication( makeRequest: MakeRequest, diff --git a/lib/entities/organization-invitation.ts b/lib/entities/organization-invitation.ts index 3c0a7e13ba..ff1b604896 100644 --- a/lib/entities/organization-invitation.ts +++ b/lib/entities/organization-invitation.ts @@ -25,7 +25,7 @@ export interface OrganizationInvitation * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw invitation data - * @return {OrganizationInvitation} Wrapped Inviation data + * @returns {OrganizationInvitation} Wrapped Inviation data */ export function wrapOrganizationInvitation( _makeRequest: MakeRequest, diff --git a/lib/entities/organization-membership.ts b/lib/entities/organization-membership.ts index caf28ddd03..4f8c97422d 100644 --- a/lib/entities/organization-membership.ts +++ b/lib/entities/organization-membership.ts @@ -26,7 +26,7 @@ export interface OrganizationMembership DefaultElements { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -100,7 +100,7 @@ function createOrganizationMembershipApi(makeRequest: MakeRequest, organizationI * @private * @param {function} makeRequest - function to make requests via an adapter * @param {Object} data - Raw organization membership data - * @return {OrganizationMembership} Wrapped organization membership data + * @returns {OrganizationMembership} Wrapped organization membership data */ export function wrapOrganizationMembership( makeRequest: MakeRequest, diff --git a/lib/entities/organization.ts b/lib/entities/organization.ts index 4610d7d715..2d0558740b 100644 --- a/lib/entities/organization.ts +++ b/lib/entities/organization.ts @@ -34,7 +34,7 @@ export type OrganizationProp = OrganizationProps * @private * @param makeRequest - function to make requests via an adapter * @param data - API response for an Organization - * @return {Organization} + * @returns {Organization} */ export function wrapOrganization(makeRequest: MakeRequest, data: OrganizationProps): Organization { const org = toPlainObject(copy(data)) diff --git a/lib/entities/personal-access-token.ts b/lib/entities/personal-access-token.ts index 61f8c9e79c..5d6105a5c3 100644 --- a/lib/entities/personal-access-token.ts +++ b/lib/entities/personal-access-token.ts @@ -26,7 +26,7 @@ export interface PersonalAccessToken DefaultElements { /** * Revokes a personal access token - * @return Object the revoked personal access token + * @returns Object the revoked personal access token * @example * ```javascript * const contentful = require('contentful-management') @@ -49,7 +49,7 @@ export interface PersonalAccessToken * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw personal access token data - * @return Wrapped personal access token + * @returns Wrapped personal access token */ export function wrapPersonalAccessToken( makeRequest: MakeRequest, @@ -72,6 +72,6 @@ export function wrapPersonalAccessToken( * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw personal access collection data - * @return Wrapped personal access token collection data + * @returns Wrapped personal access token collection data */ export const wrapPersonalAccessTokenCollection = wrapCollection(wrapPersonalAccessToken) diff --git a/lib/entities/preview-api-key.ts b/lib/entities/preview-api-key.ts index 26bd2c2739..c49f63c5c9 100644 --- a/lib/entities/preview-api-key.ts +++ b/lib/entities/preview-api-key.ts @@ -24,7 +24,7 @@ function createPreviewApiKeyApi() { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw api key data - * @return Wrapped preview api key data + * @returns Wrapped preview api key data */ export function wrapPreviewApiKey( _makeRequest: MakeRequest, diff --git a/lib/entities/release-action.ts b/lib/entities/release-action.ts index f199ebceca..440e2a538f 100644 --- a/lib/entities/release-action.ts +++ b/lib/entities/release-action.ts @@ -96,7 +96,7 @@ export interface ReleaseAction * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw Release data - * @return Wrapped Release data + * @returns Wrapped Release data */ export function wrapReleaseAction( makeRequest: MakeRequest, diff --git a/lib/entities/release.ts b/lib/entities/release.ts index 775c57a22e..3791a3ecb6 100644 --- a/lib/entities/release.ts +++ b/lib/entities/release.ts @@ -245,7 +245,7 @@ export interface Release extends ReleaseProps, ReleaseApiMethods, DefaultElement * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw Release data - * @return Wrapped Release data + * @returns Wrapped Release data */ export function wrapRelease(makeRequest: MakeRequest, data: ReleaseProps): Release { const release = toPlainObject(copy(data)) diff --git a/lib/entities/resource-provider.ts b/lib/entities/resource-provider.ts index 8034022881..4614c7933b 100644 --- a/lib/entities/resource-provider.ts +++ b/lib/entities/resource-provider.ts @@ -52,7 +52,7 @@ function createResourceProviderApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -83,7 +83,7 @@ function createResourceProviderApi(makeRequest: MakeRequest) { }, /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -150,7 +150,7 @@ function createResourceProviderApi(makeRequest: MakeRequest) { /** * @private * @param data - raw ResourceProvider Object - * @return Object containing the http params for the ResourceProvider request: organizationId and appDefinitionId + * @returns Object containing the http params for the ResourceProvider request: organizationId and appDefinitionId */ const getParams = (data: ResourceProviderProps) => ({ organizationId: data.sys.organization.sys.id, @@ -159,7 +159,7 @@ const getParams = (data: ResourceProviderProps) => ({ /** * @private * @param data - raw ResourceProvider Object - * @return UpsertResourceProviderProps + * @returns UpsertResourceProviderProps */ const getUpsertParams = (data: ResourceProviderProps): UpsertResourceProviderProps => ({ sys: { id: data.sys.id }, @@ -171,7 +171,7 @@ const getUpsertParams = (data: ResourceProviderProps): UpsertResourceProviderPro * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw Resource Provider data - * @return Wrapped Resource Provider data + * @returns Wrapped Resource Provider data */ export function wrapResourceProvider( makeRequest: MakeRequest, diff --git a/lib/entities/resource-type.ts b/lib/entities/resource-type.ts index 33a55686ca..3aa576e85f 100644 --- a/lib/entities/resource-type.ts +++ b/lib/entities/resource-type.ts @@ -75,7 +75,7 @@ function createResourceTypeApi(makeRequest: MakeRequest) { return { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -107,7 +107,7 @@ function createResourceTypeApi(makeRequest: MakeRequest) { }, /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -150,7 +150,7 @@ const getUpsertParams = (data: ResourceTypeProps): UpsertResourceTypeProps => ({ * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw Resource Type data - * @return Wrapped Resource Type data + * @returns Wrapped Resource Type data */ export function wrapResourceType(makeRequest: MakeRequest, data: ResourceTypeProps): ResourceType { const resourceType = toPlainObject(copy(data)) diff --git a/lib/entities/role.ts b/lib/entities/role.ts index f1f5b775b3..fa5dbc897f 100644 --- a/lib/entities/role.ts +++ b/lib/entities/role.ts @@ -46,7 +46,7 @@ export type CreateRoleProps = Omit export interface Role extends RoleProps, DefaultElements { /** * Deletes this object on the server. - * @return {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -65,7 +65,7 @@ export interface Role extends RoleProps, DefaultElements { delete(): Promise /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -121,7 +121,7 @@ function createRoleApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw role data - * @return Wrapped role data + * @returns Wrapped role data */ export function wrapRole(makeRequest: MakeRequest, data: RoleProps): Role { const role = toPlainObject(copy(data)) diff --git a/lib/entities/snapshot.ts b/lib/entities/snapshot.ts index 8dc13b1f91..119f4bbc70 100644 --- a/lib/entities/snapshot.ts +++ b/lib/entities/snapshot.ts @@ -26,7 +26,7 @@ function createSnapshotApi() { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw snapshot data - * @return Wrapped snapshot data + * @returns Wrapped snapshot data */ export function wrapSnapshot(_makeRequest: MakeRequest, data: SnapshotProps): Snapshot { const snapshot = toPlainObject(copy(data)) @@ -38,6 +38,6 @@ export function wrapSnapshot(_makeRequest: MakeRequest, data: SnapshotProps { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -39,7 +39,7 @@ export interface SpaceMembership delete(): Promise /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -94,7 +94,7 @@ function createSpaceMembershipApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw space membership data - * @return Wrapped space membership data + * @returns Wrapped space membership data */ export function wrapSpaceMembership( makeRequest: MakeRequest, diff --git a/lib/entities/space.ts b/lib/entities/space.ts index f92d38f573..b926ecf9ee 100644 --- a/lib/entities/space.ts +++ b/lib/entities/space.ts @@ -21,7 +21,7 @@ export type Space = SpaceProps & DefaultElements & ContentfulSpaceAP * @private * @param makeRequest - function to make requests via an adapter * @param data - API response for a Space - * @return {Space} + * @returns {Space} */ export function wrapSpace(makeRequest: MakeRequest, data: SpaceProps): Space { const space = toPlainObject(copy(data)) diff --git a/lib/entities/team-membership.ts b/lib/entities/team-membership.ts index cbddc9c6ea..ffd84d19aa 100644 --- a/lib/entities/team-membership.ts +++ b/lib/entities/team-membership.ts @@ -30,7 +30,7 @@ export type CreateTeamMembershipProps = Omit export interface TeamMembership extends TeamMembershipProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -51,7 +51,7 @@ export interface TeamMembership extends TeamMembershipProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -59,7 +59,7 @@ export interface TeamSpaceMembership /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -123,7 +123,7 @@ function createTeamSpaceMembershipApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw space membership data - * @return Wrapped team space membership data + * @returns Wrapped team space membership data */ export function wrapTeamSpaceMembership( makeRequest: MakeRequest, diff --git a/lib/entities/team.ts b/lib/entities/team.ts index 7d4a23332e..8fc87e8051 100644 --- a/lib/entities/team.ts +++ b/lib/entities/team.ts @@ -26,7 +26,7 @@ export type CreateTeamProps = Omit export interface Team extends TeamProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * ```javascript * const contentful = require('contentful-management') @@ -47,7 +47,7 @@ export interface Team extends TeamProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * @example * ```javascript * const contentful = require('contentful-management') @@ -103,7 +103,7 @@ function createTeamApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw team data - * @return Wrapped team data + * @returns Wrapped team data */ export function wrapTeam(makeRequest: MakeRequest, data: TeamProps): Team { const team = toPlainObject(copy(data)) diff --git a/lib/entities/ui-config.ts b/lib/entities/ui-config.ts index f0fcd6d017..f7110b6db7 100644 --- a/lib/entities/ui-config.ts +++ b/lib/entities/ui-config.ts @@ -54,7 +54,7 @@ export interface UIConfig extends UIConfigProps, DefaultElements * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw data - * @return Wrapped UIConfig + * @returns Wrapped UIConfig */ export function wrapUIConfig(makeRequest: MakeRequest, data: UIConfigProps) { const user = toPlainObject(copy(data)) diff --git a/lib/entities/upload-credential.ts b/lib/entities/upload-credential.ts index fb62f76be9..8c11ccfa4f 100644 --- a/lib/entities/upload-credential.ts +++ b/lib/entities/upload-credential.ts @@ -15,7 +15,7 @@ export interface UploadCredential DefaultElements { /** * creates the upload credentials. - * @return upload credentials for file uploads + * @returns upload credentials for file uploads * @example * const contentful = require('contentful-management') * @@ -62,7 +62,7 @@ function createUploadCredentialsApi(makeRequest: MakeRequest) { * @private * @param {function} makeRequest - function to make requests via an adapter * @param {object} data - Raw upload credential data - * @return {UploadCredential} Wrapped upload credential data + * @returns {UploadCredential} Wrapped upload credential data */ export function wrapUploadCredential( makeRequest: MakeRequest, diff --git a/lib/entities/upload.ts b/lib/entities/upload.ts index 36ea3cb0a0..33015d8284 100644 --- a/lib/entities/upload.ts +++ b/lib/entities/upload.ts @@ -13,7 +13,7 @@ export type UploadProps = { export interface Upload extends UploadProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * @example * const contentful = require('contentful-management') * @@ -55,7 +55,7 @@ function createUploadApi(makeRequest: MakeRequest) { * @private * @param {function} makeRequest - function to make requests via an adapter * @param {object} data - Raw upload data - * @return {Upload} Wrapped upload data + * @returns {Upload} Wrapped upload data */ export function wrapUpload(makeRequest: MakeRequest, data: UploadProps) { const upload = toPlainObject(copy(data)) diff --git a/lib/entities/usage.ts b/lib/entities/usage.ts index 43ba3beece..fd0f7088e0 100644 --- a/lib/entities/usage.ts +++ b/lib/entities/usage.ts @@ -63,7 +63,7 @@ export interface Usage extends UsageProps, DefaultElements {} * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw data - * @return Normalized usage + * @returns Normalized usage */ export function wrapUsage(_makeRequest: MakeRequest, data: UsageProps): Usage { const usage = toPlainObject(copy(data)) diff --git a/lib/entities/user-ui-config.ts b/lib/entities/user-ui-config.ts index 9945d89621..1d2f72f132 100644 --- a/lib/entities/user-ui-config.ts +++ b/lib/entities/user-ui-config.ts @@ -44,7 +44,7 @@ export interface UserUIConfig extends UserUIConfigProps, DefaultElements {} * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw data - * @return Normalized user + * @returns Normalized user */ export function wrapUser(_makeRequest: MakeRequest, data: T) { const user = toPlainObject(copy(data)) @@ -67,6 +67,6 @@ export function wrapUser(_makeRequest: MakeRequest, data: T) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw data collection - * @return Normalized user collection + * @returns Normalized user collection */ export const wrapUserCollection = wrapCollection(wrapUser) diff --git a/lib/entities/webhook.ts b/lib/entities/webhook.ts index be750cc4a1..3a9433d085 100644 --- a/lib/entities/webhook.ts +++ b/lib/entities/webhook.ts @@ -214,7 +214,7 @@ export type WebhookProps = { export interface WebHooks extends WebhookProps, DefaultElements { /** * Sends an update to the server with any changes made to the object's properties - * @return Object returned from the server with updated changes. + * @returns Object returned from the server with updated changes. * ```javascript * const contentful = require('contentful-management') * @@ -236,7 +236,7 @@ export interface WebHooks extends WebhookProps, DefaultElements { /** * Deletes this object on the server. - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. * ```javascript * const contentful = require('contentful-management') * @@ -255,7 +255,7 @@ export interface WebHooks extends WebhookProps, DefaultElements { /** * List of the most recent webhook calls. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details. - * @return Promise for list of calls + * @returns Promise for list of calls * ```javascript * const contentful = require('contentful-management') * @@ -274,7 +274,7 @@ export interface WebHooks extends WebhookProps, DefaultElements { /** * Webhook call with specific id. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details - * @return Promise for call details + * @returns Promise for call details * ```javascript * const contentful = require('contentful-management') * @@ -293,7 +293,7 @@ export interface WebHooks extends WebhookProps, DefaultElements { /** * Overview of the health of webhook calls. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details. - * @return Promise for health info + * @returns Promise for health info * ```javascript * const contentful = require('contentful-management') * @@ -369,7 +369,7 @@ function createWebhookApi(makeRequest: MakeRequest) { * @private * @param makeRequest - function to make requests via an adapter * @param data - Raw webhook data - * @return Wrapped webhook data + * @returns Wrapped webhook data */ export function wrapWebhook(makeRequest: MakeRequest, data: WebhookProps): WebHooks { const webhook = toPlainObject(copy(data)) From 0980259d7f63f3b8edfdad0d789c1e1867d9f252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 12:22:44 +0100 Subject: [PATCH 05/21] refactor: remove index file in entities folder for cleaner import structure and less cross dependencies --- lib/adapters/REST/make-request.ts | 2 +- lib/contentful-management.ts | 2 +- lib/create-app-definition-api.ts | 6 +- lib/create-contentful-api.ts | 29 +++--- lib/create-entry-api.ts | 11 +-- lib/create-environment-api.ts | 36 ++++--- lib/create-environment-template-api.ts | 12 +-- lib/create-organization-api.ts | 46 ++++----- lib/create-space-api.ts | 36 +++---- lib/create-ui-config-api.ts | 5 +- lib/create-user-ui-config-api.ts | 5 +- lib/entities/index.ts | 127 ------------------------- lib/entities/resource-provider.ts | 5 +- 13 files changed, 96 insertions(+), 226 deletions(-) delete mode 100644 lib/entities/index.ts diff --git a/lib/adapters/REST/make-request.ts b/lib/adapters/REST/make-request.ts index cd44cbd502..ea83c2febd 100644 --- a/lib/adapters/REST/make-request.ts +++ b/lib/adapters/REST/make-request.ts @@ -2,7 +2,7 @@ import type { AxiosInstance } from 'contentful-sdk-core' import type { MakeRequestOptions, MakeRequestPayload } from '../../common-types' import type { OpPatch } from 'json-patch' import type { RawAxiosRequestHeaders } from 'axios' -import endpoints from './endpoints' +import endpoints from './endpoints/index' type makeAxiosRequest = MakeRequestOptions & { axiosInstance: AxiosInstance diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index d8863b1996..800786b3b2 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -14,7 +14,7 @@ import createContentfulApi from './create-contentful-api' import type { PlainClientAPI } from './plain/common-types' import type { DefaultParams } from './plain/plain-client' import { createPlainClient } from './plain/plain-client' -import * as editorInterfaceDefaults from './constants/editor-interface-defaults' +import * as editorInterfaceDefaults from './constants/editor-interface-defaults/index' export type { ClientAPI } from './create-contentful-api' export { asIterator } from './plain/as-iterator' diff --git a/lib/create-app-definition-api.ts b/lib/create-app-definition-api.ts index ad8be2d98f..59459e5ed6 100644 --- a/lib/create-app-definition-api.ts +++ b/lib/create-app-definition-api.ts @@ -1,5 +1,6 @@ import type { MakeRequest, QueryOptions, SpaceQueryOptions } from './common-types' -import entities from './entities' +import { wrapAppBundle, wrapAppBundleCollection } from './entities/app-bundle' +import { wrapResourceProvider } from './entities/resource-provider' import type { CreateAppBundleProps } from './entities/app-bundle' import type { AppDefinitionProps } from './entities/app-definition' import { wrapAppDefinition } from './entities/app-definition' @@ -14,9 +15,6 @@ export type ContentfulAppDefinitionAPI = ReturnType ({ appDefinitionId: data.sys.id, organizationId: data.sys.organization.sys.id, diff --git a/lib/create-contentful-api.ts b/lib/create-contentful-api.ts index e4b27743e1..75595109a4 100644 --- a/lib/create-contentful-api.ts +++ b/lib/create-contentful-api.ts @@ -12,7 +12,22 @@ import type { GetOAuthApplicationParams, GetUserParams, } from './common-types' -import entities from './entities' +import { wrapSpace, wrapSpaceCollection } from './entities/space' +import { wrapUser } from './entities/user' +import { + wrapPersonalAccessToken, + wrapPersonalAccessTokenCollection, +} from './entities/personal-access-token' +import { wrapAccessToken, wrapAccessTokenCollection } from './entities/access-token' +import { wrapOrganization, wrapOrganizationCollection } from './entities/organization' +import { wrapUsageCollection } from './entities/usage' +import { wrapAppDefinition } from './entities/app-definition' +import { + wrapEnvironmentTemplate, + wrapEnvironmentTemplateCollection, +} from './entities/environment-template' +import { wrapOAuthApplication, wrapOAuthApplicationCollection } from './entities/oauth-application' + import type { Organization, OrganizationProps } from './entities/organization' import type { CreatePersonalAccessTokenProps } from './entities/personal-access-token' import type { Space, SpaceProps } from './entities/space' @@ -38,18 +53,6 @@ type CreateSpaceProps = Omit & { defaultLocale?: string } * @private */ export default function createClientApi(makeRequest: MakeRequest) { - const { wrapSpace, wrapSpaceCollection } = entities.space - const { wrapUser } = entities.user - const { wrapPersonalAccessToken, wrapPersonalAccessTokenCollection } = - entities.personalAccessToken - const { wrapAccessToken, wrapAccessTokenCollection } = entities.accessToken - const { wrapOrganization, wrapOrganizationCollection } = entities.organization - const { wrapUsageCollection } = entities.usage - const { wrapAppDefinition } = entities.appDefinition - const { wrapEnvironmentTemplate, wrapEnvironmentTemplateCollection } = - entities.environmentTemplate - const { wrapOAuthApplication, wrapOAuthApplicationCollection } = entities.oauthApplication - return { /** * Gets all environment templates for a given organization with the lasted version diff --git a/lib/create-entry-api.ts b/lib/create-entry-api.ts index 6118c70306..8bbc0c7bc6 100644 --- a/lib/create-entry-api.ts +++ b/lib/create-entry-api.ts @@ -4,7 +4,11 @@ import type { CreateCommentParams, CreateCommentProps } from './entities/comment import type { Entry, EntryProps, EntryReferenceOptionsProps } from './entities/entry' import type { CreateTaskProps } from './entities/task' import * as checks from './plain/checks' -import entities from './entities' + +import { wrapEntry, wrapEntryCollection } from './entities/entry' +import { wrapSnapshot, wrapSnapshotCollection } from './entities/snapshot' +import { wrapTask, wrapTaskCollection } from './entities/task' +import { wrapComment, wrapCommentCollection } from './entities/comment' /** * @private @@ -15,11 +19,6 @@ export type ContentfulEntryApi = ReturnType * @private */ export default function createEntryApi(makeRequest: MakeRequest) { - const { wrapEntry, wrapEntryCollection } = entities.entry - const { wrapSnapshot, wrapSnapshotCollection } = entities.snapshot - const { wrapTask, wrapTaskCollection } = entities.task - const { wrapComment, wrapCommentCollection } = entities.comment - const getParams = (self: Entry) => { const entry = self.toPlainObject() as EntryProps diff --git a/lib/create-environment-api.ts b/lib/create-environment-api.ts index 586bfe3e2e..7cc5065b6f 100644 --- a/lib/create-environment-api.ts +++ b/lib/create-environment-api.ts @@ -8,7 +8,6 @@ import type { QueryOptions, } from './common-types' import type { BasicQueryOptions, MakeRequest } from './common-types' -import entities from './entities' import type { CreateAppInstallationProps } from './entities/app-installation' import type { CreateAppSignedRequestProps } from './entities/app-signed-request' import type { CreateAppActionCallProps } from './entities/app-action-call' @@ -54,6 +53,23 @@ import { wrapUserUIConfig } from './entities/user-ui-config' import { wrapEnvironmentTemplateInstallationCollection } from './entities/environment-template-installation' import { wrapFunctionCollection } from './entities/function' import { wrapFunctionLog, wrapFunctionLogCollection } from './entities/function-log' +import { wrapEnvironment } from './entities/environment' +import { wrapContentType, wrapContentTypeCollection } from './entities/content-type' +import { wrapEntry, wrapEntryCollection } from './entities/entry' +import { wrapAsset, wrapAssetCollection } from './entities/asset' +import { wrapAssetKey } from './entities/asset-key' +import { wrapLocale, wrapLocaleCollection } from './entities/locale' +import { wrapSnapshotCollection } from './entities/snapshot' +import { wrapEditorInterface, wrapEditorInterfaceCollection } from './entities/editor-interface' +import { wrapUpload } from './entities/upload' +import { wrapExtension, wrapExtensionCollection } from './entities/extension' +import { wrapAppInstallation, wrapAppInstallationCollection } from './entities/app-installation' +import { wrapAppSignedRequest } from './entities/app-signed-request' +import { wrapAppActionCall } from './entities/app-action-call' +import { wrapBulkAction } from './entities/bulk-action' +import { wrapAppAccessToken } from './entities/app-access-token' +import { wrapResourceTypesForEnvironmentCollection } from './entities/resource-type' +import { wrapResourceCollection } from './entities/resource' import type { CreateAppAccessTokenProps } from './entities/app-access-token' import type { ResourceQueryOptions } from './entities/resource' import type { AiActionInvocationType } from './entities/ai-action-invocation' @@ -71,24 +87,6 @@ export type ContentfulEnvironmentAPI = ReturnType * @private */ export default function createEnvironmentApi(makeRequest: MakeRequest) { - const { wrapEnvironment } = entities.environment - const { wrapContentType, wrapContentTypeCollection } = entities.contentType - const { wrapEntry, wrapEntryCollection } = entities.entry - const { wrapAsset, wrapAssetCollection } = entities.asset - const { wrapAssetKey } = entities.assetKey - const { wrapLocale, wrapLocaleCollection } = entities.locale - const { wrapSnapshotCollection } = entities.snapshot - const { wrapEditorInterface, wrapEditorInterfaceCollection } = entities.editorInterface - const { wrapUpload } = entities.upload - const { wrapExtension, wrapExtensionCollection } = entities.extension - const { wrapAppInstallation, wrapAppInstallationCollection } = entities.appInstallation - const { wrapAppSignedRequest } = entities.appSignedRequest - const { wrapAppActionCall } = entities.appActionCall - const { wrapBulkAction } = entities.bulkAction - const { wrapAppAccessToken } = entities.appAccessToken - const { wrapResourceTypesForEnvironmentCollection } = entities.resourceType - const { wrapResourceCollection } = entities.resource - return { /** * Deletes the environment diff --git a/lib/create-environment-template-api.ts b/lib/create-environment-template-api.ts index 4ac9eccf22..8a06362000 100644 --- a/lib/create-environment-template-api.ts +++ b/lib/create-environment-template-api.ts @@ -1,6 +1,5 @@ import { createRequestConfig } from 'contentful-sdk-core' import type { BasicCursorPaginationOptions, MakeRequest } from './common-types' -import entities from './entities' import type { EnvironmentTemplateProps } from './entities/environment-template' import type { CreateEnvironmentTemplateInstallationProps, @@ -9,12 +8,13 @@ import type { export type ContentfulEnvironmentTemplateApi = ReturnType -export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizationId: string) { - const { wrapEnvironmentTemplate, wrapEnvironmentTemplateCollection } = - entities.environmentTemplate - - const { wrapEnvironmentTemplateInstallationCollection } = entities.environmentTemplateInstallation +import { + wrapEnvironmentTemplate, + wrapEnvironmentTemplateCollection, +} from './entities/environment-template' +import { wrapEnvironmentTemplateInstallationCollection } from './entities/environment-template-installation' +export function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizationId: string) { return { /** * Updates a environment template diff --git a/lib/create-organization-api.ts b/lib/create-organization-api.ts index 1c610b5637..090a0c2e06 100644 --- a/lib/create-organization-api.ts +++ b/lib/create-organization-api.ts @@ -1,12 +1,10 @@ import { createRequestConfig } from 'contentful-sdk-core' -import entities from './entities' import type { Stream } from 'stream' import type { CreateTeamMembershipProps } from './entities/team-membership' import type { CreateTeamProps } from './entities/team' import type { CreateOrganizationInvitationProps } from './entities/organization-invitation' import type { AcceptsQueryOptions, - AcceptsQueryParams, BasicQueryOptions, MakeRequest, QueryOptions, @@ -20,6 +18,30 @@ import type { CreateAppKeyProps } from './entities/app-key' import type { CreateAppDetailsProps } from './entities/app-details' import type { OrganizationProps } from './entities/organization' +import { wrapAppDefinition, wrapAppDefinitionCollection } from './entities/app-definition' +import { wrapUser, wrapUserCollection } from './entities/user' +import { + wrapOrganizationMembership, + wrapOrganizationMembershipCollection, +} from './entities/organization-membership' +import { wrapTeamMembership, wrapTeamMembershipCollection } from './entities/team-membership' +import { + wrapTeamSpaceMembership, + wrapTeamSpaceMembershipCollection, +} from './entities/team-space-membership' +import { wrapTeam, wrapTeamCollection } from './entities/team' +import { wrapSpaceMembership, wrapSpaceMembershipCollection } from './entities/space-membership' +import { wrapOrganizationInvitation } from './entities/organization-invitation' +import { wrapAppUpload } from './entities/app-upload' +import { wrapAppSigningSecret } from './entities/app-signing-secret' +import { wrapAppEventSubscription } from './entities/app-event-subscription' +import { wrapAppKey, wrapAppKeyCollection } from './entities/app-key' +import { wrapAppDetails } from './entities/app-details' +import { wrapAppAction, wrapAppActionCollection } from './entities/app-action' +import { wrapFunction, wrapFunctionCollection } from './entities/function' +import { wrapRoleCollection } from './entities/role' +import { wrapSpaceCollection } from './entities/space' + /** * @private */ @@ -32,26 +54,6 @@ export type ContentfulOrganizationAPI = ReturnType * @private */ export default function createOrganizationApi(makeRequest: MakeRequest) { - const { wrapAppDefinition, wrapAppDefinitionCollection } = entities.appDefinition - const { wrapUser, wrapUserCollection } = entities.user - const { wrapOrganizationMembership, wrapOrganizationMembershipCollection } = - entities.organizationMembership - const { wrapTeamMembership, wrapTeamMembershipCollection } = entities.teamMembership - const { wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection } = - entities.teamSpaceMembership - const { wrapTeam, wrapTeamCollection } = entities.team - const { wrapSpaceMembership, wrapSpaceMembershipCollection } = entities.spaceMembership - const { wrapOrganizationInvitation } = entities.organizationInvitation - const { wrapAppUpload } = entities.appUpload - const { wrapAppSigningSecret } = entities.appSigningSecret - const { wrapAppEventSubscription } = entities.appEventSubscription - const { wrapAppKey, wrapAppKeyCollection } = entities.appKey - const { wrapAppDetails } = entities.appDetails - const { wrapAppAction, wrapAppActionCollection } = entities.appAction - const { wrapFunction, wrapFunctionCollection } = entities.func - const { wrapRoleCollection } = entities.role - const { wrapSpaceCollection } = entities.space - return { /** * Gets a collection of spaces in the organization diff --git a/lib/create-space-api.ts b/lib/create-space-api.ts index de997a677c..29f3491bd7 100644 --- a/lib/create-space-api.ts +++ b/lib/create-space-api.ts @@ -5,7 +5,6 @@ import { createRequestConfig } from 'contentful-sdk-core' import type { MakeRequest, PaginationQueryOptions, QueryOptions } from './common-types' -import entities from './entities' import type { CreateApiKeyProps } from './entities/api-key' import type { CreateEnvironmentProps } from './entities/environment' import type { CreateEnvironmentAliasProps } from './entities/environment-alias' @@ -21,6 +20,24 @@ import type { } from './entities/webhook' import type { AiActionProps, AiActionQueryOptions, CreateAiActionProps } from './entities/ai-action' +import { wrapSpace } from './entities/space' +import { wrapEnvironment, wrapEnvironmentCollection } from './entities/environment' +import { wrapWebhook, wrapWebhookCollection } from './entities/webhook' +import { wrapRole, wrapRoleCollection } from './entities/role' +import { wrapUser, wrapUserCollection } from './entities/user' +import { wrapSpaceMember, wrapSpaceMemberCollection } from './entities/space-member' +import { wrapSpaceMembership, wrapSpaceMembershipCollection } from './entities/space-membership' +import { + wrapTeamSpaceMembership, + wrapTeamSpaceMembershipCollection, +} from './entities/team-space-membership' +import { wrapTeamCollection } from './entities/team' +import { wrapApiKey, wrapApiKeyCollection } from './entities/api-key' +import { wrapEnvironmentAlias, wrapEnvironmentAliasCollection } from './entities/environment-alias' +import { wrapPreviewApiKey, wrapPreviewApiKeyCollection } from './entities/preview-api-key' +import { wrapScheduledAction, wrapScheduledActionCollection } from './entities/scheduled-action' +import { wrapAiAction, wrapAiActionCollection } from './entities/ai-action' + /** * @private */ @@ -33,23 +50,6 @@ export type ContentfulSpaceAPI = ReturnType * @private */ export default function createSpaceApi(makeRequest: MakeRequest) { - const { wrapSpace } = entities.space - const { wrapEnvironment, wrapEnvironmentCollection } = entities.environment - const { wrapWebhook, wrapWebhookCollection } = entities.webhook - const { wrapRole, wrapRoleCollection } = entities.role - const { wrapUser, wrapUserCollection } = entities.user - const { wrapSpaceMember, wrapSpaceMemberCollection } = entities.spaceMember - const { wrapSpaceMembership, wrapSpaceMembershipCollection } = entities.spaceMembership - const { wrapTeamSpaceMembership, wrapTeamSpaceMembershipCollection } = - entities.teamSpaceMembership - const { wrapTeamCollection } = entities.team - const { wrapApiKey, wrapApiKeyCollection } = entities.apiKey - const { wrapEnvironmentAlias, wrapEnvironmentAliasCollection } = entities.environmentAlias - const { wrapPreviewApiKey, wrapPreviewApiKeyCollection } = entities.previewApiKey - const { wrapScheduledAction, wrapScheduledActionCollection } = entities.scheduledAction - const { wrapAiAction, wrapAiActionCollection } = entities.aiAction - const { wrapAiActionInvocation, wrapAiActionInvocationCollection } = entities.aiActionInvocation - return { /** * Deletes the space diff --git a/lib/create-ui-config-api.ts b/lib/create-ui-config-api.ts index c012a86602..b762317fb5 100644 --- a/lib/create-ui-config-api.ts +++ b/lib/create-ui-config-api.ts @@ -1,7 +1,8 @@ import type { MakeRequest } from './common-types' -import entities from './entities' import type { UIConfig } from './entities/ui-config' +import { wrapUIConfig } from './entities/ui-config' + /** * @private */ @@ -11,8 +12,6 @@ export type ContentfulUIConfigApi = ReturnType * @private */ export default function createUIConfigApi(makeRequest: MakeRequest) { - const { wrapUIConfig } = entities.uiConfig - const getParams = (self: UIConfig) => { const uiConfig = self.toPlainObject() diff --git a/lib/create-user-ui-config-api.ts b/lib/create-user-ui-config-api.ts index 0ae28af783..e6ee626549 100644 --- a/lib/create-user-ui-config-api.ts +++ b/lib/create-user-ui-config-api.ts @@ -1,7 +1,8 @@ import type { MakeRequest } from './common-types' -import entities from './entities' import type { UserUIConfig } from './entities/user-ui-config' +import { wrapUserUIConfig } from './entities/user-ui-config' + /** * @private */ @@ -11,8 +12,6 @@ export type ContentfulUIConfigApi = ReturnType * @private */ export default function createUserUIConfigApi(makeRequest: MakeRequest) { - const { wrapUserUIConfig } = entities.userUIConfig - const getParams = (self: UserUIConfig) => { const userUIConfig = self.toPlainObject() diff --git a/lib/entities/index.ts b/lib/entities/index.ts deleted file mode 100644 index d63243839a..0000000000 --- a/lib/entities/index.ts +++ /dev/null @@ -1,127 +0,0 @@ -import * as aiAction from './ai-action' -import * as aiActionInvocation from './ai-action-invocation' -import * as apiKey from './api-key' -import * as appAction from './app-action' -import * as appActionCall from './app-action-call' -import * as appBundle from './app-bundle' -import * as appDefinition from './app-definition' -import * as appDetails from './app-details' -import * as appInstallation from './app-installation' -import * as appSignedRequest from './app-signed-request' -import * as appSigningSecret from './app-signing-secret' -import * as appEventSubscription from './app-event-subscription' -import * as appKey from './app-key' -import * as appAccessToken from './app-access-token' -import * as appUpload from './app-upload' -import * as asset from './asset' -import * as assetKey from './asset-key' -import * as bulkAction from './bulk-action' -import * as comment from './comment' -import * as contentType from './content-type' -import * as editorInterface from './editor-interface' -import * as entry from './entry' -import * as environment from './environment' -import * as environmentAlias from './environment-alias' -import * as environmentTemplate from './environment-template' -import * as environmentTemplateInstallation from './environment-template-installation' -import * as extension from './extension' -import * as func from './function' -import * as functionLog from './function-log' -import * as locale from './locale' -import * as oauthApplication from './oauth-application' -import * as organization from './organization' -import * as organizationInvitation from './organization-invitation' -import * as organizationMembership from './organization-membership' -import * as personalAccessToken from './personal-access-token' -import * as accessToken from './access-token' -import * as previewApiKey from './preview-api-key' -import * as release from './release' -import * as releaseAction from './release-action' -import * as role from './role' -import * as scheduledAction from './scheduled-action' -import * as snapshot from './snapshot' -import * as space from './space' -import * as spaceMember from './space-member' -import * as spaceMembership from './space-membership' -import * as tag from './tag' -import * as task from './task' -import * as team from './team' -import * as teamMembership from './team-membership' -import * as teamSpaceMembership from './team-space-membership' -import * as uiConfig from './ui-config' -import * as upload from './upload' -import * as usage from './usage' -import * as user from './user' -import * as userUIConfig from './user-ui-config' -import * as webhook from './webhook' -import * as workflowDefinition from './workflow-definition' -import * as concept from './concept' -import * as conceptScheme from './concept-scheme' -import * as resourceProvider from './resource-provider' -import * as resourceType from './resource-type' -import * as resource from './resource' - -export default { - aiAction, - aiActionInvocation, - accessToken, - appAction, - appActionCall, - appBundle, - apiKey, - appDefinition, - appInstallation, - appUpload, - appDetails, - appSignedRequest, - appSigningSecret, - appEventSubscription, - appKey, - appAccessToken, - asset, - assetKey, - bulkAction, - comment, - concept, - conceptScheme, - contentType, - editorInterface, - entry, - environment, - environmentAlias, - environmentTemplate, - environmentTemplateInstallation, - extension, - func, - functionLog, - locale, - oauthApplication, - organization, - organizationInvitation, - organizationMembership, - personalAccessToken, - previewApiKey, - release, - releaseAction, - resourceProvider, - resourceType, - resource, - role, - scheduledAction, - snapshot, - space, - spaceMember, - spaceMembership, - tag, - task, - team, - teamMembership, - teamSpaceMembership, - uiConfig, - upload, - usage, - user, - userUIConfig, - webhook, - workflowDefinition, -} diff --git a/lib/entities/resource-provider.ts b/lib/entities/resource-provider.ts index 4614c7933b..1838b7e00f 100644 --- a/lib/entities/resource-provider.ts +++ b/lib/entities/resource-provider.ts @@ -9,7 +9,8 @@ import { toPlainObject, freezeSys } from 'contentful-sdk-core' import copy from 'fast-copy' import enhanceWithMethods from '../enhance-with-methods' import type { ResourceType, UpsertResourceTypeProps } from './resource-type' -import entities from '.' + +import { wrapResourceType } from './resource-type' export type ResourceProviderProps = { /** @@ -47,8 +48,6 @@ export interface ResourceProvider * @private */ function createResourceProviderApi(makeRequest: MakeRequest) { - const { wrapResourceType } = entities.resourceType - return { /** * Sends an update to the server with any changes made to the object's properties From b9d6dfa55e5fb7fea0804eea47fd6191c26e717c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 12:42:33 +0100 Subject: [PATCH 06/21] refactor: ensure export types are really only used to export types --- lib/contentful-management.ts | 2 +- lib/create-contentful-api.ts | 10 +++++----- lib/plain/entities/resource-type.ts | 7 +++++-- lib/plain/entities/tag.ts | 3 +-- lib/plain/entities/team-membership.ts | 2 +- lib/plain/entities/team-space-membership.ts | 5 ++++- lib/plain/entities/team.ts | 2 +- lib/plain/entities/usage.ts | 2 +- lib/plain/entities/user.ts | 2 +- 9 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 800786b3b2..7e114605db 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -27,7 +27,7 @@ export type { RestAdapterParams } from './adapters/REST/rest-adapter' export { makeRequest } from './adapters/REST/make-request' export { editorInterfaceDefaults } export type PlainClientDefaultParams = DefaultParams -export * from './export-types' +export type * from './export-types' interface UserAgentParams { /** diff --git a/lib/create-contentful-api.ts b/lib/create-contentful-api.ts index 75595109a4..05abac2f51 100644 --- a/lib/create-contentful-api.ts +++ b/lib/create-contentful-api.ts @@ -26,6 +26,11 @@ import { wrapEnvironmentTemplate, wrapEnvironmentTemplateCollection, } from './entities/environment-template' +import type { + CreateOAuthApplicationProps, + OAuthApplication, + OAuthApplicationProps, +} from './entities/oauth-application' import { wrapOAuthApplication, wrapOAuthApplicationCollection } from './entities/oauth-application' import type { Organization, OrganizationProps } from './entities/organization' @@ -40,11 +45,6 @@ import type { EnvironmentTemplateProps, } from './entities/environment-template' import type { RawAxiosRequestConfig } from 'axios' -import type { - CreateOAuthApplicationProps, - OAuthApplication, - OAuthApplicationProps, -} from './export-types' export type ClientAPI = ReturnType type CreateSpaceProps = Omit & { defaultLocale?: string } diff --git a/lib/plain/entities/resource-type.ts b/lib/plain/entities/resource-type.ts index 912ed0aab2..0f52244f1a 100644 --- a/lib/plain/entities/resource-type.ts +++ b/lib/plain/entities/resource-type.ts @@ -8,8 +8,11 @@ import type { GetResourceTypeParams, GetSpaceEnvironmentParams, } from '../../common-types' -import type { ResourceTypeProps, UpsertResourceTypeProps } from '../../export-types' -import type { SpaceEnvResourceTypeProps } from '../../entities/resource-type' +import type { + SpaceEnvResourceTypeProps, + ResourceTypeProps, + UpsertResourceTypeProps, +} from '../../entities/resource-type' export type ResourceTypePlainClientAPI = { /* diff --git a/lib/plain/entities/tag.ts b/lib/plain/entities/tag.ts index e743366991..da6640c581 100644 --- a/lib/plain/entities/tag.ts +++ b/lib/plain/entities/tag.ts @@ -5,8 +5,7 @@ import type { QueryParams, CollectionProp, } from '../../common-types' -import type { UpdateTagProps, DeleteTagParams } from '../../entities/tag' -import type { TagProps, CreateTagProps } from '../../export-types' +import type { TagProps, CreateTagProps, UpdateTagProps, DeleteTagParams } from '../../entities/tag' import type { OptionalDefaults } from '../wrappers/wrap' export type TagPlainClientAPI = { diff --git a/lib/plain/entities/team-membership.ts b/lib/plain/entities/team-membership.ts index d7f5bba710..ae9e8a3d9b 100644 --- a/lib/plain/entities/team-membership.ts +++ b/lib/plain/entities/team-membership.ts @@ -6,7 +6,7 @@ import type { CollectionProp, GetTeamParams, } from '../../common-types' -import type { TeamMembershipProps, CreateTeamMembershipProps } from '../../export-types' +import type { TeamMembershipProps, CreateTeamMembershipProps } from '../../entities/team-membership' import type { OptionalDefaults } from '../wrappers/wrap' export type TeamMembershipPlainClientAPI = { diff --git a/lib/plain/entities/team-space-membership.ts b/lib/plain/entities/team-space-membership.ts index c6f89c32d0..39a729cbc1 100644 --- a/lib/plain/entities/team-space-membership.ts +++ b/lib/plain/entities/team-space-membership.ts @@ -6,7 +6,10 @@ import type { CollectionProp, GetOrganizationParams, } from '../../common-types' -import type { TeamSpaceMembershipProps, CreateTeamSpaceMembershipProps } from '../../export-types' +import type { + TeamSpaceMembershipProps, + CreateTeamSpaceMembershipProps, +} from '../../entities/team-space-membership' import type { OptionalDefaults } from '../wrappers/wrap' export type TeamSpaceMembershipPlainClientAPI = { diff --git a/lib/plain/entities/team.ts b/lib/plain/entities/team.ts index 5115095b8a..8401c54e78 100644 --- a/lib/plain/entities/team.ts +++ b/lib/plain/entities/team.ts @@ -6,7 +6,7 @@ import type { CollectionProp, GetSpaceParams, } from '../../common-types' -import type { TeamProps, CreateTeamProps } from '../../export-types' +import type { TeamProps, CreateTeamProps } from '../../entities/team' import type { OptionalDefaults } from '../wrappers/wrap' export type TeamPlainClientAPI = { diff --git a/lib/plain/entities/usage.ts b/lib/plain/entities/usage.ts index 647d24b882..0baba14543 100644 --- a/lib/plain/entities/usage.ts +++ b/lib/plain/entities/usage.ts @@ -1,5 +1,5 @@ import type { CollectionProp, QueryParams } from '../../common-types' -import type { UsageProps } from '../../export-types' +import type { UsageProps } from '../../entities/usage' import type { OptionalDefaults } from '../wrappers/wrap' export type UsagePlainClientAPI = { diff --git a/lib/plain/entities/user.ts b/lib/plain/entities/user.ts index 6a27921312..adcae098f2 100644 --- a/lib/plain/entities/user.ts +++ b/lib/plain/entities/user.ts @@ -4,7 +4,7 @@ import type { GetSpaceParams, QueryParams, } from '../../common-types' -import type { UserProps } from '../../export-types' +import type { UserProps } from '../../entities/user' import type { OptionalDefaults } from '../wrappers/wrap' export type UserPlainClientAPI = { From 72ed3f5d4af26d20324f6268e71281fe5e1fd6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 12:52:01 +0100 Subject: [PATCH 07/21] refactor: rename plain/common-types to actually describe what the file contains --- lib/contentful-management.ts | 4 ++-- lib/export-types.ts | 2 +- lib/methods/bulk-action.ts | 2 +- lib/methods/release-action.ts | 2 +- lib/plain/{common-types.ts => plain-client-types.ts} | 0 lib/plain/plain-client.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename lib/plain/{common-types.ts => plain-client-types.ts} (100%) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 7e114605db..4c48a5715d 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -11,7 +11,7 @@ import type { AdapterParams } from './create-adapter' import { createAdapter } from './create-adapter' import type { ClientAPI } from './create-contentful-api' import createContentfulApi from './create-contentful-api' -import type { PlainClientAPI } from './plain/common-types' +import type { PlainClientAPI } from './plain/plain-client-types' import type { DefaultParams } from './plain/plain-client' import { createPlainClient } from './plain/plain-client' import * as editorInterfaceDefaults from './constants/editor-interface-defaults/index' @@ -20,7 +20,7 @@ export type { ClientAPI } from './create-contentful-api' export { asIterator } from './plain/as-iterator' export { fetchAll } from './plain/pagination-helper' export { isDraft, isPublished, isUpdated } from './plain/checks' -export type { PlainClientAPI } from './plain/common-types' +export type { PlainClientAPI } from './plain/plain-client-types' export { createClient } export { RestAdapter } from './adapters/REST/rest-adapter' export type { RestAdapterParams } from './adapters/REST/rest-adapter' diff --git a/lib/export-types.ts b/lib/export-types.ts index f88cca269d..bbeef3dbbd 100644 --- a/lib/export-types.ts +++ b/lib/export-types.ts @@ -260,7 +260,7 @@ export type { WorkflowStepProps, WorkflowStepTaskAction, } from './entities/workflow-definition' -export * from './plain/common-types' +export * from './plain/plain-client-types' export { WorkflowStepPermissionAction, diff --git a/lib/methods/bulk-action.ts b/lib/methods/bulk-action.ts index 0ea7056d4a..18d7830e95 100644 --- a/lib/methods/bulk-action.ts +++ b/lib/methods/bulk-action.ts @@ -1,5 +1,5 @@ import type { BulkActionPayload, BulkActionProps } from '../entities/bulk-action' -import type { PlainClientAPI } from '../plain/common-types' +import type { PlainClientAPI } from '../plain/plain-client-types' import type { AsyncActionProcessingOptions } from './action' import { pollAsyncActionStatus } from './action' diff --git a/lib/methods/release-action.ts b/lib/methods/release-action.ts index fc53b03610..df1928e6fb 100644 --- a/lib/methods/release-action.ts +++ b/lib/methods/release-action.ts @@ -1,5 +1,5 @@ import type { ReleaseActionProps, ReleaseActionTypes } from '../entities/release-action' -import type { PlainClientAPI } from '../plain/common-types' +import type { PlainClientAPI } from '../plain/plain-client-types' import type { AsyncActionProcessingOptions } from './action' import { pollAsyncActionStatus } from './action' diff --git a/lib/plain/common-types.ts b/lib/plain/plain-client-types.ts similarity index 100% rename from lib/plain/common-types.ts rename to lib/plain/plain-client-types.ts diff --git a/lib/plain/plain-client.ts b/lib/plain/plain-client.ts index 7f510acf41..02cc17cc9e 100644 --- a/lib/plain/plain-client.ts +++ b/lib/plain/plain-client.ts @@ -1,6 +1,6 @@ import type { GetContentTypeParams, GetSpaceEnvironmentParams, MakeRequest } from '../common-types' import { omitAndDeleteField } from '../methods/content-type' -import type { PlainClientAPI } from './common-types' +import type { PlainClientAPI } from './plain-client-types' import type { DefaultParams } from './wrappers/wrap' import { wrap } from './wrappers/wrap' From cbe77a4f1c926b17144857b9ae68049faed98fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 12:52:43 +0100 Subject: [PATCH 08/21] fix: remove confusing outdated ClientParams type and finally export the type for the client creation options --- lib/contentful-management.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 4c48a5715d..d03594d695 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -42,11 +42,6 @@ interface UserAgentParams { feature?: string } -/** - * @deprecated - */ -export type ClientParams = RestAdapterParams & UserAgentParams - export type ClientOptions = UserAgentParams & XOR /** From c633bbe1d5c6448c5c012eb1dc40bc803a379cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 12:55:23 +0100 Subject: [PATCH 09/21] refactor: clean up messy imports and exports in main file - many cooks - much chaos --- lib/contentful-management.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index d03594d695..cd30458668 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -4,30 +4,30 @@ * @packageDocumentation */ -import { getUserAgentHeader } from 'contentful-sdk-core' -import type { RestAdapterParams } from './adapters/REST/rest-adapter' -import type { MakeRequest, XOR } from './common-types' import type { AdapterParams } from './create-adapter' -import { createAdapter } from './create-adapter' import type { ClientAPI } from './create-contentful-api' -import createContentfulApi from './create-contentful-api' -import type { PlainClientAPI } from './plain/plain-client-types' import type { DefaultParams } from './plain/plain-client' +import type { MakeRequest, XOR } from './common-types' +import type { PlainClientAPI } from './plain/plain-client-types' +import type { RestAdapterParams } from './adapters/REST/rest-adapter' + +import { createAdapter } from './create-adapter' import { createPlainClient } from './plain/plain-client' -import * as editorInterfaceDefaults from './constants/editor-interface-defaults/index' +import { getUserAgentHeader } from 'contentful-sdk-core' +import createContentfulApi from './create-contentful-api' export type { ClientAPI } from './create-contentful-api' +export type { PlainClientAPI } from './plain/plain-client-types' +export type { RestAdapterParams } from './adapters/REST/rest-adapter' +export type * from './export-types' +export type PlainClientDefaultParams = DefaultParams + export { asIterator } from './plain/as-iterator' export { fetchAll } from './plain/pagination-helper' export { isDraft, isPublished, isUpdated } from './plain/checks' -export type { PlainClientAPI } from './plain/plain-client-types' -export { createClient } -export { RestAdapter } from './adapters/REST/rest-adapter' -export type { RestAdapterParams } from './adapters/REST/rest-adapter' export { makeRequest } from './adapters/REST/make-request' -export { editorInterfaceDefaults } -export type PlainClientDefaultParams = DefaultParams -export type * from './export-types' +export { RestAdapter } from './adapters/REST/rest-adapter' +export * as editorInterfaceDefaults from './constants/editor-interface-defaults/index' interface UserAgentParams { /** @@ -105,3 +105,5 @@ function createClient( return createContentfulApi(makeRequest) as ClientAPI } } + +export { createClient } From 59ae491599dce2609fb4bfb872cd10e898f3f543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 13:07:21 +0100 Subject: [PATCH 10/21] chore: reinstall to clean up package.json and lock file --- package-lock.json | 41 +++++++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0cac9d1561..5ea35c18ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,7 @@ "axios": "^1.8.4", "contentful-sdk-core": "^9.0.1", "fast-copy": "^3.0.0", - "globals": "^15.15.0", - "typedoc-github-theme": "^0.2.1", - "typedoc-plugin-markdown": "^4.4.2", - "typedoc-plugin-missing-exports": "^3.1.0" + "globals": "^15.15.0" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -60,6 +57,8 @@ "size-limit": "^11.1.6", "type-fest": "^4.18.3", "typedoc": "^0.27.9", + "typedoc-github-theme": "^0.2.1", + "typedoc-plugin-missing-exports": "^3.1.0", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5", @@ -2669,6 +2668,7 @@ "version": "1.27.2", "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", + "dev": true, "license": "MIT", "dependencies": { "@shikijs/engine-oniguruma": "^1.27.2", @@ -3943,6 +3943,7 @@ "version": "1.29.2", "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz", "integrity": "sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==", + "dev": true, "license": "MIT", "dependencies": { "@shikijs/types": "1.29.2", @@ -3953,6 +3954,7 @@ "version": "1.29.2", "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.2.tgz", "integrity": "sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==", + "dev": true, "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.1", @@ -3963,6 +3965,7 @@ "version": "10.0.2", "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/is": { @@ -4096,6 +4099,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, "license": "MIT", "dependencies": { "@types/unist": "*" @@ -4157,6 +4161,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -4985,6 +4990,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, "license": "Python-2.0" }, "node_modules/argv-formatter": { @@ -5338,6 +5344,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -6956,6 +6963,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -10040,6 +10048,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, "license": "MIT", "dependencies": { "uc.micro": "^2.0.0" @@ -10674,6 +10683,7 @@ "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, "license": "MIT" }, "node_modules/lz-string": { @@ -10736,6 +10746,7 @@ "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1", @@ -10822,6 +10833,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, "license": "MIT" }, "node_modules/media-typer": { @@ -15003,6 +15015,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -17587,6 +17600,7 @@ "version": "0.27.9", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@gerrit0/mini-shiki": "^1.24.0", @@ -17609,6 +17623,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/typedoc-github-theme/-/typedoc-github-theme-0.2.1.tgz", "integrity": "sha512-pOgsS9CVAOO3JxQ1V0ocDkrPCULpoWg1OzRmn/mOlyG+vEYwUAp5DAoKrGECdNIomycxcisc8ovcMX0nHDgWTA==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" @@ -17617,22 +17632,11 @@ "typedoc": "^0.27.6" } }, - "node_modules/typedoc-plugin-markdown": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.4.2.tgz", - "integrity": "sha512-kJVkU2Wd+AXQpyL6DlYXXRrfNrHrEIUgiABWH8Z+2Lz5Sq6an4dQ/hfvP75bbokjNDUskOdFlEEm/0fSVyC7eg==", - "license": "MIT", - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "typedoc": "0.27.x" - } - }, "node_modules/typedoc-plugin-missing-exports": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-3.1.0.tgz", "integrity": "sha512-Sogbaj+qDa21NjB3SlIw4JXSwmcl/WOjwiPNaVEcPhpNG/MiRTtpwV81cT7h1cbu9StpONFPbddYWR0KV/fTWA==", + "dev": true, "license": "MIT", "peerDependencies": { "typedoc": "0.26.x || 0.27.x" @@ -17642,6 +17646,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -17651,6 +17656,7 @@ "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -17666,6 +17672,7 @@ "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -17702,6 +17709,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, "license": "MIT" }, "node_modules/uglify-js": { @@ -18668,6 +18676,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index e45709036d..75f5b09075 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "semantic-release": "^22.0.12", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.28.1", + "typedoc": "^0.27.9", "typedoc-github-theme": "^0.2.1", "typedoc-plugin-missing-exports": "^3.1.0", "typescript": "^5.6.3", From 38d99140e836592d77134f4ebba6af71aa1b25e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 13:07:47 +0100 Subject: [PATCH 11/21] refactor: rename params to clientOptions in createClient function to ensure naming of variable matches naming of type --- lib/contentful-management.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index cd30458668..738b001753 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -46,7 +46,7 @@ export type ClientOptions = UserAgentParams & XOR and ReturnType only return the types of the last overload // https://github.com/microsoft/TypeScript/issues/26591 From c5454cd8059881181d7dc8182429cc28c1d0be29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 14:22:03 +0100 Subject: [PATCH 12/21] refactor: remove deprecated, unsupported and unused alphaFeatures --- lib/contentful-management.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 738b001753..48033f5db8 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -63,17 +63,6 @@ function createClient( } ): PlainClientAPI // Usually, overloads with more specific signatures should come first but some IDEs are often not able to handle overloads with separate TSDocs correctly -/** - * @deprecated The `alphaFeatures` option is no longer supported. Please use the function without this option. - */ -function createClient( - clientOptions: ClientOptions, - opts: { - type?: 'plain' - alphaFeatures: string[] - defaults?: DefaultParams - } -): ClientAPI | PlainClientAPI function createClient( clientOptions: ClientOptions, opts: { From 54fcffa370209082850a750c80f5485654c34ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 25 Mar 2025 14:56:46 +0100 Subject: [PATCH 13/21] refactor: clean up createClient overloads, add examples for each way to use it and make compatible with typedoc --- lib/contentful-management.ts | 56 +++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 48033f5db8..6d29aa2575 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -45,16 +45,33 @@ interface UserAgentParams { export type ClientOptions = UserAgentParams & XOR /** - * Create a client instance - * @param clientOptions - Client initialization parameters + * Create a plain client instance * + * @param clientOptions + * @param opts + * + * @example Plain Client + * ```javascript + * const client = contentfulManagement.createClient({ + * accessToken: 'myAccessToken', + * opts: { + * type: 'plain' + * } + * }) + * ``` + * @example Plain Client with defaults * ```javascript * const client = contentfulManagement.createClient({ - * accessToken: 'myAccessToken' + * accessToken: 'myAccessToken', + * opts: { + * type: 'plain', + * defaults: { + * ... + * } + * } * }) * ``` */ -function createClient(clientOptions: ClientOptions): ClientAPI function createClient( clientOptions: ClientOptions, opts: { @@ -62,16 +79,35 @@ function createClient( defaults?: DefaultParams } ): PlainClientAPI -// Usually, overloads with more specific signatures should come first but some IDEs are often not able to handle overloads with separate TSDocs correctly +/** + * Create a legacy, chainable client instance + * @param clientOptions + * + * @example Legacy Chainable Client + * ```javascript + * const client = contentfulManagement.createClient({ + * accessToken: 'myAccessToken' + * }) + * ``` + */ +function createClient(clientOptions: ClientOptions): ClientAPI +/** + * Create a legacy or plain client instance + * + * Please check the responding section below: + * + * * [Plain Client](#createclient) + * * [Legacy Chainable Client](#createclient-1) + */ function createClient( clientOptions: ClientOptions, - opts: { - type?: 'plain' + opts?: { + type?: string defaults?: DefaultParams - } = {} + } ): ClientAPI | PlainClientAPI { const sdkMain = - opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js' + opts && opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js' const userAgent = getUserAgentHeader( // @ts-expect-error `${sdkMain}/${__VERSION__}`, @@ -88,7 +124,7 @@ function createClient( const makeRequest: MakeRequest = (options: Parameters[0]): ReturnType => adapter.makeRequest({ ...options, userAgent }) - if (opts.type === 'plain') { + if (opts && opts.type === 'plain') { return createPlainClient(makeRequest, opts.defaults) } else { return createContentfulApi(makeRequest) as ClientAPI From 7afe7770b1089af42af2795c0c460b3f874bce07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Thu, 27 Mar 2025 13:46:59 +0100 Subject: [PATCH 14/21] docs: README - clearer distinction between plain and legacy client, highlight our examples on contentful.com, config options as table, some more cleanups --- README.md | 196 +++++++++++++++++++++++------------------------------- 1 file changed, 82 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index 82ad51ffe8..40336452c3 100644 --- a/README.md +++ b/README.md @@ -49,29 +49,17 @@ - [Typings](#typings) - [Authentication](#authentication) - [Using ES6 import](#using-es6-import) - - [Your first request](#your-first-request) - - [Legacy Client Interface](#legacy-client-interface) + - [Using the Plain Client](#using-the-plain-client) + - [With scoped space and environment](#with-scoped-space-and-environment) + - [Using the Legacy Client](#using-the-legacy-client) - [App Framework](#app-framework) - [Troubleshooting](#troubleshooting) - [Documentation/References](#documentationreferences) - - [Configuration](#configuration) - - [accessToken (required, when `apiAdapter` is not set)](#accesstoken-required-when-apiadapter-is-not-set) - - [host (default: `'api.contentful.com'`)](#host-default-apicontentfulcom) - - [hostUpload (default: `'upload.contentful.com'`)](#hostupload-default-uploadcontentfulcom) - - [basePath (default: \`\`)](#basepath-default-) - - [httpAgent (default: `undefined`)](#httpagent-default-undefined) - - [httpsAgent (default: `undefined`)](#httpsagent-default-undefined) - - [headers (default: `{}`)](#headers-default-) - - [proxy (default: `undefined`)](#proxy-default-undefined) - - [retryOnError (default: `true`)](#retryonerror-default-true) - - [logHandler (default: `function (level, data) {}`)](#loghandler-default-function-level-data-) - - [requestLogger (default: `function (config) {}`)](#requestlogger-default-function-config-) - - [responseLogger (default: `function (response) {}`)](#responselogger-default-function-response-) - - [apiAdapter (default: `new RestAdapter(configuration)`)](#apiadapter-default-new-restadapterconfiguration) - - [throttle (default: `0`)](#throttle-default-0) + - [REST API reference with examples](#rest-api-reference-with-examples) - [Reference documentation](#reference-documentation) - - [Contentful JavaScript resources](#contentful-javascript-resources) - - [REST API reference](#rest-api-reference) + - [Configuration](#configuration) + - [Request configuration options](#request-configuration-options) + - [Tutorials \& other resources](#tutorials--other-resources) - [Versioning](#versioning) - [Reach out to us](#reach-out-to-us) - [You have questions about how to use this library?](#you-have-questions-about-how-to-use-this-library) @@ -89,6 +77,9 @@ - Content management and retrieval through Contentful's [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/). - Built in rate limiting with recovery procedures - Asset processing helpers +- Two different types of clients: + - [Plain Client](#using-the-plain-client) + - [Legacy Chainable Client ](#using-the-legacy-client) ## Supported environments @@ -154,7 +145,7 @@ Check the [releases](https://github.com/contentful/contentful-management.js/rele ## Typings -This library also comes with typings to use with typescript. +This library includes TypeScript typings out of the box. ## Authentication @@ -166,7 +157,7 @@ If you'd like to create an app which would make use of this library but that wou ## Using ES6 import -You can use the es6 import with the library as follows +You can import the library using ES6 syntax as follows: ```js // import createClient directly @@ -181,7 +172,7 @@ const client = contentful.createClient( //.... ``` -## Your first request +## Using the Plain Client Beginning with `contentful-management@7` this library provides a client which exposes all CMA endpoints in a simple flat API surface, as opposed to the waterfall structure exposed by legacy versions of the SDK. @@ -207,8 +198,11 @@ const entries = await plainClient.entry.getMany({ limit: 100, }, }) +``` + +### With scoped space and environment -// With scoped space and environment +```javascript const scopedPlainClient = contentful.createClient( { accessToken: 'YOUR_ACCESS_TOKEN', @@ -241,7 +235,7 @@ The benefits of using the "plain" version of the client, over the legacy version - The ability to scope CMA client instance to a specific `spaceId`, `environmentId`, and `organizationId` when initializing the client. - You can pass a concrete values to `defaults` and omit specifying these params in actual CMA methods calls. -## Legacy Client Interface +## Using the Legacy Client The following code snippet is an example of the legacy client interface, which reads and writes data as a sequence of nested requests: @@ -316,112 +310,86 @@ contentfulApp.init((sdk) => { ## Documentation/References -To help you get the most out of this library, we've prepared reference documentation, tutorials and other examples that will help you learn and understand how to use this library. - -## Configuration - -The `createClient` method supports several options you may set to achieve the expected behavior: - -```js -contentful.createClient({ - ... your config here ... -}) -``` - -#### accessToken (required, when `apiAdapter` is not set) - -Your CMA access token. - -#### host (default: `'api.contentful.com'`) - -Set the host used to build the request URI's. - -#### hostUpload (default: `'upload.contentful.com'`) - -Set the host used to build the upload related request uri's. - -#### basePath (default: ``) - -This path gets appended to the host to allow request urls like `https://gateway.example.com/contentful/` for custom gateways/proxies. - -#### httpAgent (default: `undefined`) - -Custom agent to perform HTTP requests. Find further information in the [axios request config documentation](https://github.com/mzabriskie/axios#request-config). - -#### httpsAgent (default: `undefined`) - -Custom agent to perform HTTPS requests. Find further information in the [axios request config documentation](https://github.com/mzabriskie/axios#request-config). - -#### headers (default: `{}`) - -Additional headers to attach to the requests. We add/overwrite the following headers: - -- Content-Type: `application/vnd.contentful.management.v1+json` -- X-Contentful-User-Agent: `sdk contentful-management.js/1.2.3; platform node.js/1.2.3; os macOS/1.2.3` - (Automatically generated) +To help you get the most out of this library, we've prepared full client configuration options, reference documentation, tutorials, and other examples to help you learn and understand how to use this library effectively. -#### proxy (default: `undefined`) +- [REST API reference with examples](#rest-api-reference-with-examples) +- [Configuration](#configuration) +- [Reference documentation](#reference-documentation) +- [Tutorials & other resources](#tutorials--other-resources) -Axios proxy configuration. See the [axios request config documentation](https://github.com/mzabriskie/axios#request-config) for further information about the supported values. +### REST API reference with examples -#### retryOnError (default: `true`) +This library is a wrapper around the [Contentful Management REST API](https://www.contentful.com/developers/docs/references/content-management-api/). -By default, this library is retrying requests which resulted in a 500 server error and 429 rate limit response. Set this to `false` to disable this behavior. +You can use the API reference to find full, copy-paste-ready examples for both the **plain** and **legacy** clients of this library. +[For example, here’s how to create, update, publish, or fetch an entry](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries/entry). -#### logHandler (default: `function (level, data) {}`) +It’s your go-to resource for: -Errors and warnings will be logged by default to the node or browser console. Pass your own log handler to intercept here and handle errors, warnings and info on your own. - -#### requestLogger (default: `function (config) {}`) - -Interceptor called on every request. Takes Axios request config as an arg. Default does nothing. Pass your own function to log any desired data. - -#### responseLogger (default: `function (response) {}`) - -Interceptor called on every response. Takes Axios response object as an arg. Default does nothing. Pass your own function to log any desired data. - -#### apiAdapter (default: `new RestAdapter(configuration)`) - -An [`Adapter`](https://github.com/contentful/contentful-management.js/blob/2350b47053459694b21b19c71025632fe57815cc/lib/common-types.ts#L493-L495) -that can be utilized to issue requests. It defaults to a [`RestAdapter`](https://github.com/contentful/contentful-management.js/blob/b50534c629a8ddc81637170a07bc63477d136cec/lib/adapters/REST/rest-adapter.ts) -initialized with provided configuration. - -> **Please Note** -> -> The Adapter will take precedence over the other options. Therefore, ensure you're providing the Adapter all the -> information it needs to issue the request (e.g., host or auth headers) - -#### throttle (default: `0`) - -Maximum number of requests per second. - -- `1`-`30` (fixed number of limit), -- `'auto'` (calculated limit based on your plan), -- `'0%'` - `'100%'` (calculated % limit based on your plan) +- Quickly grabbing example snippets for specific operations in the Contentful Management API +- Complete and detailed endpoint descriptions +- Previewing request and response payloads +- Understanding query filters and pagination ### Reference documentation -The [Contentful's JS library reference](https://contentful.github.io/contentful-management.js) documents what objects and methods are exposed by this library, what arguments they expect and what kind of data is returned. - -Most methods also have examples which show you how to use them. +The [Contentful JS SDK TypeDoc reference](https://contentful.github.io/contentful-management.js) documents all exported objects, types, functions, and instance methods. -You can start by looking at the top level `contentfulManagement` namespace. +> From version `1.0.0` onward, access version-specific docs at +> `https://contentful.github.io/contentful-management.js/contentful-management/` -The `ContentfulClientAPI` namespace defines the methods at the Client level which allow you to create and get spaces. +--- -The `ContentfulSpaceAPI` namespace defines the methods at the Space level which allow you to create and get entries, assets, content types and other possible entities. +### Configuration -The `Entry`, `Asset` and `ContentType` namespaces show you the instance methods you can use on each of these entities, once you retrieve them from the server. +The `createClient` method accepts several options to configure the client behavior: -> From version 1.0.0 onwards, you can access documentation for a specific version by visiting `https://contentful.github.io/contentful-management.js/contentful-management/` - -### Contentful JavaScript resources - -Read the [Contentful for JavaScript](https://www.contentful.com/developers/docs/javascript/) page for Tutorials, Demo Apps, and more information on other ways of using JavaScript with Contentful +```js +contentful.createClient({ + ...your config here... +}) +``` -### REST API reference +```js +// The plain client accepts the same configuration options +contentful.createClient( + { + ...your config here... + }, + { type: 'plain' } +) +``` -This library is a wrapper around our Contentful Management REST API. Some more specific details such as search parameters and pagination are better explained on the [REST API reference](https://www.contentful.com/developers/docs/references/content-management-api/), and you can also get a better understanding of how the requests look under the hood. +#### Request configuration options + +| Name | Default | Description | +| ---------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accessToken` | | **Required** (unless using `apiAdapter`). Your CMA access token. | +| `host` | `'api.contentful.com'` | The base host used for API requests. | +| `hostUpload` | `'upload.contentful.com'` | The host used for upload-related API requests. | +| `basePath` | `''` | Appended to the host. Useful for custom gateways/proxies like `https://gateway.example.com/contentful/`. | +| `httpAgent` | `undefined` | Custom HTTP agent. See [Axios request config](https://github.com/axios/axios#request-config). | +| `httpsAgent` | `undefined` | Custom HTTPS agent. See [Axios request config](https://github.com/axios/axios#request-config). | +| `headers` | `{}` | Additional headers for all requests. The SDK automatically sets:
• `Content-Type: application/vnd.contentful.management.v1+json`
• `X-Contentful-User-Agent: sdk contentful-management.js/x.y.z; platform ...; os ...` | +| `proxy` | `undefined` | Axios proxy configuration. See [Axios request config](https://github.com/axios/axios#request-config). | +| `retryOnError` | `true` | Retries requests on `500` or `429` responses. Set to `false` to disable retry behavior. | +| `throttle` | `0` | Max requests per second:
• Fixed: `1`–`30`
• `'auto'`: based on your plan
• `'0%'`–`'100%'`: percentage-based rate based on plan limit | +| `application` | `undefined` | Custom application identifier, e.g. `'myApp/version'`. Added to the `X-Contentful-User-Agent` header. | +| `integration` | `undefined` | Custom integration identifier, e.g. `'react/version'`. Added to the `X-Contentful-User-Agent` header. | +| `timeout` | `30000` | Timeout in milliseconds for requests. | +| `retryLimit` | `5` | Maximum number of retry attempts for recoverable errors. | +| `logHandler` | `function (level, data) {}` | Custom log handler for SDK logs (errors, warnings, info). Defaults to console logging. | +| `requestLogger` | `function (config) {}` | Called before each request. Receives the Axios request config. No-op by default. | +| `responseLogger` | `function (response) {}` | Called after each response. Receives the Axios response object. No-op by default. | +| `apiAdapter` | `new RestAdapter(configuration)` | Custom adapter that overrides request handling.
👉 [View adapter source](https://github.com/contentful/contentful-management.js/blob/b50534c629a8ddc81637170a07bc63477d136cec/lib/adapters/REST/rest-adapter.ts)

**Note**: Takes full control of requests. Must handle headers, host, and auth internally. | + +### Tutorials & other resources + +Check out the [Contentful for JavaScript](https://www.contentful.com/developers/docs/javascript/) page for: + +- Hands-on tutorials +- Example applications +- Integration guides for frameworks and tools ## Versioning From 5363aca4e632ac674e57e1ffa3f00586259abf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Thu, 24 Apr 2025 17:14:14 +0200 Subject: [PATCH 15/21] Refactor/restructure and improve docs (#2592) * docs: categorize navigation for better plain and legacy client destinction * refactor: move createClient in its own file and rename defaultProps to plainClientDefaultProps * docs: add descriptions to our entity status check functions * Update lib/create-client.ts Co-authored-by: Lisa White * Update lib/plain/checks.ts Co-authored-by: Lisa White * refactor: simplify or remove @ts-expect-errors * chore: set createAssetApi to private again --------- Co-authored-by: Lisa White --- lib/common-utils.ts | 19 ++- lib/contentful-management.ts | 117 +---------------- lib/create-client.ts | 119 ++++++++++++++++++ lib/create-contentful-api.ts | 6 +- lib/entities/access-token.ts | 4 + lib/entities/api-key.ts | 4 + lib/entities/app-access-token.ts | 4 + lib/entities/app-action-call.ts | 4 + lib/entities/app-action.ts | 4 + lib/entities/app-bundle.ts | 4 + lib/entities/app-definition.ts | 4 + lib/entities/app-details.ts | 4 + lib/entities/app-event-subscription.ts | 4 + lib/entities/app-installation.ts | 4 + lib/entities/app-key.ts | 4 + lib/entities/app-signed-request.ts | 4 + lib/entities/app-signing-secret.ts | 4 + lib/entities/app-upload.ts | 4 + lib/entities/asset-key.ts | 4 + lib/entities/asset.ts | 4 + lib/entities/bulk-action.ts | 4 + lib/entities/comment.ts | 4 + lib/entities/concept-scheme.ts | 4 + lib/entities/concept.ts | 4 + lib/entities/content-type-fields.ts | 4 + lib/entities/content-type.ts | 4 + lib/entities/editor-interface.ts | 4 + lib/entities/entry.ts | 4 + lib/entities/environment-alias.ts | 4 + .../environment-template-installation.ts | 4 + lib/entities/environment-template.ts | 4 + lib/entities/environment.ts | 4 + lib/entities/extension.ts | 4 + lib/entities/field-type.ts | 4 + lib/entities/function-log.ts | 4 + lib/entities/function.ts | 4 + lib/entities/locale.ts | 4 + lib/entities/oauth-application.ts | 4 + lib/entities/organization-invitation.ts | 4 + lib/entities/organization-membership.ts | 4 + lib/entities/organization.ts | 4 + lib/entities/personal-access-token.ts | 4 + lib/entities/preview-api-key.ts | 4 + lib/entities/release-action.ts | 4 + lib/entities/release.ts | 4 + lib/entities/resource-provider.ts | 4 + lib/entities/resource-type.ts | 4 + lib/entities/resource.ts | 4 + lib/entities/role.ts | 4 + lib/entities/scheduled-action.ts | 4 + lib/entities/snapshot.ts | 4 + lib/entities/space-member.ts | 4 + lib/entities/space-membership.ts | 4 + lib/entities/space.ts | 4 + lib/entities/tag.ts | 4 + lib/entities/task.ts | 4 + lib/entities/team-membership.ts | 4 + lib/entities/team-space-membership.ts | 4 + lib/entities/team.ts | 4 + lib/entities/ui-config.ts | 4 + lib/entities/upload-credential.ts | 4 + lib/entities/upload.ts | 4 + lib/entities/usage.ts | 4 + lib/entities/user-ui-config.ts | 4 + lib/entities/user.ts | 4 + lib/entities/utils.ts | 4 + lib/entities/webhook.ts | 4 + lib/entities/widget-parameters.ts | 4 + lib/entities/workflow-definition.ts | 4 + lib/entities/workflow.ts | 4 + lib/entities/workflows-changelog-entry.ts | 4 + lib/plain/as-iterator.ts | 4 + lib/plain/checks.ts | 16 +++ lib/plain/plain-client-types.ts | 9 +- lib/plain/plain-client.ts | 11 +- lib/plain/wrappers/wrap.ts | 20 ++- typedoc.json | 101 ++++++++++++--- 77 files changed, 532 insertions(+), 158 deletions(-) create mode 100644 lib/create-client.ts diff --git a/lib/common-utils.ts b/lib/common-utils.ts index 0da3ea5f8b..cec3d74d71 100644 --- a/lib/common-utils.ts +++ b/lib/common-utils.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ - import { toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { @@ -17,10 +15,11 @@ export const wrapCollection = (fn: (makeRequest: MakeRequest, entity: T, ...rest: Rest) => R) => (makeRequest: MakeRequest, data: CollectionProp, ...rest: Rest): Collection => { const collectionData = toPlainObject(copy(data)) - // @ts-expect-error - collectionData.items = collectionData.items.map((entity) => fn(makeRequest, entity, ...rest)) - // @ts-expect-error - return collectionData + + return { + ...collectionData, + items: collectionData.items.map((entity) => fn(makeRequest, entity, ...rest)), + } } export const wrapCursorPaginatedCollection = @@ -31,10 +30,10 @@ export const wrapCursorPaginatedCollection = ...rest: Rest ): CursorPaginatedCollection => { const collectionData = toPlainObject(copy(data)) - // @ts-expect-error - collectionData.items = collectionData.items.map((entity) => fn(makeRequest, entity, ...rest)) - // @ts-expect-error - return collectionData + return { + ...collectionData, + items: collectionData.items.map((entity) => fn(makeRequest, entity, ...rest)), + } } export function isSuccessful(statusCode: number) { return statusCode < 300 diff --git a/lib/contentful-management.ts b/lib/contentful-management.ts index 6d29aa2575..d29d3bdd40 100644 --- a/lib/contentful-management.ts +++ b/lib/contentful-management.ts @@ -4,23 +4,12 @@ * @packageDocumentation */ -import type { AdapterParams } from './create-adapter' -import type { ClientAPI } from './create-contentful-api' -import type { DefaultParams } from './plain/plain-client' -import type { MakeRequest, XOR } from './common-types' -import type { PlainClientAPI } from './plain/plain-client-types' -import type { RestAdapterParams } from './adapters/REST/rest-adapter' - -import { createAdapter } from './create-adapter' -import { createPlainClient } from './plain/plain-client' -import { getUserAgentHeader } from 'contentful-sdk-core' -import createContentfulApi from './create-contentful-api' +export type { PlainClientDefaultParams } from './plain/plain-client' export type { ClientAPI } from './create-contentful-api' export type { PlainClientAPI } from './plain/plain-client-types' export type { RestAdapterParams } from './adapters/REST/rest-adapter' export type * from './export-types' -export type PlainClientDefaultParams = DefaultParams export { asIterator } from './plain/as-iterator' export { fetchAll } from './plain/pagination-helper' @@ -29,106 +18,4 @@ export { makeRequest } from './adapters/REST/make-request' export { RestAdapter } from './adapters/REST/rest-adapter' export * as editorInterfaceDefaults from './constants/editor-interface-defaults/index' -interface UserAgentParams { - /** - * Application name and version e.g myApp/version - */ - application?: string - /** - * Integration name and version e.g react/version - */ - integration?: string - - feature?: string -} - -export type ClientOptions = UserAgentParams & XOR - -/** - * Create a plain client instance - * - * @param clientOptions - * @param opts - * - * @example Plain Client - * ```javascript - * const client = contentfulManagement.createClient({ - * accessToken: 'myAccessToken', - * opts: { - * type: 'plain' - * } - * }) - * ``` - * @example Plain Client with defaults - * ```javascript - * const client = contentfulManagement.createClient({ - * accessToken: 'myAccessToken', - * opts: { - * type: 'plain', - * defaults: { - * ... - * } - * } - * }) - * ``` - */ -function createClient( - clientOptions: ClientOptions, - opts: { - type: 'plain' - defaults?: DefaultParams - } -): PlainClientAPI -/** - * Create a legacy, chainable client instance - * @param clientOptions - * - * @example Legacy Chainable Client - * ```javascript - * const client = contentfulManagement.createClient({ - * accessToken: 'myAccessToken' - * }) - * ``` - */ -function createClient(clientOptions: ClientOptions): ClientAPI -/** - * Create a legacy or plain client instance - * - * Please check the responding section below: - * - * * [Plain Client](#createclient) - * * [Legacy Chainable Client](#createclient-1) - */ -function createClient( - clientOptions: ClientOptions, - opts?: { - type?: string - defaults?: DefaultParams - } -): ClientAPI | PlainClientAPI { - const sdkMain = - opts && opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js' - const userAgent = getUserAgentHeader( - // @ts-expect-error - `${sdkMain}/${__VERSION__}`, - clientOptions.application, - clientOptions.integration, - clientOptions.feature - ) - - const adapter = createAdapter({ ...clientOptions, userAgent }) - - // Parameters and ReturnType only return the types of the last overload - // https://github.com/microsoft/TypeScript/issues/26591 - // @ts-expect-error - const makeRequest: MakeRequest = (options: Parameters[0]): ReturnType => - adapter.makeRequest({ ...options, userAgent }) - - if (opts && opts.type === 'plain') { - return createPlainClient(makeRequest, opts.defaults) - } else { - return createContentfulApi(makeRequest) as ClientAPI - } -} - -export { createClient } +export * from './create-client' diff --git a/lib/create-client.ts b/lib/create-client.ts new file mode 100644 index 0000000000..c2c2e20a91 --- /dev/null +++ b/lib/create-client.ts @@ -0,0 +1,119 @@ +/** + * Navigate below to the `createClient` function to get started with using this library. + * @module + * @category Core + */ +import type { AdapterParams } from './create-adapter' +import type { ClientAPI } from './create-contentful-api' +import type { PlainClientDefaultParams } from './plain/plain-client' +import type { MakeRequest, XOR } from './common-types' +import type { PlainClientAPI } from './plain/plain-client-types' +import type { RestAdapterParams } from './adapters/REST/rest-adapter' + +import { createAdapter } from './create-adapter' +import { createPlainClient } from './plain/plain-client' +import { getUserAgentHeader } from 'contentful-sdk-core' +import { createClientApi } from './create-contentful-api' + +interface UserAgentParams { + /** + * Application name and version e.g myApp/version + */ + application?: string + /** + * Integration name and version e.g react/version + */ + integration?: string + + feature?: string +} + +export type ClientOptions = UserAgentParams & XOR + +declare global { + const __VERSION__: string +} + +/** + * Create a plain client instance + * + * @param clientOptions + * @param opts + * + * @example Plain Client + * ```javascript + * const client = contentfulManagement.createClient({ + * accessToken: 'myAccessToken', + * opts: { + * type: 'plain' + * } + * }) + * ``` + * @example Plain Client with defaults + * ```javascript + * const client = contentfulManagement.createClient({ + * accessToken: 'myAccessToken', + * opts: { + * type: 'plain', + * defaults: { + * ... + * } + * } + * }) + * ``` + */ +export function createClient( + clientOptions: ClientOptions, + opts: { + type: 'plain' + defaults?: PlainClientDefaultParams + } +): PlainClientAPI +/** + * Create a legacy, chainable client instance + * @param clientOptions + * + * @example Legacy Chainable Client + * ```javascript + * const client = contentfulManagement.createClient({ + * accessToken: 'myAccessToken' + * }) + * ``` + */ +export function createClient(clientOptions: ClientOptions): ClientAPI +/** + * Create a legacy or plain client instance + * + * Please check the corresponding section below: + * + * * [Plain Client](#createclient) + * * [Legacy Chainable Client](#createclient-1) + */ +export function createClient( + clientOptions: ClientOptions, + opts?: { + type?: string + defaults?: PlainClientDefaultParams + } +): ClientAPI | PlainClientAPI { + const sdkMain = + opts && opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js' + const userAgent = getUserAgentHeader( + `${sdkMain}/${__VERSION__}`, + clientOptions.application, + clientOptions.integration, + clientOptions.feature + ) + + const adapter = createAdapter({ ...clientOptions, userAgent }) + + // @ts-expect-error Parameters and ReturnType only return the types of the last overload (https://github.com/microsoft/TypeScript/issues/26591) + const makeRequest: MakeRequest = (options: Parameters[0]): ReturnType => + adapter.makeRequest({ ...options, userAgent }) + + if (opts && opts.type === 'plain') { + return createPlainClient(makeRequest, opts.defaults) + } else { + return createClientApi(makeRequest) as ClientAPI + } +} diff --git a/lib/create-contentful-api.ts b/lib/create-contentful-api.ts index 05abac2f51..87b0c1c06c 100644 --- a/lib/create-contentful-api.ts +++ b/lib/create-contentful-api.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Legacy Client + */ import { createRequestConfig } from 'contentful-sdk-core' import type { Collection, @@ -52,7 +56,7 @@ type CreateSpaceProps = Omit & { defaultLocale?: string } /** * @private */ -export default function createClientApi(makeRequest: MakeRequest) { +export function createClientApi(makeRequest: MakeRequest) { return { /** * Gets all environment templates for a given organization with the lasted version diff --git a/lib/entities/access-token.ts b/lib/entities/access-token.ts index 15714b2c66..b9f55d7976 100644 --- a/lib/entities/access-token.ts +++ b/lib/entities/access-token.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/api-key.ts b/lib/entities/api-key.ts index 7c7745808e..9c3904c0e8 100644 --- a/lib/entities/api-key.ts +++ b/lib/entities/api-key.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { DefaultElements, MakeRequest, MetaLinkProps, MetaSysProps } from '../common-types' diff --git a/lib/entities/app-access-token.ts b/lib/entities/app-access-token.ts index 72435c5d72..24df9c350d 100644 --- a/lib/entities/app-access-token.ts +++ b/lib/entities/app-access-token.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-action-call.ts b/lib/entities/app-action-call.ts index a5c2df73a1..d4dae2ffad 100644 --- a/lib/entities/app-action-call.ts +++ b/lib/entities/app-action-call.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-action.ts b/lib/entities/app-action.ts index 4606f1f73b..5380992bfe 100644 --- a/lib/entities/app-action.ts +++ b/lib/entities/app-action.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { Except } from 'type-fest' diff --git a/lib/entities/app-bundle.ts b/lib/entities/app-bundle.ts index 62e76a2a62..80046c4ea2 100644 --- a/lib/entities/app-bundle.ts +++ b/lib/entities/app-bundle.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { Except } from 'type-fest' diff --git a/lib/entities/app-definition.ts b/lib/entities/app-definition.ts index c6933d9977..24e24c2b5b 100644 --- a/lib/entities/app-definition.ts +++ b/lib/entities/app-definition.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { diff --git a/lib/entities/app-details.ts b/lib/entities/app-details.ts index 5819b1ceed..17cc2eafc2 100644 --- a/lib/entities/app-details.ts +++ b/lib/entities/app-details.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-event-subscription.ts b/lib/entities/app-event-subscription.ts index 6d5ec7b4ee..cea22c9e67 100644 --- a/lib/entities/app-event-subscription.ts +++ b/lib/entities/app-event-subscription.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-installation.ts b/lib/entities/app-installation.ts index 34ed0df828..e5548fb371 100644 --- a/lib/entities/app-installation.ts +++ b/lib/entities/app-installation.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { toPlainObject, freezeSys } from 'contentful-sdk-core' import copy from 'fast-copy' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/app-key.ts b/lib/entities/app-key.ts index 773248c90c..771d7c32c2 100644 --- a/lib/entities/app-key.ts +++ b/lib/entities/app-key.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-signed-request.ts b/lib/entities/app-signed-request.ts index 9afa925cfc..70f807d1f6 100644 --- a/lib/entities/app-signed-request.ts +++ b/lib/entities/app-signed-request.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-signing-secret.ts b/lib/entities/app-signing-secret.ts index e0ab6bb2b3..aa72571906 100644 --- a/lib/entities/app-signing-secret.ts +++ b/lib/entities/app-signing-secret.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { Except } from 'type-fest' diff --git a/lib/entities/app-upload.ts b/lib/entities/app-upload.ts index 9245ee376c..ca2d36f97d 100644 --- a/lib/entities/app-upload.ts +++ b/lib/entities/app-upload.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { Except } from 'type-fest' diff --git a/lib/entities/asset-key.ts b/lib/entities/asset-key.ts index 6713e5d000..bf15bcecbc 100644 --- a/lib/entities/asset-key.ts +++ b/lib/entities/asset-key.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { toPlainObject } from 'contentful-sdk-core' import type { DefaultElements, MakeRequest } from '../common-types' diff --git a/lib/entities/asset.ts b/lib/entities/asset.ts index 0f8f268b74..b3b95ded78 100644 --- a/lib/entities/asset.ts +++ b/lib/entities/asset.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { Stream } from 'stream' diff --git a/lib/entities/bulk-action.ts b/lib/entities/bulk-action.ts index 4c86037d5f..a948a40dc0 100644 --- a/lib/entities/bulk-action.ts +++ b/lib/entities/bulk-action.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' diff --git a/lib/entities/comment.ts b/lib/entities/comment.ts index 159d6b5ead..ea79c5f679 100644 --- a/lib/entities/comment.ts +++ b/lib/entities/comment.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { Node, Text } from '@contentful/rich-text-types' import copy from 'fast-copy' diff --git a/lib/entities/concept-scheme.ts b/lib/entities/concept-scheme.ts index c2a8cdea5d..3a12771f19 100644 --- a/lib/entities/concept-scheme.ts +++ b/lib/entities/concept-scheme.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { Link } from '../common-types' import type { TaxonomyConceptLink } from './concept' import type { LocalizedEntity } from './utils' diff --git a/lib/entities/concept.ts b/lib/entities/concept.ts index 093e41da1b..e540a5aa5e 100644 --- a/lib/entities/concept.ts +++ b/lib/entities/concept.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { Link } from '../common-types' import type { LocalizedEntity } from './utils' diff --git a/lib/entities/content-type-fields.ts b/lib/entities/content-type-fields.ts index c4c05fae79..6e511cb3dd 100644 --- a/lib/entities/content-type-fields.ts +++ b/lib/entities/content-type-fields.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { KeyValueMap } from '../common-types' import type { INLINES, BLOCKS } from '@contentful/rich-text-types' diff --git a/lib/entities/content-type.ts b/lib/entities/content-type.ts index fb5cd73a41..7b1593ebc2 100644 --- a/lib/entities/content-type.ts +++ b/lib/entities/content-type.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { Except, RequireAtLeastOne, SetOptional } from 'type-fest' diff --git a/lib/entities/editor-interface.ts b/lib/entities/editor-interface.ts index c7d94e9bf2..dfe0d33605 100644 --- a/lib/entities/editor-interface.ts +++ b/lib/entities/editor-interface.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/entry.ts b/lib/entities/entry.ts index 6b0c772872..cc0a1fff00 100644 --- a/lib/entities/entry.ts +++ b/lib/entities/entry.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/environment-alias.ts b/lib/entities/environment-alias.ts index d80aae3e06..dec61202cc 100644 --- a/lib/entities/environment-alias.ts +++ b/lib/entities/environment-alias.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/environment-template-installation.ts b/lib/entities/environment-template-installation.ts index 8d2969716a..bb60caea04 100644 --- a/lib/entities/environment-template-installation.ts +++ b/lib/entities/environment-template-installation.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/environment-template.ts b/lib/entities/environment-template.ts index c203159f33..4fb8f839be 100644 --- a/lib/entities/environment-template.ts +++ b/lib/entities/environment-template.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { BasicMetaSysProps, Link, MakeRequest, DefaultElements } from '../common-types' diff --git a/lib/entities/environment.ts b/lib/entities/environment.ts index 96d89aec6f..c3af2d84ed 100644 --- a/lib/entities/environment.ts +++ b/lib/entities/environment.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/extension.ts b/lib/entities/extension.ts index 7a92a5c0c9..82c34c6dab 100644 --- a/lib/entities/extension.ts +++ b/lib/entities/extension.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/field-type.ts b/lib/entities/field-type.ts index 341bfa3d48..f06f605050 100644 --- a/lib/entities/field-type.ts +++ b/lib/entities/field-type.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ export type FieldType = | { type: 'Symbol' } | { type: 'Text' } diff --git a/lib/entities/function-log.ts b/lib/entities/function-log.ts index 6f8a0b6325..5f8d3f0839 100644 --- a/lib/entities/function-log.ts +++ b/lib/entities/function-log.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { Link, DefaultElements } from '../common-types' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' diff --git a/lib/entities/function.ts b/lib/entities/function.ts index 2e8cc02a44..d171eaf4a3 100644 --- a/lib/entities/function.ts +++ b/lib/entities/function.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { Link, DefaultElements } from '../common-types' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' diff --git a/lib/entities/locale.ts b/lib/entities/locale.ts index 5aa4b630b7..15f6bab77b 100644 --- a/lib/entities/locale.ts +++ b/lib/entities/locale.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { Except, SetOptional } from 'type-fest' diff --git a/lib/entities/oauth-application.ts b/lib/entities/oauth-application.ts index b46b5d30df..f022d027e0 100644 --- a/lib/entities/oauth-application.ts +++ b/lib/entities/oauth-application.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import type { BasicMetaSysProps, DefaultElements, MakeRequest } from '../common-types' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/organization-invitation.ts b/lib/entities/organization-invitation.ts index ff1b604896..5da0ded0d8 100644 --- a/lib/entities/organization-invitation.ts +++ b/lib/entities/organization-invitation.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { DefaultElements, MakeRequest, MetaLinkProps, MetaSysProps } from '../common-types' diff --git a/lib/entities/organization-membership.ts b/lib/entities/organization-membership.ts index 4f8c97422d..9ba4c898d4 100644 --- a/lib/entities/organization-membership.ts +++ b/lib/entities/organization-membership.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/organization.ts b/lib/entities/organization.ts index 2d0558740b..8d595ba4b6 100644 --- a/lib/entities/organization.ts +++ b/lib/entities/organization.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/personal-access-token.ts b/lib/entities/personal-access-token.ts index 5d6105a5c3..57b5334c11 100644 --- a/lib/entities/personal-access-token.ts +++ b/lib/entities/personal-access-token.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/preview-api-key.ts b/lib/entities/preview-api-key.ts index c49f63c5c9..cd1dc4ec3a 100644 --- a/lib/entities/preview-api-key.ts +++ b/lib/entities/preview-api-key.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { DefaultElements, MakeRequest, MetaSysProps } from '../common-types' diff --git a/lib/entities/release-action.ts b/lib/entities/release-action.ts index 440e2a538f..975e63da68 100644 --- a/lib/entities/release-action.ts +++ b/lib/entities/release-action.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' diff --git a/lib/entities/release.ts b/lib/entities/release.ts index 3791a3ecb6..48f01b9050 100644 --- a/lib/entities/release.ts +++ b/lib/entities/release.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' diff --git a/lib/entities/resource-provider.ts b/lib/entities/resource-provider.ts index 1838b7e00f..4c84ef419a 100644 --- a/lib/entities/resource-provider.ts +++ b/lib/entities/resource-provider.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { BasicMetaSysProps, CollectionProp, diff --git a/lib/entities/resource-type.ts b/lib/entities/resource-type.ts index 3aa576e85f..38dbd21bd6 100644 --- a/lib/entities/resource-type.ts +++ b/lib/entities/resource-type.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { BasicMetaSysProps, CursorPaginatedCollectionProp, diff --git a/lib/entities/resource.ts b/lib/entities/resource.ts index eb95ed1ed8..bca412a475 100644 --- a/lib/entities/resource.ts +++ b/lib/entities/resource.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { BasicCursorPaginationOptions, CursorPaginatedCollectionProp, diff --git a/lib/entities/role.ts b/lib/entities/role.ts index fa5dbc897f..6e5f5b282d 100644 --- a/lib/entities/role.ts +++ b/lib/entities/role.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/scheduled-action.ts b/lib/entities/scheduled-action.ts index 0273c4a8cf..b27e9487d6 100644 --- a/lib/entities/scheduled-action.ts +++ b/lib/entities/scheduled-action.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/snapshot.ts b/lib/entities/snapshot.ts index 119f4bbc70..071d997c4e 100644 --- a/lib/entities/snapshot.ts +++ b/lib/entities/snapshot.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/space-member.ts b/lib/entities/space-member.ts index 24ac0ccc13..df541abfa5 100644 --- a/lib/entities/space-member.ts +++ b/lib/entities/space-member.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { DefaultElements, MakeRequest, MetaLinkProps, MetaSysProps } from '../common-types' diff --git a/lib/entities/space-membership.ts b/lib/entities/space-membership.ts index 6d1dc8ae6f..4bf0c9f4dc 100644 --- a/lib/entities/space-membership.ts +++ b/lib/entities/space-membership.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/space.ts b/lib/entities/space.ts index b926ecf9ee..ef4bf37c18 100644 --- a/lib/entities/space.ts +++ b/lib/entities/space.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { BasicMetaSysProps, DefaultElements, MakeRequest } from '../common-types' diff --git a/lib/entities/tag.ts b/lib/entities/tag.ts index 98bc4c88db..819cd049f1 100644 --- a/lib/entities/tag.ts +++ b/lib/entities/tag.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/task.ts b/lib/entities/task.ts index 30ab37f354..ad37cd7eed 100644 --- a/lib/entities/task.ts +++ b/lib/entities/task.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/team-membership.ts b/lib/entities/team-membership.ts index ffd84d19aa..f7f4d66396 100644 --- a/lib/entities/team-membership.ts +++ b/lib/entities/team-membership.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/team-space-membership.ts b/lib/entities/team-space-membership.ts index c61578a164..b1fe9035d7 100644 --- a/lib/entities/team-space-membership.ts +++ b/lib/entities/team-space-membership.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/team.ts b/lib/entities/team.ts index 8fc87e8051..57383003d6 100644 --- a/lib/entities/team.ts +++ b/lib/entities/team.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/ui-config.ts b/lib/entities/ui-config.ts index f7110b6db7..39c980b32c 100644 --- a/lib/entities/ui-config.ts +++ b/lib/entities/ui-config.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types' diff --git a/lib/entities/upload-credential.ts b/lib/entities/upload-credential.ts index 8c11ccfa4f..6201c6ceed 100644 --- a/lib/entities/upload-credential.ts +++ b/lib/entities/upload-credential.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { DefaultElements, MakeRequest, MetaSysProps, SysLink } from '../common-types' diff --git a/lib/entities/upload.ts b/lib/entities/upload.ts index 33015d8284..e0ca33977e 100644 --- a/lib/entities/upload.ts +++ b/lib/entities/upload.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import copy from 'fast-copy' import { freezeSys, toPlainObject } from 'contentful-sdk-core' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/usage.ts b/lib/entities/usage.ts index fd0f7088e0..ff6436f095 100644 --- a/lib/entities/usage.ts +++ b/lib/entities/usage.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/user-ui-config.ts b/lib/entities/user-ui-config.ts index 1d2f72f132..324d7fc399 100644 --- a/lib/entities/user-ui-config.ts +++ b/lib/entities/user-ui-config.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types' diff --git a/lib/entities/user.ts b/lib/entities/user.ts index de88211e95..ce710cb5cb 100644 --- a/lib/entities/user.ts +++ b/lib/entities/user.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import enhanceWithMethods from '../enhance-with-methods' diff --git a/lib/entities/utils.ts b/lib/entities/utils.ts index d1cd11d954..4d7fd66183 100644 --- a/lib/entities/utils.ts +++ b/lib/entities/utils.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ export type LocalizedEntity< Entity, LocalizedFields extends keyof Entity, diff --git a/lib/entities/webhook.ts b/lib/entities/webhook.ts index 3a9433d085..014869f325 100644 --- a/lib/entities/webhook.ts +++ b/lib/entities/webhook.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { Except, JsonValue, SetOptional } from 'type-fest' diff --git a/lib/entities/widget-parameters.ts b/lib/entities/widget-parameters.ts index 1913b57d33..ac92626807 100644 --- a/lib/entities/widget-parameters.ts +++ b/lib/entities/widget-parameters.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ export type ParameterType = 'Boolean' | 'Symbol' | 'Number' | 'Enum' export type InstallationParameterType = ParameterType | 'Secret' export type ParameterOption = string | { [key: string]: string } diff --git a/lib/entities/workflow-definition.ts b/lib/entities/workflow-definition.ts index 49d5a04c57..935a33fe8f 100644 --- a/lib/entities/workflow-definition.ts +++ b/lib/entities/workflow-definition.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/workflow.ts b/lib/entities/workflow.ts index 186b8fe066..901a25280a 100644 --- a/lib/entities/workflow.ts +++ b/lib/entities/workflow.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/entities/workflows-changelog-entry.ts b/lib/entities/workflows-changelog-entry.ts index d524a9d413..71db753948 100644 --- a/lib/entities/workflows-changelog-entry.ts +++ b/lib/entities/workflows-changelog-entry.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import { freezeSys, toPlainObject } from 'contentful-sdk-core' import copy from 'fast-copy' import type { diff --git a/lib/plain/as-iterator.ts b/lib/plain/as-iterator.ts index f2583d2d92..4db6087e38 100644 --- a/lib/plain/as-iterator.ts +++ b/lib/plain/as-iterator.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Plain Client + */ import copy from 'fast-copy' import type { CollectionProp, QueryParams } from '../common-types' diff --git a/lib/plain/checks.ts b/lib/plain/checks.ts index 1611578618..7245f1af8c 100644 --- a/lib/plain/checks.ts +++ b/lib/plain/checks.ts @@ -1,13 +1,29 @@ +/** + * @module + * @category Plain Client + */ import type { MetaSysProps } from '../common-types' +/** + * Returns true when an entity is published + */ export const isPublished = (data: { sys: MetaSysProps }) => !!data.sys.publishedVersion +/** + * Returns true when an entity has unpublished changes + */ export const isUpdated = (data: { sys: MetaSysProps }) => { // The act of publishing an entity increases its version by 1, so any entry which has // 2 versions higher or more than the publishedVersion has unpublished changes. return !!(data.sys.publishedVersion && data.sys.version > data.sys.publishedVersion + 1) } +/** + * Returns true when an entity has no published version + */ export const isDraft = (data: { sys: MetaSysProps }) => !data.sys.publishedVersion +/** + * Returns true when an entity is archived (and unpublished) + */ export const isArchived = (data: { sys: MetaSysProps }) => !!data.sys.archivedVersion diff --git a/lib/plain/plain-client-types.ts b/lib/plain/plain-client-types.ts index 05680cb4c8..bfdee12b38 100644 --- a/lib/plain/plain-client-types.ts +++ b/lib/plain/plain-client-types.ts @@ -1,3 +1,8 @@ +/** + * @module + * @category Plain Client + */ + import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios' import type { OpPatch } from 'json-patch' import type { @@ -115,7 +120,7 @@ import type { WebhookPlainClientAPI } from './entities/webhook' import type { WorkflowPlainClientAPI } from './entities/workflow' import type { WorkflowDefinitionPlainClientAPI } from './entities/workflow-definition' import type { WorkflowsChangelogPlainClientAPI } from './entities/workflows-changelog' -import type { DefaultParams, OptionalDefaults } from './wrappers/wrap' +import type { PlainClientDefaultParams, OptionalDefaults } from './wrappers/wrap' import type { OAuthApplicationPlainClientAPI } from './entities/oauth-application' import type { FunctionLogPlainClientAPI } from './entities/function-log' import type { AiActionPlainClientAPI } from './entities/ai-action' @@ -123,7 +128,7 @@ import type { AiActionInvocationPlainClientAPI } from './entities/ai-action-invo export type PlainClientAPI = { raw: { - getDefaultParams(): DefaultParams | undefined + getDefaultParams(): PlainClientDefaultParams | undefined get(url: string, config?: RawAxiosRequestConfig): Promise post(url: string, payload?: any, config?: RawAxiosRequestConfig): Promise patch(url: string, payload?: any, config?: RawAxiosRequestConfig): Promise diff --git a/lib/plain/plain-client.ts b/lib/plain/plain-client.ts index 02cc17cc9e..41ae12ff09 100644 --- a/lib/plain/plain-client.ts +++ b/lib/plain/plain-client.ts @@ -1,17 +1,22 @@ +/** + * @module + * @category Plain Client + */ + import type { GetContentTypeParams, GetSpaceEnvironmentParams, MakeRequest } from '../common-types' import { omitAndDeleteField } from '../methods/content-type' import type { PlainClientAPI } from './plain-client-types' -import type { DefaultParams } from './wrappers/wrap' +import type { PlainClientDefaultParams } from './wrappers/wrap' import { wrap } from './wrappers/wrap' -export type { DefaultParams } from './wrappers/wrap' +export type { PlainClientDefaultParams } from './wrappers/wrap' /** * @private */ export const createPlainClient = ( makeRequest: MakeRequest, - defaults: DefaultParams | undefined + defaults: PlainClientDefaultParams | undefined ): PlainClientAPI => { const wrapParams = { makeRequest, defaults } diff --git a/lib/plain/wrappers/wrap.ts b/lib/plain/wrappers/wrap.ts index d979b38cbb..97057fef65 100644 --- a/lib/plain/wrappers/wrap.ts +++ b/lib/plain/wrappers/wrap.ts @@ -1,6 +1,6 @@ import type { MakeRequest, MRActions, MRReturn } from '../../common-types' -export type DefaultParams = { +export type PlainClientDefaultParams = { spaceId?: string environmentId?: string organizationId?: string @@ -13,15 +13,15 @@ type UnionOmit = T extends unknown ? Omit : neve /** * @private */ -export type OptionalDefaults = UnionOmit & - Partial>> +export type OptionalDefaults = UnionOmit & + Partial>> /** * @private */ export type WrapParams = { makeRequest: MakeRequest - defaults?: DefaultParams + defaults?: PlainClientDefaultParams } /** @@ -66,21 +66,15 @@ export const wrap = => - // @ts-expect-error + // @ts-expect-error see above makeRequest({ - // @ts-expect-error entityType, - // @ts-expect-error action, - // @ts-expect-error params: { ...defaults, ...params }, payload, // Required after adding optional headers to a delete method for the first time - // @ts-expect-error headers, - }) + } as unknown) } diff --git a/typedoc.json b/typedoc.json index 200dd2105e..a867b397e7 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,23 +1,91 @@ { "name": "contentful-management.js", "entryPoints": [ - "lib/contentful-management.ts", - // "lib/plain/plain-client.ts", + "lib/create-contentful-api.ts", + "lib/create-client.ts", + "lib/plain/plain-client.ts", + "lib/plain/plain-client-types.ts", + "lib/plain/checks.ts", // "lib/plain/wrappers/wrap.ts", // "lib/contentful-management.ts", // "lib/create-adapter.ts", - // "lib/create-contentful-api.ts", // "lib/entities/app-action.ts", - // "lib/entities/environment-template-installation.ts" + // "lib/entities/environment-template-installation.ts", + "lib/contentful-management.ts", + "lib/entities/access-token.ts", + "lib/entities/api-key.ts", + "lib/entities/app-access-token.ts", + "lib/entities/app-action-call.ts", + "lib/entities/app-action.ts", + "lib/entities/app-bundle.ts", + "lib/entities/app-definition.ts", + "lib/entities/app-details.ts", + "lib/entities/app-event-subscription.ts", + "lib/entities/app-installation.ts", + "lib/entities/app-key.ts", + "lib/entities/app-signed-request.ts", + "lib/entities/app-signing-secret.ts", + "lib/entities/app-upload.ts", + "lib/entities/asset-key.ts", + "lib/entities/asset.ts", + "lib/entities/bulk-action.ts", + "lib/entities/comment.ts", + "lib/entities/concept-scheme.ts", + "lib/entities/concept.ts", + "lib/entities/content-type-fields.ts", + "lib/entities/content-type.ts", + "lib/entities/editor-interface.ts", + "lib/entities/entry.ts", + "lib/entities/environment-alias.ts", + "lib/entities/environment-template-installation.ts", + "lib/entities/environment-template.ts", + "lib/entities/environment.ts", + "lib/entities/extension.ts", + "lib/entities/field-type.ts", + "lib/entities/function-log.ts", + "lib/entities/function.ts", + "lib/entities/locale.ts", + "lib/entities/oauth-application.ts", + "lib/entities/organization-invitation.ts", + "lib/entities/organization-membership.ts", + "lib/entities/organization.ts", + "lib/entities/personal-access-token.ts", + "lib/entities/preview-api-key.ts", + "lib/entities/release-action.ts", + "lib/entities/release.ts", + "lib/entities/resource-provider.ts", + "lib/entities/resource-type.ts", + "lib/entities/resource.ts", + "lib/entities/role.ts", + "lib/entities/scheduled-action.ts", + "lib/entities/snapshot.ts", + "lib/entities/space-member.ts", + "lib/entities/space-membership.ts", + "lib/entities/space.ts", + "lib/entities/tag.ts", + "lib/entities/task.ts", + "lib/entities/team-membership.ts", + "lib/entities/team-space-membership.ts", + "lib/entities/team.ts", + "lib/entities/ui-config.ts", + "lib/entities/upload-credential.ts", + "lib/entities/upload.ts", + "lib/entities/usage.ts", + "lib/entities/user-ui-config.ts", + "lib/entities/user.ts", + "lib/entities/utils.ts", + "lib/entities/webhook.ts", + "lib/entities/widget-parameters.ts", + "lib/entities/workflow-definition.ts", + "lib/entities/workflow.ts", + "lib/entities/workflows-changelog-entry.ts" ], "out": "out", "includeVersion": true, - // "categorizeByGroup": true, - // "categoryOrder": ["Core", "Clients", "Entities", "Utilities", "*"], - "categoryOrder": ["createClient", "ClientParams", "ContentType", "Entry", "*"], - // "groupOrder": ["Variables", "Functions", "*"], + "categorizeByGroup": false, + "categoryOrder": ["Core", "Plain Client", "Legacy Client", "Entities", "*"], + "defaultCategory": "Other", "kindSortOrder": [ - "Reference", "Project", "Module", "Namespace", @@ -30,6 +98,7 @@ "Interface", "TypeAlias", "Variable", + "Reference", "Accessor", "Method", "Parameter", @@ -41,6 +110,7 @@ "GetSignature", "SetSignature" ], + "groupOrder": ["Functions", "Interfaces", "Modules", "*"], "sortEntryPoints": false, "readme": "README.md", "excludePrivate": false, @@ -48,9 +118,12 @@ "excludeProtected": false, "treatWarningsAsErrors": false, "sort": ["source-order"], - "plugin": [ - "typedoc-plugin-missing-exports", - "typedoc-github-theme" - ], + "plugin": ["typedoc-plugin-missing-exports", "typedoc-github-theme"], "hideGenerator": true, -} \ No newline at end of file + "includeHierarchySummary": true, + "navigation": { + "includeGroups": false, + "includeCategories": true, + "includeFolders": false + } +} From c7c3d93f297de739317646365d8239207cafacc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 10:01:21 +0200 Subject: [PATCH 16/21] fix: move type-fest to a regular dependency --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 75f5b09075..3be841acba 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "axios": "^1.8.4", "contentful-sdk-core": "^9.0.1", "fast-copy": "^3.0.0", - "globals": "^15.15.0" + "globals": "^15.15.0", + "type-fest": "^4.18.3" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -111,7 +112,6 @@ "rimraf": "^5.0.0", "semantic-release": "^22.0.12", "size-limit": "^11.1.6", - "type-fest": "^4.18.3", "typedoc": "^0.27.9", "typedoc-github-theme": "^0.2.1", "typedoc-plugin-missing-exports": "^3.1.0", From ffe8500c9684b103d10fb408112918ce176f2724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 12:27:08 +0200 Subject: [PATCH 17/21] docs: set link to changelog to github releases page --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- SETUP.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ef7f248a5..770acb62f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Readme · Setup · Migration · - Changelog · + Changelog · Contributing

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e07a6e2add..9184c69483 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Readme · Setup · Migration · - Changelog · + Changelog · Contributing

diff --git a/README.md b/README.md index 40336452c3..13d3e61f44 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

Readme · Setup · - Changelog · + Changelog · Contributing

diff --git a/SETUP.md b/SETUP.md index 16a0da6e7c..e830b98c0b 100644 --- a/SETUP.md +++ b/SETUP.md @@ -14,7 +14,7 @@ Readme · Setup · Migration · - Changelog · + Changelog · Contributing

From 81f6f670821c9f535248b04abdf71589ed5f90e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 12:30:12 +0200 Subject: [PATCH 18/21] docs: prever ESM syntax over CommonJS --- README.md | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 13d3e61f44..1fa6a6f334 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ - [Browser:](#browser) - [Typings](#typings) - [Authentication](#authentication) - - [Using ES6 import](#using-es6-import) + - [Importing the library](#importing-the-library) - [Using the Plain Client](#using-the-plain-client) - [With scoped space and environment](#with-scoped-space-and-environment) - [Using the Legacy Client](#using-the-legacy-client) @@ -99,7 +99,7 @@ To get started with the Contentful Management JS library you'll need to install - [Installation](#installation) - [Authentication](#authentication) -- [Using ES6 import](#using-es6-import) +- [Importing the library](#importing-the-library) - [Your first request](#your-first-request) - [Troubleshooting](#troubleshooting) - [Documentation/References](#documentationreferences) @@ -155,21 +155,16 @@ If you want to use this library for a simple tool or a local app that you won't If you'd like to create an app which would make use of this library but that would be available for other users, where they could authenticate with their own Contentful credentials, make sure to also check out the section about [Creating an OAuth Application](https://www.contentful.com/developers/docs/references/authentication/#creating-an-oauth-20-application) -## Using ES6 import +## Importing the library -You can import the library using ES6 syntax as follows: +You can import the library using either modern ES6 modules or CommonJS syntax: ```js -// import createClient directly +// Using ES6 modules import contentful from 'contentful-management' -const client = contentful.createClient( - { - // This is the access token for this space. Normally you get the token in the Contentful web app - accessToken: 'YOUR_ACCESS_TOKEN', - }, - { type: 'plain' } -) -//.... + +// Using CommonJS +const contentful = require('contentful-management') ``` ## Using the Plain Client @@ -177,7 +172,7 @@ const client = contentful.createClient( Beginning with `contentful-management@7` this library provides a client which exposes all CMA endpoints in a simple flat API surface, as opposed to the waterfall structure exposed by legacy versions of the SDK. ```javascript -const contentful = require('contentful-management') +import contentful from 'contentful-management' const plainClient = contentful.createClient( { accessToken: 'YOUR_ACCESS_TOKEN', @@ -240,7 +235,7 @@ The benefits of using the "plain" version of the client, over the legacy version The following code snippet is an example of the legacy client interface, which reads and writes data as a sequence of nested requests: ```js -const contentful = require('contentful-management') +import contentful from 'contentful-management' const client = contentful.createClient({ accessToken: 'YOUR_ACCESS_TOKEN', }) @@ -275,10 +270,10 @@ grants your apps access to the supported space-environment scoped entities witho need to expose a management token, and without coding any additional backend middleware. ```javascript -const contentfulApp = require('@contentful/app-sdk') -const contentful = require('contentful-management') +import { init as initContentfulApp } from '@contentful/app-sdk' +import contentful from 'contentful-management' -contentfulApp.init((sdk) => { +initContentfulApp((sdk) => { const cma = contentful.createClient( { apiAdapter: sdk.cmaAdapter }, { From 7abf4baec700e7010b472e61d108450fa03e6920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 12:30:25 +0200 Subject: [PATCH 19/21] docs: remove broken link to runkit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1fa6a6f334..2dfc5ca3e5 100644 --- a/README.md +++ b/README.md @@ -220,8 +220,6 @@ const entries = await scopedPlainClient.entry.getMany({ }) ``` -You can try and change the above example on [Runkit](https://npm.runkit.com/contentful-management). - The benefits of using the "plain" version of the client, over the legacy version, are: - The ability to reach any possible CMA endpoint without the necessity to call any async functions beforehand. From 9727036b7c4ec290da06682b7930f8d35341186e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 12:30:54 +0200 Subject: [PATCH 20/21] docs: remove unnesessary mention of version 1.0.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dfc5ca3e5..3c42feafd6 100644 --- a/README.md +++ b/README.md @@ -328,7 +328,7 @@ It’s your go-to resource for: The [Contentful JS SDK TypeDoc reference](https://contentful.github.io/contentful-management.js) documents all exported objects, types, functions, and instance methods. -> From version `1.0.0` onward, access version-specific docs at +> You can access version-specific docs at > `https://contentful.github.io/contentful-management.js/contentful-management/` --- From 3621ffa6cc7e1201c4b91c6bff547da2da46df17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 29 Apr 2025 12:31:36 +0200 Subject: [PATCH 21/21] docs: remove unnesessary colons in node and browser headline --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c42feafd6..d1fd25593a 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ - [Getting started](#getting-started) - [Installation](#installation) - - [Node:](#node) - - [Browser:](#browser) + - [Node](#node) + - [Browser](#browser) - [Typings](#typings) - [Authentication](#authentication) - [Importing the library](#importing-the-library) @@ -106,7 +106,7 @@ To get started with the Contentful Management JS library you'll need to install ## Installation -### Node: +### Node Using [npm](http://npmjs.org): @@ -120,7 +120,7 @@ Using [yarn](https://yarnpkg.com/lang/en/): yarn add contentful-management ``` -### Browser: +### Browser For browsers, we recommend to download the library via npm or yarn to ensure 100% availability.