@payfit/audit-log 1.0.8 → 1.1.0-rc.1

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/dist/index.d.ts +18 -6
  2. package/dist/index.js +1 -44
  3. package/dist/index.mjs +149 -0
  4. package/dist/playground.d.ts +1 -0
  5. package/dist/transport/generated/api/default-api.d.ts +7 -7
  6. package/dist/transport/generated/base.d.ts +2 -2
  7. package/dist/transport/generated/common.d.ts +65 -0
  8. package/dist/transport/generated/configuration.d.ts +22 -2
  9. package/dist/transport/generated/index.d.ts +1 -0
  10. package/dist/transport/generated/model/inline-object.d.ts +20 -20
  11. package/dist/transport/implementation.d.ts +1 -2
  12. package/dist/transport/interface.d.ts +4 -4
  13. package/package.json +45 -21
  14. package/.prettierrc +0 -5
  15. package/CHANGELOG.md +0 -13
  16. package/dist/index.js.map +0 -1
  17. package/dist/transport/generated/api/default-api.js +0 -156
  18. package/dist/transport/generated/api/default-api.js.map +0 -1
  19. package/dist/transport/generated/api.js +0 -26
  20. package/dist/transport/generated/api.js.map +0 -1
  21. package/dist/transport/generated/base.js +0 -64
  22. package/dist/transport/generated/base.js.map +0 -1
  23. package/dist/transport/generated/configuration.js +0 -27
  24. package/dist/transport/generated/configuration.js.map +0 -1
  25. package/dist/transport/generated/index.js +0 -27
  26. package/dist/transport/generated/index.js.map +0 -1
  27. package/dist/transport/generated/model/index.js +0 -14
  28. package/dist/transport/generated/model/index.js.map +0 -1
  29. package/dist/transport/generated/model/inline-object.js +0 -15
  30. package/dist/transport/generated/model/inline-object.js.map +0 -1
  31. package/dist/transport/implementation.js +0 -38
  32. package/dist/transport/implementation.js.map +0 -1
  33. package/dist/transport/interface.js +0 -3
  34. package/dist/transport/interface.js.map +0 -1
  35. package/openapi-codegen-config.yml +0 -6
  36. package/openapitools.json +0 -6
  37. package/playground/index.ts +0 -37
  38. package/src/index.ts +0 -131
  39. package/src/transport/generated/.openapi-generator/VERSION +0 -1
  40. package/src/transport/generated/.openapi-generator-ignore +0 -23
  41. package/src/transport/generated/api/default-api.ts +0 -132
  42. package/src/transport/generated/api.ts +0 -17
  43. package/src/transport/generated/base.ts +0 -70
  44. package/src/transport/generated/configuration.ts +0 -75
  45. package/src/transport/generated/git_push.sh +0 -58
  46. package/src/transport/generated/index.ts +0 -16
  47. package/src/transport/generated/model/index.ts +0 -1
  48. package/src/transport/generated/model/inline-object.ts +0 -144
  49. package/src/transport/implementation.ts +0 -27
  50. package/src/transport/interface.ts +0 -28
  51. package/tsconfig.json +0 -25
  52. package/tslint.json +0 -12
package/package.json CHANGED
@@ -1,34 +1,58 @@
1
1
  {
2
2
  "name": "@payfit/audit-log",
3
- "version": "1.0.8",
3
+ "version": "1.1.0-rc.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/PayFit/audit-logs.git",
7
+ "directory": "sdk"
8
+ },
4
9
  "description": "Library to handle audit logs at Payfit",
5
10
  "main": "dist/index.js",
11
+ "module": "dist/index.mjs",
12
+ "types": "dist/index.d.ts",
6
13
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "type:check": "tsc --noEmit",
9
- "codegen:sdk": "openapi-generator-cli generate -i ../pkg/broker/v1/swagger/openapi.json -g typescript-axios -o src/transport/generated -c openapi-codegen-config.yml",
10
- "build": "npm run codegen:sdk && rimraf dist && tsc",
11
- "prepublishOnly": "npm run build",
12
- "start:playground": "ts-node playground/index.ts"
14
+ "generate": "openapi-generator-cli generate -i ../pkg/broker/v1/swagger/openapi.json -g typescript-axios -o src/transport/generated -c openapi-codegen-config.yml",
15
+ "build": "rimraf dist && vite build",
16
+ "prepack": "npm run build",
17
+ "lint": "eslint .",
18
+ "start:playground": "ts-node src/playground.ts",
19
+ "format:check": "prettier --check .",
20
+ "format:fix": "prettier --write .",
21
+ "release": "semantic-release --noCi"
13
22
  },
14
23
  "author": "",
15
24
  "license": "ISC",
16
25
  "dependencies": {
17
- "axios": "0.21.1",
26
+ "axios": "^1.0.0",
18
27
  "lodash": "^4.17.20",
19
- "uuid": "^7.0.3"
28
+ "uuid": "^9.0.0"
20
29
  },
21
30
  "devDependencies": {
22
- "@openapitools/openapi-generator-cli": "2.2.3",
23
- "@types/lodash": "4.14.168",
24
- "@types/node": "14.14.35",
25
- "@types/uuid": "3.4.9",
26
- "prettier": "2.2.1",
27
- "rimraf": "3.0.2",
28
- "ts-node": "10.2.1",
29
- "ts-node-dev": "1.1.6",
30
- "tslint": "5.20.1",
31
- "tslint-config-prettier": "1.18.0",
32
- "typescript": "3.9.9"
33
- }
31
+ "@openapitools/openapi-generator-cli": "2.7.0",
32
+ "@payfit/browserslist-config": "1.1.1",
33
+ "@payfit/eslint-config-node": "1.1.0",
34
+ "@payfit/semantic-release-package-config": "6.13.0",
35
+ "@rollup/plugin-typescript": "11.1.5",
36
+ "@tsconfig/node18": "18.2.2",
37
+ "@tsconfig/strictest": "2.0.2",
38
+ "@types/lodash": "4.14.202",
39
+ "@types/node": "18.19.4",
40
+ "@types/uuid": "9.0.7",
41
+ "@typescript-eslint/eslint-plugin": "6.17.0",
42
+ "builtin-modules": "3.3.0",
43
+ "eslint": "8.56.0",
44
+ "prettier": "3.1.1",
45
+ "rimraf": "5.0.5",
46
+ "semantic-release": "20.1.3",
47
+ "ts-node": "10.9.2",
48
+ "typescript": "5.3.3",
49
+ "vite": "4.5.1"
50
+ },
51
+ "peerDependencies": {},
52
+ "publishConfig": {
53
+ "registry": "https://registry.npmjs.org/"
54
+ },
55
+ "files": [
56
+ "dist"
57
+ ]
34
58
  }
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "trailingComma": "es5"
5
- }
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
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.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAmC;AAEnC,+DAAsD;AAwGtD,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"}
@@ -1,156 +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
- 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
@@ -1 +0,0 @@
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;;;;;;W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IACI,SAAS,CAAC,YAA0B,EAAE,OAAa;QACtD,OAAO,oBAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnI,CAAC;CAEJ;AAbD,gCAaC"}
@@ -1,26 +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
- 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/transport/generated/api.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;;;;;;;;AAIH,oDAAkC"}
@@ -1,64 +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
- 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
@@ -1 +0,0 @@
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"}
@@ -1,27 +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
- 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
@@ -1 +0,0 @@
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"}
@@ -1,27 +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
- 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/generated/index.ts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB;;;;;;;;;;GAUG;;;;;;;;;;;;AAGH,wCAAsB;AACtB,kDAAgC"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/generated/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC"}
@@ -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,38 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Transport = void 0;
13
- const generated_1 = require("./generated");
14
- class Transport {
15
- constructor(apiUrl) {
16
- this.apiUrl = apiUrl;
17
- this.api = new generated_1.DefaultApi({
18
- basePath: this.apiUrl,
19
- });
20
- }
21
- create(auditLogData) {
22
- var _a;
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- yield this.api.v1LogPost(auditLogData);
26
- }
27
- catch (err) {
28
- if (!err.isAxiosError) {
29
- throw err;
30
- }
31
- const message = ((_a = err.response) === null || _a === void 0 ? void 0 : _a.data) || err.message;
32
- throw new Error(message);
33
- }
34
- });
35
- }
36
- }
37
- exports.Transport = Transport;
38
- //# sourceMappingURL=implementation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/transport/implementation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AAKxC,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,YAA0B;;;YACrC,IAAI;gBACF,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;aACvC;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;oBACrB,MAAM,GAAG,CAAA;iBACV;gBAED,MAAM,OAAO,GAAG,OAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,KAAI,GAAG,CAAC,OAAO,CAAA;gBACjD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;aACzB;;KACF;CACF;AArBD,8BAqBC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/transport/interface.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- withSeparateModelsAndApi: true
2
- apiPackage: 'api'
3
- modelPackage: 'model'
4
- enumPropertyNaming: UPPERCASE
5
- modelPropertyNaming: camelCase
6
- withoutPrefixEnums: true
package/openapitools.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "spaces": 2,
3
- "generator-cli": {
4
- "version": "4.3.1"
5
- }
6
- }
@@ -1,37 +0,0 @@
1
- import { AuditLogger } from '../src'
2
-
3
- const logger = new AuditLogger({
4
- apiUrl: 'http://localhost:8090',
5
- environment: 't-hello-audit',
6
- service: 'auth',
7
- })
8
-
9
- async function main() {
10
- await logger.log({
11
- event: 'update',
12
- target: 'user_settings',
13
- namespace: 'auth',
14
- payload: {
15
- isTest: true,
16
- },
17
- account: {
18
- internalId: 'an internal id',
19
- individualId: 'an individual id',
20
- employeeId: 'an employee id',
21
- holdingId: 'a holding id',
22
- companyId: 'a company id',
23
- roleId: 'a role id',
24
- userIp: '127.0.0.1',
25
- countryCode: 'FR',
26
- email: 'truc@ok.fr',
27
- },
28
- scope: {
29
- employeeId: 'an employee id',
30
- companyId: 'a company id',
31
- },
32
- })
33
- }
34
-
35
- main().catch((err) => {
36
- console.log('Error:', err)
37
- })