@kanda-libs/ks-component-ts 0.2.357 → 0.2.359

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.357",
3
+ "version": "0.2.359",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,19 +1,25 @@
1
1
  import * as t from "io-ts";
2
+ import { Result } from "./Result";
2
3
 
3
- export const Category = t.type({
4
- section: t.union([
5
- t.literal("what_is_an_iar_and_what_can_it_do"),
6
- t.literal("advertising_finance"),
7
- t.literal("treating_customers_fairly"),
8
- t.literal("howdens__the_basics_of_offering_finance"),
9
- t.literal("howdens__what_is_an_ar_and_what_can_it_do"),
10
- t.literal("howdens__senior_management_responsibilities"),
11
- t.literal("howdens__advertising_finance"),
12
- t.literal("howdens__fighting_financial_crime"),
13
- t.literal("howdens__treating_customers_fairly"),
14
- ]),
15
- number_of_quizzes: t.number,
16
- });
4
+ export const Category = t.intersection([
5
+ t.type({
6
+ section: t.union([
7
+ t.literal("what_is_an_iar_and_what_can_it_do"),
8
+ t.literal("advertising_finance"),
9
+ t.literal("treating_customers_fairly"),
10
+ t.literal("howdens__the_basics_of_offering_finance"),
11
+ t.literal("howdens__what_is_an_ar_and_what_can_it_do"),
12
+ t.literal("howdens__senior_management_responsibilities"),
13
+ t.literal("howdens__advertising_finance"),
14
+ t.literal("howdens__fighting_financial_crime"),
15
+ t.literal("howdens__treating_customers_fairly"),
16
+ ]),
17
+ number_of_quizzes: t.number,
18
+ }),
19
+ t.partial({
20
+ result: Result,
21
+ }),
22
+ ]);
17
23
 
18
24
  export interface Category {
19
25
  section:
@@ -27,4 +33,5 @@ export interface Category {
27
33
  | "howdens__fighting_financial_crime"
28
34
  | "howdens__treating_customers_fairly";
29
35
  number_of_quizzes: number;
36
+ result?: Result;
30
37
  }
@@ -2,11 +2,13 @@ import * as t from "io-ts";
2
2
 
3
3
  export const CheckoutOption = t.union([
4
4
  t.literal("apply_for_finance"),
5
+ t.literal("pay_on_card"),
5
6
  t.literal("decline_job"),
6
7
  t.literal("pay_on_completion"),
7
8
  ]);
8
9
 
9
10
  export type CheckoutOption =
10
11
  | "apply_for_finance"
12
+ | "pay_on_card"
11
13
  | "decline_job"
12
14
  | "pay_on_completion";
@@ -0,0 +1,19 @@
1
+ import * as t from "io-ts";
2
+ import { ContactInfo } from "./ContactInfo";
3
+ import { FlowType } from "./FlowType";
4
+
5
+ export const InfoLead = t.intersection([
6
+ t.type({
7
+ contact_info: ContactInfo,
8
+ }),
9
+ t.partial({
10
+ id: t.string,
11
+ flow_type: FlowType,
12
+ }),
13
+ ]);
14
+
15
+ export interface InfoLead {
16
+ id?: string;
17
+ flow_type?: FlowType;
18
+ contact_info: ContactInfo;
19
+ }
@@ -0,0 +1,20 @@
1
+ import * as t from "io-ts";
2
+ import { Pence } from "./Pence";
3
+
4
+ export const InfoStats = t.partial({
5
+ id: t.string,
6
+ jobs_sent: t.number,
7
+ jobs_applied_for_finance: t.number,
8
+ jobs_approved_for_finance: t.number,
9
+ jobs_total_revenue_of_approved: Pence,
10
+ jobs_average_value_of_approved: Pence,
11
+ });
12
+
13
+ export interface InfoStats {
14
+ id?: string;
15
+ jobs_sent?: number;
16
+ jobs_applied_for_finance?: number;
17
+ jobs_approved_for_finance?: number;
18
+ jobs_total_revenue_of_approved?: Pence;
19
+ jobs_average_value_of_approved?: Pence;
20
+ }
@@ -1,4 +1,6 @@
1
1
  import * as t from "io-ts";
2
+ import { ApplicantDetails } from "./ApplicantDetails";
3
+ import { BankAccount } from "./BankAccount";
2
4
  import { CustomerDetails } from "./CustomerDetails";
3
5
  import { EmploymentDetails } from "./EmploymentDetails";
4
6
  import { FinanceDetails } from "./FinanceDetails";
@@ -12,12 +14,18 @@ export const LeadApplicant = t.intersection([
12
14
  }),
13
15
  t.partial({
14
16
  budget: Money,
17
+ bank_account: BankAccount,
18
+ additional_employment_details: t.array(EmploymentDetails),
19
+ extra_applicants: t.array(ApplicantDetails),
15
20
  }),
16
21
  ]);
17
22
 
18
23
  export interface LeadApplicant {
24
+ budget?: Money;
25
+ bank_account?: BankAccount;
19
26
  customer_details: CustomerDetails;
20
27
  employment_details: EmploymentDetails;
28
+ additional_employment_details?: Array<EmploymentDetails>;
21
29
  finance_details: FinanceDetails;
22
- budget?: Money;
30
+ extra_applicants?: Array<ApplicantDetails>;
23
31
  }
@@ -0,0 +1,10 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const Result = t.union([
4
+ t.literal("MISSING"),
5
+ t.literal("PASSED"),
6
+ t.literal("FAILED"),
7
+ t.literal("VOIDED"),
8
+ ]);
9
+
10
+ export type Result = "MISSING" | "PASSED" | "FAILED" | "VOIDED";
@@ -2,6 +2,7 @@ import * as t from "io-ts";
2
2
  import { Category } from "./Category";
3
3
  import { Metadata } from "./Metadata";
4
4
  import { Quiz } from "./Quiz";
5
+ import { Result } from "./Result";
5
6
 
6
7
  export const Training = t.intersection([
7
8
  t.type({
@@ -15,12 +16,7 @@ export const Training = t.intersection([
15
16
  aid: t.string,
16
17
  oid: t.string,
17
18
  quizzes: t.array(Quiz),
18
- result: t.union([
19
- t.literal("MISSING"),
20
- t.literal("PASSED"),
21
- t.literal("FAILED"),
22
- t.literal("VOIDED"),
23
- ]),
19
+ result: Result,
24
20
  metadata: Metadata,
25
21
  }),
26
22
  ]);
@@ -34,6 +30,6 @@ export interface Training {
34
30
  oid?: string;
35
31
  categories: Array<Category>;
36
32
  quizzes?: Array<Quiz>;
37
- result?: "MISSING" | "PASSED" | "FAILED" | "VOIDED";
33
+ result?: Result;
38
34
  metadata?: Metadata;
39
35
  }
@@ -50,12 +50,14 @@ export * from "./InfoCompany";
50
50
  export * from "./InfoEntity";
51
51
  export * from "./InfoGhost";
52
52
  export * from "./InfoIP";
53
+ export * from "./InfoLead";
53
54
  export * from "./InfoLegacyRedirect";
54
55
  export * from "./InfoMe";
55
56
  export * from "./InfoOnboarding";
56
57
  export * from "./InfoPartnerBranding";
57
58
  export * from "./InfoQuery";
58
59
  export * from "./InfoSession";
60
+ export * from "./InfoStats";
59
61
  export * from "./InfoTrade";
60
62
  export * from "./InfoValidationEmail";
61
63
  export * from "./Job";
@@ -89,6 +91,7 @@ export * from "./Quiz";
89
91
  export * from "./Rate";
90
92
  export * from "./RedirectURLs";
91
93
  export * from "./Referral";
94
+ export * from "./Result";
92
95
  export * from "./RetiredDetails";
93
96
  export * from "./Reward";
94
97
  export * from "./SatNote";
@@ -241,6 +241,7 @@ import {
241
241
  infoSessionOperation,
242
242
  InfoSessionRequestFunction,
243
243
  } from "./infoSession";
244
+ import { infoStatsOperation, InfoStatsRequestFunction } from "./infoStats";
244
245
  import {
245
246
  infoTradeSummaryOperation,
246
247
  InfoTradeSummaryRequestFunction,
@@ -455,6 +456,7 @@ export const operations: Operations = {
455
456
  infoEnterprise: infoEnterpriseOperation,
456
457
  infoEnterpriseRole: infoEnterpriseRoleOperation,
457
458
  infoLead: infoLeadOperation,
459
+ infoStats: infoStatsOperation,
458
460
  getPartners: getPartnersOperation,
459
461
  postPartner: postPartnerOperation,
460
462
  getPartner: getPartnerOperation,
@@ -605,6 +607,7 @@ export interface OperationRequestFunctionMap {
605
607
  infoEnterprise: InfoEnterpriseRequestFunction;
606
608
  infoEnterpriseRole: InfoEnterpriseRoleRequestFunction;
607
609
  infoLead: InfoLeadRequestFunction;
610
+ infoStats: InfoStatsRequestFunction;
608
611
  getPartners: GetPartnersRequestFunction;
609
612
  postPartner: PostPartnerRequestFunction;
610
613
  getPartner: GetPartnerRequestFunction;
@@ -793,6 +796,7 @@ export const requestFunctionsBuilder = (
793
796
  requestAdapter
794
797
  ),
795
798
  infoLead: requestFunctionBuilder(operations.infoLead, requestAdapter),
799
+ infoStats: requestFunctionBuilder(operations.infoStats, requestAdapter),
796
800
  getPartners: requestFunctionBuilder(operations.getPartners, requestAdapter),
797
801
  postPartner: requestFunctionBuilder(operations.postPartner, requestAdapter),
798
802
  getPartner: requestFunctionBuilder(operations.getPartner, requestAdapter),
@@ -1218,13 +1222,24 @@ export const infoEnterpriseServiceBuilder = (
1218
1222
  infoEnterprise: requestFunctions.infoEnterprise,
1219
1223
  });
1220
1224
 
1221
- export const infoLeadServiceBuilder = (
1225
+ export const infoEnterpriseRoleServiceBuilder = (
1222
1226
  requestFunctions: OperationRequestFunctionMap
1223
1227
  ) => ({
1224
1228
  infoEnterpriseRole: requestFunctions.infoEnterpriseRole,
1229
+ });
1230
+
1231
+ export const infoLeadServiceBuilder = (
1232
+ requestFunctions: OperationRequestFunctionMap
1233
+ ) => ({
1225
1234
  infoLead: requestFunctions.infoLead,
1226
1235
  });
1227
1236
 
1237
+ export const infoStatsServiceBuilder = (
1238
+ requestFunctions: OperationRequestFunctionMap
1239
+ ) => ({
1240
+ infoStats: requestFunctions.infoStats,
1241
+ });
1242
+
1228
1243
  export const partnerServiceBuilder = (
1229
1244
  requestFunctions: OperationRequestFunctionMap
1230
1245
  ) => ({
@@ -1403,6 +1418,7 @@ export interface Operations {
1403
1418
  infoEnterprise: typeof infoEnterpriseOperation;
1404
1419
  infoEnterpriseRole: typeof infoEnterpriseRoleOperation;
1405
1420
  infoLead: typeof infoLeadOperation;
1421
+ infoStats: typeof infoStatsOperation;
1406
1422
  getPartners: typeof getPartnersOperation;
1407
1423
  postPartner: typeof postPartnerOperation;
1408
1424
  getPartner: typeof getPartnerOperation;
@@ -12,7 +12,7 @@ export const infoLeadOperation = {
12
12
  path: "/api/info/lead",
13
13
  method: "put",
14
14
  responses: {
15
- "200": { _tag: "JsonResponse", decoder: schemas.ContactInfo },
15
+ "200": { _tag: "JsonResponse", decoder: schemas.InfoLead },
16
16
  default: { _tag: "JsonResponse", decoder: schemas.Error },
17
17
  },
18
18
  parameters: [
@@ -51,6 +51,6 @@ export const infoLeadOperation = {
51
51
  } as const;
52
52
 
53
53
  export type InfoLeadRequestFunction = RequestFunction<
54
- { params: InfoLeadRequestParameters; body: schemas.ContactInfo },
55
- schemas.ContactInfo
54
+ { params: InfoLeadRequestParameters; body: schemas.InfoLead },
55
+ schemas.InfoLead
56
56
  >;
@@ -0,0 +1,24 @@
1
+ import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as parameters from "../components/parameters";
3
+ import * as schemas from "../components/schemas";
4
+
5
+ export type InfoStatsRequestParameters = {
6
+ format?: "reduced" | "full";
7
+ q?: string;
8
+ };
9
+
10
+ export const infoStatsOperation = {
11
+ path: "/api/info/stats",
12
+ method: "get",
13
+ responses: {
14
+ "200": { _tag: "JsonResponse", decoder: schemas.InfoStats },
15
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
16
+ },
17
+ parameters: [parameters.format, parameters.q],
18
+ requestDefaultHeaders: { Accept: "application/json" },
19
+ } as const;
20
+
21
+ export type InfoStatsRequestFunction = RequestFunction<
22
+ { params: InfoStatsRequestParameters },
23
+ schemas.InfoStats
24
+ >;