@kanda-libs/ks-component-ts 0.2.478 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-component-ts",
3
- "version": "0.2.478",
3
+ "version": "0.3.2",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,18 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const ActionState = t.union([
4
+ t.literal("action_not_needed"),
5
+ t.literal("action_required"),
6
+ t.literal("action_acknowledged"),
7
+ t.literal("action_taken"),
8
+ t.literal("action_to_follow_up"),
9
+ t.literal("action_resolved"),
10
+ ]);
11
+
12
+ export type ActionState =
13
+ | "action_not_needed"
14
+ | "action_required"
15
+ | "action_acknowledged"
16
+ | "action_taken"
17
+ | "action_to_follow_up"
18
+ | "action_resolved";
@@ -0,0 +1,21 @@
1
+ import * as t from "io-ts";
2
+ import { ActionState } from "./ActionState";
3
+ import { BaseId } from "./BaseId";
4
+ import { Entry } from "./Entry";
5
+
6
+ export const Audit = t.intersection([
7
+ BaseId,
8
+ t.type({
9
+ resources: t.array(t.string),
10
+ resource_id: t.string,
11
+ current_action_state: ActionState,
12
+ entries: t.array(Entry),
13
+ }),
14
+ ]);
15
+
16
+ export type Audit = BaseId & {
17
+ resources: Array<string>;
18
+ resource_id: string;
19
+ current_action_state: ActionState;
20
+ entries: Array<Entry>;
21
+ };
@@ -0,0 +1,18 @@
1
+ import * as t from "io-ts";
2
+ import { ActionState } from "./ActionState";
3
+
4
+ export const AuditInput = t.type({
5
+ assignee_email: t.string,
6
+ resource: t.string,
7
+ resource_id: t.string,
8
+ action_state: ActionState,
9
+ note: t.string,
10
+ });
11
+
12
+ export interface AuditInput {
13
+ assignee_email: string;
14
+ resource: string;
15
+ resource_id: string;
16
+ action_state: ActionState;
17
+ note: string;
18
+ }
@@ -0,0 +1,28 @@
1
+ import * as t from "io-ts";
2
+ import { Metadata } from "./Metadata";
3
+
4
+ export const BaseId = t.intersection([
5
+ t.type({
6
+ id: t.string,
7
+ metadata: Metadata,
8
+ }),
9
+ t.partial({
10
+ aid: t.string,
11
+ oid: t.string,
12
+ cid: t.string,
13
+ eid: t.string,
14
+ bid: t.string,
15
+ tid: t.string,
16
+ }),
17
+ ]);
18
+
19
+ export interface BaseId {
20
+ id: string;
21
+ aid?: string;
22
+ oid?: string;
23
+ cid?: string;
24
+ eid?: string;
25
+ bid?: string;
26
+ tid?: string;
27
+ metadata: Metadata;
28
+ }
@@ -0,0 +1,27 @@
1
+ import * as t from "io-ts";
2
+ import { DateFromISOString } from "io-ts-types";
3
+ import { ActionState } from "./ActionState";
4
+
5
+ export const Entry = t.type({
6
+ owner_name: t.string,
7
+ owner_email: t.string,
8
+ assignee_name: t.string,
9
+ assignee_email: t.string,
10
+ resource: t.string,
11
+ resource_id: t.string,
12
+ action_state: ActionState,
13
+ note: t.string,
14
+ timestamp: DateFromISOString,
15
+ });
16
+
17
+ export interface Entry {
18
+ owner_name: string;
19
+ owner_email: string;
20
+ assignee_name: string;
21
+ assignee_email: string;
22
+ resource: string;
23
+ resource_id: string;
24
+ action_state: ActionState;
25
+ note: string;
26
+ timestamp: Date;
27
+ }
@@ -3,9 +3,9 @@ import * as t from "io-ts";
3
3
  export const JobCreditState = t.intersection([
4
4
  t.type({
5
5
  id: t.string,
6
+ has_finance_application: t.boolean,
6
7
  }),
7
8
  t.partial({
8
- has_finance_application: t.boolean,
9
9
  current_status: t.union([
10
10
  t.literal("not_submitted"),
11
11
  t.literal("accepted_sign_document"),
@@ -26,7 +26,7 @@ export const JobCreditState = t.intersection([
26
26
 
27
27
  export interface JobCreditState {
28
28
  id: string;
29
- has_finance_application?: boolean;
29
+ has_finance_application: boolean;
30
30
  current_status?:
31
31
  | "not_submitted"
32
32
  | "accepted_sign_document"
@@ -1,12 +1,17 @@
1
1
  import * as t from "io-ts";
2
+ import { Audit } from "./Audit";
2
3
  import { Company } from "./Company";
3
4
  import { Credit } from "./Credit";
4
5
  import { Enterprise } from "./Enterprise";
5
6
  import { Introduction } from "./Introduction";
6
7
  import { Job } from "./Job";
8
+ import { Onboarding } from "./Onboarding";
7
9
  import { Transaction } from "./Transaction";
8
10
 
9
11
  export const SearchHits = t.type({
12
+ audit: t.array(Audit),
13
+ audit_hits: t.number,
14
+ audit_returned: t.number,
10
15
  company: t.array(Company),
11
16
  company_hits: t.number,
12
17
  company_returned: t.number,
@@ -22,12 +27,18 @@ export const SearchHits = t.type({
22
27
  job: t.array(Job),
23
28
  job_hits: t.number,
24
29
  job_returned: t.number,
30
+ onboarding: t.array(Onboarding),
31
+ onboarding_hits: t.number,
32
+ onboarding_returned: t.number,
25
33
  transaction: t.array(Transaction),
26
34
  transaction_hits: t.number,
27
35
  transaction_returned: t.number,
28
36
  });
29
37
 
30
38
  export interface SearchHits {
39
+ audit: Array<Audit>;
40
+ audit_hits: number;
41
+ audit_returned: number;
31
42
  company: Array<Company>;
32
43
  company_hits: number;
33
44
  company_returned: number;
@@ -43,6 +54,9 @@ export interface SearchHits {
43
54
  job: Array<Job>;
44
55
  job_hits: number;
45
56
  job_returned: number;
57
+ onboarding: Array<Onboarding>;
58
+ onboarding_hits: number;
59
+ onboarding_returned: number;
46
60
  transaction: Array<Transaction>;
47
61
  transaction_hits: number;
48
62
  transaction_returned: number;
@@ -1,18 +1,22 @@
1
1
  import * as t from "io-ts";
2
2
 
3
3
  export const SearchIndex = t.union([
4
+ t.literal("audit"),
4
5
  t.literal("company"),
5
6
  t.literal("credit"),
6
7
  t.literal("enterprise"),
7
8
  t.literal("introduction"),
8
9
  t.literal("job"),
10
+ t.literal("onboarding"),
9
11
  t.literal("transaction"),
10
12
  ]);
11
13
 
12
14
  export type SearchIndex =
15
+ | "audit"
13
16
  | "company"
14
17
  | "credit"
15
18
  | "enterprise"
16
19
  | "introduction"
17
20
  | "job"
21
+ | "onboarding"
18
22
  | "transaction";
@@ -1,12 +1,16 @@
1
+ export * from "./ActionState";
1
2
  export * from "./Address";
2
3
  export * from "./Analytics";
3
4
  export * from "./ApiEvent";
4
5
  export * from "./ApplicantDetails";
5
6
  export * from "./Approval";
6
7
  export * from "./Archived";
8
+ export * from "./Audit";
9
+ export * from "./AuditInput";
7
10
  export * from "./AuthUser";
8
11
  export * from "./BankAccount";
9
12
  export * from "./BankAccountType";
13
+ export * from "./BaseId";
10
14
  export * from "./Branding";
11
15
  export * from "./Budgets";
12
16
  export * from "./BusinessConfig";
@@ -37,6 +41,7 @@ export * from "./EmploymentDetails";
37
41
  export * from "./Enterprise";
38
42
  export * from "./EnterpriseUserRole";
39
43
  export * from "./EnterpriseUserType";
44
+ export * from "./Entry";
40
45
  export * from "./Error";
41
46
  export * from "./Event";
42
47
  export * from "./EventOptions";
@@ -0,0 +1,29 @@
1
+ import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type GetAuditRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const getAuditOperation = {
9
+ path: "/api/audit/{id}",
10
+ method: "get",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Audit },
13
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
14
+ },
15
+ parameters: [
16
+ {
17
+ _tag: "FormParameter",
18
+ explode: false,
19
+ in: "path",
20
+ name: "id",
21
+ },
22
+ ],
23
+ requestDefaultHeaders: { Accept: "application/json" },
24
+ } as const;
25
+
26
+ export type GetAuditRequestFunction = RequestFunction<
27
+ { params: GetAuditRequestParameters },
28
+ schemas.Audit
29
+ >;
@@ -0,0 +1,25 @@
1
+ import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as t from "io-ts";
3
+ import * as parameters from "../components/parameters";
4
+ import * as schemas from "../components/schemas";
5
+
6
+ export type GetAuditsRequestParameters = {
7
+ format?: "reduced" | "full";
8
+ q?: string;
9
+ };
10
+
11
+ export const getAuditsOperation = {
12
+ path: "/api/audit",
13
+ method: "get",
14
+ responses: {
15
+ "200": { _tag: "JsonResponse", decoder: t.array(schemas.Audit) },
16
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
17
+ },
18
+ parameters: [parameters.format, parameters.q],
19
+ requestDefaultHeaders: { Accept: "application/json" },
20
+ } as const;
21
+
22
+ export type GetAuditsRequestFunction = RequestFunction<
23
+ { params: GetAuditsRequestParameters },
24
+ Array<schemas.Audit>
25
+ >;
@@ -117,6 +117,8 @@ import {
117
117
  exportJobPayoutsOperation,
118
118
  ExportJobPayoutsRequestFunction,
119
119
  } from "./exportJobPayouts";
120
+ import { getAuditOperation, GetAuditRequestFunction } from "./getAudit";
121
+ import { getAuditsOperation, GetAuditsRequestFunction } from "./getAudits";
120
122
  import {
121
123
  getCompaniesOperation,
122
124
  GetCompaniesRequestFunction,
@@ -344,6 +346,7 @@ import {
344
346
  pendingSubscriptionOperation,
345
347
  PendingSubscriptionRequestFunction,
346
348
  } from "./pendingSubscription";
349
+ import { postAuditOperation, PostAuditRequestFunction } from "./postAudit";
347
350
  import {
348
351
  postCompanyOperation,
349
352
  PostCompanyRequestFunction,
@@ -735,6 +738,9 @@ export const operations: Operations = {
735
738
  getTransaction: getTransactionOperation,
736
739
  putTransaction: putTransactionOperation,
737
740
  deleteTransaction: deleteTransactionOperation,
741
+ getAudits: getAuditsOperation,
742
+ postAudit: postAuditOperation,
743
+ getAudit: getAuditOperation,
738
744
  providerCheckWebhook: providerCheckWebhookOperation,
739
745
  providerWebhook: providerWebhookOperation,
740
746
  actionAdhoc: actionAdhocOperation,
@@ -920,6 +926,9 @@ export interface OperationRequestFunctionMap {
920
926
  getTransaction: GetTransactionRequestFunction;
921
927
  putTransaction: PutTransactionRequestFunction;
922
928
  deleteTransaction: DeleteTransactionRequestFunction;
929
+ getAudits: GetAuditsRequestFunction;
930
+ postAudit: PostAuditRequestFunction;
931
+ getAudit: GetAuditRequestFunction;
923
932
  providerCheckWebhook: ProviderCheckWebhookRequestFunction;
924
933
  providerWebhook: ProviderWebhookRequestFunction;
925
934
  actionAdhoc: ActionAdhocRequestFunction;
@@ -1368,6 +1377,9 @@ export const requestFunctionsBuilder = (
1368
1377
  operations.deleteTransaction,
1369
1378
  requestAdapter
1370
1379
  ),
1380
+ getAudits: requestFunctionBuilder(operations.getAudits, requestAdapter),
1381
+ postAudit: requestFunctionBuilder(operations.postAudit, requestAdapter),
1382
+ getAudit: requestFunctionBuilder(operations.getAudit, requestAdapter),
1371
1383
  providerCheckWebhook: requestFunctionBuilder(
1372
1384
  operations.providerCheckWebhook,
1373
1385
  requestAdapter
@@ -1749,6 +1761,14 @@ export const transactionServiceBuilder = (
1749
1761
  deleteTransaction: requestFunctions.deleteTransaction,
1750
1762
  });
1751
1763
 
1764
+ export const auditServiceBuilder = (
1765
+ requestFunctions: OperationRequestFunctionMap
1766
+ ) => ({
1767
+ getAudits: requestFunctions.getAudits,
1768
+ postAudit: requestFunctions.postAudit,
1769
+ getAudit: requestFunctions.getAudit,
1770
+ });
1771
+
1752
1772
  export const webhookServiceBuilder = (
1753
1773
  requestFunctions: OperationRequestFunctionMap
1754
1774
  ) => ({
@@ -1952,6 +1972,9 @@ export interface Operations {
1952
1972
  getTransaction: typeof getTransactionOperation;
1953
1973
  putTransaction: typeof putTransactionOperation;
1954
1974
  deleteTransaction: typeof deleteTransactionOperation;
1975
+ getAudits: typeof getAuditsOperation;
1976
+ postAudit: typeof postAuditOperation;
1977
+ getAudit: typeof getAuditOperation;
1955
1978
  providerCheckWebhook: typeof providerCheckWebhookOperation;
1956
1979
  providerWebhook: typeof providerWebhookOperation;
1957
1980
  actionAdhoc: typeof actionAdhocOperation;
@@ -0,0 +1,24 @@
1
+ import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export const postAuditOperation = {
5
+ path: "/api/audit",
6
+ method: "post",
7
+ responses: {
8
+ "200": { _tag: "JsonResponse", decoder: schemas.Audit },
9
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
10
+ },
11
+ parameters: [],
12
+ requestDefaultHeaders: {
13
+ "Content-Type": "application/json",
14
+ Accept: "application/json",
15
+ },
16
+ body: {
17
+ _tag: "JsonBody",
18
+ },
19
+ } as const;
20
+
21
+ export type PostAuditRequestFunction = RequestFunction<
22
+ { body: schemas.AuditInput },
23
+ schemas.Audit
24
+ >;
@@ -19,6 +19,7 @@ export type RunnerRequestParameters = {
19
19
  | "housekeeping_check_lender_rate"
20
20
  | "housekeeping_check_lender_update"
21
21
  | "housekeeping_check_trade_summary"
22
+ | "housekeeping_check_audit_action"
22
23
  | "housekeeping_run_propensio_payouts";
23
24
  };
24
25