@paklo/core 0.1.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/LICENSE +21 -0
- package/dist/browser/defineProperty-ie4tC-F5.js +43 -0
- package/dist/browser/environment-DinhzwQn.js +139 -0
- package/dist/browser/environment-DinhzwQn.js.map +1 -0
- package/dist/browser/environment.d.ts +33 -0
- package/dist/browser/environment.js +3 -0
- package/dist/browser/github.d.ts +151 -0
- package/dist/browser/github.js +199 -0
- package/dist/browser/github.js.map +1 -0
- package/dist/browser/http.d.ts +121 -0
- package/dist/browser/http.js +248 -0
- package/dist/browser/http.js.map +1 -0
- package/dist/browser/logger-B7HLv660.js +31 -0
- package/dist/browser/logger-B7HLv660.js.map +1 -0
- package/dist/browser/logger.d.ts +23 -0
- package/dist/browser/logger.js +4 -0
- package/dist/browser/shared-data.d.ts +22 -0
- package/dist/browser/shared-data.js +23 -0
- package/dist/browser/shared-data.js.map +1 -0
- package/dist/browser/usage.d.ts +99 -0
- package/dist/browser/usage.js +383 -0
- package/dist/browser/usage.js.map +1 -0
- package/dist/node/azure.d.ts +338 -0
- package/dist/node/azure.js +735 -0
- package/dist/node/azure.js.map +1 -0
- package/dist/node/dependabot-BteoKZVy.js +547 -0
- package/dist/node/dependabot-BteoKZVy.js.map +1 -0
- package/dist/node/dependabot.d.ts +3 -0
- package/dist/node/dependabot.js +6 -0
- package/dist/node/environment-DX5CD-dD.js +138 -0
- package/dist/node/environment-DX5CD-dD.js.map +1 -0
- package/dist/node/environment.d.ts +33 -0
- package/dist/node/environment.js +3 -0
- package/dist/node/github.d.ts +2 -0
- package/dist/node/github.js +198 -0
- package/dist/node/github.js.map +1 -0
- package/dist/node/http-BG_-s47I.js +245 -0
- package/dist/node/http-BG_-s47I.js.map +1 -0
- package/dist/node/http.d.ts +121 -0
- package/dist/node/http.js +4 -0
- package/dist/node/index-3wZw74Ah.d.ts +151 -0
- package/dist/node/index-DP9JfUPG.d.ts +1761 -0
- package/dist/node/job-Crr4kh3e.js +451 -0
- package/dist/node/job-Crr4kh3e.js.map +1 -0
- package/dist/node/logger-bWnHxtAf.js +31 -0
- package/dist/node/logger-bWnHxtAf.js.map +1 -0
- package/dist/node/logger.d.ts +23 -0
- package/dist/node/logger.js +4 -0
- package/dist/node/shared-data.d.ts +22 -0
- package/dist/node/shared-data.js +23 -0
- package/dist/node/shared-data.js.map +1 -0
- package/dist/node/usage.d.ts +99 -0
- package/dist/node/usage.js +48 -0
- package/dist/node/usage.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import * as yaml from "js-yaml";
|
|
3
|
+
|
|
4
|
+
//#region src/dependabot/placeholder.ts
|
|
5
|
+
async function convertPlaceholder({ input, variableFinder }) {
|
|
6
|
+
if (!input) return void 0;
|
|
7
|
+
const matches = extractPlaceholder(input);
|
|
8
|
+
let result = input;
|
|
9
|
+
for (const match of matches) {
|
|
10
|
+
const placeholder = match[0];
|
|
11
|
+
const name = match[1];
|
|
12
|
+
const value = await variableFinder(name) ?? placeholder;
|
|
13
|
+
result = result.replace(placeholder, value);
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
function extractPlaceholder(input) {
|
|
18
|
+
return matchAll(input, /\${{\s*([a-zA-Z_]+[a-zA-Z0-9._-]*)\s*}}/g);
|
|
19
|
+
}
|
|
20
|
+
function matchAll(input, regexp, matches = []) {
|
|
21
|
+
const matchIfAny = regexp.exec(input);
|
|
22
|
+
if (matchIfAny) {
|
|
23
|
+
matches.push(matchIfAny);
|
|
24
|
+
matchAll(input, regexp, matches);
|
|
25
|
+
}
|
|
26
|
+
return matches;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/dependabot/config.ts
|
|
31
|
+
const DependabotRegistrySchema = z.object({
|
|
32
|
+
type: z.enum([
|
|
33
|
+
"composer-repository",
|
|
34
|
+
"docker-registry",
|
|
35
|
+
"git",
|
|
36
|
+
"hex-organization",
|
|
37
|
+
"hex-repository",
|
|
38
|
+
"maven-repository",
|
|
39
|
+
"npm-registry",
|
|
40
|
+
"nuget-feed",
|
|
41
|
+
"python-index",
|
|
42
|
+
"rubygems-server",
|
|
43
|
+
"terraform-registry"
|
|
44
|
+
]),
|
|
45
|
+
url: z.string().optional(),
|
|
46
|
+
username: z.string().optional(),
|
|
47
|
+
password: z.string().optional(),
|
|
48
|
+
key: z.string().optional(),
|
|
49
|
+
token: z.string().optional(),
|
|
50
|
+
"replaces-base": z.boolean().optional(),
|
|
51
|
+
host: z.string().optional(),
|
|
52
|
+
registry: z.string().optional(),
|
|
53
|
+
organization: z.string().optional(),
|
|
54
|
+
repo: z.string().optional(),
|
|
55
|
+
"public-key-fingerprint": z.string().optional(),
|
|
56
|
+
"index-url": z.string().optional(),
|
|
57
|
+
"auth-key": z.string().optional(),
|
|
58
|
+
"tenant-id": z.string().optional(),
|
|
59
|
+
"client-id": z.string().optional()
|
|
60
|
+
}).transform((value) => ({
|
|
61
|
+
...value,
|
|
62
|
+
type: value.type.replace("-", "_")
|
|
63
|
+
}));
|
|
64
|
+
const DependabotGroupSchema = z.object({
|
|
65
|
+
IDENTIFIER: z.string().check(z.regex(/^[a-zA-Z][a-zA-Z0-9|_-]*[a-zA-Z]$/, { message: "Group identifier must start and end with a letter, and can contain letters, pipes |, underscores _, or hyphens -." })).optional(),
|
|
66
|
+
"applies-to": z.enum(["version-updates", "security-updates"]).optional(),
|
|
67
|
+
"dependency-type": z.enum(["development", "production"]).optional(),
|
|
68
|
+
patterns: z.string().array().optional(),
|
|
69
|
+
"exclude-patterns": z.string().array().optional(),
|
|
70
|
+
"update-types": z.enum([
|
|
71
|
+
"major",
|
|
72
|
+
"minor",
|
|
73
|
+
"patch"
|
|
74
|
+
]).array().optional()
|
|
75
|
+
});
|
|
76
|
+
const DependabotAllowConditionSchema = z.object({
|
|
77
|
+
"dependency-name": z.string().optional(),
|
|
78
|
+
"dependency-type": z.enum([
|
|
79
|
+
"direct",
|
|
80
|
+
"indirect",
|
|
81
|
+
"all",
|
|
82
|
+
"production",
|
|
83
|
+
"development"
|
|
84
|
+
]).optional(),
|
|
85
|
+
"update-type": z.enum(["all", "security"]).optional()
|
|
86
|
+
});
|
|
87
|
+
const DependabotIgnoreConditionSchema = z.object({
|
|
88
|
+
"dependency-name": z.string().optional(),
|
|
89
|
+
versions: z.string().array().or(z.string()).optional(),
|
|
90
|
+
"update-types": z.enum([
|
|
91
|
+
"version-update:semver-major",
|
|
92
|
+
"version-update:semver-minor",
|
|
93
|
+
"version-update:semver-patch"
|
|
94
|
+
]).array().optional()
|
|
95
|
+
}).and(z.record(z.string(), z.any()));
|
|
96
|
+
const DependabotScheduleSchema = z.object({
|
|
97
|
+
interval: z.enum([
|
|
98
|
+
"daily",
|
|
99
|
+
"weekly",
|
|
100
|
+
"monthly",
|
|
101
|
+
"quarterly",
|
|
102
|
+
"semiannually",
|
|
103
|
+
"yearly",
|
|
104
|
+
"cron"
|
|
105
|
+
]),
|
|
106
|
+
day: z.enum([
|
|
107
|
+
"sunday",
|
|
108
|
+
"monday",
|
|
109
|
+
"tuesday",
|
|
110
|
+
"wednesday",
|
|
111
|
+
"thursday",
|
|
112
|
+
"friday",
|
|
113
|
+
"saturday"
|
|
114
|
+
]).optional().default("monday"),
|
|
115
|
+
time: z.string().default("02:00").check(z.regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/, { message: "Time must be in HH:MM format" })).optional(),
|
|
116
|
+
timezone: z.string().optional().default("Etc/UTC").refine((value) => {
|
|
117
|
+
try {
|
|
118
|
+
Intl.DateTimeFormat(void 0, { timeZone: value });
|
|
119
|
+
return true;
|
|
120
|
+
} catch {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}, { message: "Invalid IANA time zone" }),
|
|
124
|
+
cronjob: z.string().check(z.regex(/^\S+ \S+ \S+ \S+ \S+$/, { message: "Cronjob must be in standard cron format" })).optional()
|
|
125
|
+
});
|
|
126
|
+
const DependabotCommitMessageSchema = z.object({
|
|
127
|
+
prefix: z.string().optional(),
|
|
128
|
+
"prefix-development": z.string().optional(),
|
|
129
|
+
include: z.string().optional()
|
|
130
|
+
});
|
|
131
|
+
const DependabotCooldownSchema = z.object({
|
|
132
|
+
"default-days": z.number().optional(),
|
|
133
|
+
"semver-major-days": z.number().optional(),
|
|
134
|
+
"semver-minor-days": z.number().optional(),
|
|
135
|
+
"semver-patch-days": z.number().optional(),
|
|
136
|
+
include: z.string().array().optional(),
|
|
137
|
+
exclude: z.string().array().optional()
|
|
138
|
+
});
|
|
139
|
+
const DependabotPullRequestBranchNameSchema = z.object({ separator: z.string().optional() });
|
|
140
|
+
const PackageEcosystemSchema = z.enum([
|
|
141
|
+
"bun",
|
|
142
|
+
"bundler",
|
|
143
|
+
"cargo",
|
|
144
|
+
"composer",
|
|
145
|
+
"devcontainers",
|
|
146
|
+
"docker",
|
|
147
|
+
"docker-compose",
|
|
148
|
+
"dotnet-sdk",
|
|
149
|
+
"helm",
|
|
150
|
+
"mix",
|
|
151
|
+
"elm",
|
|
152
|
+
"gitsubmodule",
|
|
153
|
+
"github-actions",
|
|
154
|
+
"gomod",
|
|
155
|
+
"gradle",
|
|
156
|
+
"maven",
|
|
157
|
+
"npm",
|
|
158
|
+
"nuget",
|
|
159
|
+
"pip",
|
|
160
|
+
"pub",
|
|
161
|
+
"swift",
|
|
162
|
+
"terraform",
|
|
163
|
+
"uv",
|
|
164
|
+
"pipenv",
|
|
165
|
+
"pip-compile",
|
|
166
|
+
"poetry",
|
|
167
|
+
"pnpm",
|
|
168
|
+
"yarn"
|
|
169
|
+
]);
|
|
170
|
+
const VersioningStrategySchema = z.enum([
|
|
171
|
+
"auto",
|
|
172
|
+
"increase",
|
|
173
|
+
"increase-if-necessary",
|
|
174
|
+
"lockfile-only",
|
|
175
|
+
"widen"
|
|
176
|
+
]);
|
|
177
|
+
const DependabotUpdateSchema = z.object({
|
|
178
|
+
"package-ecosystem": PackageEcosystemSchema,
|
|
179
|
+
directory: z.string().optional(),
|
|
180
|
+
directories: z.string().array().optional(),
|
|
181
|
+
allow: DependabotAllowConditionSchema.array().optional(),
|
|
182
|
+
assignees: z.string().array().optional(),
|
|
183
|
+
"commit-message": DependabotCommitMessageSchema.optional(),
|
|
184
|
+
cooldown: DependabotCooldownSchema.optional(),
|
|
185
|
+
groups: z.record(z.string(), DependabotGroupSchema).optional(),
|
|
186
|
+
ignore: DependabotIgnoreConditionSchema.array().optional(),
|
|
187
|
+
"insecure-external-code-execution": z.enum(["allow", "deny"]).optional(),
|
|
188
|
+
labels: z.string().array().optional(),
|
|
189
|
+
milestone: z.coerce.string().optional(),
|
|
190
|
+
"open-pull-requests-limit": z.number().check(z.int(), z.gte(0)).optional(),
|
|
191
|
+
"pull-request-branch-name": DependabotPullRequestBranchNameSchema.optional(),
|
|
192
|
+
"rebase-strategy": z.string().optional(),
|
|
193
|
+
registries: z.string().array().optional(),
|
|
194
|
+
schedule: DependabotScheduleSchema.optional(),
|
|
195
|
+
"target-branch": z.string().optional(),
|
|
196
|
+
vendor: z.boolean().optional(),
|
|
197
|
+
"versioning-strategy": VersioningStrategySchema.optional()
|
|
198
|
+
}).transform((value, { addIssue }) => {
|
|
199
|
+
if (!value.directory && (!value.directories || value.directories.length === 0)) addIssue("Either 'directory' or 'directories' must be specified in the dependency update configuration.");
|
|
200
|
+
if (value.directory && /[*?[\]{}]/.test(value.directory)) addIssue("The 'directory' field must not include glob pattern.");
|
|
201
|
+
value["open-pull-requests-limit"] ??= 5;
|
|
202
|
+
return value;
|
|
203
|
+
});
|
|
204
|
+
/**
|
|
205
|
+
* Represents the dependabot.yaml configuration file options.
|
|
206
|
+
* See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-dependabotyml
|
|
207
|
+
*/
|
|
208
|
+
const DependabotConfigSchema = z.object({
|
|
209
|
+
version: z.number().refine((v) => v === 2, { message: "Only version 2 of dependabot is supported" }),
|
|
210
|
+
updates: DependabotUpdateSchema.array().check(z.minLength(1, { message: "At least one update configuration is required" })),
|
|
211
|
+
registries: z.record(z.string(), DependabotRegistrySchema).optional(),
|
|
212
|
+
"enable-beta-ecosystems": z.boolean().optional()
|
|
213
|
+
});
|
|
214
|
+
function parseUpdates(config, configPath) {
|
|
215
|
+
const updates = [];
|
|
216
|
+
for (const update of config.updates) {
|
|
217
|
+
if (update.ignore) for (const condition of update.ignore) {
|
|
218
|
+
condition.source ??= configPath;
|
|
219
|
+
condition["updated-at"] ??= (/* @__PURE__ */ new Date()).toISOString();
|
|
220
|
+
}
|
|
221
|
+
updates.push(update);
|
|
222
|
+
}
|
|
223
|
+
return updates;
|
|
224
|
+
}
|
|
225
|
+
async function parseRegistries(config, variableFinder) {
|
|
226
|
+
const registries = {};
|
|
227
|
+
for (const [key, registry] of Object.entries(config.registries || {})) {
|
|
228
|
+
const updated = { ...registry };
|
|
229
|
+
const { type } = updated;
|
|
230
|
+
if (type === "hex_organization" && !updated.organization) throw new Error(`The value 'organization' in dependency registry config '${type}' is missing`);
|
|
231
|
+
if (type === "hex_repository" && !updated.repo) throw new Error(`The value 'repo' in dependency registry config '${key}' is missing`);
|
|
232
|
+
updated.username = await convertPlaceholder({
|
|
233
|
+
input: updated.username,
|
|
234
|
+
variableFinder
|
|
235
|
+
});
|
|
236
|
+
updated.password = await convertPlaceholder({
|
|
237
|
+
input: updated.password,
|
|
238
|
+
variableFinder
|
|
239
|
+
});
|
|
240
|
+
updated.key = await convertPlaceholder({
|
|
241
|
+
input: updated.key,
|
|
242
|
+
variableFinder
|
|
243
|
+
});
|
|
244
|
+
updated.token = await convertPlaceholder({
|
|
245
|
+
input: updated.token,
|
|
246
|
+
variableFinder
|
|
247
|
+
});
|
|
248
|
+
const url = updated.url;
|
|
249
|
+
if (!url && type !== "hex_organization") throw new Error(`The value 'url' in dependency registry config '${key}' is missing`);
|
|
250
|
+
if (url) {
|
|
251
|
+
if (URL.canParse(url)) {
|
|
252
|
+
const parsedUrl = new URL(url);
|
|
253
|
+
if (type === "docker_registry" || type === "npm_registry") updated.registry = url.replace("https://", "").replace("http://", "");
|
|
254
|
+
if (type === "terraform_registry" || type === "composer_repository") updated.host = parsedUrl.hostname;
|
|
255
|
+
}
|
|
256
|
+
if (type === "python_index") updated["index-url"] = url;
|
|
257
|
+
if (type === "docker_registry" || type === "npm_registry" || type === "terraform_registry" || type === "python_index") delete updated.url;
|
|
258
|
+
}
|
|
259
|
+
registries[key] = updated;
|
|
260
|
+
}
|
|
261
|
+
return registries;
|
|
262
|
+
}
|
|
263
|
+
function validateConfiguration(updates, registries) {
|
|
264
|
+
const configured = Object.keys(registries);
|
|
265
|
+
const referenced = [];
|
|
266
|
+
for (const u of updates) referenced.push(...u.registries ?? []);
|
|
267
|
+
const missingConfiguration = referenced.filter((el) => !configured.includes(el));
|
|
268
|
+
if (missingConfiguration.length > 0) throw new Error(`Referenced registries: '${missingConfiguration.join(",")}' have not been configured in the root of dependabot.yml`);
|
|
269
|
+
const missingReferences = configured.filter((el) => !referenced.includes(el));
|
|
270
|
+
if (missingReferences.length > 0) throw new Error(`Registries: '${missingReferences.join(",")}' have not been referenced by any update`);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Possible paths to the dependabot config file.
|
|
274
|
+
* Remember to prefix with a forward slash when querying API endpoints or where necessary.
|
|
275
|
+
*/
|
|
276
|
+
const POSSIBLE_CONFIG_FILE_PATHS = [
|
|
277
|
+
".azuredevops/dependabot.yml",
|
|
278
|
+
".azuredevops/dependabot.yaml",
|
|
279
|
+
".github/dependabot.yaml",
|
|
280
|
+
".github/dependabot.yml"
|
|
281
|
+
];
|
|
282
|
+
/**
|
|
283
|
+
* Parse the contents of a dependabot config YAML file
|
|
284
|
+
* @returns {DependabotConfig} config - the dependabot configuration
|
|
285
|
+
*/
|
|
286
|
+
async function parseDependabotConfig({ configContents, configPath, variableFinder }) {
|
|
287
|
+
const loadedConfig = yaml.load(configContents);
|
|
288
|
+
if (loadedConfig === null || typeof loadedConfig !== "object") throw new Error("Invalid dependabot config object");
|
|
289
|
+
const config = await DependabotConfigSchema.parseAsync(loadedConfig);
|
|
290
|
+
const updates = parseUpdates(config, configPath);
|
|
291
|
+
const registries = await parseRegistries(config, variableFinder);
|
|
292
|
+
validateConfiguration(updates, registries);
|
|
293
|
+
return {
|
|
294
|
+
...config,
|
|
295
|
+
updates,
|
|
296
|
+
registries
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/dependabot/job.ts
|
|
302
|
+
const DependabotCredentialSchema = z.record(z.string(), z.any());
|
|
303
|
+
const CertificateAuthoritySchema = z.object({
|
|
304
|
+
cert: z.string(),
|
|
305
|
+
key: z.string()
|
|
306
|
+
});
|
|
307
|
+
const DependabotProxyConfigSchema = z.object({
|
|
308
|
+
all_credentials: DependabotCredentialSchema.array(),
|
|
309
|
+
ca: CertificateAuthoritySchema
|
|
310
|
+
});
|
|
311
|
+
const DependabotSourceProviderSchema = z.enum(["azure"]);
|
|
312
|
+
const DependabotSourceSchema = z.object({
|
|
313
|
+
provider: DependabotSourceProviderSchema,
|
|
314
|
+
repo: z.string(),
|
|
315
|
+
directory: z.string().nullish(),
|
|
316
|
+
directories: z.string().array().nullish(),
|
|
317
|
+
branch: z.string().nullish(),
|
|
318
|
+
commit: z.string().nullish(),
|
|
319
|
+
hostname: z.string().nullish(),
|
|
320
|
+
"api-endpoint": z.string().nullish()
|
|
321
|
+
});
|
|
322
|
+
const DependabotExistingPRSchema = z.object({
|
|
323
|
+
"dependency-name": z.string(),
|
|
324
|
+
"dependency-version": z.string().nullish(),
|
|
325
|
+
directory: z.string().nullish(),
|
|
326
|
+
removed: z.boolean().nullish()
|
|
327
|
+
});
|
|
328
|
+
const DependabotExistingGroupPRSchema = z.object({
|
|
329
|
+
"dependency-group-name": z.string(),
|
|
330
|
+
dependencies: DependabotExistingPRSchema.array()
|
|
331
|
+
});
|
|
332
|
+
const DependabotAllowedSchema = z.object({
|
|
333
|
+
"dependency-name": z.string().nullish(),
|
|
334
|
+
"dependency-type": z.string().nullish(),
|
|
335
|
+
"update-type": z.enum(["all", "security"]).optional()
|
|
336
|
+
});
|
|
337
|
+
const DependabotGroupRuleJobSchema = z.object({
|
|
338
|
+
patterns: z.string().array().nullish(),
|
|
339
|
+
"exclude-patterns": z.string().array().nullish(),
|
|
340
|
+
"dependency-type": z.string().nullish(),
|
|
341
|
+
"update-types": z.string().array().nullish()
|
|
342
|
+
});
|
|
343
|
+
const DependabotGroupJobSchema = z.object({
|
|
344
|
+
name: z.string(),
|
|
345
|
+
"applies-to": z.string().nullish(),
|
|
346
|
+
rules: DependabotGroupRuleJobSchema
|
|
347
|
+
});
|
|
348
|
+
const DependabotConditionSchema = z.object({
|
|
349
|
+
"dependency-name": z.string(),
|
|
350
|
+
source: z.string().nullish(),
|
|
351
|
+
"update-types": z.string().array().nullish(),
|
|
352
|
+
"updated-at": z.coerce.string().nullish(),
|
|
353
|
+
"version-requirement": z.string().nullish()
|
|
354
|
+
});
|
|
355
|
+
const DependabotSecurityAdvisorySchema = z.object({
|
|
356
|
+
"dependency-name": z.string(),
|
|
357
|
+
"affected-versions": z.string().array(),
|
|
358
|
+
"patched-versions": z.string().array().nullish(),
|
|
359
|
+
"unaffected-versions": z.string().array()
|
|
360
|
+
});
|
|
361
|
+
const DependabotRequirementSourceSchema = z.record(z.string(), z.any());
|
|
362
|
+
const DependabotRequirementSchema = z.object({
|
|
363
|
+
file: z.string().nullish(),
|
|
364
|
+
groups: z.string().array().nullish(),
|
|
365
|
+
metadata: z.record(z.string(), z.any()).nullish(),
|
|
366
|
+
requirement: z.string().nullish(),
|
|
367
|
+
source: DependabotRequirementSourceSchema.nullish(),
|
|
368
|
+
version: z.string().nullish(),
|
|
369
|
+
"previous-version": z.string().nullish()
|
|
370
|
+
});
|
|
371
|
+
const DependabotDependencySchema = z.object({
|
|
372
|
+
name: z.string(),
|
|
373
|
+
"previous-requirements": DependabotRequirementSchema.array().nullish(),
|
|
374
|
+
"previous-version": z.string().nullish(),
|
|
375
|
+
version: z.string().nullish(),
|
|
376
|
+
requirements: DependabotRequirementSchema.array().nullish(),
|
|
377
|
+
removed: z.boolean().nullish(),
|
|
378
|
+
directory: z.string().nullish()
|
|
379
|
+
});
|
|
380
|
+
const DependabotCommitOptionsSchema = z.object({
|
|
381
|
+
prefix: z.string().nullish(),
|
|
382
|
+
"prefix-development": z.string().nullish(),
|
|
383
|
+
"include-scope": z.boolean().nullish()
|
|
384
|
+
});
|
|
385
|
+
const DependabotExperimentsSchema = z.record(z.string(), z.union([z.string(), z.boolean()]));
|
|
386
|
+
const DependabotPackageManagerSchema = z.enum([
|
|
387
|
+
"bun",
|
|
388
|
+
"bundler",
|
|
389
|
+
"cargo",
|
|
390
|
+
"composer",
|
|
391
|
+
"devcontainers",
|
|
392
|
+
"docker",
|
|
393
|
+
"docker_compose",
|
|
394
|
+
"dotnet_sdk",
|
|
395
|
+
"helm",
|
|
396
|
+
"hex",
|
|
397
|
+
"elm",
|
|
398
|
+
"submodules",
|
|
399
|
+
"github_actions",
|
|
400
|
+
"go_modules",
|
|
401
|
+
"gradle",
|
|
402
|
+
"maven",
|
|
403
|
+
"npm_and_yarn",
|
|
404
|
+
"nuget",
|
|
405
|
+
"pip",
|
|
406
|
+
"pub",
|
|
407
|
+
"swift",
|
|
408
|
+
"terraform",
|
|
409
|
+
"uv"
|
|
410
|
+
]);
|
|
411
|
+
const DependabotCommandSchema = z.enum([
|
|
412
|
+
"graph",
|
|
413
|
+
"version",
|
|
414
|
+
"recreate"
|
|
415
|
+
]);
|
|
416
|
+
const DependabotJobConfigSchema = z.object({
|
|
417
|
+
id: z.number().optional(),
|
|
418
|
+
command: DependabotCommandSchema.optional(),
|
|
419
|
+
"package-manager": DependabotPackageManagerSchema,
|
|
420
|
+
"allowed-updates": DependabotAllowedSchema.array(),
|
|
421
|
+
debug: z.boolean().nullable(),
|
|
422
|
+
"dependency-groups": DependabotGroupJobSchema.array().nullish(),
|
|
423
|
+
dependencies: z.string().array().nullable(),
|
|
424
|
+
"dependency-group-to-refresh": z.string().nullish(),
|
|
425
|
+
"existing-pull-requests": DependabotExistingPRSchema.array().array(),
|
|
426
|
+
"existing-group-pull-requests": DependabotExistingGroupPRSchema.array(),
|
|
427
|
+
experiments: DependabotExperimentsSchema,
|
|
428
|
+
"ignore-conditions": DependabotConditionSchema.array(),
|
|
429
|
+
"lockfile-only": z.boolean(),
|
|
430
|
+
"requirements-update-strategy": z.string().nullable(),
|
|
431
|
+
"security-advisories": DependabotSecurityAdvisorySchema.array(),
|
|
432
|
+
"security-updates-only": z.boolean(),
|
|
433
|
+
source: DependabotSourceSchema,
|
|
434
|
+
"update-subdependencies": z.boolean(),
|
|
435
|
+
"updating-a-pull-request": z.boolean(),
|
|
436
|
+
"vendor-dependencies": z.boolean(),
|
|
437
|
+
"reject-external-code": z.boolean().nullish(),
|
|
438
|
+
"repo-private": z.boolean(),
|
|
439
|
+
"commit-message-options": DependabotCommitOptionsSchema,
|
|
440
|
+
"credentials-metadata": DependabotCredentialSchema.array().nullish(),
|
|
441
|
+
"max-updater-run-time": z.int().nullish(),
|
|
442
|
+
cooldown: DependabotCooldownSchema.nullish(),
|
|
443
|
+
"proxy-log-response-body-on-auth-failure": z.boolean().nullish(),
|
|
444
|
+
"enable-beta-ecosystems": z.boolean().nullish(),
|
|
445
|
+
"multi-ecosystem-update": z.boolean().nullish()
|
|
446
|
+
});
|
|
447
|
+
const DependabotJobFileSchema = z.object({ job: DependabotJobConfigSchema });
|
|
448
|
+
|
|
449
|
+
//#endregion
|
|
450
|
+
export { DependabotUpdateSchema as A, DependabotCommitMessageSchema as C, DependabotIgnoreConditionSchema as D, DependabotGroupSchema as E, parseRegistries as F, parseUpdates as I, validateConfiguration as L, PackageEcosystemSchema as M, VersioningStrategySchema as N, DependabotRegistrySchema as O, parseDependabotConfig as P, convertPlaceholder 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, POSSIBLE_CONFIG_FILE_PATHS as j, DependabotScheduleSchema 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, extractPlaceholder as z };
|
|
451
|
+
//# sourceMappingURL=job-Crr4kh3e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-Crr4kh3e.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 'composer-repository',\n 'docker-registry',\n 'git',\n 'hex-organization',\n 'hex-repository',\n 'maven-repository',\n 'npm-registry',\n 'nuget-feed',\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 '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 'maven',\n 'npm',\n 'nuget',\n 'pip',\n 'pub',\n 'swift',\n 'terraform',\n 'uv',\n\n // Additional aliases, sometimes used for convenience\n 'pipenv',\n 'pip-compile',\n 'poetry',\n 'pnpm',\n 'yarn',\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 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(),\n 'target-branch': z.string().optional(),\n vendor: z.boolean().optional(),\n 'versioning-strategy': VersioningStrategySchema.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 return value;\n });\nexport type DependabotUpdate = z.infer<typeof DependabotUpdateSchema>;\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.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 * 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\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 // 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 === 'terraform_registry' || type === 'composer_repository';\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 // TODO: refine to ensure either directory or directories is provided\n // TODO: refine to ensure either both hostname and api-endpoint have a value or both are undefined\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 'bun',\n 'bundler',\n 'cargo',\n 'composer',\n 'devcontainers',\n 'docker',\n 'docker_compose', // // ecosystem(s): 'docker-compose',\n 'dotnet_sdk', // ecosystem(s): 'dotnet-sdk'\n 'helm',\n 'hex', // ecosystem(s): 'mix'\n 'elm',\n 'submodules', // ecosystem(s): 'gitsubmodule'\n 'github_actions', // ecosystem(s): 'github-actions'\n 'go_modules', // ecosystem(s): 'gomod'\n 'gradle',\n 'maven',\n 'npm_and_yarn', // ecosystem(s): 'npm', 'pnpm', 'yarn'\n 'nuget',\n 'pip', // ecosystem(s): 'pipenv', 'pip-compile', 'poetry'\n 'pub',\n 'swift',\n 'terraform',\n 'uv',\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});\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,KAAI,CAAC,MAAO,QAAO;CAEnB,MAAMA,UAA6B,mBAAmB,MAAM;CAC5D,I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AC5B,gCAAgC,EAAE,QAAQ,CAAC,UAAU;CACrD,uBAAuB,iCAAiC,OAAO;CAC/D,yBAAyB,EAAE,SAAS;CACpC,QAAQ;CACR,0BAA0B,EAAE,SAAS;CACrC,2BAA2B,EAAE,SAAS;CACtC,uBAAuB,EAAE,SAAS;CAClC,wBAAwB,EAAE,SAAS,CAAC,SAAS;CAC7C,gBAAgB,EAAE,SAAS;CAC3B,0BAA0B;CAC1B,wBAAwB,2BAA2B,OAAO,CAAC,SAAS;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;CAChD,CAAC;AAGF,MAAa,0BAA0B,EAAE,OAAO,EAC9C,KAAK,2BACN,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as environment } from "./environment-DX5CD-dD.js";
|
|
2
|
+
import pino from "pino";
|
|
3
|
+
import { PinoPretty } from "pino-pretty";
|
|
4
|
+
|
|
5
|
+
//#region src/logger.ts
|
|
6
|
+
const options = {
|
|
7
|
+
level: process.env.LOG_LEVEL || (environment.production ? "warn" : "debug"),
|
|
8
|
+
base: {
|
|
9
|
+
env: environment.name,
|
|
10
|
+
sha: environment.sha,
|
|
11
|
+
branch: environment.branch
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const destination = environment.production ? void 0 : PinoPretty({
|
|
15
|
+
colorize: true,
|
|
16
|
+
sync: environment.test
|
|
17
|
+
});
|
|
18
|
+
const logger = pino(options, destination);
|
|
19
|
+
/**
|
|
20
|
+
* Creates a logger for the application.
|
|
21
|
+
* @param options - The options for creating the logger.
|
|
22
|
+
* @returns The created logger.
|
|
23
|
+
*/
|
|
24
|
+
function create({ name }) {
|
|
25
|
+
const application = `paklo-${name}`;
|
|
26
|
+
return logger.child({ application }, { level: environment.production ? "warn" : "debug" });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { logger as n, create as t };
|
|
31
|
+
//# sourceMappingURL=logger-bWnHxtAf.js.map
|
|
@@ -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,23 @@
|
|
|
1
|
+
import pino, { Logger } from "pino";
|
|
2
|
+
|
|
3
|
+
//#region src/logger.d.ts
|
|
4
|
+
declare const logger: pino.Logger<never, boolean>;
|
|
5
|
+
/** Options for creating a logger. */
|
|
6
|
+
type CreateOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the application.
|
|
9
|
+
* @example `website`
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Creates a logger for the application.
|
|
15
|
+
* @param options - The options for creating the logger.
|
|
16
|
+
* @returns The created logger.
|
|
17
|
+
*/
|
|
18
|
+
declare function create({
|
|
19
|
+
name
|
|
20
|
+
}: CreateOptions): Logger;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { CreateOptions, create, logger };
|
|
23
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/shared-data/social-media.d.ts
|
|
2
|
+
declare const socials: {
|
|
3
|
+
twitter: {
|
|
4
|
+
username: string;
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
linkedin: {
|
|
8
|
+
username: string;
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
youtube: {
|
|
12
|
+
channel: string;
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
github: {
|
|
16
|
+
username: string;
|
|
17
|
+
url: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { socials };
|
|
22
|
+
//# sourceMappingURL=shared-data.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/shared-data/social-media.ts
|
|
2
|
+
const socials = {
|
|
3
|
+
twitter: {
|
|
4
|
+
username: "maxwellweru",
|
|
5
|
+
url: "https://twitter.com/maxwellweru"
|
|
6
|
+
},
|
|
7
|
+
linkedin: {
|
|
8
|
+
username: "maxwellweru",
|
|
9
|
+
url: "https://www.linkedin.com/in/maxwellweru"
|
|
10
|
+
},
|
|
11
|
+
youtube: {
|
|
12
|
+
channel: "mburumaxwell",
|
|
13
|
+
url: "https://youtube.com/c/mburumaxwell"
|
|
14
|
+
},
|
|
15
|
+
github: {
|
|
16
|
+
username: "mburumaxwell",
|
|
17
|
+
url: "https://github.com/mburumaxwell"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { socials };
|
|
23
|
+
//# sourceMappingURL=shared-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-data.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"}
|