@treatwell/moleculer-essentials 1.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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/context-factory-BWO3xPWE.d.cts +520 -0
- package/dist/context-factory-BWO3xPWE.d.mts +520 -0
- package/dist/index-82e1CXJX.cjs +11 -0
- package/dist/index-BV1ZqQrU.mjs +351 -0
- package/dist/index-DNJWwcZu.mjs +8 -0
- package/dist/index-rZl77S1z.cjs +375 -0
- package/dist/index.cjs +1570 -0
- package/dist/index.d.cts +373 -0
- package/dist/index.d.mts +373 -0
- package/dist/index.mjs +1535 -0
- package/dist/mixins/database.mixin.cjs +1673 -0
- package/dist/mixins/database.mixin.d.cts +958 -0
- package/dist/mixins/database.mixin.d.mts +958 -0
- package/dist/mixins/database.mixin.mjs +1645 -0
- package/dist/mixins/encryptor.mixin.cjs +84 -0
- package/dist/mixins/encryptor.mixin.d.cts +31 -0
- package/dist/mixins/encryptor.mixin.d.mts +31 -0
- package/dist/mixins/encryptor.mixin.mjs +81 -0
- package/dist/mixins/global-store.mixin.cjs +56 -0
- package/dist/mixins/global-store.mixin.d.cts +39 -0
- package/dist/mixins/global-store.mixin.d.mts +39 -0
- package/dist/mixins/global-store.mixin.mjs +54 -0
- package/dist/mixins/jwt.mixin.cjs +118 -0
- package/dist/mixins/jwt.mixin.d.cts +43 -0
- package/dist/mixins/jwt.mixin.d.mts +43 -0
- package/dist/mixins/jwt.mixin.mjs +115 -0
- package/dist/mixins/queue.mixin.cjs +420 -0
- package/dist/mixins/queue.mixin.d.cts +150 -0
- package/dist/mixins/queue.mixin.d.mts +150 -0
- package/dist/mixins/queue.mixin.mjs +414 -0
- package/dist/mixins/redis.mixin.cjs +50 -0
- package/dist/mixins/redis.mixin.d.cts +27 -0
- package/dist/mixins/redis.mixin.d.mts +27 -0
- package/dist/mixins/redis.mixin.mjs +48 -0
- package/dist/mixins/redlock.mixin.cjs +76 -0
- package/dist/mixins/redlock.mixin.d.cts +30 -0
- package/dist/mixins/redlock.mixin.d.mts +30 -0
- package/dist/mixins/redlock.mixin.mjs +74 -0
- package/package.json +181 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { J as JSONSchemaType, S as SomeJSONSchema, C as CustomActionSchema, A as Alias, a as CustomServiceSchema, D as Document, b as SchemaObject, O as OperationObject, R as ReferenceObject } from './context-factory-BWO3xPWE.mjs';
|
|
2
|
+
export { d as AjvValidator, x as ApiKeySecurityScheme, F as CallbackObject, G as ComponentsObject, j as ContactObject, i as ContextFactory, q as EncodingObject, p as ExampleObject, E as ExternalDocumentationObject, H as HeaderObject, w as HttpSecurityScheme, I as InfoObject, L as LicenseObject, s as LinkObject, M as MediaTypeObject, y as OAuth2SecurityScheme, z as OpenIdSecurityScheme, o as ParameterBaseObject, n as ParameterObject, N as PathItemObject, m as PathsObject, P as PropertiesSchema, r as RequestBodyObject, c as RequiredMembers, t as ResponseObject, u as ResponsesObject, v as SecurityRequirementObject, B as SecuritySchemeObject, l as ServerObject, k as ServerVariableObject, K as TagObject, e as Transform, h as TransformField, f as TransformLevel, g as TransformMap, T as Transformer, V as ValidationSchema, Z as ZodValidator } from './context-factory-BWO3xPWE.mjs';
|
|
3
|
+
import { ObjectId } from 'bson';
|
|
4
|
+
import { ZodType, z as z$1 } from 'zod';
|
|
5
|
+
import { z } from 'zod/v4';
|
|
6
|
+
import { Ajv2019 } from 'ajv/dist/2019.js';
|
|
7
|
+
import * as Moleculer from 'moleculer';
|
|
8
|
+
import { Context, ServiceSchema, ServiceSettingSchema, Service, ServiceBroker, BrokerOptions, Middleware, LoggerConfig, TracerExporters, LoggerInstance, Tracer, Span, MetricReporters, MetricRegistry, MetricReporterOptions } from 'moleculer';
|
|
9
|
+
import { Logger } from 'pino';
|
|
10
|
+
|
|
11
|
+
declare function omitFields<T extends Record<string, unknown>, F extends keyof T>(schema: JSONSchemaType<T>, fields: F[], refName?: string): JSONSchemaType<Omit<T, F>>;
|
|
12
|
+
declare function pickFields<T extends Record<string, unknown>, F extends keyof T>(schema: JSONSchemaType<T>, fields: F[], refName?: string): JSONSchemaType<Pick<T, F>>;
|
|
13
|
+
declare function optionalExceptFields<T extends Record<string, unknown>, F extends keyof T>(schema: JSONSchemaType<T>, fields: F[], refName?: string): JSONSchemaType<Partial<Omit<T, F>> & Pick<T, F>>;
|
|
14
|
+
declare function optionalFields<T extends Record<string, unknown>, F extends keyof T>(schema: JSONSchemaType<T>, fields: F[], refName?: string): JSONSchemaType<Omit<T, F> & Partial<Pick<T, F>>>;
|
|
15
|
+
declare function toPartialSchema<T extends Record<string, unknown>>(schema: JSONSchemaType<T>, refName?: string): JSONSchemaType<Partial<T>, true>;
|
|
16
|
+
declare function addFieldsToSchema<T extends Record<string, unknown>, F extends Record<string, SomeJSONSchema>>(schema: JSONSchemaType<T>, newFields: F, refName?: string): JSONSchemaType<T & F>;
|
|
17
|
+
declare function composeSchemas<T extends Record<string, unknown>, U extends Record<string, unknown>>(schemaRefName: string | null, schema1: JSONSchemaType<T>, schema2: JSONSchemaType<U>): JSONSchemaType<T & U>;
|
|
18
|
+
declare function composeSchemas<T extends Record<string, unknown>, U extends Record<string, unknown>, V extends Record<string, unknown>>(schemaRefName: string | null, schema1: JSONSchemaType<T>, schema2: JSONSchemaType<U>, schema3: JSONSchemaType<V>): JSONSchemaType<T & U & V>;
|
|
19
|
+
declare function composeSchemas<T extends Record<string, unknown>, U extends Record<string, unknown>, V extends Record<string, unknown>, W extends Record<string, unknown>>(schemaRefName: string | null, schema1: JSONSchemaType<T>, schema2: JSONSchemaType<U>, schema3: JSONSchemaType<V>, schema4: JSONSchemaType<W>): JSONSchemaType<T & U & V & W>;
|
|
20
|
+
|
|
21
|
+
declare const COERCE_ARRAY_ATTRIBUTE = "x-coerce-array";
|
|
22
|
+
declare const SCHEMA_REF_NAME = "$id";
|
|
23
|
+
declare const EMPTY_OBJECT_SCHEMA: JSONSchemaType<Record<string, never>>;
|
|
24
|
+
declare const DATE_TYPE: JSONSchemaType<Date>;
|
|
25
|
+
declare const OBJECTID_TYPE: JSONSchemaType<ObjectId>;
|
|
26
|
+
|
|
27
|
+
type OpenAPIMixinOptions = {
|
|
28
|
+
/**
|
|
29
|
+
* OpenAPI Tags to be applied to this mixin actions
|
|
30
|
+
*/
|
|
31
|
+
tags?: string[];
|
|
32
|
+
swaggerUI?: {
|
|
33
|
+
version?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Default kinds to be used when no kind is specified in the service or action
|
|
37
|
+
*/
|
|
38
|
+
defaultKinds?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Additional options to be set on actions generated by this mixin.
|
|
41
|
+
*/
|
|
42
|
+
actionOptions?: CustomActionSchema;
|
|
43
|
+
/**
|
|
44
|
+
* Gives the list of security schemes to apply for a specific action.
|
|
45
|
+
*/
|
|
46
|
+
getSecuritySchemes?: (action: Alias) => string[] | undefined | false;
|
|
47
|
+
};
|
|
48
|
+
declare function OpenAPIMixin(options: OpenAPIMixinOptions): Partial<CustomServiceSchema<{
|
|
49
|
+
openapi: {
|
|
50
|
+
openapi: string;
|
|
51
|
+
info: {
|
|
52
|
+
description: string;
|
|
53
|
+
version: string;
|
|
54
|
+
title: string;
|
|
55
|
+
};
|
|
56
|
+
paths: {};
|
|
57
|
+
components: {
|
|
58
|
+
responses: {
|
|
59
|
+
ServerError: {
|
|
60
|
+
description: string;
|
|
61
|
+
content: {
|
|
62
|
+
'application/json': {
|
|
63
|
+
schema: JSONSchemaType<Omit<Moleculer.Errors.MoleculerServerError, "cause">>;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
UnauthorizedError: {
|
|
68
|
+
description: string;
|
|
69
|
+
content: {
|
|
70
|
+
'application/json': {
|
|
71
|
+
schema: JSONSchemaType<Record<string, unknown>>;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
FileNotExist: {
|
|
76
|
+
description: string;
|
|
77
|
+
content: {
|
|
78
|
+
'application/json': {
|
|
79
|
+
schema: JSONSchemaType<Record<string, unknown>>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
FileTooBig: {
|
|
84
|
+
description: string;
|
|
85
|
+
content: {
|
|
86
|
+
'application/json': {
|
|
87
|
+
schema: JSONSchemaType<Record<string, unknown>>;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
ValidationError: {
|
|
92
|
+
description: string;
|
|
93
|
+
content: {
|
|
94
|
+
'application/json': {
|
|
95
|
+
schema: JSONSchemaType<Omit<Moleculer.Errors.ValidationError, "cause">>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
schemas: {
|
|
101
|
+
OpenAPIModel: {
|
|
102
|
+
type: string;
|
|
103
|
+
properties: {
|
|
104
|
+
openapi: {
|
|
105
|
+
example: string;
|
|
106
|
+
type: string;
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
info: {
|
|
110
|
+
type: string;
|
|
111
|
+
properties: {
|
|
112
|
+
description: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
tags: {
|
|
118
|
+
type: string;
|
|
119
|
+
items: {
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
required: string[];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}, {
|
|
130
|
+
matchesKind(openAPINames: string[] | null | undefined, kind: string | undefined): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Generate the OpenAPI schema for the specified kind.
|
|
133
|
+
*/
|
|
134
|
+
generateSchema(ctx: Context, kind?: string): Promise<Document>;
|
|
135
|
+
}, unknown, unknown>>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* This class walks through a JSON schema and extracts all the refs.
|
|
139
|
+
* When a ref is found, it calls the onNewRef child method, and replace the schema with the ref.
|
|
140
|
+
*/
|
|
141
|
+
declare abstract class RefExtractor {
|
|
142
|
+
private refs;
|
|
143
|
+
protected meta: Record<string, unknown>;
|
|
144
|
+
/**
|
|
145
|
+
* Allows to translate the ref name to a new ref name.
|
|
146
|
+
* The walk method will use the response to decide if a ref was already extracted or not.
|
|
147
|
+
*/
|
|
148
|
+
protected abstract refReplacer(ref: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Called when a new ref is found. Allows to store the ref in a map or do something else.
|
|
151
|
+
*/
|
|
152
|
+
protected abstract onNewRef(originalRef: string, schema: SomeJSONSchema): unknown;
|
|
153
|
+
protected onError(message: string, other?: Record<string, unknown>): void;
|
|
154
|
+
setMeta(meta: Record<string, unknown>): void;
|
|
155
|
+
extract(schemaToExtract: SomeJSONSchema, initialRef?: string | undefined, skipRoot?: boolean): SomeJSONSchema;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare class OpenAPIExtractor extends RefExtractor {
|
|
159
|
+
private readonly doc;
|
|
160
|
+
constructor(doc: Document);
|
|
161
|
+
refReplacer(ref: string): string;
|
|
162
|
+
onNewRef(originalRef: string, schema: SomeJSONSchema): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type OpenAPIResponses = SchemaObject<NonNullable<any>> | z.ZodType;
|
|
166
|
+
|
|
167
|
+
declare function createOpenAPIResponses(model: OpenAPIResponses, description?: string): OperationObject;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Convert a zod schema to a JSON Schema with an OpenAPI spec (for refs).
|
|
171
|
+
*
|
|
172
|
+
* We always take the input version of a Zod schema, before transforms.
|
|
173
|
+
* It means that we don't support inputs not JSON schemas compatible, including dates, objectIds.
|
|
174
|
+
* For this, you should use helpers provided by this package.
|
|
175
|
+
*/
|
|
176
|
+
declare function zodToOpenAPISchema(schema: ZodType, extractor: OpenAPIExtractor): SchemaObject | ReferenceObject;
|
|
177
|
+
declare const zodDate: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDate>;
|
|
178
|
+
declare const zodObjectId: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodCustom<ObjectId, ObjectId>>;
|
|
179
|
+
declare function zodCoerceArray<T extends ZodType>(element: T, params?: Parameters<typeof z$1.array>[1]): z$1.ZodPipe<z$1.ZodTransform<any[] | undefined, unknown>, z$1.ZodArray<T>>;
|
|
180
|
+
|
|
181
|
+
declare class AjvExtractor extends RefExtractor {
|
|
182
|
+
private readonly ajv;
|
|
183
|
+
constructor(ajv: Ajv2019);
|
|
184
|
+
protected refReplacer(ref: string): string;
|
|
185
|
+
protected onNewRef(originalRef: string, schema: SomeJSONSchema): void;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* This function is a NO-OP and is only useful for Typescript types.
|
|
190
|
+
* Using Generic arguments allows TS to infer types directly from the object
|
|
191
|
+
* passed as input.
|
|
192
|
+
*
|
|
193
|
+
* For the wrapMixin fn, it will return the exact type of the object passed
|
|
194
|
+
* in order to generate smart typings for services using the mixin.
|
|
195
|
+
*
|
|
196
|
+
* In case of a mixin using options (a function that will return the mixin),
|
|
197
|
+
* for types to work, you must NOT specify the return type and let TS infer
|
|
198
|
+
* the return type.
|
|
199
|
+
*
|
|
200
|
+
* For now, only methods are typed.
|
|
201
|
+
*/
|
|
202
|
+
declare function wrapMixin<Settings, Methods, Mixins, AdditionalProperties>(svc: Partial<CustomServiceSchema<Settings, Methods, Mixins, AdditionalProperties>>): typeof svc;
|
|
203
|
+
/**
|
|
204
|
+
* This function is a NO-OP and is only useful for Typescript types.
|
|
205
|
+
* Using Generic arguments allows TS to infer types directly from the object
|
|
206
|
+
* passed as input.
|
|
207
|
+
*
|
|
208
|
+
* For the wrapService fn, it will return a moleculer ServiceSchema that will stripe
|
|
209
|
+
* out every smart typing of methods. This should never be used inside a mixin.
|
|
210
|
+
*/
|
|
211
|
+
declare function wrapService<Settings, Methods, Mixins, AdditionalProperties>(svc: CustomServiceSchema<Settings, Methods, Mixins, AdditionalProperties>): ServiceSchema;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* This class replace the default Service class in Moleculer to:
|
|
215
|
+
* - Replace the params of actions with functions that return the params in
|
|
216
|
+
* order to prevent moleculer from merging them.
|
|
217
|
+
*/
|
|
218
|
+
declare class ServiceFactory<S = ServiceSettingSchema> extends Service<S> {
|
|
219
|
+
constructor(broker: ServiceBroker, schema?: ServiceSchema<S>);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare function createServiceBroker(opts?: BrokerOptions): ServiceBroker;
|
|
223
|
+
|
|
224
|
+
type LabelValue = string;
|
|
225
|
+
type Operator = 'in' | 'notin' | 'exists' | 'doesnotexists';
|
|
226
|
+
type Rule<Op extends Operator = Operator> = Op extends 'in' | 'notin' ? {
|
|
227
|
+
key: string;
|
|
228
|
+
operator: Op;
|
|
229
|
+
values: LabelValue[];
|
|
230
|
+
} : {
|
|
231
|
+
key: string;
|
|
232
|
+
operator: Op;
|
|
233
|
+
};
|
|
234
|
+
type Selector = {
|
|
235
|
+
matchLabels?: Record<string, LabelValue>;
|
|
236
|
+
matchExpressions: Rule[];
|
|
237
|
+
};
|
|
238
|
+
type ServiceMetadata = Record<string, LabelValue | number | boolean> | undefined;
|
|
239
|
+
declare function isServiceSelected(metadata: ServiceMetadata, selector: Partial<Selector>): boolean;
|
|
240
|
+
declare function getMetadataFromService(svc: Partial<ServiceSchema>): ServiceMetadata;
|
|
241
|
+
|
|
242
|
+
type HealthCheckOptions = {
|
|
243
|
+
port: number;
|
|
244
|
+
startDebounce: number;
|
|
245
|
+
readiness: {
|
|
246
|
+
path: string;
|
|
247
|
+
};
|
|
248
|
+
liveness: {
|
|
249
|
+
path: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Inspired from https://gist.github.com/icebob/c717ae22002b9ecaa4b253a67952da3a
|
|
254
|
+
*/
|
|
255
|
+
declare function HealthCheckMiddleware(_opts: Partial<HealthCheckOptions>): Middleware;
|
|
256
|
+
|
|
257
|
+
declare const createLogger: (bindings: Record<string, unknown>) => Logger;
|
|
258
|
+
declare function createLoggerConfig(): LoggerConfig;
|
|
259
|
+
declare const defaultLogger: Logger;
|
|
260
|
+
|
|
261
|
+
type NewrelicTraceExporterOptions = {
|
|
262
|
+
logger?: LoggerInstance;
|
|
263
|
+
safetyTags?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Base URL for NewRelic server.
|
|
266
|
+
*/
|
|
267
|
+
baseURL?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Maximum number of spans to be sent in one time.
|
|
270
|
+
*/
|
|
271
|
+
batchSize?: number;
|
|
272
|
+
/**
|
|
273
|
+
* NewRelic Insert API Key.
|
|
274
|
+
*/
|
|
275
|
+
insertKey?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Batch send time interval in seconds.
|
|
278
|
+
*/
|
|
279
|
+
interval?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Default span tags.
|
|
282
|
+
*/
|
|
283
|
+
defaultTags?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* >>> Hard copy of the moleculer NewRelic provider. It didn't handle errors correctly
|
|
287
|
+
*
|
|
288
|
+
* Trace Exporter for NewRelic using Zipkin data.
|
|
289
|
+
*
|
|
290
|
+
* NewRelic zipkin tracer: https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-zipkin-format-traces-trace-api
|
|
291
|
+
* API v2: https://zipkin.io/zipkin-api/#/
|
|
292
|
+
*/
|
|
293
|
+
declare class NewrelicTraceExporter extends TracerExporters.Base {
|
|
294
|
+
private queue;
|
|
295
|
+
private timer;
|
|
296
|
+
private defaultTags;
|
|
297
|
+
constructor(opts: NewrelicTraceExporterOptions);
|
|
298
|
+
/**
|
|
299
|
+
* Initialize Trace Exporter.
|
|
300
|
+
*/
|
|
301
|
+
init(tracer: Tracer): void;
|
|
302
|
+
/**
|
|
303
|
+
* Stop Trace exporter
|
|
304
|
+
*/
|
|
305
|
+
stop(): Promise<void>;
|
|
306
|
+
/**
|
|
307
|
+
* Span is finished.
|
|
308
|
+
*/
|
|
309
|
+
spanFinished(span: Span): void;
|
|
310
|
+
/**
|
|
311
|
+
* Flush tracing data to NewRelic Zipkin api endpoint
|
|
312
|
+
*/
|
|
313
|
+
flush(): Promise<void>;
|
|
314
|
+
/**
|
|
315
|
+
* Generate tracing data for NewRelic
|
|
316
|
+
*/
|
|
317
|
+
generateTracingData(): unknown[];
|
|
318
|
+
/**
|
|
319
|
+
* Create NewRelic v1 payload
|
|
320
|
+
*/
|
|
321
|
+
makePayload(span: Span): unknown;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
type DefaultTags = Record<string, unknown> | ((registry: MetricRegistry) => Record<string, unknown>);
|
|
325
|
+
type NewrelicMetricsOptions = MetricReporterOptions & {
|
|
326
|
+
/**
|
|
327
|
+
* Base URL for NewRelic server.
|
|
328
|
+
*/
|
|
329
|
+
baseURL?: string;
|
|
330
|
+
/**
|
|
331
|
+
* NewRelic Insert API Key
|
|
332
|
+
*/
|
|
333
|
+
insertKey?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Batch send time interval in seconds.
|
|
336
|
+
*/
|
|
337
|
+
interval?: number;
|
|
338
|
+
/**
|
|
339
|
+
* Default tags to be added to all metrics.
|
|
340
|
+
*/
|
|
341
|
+
defaultTags?: DefaultTags;
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* NewRelic metrics reporter.
|
|
345
|
+
*
|
|
346
|
+
* NewRelic API: https://docs.newrelic.com/docs/data-apis/understand-data/metric-data/metric-data-type/
|
|
347
|
+
*/
|
|
348
|
+
declare class NewrelicMetricsReporter extends MetricReporters.Base {
|
|
349
|
+
registry: MetricRegistry;
|
|
350
|
+
logger: LoggerInstance;
|
|
351
|
+
private timer;
|
|
352
|
+
private defaultTags;
|
|
353
|
+
constructor(opts: NewrelicMetricsOptions);
|
|
354
|
+
/**
|
|
355
|
+
* Initialize Trace Exporter.
|
|
356
|
+
*/
|
|
357
|
+
init(registry: MetricRegistry): void;
|
|
358
|
+
/**
|
|
359
|
+
* Stop Trace exporter
|
|
360
|
+
*/
|
|
361
|
+
stop(): Promise<void>;
|
|
362
|
+
/**
|
|
363
|
+
* Flush tracing data to NewRelic Zipkin api endpoint
|
|
364
|
+
*/
|
|
365
|
+
flush(): Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* Generate metrics data for NewRelic
|
|
368
|
+
*/
|
|
369
|
+
generateMetricsPayload(): unknown[];
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export { AjvExtractor, Alias, COERCE_ARRAY_ATTRIBUTE, CustomActionSchema, CustomServiceSchema, DATE_TYPE, Document, EMPTY_OBJECT_SCHEMA, HealthCheckMiddleware, JSONSchemaType, NewrelicMetricsReporter, NewrelicTraceExporter, OBJECTID_TYPE, OpenAPIExtractor, OpenAPIMixin, OperationObject, RefExtractor, ReferenceObject, SCHEMA_REF_NAME, SchemaObject, ServiceFactory, SomeJSONSchema, addFieldsToSchema, composeSchemas, createLogger, createLoggerConfig, createOpenAPIResponses, createServiceBroker, defaultLogger, getMetadataFromService, isServiceSelected, omitFields, optionalExceptFields, optionalFields, pickFields, toPartialSchema, wrapMixin, wrapService, zodCoerceArray, zodDate, zodObjectId, zodToOpenAPISchema };
|
|
373
|
+
export type { OpenAPIMixinOptions, OpenAPIResponses, Selector };
|