@lokalise/fastify-extras 30.2.0 → 30.3.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/README.md +472 -406
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/openTelemetryTransactionManagerPlugin.d.ts +52 -0
- package/dist/plugins/openTelemetryTransactionManagerPlugin.js +129 -0
- package/dist/plugins/openTelemetryTransactionManagerPlugin.js.map +1 -0
- package/package.json +90 -88
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { requestContextProviderPlugin, getRequestIdFastifyAppConfig, } from './p
|
|
|
4
4
|
export type { BaseRequestContext as RequestContext } from './plugins/requestContextProviderPlugin.js';
|
|
5
5
|
export { newrelicTransactionManagerPlugin, NewRelicTransactionManager, } from './plugins/newrelicTransactionManagerPlugin.js';
|
|
6
6
|
export type { NewRelicTransactionManagerOptions } from './plugins/newrelicTransactionManagerPlugin.js';
|
|
7
|
+
export { openTelemetryTransactionManagerPlugin, OpenTelemetryTransactionManager, } from './plugins/openTelemetryTransactionManagerPlugin.js';
|
|
8
|
+
export type { OpenTelemetryTransactionManagerOptions } from './plugins/openTelemetryTransactionManagerPlugin.js';
|
|
7
9
|
export { splitIOFeatureManagerPlugin, SplitIOFeatureManager, } from './plugins/splitIOFeatureManagerPlugin.js';
|
|
8
10
|
export type { SplitIOOptions } from './plugins/splitIOFeatureManagerPlugin.js';
|
|
9
11
|
export { healthcheckMetricsPlugin, wrapHealthCheckForPrometheus, } from './plugins/healthcheck/healthcheckMetricsPlugin.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { bugsnagPlugin, reportErrorToBugsnag, bugsnagErrorReporter, addFeatureFlag, } from './plugins/bugsnagPlugin.js';
|
|
2
2
|
export { requestContextProviderPlugin, getRequestIdFastifyAppConfig, } from './plugins/requestContextProviderPlugin.js';
|
|
3
3
|
export { newrelicTransactionManagerPlugin, NewRelicTransactionManager, } from './plugins/newrelicTransactionManagerPlugin.js';
|
|
4
|
+
export { openTelemetryTransactionManagerPlugin, OpenTelemetryTransactionManager, } from './plugins/openTelemetryTransactionManagerPlugin.js';
|
|
4
5
|
export { splitIOFeatureManagerPlugin, SplitIOFeatureManager, } from './plugins/splitIOFeatureManagerPlugin.js';
|
|
5
6
|
export { healthcheckMetricsPlugin, wrapHealthCheckForPrometheus, } from './plugins/healthcheck/healthcheckMetricsPlugin.js';
|
|
6
7
|
export { PrometheusCounterTransactionManager } from './plugins/prometheus/PrometheusCounterTransactionManager.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,GACf,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,2CAA2C,CAAA;AAGlD,OAAO,EACL,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,+CAA+C,CAAA;AAGtD,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,0CAA0C,CAAA;AAGjD,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,mDAAmD,CAAA;AAO1D,OAAO,EAAE,mCAAmC,EAAE,MAAM,6DAA6D,CAAA;AAEjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAEtE,OAAO,EACL,yBAAyB,EACzB,kCAAkC,GACnC,MAAM,+CAA+C,CAAA;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAM1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAA;AAO1F,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAG7E,OAAO,EAAE,uBAAuB,EAAE,MA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,EACL,yBAAyB,EACzB,kCAAkC,GACnC,MAAM,+CAA+C,CAAA;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAM1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAA;AAO1F,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAG7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAA;AAG1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAA;AAG5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAA;AAGlG,OAAO,EACL,eAAe,GAGhB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EACL,gBAAgB,EAChB,6BAA6B,GAG9B,MAAM,yCAAyC,CAAA;AAIhD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAEhF,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,uCAAuC,CAAA;AAG9C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAA4B,MAAM,0BAA0B,CAAA;AAGnG,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TransactionObservabilityManager } from '@lokalise/node-core';
|
|
2
|
+
import type { Span, Tracer } from '@opentelemetry/api';
|
|
3
|
+
import type { FastifyPluginCallback } from 'fastify';
|
|
4
|
+
declare module 'fastify' {
|
|
5
|
+
interface FastifyInstance {
|
|
6
|
+
openTelemetryTransactionManager: OpenTelemetryTransactionManager;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export interface OpenTelemetryTransactionManagerOptions {
|
|
10
|
+
isEnabled: boolean;
|
|
11
|
+
serviceName?: string;
|
|
12
|
+
serviceVersion?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class OpenTelemetryTransactionManager implements TransactionObservabilityManager {
|
|
15
|
+
private readonly isEnabled;
|
|
16
|
+
private readonly tracer;
|
|
17
|
+
private readonly spanMap;
|
|
18
|
+
constructor(isEnabled: boolean, serviceName?: string, serviceVersion?: string);
|
|
19
|
+
/**
|
|
20
|
+
* @param transactionName - used for grouping similar transactions together
|
|
21
|
+
* @param uniqueTransactionKey - used for identifying specific ongoing transaction. Must be reasonably unique to reduce possibility of collisions
|
|
22
|
+
*/
|
|
23
|
+
start(transactionName: string, uniqueTransactionKey: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* @param transactionName - used for grouping similar transactions together
|
|
26
|
+
* @param uniqueTransactionKey - used for identifying specific ongoing transaction. Must be reasonably unique to reduce possibility of collisions
|
|
27
|
+
* @param transactionGroup - group is used for grouping related transactions with different names
|
|
28
|
+
*/
|
|
29
|
+
startWithGroup(transactionName: string, uniqueTransactionKey: string, transactionGroup: string): void;
|
|
30
|
+
stop(uniqueTransactionKey: string, wasSuccessful?: boolean): void;
|
|
31
|
+
addCustomAttribute(attrName: string, attrValue: string | number | boolean): void;
|
|
32
|
+
addCustomAttributes(uniqueTransactionKey: string, atts: {
|
|
33
|
+
[p: string]: string | number | boolean;
|
|
34
|
+
}): void;
|
|
35
|
+
setUserID(userId: string): void;
|
|
36
|
+
setControllerName(name: string, action: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get a span by its unique transaction key. Useful for advanced use cases
|
|
39
|
+
* where direct span manipulation is needed.
|
|
40
|
+
*/
|
|
41
|
+
getSpan(uniqueTransactionKey: string): Span | null;
|
|
42
|
+
/**
|
|
43
|
+
* Get the underlying tracer for advanced use cases.
|
|
44
|
+
*/
|
|
45
|
+
getTracer(): Tracer;
|
|
46
|
+
/**
|
|
47
|
+
* Run a function within the context of a specific span.
|
|
48
|
+
* Useful when you need child spans to be automatically linked to a parent.
|
|
49
|
+
*/
|
|
50
|
+
runInSpanContext<T>(uniqueTransactionKey: string, fn: () => T): T;
|
|
51
|
+
}
|
|
52
|
+
export declare const openTelemetryTransactionManagerPlugin: FastifyPluginCallback<OpenTelemetryTransactionManagerOptions>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { SpanStatusCode, context, trace } from '@opentelemetry/api';
|
|
2
|
+
import fp from 'fastify-plugin';
|
|
3
|
+
import { FifoMap } from 'toad-cache';
|
|
4
|
+
export class OpenTelemetryTransactionManager {
|
|
5
|
+
isEnabled;
|
|
6
|
+
tracer;
|
|
7
|
+
spanMap;
|
|
8
|
+
constructor(isEnabled, serviceName = 'unknown-service', serviceVersion = '1.0.0') {
|
|
9
|
+
this.isEnabled = isEnabled;
|
|
10
|
+
this.tracer = trace.getTracer(serviceName, serviceVersion);
|
|
11
|
+
this.spanMap = new FifoMap(2000);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param transactionName - used for grouping similar transactions together
|
|
15
|
+
* @param uniqueTransactionKey - used for identifying specific ongoing transaction. Must be reasonably unique to reduce possibility of collisions
|
|
16
|
+
*/
|
|
17
|
+
start(transactionName, uniqueTransactionKey) {
|
|
18
|
+
if (!this.isEnabled)
|
|
19
|
+
return;
|
|
20
|
+
const span = this.tracer.startSpan(transactionName, {
|
|
21
|
+
attributes: {
|
|
22
|
+
'transaction.type': 'background',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
this.spanMap.set(uniqueTransactionKey, span);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @param transactionName - used for grouping similar transactions together
|
|
29
|
+
* @param uniqueTransactionKey - used for identifying specific ongoing transaction. Must be reasonably unique to reduce possibility of collisions
|
|
30
|
+
* @param transactionGroup - group is used for grouping related transactions with different names
|
|
31
|
+
*/
|
|
32
|
+
startWithGroup(transactionName, uniqueTransactionKey, transactionGroup) {
|
|
33
|
+
if (!this.isEnabled)
|
|
34
|
+
return;
|
|
35
|
+
const span = this.tracer.startSpan(transactionName, {
|
|
36
|
+
attributes: {
|
|
37
|
+
'transaction.type': 'background',
|
|
38
|
+
'transaction.group': transactionGroup,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
this.spanMap.set(uniqueTransactionKey, span);
|
|
42
|
+
}
|
|
43
|
+
stop(uniqueTransactionKey, wasSuccessful = true) {
|
|
44
|
+
if (!this.isEnabled)
|
|
45
|
+
return;
|
|
46
|
+
const span = this.spanMap.get(uniqueTransactionKey) ?? null;
|
|
47
|
+
if (!span)
|
|
48
|
+
return;
|
|
49
|
+
if (!wasSuccessful) {
|
|
50
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
54
|
+
}
|
|
55
|
+
span.end();
|
|
56
|
+
this.spanMap.delete(uniqueTransactionKey);
|
|
57
|
+
}
|
|
58
|
+
addCustomAttribute(attrName, attrValue) {
|
|
59
|
+
if (!this.isEnabled)
|
|
60
|
+
return;
|
|
61
|
+
const activeSpan = trace.getActiveSpan();
|
|
62
|
+
if (activeSpan) {
|
|
63
|
+
activeSpan.setAttribute(attrName, attrValue);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
addCustomAttributes(uniqueTransactionKey, atts) {
|
|
67
|
+
if (!this.isEnabled)
|
|
68
|
+
return;
|
|
69
|
+
const span = this.spanMap.get(uniqueTransactionKey);
|
|
70
|
+
if (!span)
|
|
71
|
+
return;
|
|
72
|
+
for (const [key, value] of Object.entries(atts)) {
|
|
73
|
+
span.setAttribute(key, value);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
setUserID(userId) {
|
|
77
|
+
if (!this.isEnabled)
|
|
78
|
+
return;
|
|
79
|
+
const activeSpan = trace.getActiveSpan();
|
|
80
|
+
if (activeSpan) {
|
|
81
|
+
activeSpan.setAttribute('enduser.id', userId);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
setControllerName(name, action) {
|
|
85
|
+
if (!this.isEnabled)
|
|
86
|
+
return;
|
|
87
|
+
const activeSpan = trace.getActiveSpan();
|
|
88
|
+
if (activeSpan) {
|
|
89
|
+
activeSpan.setAttribute('code.namespace', name);
|
|
90
|
+
activeSpan.setAttribute('code.function', action);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get a span by its unique transaction key. Useful for advanced use cases
|
|
95
|
+
* where direct span manipulation is needed.
|
|
96
|
+
*/
|
|
97
|
+
getSpan(uniqueTransactionKey) {
|
|
98
|
+
if (!this.isEnabled)
|
|
99
|
+
return null;
|
|
100
|
+
return this.spanMap.get(uniqueTransactionKey) ?? null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get the underlying tracer for advanced use cases.
|
|
104
|
+
*/
|
|
105
|
+
getTracer() {
|
|
106
|
+
return this.tracer;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Run a function within the context of a specific span.
|
|
110
|
+
* Useful when you need child spans to be automatically linked to a parent.
|
|
111
|
+
*/
|
|
112
|
+
runInSpanContext(uniqueTransactionKey, fn) {
|
|
113
|
+
if (!this.isEnabled)
|
|
114
|
+
return fn();
|
|
115
|
+
const span = this.spanMap.get(uniqueTransactionKey);
|
|
116
|
+
if (!span)
|
|
117
|
+
return fn();
|
|
118
|
+
return context.with(trace.setSpan(context.active(), span), fn);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function plugin(fastify, opts) {
|
|
122
|
+
const manager = new OpenTelemetryTransactionManager(opts.isEnabled, opts.serviceName, opts.serviceVersion);
|
|
123
|
+
fastify.decorate('openTelemetryTransactionManager', manager);
|
|
124
|
+
}
|
|
125
|
+
export const openTelemetryTransactionManagerPlugin = fp(plugin, {
|
|
126
|
+
fastify: '5.x',
|
|
127
|
+
name: 'opentelemetry-transaction-manager-plugin',
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=openTelemetryTransactionManagerPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openTelemetryTransactionManagerPlugin.js","sourceRoot":"","sources":["../../lib/plugins/openTelemetryTransactionManagerPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEnE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAcpC,MAAM,OAAO,+BAA+B;IACzB,SAAS,CAAS;IAClB,MAAM,CAAQ;IACd,OAAO,CAAe;IAEvC,YAAY,SAAkB,EAAE,WAAW,GAAG,iBAAiB,EAAE,cAAc,GAAG,OAAO;QACvF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;QAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAuB,EAAE,oBAA4B;QAChE,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAM;QAE3B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE;YAClD,UAAU,EAAE;gBACV,kBAAkB,EAAE,YAAY;aACjC;SACF,CAAC,CAAA;QACF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED;;;;OAIG;IACI,cAAc,CACnB,eAAuB,EACvB,oBAA4B,EAC5B,gBAAwB;QAExB,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAM;QAE3B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE;YAClD,UAAU,EAAE;gBACV,kBAAkB,EAAE,YAAY;gBAChC,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AO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;IAChE,CAAC;CACF;AAED,SAAS,MAAM,CAAC,OAAwB,EAAE,IAA4C;IACpF,MAAM,OAAO,GAAG,IAAI,+BAA+B,CACjD,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,cAAc,CACpB,CAAA;IACD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAA;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,qCAAqC,GAChD,EAAE,CAAC,MAAM,EAAE;IACT,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,0CAA0C;CACjD,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lokalise/fastify-extras",
|
|
3
|
-
"version": "30.
|
|
4
|
-
"description": "Opinionated set of fastify plugins, commonly used in Lokalise",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Lokalise",
|
|
7
|
-
"url": "https://lokalise.com/"
|
|
8
|
-
},
|
|
9
|
-
"license": "Apache-2.0",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git://github.com/lokalise/fastify-extras.git"
|
|
13
|
-
},
|
|
14
|
-
"keywords": ["fastify", "newrelic", "bugsnag", "request-context", "request-id", "split-io"],
|
|
15
|
-
"homepage": "https://github.com/lokalise/fastify-extras",
|
|
16
|
-
"files": ["dist/**", "LICENSE", "README.md"],
|
|
17
|
-
"type": "module",
|
|
18
|
-
"main": "./dist/index.js",
|
|
19
|
-
"exports": {
|
|
20
|
-
".": "./dist/index.js",
|
|
21
|
-
"./package.json": "./package.json"
|
|
22
|
-
},
|
|
23
|
-
"publishConfig": {
|
|
24
|
-
"access": "public"
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "rimraf dist && tsc --project tsconfig.build.json",
|
|
28
|
-
"test": "vitest",
|
|
29
|
-
"test:coverage": "vitest --coverage",
|
|
30
|
-
"test:ci": "npm run lint && npm run test:coverage",
|
|
31
|
-
"lint": "biome check . && tsc",
|
|
32
|
-
"lint:fix": "biome check --write",
|
|
33
|
-
"docker:start": "docker compose -f docker-compose.yml up --build -d redis && docker compose -f docker-compose.yml up --build -d wait_for_redis",
|
|
34
|
-
"docker:stop": "docker compose -f docker-compose.yml down",
|
|
35
|
-
"version": "auto-changelog -p && git add CHANGELOG.md && biome check --write package.json && git add package.json"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@amplitude/analytics-node": "^1.5.7",
|
|
39
|
-
"@bugsnag/js": "^8.4.0",
|
|
40
|
-
"@lokalise/error-utils": "^3.0.0",
|
|
41
|
-
"@splitsoftware/splitio": "^11.
|
|
42
|
-
"@supercharge/promise-pool": "^3.2.0",
|
|
43
|
-
"fastify-metrics": "^12.1.0",
|
|
44
|
-
"fastify-plugin": "^5.0.1",
|
|
45
|
-
"prom-client": "^15.1.3",
|
|
46
|
-
"toad-cache": "^3.7.0"
|
|
47
|
-
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"@fastify/jwt": ">=9.1.0",
|
|
50
|
-
"@lokalise/api-contracts": ">=5.0.0",
|
|
51
|
-
"@lokalise/background-jobs-common": ">=12.0.0",
|
|
52
|
-
"@lokalise/node-core": ">=14.0.0",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"fastify
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@lokalise/
|
|
66
|
-
"@
|
|
67
|
-
"@lokalise/
|
|
68
|
-
"@lokalise/
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@lokalise/fastify-extras",
|
|
3
|
+
"version": "30.3.0",
|
|
4
|
+
"description": "Opinionated set of fastify plugins, commonly used in Lokalise",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Lokalise",
|
|
7
|
+
"url": "https://lokalise.com/"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git://github.com/lokalise/fastify-extras.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": ["fastify", "newrelic", "bugsnag", "request-context", "request-id", "split-io"],
|
|
15
|
+
"homepage": "https://github.com/lokalise/fastify-extras",
|
|
16
|
+
"files": ["dist/**", "LICENSE", "README.md"],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./dist/index.js",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "rimraf dist && tsc --project tsconfig.build.json",
|
|
28
|
+
"test": "vitest",
|
|
29
|
+
"test:coverage": "vitest --coverage",
|
|
30
|
+
"test:ci": "npm run lint && npm run test:coverage",
|
|
31
|
+
"lint": "biome check . && tsc",
|
|
32
|
+
"lint:fix": "biome check --write",
|
|
33
|
+
"docker:start": "docker compose -f docker-compose.yml up --build -d redis && docker compose -f docker-compose.yml up --build -d wait_for_redis",
|
|
34
|
+
"docker:stop": "docker compose -f docker-compose.yml down",
|
|
35
|
+
"version": "auto-changelog -p && git add CHANGELOG.md && biome check --write package.json && git add package.json"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@amplitude/analytics-node": "^1.5.7",
|
|
39
|
+
"@bugsnag/js": "^8.4.0",
|
|
40
|
+
"@lokalise/error-utils": "^3.0.0",
|
|
41
|
+
"@splitsoftware/splitio": "^11.6.0",
|
|
42
|
+
"@supercharge/promise-pool": "^3.2.0",
|
|
43
|
+
"fastify-metrics": "^12.1.0",
|
|
44
|
+
"fastify-plugin": "^5.0.1",
|
|
45
|
+
"prom-client": "^15.1.3",
|
|
46
|
+
"toad-cache": "^3.7.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@fastify/jwt": ">=9.1.0",
|
|
50
|
+
"@lokalise/api-contracts": ">=5.0.0",
|
|
51
|
+
"@lokalise/background-jobs-common": ">=12.0.0",
|
|
52
|
+
"@lokalise/node-core": ">=14.0.0",
|
|
53
|
+
"@opentelemetry/api": ">=1.9.0",
|
|
54
|
+
"bullmq": "^5.19.0",
|
|
55
|
+
"fastify": "^5.5.0",
|
|
56
|
+
"fastify-type-provider-zod": ">=6.0.0",
|
|
57
|
+
"ioredis": "^5.7.0",
|
|
58
|
+
"newrelic": ">=11.13.0",
|
|
59
|
+
"pino": ">=9.9.0",
|
|
60
|
+
"zod": ">=4.1.5"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@amplitude/analytics-types": "^2.10.0",
|
|
64
|
+
"@biomejs/biome": "^1.9.4",
|
|
65
|
+
"@lokalise/backend-http-client": "^10.0.0",
|
|
66
|
+
"@opentelemetry/api": "^1.9.0",
|
|
67
|
+
"@lokalise/background-jobs-common": "^14.0.2",
|
|
68
|
+
"@lokalise/biome-config": "^2.0.0",
|
|
69
|
+
"@lokalise/node-core": "^14.4.2",
|
|
70
|
+
"@lokalise/tsconfig": "^3.0.0",
|
|
71
|
+
"@types/newrelic": "^9.14.8",
|
|
72
|
+
"@types/node": "^24.7.0",
|
|
73
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
74
|
+
"auto-changelog": "^2.4.0",
|
|
75
|
+
"bullmq": "^5.61.0",
|
|
76
|
+
"fastify": "^5.6.1",
|
|
77
|
+
"fastify-type-provider-zod": "^6.0.0",
|
|
78
|
+
"ioredis": "^5.6.1",
|
|
79
|
+
"newrelic": "13.9.2",
|
|
80
|
+
"pino": "^10.0.0",
|
|
81
|
+
"pino-pretty": "^13.1.1",
|
|
82
|
+
"rimraf": "^6.0.1",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
|
+
"vitest": "^3.2.4",
|
|
85
|
+
"zod": "^4.1.12"
|
|
86
|
+
},
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=20"
|
|
89
|
+
}
|
|
90
|
+
}
|