@rage-against-the-pixel/app-store-connect-api 3.7.1 → 4.0.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.
package/README.md CHANGED
@@ -37,7 +37,7 @@ async function main() {
37
37
  privateKey: '<PRIVATE_KEY>',
38
38
  };
39
39
  const client = new AppStoreConnectClient(options);
40
- const { data: response, error } = await client.api.appsGetCollection({
40
+ const { data: response, error } = await client.api.AppService.appsGetCollection({
41
41
  query: {
42
42
  limit: 10
43
43
  }
@@ -19,7 +19,7 @@ export declare const createQuerySerializer: <T = unknown>({ allowReserved, array
19
19
  /**
20
20
  * Infers parseAs value from provided Content-Type header.
21
21
  */
22
- export declare const getParseAs: (content: string | null) => Exclude<Config["parseAs"], "auto" | "stream">;
22
+ export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto" | "stream">;
23
23
  export declare const getUrl: ({ baseUrl, path, query, querySerializer, url: _url, }: {
24
24
  baseUrl: string;
25
25
  path?: Record<string, unknown>;
@@ -220,20 +220,22 @@ exports.createQuerySerializer = createQuerySerializer;
220
220
  /**
221
221
  * Infers parseAs value from provided Content-Type header.
222
222
  */
223
- const getParseAs = (content) => {
224
- if (!content) {
223
+ const getParseAs = (contentType) => {
224
+ if (!contentType) {
225
225
  return;
226
226
  }
227
- if (content.startsWith('application/json') || content.endsWith('+json')) {
227
+ const cleanContent = contentType.split(';')[0].trim();
228
+ if (cleanContent.startsWith('application/json') ||
229
+ cleanContent.endsWith('+json')) {
228
230
  return 'json';
229
231
  }
230
- if (content === 'multipart/form-data') {
232
+ if (cleanContent === 'multipart/form-data') {
231
233
  return 'formData';
232
234
  }
233
- if (['application/', 'audio/', 'image/', 'video/'].some((type) => content.startsWith(type))) {
235
+ if (['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))) {
234
236
  return 'blob';
235
237
  }
236
- if (content.startsWith('text/')) {
238
+ if (cleanContent.startsWith('text/')) {
237
239
  return 'text';
238
240
  }
239
241
  };