@paklo/core 0.7.3 → 0.9.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/azure/index.d.mts +930 -116
- package/dist/azure/index.mjs +412 -229
- package/dist/azure/index.mjs.map +1 -1
- package/dist/dependabot/index.d.mts +3 -3
- package/dist/dependabot/index.mjs +3 -4
- package/dist/{dependabot-_TVZhG0L.mjs → dependabot-rtPO9HdD.mjs} +21 -14
- package/dist/dependabot-rtPO9HdD.mjs.map +1 -0
- package/dist/github/index.d.mts +1 -1
- package/dist/github/index.mjs +1 -1
- package/dist/{index-BWftXTYB.d.mts → index-BfwWezjJ.d.mts} +1 -1
- package/dist/{index-vaaBSJ7v.d.mts → index-Byxjhvfz.d.mts} +67 -59
- package/dist/{job-DQiSYFHb.mjs → job-BxOZ-hqF.mjs} +2 -2
- package/dist/job-BxOZ-hqF.mjs.map +1 -0
- package/dist/{logger-BqvUa-Ue.mjs → logger-5PEqZVLr.mjs} +10 -3
- package/dist/{logger-BqvUa-Ue.mjs.map → logger-5PEqZVLr.mjs.map} +1 -1
- package/dist/logger.mjs +1 -1
- package/dist/usage.d.mts +1 -1
- package/dist/usage.mjs +1 -1
- package/package.json +6 -9
- package/dist/dependabot-_TVZhG0L.mjs.map +0 -1
- package/dist/http/index.d.mts +0 -121
- package/dist/http/index.mjs +0 -3
- package/dist/http-D2wwAKQ-.mjs +0 -241
- package/dist/http-D2wwAKQ-.mjs.map +0 -1
- package/dist/job-DQiSYFHb.mjs.map +0 -1
package/dist/http-D2wwAKQ-.mjs
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
//#region src/http/headers.ts
|
|
2
|
-
const HEADER_NAME_CONTENT_DISPOSITION = "Content-Disposition";
|
|
3
|
-
const HEADER_NAME_CONTENT_TYPE = "Content-Type";
|
|
4
|
-
const HEADER_NAME_ACCEPT = "Accept";
|
|
5
|
-
const HEADER_NAME_USER_AGENT = "User-Agent";
|
|
6
|
-
const HEADER_NAME_AUTHORIZATION = "Authorization";
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/http/multipart.ts
|
|
10
|
-
var MultipartFormDataBody = class {
|
|
11
|
-
type = "multipart/form-data";
|
|
12
|
-
boundary = `${Math.random().toString(36).substring(2)}`;
|
|
13
|
-
parts = [];
|
|
14
|
-
async encode() {
|
|
15
|
-
if (this.parts.length === 0) throw new Error("MultipartFormDataBody must have at least one part");
|
|
16
|
-
const data = [];
|
|
17
|
-
for (const part of this.parts) {
|
|
18
|
-
data.push(`--${this.boundary}\r\n`);
|
|
19
|
-
for (const [key, value] of Object.entries(part.headers)) data.push(`${key}: ${value}\r\n`);
|
|
20
|
-
data.push("\r\n");
|
|
21
|
-
data.push(part.body);
|
|
22
|
-
data.push("\r\n");
|
|
23
|
-
}
|
|
24
|
-
data.push(`--${this.boundary}--\r\n`);
|
|
25
|
-
const list = [];
|
|
26
|
-
for (const item of data) if (item instanceof File) list.push(Buffer.from(await item.arrayBuffer()));
|
|
27
|
-
else if (typeof item === "string") list.push(Buffer.from(item, "utf8"));
|
|
28
|
-
else list.push(item);
|
|
29
|
-
return Buffer.concat(list);
|
|
30
|
-
}
|
|
31
|
-
getBoundary() {
|
|
32
|
-
return this.boundary;
|
|
33
|
-
}
|
|
34
|
-
getContentType() {
|
|
35
|
-
return `${this.type}; boundary=${this.boundary}`;
|
|
36
|
-
}
|
|
37
|
-
add(name, value) {
|
|
38
|
-
const part = createPart(name, value);
|
|
39
|
-
this.parts.push(part);
|
|
40
|
-
}
|
|
41
|
-
addFile(name, file) {
|
|
42
|
-
const part = createPart(name, file, file.name, file.type);
|
|
43
|
-
this.parts.push(part);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
function createPart(name, body, filename, contentType) {
|
|
47
|
-
const headers = {};
|
|
48
|
-
headers[HEADER_NAME_CONTENT_DISPOSITION] = `form-data; name="${name}"${filename ? `; filename="${filename}"` : ""}`;
|
|
49
|
-
if (contentType) headers[HEADER_NAME_CONTENT_TYPE] = contentType;
|
|
50
|
-
return {
|
|
51
|
-
name,
|
|
52
|
-
headers,
|
|
53
|
-
body
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/http/inner.ts
|
|
59
|
-
var InnerApiClient = class {
|
|
60
|
-
baseUrl;
|
|
61
|
-
headers;
|
|
62
|
-
token;
|
|
63
|
-
/**
|
|
64
|
-
* Create a new API client.
|
|
65
|
-
* @param options The options to use for the client.
|
|
66
|
-
*/
|
|
67
|
-
constructor({ baseUrl, token }) {
|
|
68
|
-
this.baseUrl = baseUrl;
|
|
69
|
-
this.headers = new Headers({ [HEADER_NAME_ACCEPT]: "application/json" });
|
|
70
|
-
this.token = token;
|
|
71
|
-
}
|
|
72
|
-
async get(url, options) {
|
|
73
|
-
return this.request({
|
|
74
|
-
url: this.makeUrl(url, options),
|
|
75
|
-
method: "GET",
|
|
76
|
-
...options
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
async post(url, options) {
|
|
80
|
-
return this.request({
|
|
81
|
-
method: "POST",
|
|
82
|
-
url: this.makeUrl(url, options),
|
|
83
|
-
...options
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
async put(url, options) {
|
|
87
|
-
return this.request({
|
|
88
|
-
method: "PUT",
|
|
89
|
-
url: this.makeUrl(url, options),
|
|
90
|
-
...options
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
async patch(url, options) {
|
|
94
|
-
return this.request({
|
|
95
|
-
method: "PATCH",
|
|
96
|
-
url: this.makeUrl(url, options),
|
|
97
|
-
...options
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
async delete(url, options) {
|
|
101
|
-
return this.request({
|
|
102
|
-
method: "DELETE",
|
|
103
|
-
url: this.makeUrl(url, options),
|
|
104
|
-
...options
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
async request(options) {
|
|
108
|
-
const { method, url, payload, userAgent, headers: additionalHeaders, schema } = options;
|
|
109
|
-
const headers = new Headers(this.headers);
|
|
110
|
-
if (userAgent) headers.set(HEADER_NAME_USER_AGENT, userAgent);
|
|
111
|
-
if (this.token) headers.set(HEADER_NAME_AUTHORIZATION, `Bearer ${this.token}`);
|
|
112
|
-
if (additionalHeaders) if (additionalHeaders instanceof Headers) additionalHeaders.forEach((value, key) => headers.set(key, value));
|
|
113
|
-
else if (Array.isArray(additionalHeaders)) additionalHeaders.forEach(([key, value]) => headers.set(key, value));
|
|
114
|
-
else Object.entries(additionalHeaders).forEach(([key, value]) => headers.set(key, value));
|
|
115
|
-
let body;
|
|
116
|
-
if (skipSerialization(payload)) body = payload;
|
|
117
|
-
else if (payload instanceof MultipartFormDataBody) {
|
|
118
|
-
body = new Uint8Array(await payload.encode());
|
|
119
|
-
headers.set(HEADER_NAME_CONTENT_TYPE, payload.getContentType());
|
|
120
|
-
} else {
|
|
121
|
-
body = JSON.stringify(payload);
|
|
122
|
-
headers.set(HEADER_NAME_CONTENT_TYPE, "application/json");
|
|
123
|
-
}
|
|
124
|
-
try {
|
|
125
|
-
const response = await fetch(url, {
|
|
126
|
-
method,
|
|
127
|
-
headers,
|
|
128
|
-
body
|
|
129
|
-
});
|
|
130
|
-
const { ok: successful, status, statusText } = response;
|
|
131
|
-
if (!successful) try {
|
|
132
|
-
const rawError = await response.text();
|
|
133
|
-
return {
|
|
134
|
-
headers: response.headers,
|
|
135
|
-
successful,
|
|
136
|
-
status,
|
|
137
|
-
statusText,
|
|
138
|
-
error: JSON.parse(rawError)
|
|
139
|
-
};
|
|
140
|
-
} catch (err) {
|
|
141
|
-
if (err instanceof SyntaxError) return {
|
|
142
|
-
headers: response.headers,
|
|
143
|
-
successful,
|
|
144
|
-
status,
|
|
145
|
-
statusText,
|
|
146
|
-
error: {
|
|
147
|
-
title: "Unknown error",
|
|
148
|
-
status,
|
|
149
|
-
statusText: response.statusText
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const error = {
|
|
153
|
-
title: (err instanceof Error ? err.message : void 0) ?? "Unknown error",
|
|
154
|
-
status: response.status,
|
|
155
|
-
statusText: response.statusText
|
|
156
|
-
};
|
|
157
|
-
return {
|
|
158
|
-
headers: response.headers,
|
|
159
|
-
successful,
|
|
160
|
-
status,
|
|
161
|
-
statusText,
|
|
162
|
-
error
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
const contentLength = response.headers.get("content-length");
|
|
166
|
-
let data = contentLength && contentLength !== "0" ? await response.json() : void 0;
|
|
167
|
-
if (data && schema) {
|
|
168
|
-
const result = await schema.safeParseAsync(data);
|
|
169
|
-
if (!result.success) return {
|
|
170
|
-
headers: response.headers,
|
|
171
|
-
successful: false,
|
|
172
|
-
status,
|
|
173
|
-
statusText,
|
|
174
|
-
data,
|
|
175
|
-
error: {
|
|
176
|
-
title: "application_error",
|
|
177
|
-
detail: "Schema validation error",
|
|
178
|
-
errors: result.error.flatten().fieldErrors,
|
|
179
|
-
status: response.status,
|
|
180
|
-
statusText: response.statusText
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
data = result.data;
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
headers: response.headers,
|
|
187
|
-
data,
|
|
188
|
-
successful,
|
|
189
|
-
status,
|
|
190
|
-
statusText
|
|
191
|
-
};
|
|
192
|
-
} catch (err) {
|
|
193
|
-
return {
|
|
194
|
-
headers: new Headers(),
|
|
195
|
-
successful: false,
|
|
196
|
-
status: -1,
|
|
197
|
-
statusText: "Application Error",
|
|
198
|
-
error: {
|
|
199
|
-
title: "application_error",
|
|
200
|
-
detail: `Unable to fetch data. The request could not be resolved. ${err}`
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
makeUrl(url, options) {
|
|
206
|
-
if (url.startsWith("http://") || url.startsWith("https://")) return url;
|
|
207
|
-
return `${options?.baseUrl ?? this.baseUrl}${url}`;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Whether to skip serialization of the payload.
|
|
212
|
-
* @param payload The payload to check.
|
|
213
|
-
* @returns true if the payload should not be serialized; otherwise, false.
|
|
214
|
-
*/
|
|
215
|
-
function skipSerialization(payload) {
|
|
216
|
-
return payload instanceof FormData || payload instanceof URLSearchParams || payload instanceof ReadableStream || payload instanceof Blob || payload instanceof ArrayBuffer || payload instanceof Buffer || typeof payload === "string" || !payload;
|
|
217
|
-
}
|
|
218
|
-
/** Http request error */
|
|
219
|
-
var HttpRequestError = class extends Error {
|
|
220
|
-
constructor(message, code) {
|
|
221
|
-
super(message);
|
|
222
|
-
this.code = code;
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
function isErrorTemporaryFailure(e) {
|
|
226
|
-
if (e instanceof HttpRequestError) switch (e.code) {
|
|
227
|
-
case 502: return true;
|
|
228
|
-
case 503: return true;
|
|
229
|
-
case 504: return true;
|
|
230
|
-
default: return false;
|
|
231
|
-
}
|
|
232
|
-
else if (e?.code) switch (e.code) {
|
|
233
|
-
case "ETIMEDOUT": return true;
|
|
234
|
-
default: return false;
|
|
235
|
-
}
|
|
236
|
-
else return false;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
//#endregion
|
|
240
|
-
export { HEADER_NAME_AUTHORIZATION as a, HEADER_NAME_USER_AGENT as c, HEADER_NAME_ACCEPT as i, InnerApiClient as n, HEADER_NAME_CONTENT_DISPOSITION as o, isErrorTemporaryFailure as r, HEADER_NAME_CONTENT_TYPE as s, HttpRequestError as t };
|
|
241
|
-
//# sourceMappingURL=http-D2wwAKQ-.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-D2wwAKQ-.mjs","names":["data: Array<MultipartFormDataBodyPart['body']>","list: Buffer[]","headers: Record<string, string>","body: BodyInit | undefined","error: ProblemDetails","code: number"],"sources":["../src/http/headers.ts","../src/http/multipart.ts","../src/http/inner.ts"],"sourcesContent":["export const HEADER_NAME_CONTENT_DISPOSITION = 'Content-Disposition';\nexport const HEADER_NAME_CONTENT_TYPE = 'Content-Type';\nexport const HEADER_NAME_ACCEPT = 'Accept';\nexport const HEADER_NAME_USER_AGENT = 'User-Agent';\nexport const HEADER_NAME_AUTHORIZATION = 'Authorization';\n","import { HEADER_NAME_CONTENT_DISPOSITION, HEADER_NAME_CONTENT_TYPE } from './headers';\n\nexport class MultipartFormDataBody {\n private type = 'multipart/form-data';\n private boundary: string = `${Math.random().toString(36).substring(2)}`;\n private parts: Array<MultipartFormDataBodyPart> = [];\n\n public async encode(): Promise<Buffer> {\n if (this.parts.length === 0) {\n throw new Error('MultipartFormDataBody must have at least one part');\n }\n\n const data: Array<MultipartFormDataBodyPart['body']> = [];\n\n for (const part of this.parts) {\n // write boundary\n data.push(`--${this.boundary}\\r\\n`);\n\n // write headers\n for (const [key, value] of Object.entries(part.headers)) {\n data.push(`${key}: ${value}\\r\\n`);\n }\n data.push('\\r\\n');\n\n // write body\n data.push(part.body);\n data.push('\\r\\n');\n }\n\n data.push(`--${this.boundary}--\\r\\n`);\n\n const list: Buffer[] = [];\n for (const item of data) {\n if (item instanceof File) list.push(Buffer.from(await item.arrayBuffer()));\n else if (typeof item === 'string') list.push(Buffer.from(item, 'utf8'));\n else list.push(item);\n }\n return Buffer.concat(list);\n }\n\n public getBoundary(): string {\n return this.boundary;\n }\n\n public getContentType(): string {\n return `${this.type}; boundary=${this.boundary}`;\n }\n\n public add(name: string, value: string) {\n const part = createPart(name, value);\n this.parts.push(part);\n }\n\n public addFile(name: string, file: File) {\n const part = createPart(name, file, file.name, file.type);\n this.parts.push(part);\n }\n}\n\ntype MultipartFormDataBodyPart = {\n name: string;\n headers: Record<string, string>;\n body: Buffer | File | string;\n};\n\nfunction createPart(\n name: string,\n body: MultipartFormDataBodyPart['body'],\n filename?: string,\n contentType?: string,\n): MultipartFormDataBodyPart {\n const headers: Record<string, string> = {};\n headers[HEADER_NAME_CONTENT_DISPOSITION] = `form-data; name=\"${name}\"${filename ? `; filename=\"${filename}\"` : ''}`;\n if (contentType) headers[HEADER_NAME_CONTENT_TYPE] = contentType;\n return { name, headers, body };\n}\n","import type { ZodType } from 'zod';\n\nimport {\n HEADER_NAME_ACCEPT,\n HEADER_NAME_AUTHORIZATION,\n HEADER_NAME_CONTENT_TYPE,\n HEADER_NAME_USER_AGENT,\n} from './headers';\nimport { MultipartFormDataBody } from './multipart';\nimport type { ProblemDetails } from './problem';\n\nexport type CreateInnerApiClientOptions = {\n /**\n * The base URL to use for the API.\n * @example 'https://www.paklo.app/api'\n */\n baseUrl: string;\n\n /** The token to use for authentication. This can be a JWT or specialized key. */\n token?: string;\n};\n\nexport type RequestOptions = {\n /**\n * Value for the `User-Agent` header.\n * This prepends the default value (e.g. `paklo/ab26320`)\n * which is important when we need to propagate the browser information to the server.\n */\n userAgent?: string;\n};\n\nexport type ResourceResponse<T = Record<string, unknown>> = {\n /** The headers of the response. */\n headers: Headers;\n\n /** Whether the request was successful. */\n successful: boolean;\n\n /** The status code of the response. */\n status: number;\n\n /** The status text of the response. */\n statusText: string;\n\n /** The data of the response. */\n data?: T;\n\n /** The error of the response. */\n error?: ProblemDetails;\n};\n\nexport type InnerRequestOptions<T> = RequestOptions & {\n /**\n * The base URL to use for the request.\n * This overrides the default base URL.\n * @example 'https://www.paklo.app/api'\n */\n baseUrl?: string;\n\n /** Additional headers to use for the request. */\n headers?: HeadersInit;\n\n /** The payload to use for the request. */\n payload?: Record<string, unknown> | MultipartFormDataBody | ReadableStream | XMLHttpRequestBodyInit;\n\n /** The schema to use when parsing the response. */\n schema?: ZodType<T>;\n};\n\ntype InnerRequestOptionsComplete<T> = InnerRequestOptions<T> & {\n /** The method to use for the request. */\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\n /** The URL to use for the request. */\n url: string;\n};\n\nexport class InnerApiClient {\n private readonly baseUrl: string;\n private readonly headers: Headers;\n private readonly token?: string;\n\n /**\n * Create a new API client.\n * @param options The options to use for the client.\n */\n constructor({ baseUrl, token }: CreateInnerApiClientOptions) {\n this.baseUrl = baseUrl;\n\n this.headers = new Headers({\n [HEADER_NAME_ACCEPT]: 'application/json',\n });\n\n this.token = token;\n }\n\n async get<T>(url: string, options?: InnerRequestOptions<T>) {\n return this.request<T>({\n url: this.makeUrl(url, options),\n method: 'GET',\n ...options,\n });\n }\n\n async post<T>(url: string, options?: InnerRequestOptions<T>) {\n return this.request<T>({\n method: 'POST',\n url: this.makeUrl(url, options),\n ...options,\n });\n }\n\n async put<T>(url: string, options?: InnerRequestOptions<T>) {\n return this.request<T>({\n method: 'PUT',\n url: this.makeUrl(url, options),\n ...options,\n });\n }\n\n async patch<T>(url: string, options?: InnerRequestOptions<T>) {\n return this.request<T>({\n method: 'PATCH',\n url: this.makeUrl(url, options),\n ...options,\n });\n }\n\n async delete<T>(url: string, options?: InnerRequestOptions<T>) {\n return this.request<T>({\n method: 'DELETE',\n url: this.makeUrl(url, options),\n ...options,\n });\n }\n\n async request<T>(options: InnerRequestOptionsComplete<T>): Promise<ResourceResponse<T>> {\n const { method, url, payload, userAgent, headers: additionalHeaders, schema } = options;\n\n // create headers for the request\n const headers = new Headers(this.headers);\n if (userAgent) {\n headers.set(HEADER_NAME_USER_AGENT, userAgent);\n }\n\n // populate authorization header\n if (this.token) {\n headers.set(HEADER_NAME_AUTHORIZATION, `Bearer ${this.token}`);\n }\n\n // populate additional headers\n // biome-ignore-start lint/suspicious/useIterableCallbackReturn: not used\n if (additionalHeaders) {\n if (additionalHeaders instanceof Headers) {\n additionalHeaders.forEach((value, key) => headers.set(key, value as string));\n } else if (Array.isArray(additionalHeaders)) {\n additionalHeaders.forEach(([key, value]) => headers.set(key, value));\n } else {\n Object.entries(additionalHeaders).forEach(([key, value]) => headers.set(key, value as string));\n }\n }\n // biome-ignore-end lint/suspicious/useIterableCallbackReturn: not used\n\n // prepare body\n let body: BodyInit | undefined;\n if (skipSerialization(payload)) body = payload;\n else if (payload instanceof MultipartFormDataBody) {\n body = new Uint8Array(await payload.encode());\n headers.set(HEADER_NAME_CONTENT_TYPE, payload.getContentType());\n } else {\n body = JSON.stringify(payload);\n headers.set(HEADER_NAME_CONTENT_TYPE, 'application/json');\n }\n\n // make request\n try {\n const response = await fetch(url, { method, headers, body });\n const { ok: successful, status, statusText } = response;\n\n if (!successful) {\n try {\n const rawError = await response.text();\n return { headers: response.headers, successful, status, statusText, error: JSON.parse(rawError) };\n } catch (err) {\n if (err instanceof SyntaxError) {\n return {\n headers: response.headers,\n successful,\n status,\n statusText,\n error: {\n title: 'Unknown error',\n status,\n statusText: response.statusText,\n },\n };\n }\n\n const error: ProblemDetails = {\n title: (err instanceof Error ? err.message : undefined) ?? 'Unknown error',\n status: response.status,\n statusText: response.statusText,\n };\n\n return { headers: response.headers, successful, status, statusText, error };\n }\n }\n\n const contentLength = response.headers.get('content-length');\n let data = contentLength && contentLength !== '0' ? ((await response.json()) as T) : undefined;\n if (data && schema) {\n const result = await schema.safeParseAsync(data);\n if (!result.success) {\n return {\n headers: response.headers,\n successful: false,\n status,\n statusText,\n data,\n error: {\n title: 'application_error',\n detail: 'Schema validation error',\n errors: result.error.flatten().fieldErrors,\n status: response.status,\n statusText: response.statusText,\n },\n };\n }\n data = result.data;\n }\n\n return { headers: response.headers, data, successful, status, statusText };\n } catch (err) {\n return {\n headers: new Headers(),\n successful: false,\n status: -1,\n statusText: 'Application Error',\n error: {\n title: 'application_error',\n detail: `Unable to fetch data. The request could not be resolved. ${err}`,\n },\n };\n }\n }\n\n private makeUrl<T>(url: string, options?: InnerRequestOptions<T>): string {\n if (url.startsWith('http://') || url.startsWith('https://')) return url;\n const baseUrl = options?.baseUrl ?? this.baseUrl;\n return `${baseUrl}${url}`;\n }\n}\n\n/**\n * Whether to skip serialization of the payload.\n * @param payload The payload to check.\n * @returns true if the payload should not be serialized; otherwise, false.\n */\nfunction skipSerialization(\n payload: InnerRequestOptions<never>['payload'],\n): payload is FormData | URLSearchParams | ReadableStream | Blob | ArrayBuffer | string | undefined {\n return (\n payload instanceof FormData ||\n payload instanceof URLSearchParams ||\n payload instanceof ReadableStream ||\n payload instanceof Blob ||\n payload instanceof ArrayBuffer ||\n payload instanceof Buffer ||\n typeof payload === 'string' ||\n !payload\n );\n}\n\n/** Http request error */\nexport class HttpRequestError extends Error {\n constructor(\n message: string,\n public code: number,\n ) {\n super(message);\n }\n}\n\nexport function isErrorTemporaryFailure(e?: { code?: string | number; message?: string } | null): boolean {\n if (e instanceof HttpRequestError) {\n // Check for common HTTP status codes that indicate a temporary failure\n // See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n switch (e.code) {\n case 502:\n return true; // 502 Bad Gateway\n case 503:\n return true; // 503 Service Unavailable\n case 504:\n return true; // 504 Gateway Timeout\n default:\n return false;\n }\n } else if (e?.code) {\n // Check for Node.js system errors that indicate a temporary failure\n // See: https://nodejs.org/api/errors.html#errors_common_system_errors\n switch (e.code) {\n case 'ETIMEDOUT':\n return true; // Operation timed out\n default:\n return false;\n }\n } else {\n return false;\n }\n}\n"],"mappings":";AAAA,MAAa,kCAAkC;AAC/C,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAClC,MAAa,yBAAyB;AACtC,MAAa,4BAA4B;;;;ACFzC,IAAa,wBAAb,MAAmC;CACjC,AAAQ,OAAO;CACf,AAAQ,WAAmB,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,EAAE;CACrE,AAAQ,QAA0C,EAAE;CAEpD,MAAa,SAA0B;AACrC,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAI,MAAM,oDAAoD;EAGtE,MAAMA,OAAiD,EAAE;AAEzD,OAAK,MAAM,QAAQ,KAAK,OAAO;AAE7B,QAAK,KAAK,KAAK,KAAK,SAAS,MAAM;AAGnC,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,QAAQ,CACrD,MAAK,KAAK,GAAG,IAAI,IAAI,MAAM,MAAM;AAEnC,QAAK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,YAAY;IACZ,OAAO;KACL,OAAO;KACP,QAAQ,4DAA4D;KACrE;IACF;;;CAIL,AAAQ,QAAW,KAAa,SAA0C;AACxE,MAAI,IAAI,WAAW,UAAU,IAAI,IAAI,WAAW,WAAW,CAAE,QAAO;AAEpE,SAAO,GADS,SAAS,WAAW,KAAK,UACrB;;;;;;;;AASxB,SAAS,kBACP,SACkG;AAClG,QACE,mBAAmB,YACnB,mBAAmB,mBACnB,mBAAmB,kBACnB,mBAAmB,QACnB,mBAAmB,eACnB,mBAAmB,UACnB,OAAO,YAAY,YACnB,CAAC;;;AAKL,IAAa,mBAAb,cAAsC,MAAM;CAC1C,YACE,SACA,AAAOC,MACP;AACA,QAAM,QAAQ;EAFP;;;AAMX,SAAgB,wBAAwB,GAAkE;AACxG,KAAI,aAAa,iBAGf,SAAQ,EAAE,MAAV;EACE,KAAK,IACH,QAAO;EACT,KAAK,IACH,QAAO;EACT,KAAK,IACH,QAAO;EACT,QACE,QAAO;;UAEF,GAAG,KAGZ,SAAQ,EAAE,MAAV;EACE,KAAK,YACH,QAAO;EACT,QACE,QAAO;;KAGX,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-DQiSYFHb.mjs","names":["matches: RegExpExecArray[]","regexp: RegExp","betaEcosystems: PackageEcosystem[]","updates: DependabotUpdate[]","registries: Record<string, DependabotRegistry>","referenced: string[]"],"sources":["../src/dependabot/directory-key.ts","../src/dependabot/placeholder.ts","../src/dependabot/config.ts","../src/dependabot/job.ts"],"sourcesContent":["/**\n * Options for creating a directory key that supports both naming conventions:\n * - `ecosystem` (standard format)\n * - `package-ecosystem` (alternative format for compatibility)\n *\n * Either a single `directory` or multiple `directories` can be specified.\n */\ntype MakeDirectoryKeyOptions =\n | {\n /** The package ecosystem (e.g., 'npm', 'pip', 'bundler') */\n ecosystem: string;\n /** Single directory path (optional if directories is provided) */\n directory?: string | null;\n /** Multiple directory paths (optional if directory is provided) */\n directories?: string[];\n }\n | {\n /** The package ecosystem using alternative naming convention */\n 'package-ecosystem': string;\n /** Single directory path (optional if directories is provided) */\n directory?: string | null;\n /** Multiple directory paths (optional if directory is provided) */\n directories?: string[];\n };\n\n/**\n * Creates a unique directory key by combining the ecosystem and directory information.\n *\n * The key format is: `{ecosystem}::{directory_info}`\n * - For single directory: `npm::/src/frontend`\n * - For multiple directories: `npm::/src/frontend,/src/backend`\n *\n * @param options - Configuration object containing ecosystem and directory information\n * @returns A unique string key in the format `{ecosystem}::{directories}`\n *\n * @example\n * ```typescript\n * // Single directory\n * const key1 = makeDirectoryKey({ ecosystem: 'npm', directory: '/src' });\n * // Returns: \"npm::/src\"\n *\n * // Multiple directories\n * const key2 = makeDirectoryKey({\n * ecosystem: 'pip',\n * directories: ['/backend', '/scripts']\n * });\n * // Returns: \"pip::/backend,/scripts\"\n *\n * // Using alternative naming convention\n * const key3 = makeDirectoryKey({\n * 'package-ecosystem': 'bundler',\n * directory: '/app'\n * });\n * // Returns: \"bundler::/app\"\n * ```\n */\nexport function makeDirectoryKey(options: MakeDirectoryKeyOptions): string {\n // Extract ecosystem name from either naming convention\n const ecosystem = 'ecosystem' in options ? options.ecosystem : options['package-ecosystem'];\n\n // Use single directory if provided, otherwise join multiple directories with comma\n const directoryPart = options.directory ?? options.directories!.join(',');\n\n return `${ecosystem}::${directoryPart}`;\n}\n","export type VariableFinderFn = (name: string) => string | undefined | Promise<string | undefined>;\n\nasync function convertPlaceholder({\n input,\n variableFinder,\n}: {\n input?: string;\n variableFinder: VariableFinderFn;\n}): Promise<string | undefined> {\n if (!input) return undefined;\n\n const matches: RegExpExecArray[] = extractPlaceholder(input);\n let result = input;\n for (const match of matches) {\n const placeholder = match[0];\n const name = match[1]!;\n const value = (await variableFinder(name)) ?? placeholder;\n result = result.replace(placeholder, value);\n }\n return result;\n}\n\nfunction extractPlaceholder(input: string) {\n const matches: RegExpExecArray[] = [];\n const regexp: RegExp = /\\$\\{\\{\\s{0,10}([a-zA-Z_][a-zA-Z0-9._-]{0,99})\\s{0,10}\\}\\}/;\n\n let searchInput = input;\n let offset = 0;\n\n while (searchInput.length > 0) {\n const match = searchInput.match(regexp);\n if (!match || match.index === undefined) break;\n\n // Adjust match index to account for previous slices\n const adjustedMatch = Object.assign([...match], {\n index: match.index + offset,\n input: input,\n groups: match.groups,\n }) as RegExpExecArray;\n\n matches.push(adjustedMatch);\n\n // Move past this match\n const nextStart = match.index + match[0].length;\n offset += nextStart;\n searchInput = searchInput.slice(nextStart);\n }\n\n return matches;\n}\n\nexport { convertPlaceholder, extractPlaceholder };\n","import * as yaml from 'js-yaml';\nimport { z } from 'zod';\n\nimport { makeDirectoryKey } from './directory-key';\nimport { convertPlaceholder, type VariableFinderFn } from './placeholder';\n\nexport const DependabotRegistrySchema = z\n .object({\n type: z.enum([\n // order matches\n // https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot#supported-private-registries\n\n 'cargo-registry',\n 'composer-repository',\n 'docker-registry',\n 'git',\n 'goproxy-server',\n 'helm-registry',\n 'hex-organization',\n 'hex-repository',\n 'maven-repository',\n 'npm-registry',\n 'nuget-feed',\n 'pub-repository',\n 'python-index',\n 'rubygems-server',\n 'terraform-registry',\n ]),\n url: z.string().optional(),\n username: z.string().optional(),\n password: z.string().optional(),\n key: z.string().optional(),\n token: z.string().optional(),\n 'replaces-base': z.boolean().optional(),\n host: z.string().optional(), // for terraform and composer only\n registry: z.string().optional(), // for npm only\n organization: z.string().optional(), // for hex-organisation only\n repo: z.string().optional(), // for hex-repository only\n 'public-key-fingerprint': z.string().optional(), // for hex-repository only\n 'index-url': z.string().optional(), // for python-index only\n 'auth-key': z.string().optional(), // used by composer-repository, docker-registry, etc\n 'tenant-id': z.string().optional(), // can only be for azure related stuff, not sure\n 'client-id': z.string().optional(), // can only be for azure related stuff, not sure\n })\n // change underscore to dash in the registry key/type\n .transform((value) => ({ ...value, type: value.type.replace('-', '_') }));\nexport type DependabotRegistry = z.infer<typeof DependabotRegistrySchema>;\n\nexport const DependabotGroupSchema = z.object({\n // Define an identifier for the group to use in branch names and pull request titles.\n // This must start and end with a letter, and can contain letters, pipes |, underscores _, or hyphens -.\n IDENTIFIER: z\n .string()\n .check(\n z.regex(/^[a-zA-Z][a-zA-Z0-9|_-]*[a-zA-Z]$/, {\n message:\n 'Group identifier must start and end with a letter, and can contain letters, pipes |, underscores _, or hyphens -.',\n }),\n )\n .optional(),\n 'applies-to': z.enum(['version-updates', 'security-updates']).optional(),\n 'dependency-type': z.enum(['development', 'production']).optional(),\n patterns: z.string().array().optional(),\n 'exclude-patterns': z.string().array().optional(),\n 'update-types': z.enum(['major', 'minor', 'patch']).array().optional(),\n});\nexport type DependabotGroup = z.infer<typeof DependabotGroupSchema>;\n\nexport const DependabotAllowConditionSchema = z.object({\n 'dependency-name': z.string().optional(),\n 'dependency-type': z.enum(['direct', 'indirect', 'all', 'production', 'development']).optional(),\n 'update-type': z.enum(['all', 'security']).optional(),\n});\nexport type DependabotAllowCondition = z.infer<typeof DependabotAllowConditionSchema>;\n\nexport const DependabotIgnoreConditionSchema = z\n .object({\n 'dependency-name': z.string().optional(),\n versions: z.string().array().or(z.string()).optional(),\n 'update-types': z\n .enum(['version-update:semver-major', 'version-update:semver-minor', 'version-update:semver-patch'])\n .array()\n .optional(),\n })\n .and(z.record(z.string(), z.any()));\nexport type DependabotIgnoreCondition = z.infer<typeof DependabotIgnoreConditionSchema>;\n\nexport const DependabotScheduleSchema = z\n .object({\n interval: z.enum(['daily', 'weekly', 'monthly', 'quarterly', 'semiannually', 'yearly', 'cron']),\n\n day: z\n .enum(['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'])\n .optional()\n .default('monday'),\n\n time: z\n .string()\n .default('02:00')\n .check(z.regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/, { message: 'Time must be in HH:MM format' }))\n .optional(),\n\n timezone: z\n .string()\n .optional()\n .default('Etc/UTC')\n .refine(\n (value) => {\n try {\n // If tz is not a valid IANA name, this throws a RangeError\n Intl.DateTimeFormat(undefined, { timeZone: value });\n return true;\n } catch {\n return false;\n }\n },\n { message: 'Invalid IANA time zone' },\n ),\n cronjob: z\n .string()\n .check(z.regex(/^\\S+ \\S+ \\S+ \\S+ \\S+$/, { message: 'Cronjob must be in standard cron format' }))\n .optional(),\n })\n .transform((value, { addIssue }) => {\n // if interval is 'cron', cronjob must be specified\n if (value.interval === 'cron' && !value.cronjob) {\n addIssue(\"The 'cronjob' field must be specified when the interval is set to 'cron'.\");\n }\n\n return value;\n });\nexport type DependabotSchedule = z.infer<typeof DependabotScheduleSchema>;\n\nexport const DependabotCommitMessageSchema = z.object({\n prefix: z.string().optional(),\n 'prefix-development': z.string().optional(),\n include: z.string().optional(),\n});\nexport type DependabotCommitMessage = z.infer<typeof DependabotCommitMessageSchema>;\n\nexport const DependabotCooldownSchema = z.object({\n 'default-days': z.number().optional(),\n 'semver-major-days': z.number().optional(),\n 'semver-minor-days': z.number().optional(),\n 'semver-patch-days': z.number().optional(),\n include: z.string().array().optional(),\n exclude: z.string().array().optional(),\n});\nexport type DependabotCooldown = z.infer<typeof DependabotCooldownSchema>;\n\nconst DependabotPullRequestBranchNameSchema = z.object({\n separator: z.string().optional(),\n});\nexport type DependabotPullRequestBranchName = z.infer<typeof DependabotPullRequestBranchNameSchema>;\n\nexport const PackageEcosystemSchema = z.enum([\n // order matches\n // https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference#package-ecosystem-\n\n 'bazel', // still in beta as of 2025-Nov-17\n 'bun',\n 'bundler',\n 'cargo',\n 'composer',\n 'conda',\n 'devcontainers',\n 'docker',\n 'docker-compose',\n 'dotnet-sdk',\n 'helm',\n 'mix',\n 'elm',\n 'gitsubmodule',\n 'github-actions',\n 'gomod',\n 'gradle',\n 'julia',\n 'maven',\n 'npm',\n 'nuget',\n 'opentofu', // in beta as of 2025-Nov-17\n 'pip',\n 'pip-compile', // alias mapped to 'pip'\n 'pipenv', // alias mapped to 'pip'\n 'pnpm', // alias mapped to 'npm'\n 'poetry', // alias mapped to 'pip'\n 'pub',\n 'rust-toolchain',\n 'swift',\n 'terraform',\n 'uv',\n 'vcpkg',\n 'yarn', // alias mapped to 'npm'\n]);\nexport type PackageEcosystem = z.infer<typeof PackageEcosystemSchema>;\n\nexport const VersioningStrategySchema = z.enum(['auto', 'increase', 'increase-if-necessary', 'lockfile-only', 'widen']);\nexport type VersioningStrategy = z.infer<typeof VersioningStrategySchema>;\n\nexport const DependabotUpdateSchema = z\n .object({\n 'package-ecosystem': PackageEcosystemSchema,\n directory: z.string().optional(),\n directories: z.string().array().optional(),\n 'exclude-paths': z.string().array().optional(),\n allow: DependabotAllowConditionSchema.array().optional(),\n assignees: z.string().array().optional(),\n 'commit-message': DependabotCommitMessageSchema.optional(),\n cooldown: DependabotCooldownSchema.optional(),\n groups: z.record(z.string(), DependabotGroupSchema).optional(),\n ignore: DependabotIgnoreConditionSchema.array().optional(),\n 'insecure-external-code-execution': z.enum(['allow', 'deny']).optional(),\n labels: z.string().array().optional(),\n milestone: z.coerce.string().optional(),\n 'open-pull-requests-limit': z.number().check(z.int(), z.gte(0)).optional(),\n 'pull-request-branch-name': DependabotPullRequestBranchNameSchema.optional(),\n 'rebase-strategy': z.string().optional(),\n registries: z.string().array().optional(),\n schedule: DependabotScheduleSchema.optional(), // TODO: make required after 2025-Nov-30\n 'target-branch': z.string().optional(),\n vendor: z.boolean().optional(),\n 'versioning-strategy': VersioningStrategySchema.optional(),\n patterns: z.string().array().optional(),\n 'multi-ecosystem-group': z.string().optional(),\n })\n .transform((value, { addIssue }) => {\n // either 'directory' or 'directories' must be specified\n if (!value.directory && (!value.directories || value.directories.length === 0)) {\n addIssue(\"Either 'directory' or 'directories' must be specified in the dependency update configuration.\");\n }\n\n // validate that 'directory' does not contain glob patterns\n if (value.directory && /[*?[\\]{}]/.test(value.directory)) {\n addIssue(\"The 'directory' field must not include glob pattern.\");\n }\n\n value['open-pull-requests-limit'] ??= 5; // default to 5 if not specified\n\n // The patterns key is required when using multi-ecosystem-group.\n // You can specify dependency patterns to include only certain dependencies in the group,\n // or use [\"*\"] to include all dependencies.\n if (value['multi-ecosystem-group'] && (!value.patterns || value.patterns.length === 0)) {\n addIssue(\n \"The 'patterns' field must be specified and contain at least one pattern when using 'multi-ecosystem-group'.\",\n );\n }\n\n return value;\n });\nexport type DependabotUpdate = z.infer<typeof DependabotUpdateSchema>;\n\nexport const DependabotMultiEcosystemGroupSchema = z.object({\n schedule: DependabotScheduleSchema,\n labels: z.string().array().optional(), // behaviour: additive\n milestone: z.coerce.string().optional(), // behaviour: group-only\n assignees: z.string().array().optional(), // behaviour: additive\n 'target-branch': z.string().optional(), // behaviour: group-only\n 'commit-message': DependabotCommitMessageSchema.optional(), // behaviour: group-only\n 'pull-request-branch-name': DependabotPullRequestBranchNameSchema.optional(), // behaviour: group-only\n});\nexport type DependabotMultiEcosystemGroup = z.infer<typeof DependabotMultiEcosystemGroupSchema>;\n\n/**\n * Represents the dependabot.yaml configuration file options.\n * See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-dependabotyml\n */\nexport const DependabotConfigSchema = z\n .object({\n /**\n * Mandatory. configuration file version.\n **/\n version: z.number().refine((v) => v === 2, { message: 'Only version 2 of dependabot is supported' }),\n\n /**\n * Optional. Configure groups of ecosystems to update together in a single pull request.\n */\n 'multi-ecosystem-groups': z.record(z.string(), DependabotMultiEcosystemGroupSchema).optional(),\n\n /**\n * Mandatory. Configure how Dependabot updates the versions or project dependencies.\n * Each entry configures the update settings for a particular package manager.\n */\n updates: DependabotUpdateSchema.array().check(\n z.minLength(1, { message: 'At least one update configuration is required' }),\n ),\n\n /**\n * Optional.\n * Specify authentication details to access private package registries.\n */\n registries: z.record(z.string(), DependabotRegistrySchema).optional(),\n\n /**\n * Optional. Enables updates for ecosystems that are not yet generally available.\n * https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference#enable-beta-ecosystems-\n */\n 'enable-beta-ecosystems': z.boolean().optional(),\n })\n .transform((value, { addIssue }) => {\n // If you attempt to set group-only keys at the ecosystem level (in updates entries),\n // Dependabot will throw a configuration error and fail to process your dependabot.yml file.\n // These keys must only be specified in the multi-ecosystem-groups section.\n // https://docs.github.com/en/code-security/dependabot/working-with-dependabot/configuring-multi-ecosystem-updates#group-only-keys\n const groupOnlyKeys = ['milestone', 'target-branch', 'commit-message', 'pull-request-branch-name'] as const;\n if (value['multi-ecosystem-groups']) {\n for (const update of value.updates) {\n for (const key of groupOnlyKeys) {\n if (key in update) {\n addIssue(\n `The '${key}' field must not be specified in the 'updates' section when using 'multi-ecosystem-groups'. It is a group-only field.`,\n );\n }\n }\n }\n }\n\n // ensure there is no update with the same package-ecosystem and directory/directories combination\n const seen = new Set<string>();\n for (const update of value.updates) {\n const key = makeDirectoryKey(update);\n if (seen.has(key)) {\n addIssue(\n `Duplicate update configuration found for '${update['package-ecosystem']}' and directory: '${update.directory ?? update.directories?.join(',')}'`,\n );\n }\n seen.add(key);\n }\n\n // ensure that the ecosystems in beta are only used when 'enable-beta-ecosystems' is true\n const betaEcosystems: PackageEcosystem[] = ['bazel', 'conda', 'opentofu'];\n if (!value['enable-beta-ecosystems']) {\n for (const update of value.updates) {\n if (betaEcosystems.includes(update['package-ecosystem'])) {\n addIssue(\n `The package ecosystem '${update['package-ecosystem']}' is currently in beta. To use it, set 'enable-beta-ecosystems' to true in the dependabot configuration.`,\n );\n }\n }\n }\n\n return value;\n });\n\nexport type DependabotConfig = z.infer<typeof DependabotConfigSchema>;\n\nexport function parseUpdates(config: DependabotConfig, configPath: string): DependabotUpdate[] {\n const updates: DependabotUpdate[] = [];\n\n // Parse the value of each of the updates obtained from the file\n for (const update of config.updates) {\n // populate the 'ignore' conditions 'source' and 'updated-at' properties, if missing\n // NOTE: 'source' and 'updated-at' are not documented in the dependabot.yml config docs, but are defined in the dependabot-core and dependabot-cli models.\n // Currently they don't appear to add much value to the update process, but are populated here for completeness.\n if (update.ignore) {\n for (const condition of update.ignore) {\n condition.source ??= configPath;\n // we don't know the last updated time, so we use the current time\n condition['updated-at'] ??= new Date().toISOString();\n }\n }\n\n updates.push(update);\n }\n return updates;\n}\n\nexport async function parseRegistries(\n config: DependabotConfig,\n variableFinder: VariableFinderFn,\n): Promise<Record<string, DependabotRegistry>> {\n // Parse the value of each of the registries obtained from the config\n const registries: Record<string, DependabotRegistry> = {};\n for (const [key, registry] of Object.entries(config.registries || {})) {\n const updated = { ...registry };\n const { type } = updated;\n\n // handle special fields for 'hex-organization' types\n if (type === 'hex_organization' && !updated.organization) {\n throw new Error(`The value 'organization' in dependency registry config '${type}' is missing`);\n }\n\n // handle special fields for 'hex-repository' types\n if (type === 'hex_repository' && !updated.repo) {\n throw new Error(`The value 'repo' in dependency registry config '${key}' is missing`);\n }\n\n // parse username, password, key, and token while replacing tokens where necessary\n updated.username = await convertPlaceholder({ input: updated.username, variableFinder: variableFinder });\n updated.password = await convertPlaceholder({ input: updated.password, variableFinder: variableFinder });\n updated.key = await convertPlaceholder({ input: updated.key, variableFinder: variableFinder });\n updated.token = await convertPlaceholder({ input: updated.token, variableFinder: variableFinder });\n\n // TODO: include sources for this logic, otherwise it looks like magic.\n // Initially, this was based on reading through the dependabot-core logic\n // but much has since changed.\n\n // parse the url\n const url = updated.url;\n if (!url && type !== 'hex_organization') {\n throw new Error(`The value 'url' in dependency registry config '${key}' is missing`);\n }\n if (url) {\n /*\n * Some credentials do not use the 'url' property in the Ruby updater.\n * The 'host' and 'registry' properties are derived from the given URL.\n * The 'registry' property is derived from the 'url' by stripping off the scheme.\n * The 'host' property is derived from the hostname of the 'url'.\n *\n * 'npm_registry' and 'docker_registry' use 'registry' only.\n * 'terraform_registry' uses 'host' only.\n * 'composer_repository' uses both 'url' and 'host'.\n * 'python_index' uses 'index-url' instead of 'url'.\n */\n\n if (URL.canParse(url)) {\n const parsedUrl = new URL(url);\n\n const addRegistry = type === 'docker_registry' || type === 'npm_registry';\n if (addRegistry) updated.registry = url.replace('https://', '').replace('http://', '');\n\n const addHost = type === 'composer_repository' || type === 'terraform_registry';\n if (addHost) updated.host = parsedUrl.hostname;\n }\n\n if (type === 'python_index') updated['index-url'] = url;\n\n const removeUrl =\n type === 'docker_registry' ||\n type === 'npm_registry' ||\n type === 'terraform_registry' ||\n type === 'python_index';\n if (removeUrl) delete updated.url; // remove the url if not needed\n }\n\n // add to list\n registries[key] = updated;\n }\n return registries;\n}\n\nexport function validateConfiguration(updates: DependabotUpdate[], registries: Record<string, DependabotRegistry>) {\n const configured = Object.keys(registries);\n const referenced: string[] = [];\n for (const u of updates) referenced.push(...(u.registries ?? []));\n\n // ensure there are no configured registries that have not been referenced\n const missingConfiguration = referenced.filter((el) => !configured.includes(el));\n if (missingConfiguration.length > 0) {\n throw new Error(\n `Referenced registries: '${missingConfiguration.join(',')}' have not been configured in the root of dependabot.yml`,\n );\n }\n\n // ensure there are no registries referenced but not configured\n const missingReferences = configured.filter((el) => !referenced.includes(el));\n if (missingReferences.length > 0) {\n throw new Error(`Registries: '${missingReferences.join(',')}' have not been referenced by any update`);\n }\n}\n\n/**\n * Possible paths to the dependabot config file.\n * Remember to prefix with a forward slash when querying API endpoints or where necessary.\n */\nexport const POSSIBLE_CONFIG_FILE_PATHS = [\n '.azuredevops/dependabot.yml',\n '.azuredevops/dependabot.yaml',\n '.github/dependabot.yaml',\n '.github/dependabot.yml',\n];\n\n/**\n * Parse the contents of a dependabot config YAML file\n * @returns {DependabotConfig} config - the dependabot configuration\n */\nexport async function parseDependabotConfig({\n configContents,\n configPath,\n variableFinder,\n}: {\n configContents: string;\n configPath: string;\n variableFinder: VariableFinderFn;\n}): Promise<DependabotConfig> {\n // Load the config\n const loadedConfig = yaml.load(configContents);\n if (loadedConfig === null || typeof loadedConfig !== 'object') {\n throw new Error('Invalid dependabot config object');\n }\n\n // Parse the config\n const config = await DependabotConfigSchema.parseAsync(loadedConfig);\n const updates = parseUpdates(config, configPath);\n const registries = await parseRegistries(config, variableFinder);\n validateConfiguration(updates, registries);\n\n return { ...config, updates, registries };\n}\n","import { z } from 'zod';\nimport { DependabotCooldownSchema } from './config';\n\n// we use nullish() because it does optional() and allows the value to be set to null\n\nexport const DependabotCredentialSchema = z.record(z.string(), z.any());\nexport type DependabotCredential = z.infer<typeof DependabotCredentialSchema>;\n\nexport const CertificateAuthoritySchema = z.object({\n cert: z.string(),\n key: z.string(),\n});\nexport type CertificateAuthority = z.infer<typeof CertificateAuthoritySchema>;\n\nexport const DependabotProxyConfigSchema = z.object({\n all_credentials: DependabotCredentialSchema.array(),\n ca: CertificateAuthoritySchema,\n});\nexport type DependabotProxyConfig = z.infer<typeof DependabotProxyConfigSchema>;\n\nexport const DependabotSourceProviderSchema = z.enum(['azure', 'gitlab', 'bitbucket']);\nexport type DependabotSourceProvider = z.infer<typeof DependabotSourceProviderSchema>;\n\nexport const DependabotSourceSchema = z.object({\n provider: DependabotSourceProviderSchema,\n repo: z.string(),\n directory: z.string().nullish(),\n directories: z.string().array().nullish(),\n branch: z.string().nullish(),\n commit: z.string().nullish(),\n hostname: z.string().nullish(), // Must be provided if api-endpoint is\n 'api-endpoint': z.string().nullish(), // Must be provided if hostname is\n});\nexport type DependabotSource = z.infer<typeof DependabotSourceSchema>;\n\nexport const DependabotExistingPRSchema = z.object({\n 'dependency-name': z.string(),\n 'dependency-version': z.string().nullish(),\n directory: z.string().nullish(),\n removed: z.boolean().nullish(),\n});\nexport type DependabotExistingPR = z.infer<typeof DependabotExistingPRSchema>;\n\nexport const DependabotExistingGroupPRSchema = z.object({\n 'dependency-group-name': z.string(),\n dependencies: DependabotExistingPRSchema.array(),\n});\nexport type DependabotExistingGroupPR = z.infer<typeof DependabotExistingGroupPRSchema>;\n\nexport const DependabotAllowedSchema = z.object({\n 'dependency-name': z.string().nullish(),\n 'dependency-type': z.string().nullish(),\n 'update-type': z.enum(['all', 'security']).optional(),\n});\nexport type DependabotAllowed = z.infer<typeof DependabotAllowedSchema>;\n\nexport const DependabotGroupRuleJobSchema = z.object({\n patterns: z.string().array().nullish(),\n 'exclude-patterns': z.string().array().nullish(),\n 'dependency-type': z.string().nullish(),\n 'update-types': z.string().array().nullish(),\n});\nexport type DependabotGroupRuleJob = z.infer<typeof DependabotGroupRuleJobSchema>;\n\nexport const DependabotGroupJobSchema = z.object({\n name: z.string(),\n 'applies-to': z.string().nullish(),\n rules: DependabotGroupRuleJobSchema,\n});\nexport type DependabotGroupJob = z.infer<typeof DependabotGroupJobSchema>;\n\nexport const DependabotConditionSchema = z.object({\n 'dependency-name': z.string(),\n source: z.string().nullish(),\n 'update-types': z.string().array().nullish(),\n 'updated-at': z.coerce.string().nullish(),\n 'version-requirement': z.string().nullish(),\n});\nexport type DependabotCondition = z.infer<typeof DependabotConditionSchema>;\n\nexport const DependabotSecurityAdvisorySchema = z.object({\n 'dependency-name': z.string(),\n 'affected-versions': z.string().array(),\n 'patched-versions': z.string().array().nullish(), // may not be patched as of yet\n 'unaffected-versions': z.string().array(),\n});\nexport type DependabotSecurityAdvisory = z.infer<typeof DependabotSecurityAdvisorySchema>;\n\nexport const DependabotRequirementSourceSchema = z.record(z.string(), z.any());\nexport type DependabotRequirementSource = z.infer<typeof DependabotRequirementSourceSchema>;\n\nexport const DependabotRequirementSchema = z.object({\n file: z.string().nullish(), // e.g. 'requirements.txt' or '/Root.csproj'\n groups: z.string().array().nullish(), // e.g. ['dependencies']\n metadata: z.record(z.string(), z.any()).nullish(),\n requirement: z.string().nullish(), // e.g. '==3.2.0' or '8.1.0'\n source: DependabotRequirementSourceSchema.nullish(),\n version: z.string().nullish(),\n 'previous-version': z.string().nullish(),\n});\nexport type DependabotRequirement = z.infer<typeof DependabotRequirementSchema>;\n\nexport const DependabotDependencySchema = z.object({\n name: z.string(), // e.g. 'django' or 'GraphQL.Server.Ui.Voyager'\n 'previous-requirements': DependabotRequirementSchema.array().nullish(),\n 'previous-version': z.string().nullish(),\n version: z.string().nullish(), // e.g. '5.0.1' or '8.1.0'\n requirements: DependabotRequirementSchema.array().nullish(),\n removed: z.boolean().nullish(),\n directory: z.string().nullish(),\n});\nexport type DependabotDependency = z.infer<typeof DependabotDependencySchema>;\n\nexport const DependabotCommitOptionsSchema = z.object({\n prefix: z.string().nullish(),\n 'prefix-development': z.string().nullish(),\n 'include-scope': z.boolean().nullish(),\n});\nexport type DependabotCommitOptions = z.infer<typeof DependabotCommitOptionsSchema>;\n\nexport const DependabotExperimentsSchema = z.record(z.string(), z.union([z.string(), z.boolean()]));\nexport type DependabotExperiments = z.infer<typeof DependabotExperimentsSchema>;\n\nexport const DependabotPackageManagerSchema = z.enum([\n 'bundler',\n 'cargo',\n 'composer',\n 'conda',\n 'pub',\n 'docker',\n 'elm',\n 'github_actions', // ecosystem(s): 'github-actions'\n 'submodules', // ecosystem(s): 'gitsubmodule'\n 'go_modules', // ecosystem(s): 'gomod'\n 'gradle',\n 'maven',\n 'hex', // ecosystem(s): 'mix'\n 'nuget',\n 'npm_and_yarn', // ecosystem(s): 'npm', 'pnpm', 'yarn'\n 'pip', // ecosystem(s): 'pipenv', 'pip-compile', 'poetry'\n 'rust_toolchain', // ecosystem(s): 'rust-toolchain'\n 'swift',\n 'terraform',\n 'devcontainers',\n 'dotnet_sdk', // ecosystem(s): 'dotnet-sdk'\n 'bun',\n 'docker_compose', // // ecosystem(s): 'docker-compose',\n 'uv',\n 'vcpkg',\n 'helm',\n 'julia',\n 'bazel',\n 'opentofu',\n]);\nexport type DependabotPackageManager = z.infer<typeof DependabotPackageManagerSchema>;\n\nexport const DependabotCommandSchema = z.enum(['graph', 'version', 'recreate']);\nexport type DependabotCommand = z.infer<typeof DependabotCommandSchema>;\n\n// See: https://github.com/dependabot/cli/blob/main/internal/model/job.go\n// https://github.com/dependabot/dependabot-core/blob/main/updater/lib/dependabot/job.rb\nexport const DependabotJobConfigSchema = z.object({\n id: z.string(),\n command: DependabotCommandSchema.optional(),\n 'package-manager': DependabotPackageManagerSchema,\n 'allowed-updates': DependabotAllowedSchema.array(),\n debug: z.boolean().nullable(),\n 'dependency-groups': DependabotGroupJobSchema.array().nullish(),\n dependencies: z.string().array().nullable(),\n 'dependency-group-to-refresh': z.string().nullish(),\n 'existing-pull-requests': DependabotExistingPRSchema.array().array(),\n 'existing-group-pull-requests': DependabotExistingGroupPRSchema.array(),\n experiments: DependabotExperimentsSchema,\n 'ignore-conditions': DependabotConditionSchema.array(),\n 'lockfile-only': z.boolean(),\n 'requirements-update-strategy': z.string().nullable(),\n 'security-advisories': DependabotSecurityAdvisorySchema.array(),\n 'security-updates-only': z.boolean(),\n source: DependabotSourceSchema,\n 'update-subdependencies': z.boolean(),\n 'updating-a-pull-request': z.boolean(),\n 'vendor-dependencies': z.boolean(),\n 'reject-external-code': z.boolean().nullish(),\n 'repo-private': z.boolean(),\n 'commit-message-options': DependabotCommitOptionsSchema,\n 'credentials-metadata': DependabotCredentialSchema.array().nullish(),\n 'max-updater-run-time': z.int().nullish(),\n cooldown: DependabotCooldownSchema.nullish(),\n 'proxy-log-response-body-on-auth-failure': z.boolean().nullish(),\n 'enable-beta-ecosystems': z.boolean().nullish(),\n 'multi-ecosystem-update': z.boolean().nullish(),\n 'exclude-paths': z.string().array().optional(),\n});\nexport type DependabotJobConfig = z.infer<typeof DependabotJobConfigSchema>;\n\nexport const DependabotJobFileSchema = z.object({\n job: DependabotJobConfigSchema,\n});\nexport type DependabotJobFile = z.infer<typeof DependabotJobFileSchema>;\n\n// Code below is borrowed and adapted from dependabot-action\n\n// biome-ignore-start lint/suspicious/noExplicitAny: generic\nexport type FetchedFiles = {\n base_commit_sha: string;\n dependency_files: any[];\n base64_dependency_files: any[];\n};\n// biome-ignore-end lint/suspicious/noExplicitAny: generic\n\nexport type FileFetcherInput = {\n job: DependabotJobConfig;\n};\n\nexport type FileUpdaterInput = FetchedFiles & {\n job: DependabotJobConfig;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,iBAAiB,SAA0C;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