@datocms/cma-client 1.2.12-alpha.0 → 1.2.12-alpha.2

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.
package/README.md CHANGED
@@ -16,4 +16,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/datocm
16
16
 
17
17
  ## License
18
18
 
19
- The package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
19
+ The package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -127,7 +127,7 @@ var Client = /** @class */ (function () {
127
127
  });
128
128
  Client.prototype.request = function (options) {
129
129
  var _this = this;
130
- return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v1.2.12-alpha.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
130
+ return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v1.2.12-alpha.2', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
131
131
  ? { 'X-Environment': this.config.environment }
132
132
  : {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
133
133
  return _this.jobResultsFetcher
@@ -56,13 +56,13 @@ var Environment = /** @class */ (function (_super) {
56
56
  * @throws {ApiError}
57
57
  * @throws {TimeoutError}
58
58
  */
59
- Environment.prototype.fork = function (environmentId, body) {
59
+ Environment.prototype.fork = function (environmentId, body, queryParams) {
60
60
  return this.rawFork(Utils.toId(environmentId), Utils.serializeRequestBody(body, {
61
61
  id: Utils.toId(environmentId),
62
62
  type: 'environment',
63
63
  attributes: [],
64
64
  relationships: [],
65
- })).then(function (body) {
65
+ }), queryParams).then(function (body) {
66
66
  return Utils.deserializeResponseBody(body);
67
67
  });
68
68
  };
@@ -74,11 +74,12 @@ var Environment = /** @class */ (function (_super) {
74
74
  * @throws {ApiError}
75
75
  * @throws {TimeoutError}
76
76
  */
77
- Environment.prototype.rawFork = function (environmentId, body) {
77
+ Environment.prototype.rawFork = function (environmentId, body, queryParams) {
78
78
  return this.client.request({
79
79
  method: 'POST',
80
80
  url: "/environments/".concat(environmentId, "/fork"),
81
81
  body: body,
82
+ queryParams: queryParams,
82
83
  });
83
84
  };
84
85
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../../../src/generated/resources/Environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAoD;AAGpD,oEAA8C;AAE9C;IAAyC,+BAAY;IAArD;;IAkLA,CAAC;IA/KC;;;;;;;OAOG;IACH,0BAAI,GAAJ,UACE,aAAyD,EACzD,IAA6C;QAE7C,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EACzB,KAAK,CAAC,oBAAoB,CAAoC,IAAI,EAAE;YAClE,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;YAC7B,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE;SAClB,CAAC,CACH,CAAC,IAAI,CAAC,UAAC,IAAI;YACV,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UACE,aAAqB,EACrB,IAAuC;QAEvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuC;YAC/D,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,wBAAiB,aAAa,UAAO;YAC1C,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,aAAyD;QAC/D,OAAO,IA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,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAC1D,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,gCAAU,GAAV,UACE,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0C;YAClE,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,wBAAiB,aAAa,CAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAhLe,gBAAI,GAAkB,aAAa,CAAC;IAiLtD,kBAAC;CAAA,AAlLD,CAAyC,sBAAY,GAkLpD;kBAlLoB,WAAW"}
1
+ {"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../../../src/generated/resources/Environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAoD;AAGpD,oEAA8C;AAE9C;IAAyC,+BAAY;IAArD;;IAsLA,CAAC;IAnLC;;;;;;;OAOG;IACH,0BAAI,GAAJ,UACE,aAAyD,EACzD,IAA6C,EAC7C,WAAyD;QAEzD,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EACzB,KAAK,CAAC,oBAAoB,CAAoC,IAAI,EAAE;YAClE,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;YAC7B,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE;SAClB,CAAC,EACF,WAAW,CACZ,CAAC,IAAI,CAAC,UAAC,IAAI;YACV,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UACE,aAAqB,EACrB,IAAuC,EACvC,WAAmD;QAEnD,OAAO,IAAI,CAAC,MAAM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,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0C;YAClE,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,wBAAiB,aAAa,CAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,aAAyD;QAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAC1D,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,gCAAU,GAAV,UACE,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0C;YAClE,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,wBAAiB,aAAa,CAAE;SACtC,CAAC,CAAC;IACL,CAAC;IApLe,gBAAI,GAAkB,aAAa,CAAC;IAqLtD,kBAAC;CAAA,AAtLD,CAAyC,sBAAY,GAsLpD;kBAtLoB,WAAW"}
@@ -101,7 +101,7 @@ var Client = /** @class */ (function () {
101
101
  });
102
102
  Client.prototype.request = function (options) {
103
103
  var _this = this;
104
- return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v1.2.12-alpha.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
104
+ return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v1.2.12-alpha.2', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
105
105
  ? { 'X-Environment': this.config.environment }
106
106
  : {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
107
107
  return _this.jobResultsFetcher
@@ -926,6 +926,25 @@ export declare type SearchResultInstancesHrefSchema = {
926
926
  * via the `definition` "type".
927
927
  */
928
928
  export declare type EnvironmentType = 'environment';
929
+ /**
930
+ * This interface was referenced by `Environment`'s JSON-Schema
931
+ * via the `fork.hrefSchema` link.
932
+ */
933
+ export declare type EnvironmentForkHrefSchema = {
934
+ /**
935
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
936
+ */
937
+ immediate_return?: string;
938
+ /**
939
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
940
+ */
941
+ fast?: string;
942
+ /**
943
+ * Force the fork, even if there are collaborators editing some records
944
+ */
945
+ force?: boolean;
946
+ [k: string]: unknown;
947
+ };
929
948
  /**
930
949
  * JSON API type field
931
950
  *
@@ -7340,6 +7359,14 @@ export declare type EnvironmentMeta = {
7340
7359
  * Status of the environment
7341
7360
  */
7342
7361
  status: 'creating' | 'ready' | 'destroying';
7362
+ /**
7363
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7364
+ */
7365
+ fork_completion_percentage?: number;
7366
+ /**
7367
+ * Is this environment the in read-only mode because of a fast-fork?
7368
+ */
7369
+ read_only_mode: boolean;
7343
7370
  /**
7344
7371
  * Date of creation
7345
7372
  */
@@ -7355,7 +7382,7 @@ export declare type EnvironmentMeta = {
7355
7382
  /**
7356
7383
  * ID of the environment that's been forked to generate this one
7357
7384
  */
7358
- forked_from?: string | null;
7385
+ forked_from: string | null;
7359
7386
  };
7360
7387
  /**
7361
7388
  * JSON API data
@@ -1111,6 +1111,25 @@ export declare type EnvironmentType = 'environment';
1111
1111
  * via the `fork.targetSchema` link.
1112
1112
  */
1113
1113
  export declare type EnvironmentForkTargetSchema = Job | Environment;
1114
+ /**
1115
+ * This interface was referenced by `Environment`'s JSON-Schema
1116
+ * via the `fork.hrefSchema` link.
1117
+ */
1118
+ export declare type EnvironmentForkHrefSchema = {
1119
+ /**
1120
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
1121
+ */
1122
+ immediate_return?: string;
1123
+ /**
1124
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
1125
+ */
1126
+ fast?: string;
1127
+ /**
1128
+ * Force the fork, even if there are collaborators editing some records
1129
+ */
1130
+ force?: boolean;
1131
+ [k: string]: unknown;
1132
+ };
1114
1133
  /**
1115
1134
  * This interface was referenced by `Environment`'s JSON-Schema
1116
1135
  * via the `instances.targetSchema` link.
@@ -7368,6 +7387,14 @@ export declare type EnvironmentMeta = {
7368
7387
  * Status of the environment
7369
7388
  */
7370
7389
  status: 'creating' | 'ready' | 'destroying';
7390
+ /**
7391
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7392
+ */
7393
+ fork_completion_percentage?: number;
7394
+ /**
7395
+ * Is this environment the in read-only mode because of a fast-fork?
7396
+ */
7397
+ read_only_mode: boolean;
7371
7398
  /**
7372
7399
  * Date of creation
7373
7400
  */
@@ -7383,7 +7410,7 @@ export declare type EnvironmentMeta = {
7383
7410
  /**
7384
7411
  * ID of the environment that's been forked to generate this one
7385
7412
  */
7386
- forked_from?: string | null;
7413
+ forked_from: string | null;
7387
7414
  };
7388
7415
  /**
7389
7416
  * JSON API data
@@ -11,7 +11,7 @@ export default class Environment extends BaseResource {
11
11
  * @throws {ApiError}
12
12
  * @throws {TimeoutError}
13
13
  */
14
- fork(environmentId: string | SimpleSchemaTypes.EnvironmentData, body: SimpleSchemaTypes.EnvironmentForkSchema): Promise<SimpleSchemaTypes.Environment>;
14
+ fork(environmentId: string | SimpleSchemaTypes.EnvironmentData, body: SimpleSchemaTypes.EnvironmentForkSchema, queryParams?: SimpleSchemaTypes.EnvironmentForkHrefSchema): Promise<SimpleSchemaTypes.Environment>;
15
15
  /**
16
16
  * Fork an existing environment
17
17
  *
@@ -20,7 +20,7 @@ export default class Environment extends BaseResource {
20
20
  * @throws {ApiError}
21
21
  * @throws {TimeoutError}
22
22
  */
23
- rawFork(environmentId: string, body: SchemaTypes.EnvironmentForkSchema): Promise<SchemaTypes.EnvironmentForkJobSchema>;
23
+ rawFork(environmentId: string, body: SchemaTypes.EnvironmentForkSchema, queryParams?: SchemaTypes.EnvironmentForkHrefSchema): Promise<SchemaTypes.EnvironmentForkJobSchema>;
24
24
  /**
25
25
  * Promote an environment to primary
26
26
  *
@@ -28,13 +28,13 @@ var Environment = /** @class */ (function (_super) {
28
28
  * @throws {ApiError}
29
29
  * @throws {TimeoutError}
30
30
  */
31
- Environment.prototype.fork = function (environmentId, body) {
31
+ Environment.prototype.fork = function (environmentId, body, queryParams) {
32
32
  return this.rawFork(Utils.toId(environmentId), Utils.serializeRequestBody(body, {
33
33
  id: Utils.toId(environmentId),
34
34
  type: 'environment',
35
35
  attributes: [],
36
36
  relationships: [],
37
- })).then(function (body) {
37
+ }), queryParams).then(function (body) {
38
38
  return Utils.deserializeResponseBody(body);
39
39
  });
40
40
  };
@@ -46,11 +46,12 @@ var Environment = /** @class */ (function (_super) {
46
46
  * @throws {ApiError}
47
47
  * @throws {TimeoutError}
48
48
  */
49
- Environment.prototype.rawFork = function (environmentId, body) {
49
+ Environment.prototype.rawFork = function (environmentId, body, queryParams) {
50
50
  return this.client.request({
51
51
  method: 'POST',
52
52
  url: "/environments/".concat(environmentId, "/fork"),
53
53
  body: body,
54
+ queryParams: queryParams,
54
55
  });
55
56
  };
56
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../../../src/generated/resources/Environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAGpD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;IAAyC,+BAAY;IAArD;;IAkLA,CAAC;IA/KC;;;;;;;OAOG;IACH,0BAAI,GAAJ,UACE,aAAyD,EACzD,IAA6C;QAE7C,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EACzB,KAAK,CAAC,oBAAoB,CAAoC,IAAI,EAAE;YAClE,EAAE,EAAE,KAAK,CAAC,IAAI,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;;;;;;OAOG;IACH,0BAAI,GAAJ,UAAK,aAAyD;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YACvD,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UACE,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0C;YAClE,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,wBAAiB,aAAa,CAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,aAAyD;QAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAC1D,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,gCAAU,GAAV,UACE,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0C;YAClE,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,wBAAiB,aAAa,CAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAhLe,gBAAI,GAAkB,aAAa,CAAC;IAiLtD,kBAAC;CAAA,AAlLD,CAAyC,YAAY,GAkLpD;eAlLoB,WAAW"}
1
+ {"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../../../src/generated/resources/Environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAGpD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;IAAyC,+BAAY;IAArD;;IAsLA,CAAC;IAnLC;;;;;;;OAOG;IACH,0BAAI,GAAJ,UACE,a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esHrefSchema = {
926
926
  * via the `definition` "type".
927
927
  */
928
928
  export declare type EnvironmentType = 'environment';
929
+ /**
930
+ * This interface was referenced by `Environment`'s JSON-Schema
931
+ * via the `fork.hrefSchema` link.
932
+ */
933
+ export declare type EnvironmentForkHrefSchema = {
934
+ /**
935
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
936
+ */
937
+ immediate_return?: string;
938
+ /**
939
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
940
+ */
941
+ fast?: string;
942
+ /**
943
+ * Force the fork, even if there are collaborators editing some records
944
+ */
945
+ force?: boolean;
946
+ [k: string]: unknown;
947
+ };
929
948
  /**
930
949
  * JSON API type field
931
950
  *
@@ -7340,6 +7359,14 @@ export declare type EnvironmentMeta = {
7340
7359
  * Status of the environment
7341
7360
  */
7342
7361
  status: 'creating' | 'ready' | 'destroying';
7362
+ /**
7363
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7364
+ */
7365
+ fork_completion_percentage?: number;
7366
+ /**
7367
+ * Is this environment the in read-only mode because of a fast-fork?
7368
+ */
7369
+ read_only_mode: boolean;
7343
7370
  /**
7344
7371
  * Date of creation
7345
7372
  */
@@ -7355,7 +7382,7 @@ export declare type EnvironmentMeta = {
7355
7382
  /**
7356
7383
  * ID of the environment that's been forked to generate this one
7357
7384
  */
7358
- forked_from?: string | null;
7385
+ forked_from: string | null;
7359
7386
  };
7360
7387
  /**
7361
7388
  * JSON API data
@@ -1111,6 +1111,25 @@ export declare type EnvironmentType = 'environment';
1111
1111
  * via the `fork.targetSchema` link.
1112
1112
  */
1113
1113
  export declare type EnvironmentForkTargetSchema = Job | Environment;
1114
+ /**
1115
+ * This interface was referenced by `Environment`'s JSON-Schema
1116
+ * via the `fork.hrefSchema` link.
1117
+ */
1118
+ export declare type EnvironmentForkHrefSchema = {
1119
+ /**
1120
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
1121
+ */
1122
+ immediate_return?: string;
1123
+ /**
1124
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
1125
+ */
1126
+ fast?: string;
1127
+ /**
1128
+ * Force the fork, even if there are collaborators editing some records
1129
+ */
1130
+ force?: boolean;
1131
+ [k: string]: unknown;
1132
+ };
1114
1133
  /**
1115
1134
  * This interface was referenced by `Environment`'s JSON-Schema
1116
1135
  * via the `instances.targetSchema` link.
@@ -7368,6 +7387,14 @@ export declare type EnvironmentMeta = {
7368
7387
  * Status of the environment
7369
7388
  */
7370
7389
  status: 'creating' | 'ready' | 'destroying';
7390
+ /**
7391
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7392
+ */
7393
+ fork_completion_percentage?: number;
7394
+ /**
7395
+ * Is this environment the in read-only mode because of a fast-fork?
7396
+ */
7397
+ read_only_mode: boolean;
7371
7398
  /**
7372
7399
  * Date of creation
7373
7400
  */
@@ -7383,7 +7410,7 @@ export declare type EnvironmentMeta = {
7383
7410
  /**
7384
7411
  * ID of the environment that's been forked to generate this one
7385
7412
  */
7386
- forked_from?: string | null;
7413
+ forked_from: string | null;
7387
7414
  };
7388
7415
  /**
7389
7416
  * JSON API data
@@ -11,7 +11,7 @@ export default class Environment extends BaseResource {
11
11
  * @throws {ApiError}
12
12
  * @throws {TimeoutError}
13
13
  */
14
- fork(environmentId: string | SimpleSchemaTypes.EnvironmentData, body: SimpleSchemaTypes.EnvironmentForkSchema): Promise<SimpleSchemaTypes.Environment>;
14
+ fork(environmentId: string | SimpleSchemaTypes.EnvironmentData, body: SimpleSchemaTypes.EnvironmentForkSchema, queryParams?: SimpleSchemaTypes.EnvironmentForkHrefSchema): Promise<SimpleSchemaTypes.Environment>;
15
15
  /**
16
16
  * Fork an existing environment
17
17
  *
@@ -20,7 +20,7 @@ export default class Environment extends BaseResource {
20
20
  * @throws {ApiError}
21
21
  * @throws {TimeoutError}
22
22
  */
23
- rawFork(environmentId: string, body: SchemaTypes.EnvironmentForkSchema): Promise<SchemaTypes.EnvironmentForkJobSchema>;
23
+ rawFork(environmentId: string, body: SchemaTypes.EnvironmentForkSchema, queryParams?: SchemaTypes.EnvironmentForkHrefSchema): Promise<SchemaTypes.EnvironmentForkJobSchema>;
24
24
  /**
25
25
  * Promote an environment to primary
26
26
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "1.2.12-alpha.0",
3
+ "version": "1.2.12-alpha.2",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "@datocms/dashboard-client": "^1.2.9"
44
44
  },
45
- "gitHead": "de4b8c10f3e88b6a7acaf122150cae7990553b37"
45
+ "gitHead": "b2bce0a942534f22f8207635b5681749a2be70e3"
46
46
  }
package/resources.json CHANGED
@@ -2097,6 +2097,7 @@
2097
2097
  "attributes": [],
2098
2098
  "relationships": []
2099
2099
  },
2100
+ "queryParamsType": "EnvironmentForkHrefSchema",
2100
2101
  "queryParamsRequired": false,
2101
2102
  "responseType": "EnvironmentForkJobSchema",
2102
2103
  "name": "fork",
@@ -133,7 +133,7 @@ export class Client {
133
133
  ...this.config,
134
134
  ...options,
135
135
  logFn: this.config.logFn || console.log,
136
- userAgent: '@datocms/cma-client v1.2.12-alpha.0',
136
+ userAgent: '@datocms/cma-client v1.2.12-alpha.2',
137
137
  baseUrl: this.baseUrl,
138
138
  preCallStack: new Error().stack,
139
139
  extraHeaders: {
@@ -928,6 +928,25 @@ export type SearchResultInstancesHrefSchema = {
928
928
  * via the `definition` "type".
929
929
  */
930
930
  export type EnvironmentType = 'environment';
931
+ /**
932
+ * This interface was referenced by `Environment`'s JSON-Schema
933
+ * via the `fork.hrefSchema` link.
934
+ */
935
+ export type EnvironmentForkHrefSchema = {
936
+ /**
937
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
938
+ */
939
+ immediate_return?: string;
940
+ /**
941
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
942
+ */
943
+ fast?: string;
944
+ /**
945
+ * Force the fork, even if there are collaborators editing some records
946
+ */
947
+ force?: boolean;
948
+ [k: string]: unknown;
949
+ };
931
950
  /**
932
951
  * JSON API type field
933
952
  *
@@ -7916,6 +7935,14 @@ export type EnvironmentMeta = {
7916
7935
  * Status of the environment
7917
7936
  */
7918
7937
  status: 'creating' | 'ready' | 'destroying';
7938
+ /**
7939
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7940
+ */
7941
+ fork_completion_percentage?: number;
7942
+ /**
7943
+ * Is this environment the in read-only mode because of a fast-fork?
7944
+ */
7945
+ read_only_mode: boolean;
7919
7946
  /**
7920
7947
  * Date of creation
7921
7948
  */
@@ -7931,7 +7958,7 @@ export type EnvironmentMeta = {
7931
7958
  /**
7932
7959
  * ID of the environment that's been forked to generate this one
7933
7960
  */
7934
- forked_from?: string | null;
7961
+ forked_from: string | null;
7935
7962
  };
7936
7963
 
7937
7964
  /**
@@ -1113,6 +1113,25 @@ export type EnvironmentType = 'environment';
1113
1113
  * via the `fork.targetSchema` link.
1114
1114
  */
1115
1115
  export type EnvironmentForkTargetSchema = Job | Environment;
1116
+ /**
1117
+ * This interface was referenced by `Environment`'s JSON-Schema
1118
+ * via the `fork.hrefSchema` link.
1119
+ */
1120
+ export type EnvironmentForkHrefSchema = {
1121
+ /**
1122
+ * Whether the call should immediately return a pending environment, or wait for the completion of the fork
1123
+ */
1124
+ immediate_return?: string;
1125
+ /**
1126
+ * Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process
1127
+ */
1128
+ fast?: string;
1129
+ /**
1130
+ * Force the fork, even if there are collaborators editing some records
1131
+ */
1132
+ force?: boolean;
1133
+ [k: string]: unknown;
1134
+ };
1116
1135
  /**
1117
1136
  * This interface was referenced by `Environment`'s JSON-Schema
1118
1137
  * via the `instances.targetSchema` link.
@@ -7922,6 +7941,14 @@ export type EnvironmentMeta = {
7922
7941
  * Status of the environment
7923
7942
  */
7924
7943
  status: 'creating' | 'ready' | 'destroying';
7944
+ /**
7945
+ * The completion percentage of the fork operation (only present if the status is `creating`)
7946
+ */
7947
+ fork_completion_percentage?: number;
7948
+ /**
7949
+ * Is this environment the in read-only mode because of a fast-fork?
7950
+ */
7951
+ read_only_mode: boolean;
7925
7952
  /**
7926
7953
  * Date of creation
7927
7954
  */
@@ -7937,7 +7964,7 @@ export type EnvironmentMeta = {
7937
7964
  /**
7938
7965
  * ID of the environment that's been forked to generate this one
7939
7966
  */
7940
- forked_from?: string | null;
7967
+ forked_from: string | null;
7941
7968
  };
7942
7969
 
7943
7970
  /**
@@ -17,6 +17,7 @@ export default class Environment extends BaseResource {
17
17
  fork(
18
18
  environmentId: string | SimpleSchemaTypes.EnvironmentData,
19
19
  body: SimpleSchemaTypes.EnvironmentForkSchema,
20
+ queryParams?: SimpleSchemaTypes.EnvironmentForkHrefSchema,
20
21
  ) {
21
22
  return this.rawFork(
22
23
  Utils.toId(environmentId),
@@ -26,6 +27,7 @@ export default class Environment extends BaseResource {
26
27
  attributes: [],
27
28
  relationships: [],
28
29
  }),
30
+ queryParams,
29
31
  ).then((body) =>
30
32
  Utils.deserializeResponseBody<SimpleSchemaTypes.EnvironmentForkJobSchema>(
31
33
  body,
@@ -44,11 +46,13 @@ export default class Environment extends BaseResource {
44
46
  rawFork(
45
47
  environmentId: string,
46
48
  body: SchemaTypes.EnvironmentForkSchema,
49
+ queryParams?: SchemaTypes.EnvironmentForkHrefSchema,
47
50
  ): Promise<SchemaTypes.EnvironmentForkJobSchema> {
48
51
  return this.client.request<SchemaTypes.EnvironmentForkJobSchema>({
49
52
  method: 'POST',
50
53
  url: `/environments/${environmentId}/fork`,
51
54
  body,
55
+ queryParams,
52
56
  });
53
57
  }
54
58