@dynamatix/gb-schemas 2.3.296 → 2.3.298

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.
@@ -0,0 +1,120 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
2
+ /// <reference path="../value-objects/account-number.d.ts" />
3
+ /// <reference path="../value-objects/sort-code.d.ts" />
4
+ /// <reference types="mongoose/types/aggregate" />
5
+ /// <reference types="mongoose/types/callback" />
6
+ /// <reference types="mongoose/types/collection" />
7
+ /// <reference types="mongoose/types/connection" />
8
+ /// <reference types="mongoose/types/cursor" />
9
+ /// <reference types="mongoose/types/document" />
10
+ /// <reference types="mongoose/types/error" />
11
+ /// <reference types="mongoose/types/expressions" />
12
+ /// <reference types="mongoose/types/helpers" />
13
+ /// <reference types="mongoose/types/middlewares" />
14
+ /// <reference types="mongoose/types/indexes" />
15
+ /// <reference types="mongoose/types/models" />
16
+ /// <reference types="mongoose/types/mongooseoptions" />
17
+ /// <reference types="mongoose/types/pipelinestage" />
18
+ /// <reference types="mongoose/types/populate" />
19
+ /// <reference types="mongoose/types/query" />
20
+ /// <reference types="mongoose/types/schemaoptions" />
21
+ /// <reference types="mongoose/types/session" />
22
+ /// <reference types="mongoose/types/types" />
23
+ /// <reference types="mongoose/types/utility" />
24
+ /// <reference types="mongoose/types/validation" />
25
+ /// <reference types="mongoose/types/virtuals" />
26
+ /// <reference types="mongoose/types/schematypes" />
27
+ /// <reference types="mongoose/types/inferschematype" />
28
+ /// <reference types="mongoose/types/inferrawdoctype" />
29
+ import mongoose from "mongoose";
30
+ declare const ApiPerformanceLogModel: mongoose.Model<{
31
+ createdAt: NativeDate;
32
+ updatedAt: NativeDate;
33
+ } & {
34
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
35
+ endpoint: string;
36
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
37
+ responseTime: number;
38
+ responseSize: number;
39
+ requestSize: number;
40
+ requestedAt: NativeDate;
41
+ averageResponseCount: number;
42
+ label?: string | null | undefined;
43
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
44
+ createdAt: NativeDate;
45
+ updatedAt: NativeDate;
46
+ } & {
47
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
48
+ endpoint: string;
49
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
50
+ responseTime: number;
51
+ responseSize: number;
52
+ requestSize: number;
53
+ requestedAt: NativeDate;
54
+ averageResponseCount: number;
55
+ label?: string | null | undefined;
56
+ }, {}> & {
57
+ createdAt: NativeDate;
58
+ updatedAt: NativeDate;
59
+ } & {
60
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
61
+ endpoint: string;
62
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
63
+ responseTime: number;
64
+ responseSize: number;
65
+ requestSize: number;
66
+ requestedAt: NativeDate;
67
+ averageResponseCount: number;
68
+ label?: string | null | undefined;
69
+ } & {
70
+ _id: mongoose.Types.ObjectId;
71
+ } & {
72
+ __v: number;
73
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
74
+ timestamps: true;
75
+ }, {
76
+ createdAt: NativeDate;
77
+ updatedAt: NativeDate;
78
+ } & {
79
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
80
+ endpoint: string;
81
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
82
+ responseTime: number;
83
+ responseSize: number;
84
+ requestSize: number;
85
+ requestedAt: NativeDate;
86
+ averageResponseCount: number;
87
+ label?: string | null | undefined;
88
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
89
+ createdAt: NativeDate;
90
+ updatedAt: NativeDate;
91
+ } & {
92
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
93
+ endpoint: string;
94
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
95
+ responseTime: number;
96
+ responseSize: number;
97
+ requestSize: number;
98
+ requestedAt: NativeDate;
99
+ averageResponseCount: number;
100
+ label?: string | null | undefined;
101
+ }>, {}> & mongoose.FlatRecord<{
102
+ createdAt: NativeDate;
103
+ updatedAt: NativeDate;
104
+ } & {
105
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
106
+ endpoint: string;
107
+ performanceStatus: "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
108
+ responseTime: number;
109
+ responseSize: number;
110
+ requestSize: number;
111
+ requestedAt: NativeDate;
112
+ averageResponseCount: number;
113
+ label?: string | null | undefined;
114
+ }> & {
115
+ _id: mongoose.Types.ObjectId;
116
+ } & {
117
+ __v: number;
118
+ }>>;
119
+ export default ApiPerformanceLogModel;
120
+ //# sourceMappingURL=api-performance.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-performance.model.d.ts","sourceRoot":"","sources":["../../shared/api-performance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAyBhC,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+D,CAAC;AAC5F,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import mongoose from "mongoose";
2
+ const apiPerformanceLogSchema = new mongoose.Schema({
3
+ label: { type: String },
4
+ endpoint: { type: String, required: true },
5
+ performanceStatus: {
6
+ type: String,
7
+ enum: ["Optimal", "Acceptable", "Degraded", "Severe", "Critical"],
8
+ required: true
9
+ },
10
+ responseTime: { type: Number, required: true }, // in milliseconds
11
+ responseSize: { type: Number, default: 0 }, // in bytes
12
+ requestSize: { type: Number, default: 0 }, // in bytes
13
+ requestedAt: { type: Date, required: true, default: Date.now },
14
+ method: {
15
+ type: String,
16
+ required: true,
17
+ enum: ["GET", "POST", "PUT", "PATCH", "DELETE"]
18
+ },
19
+ averageResponseCount: { type: Number, default: 0 },
20
+ }, { timestamps: true });
21
+ const ApiPerformanceLogModel = mongoose.model("ApiPerformanceLog", apiPerformanceLogSchema);
22
+ export default ApiPerformanceLogModel;
@@ -0,0 +1,177 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
2
+ /// <reference path="../value-objects/account-number.d.ts" />
3
+ /// <reference path="../value-objects/sort-code.d.ts" />
4
+ /// <reference types="mongoose/types/aggregate" />
5
+ /// <reference types="mongoose/types/callback" />
6
+ /// <reference types="mongoose/types/collection" />
7
+ /// <reference types="mongoose/types/connection" />
8
+ /// <reference types="mongoose/types/cursor" />
9
+ /// <reference types="mongoose/types/document" />
10
+ /// <reference types="mongoose/types/error" />
11
+ /// <reference types="mongoose/types/expressions" />
12
+ /// <reference types="mongoose/types/helpers" />
13
+ /// <reference types="mongoose/types/middlewares" />
14
+ /// <reference types="mongoose/types/indexes" />
15
+ /// <reference types="mongoose/types/models" />
16
+ /// <reference types="mongoose/types/mongooseoptions" />
17
+ /// <reference types="mongoose/types/pipelinestage" />
18
+ /// <reference types="mongoose/types/populate" />
19
+ /// <reference types="mongoose/types/query" />
20
+ /// <reference types="mongoose/types/schemaoptions" />
21
+ /// <reference types="mongoose/types/session" />
22
+ /// <reference types="mongoose/types/types" />
23
+ /// <reference types="mongoose/types/utility" />
24
+ /// <reference types="mongoose/types/validation" />
25
+ /// <reference types="mongoose/types/virtuals" />
26
+ /// <reference types="mongoose/types/schematypes" />
27
+ /// <reference types="mongoose/types/inferschematype" />
28
+ /// <reference types="mongoose/types/inferrawdoctype" />
29
+ import { Document } from "mongoose";
30
+ /**
31
+ * HTTP methods supported by the API performance tracking system.
32
+ */
33
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
34
+ /**
35
+ * Performance status levels based on response time.
36
+ * Automatically set by the model's pre-save middleware.
37
+ */
38
+ export type PerformanceStatus = "Optimal" | "Acceptable" | "Degraded" | "Severe" | "Critical";
39
+ /**
40
+ * Interface representing an API performance log entry.
41
+ * This matches the Mongoose schema structure for API performance tracking.
42
+ */
43
+ export interface IApiPerformance {
44
+ /**
45
+ * Optional label for the API performance log entry
46
+ */
47
+ label?: string;
48
+ /**
49
+ * API endpoint or route (e.g., /api/users)
50
+ */
51
+ endpoint: string;
52
+ /**
53
+ * Performance status automatically calculated based on response time
54
+ * @default calculated by pre-save middleware
55
+ */
56
+ performanceStatus: PerformanceStatus;
57
+ /**
58
+ * Response time in milliseconds
59
+ */
60
+ responseTime: number;
61
+ /**
62
+ * Size of the response payload in bytes
63
+ * @default 0
64
+ */
65
+ responseSize?: number;
66
+ /**
67
+ * Size of the request payload in bytes
68
+ * @default 0
69
+ */
70
+ requestSize?: number;
71
+ /**
72
+ * Timestamp when the API call was made
73
+ * @default Date.now
74
+ */
75
+ requestedAt: Date;
76
+ /**
77
+ * HTTP method used in the request
78
+ */
79
+ method: HttpMethod;
80
+ /**
81
+ * Average response count for analytics
82
+ * @default 0
83
+ */
84
+ averageResponseCount?: number;
85
+ /**
86
+ * Automatically added by Mongoose timestamps
87
+ */
88
+ createdAt?: Date;
89
+ updatedAt?: Date;
90
+ }
91
+ /**
92
+ * Mongoose document type for API performance logs.
93
+ * Extends the base interface with Mongoose document methods.
94
+ */
95
+ export interface IApiPerformanceDocument extends IApiPerformance, Document {
96
+ }
97
+ /**
98
+ * Input type for creating a new API performance log entry.
99
+ * Excludes auto-generated fields like timestamps, _id, and performanceStatus.
100
+ */
101
+ export interface ICreateApiPerformanceInput {
102
+ endpoint: string;
103
+ method: HttpMethod;
104
+ responseTime: number;
105
+ label?: string;
106
+ requestSize?: number;
107
+ responseSize?: number;
108
+ requestedAt?: Date;
109
+ averageResponseCount?: number;
110
+ }
111
+ /**
112
+ * Update type for modifying an existing API performance log entry.
113
+ * All fields are optional for partial updates.
114
+ * Note: performanceStatus is automatically calculated and should not be manually set.
115
+ */
116
+ export interface IUpdateApiPerformanceInput {
117
+ endpoint?: string;
118
+ method?: HttpMethod;
119
+ responseTime?: number;
120
+ label?: string;
121
+ requestSize?: number;
122
+ responseSize?: number;
123
+ requestedAt?: Date;
124
+ averageResponseCount?: number;
125
+ }
126
+ /**
127
+ * Query filters for searching API performance logs.
128
+ * Supports filtering by various criteria.
129
+ */
130
+ export interface IApiPerformanceFilters {
131
+ endpoint?: string | RegExp;
132
+ method?: HttpMethod;
133
+ performanceStatus?: PerformanceStatus;
134
+ responseTime?: {
135
+ $gte?: number;
136
+ $lte?: number;
137
+ };
138
+ label?: string | RegExp;
139
+ requestedAt?: {
140
+ $gte?: Date;
141
+ $lte?: Date;
142
+ };
143
+ averageResponseCount?: {
144
+ $gte?: number;
145
+ $lte?: number;
146
+ };
147
+ createdAt?: {
148
+ $gte?: Date;
149
+ $lte?: Date;
150
+ };
151
+ updatedAt?: {
152
+ $gte?: Date;
153
+ $lte?: Date;
154
+ };
155
+ }
156
+ /**
157
+ * Aggregation result for API performance analytics.
158
+ * Used for performance metrics and reporting.
159
+ */
160
+ export interface IApiPerformanceAnalytics {
161
+ _id?: {
162
+ endpoint?: string;
163
+ method?: HttpMethod;
164
+ performanceStatus?: PerformanceStatus;
165
+ };
166
+ count: number;
167
+ avgResponseTime: number;
168
+ minResponseTime: number;
169
+ maxResponseTime: number;
170
+ totalRequestSize: number;
171
+ totalResponseSize: number;
172
+ avgResponseCount: number;
173
+ performanceStatusDistribution?: {
174
+ [key in PerformanceStatus]?: number;
175
+ };
176
+ }
177
+ //# sourceMappingURL=api-performance.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-performance.type.d.ts","sourceRoot":"","sources":["../../shared/api-performance.type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,G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M,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,6BAA6B,CAAC,EAAE;SAC7B,GAAG,IAAI,iBAAiB,CAAC,CAAC,EAAE,MAAM;KACpC,CAAC;CACH"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.3.296",
3
+ "version": "2.3.298",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",