contentful-management 11.35.1 → 11.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@ function createClient(params, opts = {}) {
46
46
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
47
47
  const userAgent = getUserAgentHeader(
48
48
  // @ts-expect-error
49
- `${sdkMain}/${"11.35.1"}`, params.application, params.integration, params.feature);
49
+ `${sdkMain}/${"11.36.0"}`, params.application, params.integration, params.feature);
50
50
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
51
51
  userAgent
52
52
  }));
@@ -1239,14 +1239,17 @@ export default function createEnvironmentApi(makeRequest) {
1239
1239
  * .catch(console.error)
1240
1240
  * ```
1241
1241
  */
1242
- getLocales() {
1242
+ getLocales(query = {}) {
1243
1243
  const raw = this.toPlainObject();
1244
1244
  return makeRequest({
1245
1245
  entityType: 'Locale',
1246
1246
  action: 'getMany',
1247
1247
  params: {
1248
1248
  spaceId: raw.sys.space.sys.id,
1249
- environmentId: raw.sys.id
1249
+ environmentId: raw.sys.id,
1250
+ query: createRequestConfig({
1251
+ query
1252
+ }).params
1250
1253
  }
1251
1254
  }).then(data => wrapLocaleCollection(makeRequest, data));
1252
1255
  },
@@ -843,7 +843,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
843
843
  * .catch(console.error)
844
844
  * ```
845
845
  */
846
- getLocales(): Promise<import("./common-types").Collection<import("./entities/locale").Locale, import("./entities/locale").LocaleProps>>;
846
+ getLocales(query?: BasicQueryOptions): Promise<import("./common-types").Collection<import("./entities/locale").Locale, import("./entities/locale").LocaleProps>>;
847
847
  /**
848
848
  * Creates a Locale
849
849
  * @param data - Object representation of the Locale to be created
@@ -4,10 +4,10 @@ import type { UpsertResourceProviderProps, ResourceProviderProps } from '../../e
4
4
  import type { OptionalDefaults } from '../wrappers/wrap';
5
5
  export type ResourceProviderPlainClientAPI = {
6
6
  /**
7
- * Fetch a Resource Provider
7
+ * Fetches a Resource Provider
8
8
  * @param params entity IDs to identify the Resource Provider
9
- * @returns the App Definition config
10
- * @throws if the request fails, or the Resource Provider is not found
9
+ * @returns the Resource Provider
10
+ * @throws if the request fails or the Resource Provider is not found
11
11
  * @example
12
12
  * ```javascript
13
13
  * const resourceProvider = await client.resourceProvider.get({
@@ -18,15 +18,17 @@ export type ResourceProviderPlainClientAPI = {
18
18
  */
19
19
  get(params: OptionalDefaults<GetResourceProviderParams>): Promise<ResourceProviderProps>;
20
20
  /**
21
- * Creates or updates a Resource Provider
21
+ * Creates a Resource Provider
22
22
  * @param params entity IDs to identify the Resource Provider
23
- * @param rawData the ResourceProvider
24
- * @returns the created or updated Resource Provider
25
- * @throws if the request fails, the App Definition or Resource Provider is not found, or the payload is malformed
23
+ * @param rawData the Resource Provider data
24
+ * @returns the created Resource Provider
25
+ * @throws if the request fails, the App Definition is not found,
26
+ * a Resource Provider associated with the organization and app definition already exists,
27
+ * or the payload is malformed
26
28
  * @example
27
29
  * ```javascript
28
- * // You need a valid AppDefinition with an activated AppBundle that has a contentful function configured
29
- * const appInstallation = await client.resourceProvider.upsert(
30
+ * // You need a valid AppDefinition with an activated AppBundle that has a configured Contentful function
31
+ * const resourceProvider = await client.resourceProvider.upsert(
30
32
  * {
31
33
  * organizationId: '<organization_id>',
32
34
  * appDefinitionId: '<app_definition_id>',
@@ -41,9 +43,10 @@ export type ResourceProviderPlainClientAPI = {
41
43
  */
42
44
  upsert(params: OptionalDefaults<GetResourceProviderParams>, rawData: UpsertResourceProviderProps, headers?: RawAxiosRequestHeaders): Promise<ResourceProviderProps>;
43
45
  /**
44
- * Delete a ResourceProvider
46
+ * Deletes a ResourceProvider
45
47
  * @param params entity IDs to identify the Resource Provider
46
- * @throws if the request fails, or the Resource Provider is not found
48
+ * @throws if the request fails, the Resource Provider is not found
49
+ * or the Resource Provider is associated with an existing Resource Type
47
50
  * @example
48
51
  * ```javascript
49
52
  * await client.resourceProvider.delete({
@@ -3,17 +3,19 @@ import type { CursorPaginatedCollectionProp, GetResourceParams } from '../../com
3
3
  import type { ResourceProps, ResourceQueryOptions } from '../../entities/resource';
4
4
  export type ResourcePlainAPI = {
5
5
  /**
6
- * Fetch Resources
6
+ * Fetches all Resources.
7
+ * Supports fetching specific Resources by URNs or searching by a text query.
7
8
  * @param params entity IDs to identify the Resources
8
- * @returns the App Definition config
9
- * @throws if the request fails, or the Resource Type is not found
9
+ * @params optional query params for search or lookup events
10
+ * @returns the Resources collection
11
+ * @throws if the request fails or the Resource Type is not found
10
12
  * @example
11
13
  * ```javascript
12
14
  * // Lookup example
13
- * const resourceProvider = await client.resource.getMany({
15
+ * const resources = await client.resource.getMany({
14
16
  * spaceId: '<space_id>',
15
17
  * environmentId: '<environment_id>',
16
- * resourceTypeId: '<resource_type_id>',
18
+ * resourceTypeId: '<resource_provider_id>:<resource_type_name>',
17
19
  * query: {
18
20
  * 'sys.urn[in]': '<resource_urn1>,<resource_urn2>',
19
21
  * limit': <number>,
@@ -21,10 +23,10 @@ export type ResourcePlainAPI = {
21
23
  * });
22
24
  *
23
25
  * // Search example
24
- * const resourceProvider = await client.resource.getMany({
26
+ * const resources = await client.resource.getMany({
25
27
  * spaceId: '<space_id>',
26
28
  * environmentId: '<environment_id>',
27
- * resourceTypeId: '<resource_type_id>',
29
+ * resourceTypeId: '<resource_provider_id>:<resource_type_name>',
28
30
  * query: {
29
31
  * 'query': 'text',
30
32
  * 'limit': <number>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.35.1",
3
+ "version": "11.36.0",
4
4
  "description": "Client for Contentful's Content Management API",
5
5
  "homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
6
6
  "main": "./dist/contentful-management.node.js",