@meltemi/diagrams-cli 0.0.0-stage → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/dist/assets-command.d.ts +16 -0
- package/dist/assets-command.d.ts.map +1 -0
- package/dist/assets-command.js +145 -0
- package/dist/assets-command.js.map +1 -0
- package/dist/assist-command.d.ts +19 -0
- package/dist/assist-command.d.ts.map +1 -0
- package/dist/assist-command.js +268 -0
- package/dist/assist-command.js.map +1 -0
- package/dist/auth-command.d.ts +14 -0
- package/dist/auth-command.d.ts.map +1 -0
- package/dist/auth-command.js +233 -0
- package/dist/auth-command.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +60 -0
- package/dist/bin.js.map +1 -0
- package/dist/build-command.d.ts +23 -0
- package/dist/build-command.d.ts.map +1 -0
- package/dist/build-command.js +123 -0
- package/dist/build-command.js.map +1 -0
- package/dist/cli.d.ts +46 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +823 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud-client.d.ts +246 -0
- package/dist/cloud-client.d.ts.map +1 -0
- package/dist/cloud-client.js +591 -0
- package/dist/cloud-client.js.map +1 -0
- package/dist/cloud-command.d.ts +56 -0
- package/dist/cloud-command.d.ts.map +1 -0
- package/dist/cloud-command.js +81 -0
- package/dist/cloud-command.js.map +1 -0
- package/dist/cloud-context.d.ts +106 -0
- package/dist/cloud-context.d.ts.map +1 -0
- package/dist/cloud-context.js +185 -0
- package/dist/cloud-context.js.map +1 -0
- package/dist/cloud-errors.d.ts +37 -0
- package/dist/cloud-errors.d.ts.map +1 -0
- package/dist/cloud-errors.js +46 -0
- package/dist/cloud-errors.js.map +1 -0
- package/dist/cloud-host.d.ts +72 -0
- package/dist/cloud-host.d.ts.map +1 -0
- package/dist/cloud-host.js +129 -0
- package/dist/cloud-host.js.map +1 -0
- package/dist/cloud-manifest.d.ts +12 -0
- package/dist/cloud-manifest.d.ts.map +1 -0
- package/dist/cloud-manifest.js +21 -0
- package/dist/cloud-manifest.js.map +1 -0
- package/dist/cloud-paths.d.ts +48 -0
- package/dist/cloud-paths.d.ts.map +1 -0
- package/dist/cloud-paths.js +104 -0
- package/dist/cloud-paths.js.map +1 -0
- package/dist/credentials.d.ts +107 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +243 -0
- package/dist/credentials.js.map +1 -0
- package/dist/export-command.d.ts +35 -0
- package/dist/export-command.d.ts.map +1 -0
- package/dist/export-command.js +524 -0
- package/dist/export-command.js.map +1 -0
- package/dist/import-command.d.ts +20 -0
- package/dist/import-command.d.ts.map +1 -0
- package/dist/import-command.js +254 -0
- package/dist/import-command.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/init-command.d.ts +28 -0
- package/dist/init-command.d.ts.map +1 -0
- package/dist/init-command.js +199 -0
- package/dist/init-command.js.map +1 -0
- package/dist/login-listener.d.ts +58 -0
- package/dist/login-listener.d.ts.map +1 -0
- package/dist/login-listener.js +173 -0
- package/dist/login-listener.js.map +1 -0
- package/dist/messages/en.d.ts +533 -0
- package/dist/messages/en.d.ts.map +1 -0
- package/dist/messages/en.js +803 -0
- package/dist/messages/en.js.map +1 -0
- package/dist/messages/es.d.ts +3 -0
- package/dist/messages/es.d.ts.map +1 -0
- package/dist/messages/es.js +764 -0
- package/dist/messages/es.js.map +1 -0
- package/dist/messages/index.d.ts +442 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +42 -0
- package/dist/messages/index.js.map +1 -0
- package/dist/messages/push-pull-en.d.ts +84 -0
- package/dist/messages/push-pull-en.d.ts.map +1 -0
- package/dist/messages/push-pull-en.js +146 -0
- package/dist/messages/push-pull-en.js.map +1 -0
- package/dist/messages/push-pull-es.d.ts +7 -0
- package/dist/messages/push-pull-es.d.ts.map +1 -0
- package/dist/messages/push-pull-es.js +144 -0
- package/dist/messages/push-pull-es.js.map +1 -0
- package/dist/open-url.d.ts +11 -0
- package/dist/open-url.d.ts.map +1 -0
- package/dist/open-url.js +36 -0
- package/dist/open-url.js.map +1 -0
- package/dist/plugins-command.d.ts +15 -0
- package/dist/plugins-command.d.ts.map +1 -0
- package/dist/plugins-command.js +106 -0
- package/dist/plugins-command.js.map +1 -0
- package/dist/preview.d.ts +54 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +249 -0
- package/dist/preview.js.map +1 -0
- package/dist/project-errors.d.ts +17 -0
- package/dist/project-errors.d.ts.map +1 -0
- package/dist/project-errors.js +85 -0
- package/dist/project-errors.js.map +1 -0
- package/dist/projects-command.d.ts +13 -0
- package/dist/projects-command.d.ts.map +1 -0
- package/dist/projects-command.js +85 -0
- package/dist/projects-command.js.map +1 -0
- package/dist/publish-command.d.ts +41 -0
- package/dist/publish-command.d.ts.map +1 -0
- package/dist/publish-command.js +311 -0
- package/dist/publish-command.js.map +1 -0
- package/dist/pull-command.d.ts +21 -0
- package/dist/pull-command.d.ts.map +1 -0
- package/dist/pull-command.js +300 -0
- package/dist/pull-command.js.map +1 -0
- package/dist/push-command.d.ts +31 -0
- package/dist/push-command.d.ts.map +1 -0
- package/dist/push-command.js +391 -0
- package/dist/push-command.js.map +1 -0
- package/dist/push-review.d.ts +16 -0
- package/dist/push-review.d.ts.map +1 -0
- package/dist/push-review.js +72 -0
- package/dist/push-review.js.map +1 -0
- package/dist/push-set.d.ts +126 -0
- package/dist/push-set.d.ts.map +1 -0
- package/dist/push-set.js +289 -0
- package/dist/push-set.js.map +1 -0
- package/dist/push-validation.d.ts +20 -0
- package/dist/push-validation.d.ts.map +1 -0
- package/dist/push-validation.js +70 -0
- package/dist/push-validation.js.map +1 -0
- package/dist/redact.d.ts +9 -0
- package/dist/redact.d.ts.map +1 -0
- package/dist/redact.js +22 -0
- package/dist/redact.js.map +1 -0
- package/dist/review-command.d.ts +44 -0
- package/dist/review-command.d.ts.map +1 -0
- package/dist/review-command.js +348 -0
- package/dist/review-command.js.map +1 -0
- package/package.json +56 -3
- package/templates/c4/diagrams/views.meltemi +16 -0
- package/templates/c4/models/system.meltemi +23 -0
- package/templates/ci/github.yml +96 -0
- package/templates/ci/gitlab.yml +53 -0
- package/templates/flow/diagrams/overview.meltemi +15 -0
- package/templates/free/diagrams/slide.meltemi +39 -0
- package/templates/purchase/diagrams/architecture.meltemi +36 -0
- package/templates/purchase/diagrams/executive.meltemi +52 -0
- package/templates/purchase/diagrams/payment.meltemi +42 -0
- package/templates/purchase/models/commerce.meltemi +30 -0
- package/templates/purchase/stories/purchase.meltemi +38 -0
- package/templates/sequence/diagrams/sign-in.meltemi +36 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
// A slide composed freely: every object is placed by hand on a 16:9 canvas. Drag them on the
|
|
4
|
+
// canvas in VS Code, or change the places below.
|
|
5
|
+
diagram slide: free {
|
|
6
|
+
title "How a request flows"
|
|
7
|
+
canvas (1280, 720)
|
|
8
|
+
layout manual
|
|
9
|
+
|
|
10
|
+
text heading "How a request flows"
|
|
11
|
+
text subtitle "From the browser to the database in two steps"
|
|
12
|
+
|
|
13
|
+
box browser "Browser"
|
|
14
|
+
icon person "tabler:user"
|
|
15
|
+
|
|
16
|
+
group backend "Backend" {
|
|
17
|
+
box api "API"
|
|
18
|
+
box db "Database"
|
|
19
|
+
api -> db: "SQL" as query
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
browser -> api: "HTTPS" as request
|
|
23
|
+
|
|
24
|
+
placement {
|
|
25
|
+
place heading at (640, 90)
|
|
26
|
+
place subtitle at (640, 145)
|
|
27
|
+
place person at (220, 300)
|
|
28
|
+
place browser at (220, 400)
|
|
29
|
+
place backend at (800, 400)
|
|
30
|
+
size backend (600, 220)
|
|
31
|
+
place api at (150, 110)
|
|
32
|
+
place db at (450, 110)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
style heading { fontSize 40; fontWeight 700 }
|
|
36
|
+
style subtitle { color muted }
|
|
37
|
+
style db { shape cylinder }
|
|
38
|
+
animate request { effect flow; duration 1200ms; repeat forever }
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
import commerce from "../models/commerce.meltemi"
|
|
4
|
+
|
|
5
|
+
// The general architecture: the shop in its context, then its containers.
|
|
6
|
+
diagram context: c4 using commerce {
|
|
7
|
+
title "The shop in context"
|
|
8
|
+
level context
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
diagram containers: c4 using commerce {
|
|
12
|
+
title "Inside the shop"
|
|
13
|
+
level container
|
|
14
|
+
scope shop
|
|
15
|
+
layout assisted
|
|
16
|
+
|
|
17
|
+
// Two rows inside the shop: the order's way in above, its data and events below.
|
|
18
|
+
placement {
|
|
19
|
+
place customer at (130, 70)
|
|
20
|
+
place shop.web at (130, 300)
|
|
21
|
+
place shop.gateway at (450, 300)
|
|
22
|
+
place shop.orders at (770, 300)
|
|
23
|
+
place shop.payments at (1090, 300)
|
|
24
|
+
place shop.db at (450, 520)
|
|
25
|
+
place shop.events at (770, 520)
|
|
26
|
+
place provider at (1090, 760)
|
|
27
|
+
route store from shop.orders.south to shop.db.north via [(730, 410), (450, 410)]
|
|
28
|
+
route publish from shop.payments.south to shop.events.east via [(1050, 520)]
|
|
29
|
+
label authorise at 75%
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// A document page of the containers.
|
|
34
|
+
export sheet for containers {
|
|
35
|
+
format pdf
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
import commerce from "../models/commerce.meltemi"
|
|
4
|
+
|
|
5
|
+
// The executive view: a slide composed freely, whose boxes are entities of the model.
|
|
6
|
+
diagram executive: free {
|
|
7
|
+
title "From click to confirmed order"
|
|
8
|
+
canvas (1280, 720)
|
|
9
|
+
layout manual
|
|
10
|
+
|
|
11
|
+
text heading "From click to confirmed order"
|
|
12
|
+
text subtitle "One order, one payment, one event: under two seconds"
|
|
13
|
+
|
|
14
|
+
icon buyer "tabler:shopping-cart"
|
|
15
|
+
box customer "Customer" { link commerce.customer }
|
|
16
|
+
|
|
17
|
+
group shop "Online shop" {
|
|
18
|
+
box orders "Orders" { link commerce.shop.orders }
|
|
19
|
+
box payments "Payments" { link commerce.shop.payments }
|
|
20
|
+
orders -> payments: "Charge" as charge
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
box provider "Payment provider" { link commerce.provider }
|
|
24
|
+
|
|
25
|
+
customer -> orders: "Places an order" as order
|
|
26
|
+
payments -> provider: "Authorises" as authorise
|
|
27
|
+
|
|
28
|
+
placement {
|
|
29
|
+
place heading at (640, 90)
|
|
30
|
+
place subtitle at (640, 145)
|
|
31
|
+
place buyer at (170, 300)
|
|
32
|
+
place customer at (170, 390)
|
|
33
|
+
place shop at (640, 390)
|
|
34
|
+
size shop (520, 150)
|
|
35
|
+
place orders at (114, 35)
|
|
36
|
+
place payments at (374, 35)
|
|
37
|
+
place provider at (1110, 390)
|
|
38
|
+
label order at 40%
|
|
39
|
+
label authorise at 55%
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
style heading { fontSize 40; fontWeight 700 }
|
|
43
|
+
style subtitle { color muted }
|
|
44
|
+
style provider { shape pill }
|
|
45
|
+
animate order { effect flow; duration 1200ms; repeat forever }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// A slide picture at twice the pixels.
|
|
49
|
+
export slide for executive {
|
|
50
|
+
format png
|
|
51
|
+
scale 2
|
|
52
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
import commerce from "../models/commerce.meltemi"
|
|
4
|
+
|
|
5
|
+
// The payment sequence. Its participants are entities of the model, so they take its names.
|
|
6
|
+
diagram payment: sequence {
|
|
7
|
+
title "Payment"
|
|
8
|
+
|
|
9
|
+
actor customer { link commerce.customer }
|
|
10
|
+
participant web { link commerce.shop.web }
|
|
11
|
+
participant orders { link commerce.shop.orders }
|
|
12
|
+
participant payments { link commerce.shop.payments }
|
|
13
|
+
participant provider { link commerce.provider }
|
|
14
|
+
queue events { link commerce.shop.events }
|
|
15
|
+
|
|
16
|
+
customer -> web: "Pay" as checkout
|
|
17
|
+
web -> orders: "Confirm the order" as confirm
|
|
18
|
+
orders -> payments: "Charge" as charge
|
|
19
|
+
activate payments
|
|
20
|
+
payments -> provider: "Authorise the card" as authorise
|
|
21
|
+
|
|
22
|
+
alt result "Approved" {
|
|
23
|
+
provider --> payments: "Approved" as approved
|
|
24
|
+
payments -> events: "PaymentApproved" as publish
|
|
25
|
+
payments --> orders: "Paid" as paid
|
|
26
|
+
orders --> web: "Order confirmed" as confirmed
|
|
27
|
+
} else "Declined" {
|
|
28
|
+
provider --> payments: "Declined" as declined
|
|
29
|
+
payments --> orders: "Payment failed" as failed
|
|
30
|
+
orders --> web: "Try another card" as retry
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
deactivate payments
|
|
34
|
+
|
|
35
|
+
scenario approved "Payment approved" {
|
|
36
|
+
choose result "Approved"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
scenario declined "Payment declined" {
|
|
40
|
+
choose result "Declined"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
// The reference purchase: a customer, the API entry, orders, payments, events and data. Every view,
|
|
4
|
+
// the payment sequence, the executive slide and the story draw these entities.
|
|
5
|
+
model commerce {
|
|
6
|
+
person customer "Customer" { description "Buys online" }
|
|
7
|
+
|
|
8
|
+
system shop "Online shop" {
|
|
9
|
+
description "Takes orders and payments"
|
|
10
|
+
container web "Web store" { technology "React" }
|
|
11
|
+
container gateway "API gateway" { technology "Kong" }
|
|
12
|
+
container orders "Orders" { technology "Kotlin" }
|
|
13
|
+
container payments "Payments" { technology "Kotlin" }
|
|
14
|
+
container events "Event bus" { technology "Kafka" }
|
|
15
|
+
datastore db "Orders database" { technology "PostgreSQL" }
|
|
16
|
+
}
|
|
17
|
+
system provider "Payment provider" {
|
|
18
|
+
description "Authorises cards"
|
|
19
|
+
external
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
customer -> shop.web: "Places an order" as buys
|
|
23
|
+
shop.web -> shop.gateway: "Calls" as calls { technology "JSON/HTTPS" }
|
|
24
|
+
shop.gateway -> shop.orders: "Creates the order" as create
|
|
25
|
+
shop.orders -> shop.db: "Stores" as store
|
|
26
|
+
shop.orders -> shop.payments: "Requests the payment" as charge
|
|
27
|
+
shop.payments -> provider: "Authorises the card" as authorise
|
|
28
|
+
shop.payments -> shop.events: "PaymentApproved" as publish
|
|
29
|
+
shop.events -> shop.orders: "Confirms the order" as confirm
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
import "../diagrams/architecture.meltemi" as views
|
|
4
|
+
|
|
5
|
+
// The animated walkthrough: from the shop in context to the containers that take the order.
|
|
6
|
+
story purchase for views.context {
|
|
7
|
+
title "A purchase, step by step"
|
|
8
|
+
description "Who takes part, then how the order and the payment travel inside the shop."
|
|
9
|
+
|
|
10
|
+
scene who {
|
|
11
|
+
reveal customer, shop, provider over 800ms
|
|
12
|
+
highlight buys
|
|
13
|
+
hold 1s
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
scene inside {
|
|
17
|
+
view views.containers
|
|
18
|
+
transition morph over 900ms
|
|
19
|
+
trace calls over 700ms
|
|
20
|
+
trace create over 700ms
|
|
21
|
+
trace charge over 700ms
|
|
22
|
+
parallel {
|
|
23
|
+
trace authorise over 1000ms
|
|
24
|
+
highlight provider over 1000ms
|
|
25
|
+
}
|
|
26
|
+
trace publish over 700ms
|
|
27
|
+
trace confirm over 700ms
|
|
28
|
+
camera shop.orders, shop.payments, shop.events
|
|
29
|
+
hold 1500ms
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// The story as a 1080p video at 30 frames per second.
|
|
34
|
+
export video for purchase {
|
|
35
|
+
format mp4
|
|
36
|
+
size (1920, 1080)
|
|
37
|
+
fps 30
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
language "0.2"
|
|
2
|
+
|
|
3
|
+
// Sign-in, with a scenario for each outcome: export one with
|
|
4
|
+
// `meltemi-diagrams export diagrams/sign-in.meltemi --scenario success`.
|
|
5
|
+
diagram signin: sequence {
|
|
6
|
+
title "Sign in"
|
|
7
|
+
|
|
8
|
+
actor user "User"
|
|
9
|
+
participant web "Web app"
|
|
10
|
+
participant api "API"
|
|
11
|
+
database db "Users"
|
|
12
|
+
|
|
13
|
+
user -> web: "Email and password" as submit
|
|
14
|
+
web -> api: "POST /sessions" as login
|
|
15
|
+
activate api
|
|
16
|
+
api -> db: "Find the user" as find
|
|
17
|
+
db --> api: "User" as found
|
|
18
|
+
|
|
19
|
+
alt check "Password matches" {
|
|
20
|
+
api --> web: "Session" as session
|
|
21
|
+
web --> user: "Welcome" as welcome
|
|
22
|
+
} else "Wrong password" {
|
|
23
|
+
api --> web: "401" as rejected
|
|
24
|
+
web --> user: "Try again" as retry
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
deactivate api
|
|
28
|
+
|
|
29
|
+
scenario success "Signed in" {
|
|
30
|
+
choose check "Password matches"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
scenario failure "Wrong password" {
|
|
34
|
+
choose check "Wrong password"
|
|
35
|
+
}
|
|
36
|
+
}
|