@rage-against-the-pixel/app-store-connect-api 4.3.1 → 4.4.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/dist/app_store_connect_api/client/client.gen.js +114 -102
- package/dist/app_store_connect_api/client/index.d.ts +2 -1
- package/dist/app_store_connect_api/client/index.js +3 -1
- package/dist/app_store_connect_api/client/types.gen.d.ts +9 -13
- package/dist/app_store_connect_api/client/utils.gen.d.ts +8 -4
- package/dist/app_store_connect_api/client/utils.gen.js +15 -17
- package/dist/app_store_connect_api/client.gen.js +1 -3
- package/dist/app_store_connect_api/core/bodySerializer.gen.d.ts +16 -8
- package/dist/app_store_connect_api/core/bodySerializer.gen.js +1 -1
- package/dist/app_store_connect_api/core/params.gen.d.ts +10 -0
- package/dist/app_store_connect_api/core/params.gen.js +22 -10
- package/dist/app_store_connect_api/core/pathSerializer.gen.js +3 -11
- package/dist/app_store_connect_api/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/app_store_connect_api/core/queryKeySerializer.gen.js +98 -0
- package/dist/app_store_connect_api/core/serverSentEvents.gen.d.ts +1 -1
- package/dist/app_store_connect_api/core/serverSentEvents.gen.js +7 -11
- package/dist/app_store_connect_api/core/types.gen.d.ts +1 -1
- package/dist/app_store_connect_api/core/utils.gen.js +1 -1
- package/dist/app_store_connect_api/index.d.ts +3 -3
- package/dist/app_store_connect_api/index.js +1629 -17
- package/dist/app_store_connect_api/schemas.gen.d.ts +410 -7
- package/dist/app_store_connect_api/schemas.gen.js +22200 -8254
- package/dist/app_store_connect_api/sdk.gen.d.ts +30 -2
- package/dist/app_store_connect_api/sdk.gen.js +4302 -10339
- package/dist/app_store_connect_api/types.gen.d.ts +884 -68
- package/dist/app_store_connect_api/types.gen.js +8 -1
- package/package.json +2 -2
|
@@ -68,9 +68,7 @@ const serializeArrayParam = ({ allowReserved, explode, name, style, value, }) =>
|
|
|
68
68
|
});
|
|
69
69
|
})
|
|
70
70
|
.join(separator);
|
|
71
|
-
return style === 'label' || style === 'matrix'
|
|
72
|
-
? separator + joinedValues
|
|
73
|
-
: joinedValues;
|
|
71
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
74
72
|
};
|
|
75
73
|
exports.serializeArrayParam = serializeArrayParam;
|
|
76
74
|
const serializePrimitiveParam = ({ allowReserved, name, value, }) => {
|
|
@@ -90,11 +88,7 @@ const serializeObjectParam = ({ allowReserved, explode, name, style, value, valu
|
|
|
90
88
|
if (style !== 'deepObject' && !explode) {
|
|
91
89
|
let values = [];
|
|
92
90
|
Object.entries(value).forEach(([key, v]) => {
|
|
93
|
-
values = [
|
|
94
|
-
...values,
|
|
95
|
-
key,
|
|
96
|
-
allowReserved ? v : encodeURIComponent(v),
|
|
97
|
-
];
|
|
91
|
+
values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
|
|
98
92
|
});
|
|
99
93
|
const joinedValues = values.join(',');
|
|
100
94
|
switch (style) {
|
|
@@ -116,8 +110,6 @@ const serializeObjectParam = ({ allowReserved, explode, name, style, value, valu
|
|
|
116
110
|
value: v,
|
|
117
111
|
}))
|
|
118
112
|
.join(separator);
|
|
119
|
-
return style === 'label' || style === 'matrix'
|
|
120
|
-
? separator + joinedValues
|
|
121
|
-
: joinedValues;
|
|
113
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
122
114
|
};
|
|
123
115
|
exports.serializeObjectParam = serializeObjectParam;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-friendly union that mirrors what Pinia Colada can hash.
|
|
3
|
+
*/
|
|
4
|
+
export type JsonValue = null | string | number | boolean | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const queryKeyJsonReplacer: (_key: string, value: unknown) => {} | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
13
|
+
*/
|
|
14
|
+
export declare const stringifyToJsonValue: (input: unknown) => JsonValue | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
17
|
+
*/
|
|
18
|
+
export declare const serializeQueryKeyValue: (value: unknown) => JsonValue | undefined;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.serializeQueryKeyValue = exports.stringifyToJsonValue = exports.queryKeyJsonReplacer = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
7
|
+
*/
|
|
8
|
+
const queryKeyJsonReplacer = (_key, value) => {
|
|
9
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
if (typeof value === 'bigint') {
|
|
13
|
+
return value.toString();
|
|
14
|
+
}
|
|
15
|
+
if (value instanceof Date) {
|
|
16
|
+
return value.toISOString();
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
exports.queryKeyJsonReplacer = queryKeyJsonReplacer;
|
|
21
|
+
/**
|
|
22
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
23
|
+
*/
|
|
24
|
+
const stringifyToJsonValue = (input) => {
|
|
25
|
+
try {
|
|
26
|
+
const json = JSON.stringify(input, exports.queryKeyJsonReplacer);
|
|
27
|
+
if (json === undefined) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return JSON.parse(json);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.stringifyToJsonValue = stringifyToJsonValue;
|
|
37
|
+
/**
|
|
38
|
+
* Detects plain objects (including objects with a null prototype).
|
|
39
|
+
*/
|
|
40
|
+
const isPlainObject = (value) => {
|
|
41
|
+
if (value === null || typeof value !== 'object') {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const prototype = Object.getPrototypeOf(value);
|
|
45
|
+
return prototype === Object.prototype || prototype === null;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
49
|
+
*/
|
|
50
|
+
const serializeSearchParams = (params) => {
|
|
51
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
52
|
+
const result = {};
|
|
53
|
+
for (const [key, value] of entries) {
|
|
54
|
+
const existing = result[key];
|
|
55
|
+
if (existing === undefined) {
|
|
56
|
+
result[key] = value;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(existing)) {
|
|
60
|
+
existing.push(value);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
result[key] = [existing, value];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
70
|
+
*/
|
|
71
|
+
const serializeQueryKeyValue = (value) => {
|
|
72
|
+
if (value === null) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value === 'bigint') {
|
|
82
|
+
return value.toString();
|
|
83
|
+
}
|
|
84
|
+
if (value instanceof Date) {
|
|
85
|
+
return value.toISOString();
|
|
86
|
+
}
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
return (0, exports.stringifyToJsonValue)(value);
|
|
89
|
+
}
|
|
90
|
+
if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
|
|
91
|
+
return serializeSearchParams(value);
|
|
92
|
+
}
|
|
93
|
+
if (isPlainObject(value)) {
|
|
94
|
+
return (0, exports.stringifyToJsonValue)(value);
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
};
|
|
98
|
+
exports.serializeQueryKeyValue = serializeQueryKeyValue;
|
|
@@ -68,4 +68,4 @@ export interface StreamEvent<TData = unknown> {
|
|
|
68
68
|
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
69
69
|
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
70
70
|
};
|
|
71
|
-
export declare
|
|
71
|
+
export declare function createSseClient<TData = unknown>({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }: ServerSentEventsOptions): ServerSentEventsResult<TData>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createSseClient =
|
|
5
|
-
|
|
4
|
+
exports.createSseClient = createSseClient;
|
|
5
|
+
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
6
6
|
let lastEventId;
|
|
7
|
-
const sleep = sseSleepFn ??
|
|
8
|
-
((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
7
|
+
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
9
8
|
const createStream = async function* () {
|
|
10
9
|
let retryDelay = sseDefaultRetryDelay ?? 3000;
|
|
11
10
|
let attempt = 0;
|
|
@@ -40,9 +39,7 @@ const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
40
39
|
throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
41
40
|
if (!response.body)
|
|
42
41
|
throw new Error('No body in SSE response');
|
|
43
|
-
const reader = response.body
|
|
44
|
-
.pipeThrough(new TextDecoderStream())
|
|
45
|
-
.getReader();
|
|
42
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
46
43
|
let buffer = '';
|
|
47
44
|
const abortHandler = () => {
|
|
48
45
|
try {
|
|
@@ -59,6 +56,7 @@ const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
59
56
|
if (done)
|
|
60
57
|
break;
|
|
61
58
|
buffer += value;
|
|
59
|
+
buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings
|
|
62
60
|
const chunks = buffer.split('\n\n');
|
|
63
61
|
buffer = chunks.pop() ?? '';
|
|
64
62
|
for (const chunk of chunks) {
|
|
@@ -123,8 +121,7 @@ const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
123
121
|
catch (error) {
|
|
124
122
|
// connection failed or aborted; retry after delay
|
|
125
123
|
onSseError?.(error);
|
|
126
|
-
if (sseMaxRetryAttempts !== undefined &&
|
|
127
|
-
attempt >= sseMaxRetryAttempts) {
|
|
124
|
+
if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
|
|
128
125
|
break; // stop after firing error
|
|
129
126
|
}
|
|
130
127
|
// exponential backoff: double retry each attempt, cap at 30s
|
|
@@ -135,5 +132,4 @@ const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
135
132
|
};
|
|
136
133
|
const stream = createStream();
|
|
137
134
|
return { stream };
|
|
138
|
-
}
|
|
139
|
-
exports.createSseClient = createSseClient;
|
|
135
|
+
}
|
|
@@ -61,7 +61,7 @@ export interface Config {
|
|
|
61
61
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
62
62
|
/**
|
|
63
63
|
* A function transforming response data before it's returned. This is useful
|
|
64
|
-
* for post-processing data, e.g
|
|
64
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
65
65
|
*/
|
|
66
66
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
67
67
|
/**
|
|
@@ -81,7 +81,7 @@ function getValidRequestBody(options) {
|
|
|
81
81
|
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
|
|
82
82
|
return hasSerializedBody ? options.serializedBody : null;
|
|
83
83
|
}
|
|
84
|
-
// not all clients implement a serializedBody property (i.e
|
|
84
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
85
85
|
return options.body !== '' ? options.body : null;
|
|
86
86
|
}
|
|
87
87
|
// plain/text body
|