@payfit/audit-log 2.0.0-rc.3 → 2.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.
Files changed (52) hide show
  1. package/.prettierrc +5 -0
  2. package/CHANGELOG.md +13 -0
  3. package/dist/index.d.ts +13 -7
  4. package/dist/index.js +55 -1
  5. package/dist/index.js.map +1 -0
  6. package/dist/transport/generated/api/default-api.d.ts +7 -7
  7. package/dist/transport/generated/api/default-api.js +156 -0
  8. package/dist/transport/generated/api/default-api.js.map +1 -0
  9. package/dist/transport/generated/api.js +26 -0
  10. package/dist/transport/generated/api.js.map +1 -0
  11. package/dist/transport/generated/base.d.ts +2 -2
  12. package/dist/transport/generated/base.js +64 -0
  13. package/dist/transport/generated/base.js.map +1 -0
  14. package/dist/transport/generated/configuration.d.ts +2 -22
  15. package/dist/transport/generated/configuration.js +27 -0
  16. package/dist/transport/generated/configuration.js.map +1 -0
  17. package/dist/transport/generated/index.d.ts +0 -1
  18. package/dist/transport/generated/index.js +27 -0
  19. package/dist/transport/generated/index.js.map +1 -0
  20. package/dist/transport/generated/model/index.js +14 -0
  21. package/dist/transport/generated/model/index.js.map +1 -0
  22. package/dist/transport/generated/model/inline-object.d.ts +20 -20
  23. package/dist/transport/generated/model/inline-object.js +15 -0
  24. package/dist/transport/generated/model/inline-object.js.map +1 -0
  25. package/dist/transport/implementation.d.ts +2 -1
  26. package/dist/transport/implementation.js +38 -0
  27. package/dist/transport/implementation.js.map +1 -0
  28. package/dist/transport/interface.d.ts +4 -4
  29. package/dist/transport/interface.js +3 -0
  30. package/dist/transport/interface.js.map +1 -0
  31. package/openapi-codegen-config.yml +6 -0
  32. package/openapitools.json +6 -0
  33. package/package.json +21 -45
  34. package/playground/index.ts +37 -0
  35. package/src/index.ts +205 -0
  36. package/src/transport/generated/.openapi-generator/VERSION +1 -0
  37. package/src/transport/generated/.openapi-generator-ignore +23 -0
  38. package/src/transport/generated/api/default-api.ts +132 -0
  39. package/src/transport/generated/api.ts +17 -0
  40. package/src/transport/generated/base.ts +70 -0
  41. package/src/transport/generated/configuration.ts +75 -0
  42. package/src/transport/generated/git_push.sh +58 -0
  43. package/src/transport/generated/index.ts +16 -0
  44. package/src/transport/generated/model/index.ts +1 -0
  45. package/src/transport/generated/model/inline-object.ts +144 -0
  46. package/src/transport/implementation.ts +27 -0
  47. package/src/transport/interface.ts +28 -0
  48. package/tsconfig.json +25 -0
  49. package/tslint.json +12 -0
  50. package/dist/index.mjs +0 -149
  51. package/dist/playground.d.ts +0 -1
  52. package/dist/transport/generated/common.d.ts +0 -65
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5"
5
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ ## 1.0.5 (2020/06/03)
2
+
3
+ - Fix an error with audit log timestamp format (#37)
4
+
5
+ ## 1.0.4 (2020/04/02)
6
+
7
+ - Better error handling (#18)
8
+ - Use TS 3.7 (#18)
9
+ - Add individualId to scope (#18)
10
+
11
+ ## 1.0.3 (2020/04/01)
12
+
13
+ First working version in prod
package/dist/index.d.ts CHANGED
@@ -1,15 +1,21 @@
1
1
  /**
2
2
  * The allowed Namespaces for the AuditLog
3
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';
4
+ export declare type AuditNamespaces = 'employee' | 'company' | 'permissions' | 'absence' | 'expense' | 'advancePayment' | 'auth' | 'billing' | 'modules' | 'integrations' | 'partnerApi' | 'donation' | 'notificationSettings' | 'people' | 'subscriptions';
5
5
  /**
6
6
  * The allowed targets for the AuditLog
7
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';
8
+ export declare type AuditTargets = 'reporting' | 'employee' | 'employee.settings' | 'employee-request' | 'company.billings' | 'company.variables' | 'company.settings' | 'company.emails' | 'company.addons' | 'company.plans' | 'user.role' | 'user.account' | 'user.primaryEmail' | 'user.secondaryEmail' | 'user.locale' | 'user.notificationSettings' | '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.settings' | 'people.relation';
9
9
  /**
10
10
  * The allowed Events for the AuditLog
11
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' | 'deleteAllAdmins';
12
+ export declare enum AuditEvents {
13
+ create = "create",
14
+ update = "update",
15
+ delete = "delete",
16
+ view = "view",
17
+ merge = "merge"
18
+ }
13
19
  /**
14
20
  * Data to audit log.
15
21
  */
@@ -18,7 +24,7 @@ export interface IAuditLogData {
18
24
  * The data specific to the audit log.
19
25
  * For example, if we add a bonus to an employee, it could contain the amount, the impacted employeeId, etc...
20
26
  */
21
- payload?: Record<string, unknown>;
27
+ payload?: object;
22
28
  /**
23
29
  * The buisness domain impacted.
24
30
  * e.g documents, authentication, ...
@@ -33,7 +39,7 @@ export interface IAuditLogData {
33
39
  * The target of event.
34
40
  * e.g. user.settings, employee.bonuses, ...
35
41
  */
36
- target: AuditTargets | string;
42
+ target: AuditTargets;
37
43
  /**
38
44
  * The data that describes who did perform the logged action.
39
45
  */
@@ -46,7 +52,7 @@ export interface IAuditLogData {
46
52
  /**
47
53
  * Data used to indentify who performed an action
48
54
  */
49
- export type IAuditLogAuthData = {
55
+ export declare type IAuditLogAuthData = {
50
56
  /**
51
57
  * The id of the payfiter that did the action if it has been made during a siginAs
52
58
  */
@@ -75,7 +81,7 @@ export type IAuditLogAuthData = {
75
81
  * Data used to "scope" the audit log.
76
82
  * Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
77
83
  */
78
- export type IAuditLogScope = {
84
+ export declare type IAuditLogScope = {
79
85
  holdingId: string;
80
86
  } | {
81
87
  companyId: string;
package/dist/index.js CHANGED
@@ -1 +1,55 @@
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;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.AuditLogger = exports.AuditEvents = void 0;
24
+ const uuid_1 = require("uuid");
25
+ const implementation_1 = require("./transport/implementation");
26
+ /**
27
+ * The allowed Events for the AuditLog
28
+ */
29
+ var AuditEvents;
30
+ (function (AuditEvents) {
31
+ AuditEvents["create"] = "create";
32
+ AuditEvents["update"] = "update";
33
+ AuditEvents["delete"] = "delete";
34
+ AuditEvents["view"] = "view";
35
+ AuditEvents["merge"] = "merge";
36
+ })(AuditEvents = exports.AuditEvents || (exports.AuditEvents = {}));
37
+ class AuditLogger {
38
+ constructor(params) {
39
+ this.params = params;
40
+ this.transport = new implementation_1.Transport(params.apiUrl);
41
+ }
42
+ log(_a) {
43
+ var { scope, account } = _a, data = __rest(_a, ["scope", "account"]);
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const uuid = uuid_1.v4();
46
+ const { environment, service } = this.params;
47
+ const timestamp = Math.floor(Date.now() / 1000);
48
+ const log = Object.assign(Object.assign(Object.assign(Object.assign({}, data), account), { service, id: uuid, environment,
49
+ timestamp }), (scope && { scope }));
50
+ yield this.transport.create(log);
51
+ });
52
+ }
53
+ }
54
+ exports.AuditLogger = AuditLogger;
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAmC;AAEnC,+DAAsD;AAiEtD;;GAEG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,8BAAe,CAAA;AACjB,CAAC,EANW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAMtB;AAwGD,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,EAA0C;YAA1C,EAAE,KAAK,EAAE,OAAO,OAA0B,EAArB,IAAI,cAAzB,oBAA2B,CAAF;;YACjC,MAAM,IAAI,GAAG,SAAM,EAAE,CAAA;YACrB,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;YAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;YAE/C,MAAM,GAAG,+DACJ,IAAI,GACJ,OAAO,KACV,OAAO,EACP,EAAE,EAAE,IAAI,EACR,WAAW;gBACX,SAAS,KACN,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC,CACxB,CAAA;YAED,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;;KACjC;CACF;AAxBD,kCAwBC"}
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
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: (inlineObject: InlineObject, options?: AxiosRequestConfig) => Promise<RequestArgs>;
28
+ v1LogPost: (inlineObject: InlineObject, options?: any) => Promise<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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
42
+ v1LogPost(inlineObject: InlineObject, options?: any): Promise<(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?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<void, any>>;
73
+ v1LogPost(inlineObject: InlineObject, options?: any): Promise<import("axios").AxiosResponse<void, any>>;
74
74
  }
@@ -0,0 +1,156 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
34
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
35
+ return new (P || (P = Promise))(function (resolve, reject) {
36
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
37
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
38
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
39
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
40
+ });
41
+ };
42
+ var __importDefault = (this && this.__importDefault) || function (mod) {
43
+ return (mod && mod.__esModule) ? mod : { "default": mod };
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = void 0;
47
+ const globalImportUrl = __importStar(require("url"));
48
+ const axios_1 = __importDefault(require("axios"));
49
+ // Some imports not used depending on template conditions
50
+ // @ts-ignore
51
+ const base_1 = require("../base");
52
+ /**
53
+ * DefaultApi - axios parameter creator
54
+ * @export
55
+ */
56
+ exports.DefaultApiAxiosParamCreator = function (configuration) {
57
+ return {
58
+ /**
59
+ *
60
+ * @summary Creates Audit Log event
61
+ * @param {InlineObject} inlineObject
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ */
65
+ v1LogPost: (inlineObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
66
+ // verify required parameter 'inlineObject' is not null or undefined
67
+ if (inlineObject === null || inlineObject === undefined) {
68
+ throw new base_1.RequiredError('inlineObject', 'Required parameter inlineObject was null or undefined when calling v1LogPost.');
69
+ }
70
+ const localVarPath = `/v1/log`;
71
+ const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
72
+ let baseOptions;
73
+ if (configuration) {
74
+ baseOptions = configuration.baseOptions;
75
+ }
76
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
77
+ const localVarHeaderParameter = {};
78
+ const localVarQueryParameter = {};
79
+ localVarHeaderParameter['Content-Type'] = 'application/json';
80
+ localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, localVarUrlObj.query), localVarQueryParameter), options.query);
81
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
82
+ delete localVarUrlObj.search;
83
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
84
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
85
+ const needsSerialization = (typeof inlineObject !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
86
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) : (inlineObject || "");
87
+ return {
88
+ url: globalImportUrl.format(localVarUrlObj),
89
+ options: localVarRequestOptions,
90
+ };
91
+ }),
92
+ };
93
+ };
94
+ /**
95
+ * DefaultApi - functional programming interface
96
+ * @export
97
+ */
98
+ exports.DefaultApiFp = function (configuration) {
99
+ return {
100
+ /**
101
+ *
102
+ * @summary Creates Audit Log event
103
+ * @param {InlineObject} inlineObject
104
+ * @param {*} [options] Override http request option.
105
+ * @throws {RequiredError}
106
+ */
107
+ v1LogPost(inlineObject, options) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ const localVarAxiosArgs = yield exports.DefaultApiAxiosParamCreator(configuration).v1LogPost(inlineObject, options);
110
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
111
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
112
+ return axios.request(axiosRequestArgs);
113
+ };
114
+ });
115
+ },
116
+ };
117
+ };
118
+ /**
119
+ * DefaultApi - factory interface
120
+ * @export
121
+ */
122
+ exports.DefaultApiFactory = function (configuration, basePath, axios) {
123
+ return {
124
+ /**
125
+ *
126
+ * @summary Creates Audit Log event
127
+ * @param {InlineObject} inlineObject
128
+ * @param {*} [options] Override http request option.
129
+ * @throws {RequiredError}
130
+ */
131
+ v1LogPost(inlineObject, options) {
132
+ return exports.DefaultApiFp(configuration).v1LogPost(inlineObject, options).then((request) => request(axios, basePath));
133
+ },
134
+ };
135
+ };
136
+ /**
137
+ * DefaultApi - object-oriented interface
138
+ * @export
139
+ * @class DefaultApi
140
+ * @extends {BaseAPI}
141
+ */
142
+ class DefaultApi extends base_1.BaseAPI {
143
+ /**
144
+ *
145
+ * @summary Creates Audit Log event
146
+ * @param {InlineObject} inlineObject
147
+ * @param {*} [options] Override http request option.
148
+ * @throws {RequiredError}
149
+ * @memberof DefaultApi
150
+ */
151
+ v1LogPost(inlineObject, options) {
152
+ return exports.DefaultApiFp(this.configuration).v1LogPost(inlineObject, options).then((request) => request(this.axios, this.basePath));
153
+ }
154
+ }
155
+ exports.DefaultApi = DefaultApi;
156
+ //# 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,2BAA2B,GAAG,UAAU,aAA6B;IAC9E,OAAO;QACH;;;;;;WAMG;QACH,SAAS,EAAE,CAAO,YAA0B,EAAE,UAAe,EAAE,EAAwB,EAAE;YACrF,oEAAoE;YACpE,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE;gBAC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,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnI,CAAC;CAEJ;AAbD,gCAaC"}
@@ -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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ __exportStar(require("./api/default-api"), exports);
26
+ //# 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,oDAAkC"}
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { Configuration } from "./configuration";
13
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
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: AxiosRequestConfig;
32
+ options: any;
33
33
  }
34
34
  /**
35
35
  *
@@ -0,0 +1,64 @@
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
+ exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ const axios_1 = __importDefault(require("axios"));
22
+ exports.BASE_PATH = "http://localhost:8090".replace(/\/+$/, "");
23
+ /**
24
+ *
25
+ * @export
26
+ */
27
+ exports.COLLECTION_FORMATS = {
28
+ csv: ",",
29
+ ssv: " ",
30
+ tsv: "\t",
31
+ pipes: "|",
32
+ };
33
+ /**
34
+ *
35
+ * @export
36
+ * @class BaseAPI
37
+ */
38
+ class BaseAPI {
39
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
40
+ this.basePath = basePath;
41
+ this.axios = axios;
42
+ if (configuration) {
43
+ this.configuration = configuration;
44
+ this.basePath = configuration.basePath || this.basePath;
45
+ }
46
+ }
47
+ }
48
+ exports.BaseAPI = BaseAPI;
49
+ ;
50
+ /**
51
+ *
52
+ * @export
53
+ * @class RequiredError
54
+ * @extends {Error}
55
+ */
56
+ class RequiredError extends Error {
57
+ constructor(field, msg) {
58
+ super(msg);
59
+ this.field = field;
60
+ this.name = "RequiredError";
61
+ }
62
+ }
63
+ exports.RequiredError = RequiredError;
64
+ //# 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,uBAAuB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAErE;;;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"}
@@ -13,10 +13,9 @@ export interface ConfigurationParameters {
13
13
  apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
14
  username?: string;
15
15
  password?: string;
16
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<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
  /**
@@ -45,7 +44,7 @@ export declare class Configuration {
45
44
  * @param scopes oauth2 scope
46
45
  * @memberof Configuration
47
46
  */
48
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<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,27 @@
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
+ exports.Configuration = void 0;
16
+ class Configuration {
17
+ constructor(param = {}) {
18
+ this.apiKey = param.apiKey;
19
+ this.username = param.username;
20
+ this.password = param.password;
21
+ this.accessToken = param.accessToken;
22
+ this.basePath = param.basePath;
23
+ this.baseOptions = param.baseOptions;
24
+ }
25
+ }
26
+ exports.Configuration = Configuration;
27
+ //# 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"}
@@ -11,4 +11,3 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
- export * from "./model";
@@ -0,0 +1,27 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ __exportStar(require("./api"), exports);
26
+ __exportStar(require("./configuration"), exports);
27
+ //# 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,wCAAsB;AACtB,kDAAgC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./inline-object"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/generated/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC"}