@datocms/cma-client 5.4.15 → 5.4.16

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.
@@ -90,7 +90,7 @@ class Client {
90
90
  return this.config.baseUrl || Client.defaultBaseUrl;
91
91
  }
92
92
  request(options) {
93
- return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.15', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
93
+ return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.16', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
94
94
  ? { 'X-Environment': this.config.environment }
95
95
  : {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
96
96
  return this.jobResultsFetcher
@@ -75,7 +75,7 @@ export type NewBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>
75
75
  export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = [
76
76
  D
77
77
  ] extends [never] ? UnchangedBlockInRequest : D extends unknown ? UnchangedBlockInRequest | UpdatedBlockInRequest<D> | NewBlockInRequest<D> : never;
78
- export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
78
+ export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = RawApiTypes.ItemInNestedResponse<D>;
79
79
  /**
80
80
  * Single Block field value for API requests - allows flexible block representations:
81
81
  * - string: Just the block ID (to keep existing blocks unchanged)
@@ -8,22 +8,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
8
8
  type: ItemTypeType;
9
9
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
10
10
  };
11
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
11
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
12
12
  __itemTypeId?: D['itemTypeId'];
13
13
  id: ItemIdentity;
14
14
  type: ItemType1;
15
15
  item_type: ItemTypeData<D>;
16
16
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
17
17
  meta: ItemMeta;
18
- } & ToItemAttributes<D>;
19
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
18
+ } & ToItemAttributes<D> : never;
19
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  id: ItemIdentity;
22
22
  type: ItemType1;
23
23
  item_type: ItemTypeData<D>;
24
24
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
25
25
  meta: ItemMeta;
26
- } & ToItemAttributesInNestedResponse<D>;
26
+ } & ToItemAttributesInNestedResponse<D> : never;
27
27
  /**
28
28
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
29
29
  */
@@ -64,7 +64,7 @@ export class Client {
64
64
  return this.config.baseUrl || Client.defaultBaseUrl;
65
65
  }
66
66
  request(options) {
67
- return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.15', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
67
+ return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.16', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
68
68
  ? { 'X-Environment': this.config.environment }
69
69
  : {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
70
70
  return this.jobResultsFetcher
@@ -16,22 +16,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
16
16
  type: ItemTypeType;
17
17
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
18
18
  };
19
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
19
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  type: ItemType1;
22
22
  id: ItemIdentity;
23
23
  relationships: ItemRelationships<D>;
24
24
  meta: ItemMeta;
25
25
  attributes: ToItemAttributes<D>;
26
- };
27
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
26
+ } : never;
27
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
28
28
  __itemTypeId?: D['itemTypeId'];
29
29
  type: ItemType1;
30
30
  id: ItemIdentity;
31
31
  relationships: ItemRelationships<D>;
32
32
  meta: ItemMeta;
33
33
  attributes: ToItemAttributesInNestedResponse<D>;
34
- };
34
+ } : never;
35
35
  /**
36
36
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
37
37
  */
@@ -12,9 +12,16 @@ export default class ItemVersion extends BaseResource {
12
12
  * @throws {ApiError}
13
13
  * @throws {TimeoutError}
14
14
  */
15
- restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[ApiTypes.Item<import("../../index.js").ItemTypeDefinition<{
16
- locales: string;
17
- }, string, {}>>, ApiTypes.ItemVersion]>;
15
+ restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[{
16
+ __itemTypeId?: string | undefined;
17
+ id: string;
18
+ type: "item";
19
+ item_type: ApiTypes.ItemTypeData<import("../../index.js").ItemTypeDefinition<{
20
+ locales: string;
21
+ }, string, {}>>;
22
+ creator?: ApiTypes.UserData | ApiTypes.AccessTokenData | ApiTypes.AccountData | ApiTypes.SsoUserData | ApiTypes.OrganizationData | undefined;
23
+ meta: ApiTypes.ItemMeta;
24
+ } & Record<string, unknown>, ApiTypes.ItemVersion]>;
18
25
  /**
19
26
  * Restore an old record version
20
27
  *
@@ -75,7 +75,7 @@ export type NewBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>
75
75
  export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = [
76
76
  D
77
77
  ] extends [never] ? UnchangedBlockInRequest : D extends unknown ? UnchangedBlockInRequest | UpdatedBlockInRequest<D> | NewBlockInRequest<D> : never;
78
- export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
78
+ export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = RawApiTypes.ItemInNestedResponse<D>;
79
79
  /**
80
80
  * Single Block field value for API requests - allows flexible block representations:
81
81
  * - string: Just the block ID (to keep existing blocks unchanged)
@@ -8,22 +8,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
8
8
  type: ItemTypeType;
9
9
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
10
10
  };
11
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
11
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
12
12
  __itemTypeId?: D['itemTypeId'];
13
13
  id: ItemIdentity;
14
14
  type: ItemType1;
15
15
  item_type: ItemTypeData<D>;
16
16
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
17
17
  meta: ItemMeta;
18
- } & ToItemAttributes<D>;
19
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
18
+ } & ToItemAttributes<D> : never;
19
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  id: ItemIdentity;
22
22
  type: ItemType1;
23
23
  item_type: ItemTypeData<D>;
24
24
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
25
25
  meta: ItemMeta;
26
- } & ToItemAttributesInNestedResponse<D>;
26
+ } & ToItemAttributesInNestedResponse<D> : never;
27
27
  /**
28
28
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
29
29
  */
@@ -16,22 +16,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
16
16
  type: ItemTypeType;
17
17
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
18
18
  };
19
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
19
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  type: ItemType1;
22
22
  id: ItemIdentity;
23
23
  relationships: ItemRelationships<D>;
24
24
  meta: ItemMeta;
25
25
  attributes: ToItemAttributes<D>;
26
- };
27
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
26
+ } : never;
27
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
28
28
  __itemTypeId?: D['itemTypeId'];
29
29
  type: ItemType1;
30
30
  id: ItemIdentity;
31
31
  relationships: ItemRelationships<D>;
32
32
  meta: ItemMeta;
33
33
  attributes: ToItemAttributesInNestedResponse<D>;
34
- };
34
+ } : never;
35
35
  /**
36
36
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
37
37
  */
@@ -12,9 +12,16 @@ export default class ItemVersion extends BaseResource {
12
12
  * @throws {ApiError}
13
13
  * @throws {TimeoutError}
14
14
  */
15
- restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[ApiTypes.Item<import("../../index.js").ItemTypeDefinition<{
16
- locales: string;
17
- }, string, {}>>, ApiTypes.ItemVersion]>;
15
+ restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[{
16
+ __itemTypeId?: string | undefined;
17
+ id: string;
18
+ type: "item";
19
+ item_type: ApiTypes.ItemTypeData<import("../../index.js").ItemTypeDefinition<{
20
+ locales: string;
21
+ }, string, {}>>;
22
+ creator?: ApiTypes.UserData | ApiTypes.AccessTokenData | ApiTypes.AccountData | ApiTypes.SsoUserData | ApiTypes.OrganizationData | undefined;
23
+ meta: ApiTypes.ItemMeta;
24
+ } & Record<string, unknown>, ApiTypes.ItemVersion]>;
18
25
  /**
19
26
  * Restore an old record version
20
27
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "5.4.15",
3
+ "version": "5.4.16",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
@@ -45,5 +45,5 @@
45
45
  "@datocms/dashboard-client": "^5.4.9",
46
46
  "@types/uuid": "^9.0.7"
47
47
  },
48
- "gitHead": "c368fd252a0ba33c3b22759b5619781c7a8aba7b"
48
+ "gitHead": "454acff0c6db2d3dda7f98c831e787e2e0413364"
49
49
  }
@@ -107,7 +107,7 @@ export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> =
107
107
 
108
108
  export type BlockInNestedResponse<
109
109
  D extends ItemTypeDefinition = ItemTypeDefinition,
110
- > = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
110
+ > = RawApiTypes.ItemInNestedResponse<D>;
111
111
 
112
112
  /**
113
113
  * Single Block field value for API requests - allows flexible block representations:
@@ -27,35 +27,40 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
27
27
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
28
28
  };
29
29
 
30
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
31
- __itemTypeId?: D['itemTypeId'];
32
- id: ItemIdentity;
33
- type: ItemType1;
34
- item_type: ItemTypeData<D>;
35
- creator?:
36
- | AccountData
37
- | AccessTokenData
38
- | UserData
39
- | SsoUserData
40
- | OrganizationData;
41
- meta: ItemMeta;
42
- } & ToItemAttributes<D>;
30
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> =
31
+ D extends ItemTypeDefinition
32
+ ? {
33
+ __itemTypeId?: D['itemTypeId'];
34
+ id: ItemIdentity;
35
+ type: ItemType1;
36
+ item_type: ItemTypeData<D>;
37
+ creator?:
38
+ | AccountData
39
+ | AccessTokenData
40
+ | UserData
41
+ | SsoUserData
42
+ | OrganizationData;
43
+ meta: ItemMeta;
44
+ } & ToItemAttributes<D>
45
+ : never;
43
46
 
44
47
  export type ItemInNestedResponse<
45
48
  D extends ItemTypeDefinition = ItemTypeDefinition,
46
- > = {
47
- __itemTypeId?: D['itemTypeId'];
48
- id: ItemIdentity;
49
- type: ItemType1;
50
- item_type: ItemTypeData<D>;
51
- creator?:
52
- | AccountData
53
- | AccessTokenData
54
- | UserData
55
- | SsoUserData
56
- | OrganizationData;
57
- meta: ItemMeta;
58
- } & ToItemAttributesInNestedResponse<D>;
49
+ > = D extends ItemTypeDefinition
50
+ ? {
51
+ __itemTypeId?: D['itemTypeId'];
52
+ id: ItemIdentity;
53
+ type: ItemType1;
54
+ item_type: ItemTypeData<D>;
55
+ creator?:
56
+ | AccountData
57
+ | AccessTokenData
58
+ | UserData
59
+ | SsoUserData
60
+ | OrganizationData;
61
+ meta: ItemMeta;
62
+ } & ToItemAttributesInNestedResponse<D>
63
+ : never;
59
64
 
60
65
  /* tslint:disable */
61
66
  /**
@@ -151,7 +151,7 @@ export class Client {
151
151
  ...this.config,
152
152
  ...options,
153
153
  logFn: this.config.logFn || console.log,
154
- userAgent: '@datocms/cma-client v5.4.15',
154
+ userAgent: '@datocms/cma-client v5.4.16',
155
155
  baseUrl: this.baseUrl,
156
156
  preCallStack: new Error().stack,
157
157
  extraHeaders: {
@@ -39,25 +39,30 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
39
39
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
40
40
  };
41
41
 
42
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
43
- __itemTypeId?: D['itemTypeId'];
44
- type: ItemType1;
45
- id: ItemIdentity;
46
- relationships: ItemRelationships<D>;
47
- meta: ItemMeta;
48
- attributes: ToItemAttributes<D>;
49
- };
42
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> =
43
+ D extends ItemTypeDefinition
44
+ ? {
45
+ __itemTypeId?: D['itemTypeId'];
46
+ type: ItemType1;
47
+ id: ItemIdentity;
48
+ relationships: ItemRelationships<D>;
49
+ meta: ItemMeta;
50
+ attributes: ToItemAttributes<D>;
51
+ }
52
+ : never;
50
53
 
51
54
  export type ItemInNestedResponse<
52
55
  D extends ItemTypeDefinition = ItemTypeDefinition,
53
- > = {
54
- __itemTypeId?: D['itemTypeId'];
55
- type: ItemType1;
56
- id: ItemIdentity;
57
- relationships: ItemRelationships<D>;
58
- meta: ItemMeta;
59
- attributes: ToItemAttributesInNestedResponse<D>;
60
- };
56
+ > = D extends ItemTypeDefinition
57
+ ? {
58
+ __itemTypeId?: D['itemTypeId'];
59
+ type: ItemType1;
60
+ id: ItemIdentity;
61
+ relationships: ItemRelationships<D>;
62
+ meta: ItemMeta;
63
+ attributes: ToItemAttributesInNestedResponse<D>;
64
+ }
65
+ : never;
61
66
 
62
67
  /* tslint:disable */
63
68
  /**