@payfit/audit-log 2.15.2 → 2.16.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.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  * The allowed Namespaces for the AuditLog
3
3
  */
4
- type AuditNamespaces = 'employee' | 'company' | 'permissions' | 'absence' | 'expense' | 'payments' | 'auth' | 'billing' | 'modules' | 'integrations' | 'partnerApi' | 'donation' | 'notificationSettings' | 'people' | 'subscriptions' | 'organization' | 'declarations' | 'pricing' | 'payroll' | 'jetlang' | 'files';
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';
5
5
  /**
6
6
  * The allowed targets for the AuditLog
7
7
  */
8
- type AuditTargets = 'reporting' | 'employee' | 'employee.settings' | 'employee-request' | 'company' | 'company.billings' | 'company.billing' | 'company.variables' | 'company.settings' | 'company.emails' | 'company.addons' | 'company.plans' | 'company.modules' | 'declaration.metadata' | 'user.role' | 'user.account' | 'user.primaryEmail' | 'user.secondaryEmail' | 'user.locale' | 'user.notificationSettings' | 'user.mfa' | 'role' | 'team' | 'department' | 'workflow' | 'integration' | 'apiAccess' | 'individual' | 'association' | 'association.archived' | 'donation' | 'donation.amount' | 'donation.auth.partner.portal' | 'donation.company.onboarding' | 'donation.taxReceipt' | 'donationPayment.status' | 'people.document.comments' | 'people.document.notifications' | 'people.document.reactions' | 'people.document.status' | 'people.document.answers' | 'people.oneOne' | 'people.campaign' | 'people.assessment' | 'people.assessment.360details' | 'people.assessment.managerRequests' | 'people.assessment.manager' | 'people.assessment.answers' | 'people.assessment.feedbacks' | 'iban' | 'salary-payments.connect' | 'salary-payments.pay.url' | 'advance-salary-payments.pay.url' | 'variable' | 'jetlang-data' | 'access-logs' | 'event' | 'topic' | 'file' | 'file.presigned-url' | 'archive' | 'payslip.merge';
8
+ export type AuditTargets = 'reporting' | 'employee' | 'employee.settings' | 'employee-request' | 'company' | 'company.billings' | 'company.billing' | 'company.variables' | 'company.settings' | 'company.emails' | 'company.addons' | 'company.plans' | 'company.modules' | 'declaration.metadata' | 'user.role' | 'user.account' | 'user.primaryEmail' | 'user.secondaryEmail' | 'user.locale' | 'user.notificationSettings' | 'user.mfa' | 'role' | 'team' | 'department' | 'workflow' | 'integration' | 'apiAccess' | 'individual' | 'association' | 'association.archived' | 'donation' | 'donation.amount' | 'donation.auth.partner.portal' | 'donation.company.onboarding' | 'donation.taxReceipt' | 'donationPayment.status' | 'people.document.comments' | 'people.document.notifications' | 'people.document.reactions' | 'people.document.status' | 'people.document.answers' | 'people.oneOne' | 'people.campaign' | 'people.assessment' | 'people.assessment.360details' | 'people.assessment.managerRequests' | 'people.assessment.manager' | 'people.assessment.answers' | 'people.assessment.feedbacks' | 'iban' | 'salary-payments.connect' | 'salary-payments.pay.url' | 'advance-salary-payments.pay.url' | 'variable' | 'jetlang-data' | 'access-logs' | 'event' | 'topic' | 'file' | 'file.presigned-url' | 'archive' | 'payslip.merge';
9
9
  /**
10
10
  * The allowed Events for the AuditLog
11
11
  */
12
- type AuditEvents = 'create' | 'update' | 'share' | 'delete' | 'view' | 'sign' | 'signin' | 'signinFail' | 'signinAs' | 'logout' | 'updateCurrentAccount' | 'merge' | 'disable' | 'sendResetPasswordLink' | 'enable' | 'verify' | 'read' | 'write' | 'subscribe' | 'consume' | 'setup';
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';
13
13
  /**
14
14
  * Data to audit log.
15
15
  */
16
- interface IAuditLogData {
16
+ export interface IAuditLogData {
17
17
  /**
18
18
  * The data specific to the audit log.
19
19
  * For example, if we add a bonus to an employee, it could contain the amount, the impacted employeeId, etc...
@@ -46,7 +46,7 @@ interface IAuditLogData {
46
46
  /**
47
47
  * Data used to indentify who performed an action
48
48
  */
49
- type IAuditLogAuthData = {
49
+ export type IAuditLogAuthData = {
50
50
  /**
51
51
  * The id of the payfiter that did the action if it has been made during a siginAs
52
52
  */
@@ -75,7 +75,7 @@ type IAuditLogAuthData = {
75
75
  * Data used to "scope" the audit log.
76
76
  * Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
77
77
  */
78
- type IAuditLogScope = {
78
+ export type IAuditLogScope = {
79
79
  holdingId: string;
80
80
  } | {
81
81
  companyId: string;
@@ -83,18 +83,17 @@ type IAuditLogScope = {
83
83
  } | {
84
84
  individualId: string;
85
85
  } | null;
86
- interface IAuditLogger {
86
+ export interface IAuditLogger {
87
87
  log: (data: IAuditLogData) => Promise<void>;
88
88
  }
89
- interface IAuditLoggerInitialization {
89
+ export interface IAuditLoggerInitialization {
90
90
  apiUrl: string;
91
91
  environment: string;
92
92
  service: string;
93
93
  }
94
- declare class AuditLogger implements IAuditLogger {
94
+ export declare class AuditLogger implements IAuditLogger {
95
95
  protected params: IAuditLoggerInitialization;
96
96
  private transport;
97
97
  constructor(params: IAuditLoggerInitialization);
98
98
  log({ scope, account, ...data }: IAuditLogData): Promise<void>;
99
99
  }
100
- export { AuditNamespaces, AuditTargets, AuditEvents, IAuditLogData, IAuditLogAuthData, IAuditLogScope, IAuditLogger, IAuditLoggerInitialization, AuditLogger };
package/dist/index.js ADDED
@@ -0,0 +1 @@
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 ADDED
@@ -0,0 +1,149 @@
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);
13
+ }
14
+ }
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
+ }
22
+ }
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);
83
+ }
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
+ });
115
+ }
116
+ async create(e) {
117
+ var t;
118
+ try {
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);
125
+ }
126
+ }
127
+ }
128
+ class O {
129
+ constructor(e) {
130
+ n(this, "params");
131
+ n(this, "transport");
132
+ this.params = e, this.transport = new U(e.apiUrl);
133
+ }
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,
137
+ ...t,
138
+ service: i,
139
+ id: r,
140
+ environment: a,
141
+ timestamp: c,
142
+ ...e && { scope: e }
143
+ };
144
+ await this.transport.create(h);
145
+ }
146
+ }
147
+ export {
148
+ O as AuditLogger
149
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
13
+ import { Configuration } from '../configuration';
14
+ import { RequestArgs, BaseAPI } from '../base';
15
+ import { InlineObject } from '../model';
16
+ /**
17
+ * DefaultApi - axios parameter creator
18
+ * @export
19
+ */
20
+ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
21
+ /**
22
+ *
23
+ * @summary Creates Audit Log event
24
+ * @param {InlineObject} inlineObject
25
+ * @param {*} [options] Override http request option.
26
+ * @throws {RequiredError}
27
+ */
28
+ v1LogPost: (inlineObject: InlineObject, options?: AxiosRequestConfig) => Promise<RequestArgs>;
29
+ };
30
+ /**
31
+ * DefaultApi - functional programming interface
32
+ * @export
33
+ */
34
+ export declare const DefaultApiFp: (configuration?: Configuration) => {
35
+ /**
36
+ *
37
+ * @summary Creates Audit Log event
38
+ * @param {InlineObject} inlineObject
39
+ * @param {*} [options] Override http request option.
40
+ * @throws {RequiredError}
41
+ */
42
+ v1LogPost(inlineObject: InlineObject, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
43
+ };
44
+ /**
45
+ * DefaultApi - factory interface
46
+ * @export
47
+ */
48
+ export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
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(inlineObject: InlineObject, options?: any): AxiosPromise<void>;
57
+ };
58
+ /**
59
+ * DefaultApi - object-oriented interface
60
+ * @export
61
+ * @class DefaultApi
62
+ * @extends {BaseAPI}
63
+ */
64
+ export declare class DefaultApi extends BaseAPI {
65
+ /**
66
+ *
67
+ * @summary Creates Audit Log event
68
+ * @param {InlineObject} inlineObject
69
+ * @param {*} [options] Override http request option.
70
+ * @throws {RequiredError}
71
+ * @memberof DefaultApi
72
+ */
73
+ v1LogPost(inlineObject: InlineObject, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<void, any>>;
74
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export * from './api/default-api';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const COLLECTION_FORMATS: {
20
+ csv: string;
21
+ ssv: string;
22
+ tsv: string;
23
+ pipes: string;
24
+ };
25
+ /**
26
+ *
27
+ * @export
28
+ * @interface RequestArgs
29
+ */
30
+ export interface RequestArgs {
31
+ url: string;
32
+ options: AxiosRequestConfig;
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @class BaseAPI
38
+ */
39
+ export declare class BaseAPI {
40
+ protected basePath: string;
41
+ protected axios: AxiosInstance;
42
+ protected configuration: Configuration | undefined;
43
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @class RequiredError
49
+ * @extends {Error}
50
+ */
51
+ export declare class RequiredError extends Error {
52
+ field: string;
53
+ name: "RequiredError";
54
+ constructor(field: string, msg?: string);
55
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { RequestArgs } from "./base";
14
+ import { AxiosInstance, AxiosResponse } from 'axios';
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const DUMMY_BASE_URL = "https://example.com";
20
+ /**
21
+ *
22
+ * @throws {RequiredError}
23
+ * @export
24
+ */
25
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
+ /**
27
+ *
28
+ * @export
29
+ */
30
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
+ /**
42
+ *
43
+ * @export
44
+ */
45
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
+ /**
47
+ *
48
+ * @export
49
+ */
50
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export declare const toPathString: (url: URL) => string;
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export interface ConfigurationParameters {
13
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
+ username?: string;
15
+ password?: string;
16
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
+ basePath?: string;
18
+ baseOptions?: any;
19
+ formDataCtor?: new () => any;
20
+ }
21
+ export declare class Configuration {
22
+ /**
23
+ * parameter for apiKey security
24
+ * @param name security name
25
+ * @memberof Configuration
26
+ */
27
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
28
+ /**
29
+ * parameter for basic security
30
+ *
31
+ * @type {string}
32
+ * @memberof Configuration
33
+ */
34
+ username?: string;
35
+ /**
36
+ * parameter for basic security
37
+ *
38
+ * @type {string}
39
+ * @memberof Configuration
40
+ */
41
+ password?: string;
42
+ /**
43
+ * parameter for oauth2 security
44
+ * @param name security name
45
+ * @param scopes oauth2 scope
46
+ * @memberof Configuration
47
+ */
48
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
49
+ /**
50
+ * override base path
51
+ *
52
+ * @type {string}
53
+ * @memberof Configuration
54
+ */
55
+ basePath?: string;
56
+ /**
57
+ * base options for axios calls
58
+ *
59
+ * @type {any}
60
+ * @memberof Configuration
61
+ */
62
+ baseOptions?: any;
63
+ /**
64
+ * The FormData constructor that will be used to create multipart form data
65
+ * requests. You can inject this here so that execution environments that
66
+ * do not support the FormData class can still run the generated client.
67
+ *
68
+ * @type {new () => FormData}
69
+ */
70
+ formDataCtor?: new () => any;
71
+ constructor(param?: ConfigurationParameters);
72
+ /**
73
+ * Check if the given MIME is a JSON MIME.
74
+ * JSON MIME examples:
75
+ * application/json
76
+ * application/json; charset=UTF8
77
+ * APPLICATION/JSON
78
+ * application/vnd.company+json
79
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
80
+ * @return True if the given MIME is JSON, false otherwise.
81
+ */
82
+ isJsonMime(mime: string): boolean;
83
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export * from "./api";
13
+ export * from "./configuration";
14
+ export * from "./model";
@@ -0,0 +1 @@
1
+ export * from './inline-object';
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface InlineObject
16
+ */
17
+ export interface InlineObject {
18
+ /**
19
+ * Audit log event unique identifier
20
+ * @type {string}
21
+ * @memberof InlineObject
22
+ */
23
+ 'id': string;
24
+ /**
25
+ * Audit log event country code
26
+ * @type {string}
27
+ * @memberof InlineObject
28
+ */
29
+ 'countryCode'?: string;
30
+ /**
31
+ * Audit log event payload
32
+ * @type {object}
33
+ * @memberof InlineObject
34
+ */
35
+ 'payload'?: object;
36
+ /**
37
+ * id of the payfiter who performed the audit log action, if signed as.
38
+ * @type {string}
39
+ * @memberof InlineObject
40
+ */
41
+ 'internalId'?: string;
42
+ /**
43
+ * Tells whether the logged action has been made by the system
44
+ * @type {boolean}
45
+ * @memberof InlineObject
46
+ */
47
+ 'isSystem'?: boolean;
48
+ /**
49
+ * Audit log event namespace (business related)
50
+ * @type {string}
51
+ * @memberof InlineObject
52
+ */
53
+ 'namespace': string;
54
+ /**
55
+ * Audit log event namespace (technical related)
56
+ * @type {string}
57
+ * @memberof InlineObject
58
+ */
59
+ 'service': string;
60
+ /**
61
+ * Audit log event type
62
+ * @type {string}
63
+ * @memberof InlineObject
64
+ */
65
+ 'event': string;
66
+ /**
67
+ * Audit log target
68
+ * @type {string}
69
+ * @memberof InlineObject
70
+ */
71
+ 'target': string;
72
+ /**
73
+ * Audit log event environment, only required when in todd context
74
+ * @type {string}
75
+ * @memberof InlineObject
76
+ */
77
+ 'environment'?: string;
78
+ /**
79
+ * holdingId of the account performing the event
80
+ * @type {string}
81
+ * @memberof InlineObject
82
+ */
83
+ 'holdingId'?: string;
84
+ /**
85
+ * companyId of the account performing the event
86
+ * @type {string}
87
+ * @memberof InlineObject
88
+ */
89
+ 'companyId'?: string;
90
+ /**
91
+ * employeeId of the account performing the event
92
+ * @type {string}
93
+ * @memberof InlineObject
94
+ */
95
+ 'employeeId'?: string;
96
+ /**
97
+ * individualId of the account performing the event
98
+ * @type {string}
99
+ * @memberof InlineObject
100
+ */
101
+ 'individualId'?: string;
102
+ /**
103
+ * roleId of the account performing the event
104
+ * @type {string}
105
+ * @memberof InlineObject
106
+ */
107
+ 'roleId'?: string;
108
+ /**
109
+ * userIp of the account performing the event
110
+ * @type {string}
111
+ * @memberof InlineObject
112
+ */
113
+ 'userIp'?: string;
114
+ /**
115
+ * specialRole of the account performing the event
116
+ * @type {string}
117
+ * @memberof InlineObject
118
+ */
119
+ 'specialRole'?: string;
120
+ /**
121
+ * email of the account performing the event
122
+ * @type {string}
123
+ * @memberof InlineObject
124
+ */
125
+ 'email'?: string;
126
+ /**
127
+ * Audit log event scope
128
+ * @type {object}
129
+ * @memberof InlineObject
130
+ */
131
+ 'scope'?: object;
132
+ /**
133
+ * Audit log event timestamp unix format
134
+ * @type {number}
135
+ * @memberof InlineObject
136
+ */
137
+ 'timestamp': number;
138
+ }
@@ -0,0 +1,8 @@
1
+ import { InlineObject } from './generated/model';
2
+ import { IAuditLogTransport } from './interface';
3
+ export declare class Transport implements IAuditLogTransport {
4
+ protected apiUrl: string;
5
+ private api;
6
+ constructor(apiUrl: string);
7
+ create(auditLogData: InlineObject): Promise<void>;
8
+ }