@kanda-libs/ks-component-ts 0.3.47 → 0.3.49

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.3.47",
3
+ "version": "0.3.49",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,14 @@
1
+ import * as t from "io-ts";
2
+ import { BaseId } from "./BaseId";
3
+ import { RateRequest } from "./RateRequest";
4
+
5
+ export const Enrolment = t.intersection([
6
+ BaseId,
7
+ t.type({
8
+ rate_request: RateRequest,
9
+ }),
10
+ ]);
11
+
12
+ export type Enrolment = BaseId & {
13
+ rate_request: RateRequest;
14
+ };
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const RateKeys = t.array(t.string);
4
+
5
+ export type RateKeys = Array<string>;
@@ -0,0 +1,25 @@
1
+ import * as t from "io-ts";
2
+ import { Metadata } from "./Metadata";
3
+ import { RateKeys } from "./RateKeys";
4
+
5
+ export const RateRequest = t.intersection([
6
+ t.type({
7
+ requester: t.string,
8
+ to_add: RateKeys,
9
+ to_remove: RateKeys,
10
+ added: RateKeys,
11
+ removed: RateKeys,
12
+ }),
13
+ t.partial({
14
+ metadata: Metadata,
15
+ }),
16
+ ]);
17
+
18
+ export interface RateRequest {
19
+ requester: string;
20
+ to_add: RateKeys;
21
+ to_remove: RateKeys;
22
+ added: RateKeys;
23
+ removed: RateKeys;
24
+ metadata?: Metadata;
25
+ }
@@ -2,10 +2,12 @@ import * as t from "io-ts";
2
2
 
3
3
  export const WorkType = t.union([
4
4
  t.literal("air_conditioning"),
5
+ t.literal("air_source_heat_pumps"),
5
6
  t.literal("alarm_systems"),
6
7
  t.literal("artificial_grass"),
7
8
  t.literal("bathrooms_supply_and_fitted"),
8
9
  t.literal("bathrooms_supply_only"),
10
+ t.literal("battery_storage"),
9
11
  t.literal("bedrooms_furnitue_custom"),
10
12
  t.literal("blinds_awnings_shutters"),
11
13
  t.literal("boiler_swap"),
@@ -16,6 +18,7 @@ export const WorkType = t.union([
16
18
  t.literal("conservatory_roof"),
17
19
  t.literal("decking"),
18
20
  t.literal("door_canopy"),
21
+ t.literal("door_internal"),
19
22
  t.literal("doors"),
20
23
  t.literal("driveways"),
21
24
  t.literal("electrical_installation"),
@@ -29,6 +32,7 @@ export const WorkType = t.union([
29
32
  t.literal("gates"),
30
33
  t.literal("glass_splash_backs"),
31
34
  t.literal("granite_worktops"),
35
+ t.literal("ground_source_heat_pumps"),
32
36
  t.literal("home_lifts"),
33
37
  t.literal("home_study"),
34
38
  t.literal("hot_tubs_and_spas"),
@@ -39,15 +43,18 @@ export const WorkType = t.union([
39
43
  t.literal("loft_boarding"),
40
44
  t.literal("loft_conversion"),
41
45
  t.literal("media_walls"),
46
+ t.literal("other"),
42
47
  t.literal("painting_and_decorating"),
43
48
  t.literal("patios"),
44
49
  t.literal("plastering"),
50
+ t.literal("porch"),
45
51
  t.literal("rendering"),
46
52
  t.literal("resin_driveways"),
47
53
  t.literal("roofing"),
48
54
  t.literal("roofing_excl_flat_roofs"),
49
55
  t.literal("roofline"),
50
56
  t.literal("security_lighting"),
57
+ t.literal("solar_pv_panels"),
51
58
  t.literal("stair_lifts"),
52
59
  t.literal("staircases"),
53
60
  t.literal("tiling"),
@@ -56,19 +63,53 @@ export const WorkType = t.union([
56
63
  t.literal("upvc_doors"),
57
64
  t.literal("verandas"),
58
65
  t.literal("wall_insulation_and_cladding"),
66
+ t.literal("wardrobes"),
59
67
  t.literal("water_softeners"),
60
68
  t.literal("windows"),
61
69
  t.literal("windows_and_doors"),
62
- t.literal("wardrobes"),
63
- t.literal("other"),
70
+ t.literal("aesthetics"),
71
+ t.literal("appliances"),
72
+ t.literal("car_body_shop"),
73
+ t.literal("car_detailing_and_alloys"),
74
+ t.literal("catering"),
75
+ t.literal("computer_builder"),
76
+ t.literal("dental"),
77
+ t.literal("electronics"),
78
+ t.literal("entertainers"),
79
+ t.literal("events"),
80
+ t.literal("experiences"),
81
+ t.literal("flowers"),
82
+ t.literal("full_events_package"),
83
+ t.literal("furniture"),
84
+ t.literal("graphic_designer"),
85
+ t.literal("high_end_clothing"),
86
+ t.literal("home_removals"),
87
+ t.literal("jewllery"),
88
+ t.literal("medical_assessments"),
89
+ t.literal("memberships"),
90
+ t.literal("mobillity_and_mobility_scooters"),
91
+ t.literal("network_engineer"),
92
+ t.literal("number_plates"),
93
+ t.literal("personal_security"),
94
+ t.literal("photography"),
95
+ t.literal("planners"),
96
+ t.literal("sports equipment"),
97
+ t.literal("technology_repair"),
98
+ t.literal("tool sales"),
99
+ t.literal("tyres"),
100
+ t.literal("vehicle_wrapping"),
101
+ t.literal("venues"),
102
+ t.literal("website_builder"),
64
103
  ]);
65
104
 
66
105
  export type WorkType =
67
106
  | "air_conditioning"
107
+ | "air_source_heat_pumps"
68
108
  | "alarm_systems"
69
109
  | "artificial_grass"
70
110
  | "bathrooms_supply_and_fitted"
71
111
  | "bathrooms_supply_only"
112
+ | "battery_storage"
72
113
  | "bedrooms_furnitue_custom"
73
114
  | "blinds_awnings_shutters"
74
115
  | "boiler_swap"
@@ -79,6 +120,7 @@ export type WorkType =
79
120
  | "conservatory_roof"
80
121
  | "decking"
81
122
  | "door_canopy"
123
+ | "door_internal"
82
124
  | "doors"
83
125
  | "driveways"
84
126
  | "electrical_installation"
@@ -92,6 +134,7 @@ export type WorkType =
92
134
  | "gates"
93
135
  | "glass_splash_backs"
94
136
  | "granite_worktops"
137
+ | "ground_source_heat_pumps"
95
138
  | "home_lifts"
96
139
  | "home_study"
97
140
  | "hot_tubs_and_spas"
@@ -102,15 +145,18 @@ export type WorkType =
102
145
  | "loft_boarding"
103
146
  | "loft_conversion"
104
147
  | "media_walls"
148
+ | "other"
105
149
  | "painting_and_decorating"
106
150
  | "patios"
107
151
  | "plastering"
152
+ | "porch"
108
153
  | "rendering"
109
154
  | "resin_driveways"
110
155
  | "roofing"
111
156
  | "roofing_excl_flat_roofs"
112
157
  | "roofline"
113
158
  | "security_lighting"
159
+ | "solar_pv_panels"
114
160
  | "stair_lifts"
115
161
  | "staircases"
116
162
  | "tiling"
@@ -119,8 +165,40 @@ export type WorkType =
119
165
  | "upvc_doors"
120
166
  | "verandas"
121
167
  | "wall_insulation_and_cladding"
168
+ | "wardrobes"
122
169
  | "water_softeners"
123
170
  | "windows"
124
171
  | "windows_and_doors"
125
- | "wardrobes"
126
- | "other";
172
+ | "aesthetics"
173
+ | "appliances"
174
+ | "car_body_shop"
175
+ | "car_detailing_and_alloys"
176
+ | "catering"
177
+ | "computer_builder"
178
+ | "dental"
179
+ | "electronics"
180
+ | "entertainers"
181
+ | "events"
182
+ | "experiences"
183
+ | "flowers"
184
+ | "full_events_package"
185
+ | "furniture"
186
+ | "graphic_designer"
187
+ | "high_end_clothing"
188
+ | "home_removals"
189
+ | "jewllery"
190
+ | "medical_assessments"
191
+ | "memberships"
192
+ | "mobillity_and_mobility_scooters"
193
+ | "network_engineer"
194
+ | "number_plates"
195
+ | "personal_security"
196
+ | "photography"
197
+ | "planners"
198
+ | "sports equipment"
199
+ | "technology_repair"
200
+ | "tool sales"
201
+ | "tyres"
202
+ | "vehicle_wrapping"
203
+ | "venues"
204
+ | "website_builder";
@@ -42,6 +42,7 @@ export * from "./DirectorVerification";
42
42
  export * from "./Document";
43
43
  export * from "./EmployedDetails";
44
44
  export * from "./EmploymentDetails";
45
+ export * from "./Enrolment";
45
46
  export * from "./Enterprise";
46
47
  export * from "./EnterpriseUserRole";
47
48
  export * from "./EnterpriseUserType";
@@ -120,6 +121,8 @@ export * from "./PreferenceOption";
120
121
  export * from "./PurchaseEvent";
121
122
  export * from "./Quiz";
122
123
  export * from "./Rate";
124
+ export * from "./RateKeys";
125
+ export * from "./RateRequest";
123
126
  export * from "./RedirectURLs";
124
127
  export * from "./Referral";
125
128
  export * from "./Result";
@@ -0,0 +1,29 @@
1
+ import type { RequestFunction } from "@kanda-libs/openapi-io-ts-runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type GetEnrolmentRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const getEnrolmentOperation = {
9
+ path: "/api/enrolment/{id}",
10
+ method: "get",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Enrolment },
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 GetEnrolmentRequestFunction = RequestFunction<
27
+ { params: GetEnrolmentRequestParameters },
28
+ schemas.Enrolment
29
+ >;
@@ -150,6 +150,10 @@ import {
150
150
  getDocumentsOperation,
151
151
  GetDocumentsRequestFunction,
152
152
  } from "./getDocuments";
153
+ import {
154
+ getEnrolmentOperation,
155
+ GetEnrolmentRequestFunction,
156
+ } from "./getEnrolment";
153
157
  import {
154
158
  getEnterpriseOperation,
155
159
  GetEnterpriseRequestFunction,
@@ -515,6 +519,10 @@ import {
515
519
  putDocumentOperation,
516
520
  PutDocumentRequestFunction,
517
521
  } from "./putDocument";
522
+ import {
523
+ putEnrolmentOperation,
524
+ PutEnrolmentRequestFunction,
525
+ } from "./putEnrolment";
518
526
  import {
519
527
  putEnterpriseOperation,
520
528
  PutEnterpriseRequestFunction,
@@ -777,6 +785,8 @@ export const operations: Operations = {
777
785
  getAudits: getAuditsOperation,
778
786
  postAudit: postAuditOperation,
779
787
  getAudit: getAuditOperation,
788
+ getEnrolment: getEnrolmentOperation,
789
+ putEnrolment: putEnrolmentOperation,
780
790
  providerCheckWebhook: providerCheckWebhookOperation,
781
791
  providerWebhook: providerWebhookOperation,
782
792
  actionAdhoc: actionAdhocOperation,
@@ -972,6 +982,8 @@ export interface OperationRequestFunctionMap {
972
982
  getAudits: GetAuditsRequestFunction;
973
983
  postAudit: PostAuditRequestFunction;
974
984
  getAudit: GetAuditRequestFunction;
985
+ getEnrolment: GetEnrolmentRequestFunction;
986
+ putEnrolment: PutEnrolmentRequestFunction;
975
987
  providerCheckWebhook: ProviderCheckWebhookRequestFunction;
976
988
  providerWebhook: ProviderWebhookRequestFunction;
977
989
  actionAdhoc: ActionAdhocRequestFunction;
@@ -1445,6 +1457,8 @@ export const requestFunctionsBuilder = (
1445
1457
  getAudits: requestFunctionBuilder(operations.getAudits, requestAdapter),
1446
1458
  postAudit: requestFunctionBuilder(operations.postAudit, requestAdapter),
1447
1459
  getAudit: requestFunctionBuilder(operations.getAudit, requestAdapter),
1460
+ getEnrolment: requestFunctionBuilder(operations.getEnrolment, requestAdapter),
1461
+ putEnrolment: requestFunctionBuilder(operations.putEnrolment, requestAdapter),
1448
1462
  providerCheckWebhook: requestFunctionBuilder(
1449
1463
  operations.providerCheckWebhook,
1450
1464
  requestAdapter
@@ -1858,6 +1872,13 @@ export const auditServiceBuilder = (
1858
1872
  getAudit: requestFunctions.getAudit,
1859
1873
  });
1860
1874
 
1875
+ export const enrolmentServiceBuilder = (
1876
+ requestFunctions: OperationRequestFunctionMap
1877
+ ) => ({
1878
+ getEnrolment: requestFunctions.getEnrolment,
1879
+ putEnrolment: requestFunctions.putEnrolment,
1880
+ });
1881
+
1861
1882
  export const webhookServiceBuilder = (
1862
1883
  requestFunctions: OperationRequestFunctionMap
1863
1884
  ) => ({
@@ -2071,6 +2092,8 @@ export interface Operations {
2071
2092
  getAudits: typeof getAuditsOperation;
2072
2093
  postAudit: typeof postAuditOperation;
2073
2094
  getAudit: typeof getAuditOperation;
2095
+ getEnrolment: typeof getEnrolmentOperation;
2096
+ putEnrolment: typeof putEnrolmentOperation;
2074
2097
  providerCheckWebhook: typeof providerCheckWebhookOperation;
2075
2098
  providerWebhook: typeof providerWebhookOperation;
2076
2099
  actionAdhoc: typeof actionAdhocOperation;
@@ -0,0 +1,35 @@
1
+ import type { RequestFunction } from "@kanda-libs/openapi-io-ts-runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type PutEnrolmentRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const putEnrolmentOperation = {
9
+ path: "/api/enrolment/{id}",
10
+ method: "put",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Enrolment },
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: {
24
+ "Content-Type": "application/json",
25
+ Accept: "application/json",
26
+ },
27
+ body: {
28
+ _tag: "JsonBody",
29
+ },
30
+ } as const;
31
+
32
+ export type PutEnrolmentRequestFunction = RequestFunction<
33
+ { params: PutEnrolmentRequestParameters; body: schemas.Enrolment },
34
+ schemas.Enrolment
35
+ >;