@tahminator/pipeline 1.0.38 โ 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pulumi/client.d.ts +6 -1
- package/dist/pulumi/client.js +48 -0
- package/package.json +1 -1
package/dist/pulumi/client.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type { PreviewResult, UpResult } from "@pulumi/pulumi/automation";
|
|
1
|
+
import type { OpMap, OpType, PreviewResult, UpResult } from "@pulumi/pulumi/automation";
|
|
2
2
|
import { type PulumiClientCreateArgs } from "./types";
|
|
3
3
|
export declare class PulumiClient {
|
|
4
4
|
private readonly strategy;
|
|
5
|
+
static opTypeMetadata: Record<OpType, {
|
|
6
|
+
emoji: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
5
9
|
private constructor();
|
|
6
10
|
static create(args: PulumiClientCreateArgs): Promise<PulumiClient>;
|
|
7
11
|
up(): Promise<UpResult>;
|
|
8
12
|
preview(): Promise<PreviewResult>;
|
|
13
|
+
static parseChangeSumaryToPrettyTable(changeSummary: OpMap): string;
|
|
9
14
|
}
|
package/dist/pulumi/client.js
CHANGED
|
@@ -2,6 +2,26 @@ import { AzurePulumiClientStrategy, } from "./strategy";
|
|
|
2
2
|
import { PulumiClientStrategy } from "./types";
|
|
3
3
|
export class PulumiClient {
|
|
4
4
|
strategy;
|
|
5
|
+
static opTypeMetadata = {
|
|
6
|
+
create: { emoji: "๐ข", label: "Create" },
|
|
7
|
+
update: { emoji: "๐ก", label: "Update" },
|
|
8
|
+
replace: { emoji: "๐ต", label: "Replace" },
|
|
9
|
+
delete: { emoji: "๐ด", label: "Delete" },
|
|
10
|
+
same: { emoji: "โช", label: "Unchanged" },
|
|
11
|
+
refresh: { emoji: "๐", label: "Refresh" },
|
|
12
|
+
import: { emoji: "๐ฅ", label: "Import" },
|
|
13
|
+
read: { emoji: "๐", label: "Read" },
|
|
14
|
+
discard: { emoji: "๐จ", label: "Discard" },
|
|
15
|
+
"create-replacement": { emoji: "โณ๏ธ", label: "Create Replacement" },
|
|
16
|
+
"delete-replaced": { emoji: "๐๏ธ", label: "Delete Replaced" },
|
|
17
|
+
"read-replacement": { emoji: "๐", label: "Read Replacement" },
|
|
18
|
+
"import-replacement": { emoji: "๐ฅ", label: "Import Replacement" },
|
|
19
|
+
"discard-replaced": { emoji: "๐จ", label: "Discard Replaced" },
|
|
20
|
+
"remove-pending-replace": {
|
|
21
|
+
emoji: "๐งน",
|
|
22
|
+
label: "Remove Pending Replace",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
5
25
|
constructor(strategy) {
|
|
6
26
|
this.strategy = strategy;
|
|
7
27
|
}
|
|
@@ -17,4 +37,32 @@ export class PulumiClient {
|
|
|
17
37
|
async preview() {
|
|
18
38
|
return this.strategy.preview();
|
|
19
39
|
}
|
|
40
|
+
static parseChangeSumaryToPrettyTable(changeSummary) {
|
|
41
|
+
const entries = Object.entries(changeSummary).filter(([_, count]) => count > 0);
|
|
42
|
+
if (entries.length === 0) {
|
|
43
|
+
return "โ
**No infrastructure changes detected.** Everything is in sync.";
|
|
44
|
+
}
|
|
45
|
+
// prioritize important ops
|
|
46
|
+
(() => {
|
|
47
|
+
const priority = [
|
|
48
|
+
"delete",
|
|
49
|
+
"replace",
|
|
50
|
+
"delete-replaced",
|
|
51
|
+
"create",
|
|
52
|
+
"update",
|
|
53
|
+
];
|
|
54
|
+
entries.sort((a, b) => {
|
|
55
|
+
const indexA = priority.indexOf(a[0]);
|
|
56
|
+
const indexB = priority.indexOf(b[0]);
|
|
57
|
+
return (indexA === -1 ? 99 : indexA) - (indexB === -1 ? 99 : indexB);
|
|
58
|
+
});
|
|
59
|
+
})();
|
|
60
|
+
let table = "| | Operation | Count |\n";
|
|
61
|
+
table += "| :--- | :--- | :--- |\n";
|
|
62
|
+
for (const [op, count] of entries) {
|
|
63
|
+
const meta = this.opTypeMetadata[op];
|
|
64
|
+
table += `| ${meta.emoji} | **${meta.label}** | \`${count}\` |\n`;
|
|
65
|
+
}
|
|
66
|
+
return table;
|
|
67
|
+
}
|
|
20
68
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Tahmid Ahmed",
|
|
5
5
|
"description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.39",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+https://github.com/tahminator/pipeline.git"
|
|
9
9
|
},
|