@payfit/audit-log 1.0.0-alpha7 → 1.0.0-rc.10
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 +92 -0
- package/dist/es/index.js +411 -0
- package/dist/es/index.js.map +1 -0
- package/dist/index.d.ts +34 -18
- package/dist/node/index.js +419 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +42 -19
- package/.prettierrc +0 -5
- package/dist/index.js +0 -30
- package/dist/index.js.map +0 -1
- package/dist/transport/generated/api/default-api.d.ts +0 -74
- package/dist/transport/generated/api/default-api.js +0 -131
- package/dist/transport/generated/api/default-api.js.map +0 -1
- package/dist/transport/generated/api.d.ts +0 -12
- package/dist/transport/generated/api.js +0 -19
- package/dist/transport/generated/api.js.map +0 -1
- package/dist/transport/generated/base.d.ts +0 -55
- package/dist/transport/generated/base.js +0 -63
- package/dist/transport/generated/base.js.map +0 -1
- package/dist/transport/generated/configuration.d.ts +0 -63
- package/dist/transport/generated/configuration.js +0 -26
- package/dist/transport/generated/configuration.js.map +0 -1
- package/dist/transport/generated/index.d.ts +0 -13
- package/dist/transport/generated/index.js +0 -20
- package/dist/transport/generated/index.js.map +0 -1
- package/dist/transport/generated/model/index.d.ts +0 -1
- package/dist/transport/generated/model/index.js +0 -3
- package/dist/transport/generated/model/index.js.map +0 -1
- package/dist/transport/generated/model/inline-object.d.ts +0 -120
- package/dist/transport/generated/model/inline-object.js +0 -15
- package/dist/transport/generated/model/inline-object.js.map +0 -1
- package/dist/transport/implementation.d.ts +0 -8
- package/dist/transport/implementation.js +0 -40
- package/dist/transport/implementation.js.map +0 -1
- package/dist/transport/interface.d.ts +0 -9
- package/dist/transport/interface.js +0 -3
- package/dist/transport/interface.js.map +0 -1
- package/openapi-codegen-config.yml +0 -6
- package/playground/index.ts +0 -25
- package/src/index.ts +0 -124
- package/src/transport/generated/.openapi-generator/VERSION +0 -1
- package/src/transport/generated/.openapi-generator-ignore +0 -23
- package/src/transport/generated/api/default-api.ts +0 -131
- package/src/transport/generated/api.ts +0 -17
- package/src/transport/generated/base.ts +0 -70
- package/src/transport/generated/configuration.ts +0 -75
- package/src/transport/generated/git_push.sh +0 -58
- package/src/transport/generated/index.ts +0 -16
- package/src/transport/generated/model/index.ts +0 -1
- package/src/transport/generated/model/inline-object.ts +0 -126
- package/src/transport/implementation.ts +0 -25
- package/src/transport/interface.ts +0 -11
- package/tsconfig.json +0 -25
- package/tslint.json +0 -12
|
@@ -1,120 +0,0 @@
|
|
|
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
|
-
*
|
|
38
|
-
* @type {boolean}
|
|
39
|
-
* @memberof InlineObject
|
|
40
|
-
*/
|
|
41
|
-
isImpersonated?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
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 event environment
|
|
68
|
-
* @type {string}
|
|
69
|
-
* @memberof InlineObject
|
|
70
|
-
*/
|
|
71
|
-
environment?: string;
|
|
72
|
-
/**
|
|
73
|
-
* Audit log event holdingId
|
|
74
|
-
* @type {string}
|
|
75
|
-
* @memberof InlineObject
|
|
76
|
-
*/
|
|
77
|
-
holdingId?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Audit log event companyId
|
|
80
|
-
* @type {string}
|
|
81
|
-
* @memberof InlineObject
|
|
82
|
-
*/
|
|
83
|
-
companyId?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Audit log event employeeId
|
|
86
|
-
* @type {string}
|
|
87
|
-
* @memberof InlineObject
|
|
88
|
-
*/
|
|
89
|
-
employeeId?: string;
|
|
90
|
-
/**
|
|
91
|
-
* Audit log event individualId
|
|
92
|
-
* @type {string}
|
|
93
|
-
* @memberof InlineObject
|
|
94
|
-
*/
|
|
95
|
-
individualId?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Audit log event roleId
|
|
98
|
-
* @type {string}
|
|
99
|
-
* @memberof InlineObject
|
|
100
|
-
*/
|
|
101
|
-
roleId?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Audit log event userIp
|
|
104
|
-
* @type {string}
|
|
105
|
-
* @memberof InlineObject
|
|
106
|
-
*/
|
|
107
|
-
userIp?: string;
|
|
108
|
-
/**
|
|
109
|
-
* Audit log event specialRole
|
|
110
|
-
* @type {string}
|
|
111
|
-
* @memberof InlineObject
|
|
112
|
-
*/
|
|
113
|
-
specialRole?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Audit log event email
|
|
116
|
-
* @type {string}
|
|
117
|
-
* @memberof InlineObject
|
|
118
|
-
*/
|
|
119
|
-
email?: string;
|
|
120
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// tslint:disable
|
|
3
|
-
/**
|
|
4
|
-
* Audit Logs
|
|
5
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0.0
|
|
8
|
-
* Contact: damian.bursztyn@payfit.com
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
//# sourceMappingURL=inline-object.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inline-object.js","sourceRoot":"","sources":["../../../../src/transport/generated/model/inline-object.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DefaultApi } from './generated';
|
|
2
|
-
import { IAuditLogTransport, IAuditLogCreationData } from './interface';
|
|
3
|
-
export declare class Transport implements IAuditLogTransport {
|
|
4
|
-
protected apiUrl: string;
|
|
5
|
-
api: DefaultApi;
|
|
6
|
-
constructor(apiUrl: string);
|
|
7
|
-
create(auditLogData: IAuditLogCreationData): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const generated_1 = require("./generated");
|
|
23
|
-
class Transport {
|
|
24
|
-
constructor(apiUrl) {
|
|
25
|
-
this.apiUrl = apiUrl;
|
|
26
|
-
this.api = new generated_1.DefaultApi({
|
|
27
|
-
basePath: this.apiUrl,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
create(auditLogData) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const { account } = auditLogData, logDataWithoutAccount = __rest(auditLogData, ["account"]);
|
|
33
|
-
const dataToSend = Object.assign({}, logDataWithoutAccount, account);
|
|
34
|
-
console.log(dataToSend);
|
|
35
|
-
yield this.api.v1LogPost(dataToSend);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.Transport = Transport;
|
|
40
|
-
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/transport/implementation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AAGxC,MAAa,SAAS;IAGpB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAClC,IAAI,CAAC,GAAG,GAAG,IAAI,sBAAU,CAAC;YACxB,QAAQ,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAA;IACJ,CAAC;IAEK,MAAM,CAAC,YAAmC;;YAC9C,MAAM,EAAE,OAAO,KAA+B,YAAY,EAAzC,yDAAyC,CAAA;YAE1D,MAAM,UAAU,qBACX,qBAAqB,EACrB,OAAO,CACX,CAAA;YAED,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAEvB,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QACtC,CAAC;KAAA;CACF;AArBD,8BAqBC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IAuditLogData } from '..';
|
|
2
|
-
export declare type IAuditLogCreationData = IAuditLogData & {
|
|
3
|
-
id: string;
|
|
4
|
-
timestamp: number;
|
|
5
|
-
environment: string;
|
|
6
|
-
};
|
|
7
|
-
export interface IAuditLogTransport {
|
|
8
|
-
create: (data: IAuditLogCreationData) => Promise<void>;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/transport/interface.ts"],"names":[],"mappings":""}
|
package/playground/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AuditLogger } from '../src'
|
|
2
|
-
|
|
3
|
-
const logger = new AuditLogger({
|
|
4
|
-
apiUrl: 'http://localhost:8090',
|
|
5
|
-
environment: 'TEST-env',
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
async function main() {
|
|
9
|
-
await logger.log({
|
|
10
|
-
event: 'signin',
|
|
11
|
-
namespace: 'auth',
|
|
12
|
-
service: 'auth',
|
|
13
|
-
payload: {
|
|
14
|
-
isTest: true,
|
|
15
|
-
},
|
|
16
|
-
account: {
|
|
17
|
-
isSystem: true,
|
|
18
|
-
},
|
|
19
|
-
scope: null,
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
main().catch(err => {
|
|
24
|
-
console.log('Error:', err)
|
|
25
|
-
})
|
package/src/index.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { v4 as uuidV4 } from 'uuid'
|
|
2
|
-
import { IAuditLogTransport } from './transport/interface'
|
|
3
|
-
import { Transport } from './transport/implementation'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Data to audit log.
|
|
7
|
-
*/
|
|
8
|
-
export interface IAuditLogData {
|
|
9
|
-
/**
|
|
10
|
-
* The data specific to the audit log.
|
|
11
|
-
* For example, if we add a bonus to an employee, it could contain the amount, the impacted employeeId, etc...
|
|
12
|
-
*/
|
|
13
|
-
payload?: object
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The buisness domain impacted.
|
|
17
|
-
* e.g documents, authentication, ...
|
|
18
|
-
*/
|
|
19
|
-
namespace: string
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The service name (tech).
|
|
23
|
-
* e.g files, payroll-api-v2, auth, ...
|
|
24
|
-
*/
|
|
25
|
-
service: string
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The name of the event.
|
|
29
|
-
* e.g. signIn, passwordUpdated, bonusAdded, ...
|
|
30
|
-
*/
|
|
31
|
-
event: string
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The data that describes who did perform the logged action.
|
|
35
|
-
*/
|
|
36
|
-
account: IAuditLogAuthData
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The scope of the audit log
|
|
40
|
-
*/
|
|
41
|
-
scope: IAuditLogScope
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Data used to indentify who performed an action
|
|
46
|
-
*/
|
|
47
|
-
export type IAuditLogAuthData =
|
|
48
|
-
| {
|
|
49
|
-
/**
|
|
50
|
-
* Tells if the action has been made during a siginAs
|
|
51
|
-
*/
|
|
52
|
-
isImpersonated?: boolean
|
|
53
|
-
|
|
54
|
-
// the "account" infos
|
|
55
|
-
holdingId?: string
|
|
56
|
-
companyId?: string
|
|
57
|
-
employeeId?: string
|
|
58
|
-
individualId: string
|
|
59
|
-
roleId?: string
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
countryCode?: string
|
|
65
|
-
/**
|
|
66
|
-
* The IP address of the user
|
|
67
|
-
*/
|
|
68
|
-
userIp?: string
|
|
69
|
-
/**
|
|
70
|
-
* The email address of the user
|
|
71
|
-
*/
|
|
72
|
-
email?: string
|
|
73
|
-
}
|
|
74
|
-
| {
|
|
75
|
-
/* Indicates that the action has been performed by the system */
|
|
76
|
-
isSystem: true
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Data used to "scope" the audit log.
|
|
81
|
-
* Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
|
|
82
|
-
*/
|
|
83
|
-
export type IAuditLogScope =
|
|
84
|
-
| {
|
|
85
|
-
holdingId: string
|
|
86
|
-
}
|
|
87
|
-
| {
|
|
88
|
-
companyId: string
|
|
89
|
-
employeeId?: string
|
|
90
|
-
}
|
|
91
|
-
| null
|
|
92
|
-
|
|
93
|
-
// warning: modifying this interface means probably make a breaking change to the SDK
|
|
94
|
-
export interface IAuditLogger {
|
|
95
|
-
log: (data: IAuditLogData) => Promise<void>
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface IAuditLoggerInitialization {
|
|
99
|
-
apiUrl: string
|
|
100
|
-
environment: string
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export class AuditLogger implements IAuditLogger {
|
|
104
|
-
private transport: IAuditLogTransport
|
|
105
|
-
|
|
106
|
-
constructor(protected params: IAuditLoggerInitialization) {
|
|
107
|
-
this.transport = new Transport(params.apiUrl)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
async log(params: IAuditLogData) {
|
|
111
|
-
const uuid = uuidV4()
|
|
112
|
-
const environment = this.params.environment
|
|
113
|
-
const timestamp = new Date().getTime()
|
|
114
|
-
|
|
115
|
-
const log = {
|
|
116
|
-
...params,
|
|
117
|
-
id: uuid,
|
|
118
|
-
environment,
|
|
119
|
-
timestamp,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
await this.transport.create(log)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4.2.3
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# OpenAPI Generator Ignore
|
|
2
|
-
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
-
|
|
4
|
-
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
-
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
-
|
|
7
|
-
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
-
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
-
#ApiClient.cs
|
|
10
|
-
|
|
11
|
-
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
-
#foo/*/qux
|
|
13
|
-
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
-
|
|
15
|
-
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
-
#foo/**/qux
|
|
17
|
-
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
-
|
|
19
|
-
# You can also negate patterns with an exclamation (!).
|
|
20
|
-
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
-
#docs/*.md
|
|
22
|
-
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
-
#!docs/README.md
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
// tslint:disable
|
|
2
|
-
/**
|
|
3
|
-
* Audit Logs
|
|
4
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0.0
|
|
7
|
-
* Contact: damian.bursztyn@payfit.com
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import * as globalImportUrl from 'url';
|
|
16
|
-
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
|
|
17
|
-
import { Configuration } from '../configuration';
|
|
18
|
-
// Some imports not used depending on template conditions
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
21
|
-
|
|
22
|
-
import { InlineObject } from '../model';
|
|
23
|
-
/**
|
|
24
|
-
* DefaultApi - axios parameter creator
|
|
25
|
-
* @export
|
|
26
|
-
*/
|
|
27
|
-
export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
28
|
-
return {
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @summary Creates Audit Log event
|
|
32
|
-
* @param {InlineObject} inlineObject
|
|
33
|
-
* @param {*} [options] Override http request option.
|
|
34
|
-
* @throws {RequiredError}
|
|
35
|
-
*/
|
|
36
|
-
v1LogPost(inlineObject: InlineObject, options: any = {}): RequestArgs {
|
|
37
|
-
// verify required parameter 'inlineObject' is not null or undefined
|
|
38
|
-
if (inlineObject === null || inlineObject === undefined) {
|
|
39
|
-
throw new RequiredError('inlineObject','Required parameter inlineObject was null or undefined when calling v1LogPost.');
|
|
40
|
-
}
|
|
41
|
-
const localVarPath = `/v1/log`;
|
|
42
|
-
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
|
|
43
|
-
let baseOptions;
|
|
44
|
-
if (configuration) {
|
|
45
|
-
baseOptions = configuration.baseOptions;
|
|
46
|
-
}
|
|
47
|
-
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
48
|
-
const localVarHeaderParameter = {} as any;
|
|
49
|
-
const localVarQueryParameter = {} as any;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
54
|
-
|
|
55
|
-
localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query};
|
|
56
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
57
|
-
delete localVarUrlObj.search;
|
|
58
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers};
|
|
59
|
-
const needsSerialization = (typeof inlineObject !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
60
|
-
localVarRequestOptions.data = needsSerialization ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) : (inlineObject || "");
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
url: globalImportUrl.format(localVarUrlObj),
|
|
64
|
-
options: localVarRequestOptions,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* DefaultApi - functional programming interface
|
|
72
|
-
* @export
|
|
73
|
-
*/
|
|
74
|
-
export const DefaultApiFp = function(configuration?: Configuration) {
|
|
75
|
-
return {
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @summary Creates Audit Log event
|
|
79
|
-
* @param {InlineObject} inlineObject
|
|
80
|
-
* @param {*} [options] Override http request option.
|
|
81
|
-
* @throws {RequiredError}
|
|
82
|
-
*/
|
|
83
|
-
v1LogPost(inlineObject: InlineObject, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void> {
|
|
84
|
-
const localVarAxiosArgs = DefaultApiAxiosParamCreator(configuration).v1LogPost(inlineObject, options);
|
|
85
|
-
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
86
|
-
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
87
|
-
return axios.request(axiosRequestArgs);
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* DefaultApi - factory interface
|
|
95
|
-
* @export
|
|
96
|
-
*/
|
|
97
|
-
export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
98
|
-
return {
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
* @summary Creates Audit Log event
|
|
102
|
-
* @param {InlineObject} inlineObject
|
|
103
|
-
* @param {*} [options] Override http request option.
|
|
104
|
-
* @throws {RequiredError}
|
|
105
|
-
*/
|
|
106
|
-
v1LogPost(inlineObject: InlineObject, options?: any): AxiosPromise<void> {
|
|
107
|
-
return DefaultApiFp(configuration).v1LogPost(inlineObject, options)(axios, basePath);
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* DefaultApi - object-oriented interface
|
|
114
|
-
* @export
|
|
115
|
-
* @class DefaultApi
|
|
116
|
-
* @extends {BaseAPI}
|
|
117
|
-
*/
|
|
118
|
-
export class DefaultApi extends BaseAPI {
|
|
119
|
-
/**
|
|
120
|
-
*
|
|
121
|
-
* @summary Creates Audit Log event
|
|
122
|
-
* @param {InlineObject} inlineObject
|
|
123
|
-
* @param {*} [options] Override http request option.
|
|
124
|
-
* @throws {RequiredError}
|
|
125
|
-
* @memberof DefaultApi
|
|
126
|
-
*/
|
|
127
|
-
public v1LogPost(inlineObject: InlineObject, options?: any) {
|
|
128
|
-
return DefaultApiFp(this.configuration).v1LogPost(inlineObject, options)(this.axios, this.basePath);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// tslint:disable
|
|
2
|
-
/**
|
|
3
|
-
* Audit Logs
|
|
4
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0.0
|
|
7
|
-
* Contact: damian.bursztyn@payfit.com
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export * from './api/default-api';
|
|
17
|
-
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// tslint:disable
|
|
2
|
-
/**
|
|
3
|
-
* Audit Logs
|
|
4
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0.0
|
|
7
|
-
* Contact: damian.bursztyn@payfit.com
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { Configuration } from "./configuration";
|
|
16
|
-
// Some imports not used depending on template conditions
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
|
|
19
|
-
|
|
20
|
-
export const BASE_PATH = "http://localhost:8081/v1".replace(/\/+$/, "");
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @export
|
|
25
|
-
*/
|
|
26
|
-
export const COLLECTION_FORMATS = {
|
|
27
|
-
csv: ",",
|
|
28
|
-
ssv: " ",
|
|
29
|
-
tsv: "\t",
|
|
30
|
-
pipes: "|",
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @export
|
|
36
|
-
* @interface RequestArgs
|
|
37
|
-
*/
|
|
38
|
-
export interface RequestArgs {
|
|
39
|
-
url: string;
|
|
40
|
-
options: any;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @export
|
|
46
|
-
* @class BaseAPI
|
|
47
|
-
*/
|
|
48
|
-
export class BaseAPI {
|
|
49
|
-
protected configuration: Configuration | undefined;
|
|
50
|
-
|
|
51
|
-
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
52
|
-
if (configuration) {
|
|
53
|
-
this.configuration = configuration;
|
|
54
|
-
this.basePath = configuration.basePath || this.basePath;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @export
|
|
62
|
-
* @class RequiredError
|
|
63
|
-
* @extends {Error}
|
|
64
|
-
*/
|
|
65
|
-
export class RequiredError extends Error {
|
|
66
|
-
name: "RequiredError" = "RequiredError";
|
|
67
|
-
constructor(public field: string, msg?: string) {
|
|
68
|
-
super(msg);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// tslint:disable
|
|
2
|
-
/**
|
|
3
|
-
* Audit Logs
|
|
4
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0.0
|
|
7
|
-
* Contact: damian.bursztyn@payfit.com
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export interface ConfigurationParameters {
|
|
16
|
-
apiKey?: string | ((name: string) => string);
|
|
17
|
-
username?: string;
|
|
18
|
-
password?: string;
|
|
19
|
-
accessToken?: string | ((name?: string, scopes?: string[]) => string);
|
|
20
|
-
basePath?: string;
|
|
21
|
-
baseOptions?: any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class Configuration {
|
|
25
|
-
/**
|
|
26
|
-
* parameter for apiKey security
|
|
27
|
-
* @param name security name
|
|
28
|
-
* @memberof Configuration
|
|
29
|
-
*/
|
|
30
|
-
apiKey?: string | ((name: string) => string);
|
|
31
|
-
/**
|
|
32
|
-
* parameter for basic security
|
|
33
|
-
*
|
|
34
|
-
* @type {string}
|
|
35
|
-
* @memberof Configuration
|
|
36
|
-
*/
|
|
37
|
-
username?: string;
|
|
38
|
-
/**
|
|
39
|
-
* parameter for basic security
|
|
40
|
-
*
|
|
41
|
-
* @type {string}
|
|
42
|
-
* @memberof Configuration
|
|
43
|
-
*/
|
|
44
|
-
password?: string;
|
|
45
|
-
/**
|
|
46
|
-
* parameter for oauth2 security
|
|
47
|
-
* @param name security name
|
|
48
|
-
* @param scopes oauth2 scope
|
|
49
|
-
* @memberof Configuration
|
|
50
|
-
*/
|
|
51
|
-
accessToken?: string | ((name?: string, scopes?: string[]) => string);
|
|
52
|
-
/**
|
|
53
|
-
* override base path
|
|
54
|
-
*
|
|
55
|
-
* @type {string}
|
|
56
|
-
* @memberof Configuration
|
|
57
|
-
*/
|
|
58
|
-
basePath?: string;
|
|
59
|
-
/**
|
|
60
|
-
* base options for axios calls
|
|
61
|
-
*
|
|
62
|
-
* @type {any}
|
|
63
|
-
* @memberof Configuration
|
|
64
|
-
*/
|
|
65
|
-
baseOptions?: any;
|
|
66
|
-
|
|
67
|
-
constructor(param: ConfigurationParameters = {}) {
|
|
68
|
-
this.apiKey = param.apiKey;
|
|
69
|
-
this.username = param.username;
|
|
70
|
-
this.password = param.password;
|
|
71
|
-
this.accessToken = param.accessToken;
|
|
72
|
-
this.basePath = param.basePath;
|
|
73
|
-
this.baseOptions = param.baseOptions;
|
|
74
|
-
}
|
|
75
|
-
}
|