@cosmotech/api-ts 5.0.0 → 5.1.0-rc1

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/base.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Cosmo Tech Platform API
5
5
  * Cosmo Tech Platform API
6
6
  *
7
- * The version of the OpenAPI document: 5.0.0
7
+ * The version of the OpenAPI document: 5.1.0-rc1
8
8
  * Contact: platform@cosmotech.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/common.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Cosmo Tech Platform API
5
5
  * Cosmo Tech Platform API
6
6
  *
7
- * The version of the OpenAPI document: 5.0.0
7
+ * The version of the OpenAPI document: 5.1.0-rc1
8
8
  * Contact: platform@cosmotech.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -66,7 +66,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
66
66
  function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
67
67
  if (parameter == null) return;
68
68
  if (typeof parameter === "object") {
69
- if (Array.isArray(parameter)) {
69
+ if (Array.isArray(parameter) || parameter instanceof Set) {
70
70
  (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
71
71
  }
72
72
  else {
@@ -91,13 +91,27 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
91
91
  url.search = searchParams.toString();
92
92
  }
93
93
 
94
+ /**
95
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
96
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
97
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
98
+ */
99
+ // @ts-ignore
100
+ export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
101
+ if (value instanceof Set) {
102
+ return Array.from(value);
103
+ } else {
104
+ return value;
105
+ }
106
+ }
107
+
94
108
  export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
95
109
  const nonString = typeof value !== 'string';
96
110
  const needsSerialization = nonString && configuration && configuration.isJsonMime
97
111
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
98
112
  : nonString;
99
113
  return needsSerialization
100
- ? JSON.stringify(value !== undefined ? value : {})
114
+ ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
101
115
  : (value || "");
102
116
  }
103
117
 
package/configuration.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Cosmo Tech Platform API
4
4
  * Cosmo Tech Platform API
5
5
  *
6
- * The version of the OpenAPI document: 5.0.0
6
+ * The version of the OpenAPI document: 5.1.0-rc1
7
7
  * Contact: platform@cosmotech.com
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -115,7 +115,7 @@ export class Configuration {
115
115
  * @return True if the given MIME is JSON, false otherwise.
116
116
  */
117
117
  public isJsonMime(mime: string): boolean {
118
- const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
119
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
118
+ const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
119
+ return mime !== null && jsonMime.test(mime);
120
120
  }
121
121
  }
package/dist/api.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Cosmo Tech Platform API
3
3
  * Cosmo Tech Platform API
4
4
  *
5
- * The version of the OpenAPI document: 5.0.0
5
+ * The version of the OpenAPI document: 5.1.0-rc1
6
6
  * Contact: platform@cosmotech.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1100,6 +1100,7 @@ export interface Runner {
1100
1100
  * last run info from current runner
1101
1101
  */
1102
1102
  'lastRunInfo': LastRunInfo;
1103
+ 'status': RunnerStatus;
1103
1104
  'validationStatus': RunnerValidationStatus;
1104
1105
  'security': RunnerSecurity;
1105
1106
  }
@@ -1246,6 +1247,14 @@ export interface RunnerSecurity {
1246
1247
  */
1247
1248
  'accessControlList': Array<RunnerAccessControl>;
1248
1249
  }
1250
+ /**
1251
+ * the status of the runner
1252
+ */
1253
+ export declare const RunnerStatus: {
1254
+ readonly Ok: "Ok";
1255
+ readonly Archived: "Archived";
1256
+ };
1257
+ export type RunnerStatus = typeof RunnerStatus[keyof typeof RunnerStatus];
1249
1258
  /**
1250
1259
  * Request object for updating a runner
1251
1260
  */
@@ -1292,6 +1301,7 @@ export interface RunnerUpdateRequest {
1292
1301
  * the Solution Run Template name associated with this Runner
1293
1302
  */
1294
1303
  'runTemplateName'?: string;
1304
+ 'validationStatus'?: RunnerValidationStatus;
1295
1305
  }
1296
1306
  /**
1297
1307
  * the validation status of the runner
@@ -1564,10 +1574,6 @@ export interface Workspace {
1564
1574
  'additionalData'?: {
1565
1575
  [key: string]: any;
1566
1576
  };
1567
- /**
1568
- * Activate the copy of dataset on scenario creation, meaning that each scenario created in this workspace will make this copy. when false, scenario use directly the dataset specified.
1569
- */
1570
- 'datasetCopy'?: boolean;
1571
1577
  'security': WorkspaceSecurity;
1572
1578
  }
1573
1579
  /**
@@ -1614,10 +1620,6 @@ export interface WorkspaceCreateRequest {
1614
1620
  'additionalData'?: {
1615
1621
  [key: string]: any;
1616
1622
  };
1617
- /**
1618
- * Activate the copy of dataset on scenario creation
1619
- */
1620
- 'datasetCopy'?: boolean;
1621
1623
  'security'?: WorkspaceSecurity;
1622
1624
  }
1623
1625
  export interface WorkspaceEditInfo {
@@ -1707,10 +1709,6 @@ export interface WorkspaceUpdateRequest {
1707
1709
  'additionalData'?: {
1708
1710
  [key: string]: any;
1709
1711
  };
1710
- /**
1711
- * Activate the copy of dataset on scenario creation
1712
- */
1713
- 'datasetCopy'?: boolean;
1714
1712
  }
1715
1713
  /**
1716
1714
  * DatasetApi - axios parameter creator