@kanda-libs/ks-component-ts 0.2.427 → 0.2.428

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.427",
3
+ "version": "0.2.428",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,5 +1,6 @@
1
1
  export * from "./format";
2
2
  export * from "./q";
3
+ export * from "./tier";
3
4
  export * from "./x_kanda_bid";
4
5
  export * from "./x_kanda_cid";
5
6
  export * from "./x_kanda_eid";
@@ -0,0 +1,8 @@
1
+ import { OperationParameter } from "@openapi-io-ts/runtime";
2
+
3
+ export const tier: OperationParameter = {
4
+ _tag: "FormParameter",
5
+ explode: true,
6
+ in: "query",
7
+ name: "tier",
8
+ };
@@ -13,6 +13,7 @@ import { Metadata } from "./Metadata";
13
13
  import { RedirectURLs } from "./RedirectURLs";
14
14
  import { SolarCompanyInfo } from "./SolarCompanyInfo";
15
15
  import { SoleTraderInfo } from "./SoleTraderInfo";
16
+ import { TierConfig } from "./TierConfig";
16
17
  import { UserType } from "./UserType";
17
18
  import { WelcomeSkipBanner } from "./WelcomeSkipBanner";
18
19
 
@@ -77,6 +78,7 @@ export const Company = t.intersection([
77
78
  lender_configs: t.array(LenderConfig),
78
79
  business_type: t.string,
79
80
  business_config: BusinessConfig,
81
+ tier_config: TierConfig,
80
82
  metadata: Metadata,
81
83
  }),
82
84
  ]);
@@ -130,5 +132,6 @@ export interface Company {
130
132
  lender_configs?: Array<LenderConfig>;
131
133
  business_type?: string;
132
134
  business_config?: BusinessConfig;
135
+ tier_config?: TierConfig;
133
136
  metadata?: Metadata;
134
137
  }
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const Tier = t.union([
4
+ t.literal("base_rate"),
5
+ t.literal("enterprise_rate"),
6
+ ]);
7
+
8
+ export type Tier = "base_rate" | "enterprise_rate";
@@ -0,0 +1,13 @@
1
+ import * as t from "io-ts";
2
+ import { Tier } from "./Tier";
3
+ import { TierEvent } from "./TierEvent";
4
+
5
+ export const TierConfig = t.type({
6
+ current_tier: Tier,
7
+ tiers: t.array(TierEvent),
8
+ });
9
+
10
+ export interface TierConfig {
11
+ current_tier: Tier;
12
+ tiers: Array<TierEvent>;
13
+ }
@@ -0,0 +1,15 @@
1
+ import * as t from "io-ts";
2
+ import { DateFromISOString } from "io-ts-types";
3
+ import { Tier } from "./Tier";
4
+
5
+ export const TierEvent = t.type({
6
+ tier: Tier,
7
+ action: t.union([t.literal("add_tier"), t.literal("remove_tier")]),
8
+ actioned_at: DateFromISOString,
9
+ });
10
+
11
+ export interface TierEvent {
12
+ tier: Tier;
13
+ action: "add_tier" | "remove_tier";
14
+ actioned_at: Date;
15
+ }
@@ -116,6 +116,9 @@ export * from "./SolarCompanyInfo";
116
116
  export * from "./SoleTraderInfo";
117
117
  export * from "./Subscription";
118
118
  export * from "./Tally";
119
+ export * from "./Tier";
120
+ export * from "./TierConfig";
121
+ export * from "./TierEvent";
119
122
  export * from "./Title";
120
123
  export * from "./TradeFilter";
121
124
  export * from "./TradeSummary";
@@ -1,8 +1,10 @@
1
1
  import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as parameters from "../components/parameters";
2
3
  import * as schemas from "../components/schemas";
3
4
 
4
5
  export type PostCompanyBillingRequestParameters = {
5
6
  id: string;
7
+ tier?: "base_rate" | "enterprise_rate";
6
8
  };
7
9
 
8
10
  export const postCompanyBillingOperation = {
@@ -19,6 +21,7 @@ export const postCompanyBillingOperation = {
19
21
  in: "path",
20
22
  name: "id",
21
23
  },
24
+ parameters.tier,
22
25
  ],
23
26
  requestDefaultHeaders: { Accept: "application/json" },
24
27
  } as const;
@@ -1,9 +1,11 @@
1
1
  import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as parameters from "../components/parameters";
2
3
  import * as schemas from "../components/schemas";
3
4
 
4
5
  export type PostCompanyBillingSuccessRequestParameters = {
5
6
  id: string;
6
7
  provider?: "stripe" | "premium_credit";
8
+ tier?: "base_rate" | "enterprise_rate";
7
9
  };
8
10
 
9
11
  export const postCompanyBillingSuccessOperation = {
@@ -26,6 +28,7 @@ export const postCompanyBillingSuccessOperation = {
26
28
  in: "query",
27
29
  name: "provider",
28
30
  },
31
+ parameters.tier,
29
32
  ],
30
33
  requestDefaultHeaders: { Accept: "application/json" },
31
34
  } as const;