@kanda-libs/ks-component-ts 0.2.395 → 0.2.396

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.
@@ -1,13 +0,0 @@
1
- import * as t from "io-ts";
2
- import { Money } from "./Money";
3
- import { Pence } from "./Pence";
4
-
5
- export const ChargeItem = t.type({
6
- quantity: Pence,
7
- price: Money,
8
- });
9
-
10
- export interface ChargeItem {
11
- quantity: Pence;
12
- price: Money;
13
- }
@@ -1,16 +0,0 @@
1
- import * as t from "io-ts";
2
- import { Money } from "./Money";
3
-
4
- export const DownPayment = t.intersection([
5
- t.type({
6
- amount: Money,
7
- }),
8
- t.partial({
9
- settled: t.union([t.literal("yes"), t.literal("no")]),
10
- }),
11
- ]);
12
-
13
- export interface DownPayment {
14
- amount: Money;
15
- settled?: "yes" | "no";
16
- }
@@ -1,48 +0,0 @@
1
- import * as t from "io-ts";
2
- import { ChargeItem } from "./ChargeItem";
3
- import { Pence } from "./Pence";
4
-
5
- export const EVChargerConfig = t.intersection([
6
- t.type({
7
- id: t.string,
8
- charger: t.string,
9
- charger_base_price: ChargeItem,
10
- for_solar: t.union([t.literal("yes"), t.literal("no")]),
11
- for_off_street_parking: t.union([t.literal("yes"), t.literal("no")]),
12
- colour: t.string,
13
- cable_type: t.union([
14
- t.literal("none"),
15
- t.literal("type_1"),
16
- t.literal("type_2"),
17
- ]),
18
- fusebox_distance: t.union([
19
- t.literal("0_to_5m"),
20
- t.literal("6_to_15m"),
21
- t.literal("16_to_25m"),
22
- t.literal("over_25m"),
23
- ]),
24
- }),
25
- t.partial({
26
- colour_surcharge: ChargeItem,
27
- cable_type_surcharge: ChargeItem,
28
- cable_length: Pence,
29
- cable_length_surcharge: ChargeItem,
30
- fusebox_distance_surcharge: ChargeItem,
31
- }),
32
- ]);
33
-
34
- export interface EVChargerConfig {
35
- id: string;
36
- charger: string;
37
- charger_base_price: ChargeItem;
38
- for_solar: "yes" | "no";
39
- for_off_street_parking: "yes" | "no";
40
- colour: string;
41
- colour_surcharge?: ChargeItem;
42
- cable_type: "none" | "type_1" | "type_2";
43
- cable_type_surcharge?: ChargeItem;
44
- cable_length?: Pence;
45
- cable_length_surcharge?: ChargeItem;
46
- fusebox_distance: "0_to_5m" | "6_to_15m" | "16_to_25m" | "over_25m";
47
- fusebox_distance_surcharge?: ChargeItem;
48
- }
@@ -1,48 +0,0 @@
1
- import * as t from "io-ts";
2
- import { Customer } from "./Customer";
3
- import { DownPayment } from "./DownPayment";
4
- import { EVChargerConfig } from "./EVChargerConfig";
5
- import { Metadata } from "./Metadata";
6
- import { MoneyTotal } from "./MoneyTotal";
7
- import { Pence } from "./Pence";
8
- import { RedirectURLs } from "./RedirectURLs";
9
-
10
- export const Installation = t.intersection([
11
- t.type({
12
- customer: Customer,
13
- configuration: EVChargerConfig,
14
- preferred_date: t.string,
15
- preferred_slot: t.string,
16
- vat: Pence,
17
- }),
18
- t.partial({
19
- id: t.string,
20
- cid: t.string,
21
- oid: t.string,
22
- aid: t.string,
23
- down_payment: DownPayment,
24
- total: MoneyTotal,
25
- redirect_urls: RedirectURLs,
26
- xid: t.string,
27
- xref: t.string,
28
- metadata: Metadata,
29
- }),
30
- ]);
31
-
32
- export interface Installation {
33
- id?: string;
34
- cid?: string;
35
- oid?: string;
36
- aid?: string;
37
- customer: Customer;
38
- configuration: EVChargerConfig;
39
- preferred_date: string;
40
- preferred_slot: string;
41
- down_payment?: DownPayment;
42
- vat: Pence;
43
- total?: MoneyTotal;
44
- redirect_urls?: RedirectURLs;
45
- xid?: string;
46
- xref?: string;
47
- metadata?: Metadata;
48
- }
@@ -1,38 +0,0 @@
1
- import type { RequestFunction } from "@openapi-io-ts/runtime";
2
- import * as schemas from "../components/schemas";
3
-
4
- export type ApplyInstallationWithFinanceRequestParameters = {
5
- id: string;
6
- };
7
-
8
- export const applyInstallationWithFinanceOperation = {
9
- path: "/api/installation/{id}/apply",
10
- method: "post",
11
- responses: {
12
- "200": { _tag: "JsonResponse", decoder: schemas.Job },
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 ApplyInstallationWithFinanceRequestFunction = RequestFunction<
33
- {
34
- params: ApplyInstallationWithFinanceRequestParameters;
35
- body: schemas.FinanceRate;
36
- },
37
- schemas.Job
38
- >;
@@ -1,29 +0,0 @@
1
- import type { RequestFunction } from "@openapi-io-ts/runtime";
2
- import * as schemas from "../components/schemas";
3
-
4
- export type DeleteInstallationRequestParameters = {
5
- id: string;
6
- };
7
-
8
- export const deleteInstallationOperation = {
9
- path: "/api/installation/{id}",
10
- method: "delete",
11
- responses: {
12
- "200": { _tag: "JsonResponse", decoder: schemas.Installation },
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 DeleteInstallationRequestFunction = RequestFunction<
27
- { params: DeleteInstallationRequestParameters },
28
- schemas.Installation
29
- >;
@@ -1,29 +0,0 @@
1
- import type { RequestFunction } from "@openapi-io-ts/runtime";
2
- import * as schemas from "../components/schemas";
3
-
4
- export type GetInstallationRequestParameters = {
5
- id: string;
6
- };
7
-
8
- export const getInstallationOperation = {
9
- path: "/api/installation/{id}",
10
- method: "get",
11
- responses: {
12
- "200": { _tag: "JsonResponse", decoder: schemas.Installation },
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 GetInstallationRequestFunction = RequestFunction<
27
- { params: GetInstallationRequestParameters },
28
- schemas.Installation
29
- >;
@@ -1,25 +0,0 @@
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 GetInstallationsRequestParameters = {
7
- format?: "reduced" | "full";
8
- q?: string;
9
- };
10
-
11
- export const getInstallationsOperation = {
12
- path: "/api/installation",
13
- method: "get",
14
- responses: {
15
- "200": { _tag: "JsonResponse", decoder: t.array(schemas.Installation) },
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 GetInstallationsRequestFunction = RequestFunction<
23
- { params: GetInstallationsRequestParameters },
24
- Array<schemas.Installation>
25
- >;
@@ -1,24 +0,0 @@
1
- import type { RequestFunction } from "@openapi-io-ts/runtime";
2
- import * as schemas from "../components/schemas";
3
-
4
- export const postInstallationOperation = {
5
- path: "/api/installation",
6
- method: "post",
7
- responses: {
8
- "200": { _tag: "JsonResponse", decoder: schemas.Installation },
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 PostInstallationRequestFunction = RequestFunction<
22
- { body: schemas.Installation },
23
- schemas.Installation
24
- >;
@@ -1,35 +0,0 @@
1
- import type { RequestFunction } from "@openapi-io-ts/runtime";
2
- import * as schemas from "../components/schemas";
3
-
4
- export type PutInstallationRequestParameters = {
5
- id: string;
6
- };
7
-
8
- export const putInstallationOperation = {
9
- path: "/api/installation/{id}",
10
- method: "put",
11
- responses: {
12
- "200": { _tag: "JsonResponse", decoder: schemas.Installation },
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 PutInstallationRequestFunction = RequestFunction<
33
- { params: PutInstallationRequestParameters; body: schemas.Installation },
34
- schemas.Installation
35
- >;