@walkeros/cli 4.8.1 → 4.8.3-next-1793115089237

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +115 -3
  2. package/README.md +2 -2
  3. package/dist/cli.js +4149 -4149
  4. package/dist/dev.d.ts +51 -3
  5. package/dist/dev.js +186 -0
  6. package/dist/dev.js.map +1 -1
  7. package/dist/examples/README.md +12 -1
  8. package/dist/examples/contracts/app.json +261 -0
  9. package/dist/examples/contracts/base.json +708 -0
  10. package/dist/examples/contracts/ecommerce.json +963 -0
  11. package/dist/examples/contracts/leadgen.json +240 -0
  12. package/dist/examples/contracts/publisher.json +372 -0
  13. package/dist/examples/contracts/saas.json +229 -0
  14. package/dist/examples/contracts/travel.json +234 -0
  15. package/dist/examples/customers/README.md +4 -1
  16. package/dist/examples/event.json +1 -1
  17. package/dist/examples/flow-complete.json +107 -130
  18. package/dist/examples/flow-complete.md +12 -10
  19. package/dist/examples/flow-order-complete.json +1 -1
  20. package/dist/examples/flow.json +1 -1
  21. package/dist/examples/index.d.ts +34 -4
  22. package/dist/examples/index.js +128 -139
  23. package/dist/examples/index.js.map +1 -1
  24. package/dist/examples/shared/README.md +4 -0
  25. package/dist/index.d.ts +63 -223
  26. package/dist/index.js +572 -992
  27. package/dist/index.js.map +1 -1
  28. package/dist/validate.d.ts +1 -1
  29. package/dist/validate.js +337 -204
  30. package/dist/validate.js.map +1 -1
  31. package/examples/README.md +12 -1
  32. package/examples/contracts/app.json +261 -0
  33. package/examples/contracts/base.json +708 -0
  34. package/examples/contracts/ecommerce.json +963 -0
  35. package/examples/contracts/leadgen.json +240 -0
  36. package/examples/contracts/publisher.json +372 -0
  37. package/examples/contracts/saas.json +229 -0
  38. package/examples/contracts/travel.json +234 -0
  39. package/examples/customers/README.md +4 -1
  40. package/examples/event.json +1 -1
  41. package/examples/flow-complete.json +107 -130
  42. package/examples/flow-complete.md +12 -10
  43. package/examples/flow-order-complete.json +1 -1
  44. package/examples/flow.json +1 -1
  45. package/examples/shared/README.md +4 -0
  46. package/package.json +30 -30
  47. package/src/telemetry/flow.json +42 -34
  48. package/dist/examples/test.html +0 -43
  49. package/dist/examples/web-serve.js +0 -25503
  50. package/examples/test.html +0 -43
  51. package/examples/web-serve.js +0 -25503
@@ -0,0 +1,229 @@
1
+ {
2
+ "saas": {
3
+ "description": "Events of a SaaS product: trials and subscriptions.",
4
+ "extend": "default",
5
+ "schema": {
6
+ "description": "What every SaaS event adds.",
7
+ "type": "object",
8
+ "properties": {
9
+ "user": {
10
+ "type": "object",
11
+ "properties": {
12
+ "account": {
13
+ "type": "string",
14
+ "description": "The id of the company account the user belongs to.",
15
+ "examples": ["0e8c78ea9d97a7b8185e8632"]
16
+ }
17
+ }
18
+ }
19
+ }
20
+ },
21
+ "events": {
22
+ "trial": {
23
+ "start": {
24
+ "title": "Trial start",
25
+ "description": "A free trial of a paid plan began. Every SaaS product with trials needs it.",
26
+ "examples": [
27
+ {
28
+ "name": "trial start",
29
+ "data": {
30
+ "end": "2026-10-15T00:00:00Z"
31
+ },
32
+ "nested": [
33
+ {
34
+ "entity": "plan",
35
+ "data": {
36
+ "id": "business",
37
+ "name": "Business"
38
+ }
39
+ }
40
+ ],
41
+ "user": {
42
+ "id": "us3r",
43
+ "account": "0e8c78ea9d97a7b8185e8632"
44
+ }
45
+ }
46
+ ],
47
+ "required": ["nested"],
48
+ "properties": {
49
+ "data": {
50
+ "type": "object",
51
+ "description": "The trial.",
52
+ "properties": {
53
+ "end": {
54
+ "type": "string",
55
+ "format": "date-time",
56
+ "description": "When the trial ends.",
57
+ "examples": ["2026-10-15T00:00:00Z"]
58
+ }
59
+ }
60
+ },
61
+ "nested": {
62
+ "type": "array",
63
+ "description": "The plan on trial.",
64
+ "contains": {
65
+ "type": "object",
66
+ "required": ["entity", "data"],
67
+ "properties": {
68
+ "entity": {
69
+ "type": "string",
70
+ "enum": ["plan"],
71
+ "description": "The entity name, plan.",
72
+ "examples": ["plan"]
73
+ },
74
+ "data": {
75
+ "type": "object",
76
+ "description": "The plan.",
77
+ "required": ["id"],
78
+ "properties": {
79
+ "id": {
80
+ "type": ["string", "number"],
81
+ "description": "The id of the plan.",
82
+ "examples": ["business"]
83
+ },
84
+ "name": {
85
+ "type": "string",
86
+ "description": "The name of the plan.",
87
+ "examples": ["Business"]
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "subscription": {
98
+ "start": {
99
+ "title": "Subscription start",
100
+ "description": "An account started to pay for a plan. Every SaaS product needs it. A renewal is no subscription start.",
101
+ "examples": [
102
+ {
103
+ "name": "subscription start",
104
+ "data": {
105
+ "id": "sub_9f21",
106
+ "value": 49,
107
+ "currency": "EUR",
108
+ "interval": "month"
109
+ },
110
+ "nested": [
111
+ {
112
+ "entity": "plan",
113
+ "data": {
114
+ "id": "business",
115
+ "name": "Business"
116
+ }
117
+ }
118
+ ],
119
+ "user": {
120
+ "id": "us3r",
121
+ "account": "0e8c78ea9d97a7b8185e8632"
122
+ }
123
+ }
124
+ ],
125
+ "required": ["data", "nested"],
126
+ "properties": {
127
+ "data": {
128
+ "type": "object",
129
+ "description": "The subscription.",
130
+ "required": ["id", "value", "currency"],
131
+ "properties": {
132
+ "id": {
133
+ "type": ["string", "number"],
134
+ "description": "The id of the subscription.",
135
+ "examples": ["sub_9f21"]
136
+ },
137
+ "value": {
138
+ "type": "number",
139
+ "description": "The amount of the first billing period, without tax.",
140
+ "examples": [49]
141
+ },
142
+ "currency": {
143
+ "type": "string",
144
+ "description": "The currency of value, as a three-letter code.",
145
+ "examples": ["EUR"]
146
+ },
147
+ "interval": {
148
+ "type": "string",
149
+ "description": "How often the subscription is billed, such as month or year.",
150
+ "examples": ["month"]
151
+ }
152
+ }
153
+ },
154
+ "nested": {
155
+ "type": "array",
156
+ "description": "The plan subscribed to.",
157
+ "contains": {
158
+ "type": "object",
159
+ "required": ["entity", "data"],
160
+ "properties": {
161
+ "entity": {
162
+ "type": "string",
163
+ "enum": ["plan"],
164
+ "description": "The entity name, plan.",
165
+ "examples": ["plan"]
166
+ },
167
+ "data": {
168
+ "type": "object",
169
+ "description": "The plan.",
170
+ "required": ["id"],
171
+ "properties": {
172
+ "id": {
173
+ "type": ["string", "number"],
174
+ "description": "The id of the plan.",
175
+ "examples": ["business"]
176
+ },
177
+ "name": {
178
+ "type": "string",
179
+ "description": "The name of the plan.",
180
+ "examples": ["Business"]
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ },
189
+ "cancel": {
190
+ "title": "Subscription cancel",
191
+ "description": "An account cancelled its subscription. Recommended for every SaaS product.",
192
+ "examples": [
193
+ {
194
+ "name": "subscription cancel",
195
+ "data": {
196
+ "id": "sub_9f21",
197
+ "reason": "too expensive"
198
+ },
199
+ "user": {
200
+ "id": "us3r",
201
+ "account": "0e8c78ea9d97a7b8185e8632"
202
+ }
203
+ }
204
+ ],
205
+ "required": ["data"],
206
+ "properties": {
207
+ "data": {
208
+ "type": "object",
209
+ "description": "The cancelled subscription.",
210
+ "required": ["id"],
211
+ "properties": {
212
+ "id": {
213
+ "type": ["string", "number"],
214
+ "description": "The id of the subscription.",
215
+ "examples": ["sub_9f21"]
216
+ },
217
+ "reason": {
218
+ "type": "string",
219
+ "description": "Why the account cancelled.",
220
+ "examples": ["too expensive"]
221
+ }
222
+ }
223
+ }
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
@@ -0,0 +1,234 @@
1
+ {
2
+ "travel": {
3
+ "description": "Events of a travel booking site, from the trip being planned to the confirmed booking.",
4
+ "extend": "default",
5
+ "events": {
6
+ "itinerary": {
7
+ "add": {
8
+ "title": "Itinerary add",
9
+ "description": "A visitor added an experience or a destination to the trip they plan.",
10
+ "examples": [
11
+ {
12
+ "name": "itinerary add",
13
+ "data": {
14
+ "id": "it3m",
15
+ "type": "experience"
16
+ },
17
+ "trigger": "click"
18
+ }
19
+ ],
20
+ "required": ["data"],
21
+ "properties": {
22
+ "data": {
23
+ "type": "object",
24
+ "description": "The item added to the trip.",
25
+ "required": ["id", "type"],
26
+ "properties": {
27
+ "id": {
28
+ "type": ["string", "number"],
29
+ "description": "The id of the item.",
30
+ "examples": ["it3m"]
31
+ },
32
+ "type": {
33
+ "type": "string",
34
+ "description": "What is booked, such as an experience or a destination.",
35
+ "examples": ["experience"]
36
+ },
37
+ "title": {
38
+ "type": "string",
39
+ "description": "The name of what is booked."
40
+ },
41
+ "location": {
42
+ "type": "string",
43
+ "description": "Where it takes place."
44
+ },
45
+ "price": {
46
+ "type": "number",
47
+ "description": "The price per participant."
48
+ },
49
+ "currency": {
50
+ "type": "string",
51
+ "description": "The currency of every amount, as a three-letter code.",
52
+ "examples": ["EUR"]
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "booking": {
60
+ "start": {
61
+ "title": "Booking start",
62
+ "description": "A visitor began to book.",
63
+ "examples": [
64
+ {
65
+ "name": "booking start",
66
+ "data": {
67
+ "id": "b00k1ng",
68
+ "type": "experience"
69
+ },
70
+ "trigger": "click"
71
+ }
72
+ ],
73
+ "required": ["data"],
74
+ "properties": {
75
+ "data": {
76
+ "type": "object",
77
+ "description": "The booking.",
78
+ "required": ["id", "type"],
79
+ "properties": {
80
+ "id": {
81
+ "type": ["string", "number"],
82
+ "description": "The booking number.",
83
+ "examples": ["b00k1ng"]
84
+ },
85
+ "type": {
86
+ "type": "string",
87
+ "description": "What is booked, such as an experience or a destination.",
88
+ "examples": ["experience"]
89
+ },
90
+ "title": {
91
+ "type": "string",
92
+ "description": "The name of what is booked."
93
+ },
94
+ "location": {
95
+ "type": "string",
96
+ "description": "Where it takes place."
97
+ },
98
+ "price": {
99
+ "type": "number",
100
+ "description": "The price per participant."
101
+ },
102
+ "currency": {
103
+ "type": "string",
104
+ "description": "The currency of every amount, as a three-letter code.",
105
+ "examples": ["EUR"]
106
+ }
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "complete": {
112
+ "title": "Booking complete",
113
+ "description": "A booking was confirmed.",
114
+ "examples": [
115
+ {
116
+ "name": "booking complete",
117
+ "data": {
118
+ "id": "b00k1ng",
119
+ "type": "experience",
120
+ "start": "2026-11-12",
121
+ "end": "2026-11-15",
122
+ "participants": 2,
123
+ "insurance": false,
124
+ "value": 120,
125
+ "price": 60,
126
+ "currency": "EUR"
127
+ },
128
+ "trigger": "load"
129
+ }
130
+ ],
131
+ "required": ["data"],
132
+ "properties": {
133
+ "data": {
134
+ "type": "object",
135
+ "description": "The booking.",
136
+ "required": ["id", "value", "currency"],
137
+ "properties": {
138
+ "id": {
139
+ "type": ["string", "number"],
140
+ "description": "The booking number.",
141
+ "examples": ["b00k1ng"]
142
+ },
143
+ "type": {
144
+ "type": "string",
145
+ "description": "What is booked, such as an experience or a destination.",
146
+ "examples": ["experience"]
147
+ },
148
+ "title": {
149
+ "type": "string",
150
+ "description": "The name of what is booked."
151
+ },
152
+ "location": {
153
+ "type": "string",
154
+ "description": "Where it takes place."
155
+ },
156
+ "price": {
157
+ "type": "number",
158
+ "description": "The price per participant.",
159
+ "examples": [60]
160
+ },
161
+ "currency": {
162
+ "type": "string",
163
+ "description": "The currency of every amount, as a three-letter code.",
164
+ "examples": ["EUR"]
165
+ },
166
+ "start": {
167
+ "type": "string",
168
+ "format": "date",
169
+ "description": "The first day of the booking.",
170
+ "examples": ["2026-11-12"]
171
+ },
172
+ "end": {
173
+ "type": "string",
174
+ "format": "date",
175
+ "description": "The last day of the booking.",
176
+ "examples": ["2026-11-15"]
177
+ },
178
+ "participants": {
179
+ "type": "number",
180
+ "description": "How many people the booking is for.",
181
+ "examples": [2]
182
+ },
183
+ "insurance": {
184
+ "type": "boolean",
185
+ "description": "True when the booking includes insurance.",
186
+ "examples": [false]
187
+ },
188
+ "value": {
189
+ "type": "number",
190
+ "description": "The price times the participants.",
191
+ "examples": [120]
192
+ }
193
+ }
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "filter": {
199
+ "apply": {
200
+ "title": "Filter apply",
201
+ "description": "A visitor filtered a list of results.",
202
+ "examples": [
203
+ {
204
+ "name": "filter apply",
205
+ "data": {
206
+ "type": "price",
207
+ "option": "under 100"
208
+ },
209
+ "trigger": "click"
210
+ }
211
+ ],
212
+ "properties": {
213
+ "data": {
214
+ "type": "object",
215
+ "description": "The filter.",
216
+ "properties": {
217
+ "type": {
218
+ "type": "string",
219
+ "description": "What the filter works on, such as price.",
220
+ "examples": ["price"]
221
+ },
222
+ "option": {
223
+ "type": "string",
224
+ "description": "The option chosen.",
225
+ "examples": ["under 100"]
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
@@ -11,7 +11,10 @@ Not covered by root `include`, so no customer data ships in a bundle. `basePath`
11
11
  defaults to `./customers`, relative to the working directory: run
12
12
  `walkeros push` from `packages/cli/examples`, or set `CUSTOMERS_DIR` to this
13
13
  folder's absolute path (always for `runneros start`, which runs inside the
14
- artifact folder).
14
+ artifact folder). From any other directory the lookup finds no file and the user
15
+ gets no `ltv` or `segment`, without an error. A server flow simulation also
16
+ needs the variables the setup in `flow-complete.md` exports (`GCP_SA`,
17
+ `FINGERPRINT_SALT`, `EMAIL_SALT`).
15
18
 
16
19
  In production the store is swapped for a real one, e.g.
17
20
  `@walkeros/server-store-sheets` or a GCS store; the `loadUser` step does not
@@ -2,7 +2,7 @@
2
2
  "name": "order complete",
3
3
  "data": {
4
4
  "id": "ORD-2024-12345",
5
- "total": 299.99,
5
+ "value": 299.99,
6
6
  "currency": "USD",
7
7
  "tax": 24.99,
8
8
  "shipping": 15.0