@teemill/gtins 0.7.2 → 0.8.0

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.
@@ -1 +1 @@
1
- 7.21.0
1
+ 7.25.0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @teemill/gtins@0.7.2
1
+ ## @teemill/gtins@0.8.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @teemill/gtins@0.7.2 --save
39
+ npm install @teemill/gtins@0.8.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
package/api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -38,6 +38,10 @@ export interface GTIN {
38
38
  * The GTIN
39
39
  */
40
40
  'number': string;
41
+ /**
42
+ * Whether this GTIN can be assigned to another variant. False when retired.
43
+ */
44
+ 'recyclable': boolean;
41
45
  /**
42
46
  * A reference to the resource location
43
47
  */
@@ -81,7 +85,7 @@ export const GTINsApiAxiosParamCreator = function (configuration?: Configuration
81
85
  // verify required parameter 'gtin' is not null or undefined
82
86
  assertParamExists('assignGtin', 'gtin', gtin)
83
87
  const localVarPath = `/v1/gtins/{gtin}/assign`
84
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
88
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
85
89
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
86
90
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
87
91
  let baseOptions;
@@ -180,7 +184,7 @@ export const GTINsApiAxiosParamCreator = function (configuration?: Configuration
180
184
  // verify required parameter 'gtin' is not null or undefined
181
185
  assertParamExists('getGtin', 'gtin', gtin)
182
186
  const localVarPath = `/v1/gtins/{gtin}`
183
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
187
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
184
188
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
185
189
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
186
190
  let baseOptions;
@@ -334,7 +338,7 @@ export const GTINsApiAxiosParamCreator = function (configuration?: Configuration
334
338
  // verify required parameter 'gtin' is not null or undefined
335
339
  assertParamExists('unassignGtin', 'gtin', gtin)
336
340
  const localVarPath = `/v1/gtins/{gtin}/unassign`
337
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
341
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
338
342
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
339
343
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
340
344
  let baseOptions;
package/base.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
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
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -86,7 +86,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
86
86
  function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
87
87
  if (parameter == null) return;
88
88
  if (typeof parameter === "object") {
89
- if (Array.isArray(parameter)) {
89
+ if (Array.isArray(parameter) || parameter instanceof Set) {
90
90
  (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
91
91
  }
92
92
  else {
@@ -112,7 +112,19 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
112
112
  export const setSearchParams = function (url: URL, ...objects: any[]) {
113
113
  const searchParams = new URLSearchParams(url.search);
114
114
  setFlattenedQueryParams(searchParams, objects);
115
- url.search = decodeURIComponent(searchParams.toString());
115
+ url.search = searchParams.toString();
116
+ }
117
+
118
+ /**
119
+ * JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
120
+ * @export
121
+ */
122
+ export const replaceWithSerializableTypeIfNeeded = function (_key: string, value: unknown) {
123
+ if (value instanceof Set) {
124
+ return Array.from(value);
125
+ }
126
+
127
+ return value;
116
128
  }
117
129
 
118
130
  /**
@@ -125,7 +137,7 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any,
125
137
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
126
138
  : nonString;
127
139
  return needsSerialization
128
- ? JSON.stringify(value !== undefined ? value : {})
140
+ ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
129
141
  : (value || "");
130
142
  }
131
143
 
@@ -142,8 +154,8 @@ export const toPathString = function (url: URL) {
142
154
  * @export
143
155
  */
144
156
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
145
- return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
157
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
146
158
  const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
147
- return axios.request<T, R>(axiosRequestArgs);
159
+ return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
148
160
  };
149
161
  }
package/configuration.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * GTINs
4
4
  * Manage GTINs
5
5
  *
6
- * The version of the OpenAPI document: 0.7.2
6
+ * The version of the OpenAPI document: 0.8.0
7
7
  *
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
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,6 +28,10 @@ export interface GTIN {
28
28
  * The GTIN
29
29
  */
30
30
  'number': string;
31
+ /**
32
+ * Whether this GTIN can be assigned to another variant. False when retired.
33
+ */
34
+ 'recyclable': boolean;
31
35
  /**
32
36
  * A reference to the resource location
33
37
  */
package/dist/api.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * GTINs
6
6
  * Manage GTINs
7
7
  *
8
- * The version of the OpenAPI document: 0.7.2
8
+ * The version of the OpenAPI document: 0.8.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -49,7 +49,7 @@ const GTINsApiAxiosParamCreator = function (configuration) {
49
49
  // verify required parameter 'gtin' is not null or undefined
50
50
  (0, common_1.assertParamExists)('assignGtin', 'gtin', gtin);
51
51
  const localVarPath = `/v1/gtins/{gtin}/assign`
52
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
52
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
53
53
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
54
54
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
55
55
  let baseOptions;
@@ -133,7 +133,7 @@ const GTINsApiAxiosParamCreator = function (configuration) {
133
133
  // verify required parameter 'gtin' is not null or undefined
134
134
  (0, common_1.assertParamExists)('getGtin', 'gtin', gtin);
135
135
  const localVarPath = `/v1/gtins/{gtin}`
136
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
136
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
137
137
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
138
138
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
139
139
  let baseOptions;
@@ -263,7 +263,7 @@ const GTINsApiAxiosParamCreator = function (configuration) {
263
263
  // verify required parameter 'gtin' is not null or undefined
264
264
  (0, common_1.assertParamExists)('unassignGtin', 'gtin', gtin);
265
265
  const localVarPath = `/v1/gtins/{gtin}/unassign`
266
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
266
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
267
267
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
268
268
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
269
269
  let baseOptions;
package/dist/base.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/base.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * GTINs
6
6
  * Manage GTINs
7
7
  *
8
- * The version of the OpenAPI document: 0.7.2
8
+ * The version of the OpenAPI document: 0.8.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/common.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -48,6 +48,11 @@ export declare const setOAuthToObject: (object: any, name: string, scopes: strin
48
48
  * @export
49
49
  */
50
50
  export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ * JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
53
+ * @export
54
+ */
55
+ export declare const replaceWithSerializableTypeIfNeeded: (_key: string, value: unknown) => unknown;
51
56
  /**
52
57
  *
53
58
  * @export
package/dist/common.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * GTINs
6
6
  * Manage GTINs
7
7
  *
8
- * The version of the OpenAPI document: 0.7.2
8
+ * The version of the OpenAPI document: 0.8.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
25
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
26
26
  const base_1 = require("./base");
27
27
  /**
28
28
  *
@@ -99,7 +99,7 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
99
99
  if (parameter == null)
100
100
  return;
101
101
  if (typeof parameter === "object") {
102
- if (Array.isArray(parameter)) {
102
+ if (Array.isArray(parameter) || parameter instanceof Set) {
103
103
  parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
104
104
  }
105
105
  else {
@@ -122,9 +122,20 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
122
122
  const setSearchParams = function (url, ...objects) {
123
123
  const searchParams = new URLSearchParams(url.search);
124
124
  setFlattenedQueryParams(searchParams, objects);
125
- url.search = decodeURIComponent(searchParams.toString());
125
+ url.search = searchParams.toString();
126
126
  };
127
127
  exports.setSearchParams = setSearchParams;
128
+ /**
129
+ * JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
130
+ * @export
131
+ */
132
+ const replaceWithSerializableTypeIfNeeded = function (_key, value) {
133
+ if (value instanceof Set) {
134
+ return Array.from(value);
135
+ }
136
+ return value;
137
+ };
138
+ exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
128
139
  /**
129
140
  *
130
141
  * @export
@@ -135,7 +146,7 @@ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
135
146
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
136
147
  : nonString;
137
148
  return needsSerialization
138
- ? JSON.stringify(value !== undefined ? value : {})
149
+ ? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
139
150
  : (value || "");
140
151
  };
141
152
  exports.serializeDataIfNeeded = serializeDataIfNeeded;
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -37,8 +37,8 @@ class Configuration {
37
37
  * @return True if the given MIME is JSON, false otherwise.
38
38
  */
39
39
  isJsonMime(mime) {
40
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
41
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
40
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
41
+ return mime !== null && jsonMime.test(mime);
42
42
  }
43
43
  }
44
44
  exports.Configuration = Configuration;
package/dist/esm/api.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,6 +28,10 @@ export interface GTIN {
28
28
  * The GTIN
29
29
  */
30
30
  'number': string;
31
+ /**
32
+ * Whether this GTIN can be assigned to another variant. False when retired.
33
+ */
34
+ 'recyclable': boolean;
31
35
  /**
32
36
  * A reference to the resource location
33
37
  */
package/dist/esm/api.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -46,7 +46,7 @@ export const GTINsApiAxiosParamCreator = function (configuration) {
46
46
  // verify required parameter 'gtin' is not null or undefined
47
47
  assertParamExists('assignGtin', 'gtin', gtin);
48
48
  const localVarPath = `/v1/gtins/{gtin}/assign`
49
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
49
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
50
50
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
51
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
52
52
  let baseOptions;
@@ -130,7 +130,7 @@ export const GTINsApiAxiosParamCreator = function (configuration) {
130
130
  // verify required parameter 'gtin' is not null or undefined
131
131
  assertParamExists('getGtin', 'gtin', gtin);
132
132
  const localVarPath = `/v1/gtins/{gtin}`
133
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
133
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
134
134
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
135
135
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
136
136
  let baseOptions;
@@ -260,7 +260,7 @@ export const GTINsApiAxiosParamCreator = function (configuration) {
260
260
  // verify required parameter 'gtin' is not null or undefined
261
261
  assertParamExists('unassignGtin', 'gtin', gtin);
262
262
  const localVarPath = `/v1/gtins/{gtin}/unassign`
263
- .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
263
+ .replace('{gtin}', encodeURIComponent(String(gtin)));
264
264
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
265
265
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
266
266
  let baseOptions;
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/esm/base.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -48,6 +48,11 @@ export declare const setOAuthToObject: (object: any, name: string, scopes: strin
48
48
  * @export
49
49
  */
50
50
  export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ * JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
53
+ * @export
54
+ */
55
+ export declare const replaceWithSerializableTypeIfNeeded: (_key: string, value: unknown) => unknown;
51
56
  /**
52
57
  *
53
58
  * @export
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -91,7 +91,7 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
91
91
  if (parameter == null)
92
92
  return;
93
93
  if (typeof parameter === "object") {
94
- if (Array.isArray(parameter)) {
94
+ if (Array.isArray(parameter) || parameter instanceof Set) {
95
95
  parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
96
96
  }
97
97
  else {
@@ -114,7 +114,17 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
114
114
  export const setSearchParams = function (url, ...objects) {
115
115
  const searchParams = new URLSearchParams(url.search);
116
116
  setFlattenedQueryParams(searchParams, objects);
117
- url.search = decodeURIComponent(searchParams.toString());
117
+ url.search = searchParams.toString();
118
+ };
119
+ /**
120
+ * JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
121
+ * @export
122
+ */
123
+ export const replaceWithSerializableTypeIfNeeded = function (_key, value) {
124
+ if (value instanceof Set) {
125
+ return Array.from(value);
126
+ }
127
+ return value;
118
128
  };
119
129
  /**
120
130
  *
@@ -126,7 +136,7 @@ export const serializeDataIfNeeded = function (value, requestOptions, configurat
126
136
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
137
  : nonString;
128
138
  return needsSerialization
129
- ? JSON.stringify(value !== undefined ? value : {})
139
+ ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
130
140
  : (value || "");
131
141
  };
132
142
  /**
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -3,7 +3,7 @@
3
3
  * GTINs
4
4
  * Manage GTINs
5
5
  *
6
- * The version of the OpenAPI document: 0.7.2
6
+ * The version of the OpenAPI document: 0.8.0
7
7
  *
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -34,7 +34,7 @@ export class Configuration {
34
34
  * @return True if the given MIME is JSON, false otherwise.
35
35
  */
36
36
  isJsonMime(mime) {
37
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
38
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
37
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
38
+ return mime !== null && jsonMime.test(mime);
39
39
  }
40
40
  }
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * GTINs
3
3
  * Manage GTINs
4
4
  *
5
- * The version of the OpenAPI document: 0.7.2
5
+ * The version of the OpenAPI document: 0.8.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * GTINs
6
6
  * Manage GTINs
7
7
  *
8
- * The version of the OpenAPI document: 0.7.2
8
+ * The version of the OpenAPI document: 0.8.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/docs/GTIN.md CHANGED
@@ -6,6 +6,7 @@
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
8
  **number** | **string** | The GTIN | [default to undefined]
9
+ **recyclable** | **boolean** | Whether this GTIN can be assigned to another variant. False when retired. | [default to undefined]
9
10
  **variantRef** | **string** | A reference to the resource location | [default to undefined]
10
11
  **variants** | [**Array&lt;GTINVariantsInner&gt;**](GTINVariantsInner.md) | | [default to undefined]
11
12
 
@@ -16,6 +17,7 @@ import { GTIN } from '@teemill/gtins';
16
17
 
17
18
  const instance: GTIN = {
18
19
  number,
20
+ recyclable,
19
21
  variantRef,
20
22
  variants,
21
23
  };
package/git_push.sh CHANGED
@@ -8,24 +8,24 @@ git_repo_id=$2
8
8
  release_note=$3
9
9
  git_host=$4
10
10
 
11
- if [ "$git_host" = "" ]; then
11
+ if [ -z "${git_host}" ]; then
12
12
  git_host="github.com"
13
- echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13
+ echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
14
14
  fi
15
15
 
16
- if [ "$git_user_id" = "" ]; then
16
+ if [ -z "${git_user_id}" ]; then
17
17
  git_user_id="Teemill"
18
- echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18
+ echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
19
19
  fi
20
20
 
21
- if [ "$git_repo_id" = "" ]; then
21
+ if [ -z "${git_repo_id}" ]; then
22
22
  git_repo_id="public-api"
23
- echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23
+ echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
24
24
  fi
25
25
 
26
- if [ "$release_note" = "" ]; then
26
+ if [ -z "${release_note}" ]; then
27
27
  release_note="Minor update"
28
- echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28
+ echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
29
29
  fi
30
30
 
31
31
  # Initialize the local directory as a Git repository
@@ -35,19 +35,16 @@ git init
35
35
  git add .
36
36
 
37
37
  # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
- git commit -m "$release_note"
38
+ git commit -m "${release_note}"
39
39
 
40
40
  # Sets the new remote
41
- git_remote=$(git remote)
42
- if [ "$git_remote" = "" ]; then # git remote not defined
43
-
44
- if [ "$GIT_TOKEN" = "" ]; then
45
- echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
- git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41
+ if [ -z "$(git remote)" ]; then # git remote not defined
42
+ if [ -z "${GIT_TOKEN:-}" ]; then
43
+ echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44
+ git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
47
45
  else
48
- git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46
+ git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
49
47
  fi
50
-
51
48
  fi
52
49
 
53
50
  git pull origin master
package/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * GTINs
5
5
  * Manage GTINs
6
6
  *
7
- * The version of the OpenAPI document: 0.7.2
7
+ * The version of the OpenAPI document: 0.8.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teemill/gtins",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "OpenAPI client for @teemill/gtins",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "prepare": "npm run build"
25
25
  },
26
26
  "dependencies": {
27
- "axios": "1.15.0"
27
+ "axios": "1.18.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "12.11.5 - 12.20.42",