@walkeros/server-destination-aws 4.8.2 → 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.
- package/CHANGELOG.md +28 -3
- package/dist/dev.d.mts +15 -2
- package/dist/dev.d.ts +15 -2
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +15 -2
- package/dist/examples/index.d.ts +15 -2
- package/dist/examples/index.js +86 -46
- package/dist/examples/index.mjs +79 -39
- package/dist/walkerOS.json +1121 -1074
- package/package.json +4 -4
package/dist/examples/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
var examples_exports = {};
|
|
9
9
|
__export(examples_exports, {
|
|
10
10
|
env: () => env_exports,
|
|
11
|
+
minimal: () => minimal,
|
|
11
12
|
step: () => step_exports
|
|
12
13
|
});
|
|
13
14
|
|
|
@@ -67,20 +68,6 @@ __export(step_exports, {
|
|
|
67
68
|
userSignupEvent: () => userSignupEvent
|
|
68
69
|
});
|
|
69
70
|
import { createEvent, getEvent } from "@walkeros/core";
|
|
70
|
-
|
|
71
|
-
// src/lib/payload.ts
|
|
72
|
-
import { isObject } from "@walkeros/core";
|
|
73
|
-
|
|
74
|
-
// src/firehose/lib/records.ts
|
|
75
|
-
function toRecordData(payload, newline = true) {
|
|
76
|
-
const json = JSON.stringify(payload);
|
|
77
|
-
if (typeof json !== "string")
|
|
78
|
-
throw new TypeError("The payload does not serialize to JSON.");
|
|
79
|
-
return Buffer.from(newline ? `${json}
|
|
80
|
-
` : json);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// src/firehose/examples/step.ts
|
|
84
71
|
var STREAM = "walkeros-events";
|
|
85
72
|
var init = {
|
|
86
73
|
title: "Initialization",
|
|
@@ -108,55 +95,86 @@ var init = {
|
|
|
108
95
|
};
|
|
109
96
|
var pageEvent = getEvent("page view", {
|
|
110
97
|
id: "ev-1700001000",
|
|
111
|
-
timestamp:
|
|
98
|
+
timestamp: 1700001e6,
|
|
112
99
|
data: { title: "Home", url: "https://example.com/" },
|
|
113
100
|
source: { type: "express", platform: "server" }
|
|
114
101
|
});
|
|
115
102
|
var orderEvt = getEvent("order complete", {
|
|
116
103
|
id: "ev-1700001001",
|
|
117
|
-
timestamp:
|
|
104
|
+
timestamp: 1700001001e3,
|
|
118
105
|
data: { id: "ORD-400", value: 99.99, currency: "EUR" },
|
|
119
106
|
source: { type: "express", platform: "server" }
|
|
120
107
|
});
|
|
121
108
|
var signupEvt = createEvent({
|
|
122
109
|
name: "user signup",
|
|
123
110
|
id: "ev-1700001002",
|
|
124
|
-
timestamp:
|
|
111
|
+
timestamp: 1700001002e3,
|
|
125
112
|
data: { plan: "pro", source: "landing-page" },
|
|
126
113
|
user: { id: "usr-789", email: "new@example.com" },
|
|
127
114
|
source: { type: "express", platform: "server" }
|
|
128
115
|
});
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
var firehoseRecord = {
|
|
117
|
+
title: "Page view record",
|
|
118
|
+
description: "A page view is sent to Firehose as one record: the full event as JSON followed by a newline.",
|
|
119
|
+
in: pageEvent,
|
|
120
|
+
mapping: void 0,
|
|
121
|
+
out: [
|
|
131
122
|
[
|
|
132
123
|
"client.send",
|
|
133
124
|
{
|
|
134
125
|
DeliveryStreamName: STREAM,
|
|
135
|
-
Records: [
|
|
126
|
+
Records: [
|
|
127
|
+
{
|
|
128
|
+
Data: Buffer.from(
|
|
129
|
+
'{"name":"page view","data":{"title":"Home","url":"https://example.com/"},"context":{"dev":["test",1]},"globals":{"pagegroup":"docs"},"custom":{"completely":"random"},"user":{"id":"us3r","device":"c00k13","session":"s3ss10n"},"nested":[{"entity":"child","data":{"is":"subordinated"}}],"consent":{"functional":true},"id":"ev-1700001000","trigger":"load","entity":"page","action":"view","timestamp":1700001000000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
]
|
|
136
133
|
}
|
|
137
134
|
]
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
var firehoseRecord = {
|
|
141
|
-
title: "Page view record",
|
|
142
|
-
description: "A page view is sent to Firehose as one record: the full event as JSON followed by a newline.",
|
|
143
|
-
in: pageEvent,
|
|
144
|
-
mapping: void 0,
|
|
145
|
-
out: sent(pageEvent)
|
|
135
|
+
]
|
|
146
136
|
};
|
|
147
137
|
var orderEvent = {
|
|
148
138
|
title: "Order record",
|
|
149
139
|
description: "An order complete event is serialized and delivered to Firehose as one newline-terminated record.",
|
|
150
140
|
in: orderEvt,
|
|
151
141
|
mapping: void 0,
|
|
152
|
-
out:
|
|
142
|
+
out: [
|
|
143
|
+
[
|
|
144
|
+
"client.send",
|
|
145
|
+
{
|
|
146
|
+
DeliveryStreamName: STREAM,
|
|
147
|
+
Records: [
|
|
148
|
+
{
|
|
149
|
+
Data: Buffer.from(
|
|
150
|
+
'{"name":"order complete","data":{"id":"ORD-400","value":99.99,"currency":"EUR"},"context":{"shopping":["complete",0]},"globals":{"pagegroup":"shop"},"custom":{"completely":"random"},"user":{"id":"us3r","device":"c00k13","session":"s3ss10n"},"nested":[{"entity":"product","data":{"id":"ers","name":"Everyday Ruck Snack","color":"black","size":"l","price":420},"context":{"shopping":["complete",0]},"nested":[]},{"entity":"product","data":{"id":"cc","name":"Cool Cap","size":"one size","price":42},"context":{"shopping":["complete",0]},"nested":[]},{"entity":"gift","data":{"name":"Surprise"},"context":{"shopping":["complete",0]},"nested":[]}],"consent":{"functional":true},"id":"ev-1700001001","trigger":"load","entity":"order","action":"complete","timestamp":1700001001000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
]
|
|
153
157
|
};
|
|
154
158
|
var userSignupEvent = {
|
|
155
159
|
title: "User signup record",
|
|
156
160
|
description: "A user signup event including user fields is streamed to Firehose as a JSON record.",
|
|
157
161
|
in: signupEvt,
|
|
158
162
|
mapping: void 0,
|
|
159
|
-
out:
|
|
163
|
+
out: [
|
|
164
|
+
[
|
|
165
|
+
"client.send",
|
|
166
|
+
{
|
|
167
|
+
DeliveryStreamName: STREAM,
|
|
168
|
+
Records: [
|
|
169
|
+
{
|
|
170
|
+
Data: Buffer.from(
|
|
171
|
+
'{"name":"user signup","data":{"plan":"pro","source":"landing-page"},"context":{"dev":["test",1]},"globals":{"lang":"elb"},"custom":{"completely":"random"},"user":{"id":"usr-789","email":"new@example.com"},"nested":[{"entity":"child","data":{"is":"subordinated"}}],"consent":{"functional":true},"id":"ev-1700001002","trigger":"test","entity":"user","action":"signup","timestamp":1700001002000,"timing":3.14,"source":{"count":1,"trace":"0a1b2c3d4e5f60718293a4b5c6d7e8f9","type":"express","platform":"server"}}\n'
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
]
|
|
160
178
|
};
|
|
161
179
|
var mappedRecord = {
|
|
162
180
|
title: "Mapped record",
|
|
@@ -172,12 +190,21 @@ var mappedRecord = {
|
|
|
172
190
|
}
|
|
173
191
|
}
|
|
174
192
|
},
|
|
175
|
-
out:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
193
|
+
out: [
|
|
194
|
+
[
|
|
195
|
+
"client.send",
|
|
196
|
+
{
|
|
197
|
+
DeliveryStreamName: STREAM,
|
|
198
|
+
Records: [
|
|
199
|
+
{
|
|
200
|
+
Data: Buffer.from(
|
|
201
|
+
'{"id":"ev-1700001001","name":"order complete","order_id":"ORD-400","total":99.99}\n'
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
]
|
|
181
208
|
};
|
|
182
209
|
var silentRule = {
|
|
183
210
|
public: false,
|
|
@@ -187,10 +214,16 @@ var silentRule = {
|
|
|
187
214
|
out: []
|
|
188
215
|
};
|
|
189
216
|
|
|
217
|
+
// src/firehose/examples/minimal.ts
|
|
218
|
+
var minimal = {
|
|
219
|
+
settings: { streamName: "walkeros-events" }
|
|
220
|
+
};
|
|
221
|
+
|
|
190
222
|
// src/sns/examples/index.ts
|
|
191
223
|
var examples_exports2 = {};
|
|
192
224
|
__export(examples_exports2, {
|
|
193
225
|
env: () => env_exports2,
|
|
226
|
+
minimal: () => minimal2,
|
|
194
227
|
step: () => step_exports2
|
|
195
228
|
});
|
|
196
229
|
|
|
@@ -313,20 +346,20 @@ var init2 = {
|
|
|
313
346
|
};
|
|
314
347
|
var pageEvent2 = getEvent2("page view", {
|
|
315
348
|
id: "ev-1700001000",
|
|
316
|
-
timestamp:
|
|
349
|
+
timestamp: 1700001e6,
|
|
317
350
|
data: { title: "Home", url: "https://example.com/" },
|
|
318
351
|
source: { type: "express", platform: "server" }
|
|
319
352
|
});
|
|
320
353
|
var orderEvt2 = getEvent2("order complete", {
|
|
321
354
|
id: "ev-1700001001",
|
|
322
|
-
timestamp:
|
|
355
|
+
timestamp: 1700001001e3,
|
|
323
356
|
data: { id: "ORD-400", value: 99.99, currency: "EUR" },
|
|
324
357
|
user: { id: "usr-789" },
|
|
325
358
|
source: { type: "express", platform: "server" }
|
|
326
359
|
});
|
|
327
360
|
var productViewEvt = getEvent2("product view", {
|
|
328
361
|
id: "ev-1700001002",
|
|
329
|
-
timestamp:
|
|
362
|
+
timestamp: 1700001002e3,
|
|
330
363
|
data: { id: "SKU-1", tenant_id: "acme" },
|
|
331
364
|
source: { type: "express", platform: "server" }
|
|
332
365
|
});
|
|
@@ -419,6 +452,13 @@ var silentRule2 = {
|
|
|
419
452
|
mapping: { silent: true },
|
|
420
453
|
out: []
|
|
421
454
|
};
|
|
455
|
+
|
|
456
|
+
// src/sns/examples/minimal.ts
|
|
457
|
+
var minimal2 = {
|
|
458
|
+
settings: {
|
|
459
|
+
topicArn: "arn:aws:sns:eu-central-1:123456789012:walkeros-events"
|
|
460
|
+
}
|
|
461
|
+
};
|
|
422
462
|
export {
|
|
423
463
|
env_exports as env,
|
|
424
464
|
examples_exports as firehose,
|