@payfit/audit-log 1.0.8-rc1 → 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/dist/index.d.ts CHANGED
@@ -1,3 +1,15 @@
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';
1
13
  /**
2
14
  * Data to audit log.
3
15
  */
@@ -6,22 +18,22 @@ export interface IAuditLogData {
6
18
  * The data specific to the audit log.
7
19
  * For example, if we add a bonus to an employee, it could contain the amount, the impacted employeeId, etc...
8
20
  */
9
- payload?: object;
21
+ payload?: Record<string, unknown>;
10
22
  /**
11
23
  * The buisness domain impacted.
12
24
  * e.g documents, authentication, ...
13
25
  */
14
- namespace: string;
26
+ namespace: AuditNamespaces;
15
27
  /**
16
28
  * The name of the event.
17
29
  * e.g. signIn, passwordUpdated, ...
18
30
  */
19
- event: string;
31
+ event: AuditEvents;
20
32
  /**
21
33
  * The target of event.
22
34
  * e.g. user.settings, employee.bonuses, ...
23
35
  */
24
- target: string;
36
+ target: AuditTargets | string;
25
37
  /**
26
38
  * The data that describes who did perform the logged action.
27
39
  */
@@ -34,7 +46,7 @@ export interface IAuditLogData {
34
46
  /**
35
47
  * Data used to indentify who performed an action
36
48
  */
37
- export declare type IAuditLogAuthData = {
49
+ export type IAuditLogAuthData = {
38
50
  /**
39
51
  * The id of the payfiter that did the action if it has been made during a siginAs
40
52
  */
@@ -63,7 +75,7 @@ export declare type IAuditLogAuthData = {
63
75
  * Data used to "scope" the audit log.
64
76
  * Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
65
77
  */
66
- export declare type IAuditLogScope = {
78
+ export type IAuditLogScope = {
67
79
  holdingId: string;
68
80
  } | {
69
81
  companyId: string;
package/dist/index.js CHANGED
@@ -1,44 +1 @@
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 = void 0;
24
- const uuid_1 = require("uuid");
25
- const implementation_1 = require("./transport/implementation");
26
- class AuditLogger {
27
- constructor(params) {
28
- this.params = params;
29
- this.transport = new implementation_1.Transport(params.apiUrl);
30
- }
31
- log(_a) {
32
- var { scope, account } = _a, data = __rest(_a, ["scope", "account"]);
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const uuid = uuid_1.v4();
35
- const { environment, service } = this.params;
36
- const timestamp = Math.floor(Date.now() / 1000);
37
- const log = Object.assign(Object.assign(Object.assign(Object.assign({}, data), account), { service, id: uuid, environment,
38
- timestamp }), (scope && { scope }));
39
- yield this.transport.create(log);
40
- });
41
- }
42
- }
43
- exports.AuditLogger = AuditLogger;
44
- //# sourceMappingURL=index.js.map
1
+ "use strict";var d=Object.defineProperty;var P=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>(P(s,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("uuid"),h=require("axios"),p="http://localhost:8090".replace(/\/+$/,"");class f{constructor(e,t=p,r=h){n(this,"basePath");n(this,"axios");n(this,"configuration");this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class g extends Error{constructor(t,r){super(r);n(this,"field");n(this,"name","RequiredError");this.field=t}}const A="https://example.com",w=function(s,e,t){if(t==null)throw new g(e,`Required parameter ${e} was null or undefined when calling ${s}.`)},b=function(s,...e){const t=new URLSearchParams(s.search);for(const r of e)for(const o in r)if(Array.isArray(r[o])){t.delete(o);for(const a of r[o])t.append(o,a)}else t.set(o,r[o]);s.search=t.toString()},x=function(s,e,t){const r=typeof s!="string";return(r&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):r)?JSON.stringify(s!==void 0?s:{}):s||""},y=function(s){return s.pathname+s.search+s.hash},L=function(s,e,t,r){return(o=e,a=t)=>{const i={...s.options,url:((r==null?void 0:r.basePath)||a)+s.url};return o.request(i)}},S=function(s){return{v1LogPost:async(e,t={})=>{w("v1LogPost","inlineObject",e);const r="/v1/log",o=new URL(r,A);let a;s&&(a=s.baseOptions);const i={method:"POST",...a,...t},c={},l={};c["Content-Type"]="application/json",b(o,l);let u=a&&a.headers?a.headers:{};return i.headers={...c,...u,...t.headers},i.data=x(e,i,s),{url:y(o),options:i}}}},E=function(s){const e=S(s);return{async v1LogPost(t,r){const o=await e.v1LogPost(t,r);return L(o,h,p,s)}}};class v extends f{v1LogPost(e,t){return E(this.configuration).v1LogPost(e,t).then(r=>r(this.axios,this.basePath))}}const R=s=>"isAxiosError"in s&&s.isAxiosError&&s instanceof Error;class j{constructor(e){n(this,"apiUrl");n(this,"api");this.apiUrl=e,this.api=new v({basePath:this.apiUrl,isJsonMime(t){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(r.test(t)||t.toLowerCase()==="application/json-patch+json")}})}async create(e){var t;try{await this.api.v1LogPost(e,{timeout:5e3})}catch(r){if(!R(r))throw r;const o=((t=r.response)==null?void 0:t.data)||r.message;throw new Error(o)}}}class q{constructor(e){n(this,"params");n(this,"transport");this.params=e,this.transport=new j(e.apiUrl)}async log({scope:e,account:t,...r}){const o=m.v4(),{environment:a,service:i}=this.params,c=Math.floor(Date.now()/1e3),l={...r,...t,service:i,id:o,environment:a,timestamp:c,...e&&{scope:e}};await this.transport.create(l)}}exports.AuditLogger=q;
package/dist/index.mjs ADDED
@@ -0,0 +1,149 @@
1
+ var u = Object.defineProperty;
2
+ var P = (s, e, t) => e in s ? u(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var n = (s, e, t) => (P(s, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { v4 as m } from "uuid";
5
+ import l from "axios";
6
+ const p = "http://localhost:8090".replace(/\/+$/, "");
7
+ class f {
8
+ constructor(e, t = p, o = l) {
9
+ n(this, "basePath");
10
+ n(this, "axios");
11
+ n(this, "configuration");
12
+ this.basePath = t, this.axios = o, e && (this.configuration = e, this.basePath = e.basePath || this.basePath);
13
+ }
14
+ }
15
+ class A extends Error {
16
+ constructor(t, o) {
17
+ super(o);
18
+ n(this, "field");
19
+ n(this, "name", "RequiredError");
20
+ this.field = t;
21
+ }
22
+ }
23
+ const w = "https://example.com", x = function(s, e, t) {
24
+ if (t == null)
25
+ throw new A(e, `Required parameter ${e} was null or undefined when calling ${s}.`);
26
+ }, g = function(s, ...e) {
27
+ const t = new URLSearchParams(s.search);
28
+ for (const o of e)
29
+ for (const r in o)
30
+ if (Array.isArray(o[r])) {
31
+ t.delete(r);
32
+ for (const a of o[r])
33
+ t.append(r, a);
34
+ } else
35
+ t.set(r, o[r]);
36
+ s.search = t.toString();
37
+ }, b = function(s, e, t) {
38
+ const o = typeof s != "string";
39
+ return (o && t && t.isJsonMime ? t.isJsonMime(e.headers["Content-Type"]) : o) ? JSON.stringify(s !== void 0 ? s : {}) : s || "";
40
+ }, y = function(s) {
41
+ return s.pathname + s.search + s.hash;
42
+ }, E = function(s, e, t, o) {
43
+ return (r = e, a = t) => {
44
+ const i = { ...s.options, url: ((o == null ? void 0 : o.basePath) || a) + s.url };
45
+ return r.request(i);
46
+ };
47
+ }, L = function(s) {
48
+ return {
49
+ /**
50
+ *
51
+ * @summary Creates Audit Log event
52
+ * @param {InlineObject} inlineObject
53
+ * @param {*} [options] Override http request option.
54
+ * @throws {RequiredError}
55
+ */
56
+ v1LogPost: async (e, t = {}) => {
57
+ x("v1LogPost", "inlineObject", e);
58
+ const o = "/v1/log", r = new URL(o, w);
59
+ let a;
60
+ s && (a = s.baseOptions);
61
+ const i = { method: "POST", ...a, ...t }, c = {}, h = {};
62
+ c["Content-Type"] = "application/json", g(r, h);
63
+ let d = a && a.headers ? a.headers : {};
64
+ return i.headers = { ...c, ...d, ...t.headers }, i.data = b(e, i, s), {
65
+ url: y(r),
66
+ options: i
67
+ };
68
+ }
69
+ };
70
+ }, S = function(s) {
71
+ const e = L(s);
72
+ return {
73
+ /**
74
+ *
75
+ * @summary Creates Audit Log event
76
+ * @param {InlineObject} inlineObject
77
+ * @param {*} [options] Override http request option.
78
+ * @throws {RequiredError}
79
+ */
80
+ async v1LogPost(t, o) {
81
+ const r = await e.v1LogPost(t, o);
82
+ return E(r, l, p, s);
83
+ }
84
+ };
85
+ };
86
+ class v extends f {
87
+ /**
88
+ *
89
+ * @summary Creates Audit Log event
90
+ * @param {InlineObject} inlineObject
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ * @memberof DefaultApi
94
+ */
95
+ v1LogPost(e, t) {
96
+ return S(this.configuration).v1LogPost(e, t).then((o) => o(this.axios, this.basePath));
97
+ }
98
+ }
99
+ const R = (s) => "isAxiosError" in s && s.isAxiosError && s instanceof Error;
100
+ class U {
101
+ constructor(e) {
102
+ n(this, "apiUrl");
103
+ n(this, "api");
104
+ this.apiUrl = e, this.api = new v({
105
+ basePath: this.apiUrl,
106
+ isJsonMime(t) {
107
+ const o = new RegExp(
108
+ // eslint-disable-next-line no-control-regex
109
+ "^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$",
110
+ "i"
111
+ );
112
+ return t !== null && (o.test(t) || t.toLowerCase() === "application/json-patch+json");
113
+ }
114
+ });
115
+ }
116
+ async create(e) {
117
+ var t;
118
+ try {
119
+ await this.api.v1LogPost(e, { timeout: 5e3 });
120
+ } catch (o) {
121
+ if (!R(o))
122
+ throw o;
123
+ const r = ((t = o.response) == null ? void 0 : t.data) || o.message;
124
+ throw new Error(r);
125
+ }
126
+ }
127
+ }
128
+ class O {
129
+ constructor(e) {
130
+ n(this, "params");
131
+ n(this, "transport");
132
+ this.params = e, this.transport = new U(e.apiUrl);
133
+ }
134
+ async log({ scope: e, account: t, ...o }) {
135
+ const r = m(), { environment: a, service: i } = this.params, c = Math.floor(Date.now() / 1e3), h = {
136
+ ...o,
137
+ ...t,
138
+ service: i,
139
+ id: r,
140
+ environment: a,
141
+ timestamp: c,
142
+ ...e && { scope: e }
143
+ };
144
+ await this.transport.create(h);
145
+ }
146
+ }
147
+ export {
148
+ O as AuditLogger
149
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { AxiosPromise, AxiosInstance } from 'axios';
12
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } 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 | undefined) => {
20
+ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
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?: any) => Promise<RequestArgs>;
28
+ v1LogPost: (inlineObject: InlineObject, options?: AxiosRequestConfig) => Promise<RequestArgs>;
29
29
  };
30
30
  /**
31
31
  * DefaultApi - functional programming interface
32
32
  * @export
33
33
  */
34
- export declare const DefaultApiFp: (configuration?: Configuration | undefined) => {
34
+ export declare const DefaultApiFp: (configuration?: Configuration) => {
35
35
  /**
36
36
  *
37
37
  * @summary Creates Audit Log event
@@ -39,13 +39,13 @@ export declare const DefaultApiFp: (configuration?: Configuration | undefined) =
39
39
  * @param {*} [options] Override http request option.
40
40
  * @throws {RequiredError}
41
41
  */
42
- v1LogPost(inlineObject: InlineObject, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<void>>;
42
+ v1LogPost(inlineObject: InlineObject, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
43
43
  };
44
44
  /**
45
45
  * DefaultApi - factory interface
46
46
  * @export
47
47
  */
48
- export declare const DefaultApiFactory: (configuration?: Configuration | undefined, basePath?: string | undefined, axios?: AxiosInstance | undefined) => {
48
+ export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
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?: any): Promise<import("axios").AxiosResponse<void>>;
73
+ v1LogPost(inlineObject: InlineObject, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<void, any>>;
74
74
  }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { Configuration } from "./configuration";
13
- import { AxiosInstance } from 'axios';
13
+ import { AxiosInstance, AxiosRequestConfig } 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: any;
32
+ options: AxiosRequestConfig;
33
33
  }
34
34
  /**
35
35
  *
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Audit Logs
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: damian.bursztyn@payfit.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { RequestArgs } from "./base";
14
+ import { AxiosInstance, AxiosResponse } from 'axios';
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const DUMMY_BASE_URL = "https://example.com";
20
+ /**
21
+ *
22
+ * @throws {RequiredError}
23
+ * @export
24
+ */
25
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
+ /**
27
+ *
28
+ * @export
29
+ */
30
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
+ /**
42
+ *
43
+ * @export
44
+ */
45
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
+ /**
47
+ *
48
+ * @export
49
+ */
50
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export declare const toPathString: (url: URL) => string;
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
@@ -13,9 +13,10 @@ 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 | ((name?: string, scopes?: string[]) => string);
16
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
17
  basePath?: string;
18
18
  baseOptions?: any;
19
+ formDataCtor?: new () => any;
19
20
  }
20
21
  export declare class Configuration {
21
22
  /**
@@ -44,7 +45,7 @@ export declare class Configuration {
44
45
  * @param scopes oauth2 scope
45
46
  * @memberof Configuration
46
47
  */
47
- accessToken?: string | ((name?: string, scopes?: string[]) => string);
48
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
48
49
  /**
49
50
  * override base path
50
51
  *
@@ -59,5 +60,24 @@ export declare class Configuration {
59
60
  * @memberof Configuration
60
61
  */
61
62
  baseOptions?: any;
63
+ /**
64
+ * The FormData constructor that will be used to create multipart form data
65
+ * requests. You can inject this here so that execution environments that
66
+ * do not support the FormData class can still run the generated client.
67
+ *
68
+ * @type {new () => FormData}
69
+ */
70
+ formDataCtor?: new () => any;
62
71
  constructor(param?: ConfigurationParameters);
72
+ /**
73
+ * Check if the given MIME is a JSON MIME.
74
+ * JSON MIME examples:
75
+ * application/json
76
+ * application/json; charset=UTF8
77
+ * APPLICATION/JSON
78
+ * application/vnd.company+json
79
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
80
+ * @return True if the given MIME is JSON, false otherwise.
81
+ */
82
+ isJsonMime(mime: string): boolean;
63
83
  }
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from "./api";
13
13
  export * from "./configuration";
14
+ export * from "./model";
@@ -20,119 +20,119 @@ export interface InlineObject {
20
20
  * @type {string}
21
21
  * @memberof InlineObject
22
22
  */
23
- id: string;
23
+ 'id': string;
24
24
  /**
25
25
  * Audit log event country code
26
26
  * @type {string}
27
27
  * @memberof InlineObject
28
28
  */
29
- countryCode?: string;
29
+ 'countryCode'?: string;
30
30
  /**
31
31
  * Audit log event payload
32
32
  * @type {object}
33
33
  * @memberof InlineObject
34
34
  */
35
- payload?: object;
35
+ 'payload'?: object;
36
36
  /**
37
37
  * id of the payfiter who performed the audit log action, if signed as.
38
38
  * @type {string}
39
39
  * @memberof InlineObject
40
40
  */
41
- internalId?: string;
41
+ 'internalId'?: string;
42
42
  /**
43
43
  * Tells whether the logged action has been made by the system
44
44
  * @type {boolean}
45
45
  * @memberof InlineObject
46
46
  */
47
- isSystem?: boolean;
47
+ 'isSystem'?: boolean;
48
48
  /**
49
49
  * Audit log event namespace (business related)
50
50
  * @type {string}
51
51
  * @memberof InlineObject
52
52
  */
53
- namespace: string;
53
+ 'namespace': string;
54
54
  /**
55
55
  * Audit log event namespace (technical related)
56
56
  * @type {string}
57
57
  * @memberof InlineObject
58
58
  */
59
- service: string;
59
+ 'service': string;
60
60
  /**
61
61
  * Audit log event type
62
62
  * @type {string}
63
63
  * @memberof InlineObject
64
64
  */
65
- event: string;
65
+ 'event': string;
66
66
  /**
67
67
  * Audit log target
68
68
  * @type {string}
69
69
  * @memberof InlineObject
70
70
  */
71
- target: string;
71
+ 'target': string;
72
72
  /**
73
73
  * Audit log event environment, only required when in todd context
74
74
  * @type {string}
75
75
  * @memberof InlineObject
76
76
  */
77
- environment?: string;
77
+ 'environment'?: string;
78
78
  /**
79
79
  * holdingId of the account performing the event
80
80
  * @type {string}
81
81
  * @memberof InlineObject
82
82
  */
83
- holdingId?: string;
83
+ 'holdingId'?: string;
84
84
  /**
85
85
  * companyId of the account performing the event
86
86
  * @type {string}
87
87
  * @memberof InlineObject
88
88
  */
89
- companyId?: string;
89
+ 'companyId'?: string;
90
90
  /**
91
91
  * employeeId of the account performing the event
92
92
  * @type {string}
93
93
  * @memberof InlineObject
94
94
  */
95
- employeeId?: string;
95
+ 'employeeId'?: string;
96
96
  /**
97
97
  * individualId of the account performing the event
98
98
  * @type {string}
99
99
  * @memberof InlineObject
100
100
  */
101
- individualId?: string;
101
+ 'individualId'?: string;
102
102
  /**
103
103
  * roleId of the account performing the event
104
104
  * @type {string}
105
105
  * @memberof InlineObject
106
106
  */
107
- roleId?: string;
107
+ 'roleId'?: string;
108
108
  /**
109
109
  * userIp of the account performing the event
110
110
  * @type {string}
111
111
  * @memberof InlineObject
112
112
  */
113
- userIp?: string;
113
+ 'userIp'?: string;
114
114
  /**
115
115
  * specialRole of the account performing the event
116
116
  * @type {string}
117
117
  * @memberof InlineObject
118
118
  */
119
- specialRole?: string;
119
+ 'specialRole'?: string;
120
120
  /**
121
121
  * email of the account performing the event
122
122
  * @type {string}
123
123
  * @memberof InlineObject
124
124
  */
125
- email?: string;
125
+ 'email'?: string;
126
126
  /**
127
127
  * Audit log event scope
128
128
  * @type {object}
129
129
  * @memberof InlineObject
130
130
  */
131
- scope?: object;
131
+ 'scope'?: object;
132
132
  /**
133
133
  * Audit log event timestamp unix format
134
134
  * @type {number}
135
135
  * @memberof InlineObject
136
136
  */
137
- timestamp: number;
137
+ 'timestamp': number;
138
138
  }
@@ -1,9 +1,8 @@
1
- import { DefaultApi } from './generated';
2
1
  import { InlineObject } from './generated/model';
3
2
  import { IAuditLogTransport } from './interface';
4
3
  export declare class Transport implements IAuditLogTransport {
5
4
  protected apiUrl: string;
6
- api: DefaultApi;
5
+ private api;
7
6
  constructor(apiUrl: string);
8
7
  create(auditLogData: InlineObject): Promise<void>;
9
8
  }
@@ -1,11 +1,11 @@
1
- export declare type IAuditLogCreationData = {
1
+ export interface IAuditLogCreationData {
2
2
  id: string;
3
3
  timestamp: number;
4
4
  environment: string;
5
5
  service: string;
6
- scope?: object;
6
+ scope?: Record<string, unknown>;
7
7
  countryCode?: string;
8
- payload?: object;
8
+ payload?: Record<string, unknown>;
9
9
  internalId?: string;
10
10
  isSystem?: boolean;
11
11
  namespace: string;
@@ -19,7 +19,7 @@ export declare type IAuditLogCreationData = {
19
19
  userIp?: string;
20
20
  specialRole?: string;
21
21
  email?: string;
22
- };
22
+ }
23
23
  export interface IAuditLogTransport {
24
24
  create: (data: IAuditLogCreationData) => Promise<void>;
25
25
  }