pepr 0.55.6-nightly.1 → 0.55.6-nightly.10

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.
@@ -21,7 +21,6 @@ export declare const dependencies: {
21
21
  }, devDependencies: {
22
22
  "@commitlint/cli": string;
23
23
  "@commitlint/config-conventional": string;
24
- "@fast-check/vitest": string;
25
24
  "@semantic-release/commit-analyzer": string;
26
25
  "@semantic-release/git": string;
27
26
  "@semantic-release/npm": string;
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/cli/init/templates.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrE,eAAO,MAAQ,YAAY;;;;;;;;;;;;;;;;GAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAE,gBAAgB;;;;;;;;;;;GAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAE,OAAO,QAAgB,CAAC;AAEjG,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1B,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,OAAO,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,YAAY,CAAC;YAC3B,YAAY,EAAE;gBAAE,UAAU,EAAE,MAAM,EAA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rB,CAAC;QACF,OAAO,EAAE;YAAE,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC;QACjC,YAAY,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/C,eAAe,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACzC,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CA4D7D;AAED,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,eAAO,MAAM,SAAS;;;CAGrB,CAAC;AAEF,eAAO,MAAM,SAAS;;;CAGrB,CAAC;AAEF,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;CAGnB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;CAGxB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;CAGpB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;CAGpB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAgBlB,CAAC"}
package/dist/cli.js CHANGED
@@ -8073,6 +8073,10 @@ function storeRoleBinding(name2) {
8073
8073
  var import_fs2 = require("fs");
8074
8074
 
8075
8075
  // src/lib/assets/ignoredNamespaces.ts
8076
+ function getIgnoreNamespaces(config) {
8077
+ const fromConfig = config?.alwaysIgnore?.namespaces?.length ? config.alwaysIgnore.namespaces : config?.admission?.alwaysIgnore?.namespaces;
8078
+ return resolveIgnoreNamespaces(fromConfig);
8079
+ }
8076
8080
  function resolveIgnoreNamespaces(ignoredNSConfig = []) {
8077
8081
  const ignoredNSEnv = process.env.PEPR_ADDITIONAL_IGNORED_NAMESPACES;
8078
8082
  if (!ignoredNSEnv) {
@@ -8091,23 +8095,14 @@ async function overridesFile({ hash, name: name2, image, config, apiPath, capabi
8091
8095
  const rbacOverrides = clusterRole(name2, capabilities, config.rbacMode, config.rbac).rules;
8092
8096
  const overrides = {
8093
8097
  imagePullSecrets,
8094
- additionalIgnoredNamespaces: resolveIgnoreNamespaces(
8095
- config?.alwaysIgnore?.namespaces?.length ? config?.alwaysIgnore?.namespaces : config?.admission?.alwaysIgnore?.namespaces
8096
- ),
8098
+ additionalIgnoredNamespaces: getIgnoreNamespaces(config),
8097
8099
  rbac: rbacOverrides,
8098
- secrets: {
8099
- apiPath: Buffer.from(apiPath).toString("base64")
8100
- },
8100
+ secrets: { apiPath: Buffer.from(apiPath).toString("base64") },
8101
8101
  hash,
8102
- namespace: {
8103
- annotations: {},
8104
- labels: config.customLabels?.namespace ?? {
8105
- "pepr.dev": ""
8106
- }
8107
- },
8102
+ namespace: namespaceBlock(config),
8108
8103
  uuid: name2,
8109
8104
  admission: {
8110
- enabled: controllerType.admission === true ? true : false,
8105
+ enabled: controllerType.admission === true,
8111
8106
  antiAffinity: false,
8112
8107
  terminationGracePeriodSeconds: 5,
8113
8108
  failurePolicy: config.onError === "reject" ? "Fail" : "Ignore",
@@ -8115,55 +8110,12 @@ async function overridesFile({ hash, name: name2, image, config, apiPath, capabi
8115
8110
  env: genEnv(config, false, true),
8116
8111
  envFrom: [],
8117
8112
  image,
8118
- annotations: {
8119
- "pepr.dev/description": `${config.description}` || ""
8120
- },
8121
- labels: {
8122
- app: name2,
8123
- "pepr.dev/controller": "admission",
8124
- "pepr.dev/uuid": config.uuid
8125
- },
8126
- securityContext: {
8127
- runAsUser: image.includes("private") ? 1e3 : 65532,
8128
- runAsGroup: image.includes("private") ? 1e3 : 65532,
8129
- runAsNonRoot: true,
8130
- fsGroup: image.includes("private") ? 1e3 : 65532
8131
- },
8132
- readinessProbe: {
8133
- httpGet: {
8134
- path: "/healthz",
8135
- port: 3e3,
8136
- scheme: "HTTPS"
8137
- },
8138
- initialDelaySeconds: 10
8139
- },
8140
- livenessProbe: {
8141
- httpGet: {
8142
- path: "/healthz",
8143
- port: 3e3,
8144
- scheme: "HTTPS"
8145
- },
8146
- initialDelaySeconds: 10
8147
- },
8148
- resources: {
8149
- requests: {
8150
- memory: "256Mi",
8151
- cpu: "200m"
8152
- },
8153
- limits: {
8154
- memory: "512Mi",
8155
- cpu: "500m"
8156
- }
8157
- },
8158
- containerSecurityContext: {
8159
- runAsUser: image.includes("private") ? 1e3 : 65532,
8160
- runAsGroup: image.includes("private") ? 1e3 : 65532,
8161
- runAsNonRoot: true,
8162
- allowPrivilegeEscalation: false,
8163
- capabilities: {
8164
- drop: ["ALL"]
8165
- }
8166
- },
8113
+ annotations: controllerAnnotations(config.description),
8114
+ labels: controllerLabels(name2, config.uuid, "admission"),
8115
+ securityContext: podSecurityContext(image),
8116
+ ...commonProbes(),
8117
+ resources: commonResources(),
8118
+ containerSecurityContext: containerSecurityContext(image),
8167
8119
  podAnnotations: {},
8168
8120
  podLabels: {},
8169
8121
  nodeSelector: {},
@@ -8178,60 +8130,17 @@ async function overridesFile({ hash, name: name2, image, config, apiPath, capabi
8178
8130
  }
8179
8131
  },
8180
8132
  watcher: {
8181
- enabled: controllerType.watcher === true ? true : false,
8133
+ enabled: controllerType.watcher === true,
8182
8134
  terminationGracePeriodSeconds: 5,
8183
8135
  env: genEnv(config, true, true),
8184
8136
  envFrom: [],
8185
8137
  image,
8186
- annotations: {
8187
- "pepr.dev/description": `${config.description}` || ""
8188
- },
8189
- labels: {
8190
- app: `${name2}-watcher`,
8191
- "pepr.dev/controller": "watcher",
8192
- "pepr.dev/uuid": config.uuid
8193
- },
8194
- securityContext: {
8195
- runAsUser: image.includes("private") ? 1e3 : 65532,
8196
- runAsGroup: image.includes("private") ? 1e3 : 65532,
8197
- runAsNonRoot: true,
8198
- fsGroup: image.includes("private") ? 1e3 : 65532
8199
- },
8200
- readinessProbe: {
8201
- httpGet: {
8202
- path: "/healthz",
8203
- port: 3e3,
8204
- scheme: "HTTPS"
8205
- },
8206
- initialDelaySeconds: 10
8207
- },
8208
- livenessProbe: {
8209
- httpGet: {
8210
- path: "/healthz",
8211
- port: 3e3,
8212
- scheme: "HTTPS"
8213
- },
8214
- initialDelaySeconds: 10
8215
- },
8216
- resources: {
8217
- requests: {
8218
- memory: "256Mi",
8219
- cpu: "200m"
8220
- },
8221
- limits: {
8222
- memory: "512Mi",
8223
- cpu: "500m"
8224
- }
8225
- },
8226
- containerSecurityContext: {
8227
- runAsUser: image.includes("private") ? 1e3 : 65532,
8228
- runAsGroup: image.includes("private") ? 1e3 : 65532,
8229
- runAsNonRoot: true,
8230
- allowPrivilegeEscalation: false,
8231
- capabilities: {
8232
- drop: ["ALL"]
8233
- }
8234
- },
8138
+ annotations: controllerAnnotations(config.description),
8139
+ labels: controllerLabels(name2, config.uuid, "watcher"),
8140
+ securityContext: podSecurityContext(image),
8141
+ ...commonProbes(),
8142
+ resources: commonResources(),
8143
+ containerSecurityContext: containerSecurityContext(image),
8235
8144
  nodeSelector: {},
8236
8145
  tolerations: [],
8237
8146
  extraVolumeMounts: [],
@@ -8260,6 +8169,63 @@ async function writeSchemaYamlFromObject(valuesString, valuesFilePath) {
8260
8169
  const schemaObj = JSON.parse(schemaJson);
8261
8170
  await import_fs2.promises.writeFile(schemaPath, JSON.stringify(schemaObj, null, 2), "utf8");
8262
8171
  }
8172
+ function runIdsForImage(image) {
8173
+ const id = image.includes("private") ? 1e3 : 65532;
8174
+ return { uid: id, gid: id, fsGroup: id };
8175
+ }
8176
+ function commonProbes() {
8177
+ return {
8178
+ readinessProbe: {
8179
+ httpGet: { path: "/healthz", port: 3e3, scheme: "HTTPS" },
8180
+ initialDelaySeconds: 10
8181
+ },
8182
+ livenessProbe: {
8183
+ httpGet: { path: "/healthz", port: 3e3, scheme: "HTTPS" },
8184
+ initialDelaySeconds: 10
8185
+ }
8186
+ };
8187
+ }
8188
+ function commonResources() {
8189
+ return {
8190
+ requests: { memory: "256Mi", cpu: "200m" },
8191
+ limits: { memory: "512Mi", cpu: "500m" }
8192
+ };
8193
+ }
8194
+ function podSecurityContext(image) {
8195
+ const ids = runIdsForImage(image);
8196
+ return {
8197
+ runAsUser: ids.uid,
8198
+ runAsGroup: ids.gid,
8199
+ runAsNonRoot: true,
8200
+ fsGroup: ids.fsGroup
8201
+ };
8202
+ }
8203
+ function containerSecurityContext(image) {
8204
+ const ids = runIdsForImage(image);
8205
+ return {
8206
+ runAsUser: ids.uid,
8207
+ runAsGroup: ids.gid,
8208
+ runAsNonRoot: true,
8209
+ allowPrivilegeEscalation: false,
8210
+ capabilities: { drop: ["ALL"] }
8211
+ };
8212
+ }
8213
+ function controllerLabels(name2, uuid, kind8) {
8214
+ return {
8215
+ app: kind8 === "admission" ? name2 : `${name2}-watcher`,
8216
+ "pepr.dev/controller": kind8,
8217
+ "pepr.dev/uuid": uuid
8218
+ };
8219
+ }
8220
+ function controllerAnnotations(description) {
8221
+ return { "pepr.dev/description": `${description ?? ""}` };
8222
+ }
8223
+ function namespaceBlock(config) {
8224
+ return {
8225
+ annotations: {},
8226
+ labels: config.customLabels?.namespace ?? { "pepr.dev": "" }
8227
+ };
8228
+ }
8263
8229
 
8264
8230
  // src/lib/assets/index.ts
8265
8231
  var import_client_node2 = require("@kubernetes/client-node");
@@ -9038,22 +9004,18 @@ var validateRule = (binding, isMutateWebhook) => {
9038
9004
  };
9039
9005
  return ruleObject;
9040
9006
  };
9041
- async function generateWebhookRules(assets, isMutateWebhook) {
9007
+ async function generateWebhookRules(assets, webhookType) {
9042
9008
  const { capabilities } = assets;
9009
+ const isMutateWebhook = webhookType === "mutate" /* MUTATE */;
9043
9010
  const rules = capabilities.flatMap(
9044
9011
  (capability) => capability.bindings.map((binding) => validateRule(binding, isMutateWebhook)).filter((rule) => !!rule)
9045
9012
  );
9046
9013
  return (0, import_ramda.uniqWith)(import_ramda.equals, rules);
9047
9014
  }
9048
- async function webhookConfigGenerator(assets, mutateOrValidate, timeoutSeconds = 10) {
9015
+ async function webhookConfigGenerator(assets, webhookType, timeoutSeconds = 10) {
9049
9016
  const ignore = [];
9050
9017
  const { name: name2, tls, config, apiPath, host } = assets;
9051
- const ignoreNS = (0, import_ramda.concat)(
9052
- peprIgnoreNamespaces,
9053
- resolveIgnoreNamespaces(
9054
- config?.alwaysIgnore?.namespaces?.length ? config?.alwaysIgnore?.namespaces : config?.admission?.alwaysIgnore?.namespaces
9055
- )
9056
- );
9018
+ const ignoreNS = (0, import_ramda.concat)(peprIgnoreNamespaces, getIgnoreNamespaces(config));
9057
9019
  if (ignoreNS) {
9058
9020
  ignore.push({
9059
9021
  key: "kubernetes.io/metadata.name",
@@ -9064,7 +9026,7 @@ async function webhookConfigGenerator(assets, mutateOrValidate, timeoutSeconds =
9064
9026
  const clientConfig = {
9065
9027
  caBundle: tls.ca
9066
9028
  };
9067
- const fullApiPath = `/${mutateOrValidate}/${apiPath}`;
9029
+ const fullApiPath = `/${webhookType}/${apiPath}`;
9068
9030
  if (host) {
9069
9031
  clientConfig.url = `https://${host}:3000${fullApiPath}`;
9070
9032
  } else {
@@ -9074,14 +9036,13 @@ async function webhookConfigGenerator(assets, mutateOrValidate, timeoutSeconds =
9074
9036
  path: fullApiPath
9075
9037
  };
9076
9038
  }
9077
- const isMutate = mutateOrValidate === "mutate" /* MUTATE */;
9078
- const rules = await generateWebhookRules(assets, isMutate);
9039
+ const rules = await generateWebhookRules(assets, webhookType);
9079
9040
  if (rules.length < 1) {
9080
9041
  return null;
9081
9042
  }
9082
9043
  const webhookConfig = {
9083
9044
  apiVersion: "admissionregistration.k8s.io/v1",
9084
- kind: isMutate ? "MutatingWebhookConfiguration" : "ValidatingWebhookConfiguration",
9045
+ kind: webhookType === "mutate" /* MUTATE */ ? "MutatingWebhookConfiguration" : "ValidatingWebhookConfiguration",
9085
9046
  metadata: { name: name2 },
9086
9047
  webhooks: [
9087
9048
  {
@@ -9590,7 +9551,7 @@ var gitIgnore = "# Ignore node_modules and Pepr build artifacts\nnode_modules\nd
9590
9551
  var readmeMd = '# Pepr Module\n\nThis is a Pepr Module. [Pepr](https://github.com/defenseunicorns/pepr) is a type-safe Kubernetes middleware system.\n\nThe `capabilities` directory contains all the capabilities for this module. By default,\na capability is a single typescript file in the format of `capability-name.ts` that is\nimported in the root `pepr.ts` file as `import { HelloPepr } from "./capabilities/hello-pepr";`.\nBecause this is typescript, you can organize this however you choose, e.g. creating a sub-folder\nper-capability or common logic in shared files or folders.\n\nExample Structure:\n\n```text\nModule Root\n\u251C\u2500\u2500 package.json\n\u251C\u2500\u2500 pepr.ts\n\u2514\u2500\u2500 capabilities\n \u251C\u2500\u2500 example-one.ts\n \u251C\u2500\u2500 example-three.ts\n \u2514\u2500\u2500 example-two.ts\n```\n';
9591
9552
  var peprTS = 'import { PeprModule } from "pepr";\n// cfg loads your pepr configuration from package.json\nimport cfg from "./package.json";\n\n// HelloPepr is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\nimport { HelloPepr } from "./capabilities/hello-pepr";\n\n/**\n * This is the main entrypoint for this Pepr module. It is run when the module is started.\n * This is where you register your Pepr configurations and capabilities.\n */\nnew PeprModule(cfg, [\n // "HelloPepr" is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\n HelloPepr,\n\n // Your additional capabilities go here\n]);\n';
9592
9553
  var helloPeprTS = 'import {\n Capability,\n K8s,\n Log,\n PeprMutateRequest,\n RegisterKind,\n a,\n fetch,\n fetchStatus,\n kind,\n} from "pepr";\nimport { MockAgent, setGlobalDispatcher } from "undici";\n\n/**\n * The HelloPepr Capability is an example capability to demonstrate some general concepts of Pepr.\n * To test this capability you run `pepr dev`and then run the following command:\n * `kubectl apply -f capabilities/hello-pepr.samples.yaml`\n */\nexport const HelloPepr = new Capability({\n name: "hello-pepr",\n description: "A simple example capability to show how things work.",\n namespaces: ["pepr-demo", "pepr-demo-2"],\n});\n\n// Use the \'When\' function to create a new action, use \'Store\' to persist data\nconst { When, Store } = HelloPepr;\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action removes the label `remove-me` when a Namespace is created.\n * Note we don\'t need to specify the namespace here, because we\'ve already specified\n * it in the Capability definition above.\n */\nWhen(a.Namespace)\n .IsCreated()\n .Mutate(ns => ns.RemoveLabel("remove-me"));\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Watch Action with K8s SSA (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action watches for the `pepr-demo-2` namespace to be created, then creates a ConfigMap with\n * the name `pepr-ssa-demo` and adds the namespace UID to the ConfigMap data. Because Pepr uses\n * server-side apply for this operation, the ConfigMap will be created or updated if it already exists.\n */\nWhen(a.Namespace)\n .IsCreated()\n .WithName("pepr-demo-2")\n .Watch(async ns => {\n Log.info("Namespace pepr-demo-2 was created.");\n\n try {\n // Apply the ConfigMap using K8s server-side apply\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: "pepr-ssa-demo",\n namespace: "pepr-demo-2",\n },\n data: {\n "ns-uid": ns.metadata.uid,\n },\n });\n } catch (error) {\n // You can use the Log object to log messages to the Pepr controller pod\n Log.error({ error }, "Failed to apply ConfigMap using server-side apply.");\n }\n\n // You can share data between actions using the Store, including between different types of actions\n Store.setItem("watch-data", "This data was stored by a Watch Action.");\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 1) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is a single action. They can be in the same file or put imported from other files.\n * In this example, when a ConfigMap is created with the name `example-1`, then add a label and annotation.\n *\n * Equivalent to manually running:\n * `kubectl label configmap example-1 pepr=was-here`\n * `kubectl annotate configmap example-1 pepr.dev=annotations-work-too`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.SetLabel("pepr", "was-here").SetAnnotation("pepr.dev", "annotations-work-too");\n\n // Use the Store to persist data between requests and Pepr controller pods\n Store.setItem("example-1", "was-here");\n\n // This data is written asynchronously and can be read back via `Store.getItem()` or `Store.subscribe()`\n Store.setItem("example-1-data", JSON.stringify(request.Raw.data));\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate & Validate Actions (CM Example 2) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This combines 3 different types of actions: \'Mutate\', \'Validate\', and \'Watch\'. The order\n * of the actions is required, but each action is optional. In this example, when a ConfigMap is created\n * with the name `example-2`, then add a label and annotation, validate that the ConfigMap has the label\n * `pepr`, and log the request.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n // This Mutate Action will mutate the request before it is persisted to the cluster\n\n // Use `request.Merge()` to merge the new data with the existing data\n request.Merge({\n metadata: {\n labels: {\n pepr: "was-here",\n },\n annotations: {\n "pepr.dev": "annotations-work-too",\n },\n },\n });\n })\n .Validate(request => {\n // This Validate Action will validate the request before it is persisted to the cluster\n\n // Approve the request if the ConfigMap has the label \'pepr\'\n if (request.HasLabel("pepr")) {\n return request.Approve();\n }\n\n // Otherwise, deny the request with an error message (optional)\n return request.Deny("ConfigMap must have label \'pepr\'");\n })\n .Watch((cm, phase) => {\n // This Watch Action will watch the ConfigMap after it has been persisted to the cluster\n Log.info({ cm }, `ConfigMap was ${phase} with the name example-2`);\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 2a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action shows a simple validation that will deny any ConfigMap that has the\n * annotation `evil`. Note that the `Deny()` function takes an optional second parameter that is a\n * user-defined status code to return.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .Validate(request => {\n if (request.HasAnnotation("evil")) {\n return request.Deny("No evil CM annotations allowed.", 400);\n }\n\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 3) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action combines different styles. Unlike the previous actions, this one will look\n * for any ConfigMap in the `pepr-demo` namespace that has the label `change=by-label` during either\n * CREATE or UPDATE. Note that all conditions added such as `WithName()`, `WithLabel()`, `InNamespace()`,\n * are ANDs so all conditions must be true for the request to be processed.\n */\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("change", "by-label")\n .Mutate(request => {\n // The K8s object e are going to mutate\n const cm = request.Raw;\n\n // Get the username and uid of the K8s request\n const { username, uid } = request.Request.userInfo;\n\n // Store some data about the request in the configmap\n cm.data["username"] = username;\n cm.data["uid"] = uid;\n\n // You can still mix other ways of making changes too\n request.SetAnnotation("pepr.dev", "making-waves");\n });\n\n// This action validates the label `change=by-label` is deleted\nWhen(a.ConfigMap)\n .IsDeleted()\n .WithLabel("change", "by-label")\n .Validate(request => {\n // Log and then always approve the request\n Log.info("CM with label \'change=by-label\' was deleted.");\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action show how you can use the `Mutate()` function without an inline function.\n * This is useful if you want to keep your actions small and focused on a single task,\n * or if you want to reuse the same function in multiple actions.\n */\nWhen(a.ConfigMap).IsCreated().WithName("example-4").Mutate(example4Cb);\n\n// This function uses the complete type definition, but is not required.\nfunction example4Cb(cm: PeprMutateRequest<a.ConfigMap>): void {\n cm.SetLabel("pepr.dev/first", "true");\n cm.SetLabel("pepr.dev/second", "true");\n cm.SetLabel("pepr.dev/third", "true");\n}\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is the same as Example 4, except this only operates on a CM in the `pepr-demo-2` namespace.\n * Note because the Capability defines namespaces, the namespace specified here must be one of those.\n * Alternatively, you can remove the namespace from the Capability definition and specify it here.\n */\nWhen(a.ConfigMap).IsCreated().InNamespace("pepr-demo-2").WithName("example-4a").Mutate(example4Cb);\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 5) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action is a bit more complex. It will look for any ConfigMap in the `pepr-demo`\n * namespace that has the label `chuck-norris` during CREATE. When it finds one, it will fetch a\n * random Chuck Norris joke from the API and add it to the ConfigMap. This is a great example of how\n * you can use Pepr to make changes to your K8s objects based on external data.\n *\n * Note the use of the `async` keyword. This is required for any action that uses `await` or `fetch()`.\n *\n * Also note we are passing a type to the `fetch()` function. This is optional, but it will help you\n * avoid mistakes when working with the data returned from the API. You can also use the `as` keyword to\n * cast the data returned from the API.\n *\n * These are equivalent:\n * ```ts\n * const joke = await fetch<TheChuckNorrisJoke>("https://icanhazdadjoke.com/");\n * const joke = await fetch("https://icanhazdadjoke.com/") as TheChuckNorrisJoke;\n * ```\n *\n * Alternatively, you can drop the type completely:\n *\n * ```ts\n * fetch("https://icanhazdadjoke.com")\n * ```\n */\ninterface TheChuckNorrisJoke {\n id: string;\n joke: string;\n status: number;\n}\n\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("chuck-norris")\n .Mutate(cm => cm.SetLabel("got-jokes", "true"))\n .Watch(async cm => {\n const jokeURL = "https://icanhazdadjoke.com";\n\n const mockAgent: MockAgent = new MockAgent();\n setGlobalDispatcher(mockAgent);\n const mockClient = mockAgent.get(jokeURL);\n mockClient.intercept({ path: "/", method: "GET" }).reply(\n 200,\n {\n id: "R7UfaahVfFd",\n joke: "Funny joke goes here.",\n status: 200,\n },\n {\n headers: {\n "Content-Type": "application/json; charset=utf-8",\n },\n },\n );\n\n // Try/catch is not needed as a response object will always be returned\n const response = await fetch<TheChuckNorrisJoke>(jokeURL, {\n headers: {\n Accept: "application/json",\n },\n });\n\n // Instead, check the `response.ok` field\n if (response.ok) {\n const { joke } = response.data;\n // Add Joke to the Store\n await Store.setItemAndWait(jokeURL, joke);\n // Add the Chuck Norris joke to the configmap\n try {\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: cm.metadata.name,\n namespace: cm.metadata.namespace,\n },\n data: {\n "chuck-says": Store.getItem(jokeURL),\n },\n });\n } catch (error) {\n Log.error({ error, cm }, "Failed to apply ConfigMap using server-side apply.");\n }\n }\n\n // You can also assert on different HTTP response codes\n if (response.status === fetchStatus.NOT_FOUND) {\n // Do something else\n return;\n }\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Secret Base64 Handling) *\n * ---------------------------------------------------------------------------------------------------\n *\n * The K8s JS client provides incomplete support for base64 encoding/decoding handling for secrets,\n * unlike the GO client. To make this less painful, Pepr automatically handles base64 encoding/decoding\n * secret data before and after the action is executed.\n */\nWhen(a.Secret)\n .IsCreated()\n .WithName("secret-1")\n .Mutate(request => {\n const secret = request.Raw;\n\n // This will be encoded at the end of all processing back to base64: "Y2hhbmdlLXdpdGhvdXQtZW5jb2Rpbmc="\n secret.data.magic = "change-without-encoding";\n\n // You can modify the data directly, and it will be encoded at the end of all processing\n secret.data.example += " - modified by Pepr";\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Untyped Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * Out of the box, Pepr supports all the standard Kubernetes objects. However, you can also create\n * your own types. This is useful if you are working with an Operator that creates custom resources.\n * There are two ways to do this, the first is to use the `When()` function with a `GenericKind`,\n * the second is to create a new class that extends `GenericKind` and use the `RegisterKind()` function.\n *\n * This example shows how to use the `When()` function with a `GenericKind`. Note that you\n * must specify the `group`, `version`, and `kind` of the object (if applicable). This is how Pepr knows\n * if the action should be triggered or not. Since we are using a `GenericKind`,\n * Pepr will not be able to provide any intellisense for the object, so you will need to refer to the\n * Kubernetes API documentation for the object you are working with.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-1\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```\n */\nWhen(a.GenericKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n})\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr without type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Typed Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This example shows how to use the `RegisterKind()` function to create a new type. This is useful\n * if you are working with an Operator that creates custom resources and you want to have intellisense\n * for the object. Note that you must specify the `group`, `version`, and `kind` of the object (if applicable)\n * as this is how Pepr knows if the action should be triggered or not.\n *\n * Once you register a new Kind with Pepr, you can use the `When()` function with the new Kind. Ideally,\n * you should register custom Kinds at the top of your Capability file or Pepr Module so they are available\n * to all actions, but we are putting it here for demonstration purposes.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-2\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```*\n */\nclass UnicornKind extends a.GenericKind {\n spec: {\n /**\n * JSDoc comments can be added to explain more details about the field.\n *\n * @example\n * ```ts\n * request.Raw.spec.message = "Hello Pepr!";\n * ```\n * */\n message: string;\n counter: number;\n };\n}\n\nRegisterKind(UnicornKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n});\n\nWhen(UnicornKind)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr with type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * A callback function that is called once the Pepr Store is fully loaded.\n */\nStore.onReady(data => {\n Log.info({ data }, "Pepr Store Ready");\n});\n';
9593
- var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=20.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.55.6-nightly.1", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { build: "tsc -p config/tsconfig.root.json && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) .", ci: "npm ci", "cluster:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "cluster:k3d:import-upstream": "npm run build && docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "cluster:k3d:import-unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr/private:dev -c pepr-dev", "format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check", "format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write", "format:integration": "eslint --config config/eslint.integration.config.mjs integration/cli integration/helpers", "format:markdown": 'npx -y markdownlint-cli --config config/.markdownlint.json --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore node_modules "**/*.md"', "format:prettier": "prettier --config config/.prettierrc src integration/cli/**/*.ts integration/helpers/**/*.ts", "format:src": "eslint --config config/eslint.root.config.mjs 'src/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern 'src/templates/**'", "format:tests": "eslint --config config/eslint.test.config.mjs 'src/**/*.test.ts'", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi`, "set-version": 'bash -lc \'ver=${PEPR_VERSION:-}; if [ -z "$ver" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js "$ver"\'', test: "npm run test:unit && npm run test:integration", "test:artifacts": "npm run build && vitest run src/build-artifact.test.ts", "test:docs": "vitest run --config=config/vitest.integration.config.ts integration/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "vitest run --config=config/vitest.integration.config.ts integration", "test:unit": "npm run gen-data-json && NODE_OPTIONS=--no-deprecation vitest --config config/vitest.root.config.ts run --coverage", "test:upgrade:unicorn": "npm run cluster:k3d && npm run cluster:k3d:import-unicorn && vitest run integration/cluster/upgrade.test.ts", "test:upgrade:upstream": "npm run cluster:k3d && npm run cluster:k3d:import-upstream && vitest run integration/cluster/upgrade.test.ts" }, dependencies: { "@types/ramda": "0.31.1", "command-line-args": "^6.0.1", commander: "14.0.1", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.10.6", pino: "10.1.0", "pino-pretty": "13.1.2", "prom-client": "15.1.3", "quicktype-core": "^23.2.6", ramda: "0.32.0", "ts-morph": "^27.0.0" }, devDependencies: { "@commitlint/cli": "20.1.0", "@commitlint/config-conventional": "20.0.0", "@fast-check/vitest": "^0.2.1", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/git": "^10.0.1", "@semantic-release/npm": "^13.0.0", "@semantic-release/release-notes-generator": "^14.1.0", "@types/command-line-args": "^5.2.3", "@types/eslint": "9.6.1", "@types/express": "5.0.3", "@types/json-pointer": "^1.0.34", "@types/json-schema": "^7.0.15", "@types/node": "24.x.x", "@types/node-forge": "1.3.14", "@types/readable-stream": "^4.0.21", "@types/urijs": "^1.19.25", "@types/ws": "^8.18.1", "@vitest/coverage-v8": "^3.2.3", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", "js-yaml": "^4.1.0", shellcheck: "^4.1.0", tsx: "^4.20.3", undici: "^7.0.1", vitest: "^3.2.3" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.45.0", "@typescript-eslint/parser": "8.45.0", esbuild: "0.25.10", eslint: "9.36.0", "node-forge": "1.3.1", prettier: "3.6.2", prompts: "2.4.2", typescript: "5.8.3", uuid: "13.0.0" } };
9554
+ var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=20.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.55.6-nightly.10", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { build: "tsc -p config/tsconfig.root.json && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) .", ci: "npm ci", "cluster:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "cluster:k3d:import-upstream": "npm run build && docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "cluster:k3d:import-unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr/private:dev -c pepr-dev", "format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check", "format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write", "format:integration": "eslint --config config/eslint.integration.config.mjs integration/cli integration/helpers", "format:markdown": 'npx -y markdownlint-cli --config config/.markdownlint.json --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore node_modules "**/*.md"', "format:prettier": "prettier --config config/.prettierrc src integration/cli/**/*.ts integration/helpers/**/*.ts", "format:src": "eslint --config config/eslint.root.config.mjs 'src/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern 'src/templates/**'", "format:tests": "eslint --config config/eslint.test.config.mjs 'src/**/*.test.ts'", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi`, "set-version": 'bash -lc \'ver=${PEPR_VERSION:-}; if [ -z "$ver" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js "$ver"\'', test: "npm run test:unit && npm run test:integration", "test:artifacts": "npm run build && vitest run src/build-artifact.test.ts", "test:docs": "vitest run --config=config/vitest.integration.config.ts integration/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "vitest run --config=config/vitest.integration.config.ts integration", "test:unit": "npm run gen-data-json && NODE_OPTIONS=--no-deprecation vitest --config config/vitest.root.config.ts run --coverage", "test:upgrade:unicorn": "npm run cluster:k3d && npm run cluster:k3d:import-unicorn && vitest run integration/cluster/upgrade.test.ts", "test:upgrade:upstream": "npm run cluster:k3d && npm run cluster:k3d:import-upstream && vitest run integration/cluster/upgrade.test.ts" }, dependencies: { "@types/ramda": "0.31.1", "command-line-args": "^6.0.1", commander: "14.0.2", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.10.6", pino: "10.1.0", "pino-pretty": "13.1.2", "prom-client": "15.1.3", "quicktype-core": "^23.2.6", ramda: "0.32.0", "ts-morph": "^27.0.0" }, devDependencies: { "@commitlint/cli": "20.1.0", "@commitlint/config-conventional": "20.0.0", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/git": "^10.0.1", "@semantic-release/npm": "^13.0.0", "@semantic-release/release-notes-generator": "^14.1.0", "@types/command-line-args": "^5.2.3", "@types/eslint": "9.6.1", "@types/express": "5.0.5", "@types/json-pointer": "^1.0.34", "@types/json-schema": "^7.0.15", "@types/node": "24.x.x", "@types/node-forge": "1.3.14", "@types/readable-stream": "^4.0.21", "@types/urijs": "^1.19.25", "@types/ws": "^8.18.1", "@vitest/coverage-v8": "^4.0.4", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", "js-yaml": "^4.1.0", shellcheck: "^4.1.0", tsx: "^4.20.3", undici: "^7.0.1", vitest: "^4.0.4" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.45.0", "@typescript-eslint/parser": "8.45.0", esbuild: "0.25.10", eslint: "9.36.0", "node-forge": "1.3.1", prettier: "3.6.2", prompts: "2.4.2", typescript: "5.8.3", uuid: "13.0.0" } };
9594
9555
 
9595
9556
  // src/cli/init/utils.ts
9596
9557
  var import_fs7 = require("fs");
@@ -60,7 +60,7 @@ if (process.env.LOG_LEVEL) {
60
60
  var logger_default = Log;
61
61
 
62
62
  // src/templates/data.json
63
- var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=20.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.55.6-nightly.1", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { build: "tsc -p config/tsconfig.root.json && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) .", ci: "npm ci", "cluster:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "cluster:k3d:import-upstream": "npm run build && docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "cluster:k3d:import-unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr/private:dev -c pepr-dev", "format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check", "format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write", "format:integration": "eslint --config config/eslint.integration.config.mjs integration/cli integration/helpers", "format:markdown": 'npx -y markdownlint-cli --config config/.markdownlint.json --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore node_modules "**/*.md"', "format:prettier": "prettier --config config/.prettierrc src integration/cli/**/*.ts integration/helpers/**/*.ts", "format:src": "eslint --config config/eslint.root.config.mjs 'src/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern 'src/templates/**'", "format:tests": "eslint --config config/eslint.test.config.mjs 'src/**/*.test.ts'", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi`, "set-version": 'bash -lc \'ver=${PEPR_VERSION:-}; if [ -z "$ver" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js "$ver"\'', test: "npm run test:unit && npm run test:integration", "test:artifacts": "npm run build && vitest run src/build-artifact.test.ts", "test:docs": "vitest run --config=config/vitest.integration.config.ts integration/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "vitest run --config=config/vitest.integration.config.ts integration", "test:unit": "npm run gen-data-json && NODE_OPTIONS=--no-deprecation vitest --config config/vitest.root.config.ts run --coverage", "test:upgrade:unicorn": "npm run cluster:k3d && npm run cluster:k3d:import-unicorn && vitest run integration/cluster/upgrade.test.ts", "test:upgrade:upstream": "npm run cluster:k3d && npm run cluster:k3d:import-upstream && vitest run integration/cluster/upgrade.test.ts" }, dependencies: { "@types/ramda": "0.31.1", "command-line-args": "^6.0.1", commander: "14.0.1", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.10.6", pino: "10.1.0", "pino-pretty": "13.1.2", "prom-client": "15.1.3", "quicktype-core": "^23.2.6", ramda: "0.32.0", "ts-morph": "^27.0.0" }, devDependencies: { "@commitlint/cli": "20.1.0", "@commitlint/config-conventional": "20.0.0", "@fast-check/vitest": "^0.2.1", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/git": "^10.0.1", "@semantic-release/npm": "^13.0.0", "@semantic-release/release-notes-generator": "^14.1.0", "@types/command-line-args": "^5.2.3", "@types/eslint": "9.6.1", "@types/express": "5.0.3", "@types/json-pointer": "^1.0.34", "@types/json-schema": "^7.0.15", "@types/node": "24.x.x", "@types/node-forge": "1.3.14", "@types/readable-stream": "^4.0.21", "@types/urijs": "^1.19.25", "@types/ws": "^8.18.1", "@vitest/coverage-v8": "^3.2.3", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", "js-yaml": "^4.1.0", shellcheck: "^4.1.0", tsx: "^4.20.3", undici: "^7.0.1", vitest: "^3.2.3" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.45.0", "@typescript-eslint/parser": "8.45.0", esbuild: "0.25.10", eslint: "9.36.0", "node-forge": "1.3.1", prettier: "3.6.2", prompts: "2.4.2", typescript: "5.8.3", uuid: "13.0.0" } };
63
+ var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=20.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.55.6-nightly.10", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { build: "tsc -p config/tsconfig.root.json && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) .", ci: "npm ci", "cluster:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "cluster:k3d:import-upstream": "npm run build && docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "cluster:k3d:import-unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr/private:dev -c pepr-dev", "format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check", "format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write", "format:integration": "eslint --config config/eslint.integration.config.mjs integration/cli integration/helpers", "format:markdown": 'npx -y markdownlint-cli --config config/.markdownlint.json --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore node_modules "**/*.md"', "format:prettier": "prettier --config config/.prettierrc src integration/cli/**/*.ts integration/helpers/**/*.ts", "format:src": "eslint --config config/eslint.root.config.mjs 'src/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern 'src/templates/**'", "format:tests": "eslint --config config/eslint.test.config.mjs 'src/**/*.test.ts'", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi`, "set-version": 'bash -lc \'ver=${PEPR_VERSION:-}; if [ -z "$ver" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js "$ver"\'', test: "npm run test:unit && npm run test:integration", "test:artifacts": "npm run build && vitest run src/build-artifact.test.ts", "test:docs": "vitest run --config=config/vitest.integration.config.ts integration/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "vitest run --config=config/vitest.integration.config.ts integration", "test:unit": "npm run gen-data-json && NODE_OPTIONS=--no-deprecation vitest --config config/vitest.root.config.ts run --coverage", "test:upgrade:unicorn": "npm run cluster:k3d && npm run cluster:k3d:import-unicorn && vitest run integration/cluster/upgrade.test.ts", "test:upgrade:upstream": "npm run cluster:k3d && npm run cluster:k3d:import-upstream && vitest run integration/cluster/upgrade.test.ts" }, dependencies: { "@types/ramda": "0.31.1", "command-line-args": "^6.0.1", commander: "14.0.2", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.10.6", pino: "10.1.0", "pino-pretty": "13.1.2", "prom-client": "15.1.3", "quicktype-core": "^23.2.6", ramda: "0.32.0", "ts-morph": "^27.0.0" }, devDependencies: { "@commitlint/cli": "20.1.0", "@commitlint/config-conventional": "20.0.0", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/git": "^10.0.1", "@semantic-release/npm": "^13.0.0", "@semantic-release/release-notes-generator": "^14.1.0", "@types/command-line-args": "^5.2.3", "@types/eslint": "9.6.1", "@types/express": "5.0.5", "@types/json-pointer": "^1.0.34", "@types/json-schema": "^7.0.15", "@types/node": "24.x.x", "@types/node-forge": "1.3.14", "@types/readable-stream": "^4.0.21", "@types/urijs": "^1.19.25", "@types/ws": "^8.18.1", "@vitest/coverage-v8": "^4.0.4", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", "js-yaml": "^4.1.0", shellcheck: "^4.1.0", tsx: "^4.20.3", undici: "^7.0.1", vitest: "^4.0.4" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.45.0", "@typescript-eslint/parser": "8.45.0", esbuild: "0.25.10", eslint: "9.36.0", "node-forge": "1.3.1", prettier: "3.6.2", prompts: "2.4.2", typescript: "5.8.3", uuid: "13.0.0" } };
64
64
 
65
65
  // src/lib/k8s.ts
66
66
  var import_kubernetes_fluent_client = require("kubernetes-fluent-client");
@@ -1,2 +1,4 @@
1
+ import { ModuleConfig } from "../types";
2
+ export declare function getIgnoreNamespaces(config?: ModuleConfig): string[];
1
3
  export declare function resolveIgnoreNamespaces(ignoredNSConfig?: string[]): string[];
2
4
  //# sourceMappingURL=ignoredNamespaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ignoredNamespaces.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/ignoredNamespaces.ts"],"names":[],"mappings":"AAGA,wBAAgB,uBAAuB,CAAC,eAAe,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAahF"}
1
+ {"version":3,"file":"ignoredNamespaces.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/ignoredNamespaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,EAAE,CAMnE;AAED,wBAAgB,uBAAuB,CAAC,eAAe,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAahF"}
@@ -5,8 +5,8 @@ import { WebhookType } from "../enums";
5
5
  import { Binding, AdditionalWebhook } from "../types";
6
6
  export declare const peprIgnoreNamespaces: string[];
7
7
  export declare const validateRule: (binding: Binding, isMutateWebhook: boolean) => V1RuleWithOperations | undefined;
8
- export declare function generateWebhookRules(assets: Assets, isMutateWebhook: boolean): Promise<V1RuleWithOperations[]>;
9
- export declare function webhookConfigGenerator(assets: Assets, mutateOrValidate: WebhookType, timeoutSeconds?: number): Promise<kind.MutatingWebhookConfiguration | kind.ValidatingWebhookConfiguration | null>;
8
+ export declare function generateWebhookRules(assets: Assets, webhookType: WebhookType): Promise<V1RuleWithOperations[]>;
9
+ export declare function webhookConfigGenerator(assets: Assets, webhookType: WebhookType, timeoutSeconds?: number): Promise<kind.MutatingWebhookConfiguration | kind.ValidatingWebhookConfiguration | null>;
10
10
  export declare function checkFailurePolicy(failurePolicy: string): void;
11
11
  export declare function configureAdditionalWebhooks(webhookConfig: V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration, additionalWebhooks: AdditionalWebhook[]): V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration;
12
12
  //# sourceMappingURL=webhooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/webhooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oBAAoB,EACpB,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAS,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAmC,CAAC;AAE7E,eAAO,MAAM,YAAY,GACvB,SAAS,OAAO,EAChB,iBAAiB,OAAO,KACvB,oBAAoB,GAAG,SAsBzB,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,OAAO,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAUjC;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,WAAW,EAC7B,cAAc,SAAK,GAClB,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,CA6EzF;AAED,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,8BAA8B,GAAG,gCAAgC,EAChF,kBAAkB,EAAE,iBAAiB,EAAE,GACtC,8BAA8B,GAAG,gCAAgC,CAoCnE"}
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/webhooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oBAAoB,EACpB,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAS,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAmC,CAAC;AAE7E,eAAO,MAAM,YAAY,GACvB,SAAS,OAAO,EAChB,iBAAiB,OAAO,KACvB,oBAAoB,GAAG,SAsBzB,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAWjC;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,cAAc,SAAK,GAClB,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAwEzF;AAED,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,8BAA8B,GAAG,gCAAgC,EAChF,kBAAkB,EAAE,iBAAiB,EAAE,GACtC,8BAA8B,GAAG,gCAAgC,CAoCnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"overridesFile.d.ts","sourceRoot":"","sources":["../../../../src/lib/assets/yaml/overridesFile.ts"],"names":[],"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,gBAAgB,EAAE,MAAM,EAAE,EAC1B,cAAc,GAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAuC,GAC5F,OAAO,CAAC,IAAI,CAAC,CAmEf;AAED,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,qBAAa,UAAU;;gBAmBT,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,KAAK,GAAE,eAAoB;IAoCzF,+BAA+B;IAC/B,WAAW,GAAI,MAAM,MAAM,KAAG,IAAI,CA+DhC;CA8KH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKxC,OAAO,EAAE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AAgB,KAAG,YAAY,CAAC,CAAC,CAAC,CAsQjF;CACH"}
@@ -3,18 +3,20 @@ import { PackageJSON, PeprModuleOptions } from "../types";
3
3
  export declare class PeprModule {
4
4
  #private;
5
5
  /**
6
- * Create a new Pepr runtime
6
+ * Initialize a new Pepr runtime module.
7
7
  *
8
- * @param config The configuration for the Pepr runtime
9
- * @param capabilities The capabilities to be loaded into the Pepr runtime
10
- * @param opts Options for the Pepr runtime
8
+ * @param pkg The package.json data containing Pepr configuration.
9
+ * @param capabilities The list of capabilities to load.
10
+ * @param opts Options for the Pepr runtime settings (e.g., deferStart).
11
11
  */
12
12
  constructor({ description, pepr }: PackageJSON, capabilities?: Capability[], opts?: PeprModuleOptions);
13
13
  /**
14
- * Start the Pepr runtime manually.
15
- * Normally this is called automatically when the Pepr module is instantiated, but can be called manually if `deferStart` is set to `true` in the constructor.
14
+ * Starts the Pepr runtime manually.
16
15
  *
17
- * @param port
16
+ * Normally this is called automatically when the Pepr module is instantiated,
17
+ * but it can be invoked manually if `deferStart` is set to `true` in the constructor.
18
+ *
19
+ * @param port - The port number to start the server on (default: 3000).
18
20
  */
19
21
  start: (port?: number) => void;
20
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAGxE,qBAAa,UAAU;;IAGrB;;;;;;OAMG;gBAED,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,WAAW,EAClC,YAAY,GAAE,UAAU,EAAO,EAC/B,IAAI,GAAE,iBAAsB;IAqD9B;;;;;OAKG;IACH,KAAK,GAAI,aAAW,KAAG,IAAI,CAEzB;CACH"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,E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