@payfit/audit-log 3.5.0-rc.29 → 3.5.0-rc.3
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 +2 -1
- package/dist/index.d.ts +5 -16
- package/dist/index.js +1 -1
- package/dist/index.mjs +132 -143
- package/dist/transport/implementation.d.ts +6 -9
- package/dist/transport/interface.d.ts +2 -4
- package/package.json +5 -11
- package/dist/compression.d.ts +0 -2
- package/dist/compression.test.d.ts +0 -1
- package/dist/index.test.d.ts +0 -1
- package/dist/logger.d.ts +0 -2
- package/dist/logger.test.d.ts +0 -1
- package/dist/metrics.d.ts +0 -16
- package/dist/metrics.test.d.ts +0 -1
- package/dist/transport/implementation.test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -16,7 +16,8 @@ Then, you must instanciate a client :
|
|
|
16
16
|
import { AuditLogger } from '@payfit/audit-log'
|
|
17
17
|
|
|
18
18
|
const logger = new AuditLogger({
|
|
19
|
-
|
|
19
|
+
apiUrl: 'http://localhost:8090',
|
|
20
|
+
environment: 'an-environment-name',
|
|
20
21
|
service: 'the-name-of-the-service',
|
|
21
22
|
})
|
|
22
23
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { Logger } from 'winston';
|
|
2
|
-
import { type IMetricsClient } from './metrics';
|
|
3
|
-
import { IAuditLogTransport } from './transport/interface';
|
|
4
1
|
/**
|
|
5
2
|
* The allowed Namespaces for the AuditLog
|
|
6
3
|
*/
|
|
7
|
-
export type AuditNamespaces = 'employee' | 'company' | 'permissions' | 'absence' | 'expense' | 'payments' | 'auth' | 'billing' | 'modules' | 'integrations' | 'partnerApi' | 'donation' | 'notificationSettings' | 'people' | 'subscriptions' | 'organization' | 'declarations' | 'pricing' | 'payroll' | 'jetlang' | 'files' | 'versioner'
|
|
4
|
+
export type AuditNamespaces = 'employee' | 'company' | 'permissions' | 'absence' | 'expense' | 'payments' | 'auth' | 'billing' | 'modules' | 'integrations' | 'partnerApi' | 'donation' | 'notificationSettings' | 'people' | 'subscriptions' | 'organization' | 'declarations' | 'pricing' | 'payroll' | 'jetlang' | 'files' | 'versioner';
|
|
8
5
|
/**
|
|
9
6
|
* The allowed targets for the AuditLog
|
|
10
7
|
*/
|
|
@@ -12,7 +9,7 @@ export type AuditTargets = 'reporting' | 'employee' | 'employee.settings' | 'emp
|
|
|
12
9
|
/**
|
|
13
10
|
* The allowed Events for the AuditLog
|
|
14
11
|
*/
|
|
15
|
-
export type AuditEvents = 'create' | 'update' | 'share' | 'delete' | 'view' | 'sign' | 'signin' | 'signinFail' | 'signinAs' | 'logout' | 'updateCurrentAccount' | 'merge' | 'disable' | 'sendResetPasswordLink' | 'enable' | 'verify' | 'read' | 'write' | 'subscribe' | 'consume' | 'setup' | 'deleteAllAdmins' | 'import'
|
|
12
|
+
export type AuditEvents = 'create' | 'update' | 'share' | 'delete' | 'view' | 'sign' | 'signin' | 'signinFail' | 'signinAs' | 'logout' | 'updateCurrentAccount' | 'merge' | 'disable' | 'sendResetPasswordLink' | 'enable' | 'verify' | 'read' | 'write' | 'subscribe' | 'consume' | 'setup' | 'deleteAllAdmins' | 'import';
|
|
16
13
|
/**
|
|
17
14
|
* Data to audit log.
|
|
18
15
|
*/
|
|
@@ -95,21 +92,13 @@ export interface IAuditLogger {
|
|
|
95
92
|
log: (data: IAuditLogData) => Promise<void>;
|
|
96
93
|
}
|
|
97
94
|
export interface IAuditLoggerInitialization {
|
|
98
|
-
|
|
99
|
-
apiUrl?: string;
|
|
95
|
+
apiUrl: string;
|
|
100
96
|
environment: string;
|
|
101
97
|
service: string;
|
|
102
98
|
}
|
|
103
|
-
export interface IAuditLoggerDependencies {
|
|
104
|
-
transport?: IAuditLogTransport;
|
|
105
|
-
logger?: Logger;
|
|
106
|
-
metrics?: IMetricsClient;
|
|
107
|
-
}
|
|
108
99
|
export declare class AuditLogger implements IAuditLogger {
|
|
109
100
|
protected params: IAuditLoggerInitialization;
|
|
110
|
-
private
|
|
111
|
-
|
|
112
|
-
private readonly metrics;
|
|
113
|
-
constructor(params: IAuditLoggerInitialization, deps?: IAuditLoggerDependencies);
|
|
101
|
+
private transport;
|
|
102
|
+
constructor(params: IAuditLoggerInitialization);
|
|
114
103
|
log({ scope, account, ...data }: IAuditLogData): Promise<void>;
|
|
115
104
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var P=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>(P(s,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("uuid"),h=require("axios"),p="http://localhost:8090".replace(/\/+$/,"");class f{constructor(e,t=p,r=h){n(this,"basePath");n(this,"axios");n(this,"configuration");this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class g extends Error{constructor(t,r){super(r);n(this,"field");n(this,"name","RequiredError");this.field=t}}const A="https://example.com",w=function(s,e,t){if(t==null)throw new g(e,`Required parameter ${e} was null or undefined when calling ${s}.`)},b=function(s,...e){const t=new URLSearchParams(s.search);for(const r of e)for(const o in r)if(Array.isArray(r[o])){t.delete(o);for(const a of r[o])t.append(o,a)}else t.set(o,r[o]);s.search=t.toString()},x=function(s,e,t){const r=typeof s!="string";return(r&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):r)?JSON.stringify(s!==void 0?s:{}):s||""},y=function(s){return s.pathname+s.search+s.hash},L=function(s,e,t,r){return(o=e,a=t)=>{const i={...s.options,url:((r==null?void 0:r.basePath)||a)+s.url};return o.request(i)}},S=function(s){return{v1LogPost:async(e,t={})=>{w("v1LogPost","inlineObject",e);const r="/v1/log",o=new URL(r,A);let a;s&&(a=s.baseOptions);const i={method:"POST",...a,...t},c={},l={};c["Content-Type"]="application/json",b(o,l);let u=a&&a.headers?a.headers:{};return i.headers={...c,...u,...t.headers},i.data=x(e,i,s),{url:y(o),options:i}}}},E=function(s){const e=S(s);return{async v1LogPost(t,r){const o=await e.v1LogPost(t,r);return L(o,h,p,s)}}};class v extends f{v1LogPost(e,t){return E(this.configuration).v1LogPost(e,t).then(r=>r(this.axios,this.basePath))}}const R=s=>"isAxiosError"in s&&s.isAxiosError&&s instanceof Error;class j{constructor(e){n(this,"apiUrl");n(this,"api");this.apiUrl=e,this.api=new v({basePath:this.apiUrl,isJsonMime(t){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(r.test(t)||t.toLowerCase()==="application/json-patch+json")}})}async create(e){var t;try{await this.api.v1LogPost(e,{timeout:5e3})}catch(r){if(!R(r))throw r;const o=((t=r.response)==null?void 0:t.data)||r.message;throw new Error(o)}}}class q{constructor(e){n(this,"params");n(this,"transport");this.params=e,this.transport=new j(e.apiUrl)}async log({scope:e,account:t,...r}){const o=m.v4(),{environment:a,service:i}=this.params,c=Math.floor(Date.now()/1e3),l={...r,...t,service:i,id:o,environment:a,timestamp:c,...e&&{scope:e}};await this.transport.create(l)}}exports.AuditLogger=q;
|
package/dist/index.mjs
CHANGED
|
@@ -1,160 +1,149 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { v4 as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
level: U(),
|
|
14
|
-
silent: process.env.NODE_ENV === "test",
|
|
15
|
-
exitOnError: !1,
|
|
16
|
-
defaultMeta: {
|
|
17
|
-
namespace: M,
|
|
18
|
-
sdk: A,
|
|
19
|
-
service: s,
|
|
20
|
-
environment: e
|
|
21
|
-
},
|
|
22
|
-
format: c.combine(c.timestamp(), c.errors({ stack: !0 }), c.json()),
|
|
23
|
-
transports: [new S.Console()]
|
|
24
|
-
}), C = "payfit.audit_logs.", h = (s) => Object.entries(s).filter(([, e]) => e !== void 0 && e !== "").map(([e, t]) => `${e}:${String(t)}`);
|
|
25
|
-
class b {
|
|
26
|
-
constructor() {
|
|
27
|
-
i(this, "client");
|
|
28
|
-
this.client = new E({
|
|
29
|
-
prefix: C,
|
|
30
|
-
// Loss of metrics never breaks the caller — DogStatsD UDP is best-effort by design.
|
|
31
|
-
errorHandler: () => {
|
|
32
|
-
},
|
|
33
|
-
cacheDns: !0
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
increment(e, t) {
|
|
37
|
-
this.client.increment(e, 1, h(t));
|
|
38
|
-
}
|
|
39
|
-
histogram(e, t, n) {
|
|
40
|
-
this.client.histogram(e, t, h(n));
|
|
41
|
-
}
|
|
42
|
-
async close() {
|
|
43
|
-
await new Promise((e) => {
|
|
44
|
-
this.client.close(() => e());
|
|
45
|
-
});
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var P = (s, e, t) => e in s ? u(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var n = (s, e, t) => (P(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { v4 as m } from "uuid";
|
|
5
|
+
import l from "axios";
|
|
6
|
+
const p = "http://localhost:8090".replace(/\/+$/, "");
|
|
7
|
+
class f {
|
|
8
|
+
constructor(e, t = p, o = l) {
|
|
9
|
+
n(this, "basePath");
|
|
10
|
+
n(this, "axios");
|
|
11
|
+
n(this, "configuration");
|
|
12
|
+
this.basePath = t, this.axios = o, e && (this.configuration = e, this.basePath = e.basePath || this.basePath);
|
|
46
13
|
}
|
|
47
14
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
15
|
+
class A extends Error {
|
|
16
|
+
constructor(t, o) {
|
|
17
|
+
super(o);
|
|
18
|
+
n(this, "field");
|
|
19
|
+
n(this, "name", "RequiredError");
|
|
20
|
+
this.field = t;
|
|
21
|
+
}
|
|
54
22
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
23
|
+
const w = "https://example.com", x = function(s, e, t) {
|
|
24
|
+
if (t == null)
|
|
25
|
+
throw new A(e, `Required parameter ${e} was null or undefined when calling ${s}.`);
|
|
26
|
+
}, g = function(s, ...e) {
|
|
27
|
+
const t = new URLSearchParams(s.search);
|
|
28
|
+
for (const o of e)
|
|
29
|
+
for (const r in o)
|
|
30
|
+
if (Array.isArray(o[r])) {
|
|
31
|
+
t.delete(r);
|
|
32
|
+
for (const a of o[r])
|
|
33
|
+
t.append(r, a);
|
|
34
|
+
} else
|
|
35
|
+
t.set(r, o[r]);
|
|
36
|
+
s.search = t.toString();
|
|
37
|
+
}, b = function(s, e, t) {
|
|
38
|
+
const o = typeof s != "string";
|
|
39
|
+
return (o && t && t.isJsonMime ? t.isJsonMime(e.headers["Content-Type"]) : o) ? JSON.stringify(s !== void 0 ? s : {}) : s || "";
|
|
40
|
+
}, y = function(s) {
|
|
41
|
+
return s.pathname + s.search + s.hash;
|
|
42
|
+
}, E = function(s, e, t, o) {
|
|
43
|
+
return (r = e, a = t) => {
|
|
44
|
+
const i = { ...s.options, url: ((o == null ? void 0 : o.basePath) || a) + s.url };
|
|
45
|
+
return r.request(i);
|
|
46
|
+
};
|
|
47
|
+
}, L = function(s) {
|
|
48
|
+
return {
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @summary Creates Audit Log event
|
|
52
|
+
* @param {InlineObject} inlineObject
|
|
53
|
+
* @param {*} [options] Override http request option.
|
|
54
|
+
* @throws {RequiredError}
|
|
55
|
+
*/
|
|
56
|
+
v1LogPost: async (e, t = {}) => {
|
|
57
|
+
x("v1LogPost", "inlineObject", e);
|
|
58
|
+
const o = "/v1/log", r = new URL(o, w);
|
|
59
|
+
let a;
|
|
60
|
+
s && (a = s.baseOptions);
|
|
61
|
+
const i = { method: "POST", ...a, ...t }, c = {}, h = {};
|
|
62
|
+
c["Content-Type"] = "application/json", g(r, h);
|
|
63
|
+
let d = a && a.headers ? a.headers : {};
|
|
64
|
+
return i.headers = { ...c, ...d, ...t.headers }, i.data = b(e, i, s), {
|
|
65
|
+
url: y(r),
|
|
66
|
+
options: i
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}, S = function(s) {
|
|
71
|
+
const e = L(s);
|
|
72
|
+
return {
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @summary Creates Audit Log event
|
|
76
|
+
* @param {InlineObject} inlineObject
|
|
77
|
+
* @param {*} [options] Override http request option.
|
|
78
|
+
* @throws {RequiredError}
|
|
79
|
+
*/
|
|
80
|
+
async v1LogPost(t, o) {
|
|
81
|
+
const r = await e.v1LogPost(t, o);
|
|
82
|
+
return E(r, l, p, s);
|
|
74
83
|
}
|
|
75
|
-
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
class v extends f {
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @summary Creates Audit Log event
|
|
90
|
+
* @param {InlineObject} inlineObject
|
|
91
|
+
* @param {*} [options] Override http request option.
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
* @memberof DefaultApi
|
|
94
|
+
*/
|
|
95
|
+
v1LogPost(e, t) {
|
|
96
|
+
return S(this.configuration).v1LogPost(e, t).then((o) => o(this.axios, this.basePath));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const R = (s) => "isAxiosError" in s && s.isAxiosError && s instanceof Error;
|
|
100
|
+
class U {
|
|
101
|
+
constructor(e) {
|
|
102
|
+
n(this, "apiUrl");
|
|
103
|
+
n(this, "api");
|
|
104
|
+
this.apiUrl = e, this.api = new v({
|
|
105
|
+
basePath: this.apiUrl,
|
|
106
|
+
isJsonMime(t) {
|
|
107
|
+
const o = new RegExp(
|
|
108
|
+
// eslint-disable-next-line no-control-regex
|
|
109
|
+
"^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$",
|
|
110
|
+
"i"
|
|
111
|
+
);
|
|
112
|
+
return t !== null && (o.test(t) || t.toLowerCase() === "application/json-patch+json");
|
|
113
|
+
}
|
|
114
|
+
});
|
|
76
115
|
}
|
|
77
116
|
async create(e) {
|
|
78
|
-
var
|
|
79
|
-
if (!this.client || !this.queueUrl)
|
|
80
|
-
return { compressed: !1 };
|
|
81
|
-
const t = JSON.stringify(e);
|
|
117
|
+
var t;
|
|
82
118
|
try {
|
|
83
|
-
|
|
84
|
-
} catch (
|
|
85
|
-
if (!
|
|
86
|
-
throw
|
|
87
|
-
|
|
119
|
+
await this.api.v1LogPost(e, { timeout: 5e3 });
|
|
120
|
+
} catch (o) {
|
|
121
|
+
if (!R(o))
|
|
122
|
+
throw o;
|
|
123
|
+
const r = ((t = o.response) == null ? void 0 : t.data) || o.message;
|
|
124
|
+
throw new Error(r);
|
|
88
125
|
}
|
|
89
126
|
}
|
|
90
|
-
async send(e) {
|
|
91
|
-
await this.client.send(new y({
|
|
92
|
-
QueueUrl: this.queueUrl,
|
|
93
|
-
MessageBody: e
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
127
|
}
|
|
97
|
-
class
|
|
98
|
-
constructor(e
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
i(this, "metrics");
|
|
103
|
-
this.params = e, this.logger = t.logger ?? q(e.service, e.environment), this.transport = t.transport ?? new k(e.environment, this.logger), this.metrics = t.metrics ?? D();
|
|
128
|
+
class O {
|
|
129
|
+
constructor(e) {
|
|
130
|
+
n(this, "params");
|
|
131
|
+
n(this, "transport");
|
|
132
|
+
this.params = e, this.transport = new U(e.apiUrl);
|
|
104
133
|
}
|
|
105
|
-
async log({ scope: e, account: t, ...
|
|
106
|
-
const
|
|
107
|
-
...
|
|
134
|
+
async log({ scope: e, account: t, ...o }) {
|
|
135
|
+
const r = m(), { environment: a, service: i } = this.params, c = Math.floor(Date.now() / 1e3), h = {
|
|
136
|
+
...o,
|
|
108
137
|
...t,
|
|
109
|
-
service:
|
|
110
|
-
id:
|
|
111
|
-
environment:
|
|
138
|
+
service: i,
|
|
139
|
+
id: r,
|
|
140
|
+
environment: a,
|
|
141
|
+
timestamp: c,
|
|
112
142
|
...e && { scope: e }
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
environment: l,
|
|
116
|
-
namespace: r.namespace,
|
|
117
|
-
event: r.event,
|
|
118
|
-
target: r.target
|
|
119
|
-
}, d = Date.now();
|
|
120
|
-
try {
|
|
121
|
-
const { compressed: m } = await this.transport.create(r);
|
|
122
|
-
this.metrics.increment("sent", {
|
|
123
|
-
...o,
|
|
124
|
-
compressed: String(m)
|
|
125
|
-
}), this.metrics.histogram("send_duration_ms", Date.now() - d, o), this.logger.debug("audit-log sent", {
|
|
126
|
-
id: r.id,
|
|
127
|
-
event: r.event,
|
|
128
|
-
target: r.target
|
|
129
|
-
});
|
|
130
|
-
} catch (m) {
|
|
131
|
-
this.metrics.increment("send_failed", o), this.metrics.histogram("send_duration_ms", Date.now() - d, o);
|
|
132
|
-
const u = m.message;
|
|
133
|
-
try {
|
|
134
|
-
this.logger.error("audit-log write failed", {
|
|
135
|
-
audit_log: r,
|
|
136
|
-
error: u
|
|
137
|
-
});
|
|
138
|
-
} catch {
|
|
139
|
-
this.metrics.increment("serialization_failed", o);
|
|
140
|
-
try {
|
|
141
|
-
this.logger.error("audit-log write failed (serialization failed)", {
|
|
142
|
-
audit_log_meta: {
|
|
143
|
-
id: r.id,
|
|
144
|
-
service: r.service,
|
|
145
|
-
environment: r.environment,
|
|
146
|
-
namespace: r.namespace,
|
|
147
|
-
event: r.event,
|
|
148
|
-
target: r.target
|
|
149
|
-
},
|
|
150
|
-
error: u
|
|
151
|
-
});
|
|
152
|
-
} catch {
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
143
|
+
};
|
|
144
|
+
await this.transport.create(h);
|
|
156
145
|
}
|
|
157
146
|
}
|
|
158
147
|
export {
|
|
159
|
-
|
|
148
|
+
O as AuditLogger
|
|
160
149
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { InlineObject } from './generated/model';
|
|
2
|
+
import { IAuditLogTransport } from './interface';
|
|
3
3
|
export declare class Transport implements IAuditLogTransport {
|
|
4
|
-
protected
|
|
5
|
-
private
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor(environment: string, logger?: Logger | undefined);
|
|
9
|
-
create(auditLogData: IAuditLogCreationData): Promise<IAuditLogCreationResult>;
|
|
10
|
-
private send;
|
|
4
|
+
protected apiUrl: string;
|
|
5
|
+
private api;
|
|
6
|
+
constructor(apiUrl: string);
|
|
7
|
+
create(auditLogData: InlineObject): Promise<void>;
|
|
11
8
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface IAuditLogCreationData {
|
|
2
2
|
id: string;
|
|
3
|
+
timestamp: number;
|
|
3
4
|
environment: string;
|
|
4
5
|
service: string;
|
|
5
6
|
scope?: Record<string, unknown>;
|
|
@@ -20,9 +21,6 @@ export interface IAuditLogCreationData {
|
|
|
20
21
|
specialRole?: string;
|
|
21
22
|
email?: string;
|
|
22
23
|
}
|
|
23
|
-
export interface IAuditLogCreationResult {
|
|
24
|
-
compressed: boolean;
|
|
25
|
-
}
|
|
26
24
|
export interface IAuditLogTransport {
|
|
27
|
-
create: (data: IAuditLogCreationData) => Promise<
|
|
25
|
+
create: (data: IAuditLogCreationData) => Promise<void>;
|
|
28
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/audit-log",
|
|
3
|
-
"version": "3.5.0-rc.
|
|
3
|
+
"version": "3.5.0-rc.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PayFit/audit-logs.git",
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
"build": "rimraf dist && vite build",
|
|
16
16
|
"prepack": "npm run build",
|
|
17
17
|
"lint": "eslint .",
|
|
18
|
-
"test": "vitest run",
|
|
19
|
-
"test:watch": "vitest",
|
|
20
18
|
"start:playground": "ts-node src/playground.ts",
|
|
21
19
|
"format:check": "prettier --check .",
|
|
22
20
|
"format:fix": "prettier --write .",
|
|
@@ -25,12 +23,9 @@
|
|
|
25
23
|
"author": "",
|
|
26
24
|
"license": "ISC",
|
|
27
25
|
"dependencies": {
|
|
28
|
-
"@aws-sdk/client-sqs": "^3.600.0",
|
|
29
26
|
"axios": "^1.0.0",
|
|
30
|
-
"hot-shots": "^11.0.0",
|
|
31
27
|
"lodash": "^4.17.20",
|
|
32
|
-
"uuid": "^9.0.0"
|
|
33
|
-
"winston": "^3.13.0"
|
|
28
|
+
"uuid": "^9.0.0"
|
|
34
29
|
},
|
|
35
30
|
"devDependencies": {
|
|
36
31
|
"@openapitools/openapi-generator-cli": "2.7.0",
|
|
@@ -51,14 +46,13 @@
|
|
|
51
46
|
"semantic-release": "22.0.12",
|
|
52
47
|
"ts-node": "10.9.2",
|
|
53
48
|
"typescript": "5.3.3",
|
|
54
|
-
"vite": "4.5.1"
|
|
55
|
-
"vitest": "4.1.4"
|
|
49
|
+
"vite": "4.5.1"
|
|
56
50
|
},
|
|
51
|
+
"peerDependencies": {},
|
|
57
52
|
"publishConfig": {
|
|
58
53
|
"registry": "https://registry.npmjs.org/"
|
|
59
54
|
},
|
|
60
55
|
"files": [
|
|
61
56
|
"dist"
|
|
62
|
-
]
|
|
63
|
-
"packageManager": "yarn@4.14.1+sha512.64df448055b2d37ba269d7db535a469b8da93f8ef1140c25fd7a83c00a8fbaacb214ca0e02553b92a2c54cef78bb67d0b4817fab02001df0e24fac0faccc3b42"
|
|
57
|
+
]
|
|
64
58
|
}
|
package/dist/compression.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/index.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/logger.d.ts
DELETED
package/dist/logger.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/metrics.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const METRIC_PREFIX = "payfit.audit_logs.";
|
|
2
|
-
export type MetricName = 'sent' | 'send_failed' | 'serialization_failed' | 'send_duration_ms';
|
|
3
|
-
export interface MetricTags {
|
|
4
|
-
service: string;
|
|
5
|
-
environment: string;
|
|
6
|
-
namespace?: string;
|
|
7
|
-
event?: string;
|
|
8
|
-
target?: string;
|
|
9
|
-
compressed?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface IMetricsClient {
|
|
12
|
-
increment(name: MetricName, tags: MetricTags): void;
|
|
13
|
-
histogram(name: MetricName, value: number, tags: MetricTags): void;
|
|
14
|
-
close(): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export declare const createMetricsClient: () => IMetricsClient;
|
package/dist/metrics.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|