@walkeros/server-destination-aws 3.3.1 → 3.4.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.
@@ -18,8 +18,18 @@ declare namespace env {
18
18
  export { env_push as push, env_simulation as simulation };
19
19
  }
20
20
 
21
+ /**
22
+ * Default firehose push -- client.send(new PutRecordBatchCommand({...}))
23
+ * Records contain the full event JSON-stringified as Buffer Data.
24
+ */
21
25
  declare const firehoseRecord: Flow.StepExample;
26
+ /**
27
+ * Order event -- same pattern, full event serialized in Records[0].Data.
28
+ */
22
29
  declare const orderEvent: Flow.StepExample;
30
+ /**
31
+ * User signup -- full event including user fields is serialized to Firehose.
32
+ */
23
33
  declare const userSignupEvent: Flow.StepExample;
24
34
 
25
35
  declare const step_firehoseRecord: typeof firehoseRecord;
@@ -18,8 +18,18 @@ declare namespace env {
18
18
  export { env_push as push, env_simulation as simulation };
19
19
  }
20
20
 
21
+ /**
22
+ * Default firehose push -- client.send(new PutRecordBatchCommand({...}))
23
+ * Records contain the full event JSON-stringified as Buffer Data.
24
+ */
21
25
  declare const firehoseRecord: Flow.StepExample;
26
+ /**
27
+ * Order event -- same pattern, full event serialized in Records[0].Data.
28
+ */
22
29
  declare const orderEvent: Flow.StepExample;
30
+ /**
31
+ * User signup -- full event including user fields is serialized to Firehose.
32
+ */
23
33
  declare const userSignupEvent: Flow.StepExample;
24
34
 
25
35
  declare const step_firehoseRecord: typeof firehoseRecord;
@@ -81,9 +81,9 @@ var c = {};
81
81
  for (var o in n) e(t, o, { get: n[o], enumerable: true });
82
82
  })(c, { Level: () => u });
83
83
  var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(u || {});
84
- var F = { merge: true, shallow: true, extend: true };
84
+ var W = { merge: true, shallow: true, extend: true };
85
85
  function L(e2, t = {}, n = {}) {
86
- n = { ...F, ...n };
86
+ n = { ...W, ...n };
87
87
  const o = Object.entries(t).reduce((t2, [o2, r]) => {
88
88
  const i = e2[o2];
89
89
  return n.merge && Array.isArray(i) && Array.isArray(r) ? t2[o2] = r.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || o2 in e2) && (t2[o2] = r), t2;
@@ -92,7 +92,7 @@ function L(e2, t = {}, n = {}) {
92
92
  }
93
93
  function fe(e2 = {}) {
94
94
  var _a;
95
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "3.3.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
95
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "3.4.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
96
96
  if (e2.name) {
97
97
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
98
98
  t2 && n2 && (r.entity = t2, r.action = n2);
@@ -112,17 +112,27 @@ var firehoseRecord = {
112
112
  source: { type: "server", id: "", previous_id: "" }
113
113
  }),
114
114
  mapping: void 0,
115
- out: {
116
- DeliveryStreamName: "walkeros-events",
117
- Records: [
115
+ out: [
116
+ [
117
+ "client.send",
118
118
  {
119
- Data: JSON.stringify({
120
- title: "Home",
121
- url: "https://example.com/"
122
- })
119
+ DeliveryStreamName: "walkeros-events",
120
+ Records: [
121
+ {
122
+ Data: Buffer.from(
123
+ JSON.stringify(
124
+ le("page view", {
125
+ timestamp: 1700001e3,
126
+ data: { title: "Home", url: "https://example.com/" },
127
+ source: { type: "server", id: "", previous_id: "" }
128
+ })
129
+ )
130
+ )
131
+ }
132
+ ]
123
133
  }
124
134
  ]
125
- }
135
+ ]
126
136
  };
127
137
  var orderEvent = {
128
138
  in: le("order complete", {
@@ -131,18 +141,27 @@ var orderEvent = {
131
141
  source: { type: "server", id: "", previous_id: "" }
132
142
  }),
133
143
  mapping: void 0,
134
- out: {
135
- DeliveryStreamName: "walkeros-events",
136
- Records: [
144
+ out: [
145
+ [
146
+ "client.send",
137
147
  {
138
- Data: JSON.stringify({
139
- id: "ORD-400",
140
- total: 99.99,
141
- currency: "EUR"
142
- })
148
+ DeliveryStreamName: "walkeros-events",
149
+ Records: [
150
+ {
151
+ Data: Buffer.from(
152
+ JSON.stringify(
153
+ le("order complete", {
154
+ timestamp: 1700001001,
155
+ data: { id: "ORD-400", total: 99.99, currency: "EUR" },
156
+ source: { type: "server", id: "", previous_id: "" }
157
+ })
158
+ )
159
+ )
160
+ }
161
+ ]
143
162
  }
144
163
  ]
145
- }
164
+ ]
146
165
  };
147
166
  var userSignupEvent = {
148
167
  in: le("user signup", {
@@ -152,17 +171,28 @@ var userSignupEvent = {
152
171
  source: { type: "server", id: "", previous_id: "" }
153
172
  }),
154
173
  mapping: void 0,
155
- out: {
156
- DeliveryStreamName: "walkeros-events",
157
- Records: [
174
+ out: [
175
+ [
176
+ "client.send",
158
177
  {
159
- Data: JSON.stringify({
160
- plan: "pro",
161
- source: "landing-page"
162
- })
178
+ DeliveryStreamName: "walkeros-events",
179
+ Records: [
180
+ {
181
+ Data: Buffer.from(
182
+ JSON.stringify(
183
+ le("user signup", {
184
+ timestamp: 1700001002,
185
+ data: { plan: "pro", source: "landing-page" },
186
+ user: { id: "usr-789", email: "new@example.com" },
187
+ source: { type: "server", id: "", previous_id: "" }
188
+ })
189
+ )
190
+ )
191
+ }
192
+ ]
163
193
  }
164
194
  ]
165
- }
195
+ ]
166
196
  };
167
197
  // Annotate the CommonJS export names for ESM import in node:
168
198
  0 && (module.exports = {
@@ -59,9 +59,9 @@ var c = {};
59
59
  for (var o in n) e(t, o, { get: n[o], enumerable: true });
60
60
  })(c, { Level: () => u });
61
61
  var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(u || {});
62
- var F = { merge: true, shallow: true, extend: true };
62
+ var W = { merge: true, shallow: true, extend: true };
63
63
  function L(e2, t = {}, n = {}) {
64
- n = { ...F, ...n };
64
+ n = { ...W, ...n };
65
65
  const o = Object.entries(t).reduce((t2, [o2, r]) => {
66
66
  const i = e2[o2];
67
67
  return n.merge && Array.isArray(i) && Array.isArray(r) ? t2[o2] = r.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || o2 in e2) && (t2[o2] = r), t2;
@@ -70,7 +70,7 @@ function L(e2, t = {}, n = {}) {
70
70
  }
71
71
  function fe(e2 = {}) {
72
72
  var _a;
73
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "3.3.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
73
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "3.4.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
74
74
  if (e2.name) {
75
75
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
76
76
  t2 && n2 && (r.entity = t2, r.action = n2);
@@ -90,17 +90,27 @@ var firehoseRecord = {
90
90
  source: { type: "server", id: "", previous_id: "" }
91
91
  }),
92
92
  mapping: void 0,
93
- out: {
94
- DeliveryStreamName: "walkeros-events",
95
- Records: [
93
+ out: [
94
+ [
95
+ "client.send",
96
96
  {
97
- Data: JSON.stringify({
98
- title: "Home",
99
- url: "https://example.com/"
100
- })
97
+ DeliveryStreamName: "walkeros-events",
98
+ Records: [
99
+ {
100
+ Data: Buffer.from(
101
+ JSON.stringify(
102
+ le("page view", {
103
+ timestamp: 1700001e3,
104
+ data: { title: "Home", url: "https://example.com/" },
105
+ source: { type: "server", id: "", previous_id: "" }
106
+ })
107
+ )
108
+ )
109
+ }
110
+ ]
101
111
  }
102
112
  ]
103
- }
113
+ ]
104
114
  };
105
115
  var orderEvent = {
106
116
  in: le("order complete", {
@@ -109,18 +119,27 @@ var orderEvent = {
109
119
  source: { type: "server", id: "", previous_id: "" }
110
120
  }),
111
121
  mapping: void 0,
112
- out: {
113
- DeliveryStreamName: "walkeros-events",
114
- Records: [
122
+ out: [
123
+ [
124
+ "client.send",
115
125
  {
116
- Data: JSON.stringify({
117
- id: "ORD-400",
118
- total: 99.99,
119
- currency: "EUR"
120
- })
126
+ DeliveryStreamName: "walkeros-events",
127
+ Records: [
128
+ {
129
+ Data: Buffer.from(
130
+ JSON.stringify(
131
+ le("order complete", {
132
+ timestamp: 1700001001,
133
+ data: { id: "ORD-400", total: 99.99, currency: "EUR" },
134
+ source: { type: "server", id: "", previous_id: "" }
135
+ })
136
+ )
137
+ )
138
+ }
139
+ ]
121
140
  }
122
141
  ]
123
- }
142
+ ]
124
143
  };
125
144
  var userSignupEvent = {
126
145
  in: le("user signup", {
@@ -130,17 +149,28 @@ var userSignupEvent = {
130
149
  source: { type: "server", id: "", previous_id: "" }
131
150
  }),
132
151
  mapping: void 0,
133
- out: {
134
- DeliveryStreamName: "walkeros-events",
135
- Records: [
152
+ out: [
153
+ [
154
+ "client.send",
136
155
  {
137
- Data: JSON.stringify({
138
- plan: "pro",
139
- source: "landing-page"
140
- })
156
+ DeliveryStreamName: "walkeros-events",
157
+ Records: [
158
+ {
159
+ Data: Buffer.from(
160
+ JSON.stringify(
161
+ le("user signup", {
162
+ timestamp: 1700001002,
163
+ data: { plan: "pro", source: "landing-page" },
164
+ user: { id: "usr-789", email: "new@example.com" },
165
+ source: { type: "server", id: "", previous_id: "" }
166
+ })
167
+ )
168
+ )
169
+ }
170
+ ]
141
171
  }
142
172
  ]
143
- }
173
+ ]
144
174
  };
145
175
  export {
146
176
  env_exports as env,