diff --git a/README.md b/README.md index 08fb34c31..bf509471f 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ const client = 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' } + { type: 'plain' }, ) //.... ``` @@ -173,13 +173,13 @@ You can use the commonjs require with the library as follows ```js // import createClient directly -const contentful = require('contentful-management'); +const contentful = require('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' } + { type: 'plain' }, ) //.... ``` @@ -194,7 +194,7 @@ const plainClient = createClient( { accessToken: 'YOUR_ACCESS_TOKEN', }, - { type: 'plain' } + { type: 'plain' }, ) const environment = await plainClient.environment.get({ @@ -222,7 +222,7 @@ const scopedPlainClient = createClient( spaceId: '', environmentId: '', }, - } + }, ) // entries from '' & '' @@ -233,8 +233,8 @@ const entries = await scopedPlainClient.entry.getMany({ }, }) ``` - -You can try and change the above example on [Runkit](https://npm.runkit.com/contentful-management). + +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: @@ -296,7 +296,7 @@ contentfulApp.init((sdk) => { environmentId: sdk.ids.environmentAlias ?? sdk.ids.environment, spaceId: sdk.ids.space, }, - } + }, ) // ...rest of initialization code diff --git a/lib/adapters/REST/endpoints/access-token.ts b/lib/adapters/REST/endpoints/access-token.ts index 57b1abc66..3f7e478f7 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 7b65b1c17..473a5b7bc 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 892041ef8..59459e5ed 100644 --- a/lib/create-app-definition-api.ts +++ b/lib/create-app-definition-api.ts @@ -23,8 +23,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -54,8 +55,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -81,8 +83,9 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets an app bundle * @param id - AppBundle ID - * @return Promise for an AppBundle - * @example ```javascript + * @returns Promise for an AppBundle + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -110,8 +113,9 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { /** * Gets a collection of AppBundles - * @return Promise for a collection of AppBundles - * @example ```javascript + * @returns Promise for a collection of AppBundles + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -136,8 +140,9 @@ 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 + * @returns Promise for the newly created AppBundle + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -165,8 +170,9 @@ 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 + * @returns Promise for the newly created AppBundle + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -194,8 +200,9 @@ 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 + * @returns Promise for the newly created or updated ResourceProvider + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -235,8 +242,9 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) { }, /** * Gets a Resource Provider - * @return Promise for a Resource Provider - * @example ```javascript + * @returns Promise for a Resource Provider + * @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 bd71bc630..081c8ecc8 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, @@ -57,7 +61,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') * @@ -82,10 +86,11 @@ 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 - * @return Promise for a EnvironmentTemplate + * @returns Promise for a EnvironmentTemplate * ```javascript * const contentful = require('contentful-management') * @@ -96,7 +101,7 @@ export default function createClientApi(makeRequest: MakeRequest) { * client.getEnvironmentTemplate({ * organizationId: '', * environmentTemplateId: '', - * version: version> + * version: * }) * .then((space) => console.log(space)) * .catch(console.error) @@ -126,8 +131,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created EnvironmentTemplate + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -152,7 +158,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') * @@ -178,7 +184,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') * @@ -203,8 +209,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Space + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -233,8 +240,9 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets an organization * @param id - Organization ID - * @return Promise for a Organization - * @example ```javascript + * @returns Promise for a Organization + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -256,8 +264,9 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a collection of Organizations - * @return Promise for a collection of Organizations - * @example ```javascript + * @returns Promise for a collection of Organizations + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -281,8 +290,9 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets the authenticated user - * @return Promise for a User - * @example ```javascript + * @returns Promise for a User + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -306,7 +316,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({ @@ -334,7 +345,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({ @@ -360,7 +372,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({ @@ -390,10 +403,9 @@ 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 + * @returns Promise for App Definition + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -419,8 +431,9 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Creates a personal access token * @param data - personal access token config - * @return Promise for a Token - * @example ```javascript + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -458,9 +471,10 @@ export default function createClientApi(makeRequest: MakeRequest) { * @deprecated - use getAccessToken instead * * Gets a personal access token - * @param data - personal access token config - * @return Promise for a Token - * @example ```javascript + * @param tokenId - personal access token config + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -484,8 +498,9 @@ export default function createClientApi(makeRequest: MakeRequest) { * @deprecated - use getAccessTokens instead * * Gets all personal access tokens - * @return Promise for a Token - * @example ```javascript + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -507,9 +522,10 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets a users access token - * @param data - users access token config - * @return Promise for a Token - * @example ```javascript + * @param tokenId - users access token config + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -531,8 +547,9 @@ export default function createClientApi(makeRequest: MakeRequest) { /** * Gets all user access tokens - * @return Promise for a Token - * @example ```javascript + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -555,8 +572,9 @@ 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 + * @returns Promise for a Token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -584,8 +602,9 @@ 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 + * @returns Promise of a collection of usages + * @example + * ```javascript * * const contentful = require('contentful-management') * @@ -619,7 +638,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') * @@ -653,7 +672,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 f11dbf9f3..8bbc0c7bc 100644 --- a/lib/create-entry-api.ts +++ b/lib/create-entry-api.ts @@ -35,8 +35,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -67,8 +68,9 @@ 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 + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -105,8 +107,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -129,8 +132,9 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Publishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -158,8 +162,9 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unpublishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -187,8 +192,9 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Archives the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -215,8 +221,9 @@ export default function createEntryApi(makeRequest: MakeRequest) { /** * Unarchives the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -243,7 +250,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({ @@ -271,7 +279,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({ @@ -300,7 +309,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({ @@ -391,7 +401,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 4739b8b98..7baa7557e 100644 --- a/lib/create-environment-api.ts +++ b/lib/create-environment-api.ts @@ -85,15 +85,16 @@ 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) { return { /** * Deletes the environment - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -119,8 +120,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Updates the environment - * @return Promise for the updated environment. - * @example ```javascript + * @returns Promise for the updated environment. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -151,8 +153,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates SDK Entry object (locally) from entry data * @param entryData - Entry Data - * @return Entry - * @example ```javascript + * @returns Entry + * @example + * ```javascript * environment.getEntry('entryId').then(entry => { * * // Build a plainObject in order to make it usable for React (saving in state or redux) @@ -184,8 +187,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Creates SDK Asset object (locally) from entry data * @param assetData - Asset ID - * @return Asset - * @example ```javascript + * @returns Asset + * @example + * ```javascript * environment.getAsset('asset_id').then(asset => { * * // Build a plainObject in order to make it usable for React (saving in state or redux) @@ -222,7 +226,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({ @@ -430,8 +435,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a Content Type * @param contentTypeId - Content Type ID - * @return Promise for a Content Type - * @example ```javascript + * @returns Promise for a Content Type + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -462,8 +468,9 @@ 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 + * @returns Promise for a collection of Content Types + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -492,8 +499,9 @@ 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 + * @returns Promise for the newly created Content Type + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -535,8 +543,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Content Type + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -579,8 +588,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an EditorInterface for a ContentType * @param contentTypeId - Content Type ID - * @return Promise for an EditorInterface - * @example ```javascript + * @returns Promise for an EditorInterface + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -609,8 +619,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets all EditorInterfaces - * @return Promise for a collection of EditorInterface - * @example ```javascript + * @returns Promise for a collection of EditorInterface + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -642,8 +653,9 @@ 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 - * @example ```javascript + * @returns Promise for an Entry + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -674,8 +686,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -709,8 +722,9 @@ 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 - * @example ```javascript + * @returns Promise for a collection of Entries + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -740,8 +754,9 @@ 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 + * @returns Promise for a collection of published Entries + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -772,8 +787,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Entry + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -812,8 +828,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Entry + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -854,7 +871,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({ @@ -891,8 +909,9 @@ 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 - * @example ```javascript + * @returns Promise for an Asset + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -925,8 +944,9 @@ 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 - * @example ```javascript + * @returns Promise for a collection of Assets + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -955,8 +975,9 @@ 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 + * @returns Promise for a collection of published Assets + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -985,8 +1006,9 @@ 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 + * @returns Promise for the newly created Asset + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1029,8 +1051,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Asset + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1072,8 +1095,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Asset + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1117,8 +1141,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created AssetKey + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1149,8 +1174,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an Upload * @param id - Upload ID - * @return Promise for an Upload - * @example ```javascript + * @returns Promise for an Upload + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1179,8 +1205,9 @@ 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. - * @example ```javascript + * @returns Upload object containing information about the uploaded file. + * @example + * ```javascript * const client = contentful.createClient({ * accessToken: '' * }) @@ -1208,8 +1235,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a Locale * @param localeId - Locale ID - * @return Promise for an Locale - * @example ```javascript + * @returns Promise for an Locale + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1238,8 +1266,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets a collection of Locales - * @return Promise for a collection of Locales - * @example ```javascript + * @returns Promise for a collection of Locales + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1268,8 +1297,9 @@ 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 + * @returns Promise for the newly created Locale + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1304,8 +1334,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an UI Extension * @param id - Extension ID - * @return Promise for an UI Extension - * @example ```javascript + * @returns Promise for an UI Extension + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1333,8 +1364,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Gets a collection of UI Extension - * @return Promise for a collection of UI Extensions - * @example ```javascript + * @returns Promise for a collection of UI Extensions + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1362,8 +1394,9 @@ 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 + * @returns Promise for the newly created UI Extension + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1407,8 +1440,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created UI Extension + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1455,8 +1489,9 @@ 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 - * @example ```javascript + * @returns Promise for an App Installation + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1495,8 +1530,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { /** * Gets an App Installation * @param id - AppDefintion ID - * @return Promise for an App Installation - * @example ```javascript + * @returns Promise for an App Installation + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1524,8 +1560,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { }, /** * Gets a collection of App Installation - * @return Promise for a collection of App Installations - * @example ```javascript + * @returns Promise for a collection of App Installations + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1555,8 +1592,9 @@ 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 - * @example ```javascript + * @returns Promise for an App Action Call + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1641,8 +1679,9 @@ 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 - * @example ```javascript + * @returns Promise for a Signed Request + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1682,8 +1721,9 @@ 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 - * @example ```javascript + * @returns Promise for an app access token + * @example + * ```javascript * const contentful = require('contentful-management') * const { sign } = require('jsonwebtoken') * @@ -1721,8 +1761,9 @@ 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 - * @example ```javascript + * @returns Promise containing wrapped collection of Functions in an environment + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1755,8 +1796,9 @@ 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 - * * @example ```javascript + * @returns Promise containing wrapped collection of FunctionLogs + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1811,8 +1853,9 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) { * @param appInstallationId * @param functionId * @param logId - * @return Promise containing a wrapped FunctionLog - * @example ```javascript + * @returns Promise containing a wrapped FunctionLog + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1853,8 +1896,9 @@ 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 - * @example ```javascript + * @returns Promise for a collection of Entry Snapshots + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1886,8 +1930,9 @@ 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 - * @example ```javascript + * @returns Promise for a collection of Content Type Snapshots + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1964,7 +2009,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({ @@ -1996,7 +2042,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({ @@ -2028,7 +2075,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({ @@ -2074,7 +2122,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({ @@ -2128,7 +2177,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({ @@ -2161,7 +2211,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({ @@ -2195,7 +2246,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({ @@ -2230,7 +2282,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({ @@ -2270,7 +2323,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({ @@ -2304,7 +2358,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({ @@ -2337,7 +2392,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({ @@ -2372,7 +2428,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({ @@ -2432,7 +2489,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') * @@ -2469,7 +2526,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') * @@ -2502,7 +2559,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 cfa97f4d0..2b8ab55ee 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,8 +86,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -110,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') * @@ -186,7 +187,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') * @@ -238,7 +239,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') * @@ -283,7 +284,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 2b51b924a..9b331e808 100644 --- a/lib/create-organization-api.ts +++ b/lib/create-organization-api.ts @@ -49,7 +49,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) { @@ -57,8 +57,9 @@ 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 + * @returns Promise a collection of Spaces in the organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -84,8 +85,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets a User - * @return Promise for a User - * @example ```javascript + * @returns Promise for a User + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -108,8 +110,9 @@ 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 + * @returns Promise a collection of Users in organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -135,8 +138,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an Organization Membership * @param id - Organization Membership ID - * @return Promise for an Organization Membership - * @example ```javascript + * @returns Promise for an Organization Membership + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -163,8 +167,9 @@ 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 + * @returns Promise for a collection of Organization Memberships + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -191,7 +196,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: '' @@ -218,7 +224,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Team - * @example ```javascript + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -241,7 +248,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,8 +277,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created TeamMembership + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -297,8 +306,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Team Membership from the team with given teamId - * @return Promise for an Team Membership - * @example ```javascript + * @returns Promise for an Team Membership + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -321,8 +331,9 @@ 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 + * @returns Promise for a Team Membership Collection + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -362,8 +373,9 @@ 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 + * @returns Promise for a Team Space Membership Collection + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -390,8 +402,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Get a Team Space Membership with given teamSpaceMembershipId - * @return Promise for a Team Space Membership - * @example ```javascript + * @returns Promise for a Team Space Membership + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -418,8 +431,9 @@ 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 + * @returns Promise for a Space Membership in an organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -445,8 +459,9 @@ 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 + * @returns Promise for a Space Membership collection across all spaces in the organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -471,8 +486,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an Invitation in Organization - * @return Promise for a OrganizationInvitation in an organization - * @example ```javascript + * @returns Promise for a OrganizationInvitation in an organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -497,8 +513,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Create an Invitation in Organization - * @return Promise for a OrganizationInvitation in an organization - * @example ```javascript + * @returns Promise for a OrganizationInvitation in an organization + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -527,8 +544,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Roles - * @return Promise for a collection of Roles - * @example ```javascript + * @returns Promise for a collection of Roles + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -552,8 +570,9 @@ 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 + * @returns Promise for the newly created AppDefinition + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -580,8 +599,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets all app definitions - * @return Promise for a collection of App Definitions - * @example ```javascript + * @returns Promise for a collection of App Definitions + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -604,8 +624,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app definition - * @return Promise for an App Definition - * @example ```javascript + * @returns Promise for an App Definition + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -628,8 +649,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Gets an app upload - * @return Promise for an App Upload - * @example ```javascript + * @returns Promise for an App Upload + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -653,8 +675,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { /** * Creates an app upload - * @return Promise for an App Upload - * @example ```javascript + * @returns Promise for an App Upload + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -678,8 +701,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app signing secret - * @return Promise for an App SigningSecret - * @example ```javascript + * @returns Promise for an App SigningSecret + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -703,8 +727,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app signing secret - * @return Promise for an App SigningSecret - * @example ```javascript + * @returns Promise for an App SigningSecret + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -727,8 +752,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -753,8 +779,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app event subscription - * @return Promise for an App Event Subscription - * @example ```javascript + * @returns Promise for an App Event Subscription + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -778,8 +805,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app event subscription - * @return Promise for an App Event Subscription - * @example ```javascript + * @returns Promise for an App Event Subscription + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -802,8 +830,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -828,8 +857,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app event subscription - * @return Promise for an App Event Subscription - * @example ```javascript + * @returns Promise for an App Event Subscription + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -860,8 +890,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app key by fingerprint - * @return Promise for an App Key - * @example ```javascript + * @returns Promise for an App Key + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -884,8 +915,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets all keys for the given app - * @return Promise for an array of App Keys - * @example ```javascript + * @returns Promise for an array of App Keys + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -919,8 +951,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -945,8 +978,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates or updates an app details entity - * @return Promise for an App Details - * @example ```javascript + * @returns Promise for an App Details + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -972,8 +1006,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an app details entity - * @return Promise for an App Details - * @example ```javascript + * @returns Promise for an App Details + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -996,8 +1031,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1022,8 +1058,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Creates an app action entity. - * @return Promise that resolves an App Action entity - * @example ```javascript + * @returns Promise that resolves an App Action entity + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1051,8 +1088,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Updates an existing app action entity. - * @return Promise that resolves an App Action entity - * @example ```javascript + * @returns Promise that resolves an App Action entity + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1080,8 +1118,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1106,8 +1145,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets an existing app action entity. - * @return Promise that resolves an App Action entity - * @example ```javascript + * @returns Promise that resolves an App Action entity + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1130,8 +1170,9 @@ export default function createOrganizationApi(makeRequest: MakeRequest) { }, /** * Gets existing app actions for an App Definition. - * @return Promise that resolves an App Action entity - * @example ```javascript + * @returns Promise that resolves an App Action entity + * @example + * ```javascript * const contentful = require('contentful-management') * const client = contentful.createClient({ * accessToken: '' @@ -1157,7 +1198,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: '' @@ -1180,7 +1222,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 5040d0a53..593b2dd49 100644 --- a/lib/create-space-api.ts +++ b/lib/create-space-api.ts @@ -46,15 +46,16 @@ 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) { return { /** * Deletes the space - * @return Promise for the deletion. It contains no data, but the Promise error case should be handled. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -77,8 +78,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Updates the space - * @return Promise for the updated space. - * @example ```javascript + * @returns Promise for the updated space. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -107,8 +109,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets an environment * @param id - Environment ID - * @return Promise for an Environment - * @example ```javascript + * @returns Promise for an Environment + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -133,8 +136,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Environments - * @return Promise for a collection of Environment - * @example ```javascript + * @returns Promise for a collection of Environment + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -159,8 +163,9 @@ 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 + * @returns Promise for the newly created Environment + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -190,8 +195,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Environment + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -225,8 +231,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Webhook * @param id - Webhook ID - * @return Promise for a Webhook - * @example ```javascript + * @returns Promise for a Webhook + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -250,8 +257,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Webhooks - * @return Promise for a collection of Webhooks - * @example ```javascript + * @returns Promise for a collection of Webhooks + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -276,7 +284,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({ @@ -301,7 +310,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({ @@ -326,8 +336,9 @@ 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 + * @returns Promise for the newly created Webhook + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -359,8 +370,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Webhook + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -392,7 +404,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') * @@ -421,7 +434,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({ @@ -449,7 +463,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({ @@ -473,7 +488,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({ @@ -498,8 +514,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Role * @param id - Role ID - * @return Promise for a Role - * @example ```javascript + * @returns Promise for a Role + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -528,8 +545,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Roles - * @return Promise for a collection of Roles - * @example ```javascript + * @returns Promise for a collection of Roles + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -554,8 +572,9 @@ 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 + * @returns Promise for the newly created Role + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -610,8 +629,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Role + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -665,8 +685,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a User * @param userId - User ID - * @return Promise for a User - * @example ```javascript + * @returns Promise for a User + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -689,8 +710,9 @@ 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 + * @returns Promise a collection of Users in a space + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -714,8 +736,9 @@ 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 + * @returns Promise for a collection of teams for a space + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -738,8 +761,9 @@ 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 + * @returns Promise for a Space Member + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -759,8 +783,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a collection of Space Members * @param query - * @return Promise for a collection of Space Members - * @example ```javascript + * @returns Promise for a collection of Space Members + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -784,8 +809,9 @@ 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 - * @example ```javascript + * @returns Promise for a Space Membership + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -806,8 +832,9 @@ 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 - * @example ```javascript + * @returns Promise for a collection of Space Memberships + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -832,8 +859,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Space Membership + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -872,8 +900,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Space Membership + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -912,8 +941,9 @@ 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 + * @returns Promise for a Team Space Membership + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -937,8 +967,9 @@ 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 + * @returns Promise for a collection of Team Space Memberships + * @example + * ```javascript * const contentful = require('contentful-management') * * client.getSpace('') @@ -962,8 +993,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Team Space Membership + * @example +* ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1002,8 +1034,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets a Api Key * @param id - API Key ID - * @return Promise for a Api Key - * @example ```javascript + * @returns Promise for a Api Key + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1029,8 +1062,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Api Keys - * @return Promise for a collection of Api Keys - * @example ```javascript + * @returns Promise for a collection of Api Keys + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1055,8 +1089,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of preview Api Keys - * @return Promise for a collection of Preview Api Keys - * @example ```javascript + * @returns Promise for a collection of Preview Api Keys + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1082,8 +1117,9 @@ 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 + * @returns Promise for a Preview Api Key + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1110,8 +1146,9 @@ 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 + * @returns Promise for the newly created Api Key + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1149,8 +1186,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created Api Key + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1189,8 +1227,9 @@ 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 - * @example ```javascript + * @returns Promise for the newly created EnvironmentAlias + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1220,8 +1259,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { /** * Gets an Environment Alias * @param Environment Alias ID - * @return Promise for an Environment Alias - * @example ```javascript + * @returns Promise for an Environment Alias + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1244,8 +1284,9 @@ export default function createSpaceApi(makeRequest: MakeRequest) { }, /** * Gets a collection of Environment Aliases - * @return Promise for a collection of Environment Aliases - * @example ```javascript + * @returns Promise for a collection of Environment Aliases + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -1271,9 +1312,10 @@ 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 + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1302,7 +1344,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({ @@ -1341,8 +1384,9 @@ 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 + * @returns Promise for the newly created scheduled actions + * @example + * ```javascript * const contentful = require('contentful-management'); * * const client = contentful.createClient({ @@ -1391,7 +1435,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({ @@ -1465,7 +1510,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 b66008e00..b762317fb 100644 --- a/lib/create-ui-config-api.ts +++ b/lib/create-ui-config-api.ts @@ -27,8 +27,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @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 ea7a07001..e6ee62654 100644 --- a/lib/create-user-ui-config-api.ts +++ b/lib/create-user-ui-config-api.ts @@ -27,8 +27,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @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 baee1e076..b9f55d797 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' @@ -37,8 +41,9 @@ export type CreatePersonalAccessTokenProps = Pick { /** * Revokes access token - * @return Object the revoked access token - * @example ```javascript + * @returns Object the revoked access token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -59,7 +64,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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -38,8 +43,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -105,6 +111,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 631c7c6cd..e9c85dce5 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' @@ -34,7 +38,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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -199,7 +204,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)) @@ -213,6 +218,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 9903483d3..80046c4ea 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' @@ -63,8 +67,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -107,7 +112,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)) @@ -121,6 +126,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 7e536e164..c1afa3220 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 { @@ -110,7 +114,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, @@ -128,6 +132,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 d4d5b76f4..17cc2eafc 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' @@ -36,8 +40,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -56,7 +61,7 @@ export interface AppDetails extends AppDetailsProps, DefaultElements ({ @@ -80,7 +85,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 52cb7d98c..15e0ad3a3 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' @@ -39,8 +43,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -78,7 +83,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 95ecb7fd0..964c97bb7 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' @@ -26,8 +30,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -48,8 +53,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -104,7 +110,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 fff467f56..771d7c32c 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' @@ -53,8 +57,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -93,7 +98,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)) @@ -104,6 +109,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 873ffdce3..ce1d274ce 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' @@ -44,7 +48,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 102b7a6b9..f9a3cb094 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' @@ -28,8 +32,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -67,7 +72,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 8b36b14f7..ca2d36f97 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' @@ -17,8 +21,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -60,7 +65,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)) @@ -73,6 +78,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 b3e1df6e5..bf15bcecb 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' @@ -20,7 +24,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 f575b9e8c..43381cbde 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 enhanceWithMethods from '../enhance-with-methods' @@ -66,9 +70,10 @@ 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 + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -106,9 +111,10 @@ 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 + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -133,11 +139,12 @@ type AssetApi = { * .catch(console.error) * ``` */ - processForLocale(locale: string, Options?: AssetProcessingForLocale): Promise + processForLocale(locale: string, options?: AssetProcessingForLocale): Promise /** * Publishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -155,8 +162,9 @@ type AssetApi = { publish(): Promise /** * Archives the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -174,8 +182,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -193,8 +202,9 @@ type AssetApi = { delete(): Promise /** * Unarchives the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -212,8 +222,9 @@ type AssetApi = { unarchive(): Promise /** * Unpublishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -231,8 +242,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -397,7 +409,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 1fe8f0b69..99480df36 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' @@ -180,7 +184,7 @@ export interface BulkAction( makeRequest: MakeRequest, diff --git a/lib/entities/comment.ts b/lib/entities/comment.ts index 1fc40a542..fd593dc66 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 c2a8cdea5..3a12771f1 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 093e41da1..e540a5aa5 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 c4c05fae7..6e511cb3d 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 cb8d3e40b..b79ead844 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' @@ -67,8 +71,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -90,8 +95,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -109,8 +115,9 @@ type ContentTypeApi = { delete(): Promise /** * Publishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -128,8 +135,9 @@ type ContentTypeApi = { publish(): Promise /** * Unpublishes the object - * @return Object returned from the server with updated metadata. - * @example ```javascript + * @returns Object returned from the server with updated metadata. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -149,8 +157,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with the current editor interface. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -182,14 +191,15 @@ 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 /** * 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 +217,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({ @@ -347,7 +358,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 5072db9c0..d80824486 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' @@ -121,7 +125,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 +147,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 afc0bb473..7ee1fc9c8 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 { @@ -58,7 +62,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 15f53153b..21879ce0e 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' @@ -25,9 +29,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. - * @memberof EnvironmentAlias - * @func update - * @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') * @@ -49,9 +51,7 @@ 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. + * @returns {Promise} Promise for the deletion. It contains no data, but the Promise error case should be handled. * ```javascript * const contentful = require('contentful-management') * @@ -108,7 +108,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, @@ -123,6 +123,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/environment-template-installation.ts b/lib/entities/environment-template-installation.ts index b7ad4e0ac..485405f9c 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 abd87d5bc..f059b7263 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 96d89aec6..c3af2d84e 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 e76a5f535..82c34c6da 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' @@ -64,8 +68,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -86,8 +91,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -140,7 +146,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/field-type.ts b/lib/entities/field-type.ts index 341bfa3d4..f06f60505 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 f1fd32dd7..24e52ea30 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' @@ -40,7 +44,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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -71,8 +76,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -131,7 +137,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 9f75d5fcb..af451dc71 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' @@ -45,12 +49,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 +71,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 +85,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 +102,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 eab1ee80f..fc010214a 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' @@ -25,7 +29,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 b93110208..6dc198d2d 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' @@ -26,8 +30,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -99,7 +104,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 4610d7d71..8d595ba4b 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' @@ -34,7 +38,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 77aba5844..43f6dd02e 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' @@ -26,8 +30,9 @@ export interface PersonalAccessToken DefaultElements { /** * Revokes a personal access token - * @return Object the revoked personal access token - * @example ```javascript + * @returns Object the revoked personal access token + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -48,7 +53,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, @@ -71,6 +76,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 a419d8262..039add2e4 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' @@ -24,7 +28,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 45f8936f0..7979a8c57 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' @@ -44,7 +48,7 @@ export interface ReleaseActionQueryOptions { /** * Limit of how many records are returned in the query result * @default 100 - * */ + **/ limit?: number } @@ -96,7 +100,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 161812dbd..c568de923 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' @@ -57,7 +61,7 @@ export interface ReleaseQueryOptions { /** * Limit how many records are returned in the result * @default 100 - * */ + **/ limit?: number /** * Order releases @@ -66,7 +70,7 @@ export interface ReleaseQueryOptions { * - `sys.updatedAt`, `-sys.updatedAt` * - `sys.createdAt`, `-sys.createdAt` * @default -sys.updatedAt - * */ + **/ order?: string } @@ -136,13 +140,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 @@ -262,7 +266,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 d232eb9d9..4c35f344e 100644 --- a/lib/entities/resource-provider.ts +++ b/lib/entities/resource-provider.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { BasicMetaSysProps, CollectionProp, @@ -51,8 +55,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -81,8 +86,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -147,7 +153,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, @@ -156,7 +162,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 }, @@ -168,7 +174,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 7855a012e..2c6afe738 100644 --- a/lib/entities/resource-type.ts +++ b/lib/entities/resource-type.ts @@ -1,3 +1,7 @@ +/** + * @module + * @category Entities + */ import type { BasicMetaSysProps, CursorPaginatedCollectionProp, @@ -75,8 +79,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -106,8 +111,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -148,7 +154,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/resource.ts b/lib/entities/resource.ts index b57e610d8..976f31efd 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 87181fd0d..6e5f5b282 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' @@ -46,10 +50,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 + * @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') * * const client = contentful.createClient({ @@ -66,8 +69,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -121,7 +125,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/scheduled-action.ts b/lib/entities/scheduled-action.ts index 8f910a868..01bb9d362 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 { @@ -143,7 +147,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 +195,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/snapshot.ts b/lib/entities/snapshot.ts index 8dc13b1f9..071d997c4 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' @@ -26,7 +30,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 +42,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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -38,8 +43,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -92,7 +98,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 f92d38f57..ef4bf37c1 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' @@ -21,7 +25,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/tag.ts b/lib/entities/tag.ts index 98bc4c88d..819cd049f 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 30ab37f35..ad37cd7ee 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 8f152318f..d02f22524 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' @@ -30,8 +34,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -50,8 +55,9 @@ 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 + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -58,8 +63,9 @@ 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. - * @example ```javascript + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -121,7 +127,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 017069d10..57383003d 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' @@ -26,8 +30,9 @@ 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. - * @example ```javascript + * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -46,8 +51,9 @@ 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 + * @returns Object returned from the server with updated changes. + * @example + * ```javascript * const contentful = require('contentful-management') * * const client = contentful.createClient({ @@ -101,7 +107,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 8807ba80c..25c15d2b6 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' @@ -54,7 +58,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 3e2512fa9..82318e452 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' @@ -15,7 +19,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 +66,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 36ea3cb0a..e0ca33977 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' @@ -13,7 +17,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 +59,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 43ba3beec..ff6436f09 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 { @@ -63,7 +67,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 9945d8962..324d7fc39 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' @@ -44,7 +48,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 +71,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/utils.ts b/lib/entities/utils.ts index 1a5e5d92f..eceae56da 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 be750cc4a..014869f32 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' @@ -214,7 +218,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 +240,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 +259,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 +278,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 +297,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 +373,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)) diff --git a/lib/entities/widget-parameters.ts b/lib/entities/widget-parameters.ts index 1913b57d3..ac9262680 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 e3b3f93ce..dcd7b2e8b 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 cbbb01330..901a25280 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 { @@ -67,7 +71,7 @@ export type WorkflowQueryOptions = Omit & { /** * Order workflows by * @default -sys.createdAt - * */ + **/ order?: OrderQueryParam } diff --git a/lib/entities/workflows-changelog-entry.ts b/lib/entities/workflows-changelog-entry.ts index 0a6ba5f59..509cb626e 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/index.ts b/lib/index.ts index 44c528efb..b1133f037 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -48,10 +48,27 @@ export type ClientOptions = UserAgentParams & XOR[0]): ReturnType => adapter.makeRequest({ ...options, userAgent }) - if (opts.type === 'plain') { + if (opts && opts.type === 'plain') { return createPlainClient(makeRequest, opts.defaults) } else { return createClientApi(makeRequest) as ClientAPI diff --git a/lib/methods/action.ts b/lib/methods/action.ts index 5fd31bf47..e042946e9 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/as-iterator.ts b/lib/plain/as-iterator.ts index 7d37b8678..9239b9d37 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 161157861..7245f1af8 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/entities/comment.ts b/lib/plain/entities/comment.ts index 493bcc144..505a41538 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 7cc571617..1d7cff63e 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 f428e4d82..8b78f1904 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 412be3cd7..d30b959c1 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 7cba685e2..fea1896d0 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 776880880..eef748d78 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 a869d3634..de3a51e7f 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/lib/plain/plain-client-types.ts b/lib/plain/plain-client-types.ts index 4ddf1a988..d115cffae 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 { diff --git a/lib/plain/plain-client.ts b/lib/plain/plain-client.ts index 4fca36d9e..a8db39f40 100644 --- a/lib/plain/plain-client.ts +++ b/lib/plain/plain-client.ts @@ -1,3 +1,8 @@ +/** + * @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' diff --git a/package-lock.json b/package-lock.json index 946998ce1..42a594612 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,9 @@ "semantic-release": "^25.0.2", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.26.2", + "typedoc": "^0.28.14", + "typedoc-github-theme": "^0.3.1", + "typedoc-plugin-missing-exports": "^4.1.2", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5" @@ -982,6 +984,42 @@ "node": ">=14" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.17.0.tgz", + "integrity": "sha512-Bpf6WuFar20ZXL6qU6VpVl4bVQfyyYiX+6O4xrns4nkU3Mr8paeupDbS1HENpcLOYj7pN4Rkd/yCaPA0vQwKww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.17.0", + "@shikijs/langs": "^3.17.0", + "@shikijs/themes": "^3.17.0", + "@shikijs/types": "^3.17.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@gerrit0/mini-shiki/node_modules/@shikijs/engine-oniguruma": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.17.0.tgz", + "integrity": "sha512-flSbHZAiOZDNTrEbULY8DLWavu/TyVu/E7RChpLB4WvKX4iHMfj80C6Hi3TjIWaQtHOW0KC6kzMcuB5TO1hZ8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.17.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@gerrit0/mini-shiki/node_modules/@shikijs/types": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.17.0.tgz", + "integrity": "sha512-wjLVfutYWVUnxAjsWEob98xgyaGv0dTEnMZDruU5mRjVN7szcGOfgO+997W2yR6odp+1PtSBNeSITRRTfUzK/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -2683,79 +2721,52 @@ "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==", + "node_modules/@shikijs/langs": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.17.0.tgz", + "integrity": "sha512-icmur2n5Ojb+HAiQu6NEcIIJ8oWDFGGEpiqSCe43539Sabpx7Y829WR3QuUW2zjTM4l6V8Sazgb3rrHO2orEAw==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "1.29.1", - "@shikijs/vscode-textmate": "^10.0.1" + "@shikijs/types": "3.17.0" } }, - "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==", + "node_modules/@shikijs/langs/node_modules/@shikijs/types": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.17.0.tgz", + "integrity": "sha512-wjLVfutYWVUnxAjsWEob98xgyaGv0dTEnMZDruU5mRjVN7szcGOfgO+997W2yR6odp+1PtSBNeSITRRTfUzK/g==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "1.29.1" + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" } }, "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==", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.17.0.tgz", + "integrity": "sha512-/xEizMHLBmMHwtx4JuOkRf3zwhWD2bmG5BRr0IPjpcWpaq4C3mYEuTk/USAEglN0qPrTwEHwKVpSu/y2jhferA==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "1.29.1" + "@shikijs/types": "3.17.0" } }, - "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==", + "node_modules/@shikijs/themes/node_modules/@shikijs/types": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.17.0.tgz", + "integrity": "sha512-wjLVfutYWVUnxAjsWEob98xgyaGv0dTEnMZDruU5mRjVN7szcGOfgO+997W2yR6odp+1PtSBNeSITRRTfUzK/g==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/vscode-textmate": "^10.0.1", + "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "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==", + "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" }, @@ -2894,16 +2905,6 @@ "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", "dev": true }, - "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.19.23", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.23.tgz", @@ -3220,13 +3221,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", @@ -3906,17 +3900,6 @@ "node": ">=6" } }, - "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", @@ -3961,28 +3944,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", @@ -4285,17 +4246,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": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -4936,20 +4886,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", @@ -5071,13 +5007,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", @@ -6409,44 +6338,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", @@ -6520,17 +6411,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", @@ -8087,28 +7967,6 @@ "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", @@ -8183,100 +8041,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", @@ -11386,18 +11150,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/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -12068,17 +11820,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", @@ -12464,34 +12205,6 @@ "dev": true, "license": "MIT" }, - "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/registry-auth-token": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", @@ -13481,23 +13194,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", @@ -13870,17 +13566,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", @@ -14070,21 +13755,6 @@ "node": ">=8" } }, - "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", @@ -14622,17 +14292,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.1.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", @@ -14704,26 +14363,50 @@ } }, "node_modules/typedoc": { - "version": "0.26.11", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.11.tgz", - "integrity": "sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==", + "version": "0.28.14", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.14.tgz", + "integrity": "sha512-ftJYPvpVfQvFzpkoSfHLkJybdA/geDJ8BGQt/ZnkkhnBYoYW6lBgPQXu6vqLxO4X75dA55hX8Af847H5KXlEFA==", "dev": true, "license": "Apache-2.0", "dependencies": { + "@gerrit0/mini-shiki": "^3.12.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", - "shiki": "^1.16.2", - "yaml": "^2.5.1" + "yaml": "^2.8.1" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 18" + "node": ">= 18", + "pnpm": ">= 10" + }, + "peerDependencies": { + "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 || 5.9.x" + } + }, + "node_modules/typedoc-github-theme": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/typedoc-github-theme/-/typedoc-github-theme-0.3.1.tgz", + "integrity": "sha512-j6PmkAGmf/MGCzYjQcUH6jS9djPsNl/IoTXooxC+MoeMkBhbmPyKJlpR6Lw12BLoe2OYpYA2J1KMktUJXp/8Sw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" }, "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" + "typedoc": "~0.28.0" + } + }, + "node_modules/typedoc-plugin-missing-exports": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-4.1.2.tgz", + "integrity": "sha512-WNoeWX9+8X3E3riuYPduilUTFefl1K+Z+5bmYqNeH5qcWjtnTRMbRzGdEQ4XXn1WEO4WCIlU0vf46Ca2y/mspg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typedoc": "^0.28.1" } }, "node_modules/typedoc/node_modules/brace-expansion": { @@ -14873,79 +14556,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": "7.0.3", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", @@ -15042,36 +14652,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.21", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", @@ -15375,16 +14955,16 @@ } }, "node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yargs": { @@ -15454,17 +15034,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 c21a59e29..2421c061a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "browserslist": [ ">0.3%", "Chrome >= 85", - "Edge >= 85", + "Edge >= 85", "Firefox >= 79", "Safari >= 14" ], @@ -38,9 +38,8 @@ "clean": "rimraf dist", "build": "npm run clean && NODE_ENV=production rollup -c", "build:types": "rimraf dist/typings && tsc --declaration --noEmit false --emitDeclarationOnly true --allowJs false", - "build:docs": "typedoc", - "docs:dev": "npm run build:docs", - "docs:watch": "nodemon --exec npm run docs:dev -w lib typings", + "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", "lint": "eslint lib test", "pretest": "rimraf coverage && npm run lint", @@ -114,7 +113,9 @@ "semantic-release": "^25.0.2", "size-limit": "^11.1.6", "type-fest": "^4.18.3", - "typedoc": "^0.26.2", + "typedoc": "^0.28.14", + "typedoc-github-theme": "^0.3.1", + "typedoc-plugin-missing-exports": "^4.1.2", "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vitest": "^2.1.5" @@ -181,4 +182,4 @@ "limit": "177 kB" } ] -} \ No newline at end of file +} diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 000000000..6e2457be1 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,126 @@ +{ + "name": "contentful-management.js", + "entryPoints": [ + "lib/index.ts", + "lib/create-contentful-api.ts", + "lib/plain/plain-client.ts", + "lib/plain/checks.ts", + // "lib/plain/wrappers/wrap.ts", + // "lib/create-adapter.ts", + // "lib/entities/app-action.ts", + // "lib/entities/environment-template-installation.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": false, + "categoryOrder": ["Core", "Plain Client", "Legacy Client", "Entities", "*"], + "defaultCategory": "Other", + "kindSortOrder": [ + "Project", + "Module", + "Namespace", + "Constructor", + "Property", + "Function", + "Enum", + "EnumMember", + "Class", + "Interface", + "TypeAlias", + "Variable", + "Reference", + "Accessor", + "Method", + "Parameter", + "TypeParameter", + "TypeLiteral", + "CallSignature", + "ConstructorSignature", + "IndexSignature", + "GetSignature", + "SetSignature" + ], + "groupOrder": ["Functions", "Interfaces", "Modules", "*"], + "sortEntryPoints": false, + "readme": "README.md", + "excludePrivate": false, + "excludeInternal": false, + "excludeProtected": false, + "treatWarningsAsErrors": false, + "sort": ["source-order"], + "plugin": ["typedoc-plugin-missing-exports", "typedoc-github-theme"], + "hideGenerator": true, + "includeHierarchySummary": true, + "navigation": { + "includeGroups": false, + "includeCategories": true, + "includeFolders": false + } +}