Skip to content

Commit 7a1a9ba

Browse files
committed
fix: upgrade typedoc, include missing types and plenty of tsdoc fixes
1 parent dadddf4 commit 7a1a9ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+671
-869
lines changed

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<p align="center">
1414
<a href="README.md">Readme</a> ·
1515
<a href="SETUP.md">Setup</a> ·
16-
<a href="MIGRATION.md">Migration</a> ·
1716
<a href="CHANGELOG.md">Changelog</a> ·
1817
<a href="CONTRIBUTING.md">Contributing</a>
1918
</p>
@@ -43,29 +42,44 @@
4342

4443
<!-- TOC -->
4544

46-
- [Features](#features)
47-
- [Supported Environments](#supported-environments)
48-
- [Getting Started](#getting-started)
45+
- [Getting started](#getting-started)
4946
- [Installation](#installation)
50-
- [Node](#node-)
51-
- [Browser](#browser-)
52-
- [Typings](#typings)
47+
- [Node:](#node)
48+
- [Browser:](#browser)
49+
- [Typings](#typings)
5350
- [Authentication](#authentication)
5451
- [Using ES6 import](#using-es6-import)
55-
- [Your first Request](#your-first-request)
56-
- [Alternative plain API](#alternative-plain-api)
57-
- [App Framework](#app-framework)
58-
- [Troubleshooting](#troubleshooting)
59-
- [Documentation/References](#documentationreferences)
52+
- [Your first request](#your-first-request)
53+
- [Legacy Client Interface](#legacy-client-interface)
54+
- [App Framework](#app-framework)
55+
- [Troubleshooting](#troubleshooting)
56+
- [Documentation/References](#documentationreferences)
6057
- [Configuration](#configuration)
61-
- [Reference Documentation](#reference-documentation)
62-
- [Contentful Javascript resources](#contentful-javascript-resources)
63-
- [REST API reference](#rest-api-reference)
64-
- [Versioning](#versioning)
65-
- [Reach out to us](#reach-out-to-us)
66-
- [Get involved](#get-involved)
67-
- [License](#license)
68-
- [Code of Conduct](#code-of-conduct)
58+
- [accessToken (required, when `apiAdapter` is not set)](#accesstoken-required-when-apiadapter-is-not-set)
59+
- [host (default: `'api.contentful.com'`)](#host-default-apicontentfulcom)
60+
- [hostUpload (default: `'upload.contentful.com'`)](#hostupload-default-uploadcontentfulcom)
61+
- [basePath (default: \`\`)](#basepath-default-)
62+
- [httpAgent (default: `undefined`)](#httpagent-default-undefined)
63+
- [httpsAgent (default: `undefined`)](#httpsagent-default-undefined)
64+
- [headers (default: `{}`)](#headers-default-)
65+
- [proxy (default: `undefined`)](#proxy-default-undefined)
66+
- [retryOnError (default: `true`)](#retryonerror-default-true)
67+
- [logHandler (default: `function (level, data) {}`)](#loghandler-default-function-level-data-)
68+
- [requestLogger (default: `function (config) {}`)](#requestlogger-default-function-config-)
69+
- [responseLogger (default: `function (response) {}`)](#responselogger-default-function-response-)
70+
- [apiAdapter (default: `new RestAdapter(configuration)`)](#apiadapter-default-new-restadapterconfiguration)
71+
- [throttle (default: `0`)](#throttle-default-0)
72+
- [Reference documentation](#reference-documentation)
73+
- [Contentful JavaScript resources](#contentful-javascript-resources)
74+
- [REST API reference](#rest-api-reference)
75+
- [Versioning](#versioning)
76+
- [Reach out to us](#reach-out-to-us)
77+
- [You have questions about how to use this library?](#you-have-questions-about-how-to-use-this-library)
78+
- [You found a bug or want to propose a feature?](#you-found-a-bug-or-want-to-propose-a-feature)
79+
- [You need to share confidential information or have other questions?](#you-need-to-share-confidential-information-or-have-other-questions)
80+
- [Get involved](#get-involved)
81+
- [License](#license)
82+
- [Code of Conduct](#code-of-conduct)
6983

7084
<!-- /TOC -->
7185
</details>

lib/adapters/REST/endpoints/access-token.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import * as raw from './raw'
1515
* @param {Object} params - Parameters for the request.
1616
* @param {string} params.tokenId - The unique token ID of the access token to retrieve.
1717
* @returns {Promise<AccessTokenProps>} A Promise that resolves with the retrieved access token information.
18-
* @example ```javascript
18+
* @example
19+
* ```javascript
1920
* const contentful = require('contentful-management')
2021
*
2122
* const plainClient = contentful.createClient(
@@ -42,7 +43,8 @@ export const get: RestEndpoint<'AccessToken', 'get'> = (
4243
* @param {AxiosInstance} http - An Axios HTTP client instance.
4344
* @param {QueryParams} params - Query parameters to filter and customize the request.
4445
* @returns {Promise<CollectionProp<AccessTokenProps>>} A Promise that resolves with a collection of access token properties.
45-
* @example ```javascript
46+
* @example
47+
* ```javascript
4648
* const contentful = require('contentful-management')
4749
*
4850
* const plainClient = contentful.createClient(
@@ -73,7 +75,8 @@ export const getMany: RestEndpoint<'AccessToken', 'getMany'> = (
7375
* @param {CreatePersonalAccessTokenProps} rawData - Data for creating the personal access token.
7476
* @param {RawAxiosRequestHeaders} [headers] - Optional HTTP headers for the request.
7577
* @returns {Promise<AccessTokenProps>} A Promise that resolves with the created personal access token.
76-
* @example ```javascript
78+
* @example
79+
* ```javascript
7780
* const contentful = require('contentful-management')
7881
*
7982
* const plainClient = contentful.createClient(
@@ -105,7 +108,8 @@ export const createPersonalAccessToken: RestEndpoint<'AccessToken', 'createPerso
105108
* @param {Object} params - The parameters for revoking the access token.
106109
* @param {string} params.tokenId - The unique identifier of the access token to revoke.
107110
* @returns {Promise<AccessTokenProps>} A Promise that resolves with the updated access token information after revocation.
108-
* @example ```javascript
111+
* @example
112+
* ```javascript
109113
* const contentful = require('contentful-management')
110114
*
111115
* const plainClient = contentful.createClient(
@@ -133,7 +137,8 @@ export const revoke: RestEndpoint<'AccessToken', 'revoke'> = (
133137
* @param {GetOrganizationParams & QueryParams} params - Parameters for the request, including organization ID and query parameters.
134138
* @param {string} params.organizationId - The unique identifier of the organization.
135139
* @returns {Promise<CollectionProp<AccessTokenProps>>} A promise that resolves to a collection of access tokens.
136-
* @example ```javascript
140+
* @example
141+
* ```javascript
137142
* const contentful = require('contentful-management')
138143
*
139144
* const plainClient = contentful.createClient(

lib/adapters/REST/endpoints/oauth-application.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import type {
2222
* @param {string} params.userId - The unique user ID of the user.
2323
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
2424
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the retrieved OAuth Application.
25-
* @example ```javascript
25+
* @example
26+
* ```javascript
2627
* const contentful = require('contentful-management')
2728
*
2829
* const plainClient = contentful.createClient(
@@ -54,7 +55,8 @@ export const get: RestEndpoint<'OAuthApplication', 'get'> = (
5455
* @param {string} params.userId - The unique user ID of the user.
5556
* @param {QueryParams} params - Query parameters to filter and customize the request.
5657
* @returns {Promise<CursorPaginatedCollectionProp<OAuthApplicationProps>>} A Promise that resolves with a collection of oauth application properties.
57-
* @example ```javascript
58+
* @example
59+
* ```javascript
5860
* const contentful = require('contentful-management')
5961
*
6062
* const plainClient = contentful.createClient(
@@ -89,7 +91,8 @@ export const getManyForUser: RestEndpoint<'OAuthApplication', 'getManyForUser'>
8991
* @param {string} params.userId - The unique user ID of the user.
9092
* @param {RawAxiosRequestHeaders} [headers] - Optional HTTP headers for the request.
9193
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the created oauth application.
92-
* @example ```javascript
94+
* @example
95+
* ```javascript
9396
* const contentful = require('contentful-management')
9497
*
9598
* const plainClient = contentful.createClient(
@@ -130,7 +133,8 @@ export const create: RestEndpoint<'OAuthApplication', 'create'> = (
130133
* @param {string} params.userId - The unique user ID of the user.
131134
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
132135
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the updated oauth application.
133-
* @example ```javascript
136+
* @example
137+
* ```javascript
134138
* const contentful = require('contentful-management')
135139
*
136140
* const plainClient = contentful.createClient(
@@ -171,7 +175,8 @@ export const update: RestEndpoint<'OAuthApplication', 'update'> = (
171175
* @param {string} params.userId - The unique user ID of the user.
172176
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
173177
* @returns {Promise<void>}
174-
* @example ```javascript
178+
* @example
179+
* ```javascript
175180
* const contentful = require('contentful-management')
176181
*
177182
* const plainClient = contentful.createClient(

lib/create-app-definition-api.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
2626
/**
2727
* Sends an update to the server with any changes made to the object's properties
2828
* @return Object returned from the server with updated changes.
29-
* @example ```javascript
29+
* @example
30+
* ```javascript
3031
* const contentful = require('contentful-management')
3132
*
3233
* const client = contentful.createClient({
@@ -57,7 +58,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
5758
/**
5859
* Deletes this object on the server.
5960
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
60-
* @example ```javascript
61+
* @example
62+
* ```javascript
6163
* const contentful = require('contentful-management')
6264
*
6365
* const client = contentful.createClient({
@@ -84,7 +86,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
8486
* Gets an app bundle
8587
* @param id - AppBundle ID
8688
* @return Promise for an AppBundle
87-
* @example ```javascript
89+
* @example
90+
* ```javascript
8891
* const contentful = require('contentful-management')
8992
* const client = contentful.createClient({
9093
* accessToken: '<content_management_api_key>'
@@ -113,7 +116,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
113116
/**
114117
* Gets a collection of AppBundles
115118
* @return Promise for a collection of AppBundles
116-
* @example ```javascript
119+
* @example
120+
* ```javascript
117121
* const contentful = require('contentful-management')
118122
* const client = contentful.createClient({
119123
* accessToken: '<content_management_api_key>'
@@ -139,7 +143,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
139143
* Creates an app bundle
140144
* @param Object representation of the App Bundle to be created
141145
* @return Promise for the newly created AppBundle
142-
* @example ```javascript
146+
* @example
147+
* ```javascript
143148
* const contentful = require('contentful-management')
144149
* const client = contentful.createClient({
145150
* accessToken: '<content_management_api_key>'
@@ -168,7 +173,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
168173
* Gets a list of App Installations across an org for given organization and App Definition
169174
* If a spaceId is provided in the query object, it will return the App Installations for that specific space.
170175
* @return Promise for the newly created AppBundle
171-
* @example ```javascript
176+
* @example
177+
* ```javascript
172178
* const contentful = require('contentful-management')
173179
* const client = contentful.createClient({
174180
* accessToken: '<content_management_api_key>'
@@ -197,7 +203,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
197203
* Creates or updates a resource provider
198204
* @param data representation of the ResourceProvider
199205
* @return Promise for the newly created or updated ResourceProvider
200-
* @example ```javascript
206+
* @example
207+
* ```javascript
201208
* const contentful = require('contentful-management')
202209
* const client = contentful.createClient({
203210
* accessToken: '<content_management_api_key>'
@@ -238,7 +245,8 @@ export default function createAppDefinitionApi(makeRequest: MakeRequest) {
238245
/**
239246
* Gets a Resource Provider
240247
* @return Promise for a Resource Provider
241-
* @example ```javascript
248+
* @example
249+
* ```javascript
242250
* const contentful = require('contentful-management')
243251
* const client = contentful.createClient({
244252
* accessToken: '<content_management_api_key>'

0 commit comments

Comments
 (0)