@paklo/core 0.2.0 → 0.3.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/{node/azure.d.ts → azure/index.d.ts} +4 -4
- package/dist/{node/azure.js → azure/index.js} +14 -14
- package/dist/azure/index.js.map +1 -0
- package/dist/{node/dependabot.d.ts → dependabot/index.d.ts} +2 -2
- package/dist/{node/dependabot.js → dependabot/index.js} +4 -4
- package/dist/{node/dependabot-BmHuie46.js → dependabot-B5pw4XDa.js} +2 -2
- package/dist/dependabot-B5pw4XDa.js.map +1 -0
- package/dist/{node/environment.d.ts → environment/index.d.ts} +1 -1
- package/dist/environment/index.js +3 -0
- package/dist/environment-DX5CD-dD.js.map +1 -0
- package/dist/{node/github.d.ts → github/index.d.ts} +1 -1
- package/dist/{node/github.js → github/index.js} +4 -4
- package/dist/github/index.js.map +1 -0
- package/dist/{node/http.d.ts → http/index.d.ts} +8 -8
- package/dist/{node/http.js → http/index.js} +2 -2
- package/dist/{node/http-BG_-s47I.js → http-Be3uWaqn.js} +1 -1
- package/dist/http-Be3uWaqn.js.map +1 -0
- package/dist/{node/index-Dgl6vmM4.d.ts → index-Dr0PB1As.d.ts} +4 -4
- package/dist/{node/job-C8KX68QT.js → job-CxYcRj_D.js} +1 -1
- package/dist/job-CxYcRj_D.js.map +1 -0
- package/dist/logger-bWnHxtAf.js.map +1 -0
- package/dist/{node/shared-data.d.ts → shared-data/index.d.ts} +1 -1
- package/dist/{node/shared-data.js → shared-data/index.js} +1 -1
- package/dist/shared-data/index.js.map +1 -0
- package/dist/{node/usage.d.ts → usage.d.ts} +1 -1
- package/dist/{node/usage.js → usage.js} +1 -1
- package/dist/usage.js.map +1 -0
- package/package.json +28 -33
- package/dist/browser/defineProperty-ie4tC-F5.js +0 -43
- package/dist/browser/environment-DinhzwQn.js +0 -139
- package/dist/browser/environment-DinhzwQn.js.map +0 -1
- package/dist/browser/environment.d.ts +0 -33
- package/dist/browser/environment.js +0 -3
- package/dist/browser/github.d.ts +0 -151
- package/dist/browser/github.js +0 -199
- package/dist/browser/github.js.map +0 -1
- package/dist/browser/http.d.ts +0 -121
- package/dist/browser/http.js +0 -248
- package/dist/browser/http.js.map +0 -1
- package/dist/browser/logger-B7HLv660.js +0 -31
- package/dist/browser/logger-B7HLv660.js.map +0 -1
- package/dist/browser/logger.js +0 -4
- package/dist/browser/shared-data.d.ts +0 -22
- package/dist/browser/shared-data.js +0 -23
- package/dist/browser/shared-data.js.map +0 -1
- package/dist/browser/usage.d.ts +0 -102
- package/dist/browser/usage.js +0 -419
- package/dist/browser/usage.js.map +0 -1
- package/dist/node/azure.js.map +0 -1
- package/dist/node/dependabot-BmHuie46.js.map +0 -1
- package/dist/node/environment-DX5CD-dD.js.map +0 -1
- package/dist/node/environment.js +0 -3
- package/dist/node/github.js.map +0 -1
- package/dist/node/http-BG_-s47I.js.map +0 -1
- package/dist/node/job-C8KX68QT.js.map +0 -1
- package/dist/node/logger-bWnHxtAf.js.map +0 -1
- package/dist/node/logger.d.ts +0 -23
- package/dist/node/shared-data.js.map +0 -1
- package/dist/node/usage.js.map +0 -1
- /package/dist/{node/environment-DX5CD-dD.js → environment-DX5CD-dD.js} +0 -0
- /package/dist/{node/index-3wZw74Ah.d.ts → index-3wZw74Ah.d.ts} +0 -0
- /package/dist/{node/logger-bWnHxtAf.js → logger-bWnHxtAf.js} +0 -0
- /package/dist/{browser/logger.d.ts → logger.d.ts} +0 -0
- /package/dist/{node/logger.js → logger.js} +0 -0
|
@@ -39,7 +39,7 @@ interface ProblemDetails {
|
|
|
39
39
|
type CreateInnerApiClientOptions = {
|
|
40
40
|
/**
|
|
41
41
|
* The base URL to use for the API.
|
|
42
|
-
* @example 'https://
|
|
42
|
+
* @example 'https://www.paklo.app/api'
|
|
43
43
|
*/
|
|
44
44
|
baseUrl: string;
|
|
45
45
|
/** The token to use for authentication. This can be a JWT or specialized key. */
|
|
@@ -53,7 +53,7 @@ type RequestOptions = {
|
|
|
53
53
|
*/
|
|
54
54
|
userAgent?: string;
|
|
55
55
|
};
|
|
56
|
-
type ResourceResponse<T
|
|
56
|
+
type ResourceResponse<T = Record<string, unknown>> = {
|
|
57
57
|
/** The headers of the response. */
|
|
58
58
|
headers: Headers;
|
|
59
59
|
/** Whether the request was successful. */
|
|
@@ -63,15 +63,15 @@ type ResourceResponse<T$1 = Record<string, unknown>> = {
|
|
|
63
63
|
/** The status text of the response. */
|
|
64
64
|
statusText: string;
|
|
65
65
|
/** The data of the response. */
|
|
66
|
-
data?: T
|
|
66
|
+
data?: T;
|
|
67
67
|
/** The error of the response. */
|
|
68
68
|
error?: ProblemDetails;
|
|
69
69
|
};
|
|
70
|
-
type InnerRequestOptions<T
|
|
70
|
+
type InnerRequestOptions<T> = RequestOptions & {
|
|
71
71
|
/**
|
|
72
72
|
* The base URL to use for the request.
|
|
73
73
|
* This overrides the default base URL.
|
|
74
|
-
* @example 'https://
|
|
74
|
+
* @example 'https://www.paklo.app/api'
|
|
75
75
|
*/
|
|
76
76
|
baseUrl?: string;
|
|
77
77
|
/** Additional headers to use for the request. */
|
|
@@ -79,9 +79,9 @@ type InnerRequestOptions<T$1> = RequestOptions & {
|
|
|
79
79
|
/** The payload to use for the request. */
|
|
80
80
|
payload?: Record<string, unknown> | MultipartFormDataBody | ReadableStream | XMLHttpRequestBodyInit;
|
|
81
81
|
/** The schema to use when parsing the response. */
|
|
82
|
-
schema?: ZodType<T
|
|
82
|
+
schema?: ZodType<T>;
|
|
83
83
|
};
|
|
84
|
-
type InnerRequestOptionsComplete<T
|
|
84
|
+
type InnerRequestOptionsComplete<T> = InnerRequestOptions<T> & {
|
|
85
85
|
/** The method to use for the request. */
|
|
86
86
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
87
87
|
/** The URL to use for the request. */
|
|
@@ -118,4 +118,4 @@ declare function isErrorTemporaryFailure(e?: {
|
|
|
118
118
|
} | null): boolean;
|
|
119
119
|
//#endregion
|
|
120
120
|
export { CreateInnerApiClientOptions, HEADER_NAME_ACCEPT, HEADER_NAME_AUTHORIZATION, HEADER_NAME_CONTENT_DISPOSITION, HEADER_NAME_CONTENT_TYPE, HEADER_NAME_USER_AGENT, HttpRequestError, InnerApiClient, InnerRequestOptions, ProblemDetails, RequestOptions, ResourceResponse, isErrorTemporaryFailure };
|
|
121
|
-
//# sourceMappingURL=
|
|
121
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { a as HEADER_NAME_AUTHORIZATION, c as HEADER_NAME_USER_AGENT, i as HEADER_NAME_ACCEPT, n as InnerApiClient, o as HEADER_NAME_CONTENT_DISPOSITION, r as isErrorTemporaryFailure, s as HEADER_NAME_CONTENT_TYPE, t as HttpRequestError } from "
|
|
1
|
+
import "../environment-DX5CD-dD.js";
|
|
2
|
+
import { a as HEADER_NAME_AUTHORIZATION, c as HEADER_NAME_USER_AGENT, i as HEADER_NAME_ACCEPT, n as InnerApiClient, o as HEADER_NAME_CONTENT_DISPOSITION, r as isErrorTemporaryFailure, s as HEADER_NAME_CONTENT_TYPE, t as HttpRequestError } from "../http-Be3uWaqn.js";
|
|
3
3
|
|
|
4
4
|
export { HEADER_NAME_ACCEPT, HEADER_NAME_AUTHORIZATION, HEADER_NAME_CONTENT_DISPOSITION, HEADER_NAME_CONTENT_TYPE, HEADER_NAME_USER_AGENT, HttpRequestError, InnerApiClient, isErrorTemporaryFailure };
|
|
@@ -242,4 +242,4 @@ function isErrorTemporaryFailure(e) {
|
|
|
242
242
|
|
|
243
243
|
//#endregion
|
|
244
244
|
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 };
|
|
245
|
-
//# sourceMappingURL=http-
|
|
245
|
+
//# sourceMappingURL=http-Be3uWaqn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-Be3uWaqn.js","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/v4';\n\nimport { environment } from '@/environment';\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\nconst defaultUserAgent = `paklo/${environment.sha?.substring(0, 7) ?? 'dogfood'}`;\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 const finalUserAgent = userAgent && userAgent.length > 0 ? `${userAgent} (${defaultUserAgent})` : defaultUserAgent;\n headers.set(HEADER_NAME_USER_AGENT, finalUserAgent);\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,C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@ type DependabotCommitOptions = z.infer<typeof DependabotCommitOptionsSchema>;
|
|
|
1246
1246
|
declare const DependabotExperimentsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
1247
1247
|
type DependabotExperiments = z.infer<typeof DependabotExperimentsSchema>;
|
|
1248
1248
|
declare const DependabotPackageManagerSchema: z.ZodEnum<{
|
|
1249
|
-
hex: "hex";
|
|
1250
1249
|
bundler: "bundler";
|
|
1251
1250
|
cargo: "cargo";
|
|
1252
1251
|
composer: "composer";
|
|
@@ -1258,6 +1257,7 @@ declare const DependabotPackageManagerSchema: z.ZodEnum<{
|
|
|
1258
1257
|
go_modules: "go_modules";
|
|
1259
1258
|
gradle: "gradle";
|
|
1260
1259
|
maven: "maven";
|
|
1260
|
+
hex: "hex";
|
|
1261
1261
|
nuget: "nuget";
|
|
1262
1262
|
npm_and_yarn: "npm_and_yarn";
|
|
1263
1263
|
pip: "pip";
|
|
@@ -1288,7 +1288,6 @@ declare const DependabotJobConfigSchema: z.ZodObject<{
|
|
|
1288
1288
|
recreate: "recreate";
|
|
1289
1289
|
}>>;
|
|
1290
1290
|
'package-manager': z.ZodEnum<{
|
|
1291
|
-
hex: "hex";
|
|
1292
1291
|
bundler: "bundler";
|
|
1293
1292
|
cargo: "cargo";
|
|
1294
1293
|
composer: "composer";
|
|
@@ -1300,6 +1299,7 @@ declare const DependabotJobConfigSchema: z.ZodObject<{
|
|
|
1300
1299
|
go_modules: "go_modules";
|
|
1301
1300
|
gradle: "gradle";
|
|
1302
1301
|
maven: "maven";
|
|
1302
|
+
hex: "hex";
|
|
1303
1303
|
nuget: "nuget";
|
|
1304
1304
|
npm_and_yarn: "npm_and_yarn";
|
|
1305
1305
|
pip: "pip";
|
|
@@ -1415,7 +1415,6 @@ declare const DependabotJobFileSchema: z.ZodObject<{
|
|
|
1415
1415
|
recreate: "recreate";
|
|
1416
1416
|
}>>;
|
|
1417
1417
|
'package-manager': z.ZodEnum<{
|
|
1418
|
-
hex: "hex";
|
|
1419
1418
|
bundler: "bundler";
|
|
1420
1419
|
cargo: "cargo";
|
|
1421
1420
|
composer: "composer";
|
|
@@ -1427,6 +1426,7 @@ declare const DependabotJobFileSchema: z.ZodObject<{
|
|
|
1427
1426
|
go_modules: "go_modules";
|
|
1428
1427
|
gradle: "gradle";
|
|
1429
1428
|
maven: "maven";
|
|
1429
|
+
hex: "hex";
|
|
1430
1430
|
nuget: "nuget";
|
|
1431
1431
|
npm_and_yarn: "npm_and_yarn";
|
|
1432
1432
|
pip: "pip";
|
|
@@ -2081,4 +2081,4 @@ declare const DependabotMetricSchema: z.ZodObject<{
|
|
|
2081
2081
|
type DependabotMetric = z.infer<typeof DependabotMetricSchema>;
|
|
2082
2082
|
//#endregion
|
|
2083
2083
|
export { sanitizeRef as $, DependabotGroup as $t, DependabotRequest as A, DependabotProxyConfig as At, makeRandomJobToken as B, DependabotSourceProviderSchema as Bt, DependabotRecordUpdateJobUnknownError as C, extractPlaceholder as Cn, DependabotGroupRuleJobSchema as Ct, DependabotUpdatePullRequest as D, DependabotJobFileSchema as Dt, DependabotUpdateDependencyListSchema as E, GitAuthor as En, DependabotJobFile as Et, createApiServerApp as F, DependabotRequirementSourceSchema as Ft, mapIgnoreConditionsFromDependabotConfigToJobConfig as G, DependabotAllowCondition as Gt, mapCredentials as H, FetchedFiles as Ht, DependabotJobBuilder as I, DependabotSecurityAdvisory as It, mapSourceFromDependabotConfigToJobConfig as J, DependabotCommitMessageSchema as Jt, mapPackageEcosystemToPackageManager as K, DependabotAllowConditionSchema as Kt, DependabotJobBuilderOutput as L, DependabotSecurityAdvisorySchema as Lt, DependabotRequestType as M, DependabotRequirement as Mt, DependabotRequestTypeSchema as N, DependabotRequirementSchema as Nt, DependabotUpdatePullRequestSchema as O, DependabotPackageManager as Ot, DependabotTokenType as P, DependabotRequirementSource as Pt, getBranchNameForUpdate as Q, DependabotCooldownSchema as Qt, DependabotSourceInfo as R, DependabotSource as Rt, DependabotRecordUpdateJobErrorSchema as S, convertPlaceholder as Sn, DependabotGroupRuleJob as St, DependabotUpdateDependencyList as T, DEPENDABOT_DEFAULT_AUTHOR_NAME as Tn, DependabotJobConfigSchema as Tt, mapExperiments as U, FileFetcherInput as Ut, mapAllowedUpdatesFromDependabotConfigToJobConfig as V, DependabotSourceSchema as Vt, mapGroupsFromDependabotConfigToJobConfig as W, FileUpdaterInput as Wt, DEFAULT_EXPERIMENTS as X, DependabotConfigSchema as Xt, mapVersionStrategyToRequirementsUpdateStrategy as Y, DependabotConfig as Yt, parseExperiments as Z, DependabotCooldown as Zt, DependabotRecordEcosystemMeta as _, parseDependabotConfig as _n, DependabotExistingPRSchema as _t, DependabotDependencyFile as a, DependabotPullRequestBranchName as an, DependabotCommandSchema as at, DependabotRecordEcosystemVersionsSchema as b, validateConfiguration as bn, DependabotGroupJob as bt, DependabotEcosystemMetaSchema as c, DependabotSchedule as cn, DependabotCondition as ct, DependabotIncrementMetric as d, DependabotUpdateSchema as dn, DependabotCredentialSchema as dt, DependabotGroupSchema as en, CertificateAuthority as et, DependabotIncrementMetricSchema as f, POSSIBLE_CONFIG_FILE_PATHS as fn, DependabotDependency as ft, DependabotMetricSchema as g, VersioningStrategySchema as gn, DependabotExistingPR as gt, DependabotMetric as h, VersioningStrategy as hn, DependabotExistingGroupPRSchema as ht, DependabotCreatePullRequestSchema as i, DependabotMultiEcosystemGroupSchema as in, DependabotCommand as it, DependabotRequestSchema as j, DependabotProxyConfigSchema as jt, CreateApiServerAppOptions as k, DependabotPackageManagerSchema as kt, DependabotEcosystemVersionManager as l, DependabotScheduleSchema as ln, DependabotConditionSchema as lt, DependabotMarkAsProcessedSchema as m, PackageEcosystemSchema as mn, DependabotExistingGroupPR as mt, DependabotClosePullRequestSchema as n, DependabotIgnoreConditionSchema as nn, DependabotAllowed as nt, DependabotDependencyFileSchema as o, DependabotRegistry as on, DependabotCommitOptions as ot, DependabotMarkAsProcessed as p, PackageEcosystem as pn, DependabotDependencySchema as pt, mapSecurityAdvisories as q, DependabotCommitMessage as qt, DependabotCreatePullRequest as r, DependabotMultiEcosystemGroup as rn, DependabotAllowedSchema as rt, DependabotEcosystemMeta as s, DependabotRegistrySchema as sn, DependabotCommitOptionsSchema as st, DependabotClosePullRequest as t, DependabotIgnoreCondition as tn, CertificateAuthoritySchema as tt, DependabotEcosystemVersionManagerSchema as u, DependabotUpdate as un, DependabotCredential as ut, DependabotRecordEcosystemMetaSchema as v, parseRegistries as vn, DependabotExperiments as vt, DependabotRecordUpdateJobUnknownErrorSchema as w, DEPENDABOT_DEFAULT_AUTHOR_EMAIL as wn, DependabotJobConfig as wt, DependabotRecordUpdateJobError as x, VariableFinderFn as xn, DependabotGroupJobSchema as xt, DependabotRecordEcosystemVersions as y, parseUpdates as yn, DependabotExperimentsSchema as yt, makeRandomJobId as z, DependabotSourceProvider as zt };
|
|
2084
|
-
//# sourceMappingURL=index-
|
|
2084
|
+
//# sourceMappingURL=index-Dr0PB1As.d.ts.map
|
|
@@ -484,4 +484,4 @@ const DependabotJobFileSchema = z.object({ job: DependabotJobConfigSchema });
|
|
|
484
484
|
|
|
485
485
|
//#endregion
|
|
486
486
|
export { DependabotScheduleSchema as A, extractPlaceholder as B, DependabotCommitMessageSchema as C, DependabotIgnoreConditionSchema as D, DependabotGroupSchema as E, parseDependabotConfig as F, parseRegistries as I, parseUpdates as L, POSSIBLE_CONFIG_FILE_PATHS as M, PackageEcosystemSchema as N, DependabotMultiEcosystemGroupSchema as O, VersioningStrategySchema as P, validateConfiguration as R, DependabotAllowConditionSchema as S, DependabotCooldownSchema as T, DependabotRequirementSchema as _, DependabotConditionSchema as a, DependabotSourceProviderSchema as b, DependabotExistingGroupPRSchema as c, DependabotGroupJobSchema as d, DependabotGroupRuleJobSchema as f, DependabotProxyConfigSchema as g, DependabotPackageManagerSchema as h, DependabotCommitOptionsSchema as i, DependabotUpdateSchema as j, DependabotRegistrySchema as k, DependabotExistingPRSchema as l, DependabotJobFileSchema as m, DependabotAllowedSchema as n, DependabotCredentialSchema as o, DependabotJobConfigSchema as p, DependabotCommandSchema as r, DependabotDependencySchema as s, CertificateAuthoritySchema as t, DependabotExperimentsSchema as u, DependabotRequirementSourceSchema as v, DependabotConfigSchema as w, DependabotSourceSchema as x, DependabotSecurityAdvisorySchema as y, convertPlaceholder as z };
|
|
487
|
-
//# sourceMappingURL=job-
|
|
487
|
+
//# sourceMappingURL=job-CxYcRj_D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-CxYcRj_D.js","names":["matches: RegExpExecArray[]","updates: DependabotUpdate[]","registries: Record<string, DependabotRegistry>","referenced: string[]"],"sources":["../src/dependabot/placeholder.ts","../src/dependabot/config.ts","../src/dependabot/job.ts"],"sourcesContent":["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 regexp: RegExp = /\\${{\\s*([a-zA-Z_]+[a-zA-Z0-9._-]*)\\s*}}/g;\n\n return matchAll(input, regexp);\n}\n\nfunction matchAll(input: string, regexp: RegExp, matches: Array<RegExpExecArray> = []) {\n const matchIfAny = regexp.exec(input);\n if (matchIfAny) {\n matches.push(matchIfAny);\n\n // recurse until no more matches\n matchAll(input, regexp, matches);\n }\n return matches;\n}\n\nexport { convertPlaceholder, extractPlaceholder };\n","import * as yaml from 'js-yaml';\nimport { z } from 'zod/v4';\n\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.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});\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 'bun',\n 'bundler',\n 'cargo',\n 'composer',\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 '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 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/v4';\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']);\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 // order matches dependabot-action/src/update-containers.ts\n\n 'bundler',\n 'cargo',\n 'composer',\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]);\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.number().optional(),\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":";;;;AAEA,eAAe,mBAAmB,EAChC,OACA,kBAI8B;AAC9B,KAA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AS;CACpE,wBAAwB,EAAE,KAAK,CAAC,SAAS;CACzC,UAAU,yBAAyB,SAAS;CAC5C,2CAA2C,EAAE,SAAS,CAAC,SAAS;CAChE,0BAA0B,EAAE,SAAS,CAAC,SAAS;CAC/C,0BAA0B,EAAE,SAAS,CAAC,SAAS;CAC/C,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU;CAC/C,CAAC;AAGF,MAAa,0BAA0B,EAAE,OAAO,EAC9C,KAAK,2BACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-bWnHxtAf.js","names":["options: LoggerOptions","destination: DestinationStream | undefined"],"sources":["../src/logger.ts"],"sourcesContent":["import pino, { type DestinationStream, type Logger, type LoggerOptions } from 'pino';\nimport { PinoPretty } from 'pino-pretty';\n\nimport { environment } from '@/environment';\n\nconst options: LoggerOptions = {\n level: process.env.LOG_LEVEL || (environment.production ? 'warn' : 'debug'),\n base: {\n env: environment.name,\n sha: environment.sha,\n branch: environment.branch,\n },\n};\n\n// pino-pretty has issues with nextjs and we cannot fix in webpack because we are moving to turbopack\n// https://github.com/pinojs/pino/issues/1841#issuecomment-1815284760\n// https://github.com/vercel/next.js/discussions/46987\nconst destination: DestinationStream | undefined = environment.production\n ? undefined\n : PinoPretty({\n colorize: true,\n // https://github.com/pinojs/pino-pretty#usage-with-jest\n sync: environment.test,\n });\nexport const logger = pino(options, destination);\n\n/** Options for creating a logger. */\nexport type CreateOptions = {\n /**\n * The name of the application.\n * @example `website`\n */\n name: string;\n};\n\n/**\n * Creates a logger for the application.\n * @param options - The options for creating the logger.\n * @returns The created logger.\n */\nexport function create({ name }: CreateOptions): Logger {\n const application = `paklo-${name}`;\n return logger.child({ application }, { level: environment.production ? 'warn' : 'debug' });\n}\n"],"mappings":";;;;;AAKA,MAAMA,UAAyB;CAC7B,OAAO,QAAQ,IAAI,cAAc,YAAY,aAAa,SAAS;CACnE,MAAM;EACJ,KAAK,YAAY;EACjB,KAAK,YAAY;EACjB,QAAQ,YAAY;EACrB;CACF;AAKD,MAAMC,cAA6C,YAAY,aAC3D,SACA,WAAW;CACT,UAAU;CAEV,MAAM,YAAY;CACnB,CAAC;AACN,MAAa,SAAS,KAAK,SAAS,YAAY;;;;;;AAgBhD,SAAgB,OAAO,EAAE,QAA+B;CACtD,MAAM,cAAc,SAAS;AAC7B,QAAO,OAAO,MAAM,EAAE,aAAa,EAAE,EAAE,OAAO,YAAY,aAAa,SAAS,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/shared-data/social-media.ts"],"sourcesContent":["// just me, for now\nexport const socials = {\n twitter: {\n username: 'maxwellweru',\n url: 'https://twitter.com/maxwellweru',\n },\n linkedin: {\n username: 'maxwellweru',\n url: 'https://www.linkedin.com/in/maxwellweru',\n },\n youtube: {\n channel: 'mburumaxwell',\n url: 'https://youtube.com/c/mburumaxwell',\n },\n github: {\n username: 'mburumaxwell',\n url: 'https://github.com/mburumaxwell',\n },\n};\n"],"mappings":";AACA,MAAa,UAAU;CACrB,SAAS;EACP,UAAU;EACV,KAAK;EACN;CACD,UAAU;EACR,UAAU;EACV,KAAK;EACN;CACD,SAAS;EACP,SAAS;EACT,KAAK;EACN;CACD,QAAQ;EACN,UAAU;EACV,KAAK;EACN;CACF"}
|
|
@@ -42,7 +42,6 @@ declare const UsageTelemetryRequestDataSchema: z.ZodObject<{
|
|
|
42
42
|
owner: z.ZodURL;
|
|
43
43
|
project: z.ZodOptional<z.ZodURL>;
|
|
44
44
|
'package-manager': z.ZodEnum<{
|
|
45
|
-
hex: "hex";
|
|
46
45
|
bundler: "bundler";
|
|
47
46
|
cargo: "cargo";
|
|
48
47
|
composer: "composer";
|
|
@@ -54,6 +53,7 @@ declare const UsageTelemetryRequestDataSchema: z.ZodObject<{
|
|
|
54
53
|
go_modules: "go_modules";
|
|
55
54
|
gradle: "gradle";
|
|
56
55
|
maven: "maven";
|
|
56
|
+
hex: "hex";
|
|
57
57
|
nuget: "nuget";
|
|
58
58
|
npm_and_yarn: "npm_and_yarn";
|
|
59
59
|
pip: "pip";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as DependabotSourceProviderSchema, h as DependabotPackageManagerSchema } from "./job-
|
|
1
|
+
import { b as DependabotSourceProviderSchema, h as DependabotPackageManagerSchema } from "./job-CxYcRj_D.js";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
|
|
4
4
|
//#region src/usage.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","names":[],"sources":["../src/usage.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { DependabotPackageManagerSchema, DependabotSourceProviderSchema } from '@/dependabot/job';\n\n/**\n * @example\n * ```json\n * {\n * \"host\": {\n * \"platform\": \"darwin\",\n * \"os\": \"25.0.0\",\n * \"arch\": \"arm64\",\n * \"machine-hash\": \"d3bbb66be2ad9dfab10af69b450f7e7e814ef7bbf1277a6d0df9e1db44ba4f5c\"\n * },\n * \"trigger\": \"user\",\n * \"provider\": \"azure\",\n * \"owner\": \"https://dev.azure.com/tingle/\",\n * \"package-manager\": \"terraform\",\n * \"version\": \"0.9.0\",\n * \"id\": 2850677077,\n * \"started\": \"2025-10-03T14:44:00.191Z\",\n * \"duration\": 31812,\n * \"success\": true\n * }\n * ```\n */\nexport const UsageTelemetryRequestDataSchema = z.object({\n host: z.object({\n platform: z.string().max(50), // e.g. linux, darwin, win32\n release: z.string().max(100), // e.g. 26.0.0, 10.0.19043\n arch: z.string().max(50), // e.g. x64, arm64\n 'machine-hash': z.string().max(250), // e.g. \"d3bbb66be2ad9dfab10af69b450f7e7e814ef7bbf1277a6d0df9e1db44ba4f5c\" for \"Maxwells-MacBook-Pro.local\"\n }),\n version: z.string().max(50),\n trigger: z.enum(['user', 'service']),\n provider: DependabotSourceProviderSchema,\n owner: z.url(),\n project: z.url().optional(), // was added later hence optional for backward compatibility\n 'package-manager': DependabotPackageManagerSchema,\n id: z.number(), // job identifier, for correlation\n started: z.coerce.date(),\n duration: z.number().min(0), // in milliseconds\n success: z.boolean(),\n});\n\n/**\n * @example\n * ```json\n * {\n * \"host\": {\n * \"platform\": \"darwin\",\n * \"os\": \"25.0.0\",\n * \"arch\": \"arm64\",\n * \"machine-hash\": \"d3bbb66be2ad9dfab10af69b450f7e7e814ef7bbf1277a6d0df9e1db44ba4f5c\"\n * },\n * \"trigger\": \"user\",\n * \"provider\": \"azure\",\n * \"owner\": \"https://dev.azure.com/tingle/\",\n * \"package-manager\": \"terraform\",\n * \"version\": \"0.9.0\",\n * \"id\": 2850677077,\n * \"started\": \"2025-10-03T14:44:00.191Z\",\n * \"duration\": 31812,\n * \"success\": true\n * }\n * ```\n */\nexport type UsageTelemetryRequestData = z.infer<typeof UsageTelemetryRequestDataSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,kCAAkC,EAAE,OAAO;CACtD,MAAM,EAAE,OAAO;EACb,UAAU,EAAE,QAAQ,CAAC,IAAI,GAAG;EAC5B,SAAS,EAAE,QAAQ,CAAC,IAAI,IAAI;EAC5B,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG;EACxB,gBAAgB,EAAE,QAAQ,CAAC,IAAI,IAAI;EACpC,CAAC;CACF,SAAS,EAAE,QAAQ,CAAC,IAAI,GAAG;CAC3B,SAAS,EAAE,KAAK,CAAC,QAAQ,UAAU,CAAC;CACpC,UAAU;CACV,OAAO,EAAE,KAAK;CACd,SAAS,EAAE,KAAK,CAAC,UAAU;CAC3B,mBAAmB;CACnB,IAAI,EAAE,QAAQ;CACd,SAAS,EAAE,OAAO,MAAM;CACxB,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC3B,SAAS,EAAE,SAAS;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,48 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paklo/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "mburumaxwell",
|
|
7
7
|
"license": "AGPL-3.0-later",
|
|
8
8
|
"exports": {
|
|
9
|
-
"./azure": {
|
|
10
|
-
"types": "./dist/node/azure.d.ts",
|
|
11
|
-
"node": "./dist/node/azure.js"
|
|
12
|
-
},
|
|
13
|
-
"./dependabot": {
|
|
14
|
-
"types": "./dist/node/dependabot.d.ts",
|
|
15
|
-
"node": "./dist/node/dependabot.js"
|
|
16
|
-
},
|
|
17
9
|
"./environment": {
|
|
18
|
-
"types": "./dist/
|
|
19
|
-
"
|
|
20
|
-
"browser": "./dist/browser/environment.js"
|
|
21
|
-
},
|
|
22
|
-
"./github": {
|
|
23
|
-
"types": "./dist/node/github.d.ts",
|
|
24
|
-
"node": "./dist/node/github.js",
|
|
25
|
-
"browser": "./dist/browser/github.js"
|
|
10
|
+
"types": "./dist/environment/index.d.ts",
|
|
11
|
+
"import": "./dist/environment/index.js"
|
|
26
12
|
},
|
|
27
13
|
"./http": {
|
|
28
|
-
"types": "./dist/
|
|
29
|
-
"
|
|
30
|
-
"browser": "./dist/browser/http.js"
|
|
14
|
+
"types": "./dist/http/index.d.ts",
|
|
15
|
+
"import": "./dist/http/index.js"
|
|
31
16
|
},
|
|
32
17
|
"./logger": {
|
|
33
|
-
"types": "./dist/
|
|
34
|
-
"
|
|
35
|
-
"browser": "./dist/browser/logger.js"
|
|
18
|
+
"types": "./dist/logger.d.ts",
|
|
19
|
+
"import": "./dist/logger.js"
|
|
36
20
|
},
|
|
37
21
|
"./shared-data": {
|
|
38
|
-
"types": "./dist/
|
|
39
|
-
"
|
|
40
|
-
"browser": "./dist/browser/shared-data.js"
|
|
22
|
+
"types": "./dist/shared-data/index.d.ts",
|
|
23
|
+
"import": "./dist/shared-data/index.js"
|
|
41
24
|
},
|
|
42
25
|
"./usage": {
|
|
43
|
-
"types": "./dist/
|
|
44
|
-
"
|
|
45
|
-
|
|
26
|
+
"types": "./dist/usage.d.ts",
|
|
27
|
+
"import": "./dist/usage.js"
|
|
28
|
+
},
|
|
29
|
+
"./github": {
|
|
30
|
+
"types": "./dist/github/index.d.ts",
|
|
31
|
+
"import": "./dist/github/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./dependabot": {
|
|
34
|
+
"types": "./dist/dependabot/index.d.ts",
|
|
35
|
+
"import": "./dist/dependabot/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./azure": {
|
|
38
|
+
"types": "./dist/azure/index.d.ts",
|
|
39
|
+
"import": "./dist/azure/index.js"
|
|
46
40
|
}
|
|
47
41
|
},
|
|
48
42
|
"files": [
|
|
@@ -51,7 +45,8 @@
|
|
|
51
45
|
],
|
|
52
46
|
"repository": {
|
|
53
47
|
"type": "git",
|
|
54
|
-
"url": "git+https://github.com/mburumaxwell/dependabot-azure-devops.git"
|
|
48
|
+
"url": "git+https://github.com/mburumaxwell/dependabot-azure-devops.git",
|
|
49
|
+
"directory": "packages/core"
|
|
55
50
|
},
|
|
56
51
|
"keywords": [
|
|
57
52
|
"dependabot",
|
|
@@ -65,7 +60,7 @@
|
|
|
65
60
|
"homepage": "https://github.com/mburumaxwell/dependabot-azure-devops#readme",
|
|
66
61
|
"dependencies": {
|
|
67
62
|
"@hono/zod-validator": "0.7.4",
|
|
68
|
-
"hono": "4.10.
|
|
63
|
+
"hono": "4.10.4",
|
|
69
64
|
"js-yaml": "4.1.0",
|
|
70
65
|
"pino": "10.1.0",
|
|
71
66
|
"pino-pretty": "13.1.2",
|
|
@@ -74,9 +69,9 @@
|
|
|
74
69
|
},
|
|
75
70
|
"devDependencies": {
|
|
76
71
|
"@types/js-yaml": "4.0.9",
|
|
77
|
-
"@types/node": "24.
|
|
72
|
+
"@types/node": "24.10.0",
|
|
78
73
|
"@types/semver": "7.7.1",
|
|
79
|
-
"tsdown": "0.15.
|
|
74
|
+
"tsdown": "0.15.12"
|
|
80
75
|
},
|
|
81
76
|
"publishConfig": {
|
|
82
77
|
"access": "public"
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/typeof.js
|
|
2
|
-
function _typeof(o) {
|
|
3
|
-
"@babel/helpers - typeof";
|
|
4
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
5
|
-
return typeof o$1;
|
|
6
|
-
} : function(o$1) {
|
|
7
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
8
|
-
}, _typeof(o);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/toPrimitive.js
|
|
13
|
-
function toPrimitive(t, r) {
|
|
14
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
15
|
-
var e = t[Symbol.toPrimitive];
|
|
16
|
-
if (void 0 !== e) {
|
|
17
|
-
var i = e.call(t, r || "default");
|
|
18
|
-
if ("object" != _typeof(i)) return i;
|
|
19
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
20
|
-
}
|
|
21
|
-
return ("string" === r ? String : Number)(t);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/toPropertyKey.js
|
|
26
|
-
function toPropertyKey(t) {
|
|
27
|
-
var i = toPrimitive(t, "string");
|
|
28
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/defineProperty.js
|
|
33
|
-
function _defineProperty(e, r, t) {
|
|
34
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
35
|
-
value: t,
|
|
36
|
-
enumerable: !0,
|
|
37
|
-
configurable: !0,
|
|
38
|
-
writable: !0
|
|
39
|
-
}) : e[r] = t, e;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { _defineProperty as t };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
3
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/environment/git.ts
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves the name of the current Git branch from the environment variables or from Git itself.
|
|
11
|
-
* The priority order for retrieving the branch name is as follows:
|
|
12
|
-
* 1. `process.env.GITHUB_REF_NAME`
|
|
13
|
-
* 2. `process.env.VERCEL_GIT_COMMIT_REF`
|
|
14
|
-
* 3. `process.env.CF_PAGES_BRANCH`
|
|
15
|
-
* 4. Retrieve the branch name from Git using the `getBranchFromGit` function.
|
|
16
|
-
* @returns The name of the current Git branch, or undefined if it cannot be determined.
|
|
17
|
-
*/
|
|
18
|
-
function getBranch() {
|
|
19
|
-
return process.env.GITHUB_REF_NAME || process.env.VERCEL_GIT_COMMIT_REF || process.env.CF_PAGES_BRANCH || getBranchFromGit();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Retrieves the Git SHA (commit hash) from the environment variables or from Git itself.
|
|
23
|
-
* The priority order for retrieving the Git SHA is as follows:
|
|
24
|
-
* 1. `process.env.GITHUB_SHA`
|
|
25
|
-
* 2. `process.env.VERCEL_GIT_COMMIT_SHA`
|
|
26
|
-
* 3. `process.env.CF_PAGES_COMMIT_SHA`
|
|
27
|
-
* 4. Retrieve the SHA from Git using the `getShaFromGit` function.
|
|
28
|
-
* @returns The Git SHA (commit hash) if available, otherwise `undefined`.
|
|
29
|
-
*/
|
|
30
|
-
function getSha() {
|
|
31
|
-
return process?.env.GITHUB_SHA || process?.env.VERCEL_GIT_COMMIT_SHA || process?.env.CF_PAGES_COMMIT_SHA || getShaFromGit();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Retrieves the SHA (commit hash) from the Git repository.
|
|
35
|
-
* @returns The SHA (commit hash) as a string, or undefined if it cannot be retrieved.
|
|
36
|
-
*/
|
|
37
|
-
function getShaFromGit() {
|
|
38
|
-
try {
|
|
39
|
-
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
40
|
-
const { execSync } = __require("node:child_process");
|
|
41
|
-
return execSync("git rev-parse HEAD").toString().trim();
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves the current branch name from Git.
|
|
49
|
-
* @returns The name of the current branch, or 'unknown' if an error occurs.
|
|
50
|
-
*/
|
|
51
|
-
function getBranchFromGit() {
|
|
52
|
-
try {
|
|
53
|
-
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
54
|
-
const { execSync } = __require("node:child_process");
|
|
55
|
-
return execSync("git rev-parse --abbrev-ref HEAD").toString().trim();
|
|
56
|
-
}
|
|
57
|
-
} catch {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/environment/platform.ts
|
|
64
|
-
function getPlatform() {
|
|
65
|
-
if (process.env.CONTAINER_APP_ENV_DNS_SUFFIX) return "azure_container_apps";
|
|
66
|
-
else if (process.env.WEBSITE_STATICWEBAPP_RESOURCE_ID) return "azure_static_web_app";
|
|
67
|
-
else if (process.env.WEBSITE_HOSTNAME) return "azure_app_service";
|
|
68
|
-
else if (process.env.CF_PAGES_URL) return "cloudflare_pages";
|
|
69
|
-
else if (process.env.VERCEL_BRANCH_URL) return "vercel";
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/environment/site-url.ts
|
|
74
|
-
/**
|
|
75
|
-
* Get the site URL based on the environment variables.
|
|
76
|
-
* @param options - The options to use.
|
|
77
|
-
* @returns The site URL.
|
|
78
|
-
*/
|
|
79
|
-
function getSiteUrlCombined({ development, main, defaultValue }) {
|
|
80
|
-
if (development) return `http://localhost:${process.env.PORT || 3e3}`;
|
|
81
|
-
if (main) return defaultValue;
|
|
82
|
-
let value = getSiteUrlForAca();
|
|
83
|
-
if (value && value.length > 0) return value;
|
|
84
|
-
value = getSiteUrlForAppService();
|
|
85
|
-
if (value && value.length > 0) return value;
|
|
86
|
-
value = getSiteUrlForSwa();
|
|
87
|
-
if (value && value.length > 0) return value;
|
|
88
|
-
value = process.env.VERCEL_BRANCH_URL;
|
|
89
|
-
if (value && value.length > 0) return `https://${value}`;
|
|
90
|
-
value = process.env.CF_PAGES_URL;
|
|
91
|
-
if (value && value.length > 0) return value;
|
|
92
|
-
return defaultValue;
|
|
93
|
-
}
|
|
94
|
-
function getSiteUrlForAca() {
|
|
95
|
-
const suffix = process.env.CONTAINER_APP_ENV_DNS_SUFFIX;
|
|
96
|
-
const name = process.env.CONTAINER_APP_NAME;
|
|
97
|
-
if (!suffix || !name) return void 0;
|
|
98
|
-
return `https://${name}.${suffix}`;
|
|
99
|
-
}
|
|
100
|
-
function getSiteUrlForAppService() {
|
|
101
|
-
const value = process.env.WEBSITE_HOSTNAME;
|
|
102
|
-
return value ? `https://${value}` : void 0;
|
|
103
|
-
}
|
|
104
|
-
function getSiteUrlForSwa() {
|
|
105
|
-
const clientIdMatch = process.env.WEBSITE_AUTH_V2_CONFIG_JSON?.match(/"clientId":"([^"]+)"/);
|
|
106
|
-
return clientIdMatch ? `https://${clientIdMatch[1]}` : void 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/environment/index.ts
|
|
111
|
-
function getEnvironment() {
|
|
112
|
-
const env = "development";
|
|
113
|
-
const branch = getBranch();
|
|
114
|
-
const sha = getSha();
|
|
115
|
-
const platform = getPlatform();
|
|
116
|
-
return {
|
|
117
|
-
name: env,
|
|
118
|
-
development: env === "development",
|
|
119
|
-
production: env === "production",
|
|
120
|
-
test: env === "test",
|
|
121
|
-
platform,
|
|
122
|
-
sha,
|
|
123
|
-
branch,
|
|
124
|
-
main: branch === "main"
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const environment = getEnvironment();
|
|
128
|
-
function getSiteUrl({ defaultValue }) {
|
|
129
|
-
const { development, main } = environment;
|
|
130
|
-
return getSiteUrlCombined({
|
|
131
|
-
development,
|
|
132
|
-
main,
|
|
133
|
-
defaultValue
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//#endregion
|
|
138
|
-
export { getSiteUrl as n, environment as t };
|
|
139
|
-
//# sourceMappingURL=environment-DinhzwQn.js.map
|