@codaco/analytics 3.1.0 → 5.0.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/dist/index.mjs DELETED
@@ -1,165 +0,0 @@
1
- // src/utils.ts
2
- function ensureError(value) {
3
- if (!value)
4
- return new Error("No value was thrown");
5
- if (value instanceof Error)
6
- return value;
7
- if (value.isPrototypeOf(Error))
8
- return value;
9
- let stringified = "[Unable to stringify the thrown value]";
10
- try {
11
- stringified = JSON.stringify(value);
12
- } catch {
13
- }
14
- const error = new Error(
15
- `This value was thrown as is, not through an Error: ${stringified}`
16
- );
17
- return error;
18
- }
19
- function getBaseUrl() {
20
- if (typeof window !== "undefined")
21
- return "";
22
- if (process.env.VERCEL_URL)
23
- return `https://${process.env.VERCEL_URL}`;
24
- if (process.env.NEXT_PUBLIC_URL)
25
- return process.env.NEXT_PUBLIC_URL;
26
- return `http://127.0.0.1:3000`;
27
- }
28
-
29
- // src/index.ts
30
- import z from "zod";
31
- var eventTypes = [
32
- "AppSetup",
33
- "ProtocolInstalled",
34
- "InterviewStarted",
35
- "InterviewCompleted",
36
- "DataExported",
37
- "Error"
38
- ];
39
- var EventsSchema = z.object({
40
- type: z.enum(eventTypes),
41
- installationId: z.string(),
42
- timestamp: z.string(),
43
- isocode: z.string().optional(),
44
- error: z.object({
45
- message: z.string(),
46
- name: z.string(),
47
- stack: z.string().optional()
48
- }).optional(),
49
- metadata: z.record(z.unknown()).optional()
50
- });
51
- var createRouteHandler = ({
52
- platformUrl = "https://analytics.networkcanvas.com",
53
- installationId,
54
- maxMindClient
55
- }) => {
56
- return async (request) => {
57
- try {
58
- const event = await request.json();
59
- const ip = await fetch("https://api64.ipify.org").then(
60
- (res) => res.text()
61
- );
62
- const { country } = await maxMindClient.country(ip);
63
- const countryCode = country?.isoCode ?? "Unknown";
64
- const dispatchableEvent = {
65
- ...event,
66
- installationId,
67
- isocode: countryCode
68
- };
69
- const response = await fetch(`${platformUrl}/api/event`, {
70
- keepalive: true,
71
- method: "POST",
72
- headers: {
73
- "Content-Type": "application/json"
74
- },
75
- body: JSON.stringify(dispatchableEvent)
76
- });
77
- if (!response.ok) {
78
- if (response.status === 404) {
79
- console.error(
80
- `Analytics platform not found. Please specify a valid platform URL.`
81
- );
82
- } else if (response.status === 500) {
83
- console.error(
84
- `Internal server error on analytics platform when forwarding event: ${response.statusText}.`
85
- );
86
- } else {
87
- console.error(
88
- `General error when forwarding event: ${response.statusText}`
89
- );
90
- }
91
- return new Response(
92
- JSON.stringify({ error: "Internal Server Error" }),
93
- {
94
- status: 500,
95
- headers: {
96
- "Content-Type": "application/json"
97
- }
98
- }
99
- );
100
- }
101
- return new Response(
102
- JSON.stringify({ message: "Event forwarded successfully" }),
103
- {
104
- status: 200,
105
- headers: {
106
- "Content-Type": "application/json"
107
- }
108
- }
109
- );
110
- } catch (e) {
111
- const error = ensureError(e);
112
- console.error("Error in route handler:", error);
113
- return new Response(JSON.stringify({ error: "Internal Server Error" }), {
114
- status: 500,
115
- headers: {
116
- "Content-Type": "application/json"
117
- }
118
- });
119
- }
120
- };
121
- };
122
- var makeEventTracker = (endpoint = "/api/analytics") => async (event) => {
123
- const endpointWithHost = getBaseUrl() + endpoint;
124
- const eventWithTimeStamp = {
125
- ...event,
126
- timestamp: /* @__PURE__ */ new Date()
127
- };
128
- try {
129
- const response = await fetch(endpointWithHost, {
130
- method: "POST",
131
- keepalive: true,
132
- body: JSON.stringify(eventWithTimeStamp),
133
- headers: {
134
- "Content-Type": "application/json"
135
- }
136
- });
137
- if (!response.ok) {
138
- if (response.status === 404) {
139
- console.error(
140
- `Analytics endpoint not found, did you forget to add the route?`
141
- );
142
- return;
143
- }
144
- if (response.status === 500) {
145
- console.error(
146
- `Internal server error when sending analytics event: ${response.statusText}. Check the route handler implementation.`
147
- );
148
- return;
149
- }
150
- console.error(
151
- `General error sending analytics event: ${response.statusText}`
152
- );
153
- }
154
- } catch (e) {
155
- const error = ensureError(e);
156
- console.error("Internal error with analytics:", error.message);
157
- }
158
- };
159
- export {
160
- EventsSchema,
161
- createRouteHandler,
162
- eventTypes,
163
- makeEventTracker
164
- };
165
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils.ts","../src/index.ts"],"sourcesContent":["// Helper function that ensures that a value is an Error\r\nexport function ensureError(value: unknown): Error {\r\n if (!value) return new Error(\"No value was thrown\");\r\n\r\n if (value instanceof Error) return value;\r\n\r\n // Test if value inherits from Error\r\n if (value.isPrototypeOf(Error)) return value as Error & typeof value;\r\n\r\n let stringified = \"[Unable to stringify the thrown value]\";\r\n try {\r\n stringified = JSON.stringify(value);\r\n } catch {}\r\n\r\n const error = new Error(\r\n `This value was thrown as is, not through an Error: ${stringified}`\r\n );\r\n return error;\r\n}\r\n\r\nexport function getBaseUrl() {\r\n if (typeof window !== \"undefined\")\r\n // browser should use relative path\r\n return \"\";\r\n\r\n if (process.env.VERCEL_URL)\r\n // reference for vercel.com\r\n return `https://${process.env.VERCEL_URL}`;\r\n\r\n if (process.env.NEXT_PUBLIC_URL)\r\n // Manually set deployment URL from env\r\n return process.env.NEXT_PUBLIC_URL;\r\n\r\n // assume localhost\r\n return `http://127.0.0.1:3000`;\r\n}\r\n","import type { NextRequest } from \"next/server\";\r\nimport { WebServiceClient } from \"@maxmind/geoip2-node\";\r\nimport { ensureError, getBaseUrl } from \"./utils\";\r\nimport z from \"zod\";\r\n\r\nexport const eventTypes = [\r\n \"AppSetup\",\r\n \"ProtocolInstalled\",\r\n \"InterviewStarted\",\r\n \"InterviewCompleted\",\r\n \"DataExported\",\r\n \"Error\",\r\n] as const;\r\n\r\nexport type EventType = (typeof eventTypes)[number];\r\ntype EventTypeWithoutError = Exclude<EventType, \"Error\">;\r\n\r\nexport const EventsSchema = z.object({\r\n type: z.enum(eventTypes),\r\n installationId: z.string(),\r\n timestamp: z.string(),\r\n isocode: z.string().optional(),\r\n error: z\r\n .object({\r\n message: z.string(),\r\n name: z.string(),\r\n stack: z.string().optional(),\r\n })\r\n .optional(),\r\n metadata: z.record(z.unknown()).optional(),\r\n});\r\n\r\nexport type Event = z.infer<typeof EventsSchema>;\r\n\r\nexport type AnalyticsEvent = {\r\n type: EventTypeWithoutError;\r\n metadata?: Record<string, unknown>;\r\n};\r\n\r\nexport type AnalyticsError = {\r\n type: \"Error\";\r\n error: Error;\r\n metadata?: Record<string, unknown>;\r\n};\r\n\r\nexport type AnalyticsEventOrError = AnalyticsEvent | AnalyticsError;\r\n\r\nexport type AnalyticsEventOrErrorWithTimestamp = AnalyticsEventOrError & {\r\n timestamp: string;\r\n};\r\n\r\ntype RouteHandlerConfiguration = {\r\n platformUrl?: string;\r\n installationId: string;\r\n maxMindClient: WebServiceClient;\r\n};\r\n\r\nexport const createRouteHandler = ({\r\n platformUrl = \"https://analytics.networkcanvas.com\",\r\n installationId,\r\n maxMindClient,\r\n}: RouteHandlerConfiguration) => {\r\n return async (request: NextRequest) => {\r\n try {\r\n const event =\r\n (await request.json()) as AnalyticsEventOrErrorWithTimestamp;\r\n\r\n const ip = await fetch(\"https://api64.ipify.org\").then((res) =>\r\n res.text()\r\n );\r\n\r\n const { country } = await maxMindClient.country(ip);\r\n const countryCode = country?.isoCode ?? \"Unknown\";\r\n\r\n const dispatchableEvent: Event = {\r\n ...event,\r\n installationId,\r\n isocode: countryCode,\r\n };\r\n\r\n // Forward to microservice\r\n const response = await fetch(`${platformUrl}/api/event`, {\r\n keepalive: true,\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify(dispatchableEvent),\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n console.error(\r\n `Analytics platform not found. Please specify a valid platform URL.`\r\n );\r\n } else if (response.status === 500) {\r\n console.error(\r\n `Internal server error on analytics platform when forwarding event: ${response.statusText}.`\r\n );\r\n } else {\r\n console.error(\r\n `General error when forwarding event: ${response.statusText}`\r\n );\r\n }\r\n\r\n return new Response(\r\n JSON.stringify({ error: \"Internal Server Error\" }),\r\n {\r\n status: 500,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n }\r\n );\r\n }\r\n\r\n return new Response(\r\n JSON.stringify({ message: \"Event forwarded successfully\" }),\r\n {\r\n status: 200,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n }\r\n );\r\n } catch (e) {\r\n const error = ensureError(e);\r\n console.error(\"Error in route handler:\", error);\r\n\r\n // Return an appropriate error response\r\n return new Response(JSON.stringify({ error: \"Internal Server Error\" }), {\r\n status: 500,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n });\r\n }\r\n };\r\n};\r\n\r\nexport const makeEventTracker =\r\n (endpoint: string = \"/api/analytics\") =>\r\n async (event: AnalyticsEventOrError) => {\r\n const endpointWithHost = getBaseUrl() + endpoint;\r\n\r\n const eventWithTimeStamp = {\r\n ...event,\r\n timestamp: new Date(),\r\n };\r\n\r\n try {\r\n const response = await fetch(endpointWithHost, {\r\n method: \"POST\",\r\n keepalive: true,\r\n body: JSON.stringify(eventWithTimeStamp),\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n console.error(\r\n `Analytics endpoint not found, did you forget to add the route?`\r\n );\r\n return;\r\n }\r\n\r\n if (response.status === 500) {\r\n console.error(\r\n `Internal server error when sending analytics event: ${response.statusText}. Check the route handler implementation.`\r\n );\r\n return;\r\n }\r\n\r\n console.error(\r\n `General error sending analytics event: ${response.statusText}`\r\n );\r\n }\r\n } catch (e) {\r\n const error = ensureError(e);\r\n\r\n console.error(\"Internal error with analytics:\", error.message);\r\n }\r\n };\r\n"],"mappings":";AACO,SAAS,YAAY,OAAuB;AACjD,MAAI,CAAC;AAAO,WAAO,IAAI,MAAM,qBAAqB;AAElD,MAAI,iBAAiB;AAAO,WAAO;AAGnC,MAAI,MAAM,cAAc,KAAK;AAAG,WAAO;AAEvC,MAAI,c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,GAAG;AAAA,IACH,WAAW,oBAAI,KAAK;AAAA,EACtB;AAEA,MAAI;AACF,UAAM,WAAW,MAAM,MAAM,kBAAkB;AAAA,MAC7C,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,MAAM,KAAK,UAAU,kBAAkB;AAAA,MACvC,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,IACF,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,UAAI,SAAS,WAAW,KAAK;AAC3B,gBAAQ;AAAA,UACN;AAAA,QACF;AACA;AAAA,MACF;AAEA,UAAI,SAAS,WAAW,KAAK;AAC3B,gBAAQ;AAAA,UACN,uDAAuD,SAAS,UAAU;AAAA,QAC5E;AACA;AAAA,MACF;AAEA,cAAQ;AAAA,QACN,0CAA0C,SAAS,UAAU;AAAA,MAC/D;AAAA,IACF;AAAA,EACF,SAAS,GAAG;AACV,UAAM,QAAQ,YAAY,CAAC;AAE3B,YAAQ,MAAM,kCAAkC,MAAM,OAAO;AAAA,EAC/D;AACF;","names":[]}
package/jest.config.js DELETED
@@ -1,198 +0,0 @@
1
- /**
2
- * For a detailed explanation regarding each configuration property, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- /** @type {import('jest').Config} */
7
- const config = {
8
- // All imported modules in your tests should be mocked automatically
9
- // automock: false,
10
-
11
- // Stop running tests after `n` failures
12
- // bail: 0,
13
-
14
- // The directory where Jest should store its cached dependency information
15
- // cacheDirectory: "/private/var/folders/vc/szx71k5j5sqcmrljl1w44ryddl7zmw/T/jest_pb0330",
16
-
17
- // Automatically clear mock calls, instances, contexts and results before every test
18
- // clearMocks: false,
19
-
20
- // Indicates whether the coverage information should be collected while executing the test
21
- // collectCoverage: false,
22
-
23
- // An array of glob patterns indicating a set of files for which coverage information should be collected
24
- // collectCoverageFrom: undefined,
25
-
26
- // The directory where Jest should output its coverage files
27
- // coverageDirectory: undefined,
28
-
29
- // An array of regexp pattern strings used to skip coverage collection
30
- // coveragePathIgnorePatterns: [
31
- // "/node_modules/"
32
- // ],
33
-
34
- // Indicates which provider should be used to instrument code for coverage
35
- coverageProvider: "v8",
36
-
37
- // A list of reporter names that Jest uses when writing coverage reports
38
- // coverageReporters: [
39
- // "json",
40
- // "text",
41
- // "lcov",
42
- // "clover"
43
- // ],
44
-
45
- // An object that configures minimum threshold enforcement for coverage results
46
- // coverageThreshold: undefined,
47
-
48
- // A path to a custom dependency extractor
49
- // dependencyExtractor: undefined,
50
-
51
- // Make calling deprecated APIs throw helpful error messages
52
- // errorOnDeprecated: false,
53
-
54
- // The default configuration for fake timers
55
- // fakeTimers: {
56
- // "enableGlobally": false
57
- // },
58
-
59
- // Force coverage collection from ignored files using an array of glob patterns
60
- // forceCoverageMatch: [],
61
-
62
- // A path to a module which exports an async function that is triggered once before all test suites
63
- // globalSetup: undefined,
64
-
65
- // A path to a module which exports an async function that is triggered once after all test suites
66
- // globalTeardown: undefined,
67
-
68
- // A set of global variables that need to be available in all test environments
69
- // globals: {},
70
-
71
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72
- // maxWorkers: "50%",
73
-
74
- // An array of directory names to be searched recursively up from the requiring module's location
75
- // moduleDirectories: [
76
- // "node_modules"
77
- // ],
78
-
79
- // An array of file extensions your modules use
80
- // moduleFileExtensions: [
81
- // "js",
82
- // "mjs",
83
- // "cjs",
84
- // "jsx",
85
- // "ts",
86
- // "tsx",
87
- // "json",
88
- // "node"
89
- // ],
90
-
91
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92
- // moduleNameMapper: {},
93
-
94
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
95
- // modulePathIgnorePatterns: [],
96
-
97
- // Activates notifications for test results
98
- // notify: false,
99
-
100
- // An enum that specifies notification mode. Requires { notify: true }
101
- // notifyMode: "failure-change",
102
-
103
- // A preset that is used as a base for Jest's configuration
104
- // preset: undefined,
105
-
106
- // Run tests from one or more projects
107
- // projects: undefined,
108
-
109
- // Use this configuration option to add custom reporters to Jest
110
- // reporters: undefined,
111
-
112
- // Automatically reset mock state before every test
113
- // resetMocks: false,
114
-
115
- // Reset the module registry before running each individual test
116
- // resetModules: false,
117
-
118
- // A path to a custom resolver
119
- // resolver: undefined,
120
-
121
- // Automatically restore mock state and implementation before every test
122
- // restoreMocks: false,
123
-
124
- // The root directory that Jest should scan for tests and modules within
125
- // rootDir: undefined,
126
-
127
- // A list of paths to directories that Jest should use to search for files in
128
- // roots: [
129
- // "<rootDir>"
130
- // ],
131
-
132
- // Allows you to use a custom runner instead of Jest's default test runner
133
- // runner: "jest-runner",
134
-
135
- // The paths to modules that run some code to configure or set up the testing environment before each test
136
- // setupFiles: [],
137
-
138
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
139
- // setupFilesAfterEnv: [],
140
-
141
- // The number of seconds after which a test is considered as slow and reported as such in the results.
142
- // slowTestThreshold: 5,
143
-
144
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
145
- // snapshotSerializers: [],
146
-
147
- // The test environment that will be used for testing
148
- testEnvironment: "node",
149
-
150
- // Options that will be passed to the testEnvironment
151
- // testEnvironmentOptions: {},
152
-
153
- // Adds a location field to test results
154
- // testLocationInResults: false,
155
-
156
- // The glob patterns Jest uses to detect test files
157
- testMatch: [
158
- "**/__tests__/**/*.[jt]s?(x)",
159
- "**/?(*.)+(spec|test).m[tj]s?(x)"
160
- ],
161
-
162
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163
- // testPathIgnorePatterns: [
164
- // "/node_modules/"
165
- // ],
166
-
167
- // The regexp pattern or array of patterns that Jest uses to detect test files
168
- // testRegex: [],
169
-
170
- // This option allows the use of a custom results processor
171
- // testResultsProcessor: undefined,
172
-
173
- // This option allows use of a custom test runner
174
- // testRunner: "jest-circus/runner",
175
-
176
- // A map from regular expressions to paths to transformers
177
- // transform: undefined,
178
-
179
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180
- // transformIgnorePatterns: [
181
- // "/node_modules/",
182
- // "\\.pnp\\.[^\\/]+$"
183
- // ],
184
-
185
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
186
- // unmockedModulePathPatterns: undefined,
187
-
188
- // Indicates whether each individual test should be reported during the run
189
- // verbose: undefined,
190
-
191
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
192
- // watchPathIgnorePatterns: [],
193
-
194
- // Whether to use watchman for file crawling
195
- // watchman: true,
196
- };
197
-
198
- module.exports = config;