@payfit/audit-log 1.0.0-rc.98 → 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/.prettierrc +5 -0
- package/README.md +8 -10
- package/dist/index.d.ts +8 -27
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -0
- package/dist/transport/generated/api/default-api.d.ts +7 -7
- package/dist/transport/generated/api/default-api.js +131 -0
- package/dist/transport/generated/api/default-api.js.map +1 -0
- package/dist/transport/generated/api.js +19 -0
- package/dist/transport/generated/api.js.map +1 -0
- package/dist/transport/generated/base.d.ts +2 -2
- package/dist/transport/generated/base.js +63 -0
- package/dist/transport/generated/base.js.map +1 -0
- package/dist/transport/generated/configuration.d.ts +4 -24
- package/dist/transport/generated/configuration.js +26 -0
- package/dist/transport/generated/configuration.js.map +1 -0
- package/dist/transport/generated/index.d.ts +0 -1
- package/dist/transport/generated/index.js +20 -0
- package/dist/transport/generated/index.js.map +1 -0
- package/dist/transport/generated/model/index.js +3 -0
- package/dist/transport/generated/model/index.js.map +1 -0
- package/dist/transport/generated/model/inline-object.d.ts +18 -36
- package/dist/transport/generated/model/inline-object.js +15 -0
- package/dist/transport/generated/model/inline-object.js.map +1 -0
- package/dist/transport/implementation.d.ts +4 -4
- package/dist/transport/implementation.js +39 -0
- package/dist/transport/implementation.js.map +1 -0
- package/dist/transport/interface.d.ts +3 -18
- package/dist/transport/interface.js +3 -0
- package/dist/transport/interface.js.map +1 -0
- package/openapi-codegen-config.yml +6 -0
- package/package.json +19 -46
- package/playground/index.ts +29 -0
- package/src/index.ts +120 -0
- package/src/transport/generated/.openapi-generator/VERSION +1 -0
- package/src/transport/generated/.openapi-generator-ignore +23 -0
- package/src/transport/generated/api/default-api.ts +131 -0
- package/src/transport/generated/api.ts +17 -0
- package/src/transport/generated/base.ts +70 -0
- package/src/transport/generated/configuration.ts +75 -0
- package/src/transport/generated/git_push.sh +58 -0
- package/src/transport/generated/index.ts +16 -0
- package/src/transport/generated/model/index.ts +1 -0
- package/src/transport/generated/model/inline-object.ts +126 -0
- package/src/transport/implementation.ts +23 -0
- package/src/transport/interface.ts +12 -0
- package/tsconfig.json +25 -0
- package/tslint.json +12 -0
- package/dist/index.mjs +0 -149
- package/dist/playground.d.ts +0 -1
- package/dist/transport/generated/common.d.ts +0 -65
package/.prettierrc
ADDED
package/README.md
CHANGED
|
@@ -26,9 +26,8 @@ You can finally write an audit log:
|
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
logger.log({
|
|
29
|
+
event: 'bonusAdded',
|
|
29
30
|
namespace: 'payroll',
|
|
30
|
-
target: 'employee.bonus',
|
|
31
|
-
event: 'create',
|
|
32
31
|
payload: {
|
|
33
32
|
amount: 200,
|
|
34
33
|
},
|
|
@@ -53,10 +52,10 @@ In order to keep synced with the actual API, the API calls from the SDK are auto
|
|
|
53
52
|
To build it, simply run
|
|
54
53
|
|
|
55
54
|
```sh
|
|
56
|
-
|
|
55
|
+
make build-sdk
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
from the
|
|
58
|
+
from the root folder of this repository (where the `Makefile` is located).
|
|
60
59
|
|
|
61
60
|
### Testing
|
|
62
61
|
|
|
@@ -64,29 +63,28 @@ For now, no unit tests have been written, but it should arrive soon !
|
|
|
64
63
|
|
|
65
64
|
### Playing around with he SDK
|
|
66
65
|
|
|
67
|
-
Could it be for testing some changes you made, or just to discover how to use the SDK, there is a [playground](./playground) at your disposal.
|
|
66
|
+
Could it be for testing some changes you made, or just to discover how to use the SDK, there is a [playground](./playground) at your disposal.
|
|
68
67
|
|
|
69
68
|
It uses the current code in the repository, not the published one, so you don't have to `npm publish` or `npm link` to make it work 🙂
|
|
70
69
|
|
|
71
70
|
To run it, simply run from the `sdk` folder:
|
|
72
|
-
|
|
73
71
|
```sh
|
|
74
72
|
npm run start:playground
|
|
75
73
|
```
|
|
76
74
|
|
|
77
75
|
### Publishing
|
|
78
76
|
|
|
79
|
-
For now, there is no automated publishing from CI, so you have to publish it manually.
|
|
80
|
-
|
|
81
|
-
To do so, simply bump the `version` field in the `package.json` file, and run
|
|
77
|
+
For now, there is no automated publishing from CI, so you have to publish it manually.
|
|
82
78
|
|
|
79
|
+
To do so, simply bump the `version` field in the `package.json` file, and run
|
|
83
80
|
```
|
|
84
81
|
npm publish
|
|
85
82
|
```
|
|
86
83
|
|
|
84
|
+
|
|
87
85
|
## Code organisation
|
|
88
86
|
|
|
89
87
|
The code is mainly split into 2 parts:
|
|
90
|
-
|
|
91
88
|
- The transport part, whose only goal is to tell how to communicate with the API, i.e it abstracts the communication layer.
|
|
92
89
|
- The logic part, which tells how to build an audit log.
|
|
90
|
+
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The allowed Namespaces for the AuditLog
|
|
3
|
-
*/
|
|
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
|
-
/**
|
|
6
|
-
* The allowed targets for the AuditLog
|
|
7
|
-
*/
|
|
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
|
-
/**
|
|
10
|
-
* The allowed Events for the AuditLog
|
|
11
|
-
*/
|
|
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
1
|
/**
|
|
14
2
|
* Data to audit log.
|
|
15
3
|
*/
|
|
@@ -18,22 +6,17 @@ export interface IAuditLogData {
|
|
|
18
6
|
* The data specific to the audit log.
|
|
19
7
|
* For example, if we add a bonus to an employee, it could contain the amount, the impacted employeeId, etc...
|
|
20
8
|
*/
|
|
21
|
-
payload?:
|
|
9
|
+
payload?: object;
|
|
22
10
|
/**
|
|
23
11
|
* The buisness domain impacted.
|
|
24
12
|
* e.g documents, authentication, ...
|
|
25
13
|
*/
|
|
26
|
-
namespace:
|
|
14
|
+
namespace: string;
|
|
27
15
|
/**
|
|
28
16
|
* The name of the event.
|
|
29
|
-
* e.g. signIn, passwordUpdated, ...
|
|
17
|
+
* e.g. signIn, passwordUpdated, bonusAdded, ...
|
|
30
18
|
*/
|
|
31
|
-
event:
|
|
32
|
-
/**
|
|
33
|
-
* The target of event.
|
|
34
|
-
* e.g. user.settings, employee.bonuses, ...
|
|
35
|
-
*/
|
|
36
|
-
target: AuditTargets | string;
|
|
19
|
+
event: string;
|
|
37
20
|
/**
|
|
38
21
|
* The data that describes who did perform the logged action.
|
|
39
22
|
*/
|
|
@@ -46,7 +29,7 @@ export interface IAuditLogData {
|
|
|
46
29
|
/**
|
|
47
30
|
* Data used to indentify who performed an action
|
|
48
31
|
*/
|
|
49
|
-
export type IAuditLogAuthData = {
|
|
32
|
+
export declare type IAuditLogAuthData = {
|
|
50
33
|
/**
|
|
51
34
|
* The id of the payfiter that did the action if it has been made during a siginAs
|
|
52
35
|
*/
|
|
@@ -54,7 +37,7 @@ export type IAuditLogAuthData = {
|
|
|
54
37
|
holdingId?: string;
|
|
55
38
|
companyId?: string;
|
|
56
39
|
employeeId?: string;
|
|
57
|
-
individualId
|
|
40
|
+
individualId: string;
|
|
58
41
|
roleId?: string;
|
|
59
42
|
/**
|
|
60
43
|
*
|
|
@@ -75,13 +58,11 @@ export type IAuditLogAuthData = {
|
|
|
75
58
|
* Data used to "scope" the audit log.
|
|
76
59
|
* Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
|
|
77
60
|
*/
|
|
78
|
-
export type IAuditLogScope = {
|
|
61
|
+
export declare type IAuditLogScope = {
|
|
79
62
|
holdingId: string;
|
|
80
63
|
} | {
|
|
81
64
|
companyId: string;
|
|
82
65
|
employeeId?: string;
|
|
83
|
-
} | {
|
|
84
|
-
individualId: string;
|
|
85
66
|
} | null;
|
|
86
67
|
export interface IAuditLogger {
|
|
87
68
|
log: (data: IAuditLogData) => Promise<void>;
|
|
@@ -95,5 +76,5 @@ export declare class AuditLogger implements IAuditLogger {
|
|
|
95
76
|
protected params: IAuditLoggerInitialization;
|
|
96
77
|
private transport;
|
|
97
78
|
constructor(params: IAuditLoggerInitialization);
|
|
98
|
-
log(
|
|
79
|
+
log(data: IAuditLogData): Promise<void>;
|
|
99
80
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
const implementation_1 = require("./transport/implementation");
|
|
13
|
+
class AuditLogger {
|
|
14
|
+
constructor(params) {
|
|
15
|
+
this.params = params;
|
|
16
|
+
this.transport = new implementation_1.Transport(params.apiUrl);
|
|
17
|
+
}
|
|
18
|
+
log(data) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const uuid = uuid_1.v4();
|
|
21
|
+
const { environment, service } = this.params;
|
|
22
|
+
const timestamp = new Date().getTime();
|
|
23
|
+
const log = Object.assign({}, data, { service, id: uuid, environment,
|
|
24
|
+
timestamp });
|
|
25
|
+
yield this.transport.create(log);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AuditLogger = AuditLogger;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,+BAAmC;AAEnC,+DAAsD;AA+FtD,MAAa,WAAW;IAGtB,YAAsB,MAAkC;QAAlC,WAAM,GAAN,MAAM,CAA4B;QACtD,IAAI,CAAC,SAAS,GAAG,IAAI,0BAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC/C,CAAC;IAEK,GAAG,CAAC,IAAmB;;YAC3B,MAAM,IAAI,GAAG,SAAM,EAAE,CAAA;YACrB,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;YAC5C,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;YAEtC,MAAM,GAAG,qBACJ,IAAI,IACP,OAAO,EACP,EAAE,EAAE,IAAI,EACR,WAAW;gBACX,SAAS,GACV,CAAA;YAED,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAClC,CAAC;KAAA;CACF;AAtBD,kCAsBC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import
|
|
12
|
+
import { AxiosPromise, AxiosInstance } from 'axios';
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
14
|
import { RequestArgs, BaseAPI } from '../base';
|
|
15
15
|
import { InlineObject } from '../model';
|
|
@@ -17,7 +17,7 @@ import { InlineObject } from '../model';
|
|
|
17
17
|
* DefaultApi - axios parameter creator
|
|
18
18
|
* @export
|
|
19
19
|
*/
|
|
20
|
-
export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
20
|
+
export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration | undefined) => {
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* @summary Creates Audit Log event
|
|
@@ -25,13 +25,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
25
25
|
* @param {*} [options] Override http request option.
|
|
26
26
|
* @throws {RequiredError}
|
|
27
27
|
*/
|
|
28
|
-
v1LogPost
|
|
28
|
+
v1LogPost(inlineObject: InlineObject, options?: any): RequestArgs;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* DefaultApi - functional programming interface
|
|
32
32
|
* @export
|
|
33
33
|
*/
|
|
34
|
-
export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
34
|
+
export declare const DefaultApiFp: (configuration?: Configuration | undefined) => {
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
* @summary Creates Audit Log event
|
|
@@ -39,13 +39,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
39
39
|
* @param {*} [options] Override http request option.
|
|
40
40
|
* @throws {RequiredError}
|
|
41
41
|
*/
|
|
42
|
-
v1LogPost(inlineObject: InlineObject, options?:
|
|
42
|
+
v1LogPost(inlineObject: InlineObject, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<void>;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* DefaultApi - factory interface
|
|
46
46
|
* @export
|
|
47
47
|
*/
|
|
48
|
-
export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
48
|
+
export declare const DefaultApiFactory: (configuration?: Configuration | undefined, basePath?: string | undefined, axios?: AxiosInstance | undefined) => {
|
|
49
49
|
/**
|
|
50
50
|
*
|
|
51
51
|
* @summary Creates Audit Log event
|
|
@@ -70,5 +70,5 @@ export declare class DefaultApi extends BaseAPI {
|
|
|
70
70
|
* @throws {RequiredError}
|
|
71
71
|
* @memberof DefaultApi
|
|
72
72
|
*/
|
|
73
|
-
v1LogPost(inlineObject: InlineObject, options?:
|
|
73
|
+
v1LogPost(inlineObject: InlineObject, options?: any): AxiosPromise<void>;
|
|
74
74
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
18
|
+
result["default"] = mod;
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const globalImportUrl = __importStar(require("url"));
|
|
26
|
+
const axios_1 = __importDefault(require("axios"));
|
|
27
|
+
// Some imports not used depending on template conditions
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const base_1 = require("../base");
|
|
30
|
+
/**
|
|
31
|
+
* DefaultApi - axios parameter creator
|
|
32
|
+
* @export
|
|
33
|
+
*/
|
|
34
|
+
exports.DefaultApiAxiosParamCreator = function (configuration) {
|
|
35
|
+
return {
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @summary Creates Audit Log event
|
|
39
|
+
* @param {InlineObject} inlineObject
|
|
40
|
+
* @param {*} [options] Override http request option.
|
|
41
|
+
* @throws {RequiredError}
|
|
42
|
+
*/
|
|
43
|
+
v1LogPost(inlineObject, options = {}) {
|
|
44
|
+
// verify required parameter 'inlineObject' is not null or undefined
|
|
45
|
+
if (inlineObject === null || inlineObject === undefined) {
|
|
46
|
+
throw new base_1.RequiredError('inlineObject', 'Required parameter inlineObject was null or undefined when calling v1LogPost.');
|
|
47
|
+
}
|
|
48
|
+
const localVarPath = `/v1/log`;
|
|
49
|
+
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
|
|
50
|
+
let baseOptions;
|
|
51
|
+
if (configuration) {
|
|
52
|
+
baseOptions = configuration.baseOptions;
|
|
53
|
+
}
|
|
54
|
+
const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions, options);
|
|
55
|
+
const localVarHeaderParameter = {};
|
|
56
|
+
const localVarQueryParameter = {};
|
|
57
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
58
|
+
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
59
|
+
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
60
|
+
delete localVarUrlObj.search;
|
|
61
|
+
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
62
|
+
const needsSerialization = (typeof inlineObject !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
63
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) : (inlineObject || "");
|
|
64
|
+
return {
|
|
65
|
+
url: globalImportUrl.format(localVarUrlObj),
|
|
66
|
+
options: localVarRequestOptions,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* DefaultApi - functional programming interface
|
|
73
|
+
* @export
|
|
74
|
+
*/
|
|
75
|
+
exports.DefaultApiFp = function (configuration) {
|
|
76
|
+
return {
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @summary Creates Audit Log event
|
|
80
|
+
* @param {InlineObject} inlineObject
|
|
81
|
+
* @param {*} [options] Override http request option.
|
|
82
|
+
* @throws {RequiredError}
|
|
83
|
+
*/
|
|
84
|
+
v1LogPost(inlineObject, options) {
|
|
85
|
+
const localVarAxiosArgs = exports.DefaultApiAxiosParamCreator(configuration).v1LogPost(inlineObject, options);
|
|
86
|
+
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
|
|
87
|
+
const axiosRequestArgs = Object.assign({}, localVarAxiosArgs.options, { url: basePath + localVarAxiosArgs.url });
|
|
88
|
+
return axios.request(axiosRequestArgs);
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* DefaultApi - factory interface
|
|
95
|
+
* @export
|
|
96
|
+
*/
|
|
97
|
+
exports.DefaultApiFactory = function (configuration, basePath, axios) {
|
|
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, options) {
|
|
107
|
+
return exports.DefaultApiFp(configuration).v1LogPost(inlineObject, options)(axios, basePath);
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* DefaultApi - object-oriented interface
|
|
113
|
+
* @export
|
|
114
|
+
* @class DefaultApi
|
|
115
|
+
* @extends {BaseAPI}
|
|
116
|
+
*/
|
|
117
|
+
class DefaultApi extends base_1.BaseAPI {
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @summary Creates Audit Log event
|
|
121
|
+
* @param {InlineObject} inlineObject
|
|
122
|
+
* @param {*} [options] Override http request option.
|
|
123
|
+
* @throws {RequiredError}
|
|
124
|
+
* @memberof DefaultApi
|
|
125
|
+
*/
|
|
126
|
+
v1LogPost(inlineObject, options) {
|
|
127
|
+
return exports.DefaultApiFp(this.configuration).v1LogPost(inlineObject, options)(this.axios, this.basePath);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.DefaultApi = DefaultApi;
|
|
131
|
+
//# sourceMappingURL=default-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-api.js","sourceRoot":"","sources":["../../../../src/transport/generated/api/default-api.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;;;;;;;;AAGH,qDAAuC;AACvC,kDAAiE;AAEjE,yDAAyD;AACzD,aAAa;AACb,kCAA6F;AAG7F;;;GAGG;AACU,QAAA,2BAA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,CAAC;CAEJ;AAbD,gCAaC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
function __export(m) {
|
|
15
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__export(require("./api/default-api"));
|
|
19
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/transport/generated/api.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;AAIH,uCAAkC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import { Configuration } from "./configuration";
|
|
13
|
-
import { AxiosInstance
|
|
13
|
+
import { AxiosInstance } from 'axios';
|
|
14
14
|
export declare const BASE_PATH: string;
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
@@ -29,7 +29,7 @@ export declare const COLLECTION_FORMATS: {
|
|
|
29
29
|
*/
|
|
30
30
|
export interface RequestArgs {
|
|
31
31
|
url: string;
|
|
32
|
-
options:
|
|
32
|
+
options: any;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
// Some imports not used depending on template conditions
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
exports.BASE_PATH = "http://localhost:8081/v1".replace(/\/+$/, "");
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.COLLECTION_FORMATS = {
|
|
27
|
+
csv: ",",
|
|
28
|
+
ssv: " ",
|
|
29
|
+
tsv: "\t",
|
|
30
|
+
pipes: "|",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
* @class BaseAPI
|
|
36
|
+
*/
|
|
37
|
+
class BaseAPI {
|
|
38
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
39
|
+
this.basePath = basePath;
|
|
40
|
+
this.axios = axios;
|
|
41
|
+
if (configuration) {
|
|
42
|
+
this.configuration = configuration;
|
|
43
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.BaseAPI = BaseAPI;
|
|
48
|
+
;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @export
|
|
52
|
+
* @class RequiredError
|
|
53
|
+
* @extends {Error}
|
|
54
|
+
*/
|
|
55
|
+
class RequiredError extends Error {
|
|
56
|
+
constructor(field, msg) {
|
|
57
|
+
super(msg);
|
|
58
|
+
this.field = field;
|
|
59
|
+
this.name = "RequiredError";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.RequiredError = RequiredError;
|
|
63
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/transport/generated/base.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;AAIH,yDAAyD;AACzD,aAAa;AACb,kDAAiE;AAEpD,QAAA,SAAS,GAAG,0BAA0B,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAExE;;;GAGG;AACU,QAAA,kBAAkB,GAAG;IAC9B,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,GAAG;CACb,CAAC;AAYF;;;;GAIG;AACH,MAAa,OAAO;IAGhB,YAAY,aAA6B,EAAY,WAAmB,iBAAS,EAAY,QAAuB,eAAW;QAA1E,aAAQ,GAAR,QAAQ,CAAoB;QAAY,UAAK,GAAL,KAAK,CAA6B;QAC3H,IAAI,aAAa,EAAE;YACf,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;SAC3D;IACL,CAAC;CACJ;AATD,0BASC;AAAA,CAAC;AAEF;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,KAAK;IAEpC,YAAmB,KAAa,EAAE,GAAY;QAC1C,KAAK,CAAC,GAAG,CAAC,CAAC;QADI,UAAK,GAAL,KAAK,CAAQ;QADhC,SAAI,GAAoB,eAAe,CAAC;IAGxC,CAAC;CACJ;AALD,sCAKC"}
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
export interface ConfigurationParameters {
|
|
13
|
-
apiKey?: string |
|
|
13
|
+
apiKey?: string | ((name: string) => string);
|
|
14
14
|
username?: string;
|
|
15
15
|
password?: string;
|
|
16
|
-
accessToken?: string |
|
|
16
|
+
accessToken?: string | ((name?: string, scopes?: string[]) => string);
|
|
17
17
|
basePath?: string;
|
|
18
18
|
baseOptions?: any;
|
|
19
|
-
formDataCtor?: new () => any;
|
|
20
19
|
}
|
|
21
20
|
export declare class Configuration {
|
|
22
21
|
/**
|
|
@@ -24,7 +23,7 @@ export declare class Configuration {
|
|
|
24
23
|
* @param name security name
|
|
25
24
|
* @memberof Configuration
|
|
26
25
|
*/
|
|
27
|
-
apiKey?: string |
|
|
26
|
+
apiKey?: string | ((name: string) => string);
|
|
28
27
|
/**
|
|
29
28
|
* parameter for basic security
|
|
30
29
|
*
|
|
@@ -45,7 +44,7 @@ export declare class Configuration {
|
|
|
45
44
|
* @param scopes oauth2 scope
|
|
46
45
|
* @memberof Configuration
|
|
47
46
|
*/
|
|
48
|
-
accessToken?: string |
|
|
47
|
+
accessToken?: string | ((name?: string, scopes?: string[]) => string);
|
|
49
48
|
/**
|
|
50
49
|
* override base path
|
|
51
50
|
*
|
|
@@ -60,24 +59,5 @@ export declare class Configuration {
|
|
|
60
59
|
* @memberof Configuration
|
|
61
60
|
*/
|
|
62
61
|
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
62
|
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
63
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
class Configuration {
|
|
16
|
+
constructor(param = {}) {
|
|
17
|
+
this.apiKey = param.apiKey;
|
|
18
|
+
this.username = param.username;
|
|
19
|
+
this.password = param.password;
|
|
20
|
+
this.accessToken = param.accessToken;
|
|
21
|
+
this.basePath = param.basePath;
|
|
22
|
+
this.baseOptions = param.baseOptions;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.Configuration = Configuration;
|
|
26
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/transport/generated/configuration.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;AAYH,MAAa,aAAa;IA2CtB,YAAY,QAAiC,EAAE;QAC3C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IACzC,CAAC;CACJ;AAnDD,sCAmDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
function __export(m) {
|
|
15
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__export(require("./api"));
|
|
19
|
+
__export(require("./configuration"));
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/generated/index.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;AAGH,2BAAsB;AACtB,qCAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/generated/model/index.ts"],"names":[],"mappings":""}
|