@datocms/cma-client 5.4.17 → 5.4.20

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.17', 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.20', 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
@@ -63,6 +63,35 @@ class Session extends BaseResource_js_1.default {
63
63
  body,
64
64
  });
65
65
  }
66
+ /**
67
+ * Destroy the current session
68
+ *
69
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
70
+ *
71
+ * @throws {ApiError}
72
+ * @throws {TimeoutError}
73
+ *
74
+ * @deprecated This API call is to be considered private and might change without notice
75
+ */
76
+ destroy() {
77
+ return this.rawDestroy();
78
+ }
79
+ /**
80
+ * Destroy the current session
81
+ *
82
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
83
+ *
84
+ * @throws {ApiError}
85
+ * @throws {TimeoutError}
86
+ *
87
+ * @deprecated This API call is to be considered private and might change without notice
88
+ */
89
+ rawDestroy() {
90
+ return this.client.request({
91
+ method: 'DELETE',
92
+ url: '/session',
93
+ });
94
+ }
66
95
  }
67
96
  exports.default = Session;
68
97
  Session.TYPE = 'session';
@@ -1 +1 @@
1
- {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../../../src/generated/resources/Session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAoD;AACpD,4EAAiD;AAIjD,MAAqB,OAAQ,SAAQ,yBAAY;IAG/C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAkC;QACvC,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,CAAC,oBAAoB,CAAkC,IAAI,EAAE;YAChE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC;YAC7C,aAAa,EAAE,EAAE;SAClB,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,KAAK,CAAC,uBAAuB,CAAqC,IAAI,CAAC,CACxE,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,IAAqC;QAErC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAwC;YAChE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;;AA3CH,0BA4CC;AA3CiB,YAAI,GAAG,SAAkB,CAAC"}
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../../../src/generated/resources/Session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAoD;AACpD,4EAAiD;AAIjD,MAAqB,OAAQ,SAAQ,yBAAY;IAG/C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAkC;QACvC,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,CAAC,oBAAoB,CAAkC,IAAI,EAAE;YAChE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC;YAC7C,aAAa,EAAE,EAAE;SAClB,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,KAAK,CAAC,uBAAuB,CAAqC,IAAI,CAAC,CACxE,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,IAAqC;QAErC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAwC;YAChE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO;YAC/B,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,UAAU;SAChB,CAAC,CAAC;IACL,CAAC;;AA1EH,0BA2EC;AA1EiB,YAAI,GAAG,SAAkB,CAAC"}
@@ -3423,7 +3423,7 @@ export type AccessTokenCreateSchema = {
3423
3423
  * Whether this API token can access the Content Management API
3424
3424
  */
3425
3425
  can_access_cma: boolean;
3426
- role: RoleData | null;
3426
+ role: RoleData;
3427
3427
  };
3428
3428
  /**
3429
3429
  * This interface was referenced by `AccessToken`'s JSON-Schema
@@ -3448,7 +3448,7 @@ export type AccessTokenUpdateSchema = {
3448
3448
  * Whether this API token can access the Content Management API
3449
3449
  */
3450
3450
  can_access_cma: boolean;
3451
- role: RoleData | null;
3451
+ role?: RoleData;
3452
3452
  };
3453
3453
  /**
3454
3454
  * DatoCMS account
@@ -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.17', 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.20', 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
@@ -3026,7 +3026,7 @@ export type AccessTokenCreateSchema = {
3026
3026
  * Role
3027
3027
  */
3028
3028
  role: {
3029
- data: RoleData | null;
3029
+ data: RoleData;
3030
3030
  };
3031
3031
  };
3032
3032
  };
@@ -3064,12 +3064,12 @@ export type AccessTokenUpdateSchema = {
3064
3064
  */
3065
3065
  can_access_cma: boolean;
3066
3066
  };
3067
- relationships: {
3067
+ relationships?: {
3068
3068
  /**
3069
3069
  * Role
3070
3070
  */
3071
3071
  role: {
3072
- data: RoleData | null;
3072
+ data: RoleData;
3073
3073
  };
3074
3074
  };
3075
3075
  };
@@ -25,4 +25,26 @@ export default class Session extends BaseResource {
25
25
  * @deprecated This API call is to be considered private and might change without notice
26
26
  */
27
27
  rawCreate(body: RawApiTypes.SessionCreateSchema): Promise<RawApiTypes.SessionCreateTargetSchema>;
28
+ /**
29
+ * Destroy the current session
30
+ *
31
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
32
+ *
33
+ * @throws {ApiError}
34
+ * @throws {TimeoutError}
35
+ *
36
+ * @deprecated This API call is to be considered private and might change without notice
37
+ */
38
+ destroy(): Promise<void>;
39
+ /**
40
+ * Destroy the current session
41
+ *
42
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
43
+ *
44
+ * @throws {ApiError}
45
+ * @throws {TimeoutError}
46
+ *
47
+ * @deprecated This API call is to be considered private and might change without notice
48
+ */
49
+ rawDestroy(): Promise<void>;
28
50
  }
@@ -35,6 +35,35 @@ export default class Session extends BaseResource {
35
35
  body,
36
36
  });
37
37
  }
38
+ /**
39
+ * Destroy the current session
40
+ *
41
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
42
+ *
43
+ * @throws {ApiError}
44
+ * @throws {TimeoutError}
45
+ *
46
+ * @deprecated This API call is to be considered private and might change without notice
47
+ */
48
+ destroy() {
49
+ return this.rawDestroy();
50
+ }
51
+ /**
52
+ * Destroy the current session
53
+ *
54
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
55
+ *
56
+ * @throws {ApiError}
57
+ * @throws {TimeoutError}
58
+ *
59
+ * @deprecated This API call is to be considered private and might change without notice
60
+ */
61
+ rawDestroy() {
62
+ return this.client.request({
63
+ method: 'DELETE',
64
+ url: '/session',
65
+ });
66
+ }
38
67
  }
39
68
  Session.TYPE = 'session';
40
69
  //# sourceMappingURL=Session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../../../src/generated/resources/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAY;IAG/C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAkC;QACvC,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,CAAC,oBAAoB,CAAkC,IAAI,EAAE;YAChE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC;YAC7C,aAAa,EAAE,EAAE;SAClB,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,KAAK,CAAC,uBAAuB,CAAqC,IAAI,CAAC,CACxE,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,IAAqC;QAErC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAwC;YAChE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;;AA1Ce,YAAI,GAAG,SAAkB,CAAC"}
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../../../src/generated/resources/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAY;IAG/C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAkC;QACvC,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,CAAC,oBAAoB,CAAkC,IAAI,EAAE;YAChE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC;YAC7C,aAAa,EAAE,EAAE;SAClB,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,KAAK,CAAC,uBAAuB,CAAqC,IAAI,CAAC,CACxE,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,IAAqC;QAErC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAwC;YAChE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO;YAC/B,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,UAAU;SAChB,CAAC,CAAC;IACL,CAAC;;AAzEe,YAAI,GAAG,SAAkB,CAAC"}
@@ -3423,7 +3423,7 @@ export type AccessTokenCreateSchema = {
3423
3423
  * Whether this API token can access the Content Management API
3424
3424
  */
3425
3425
  can_access_cma: boolean;
3426
- role: RoleData | null;
3426
+ role: RoleData;
3427
3427
  };
3428
3428
  /**
3429
3429
  * This interface was referenced by `AccessToken`'s JSON-Schema
@@ -3448,7 +3448,7 @@ export type AccessTokenUpdateSchema = {
3448
3448
  * Whether this API token can access the Content Management API
3449
3449
  */
3450
3450
  can_access_cma: boolean;
3451
- role: RoleData | null;
3451
+ role?: RoleData;
3452
3452
  };
3453
3453
  /**
3454
3454
  * DatoCMS account
@@ -3026,7 +3026,7 @@ export type AccessTokenCreateSchema = {
3026
3026
  * Role
3027
3027
  */
3028
3028
  role: {
3029
- data: RoleData | null;
3029
+ data: RoleData;
3030
3030
  };
3031
3031
  };
3032
3032
  };
@@ -3064,12 +3064,12 @@ export type AccessTokenUpdateSchema = {
3064
3064
  */
3065
3065
  can_access_cma: boolean;
3066
3066
  };
3067
- relationships: {
3067
+ relationships?: {
3068
3068
  /**
3069
3069
  * Role
3070
3070
  */
3071
3071
  role: {
3072
- data: RoleData | null;
3072
+ data: RoleData;
3073
3073
  };
3074
3074
  };
3075
3075
  };
@@ -25,4 +25,26 @@ export default class Session extends BaseResource {
25
25
  * @deprecated This API call is to be considered private and might change without notice
26
26
  */
27
27
  rawCreate(body: RawApiTypes.SessionCreateSchema): Promise<RawApiTypes.SessionCreateTargetSchema>;
28
+ /**
29
+ * Destroy the current session
30
+ *
31
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
32
+ *
33
+ * @throws {ApiError}
34
+ * @throws {TimeoutError}
35
+ *
36
+ * @deprecated This API call is to be considered private and might change without notice
37
+ */
38
+ destroy(): Promise<void>;
39
+ /**
40
+ * Destroy the current session
41
+ *
42
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
43
+ *
44
+ * @throws {ApiError}
45
+ * @throws {TimeoutError}
46
+ *
47
+ * @deprecated This API call is to be considered private and might change without notice
48
+ */
49
+ rawDestroy(): Promise<void>;
28
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "5.4.17",
3
+ "version": "5.4.20",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
@@ -42,8 +42,8 @@
42
42
  "uuid": "^9.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@datocms/dashboard-client": "^5.4.9",
45
+ "@datocms/dashboard-client": "^5.4.20",
46
46
  "@types/uuid": "^9.0.7"
47
47
  },
48
- "gitHead": "4117c106128cbe9e277806fd3481854c9b116f77"
48
+ "gitHead": "3bf94319989323e8c035e96ba952477b141b30f3"
49
49
  }
package/resources.json CHANGED
@@ -1649,6 +1649,22 @@
1649
1649
  "deprecated": "This API call is to be considered private and might change without notice",
1650
1650
  "name": "create",
1651
1651
  "rawName": "rawCreate"
1652
+ },
1653
+ {
1654
+ "returnsItem": false,
1655
+ "requestBodyRequiresItem": false,
1656
+ "offersNestedItemsOptionInQueryParams": false,
1657
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/session/destroy",
1658
+ "rel": "destroy",
1659
+ "urlTemplate": "/session",
1660
+ "method": "DELETE",
1661
+ "comment": "Destroy the current session",
1662
+ "urlPlaceholders": [],
1663
+ "optionalRequestBody": false,
1664
+ "queryParamsRequired": false,
1665
+ "deprecated": "This API call is to be considered private and might change without notice",
1666
+ "name": "destroy",
1667
+ "rawName": "rawDestroy"
1652
1668
  }
1653
1669
  ],
1654
1670
  "namespace": "session",
@@ -3733,7 +3733,7 @@ export type AccessTokenCreateSchema = {
3733
3733
  * Whether this API token can access the Content Management API
3734
3734
  */
3735
3735
  can_access_cma: boolean;
3736
- role: RoleData | null;
3736
+ role: RoleData;
3737
3737
  };
3738
3738
  /**
3739
3739
  * This interface was referenced by `AccessToken`'s JSON-Schema
@@ -3758,7 +3758,7 @@ export type AccessTokenUpdateSchema = {
3758
3758
  * Whether this API token can access the Content Management API
3759
3759
  */
3760
3760
  can_access_cma: boolean;
3761
- role: RoleData | null;
3761
+ role?: RoleData;
3762
3762
  };
3763
3763
  /**
3764
3764
  * DatoCMS account
@@ -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.17',
154
+ userAgent: '@datocms/cma-client v5.4.20',
155
155
  baseUrl: this.baseUrl,
156
156
  preCallStack: new Error().stack,
157
157
  extraHeaders: {
@@ -3260,7 +3260,7 @@ export type AccessTokenCreateSchema = {
3260
3260
  * Role
3261
3261
  */
3262
3262
  role: {
3263
- data: RoleData | null;
3263
+ data: RoleData;
3264
3264
  };
3265
3265
  };
3266
3266
  };
@@ -3298,12 +3298,12 @@ export type AccessTokenUpdateSchema = {
3298
3298
  */
3299
3299
  can_access_cma: boolean;
3300
3300
  };
3301
- relationships: {
3301
+ relationships?: {
3302
3302
  /**
3303
3303
  * Role
3304
3304
  */
3305
3305
  role: {
3306
- data: RoleData | null;
3306
+ data: RoleData;
3307
3307
  };
3308
3308
  };
3309
3309
  };
@@ -47,4 +47,35 @@ export default class Session extends BaseResource {
47
47
  body,
48
48
  });
49
49
  }
50
+
51
+ /**
52
+ * Destroy the current session
53
+ *
54
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
55
+ *
56
+ * @throws {ApiError}
57
+ * @throws {TimeoutError}
58
+ *
59
+ * @deprecated This API call is to be considered private and might change without notice
60
+ */
61
+ destroy() {
62
+ return this.rawDestroy();
63
+ }
64
+
65
+ /**
66
+ * Destroy the current session
67
+ *
68
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/session/destroy
69
+ *
70
+ * @throws {ApiError}
71
+ * @throws {TimeoutError}
72
+ *
73
+ * @deprecated This API call is to be considered private and might change without notice
74
+ */
75
+ rawDestroy(): Promise<void> {
76
+ return this.client.request<void>({
77
+ method: 'DELETE',
78
+ url: '/session',
79
+ });
80
+ }
50
81
  }