contentful-management 11.40.0 → 11.40.1

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.40.0"}`, params.application, params.integration, params.feature);
49
+ `${sdkMain}/${"11.40.1"}`, params.application, params.integration, params.feature);
50
50
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
51
51
  userAgent
52
52
  }));
@@ -0,0 +1,9 @@
1
+ import { describe, expectTypeOf, it } from 'vitest';
2
+ describe('OptionalDefaults', () => {
3
+ it('does not add props', () => {
4
+ expectTypeOf().toMatchTypeOf();
5
+ });
6
+ it('adds default props if available', () => {
7
+ expectTypeOf().toMatchTypeOf();
8
+ });
9
+ });
@@ -91,7 +91,7 @@ export declare const FIELD_TYPES: Array<keyof typeof INTERNAL_TO_API>;
91
91
  * - Assets
92
92
  * - File
93
93
  */
94
- export declare function toInternalFieldType(api: Partial<ContentFields>): "Asset" | "Entry" | "File" | "Entries" | "Boolean" | "Symbol" | "Number" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "Symbols" | "Assets" | "Resources" | undefined;
94
+ export declare function toInternalFieldType(api: Partial<ContentFields>): "Asset" | "Entry" | "Boolean" | "Symbol" | "Number" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "File" | "Symbols" | "Entries" | "Assets" | "Resources" | undefined;
95
95
  export declare const DEFAULTS_WIDGET: {
96
96
  Text: {
97
97
  widgetId: string;
@@ -7,13 +7,7 @@ export type DefaultParams = {
7
7
  /**
8
8
  * @private
9
9
  */
10
- export type OptionalDefaults<T> = Omit<T, keyof DefaultParams> & ('organizationId' extends keyof T ? {
11
- organizationId?: string;
12
- } : Record<string, unknown>) & ('spaceId' extends keyof T ? {
13
- spaceId?: string;
14
- } : Record<string, unknown>) & ('environmentId' extends keyof T ? {
15
- environmentId?: string;
16
- } : Record<string, unknown>);
10
+ export type OptionalDefaults<T> = Omit<T, keyof DefaultParams> & Partial<Pick<T, Extract<keyof T, keyof DefaultParams>>>;
17
11
  /**
18
12
  * @private
19
13
  */
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.40.0",
3
+ "version": "11.40.1",
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",
@@ -37,10 +37,11 @@
37
37
  "check-types": "tsc",
38
38
  "lint": "eslint lib test --ext '.ts,.tsx,.js,.jsx'",
39
39
  "pretest": "rimraf coverage && npm run lint",
40
- "test": "npm run test:cover-unit && npm run test:cover-integration && npm run test:size",
40
+ "test": "npm run test:cover-unit && npm run test:types && npm run test:cover-integration && npm run test:size",
41
41
  "test:cover-unit": "npm run test:unit -- --coverage",
42
42
  "test:cover-integration": "npm run test:integration -- --coverage",
43
43
  "test:unit": "npx vitest --project unit --run",
44
+ "test:types": "npx vitest --project types --run",
44
45
  "test:unit-watch": "npx vitest --project unit",
45
46
  "test:integration": "npx vitest --project integration --run --no-file-parallelism",
46
47
  "test:integration-watch": "npx vitest --project integration --no-file-parallelism",