@kanda-libs/ks-component-ts 0.3.33 → 0.3.34

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.33",
3
+ "version": "0.3.34",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,38 @@
1
+ import * as t from "io-ts";
2
+ import { CampaignEvent } from "./CampaignEvent";
3
+ import { Metadata } from "./Metadata";
4
+ import { UTM } from "./UTM";
5
+
6
+ export const Campaign = t.intersection([
7
+ t.type({
8
+ id: t.string,
9
+ sid: t.string,
10
+ event_name: CampaignEvent,
11
+ referrer: t.string,
12
+ gclid: t.string,
13
+ metadata: Metadata,
14
+ }),
15
+ t.partial({
16
+ cid: t.string,
17
+ eid: t.string,
18
+ bid: t.string,
19
+ aid: t.string,
20
+ oid: t.string,
21
+ utm: UTM,
22
+ }),
23
+ ]);
24
+
25
+ export interface Campaign {
26
+ id: string;
27
+ sid: string;
28
+ cid?: string;
29
+ eid?: string;
30
+ bid?: string;
31
+ aid?: string;
32
+ oid?: string;
33
+ event_name: CampaignEvent;
34
+ referrer: string;
35
+ gclid: string;
36
+ utm?: UTM;
37
+ metadata: Metadata;
38
+ }
@@ -0,0 +1,14 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const CampaignEvent = t.union([
4
+ t.literal("page_viewed"),
5
+ t.literal("user_signed_up"),
6
+ t.literal("account_registered"),
7
+ t.literal("account_subscribed"),
8
+ ]);
9
+
10
+ export type CampaignEvent =
11
+ | "page_viewed"
12
+ | "user_signed_up"
13
+ | "account_registered"
14
+ | "account_subscribed";
@@ -16,6 +16,8 @@ export * from "./Budgets";
16
16
  export * from "./BusinessConfig";
17
17
  export * from "./BusinessSector";
18
18
  export * from "./Cache";
19
+ export * from "./Campaign";
20
+ export * from "./CampaignEvent";
19
21
  export * from "./Category";
20
22
  export * from "./CheckoutOption";
21
23
  export * from "./CommContext";
@@ -228,6 +228,10 @@ import {
228
228
  ImportFcaApprovedRequestFunction,
229
229
  } from "./importFcaApproved";
230
230
  import { infoAuthOperation, InfoAuthRequestFunction } from "./infoAuth";
231
+ import {
232
+ infoCampaignOperation,
233
+ InfoCampaignRequestFunction,
234
+ } from "./infoCampaign";
231
235
  import {
232
236
  infoCheckoutRedirectOperation,
233
237
  InfoCheckoutRedirectRequestFunction,
@@ -584,6 +588,7 @@ export const operations: Operations = {
584
588
  infoOnboarding: infoOnboardingOperation,
585
589
  infoDirector: infoDirectorOperation,
586
590
  infoCustomer: infoCustomerOperation,
591
+ infoCampaign: infoCampaignOperation,
587
592
  infoExampleJob: infoExampleJobOperation,
588
593
  infoCredit: infoCreditOperation,
589
594
  infoAuth: infoAuthOperation,
@@ -776,6 +781,7 @@ export interface OperationRequestFunctionMap {
776
781
  infoOnboarding: InfoOnboardingRequestFunction;
777
782
  infoDirector: InfoDirectorRequestFunction;
778
783
  infoCustomer: InfoCustomerRequestFunction;
784
+ infoCampaign: InfoCampaignRequestFunction;
779
785
  infoExampleJob: InfoExampleJobRequestFunction;
780
786
  infoCredit: InfoCreditRequestFunction;
781
787
  infoAuth: InfoAuthRequestFunction;
@@ -975,6 +981,7 @@ export const requestFunctionsBuilder = (
975
981
  ),
976
982
  infoDirector: requestFunctionBuilder(operations.infoDirector, requestAdapter),
977
983
  infoCustomer: requestFunctionBuilder(operations.infoCustomer, requestAdapter),
984
+ infoCampaign: requestFunctionBuilder(operations.infoCampaign, requestAdapter),
978
985
  infoExampleJob: requestFunctionBuilder(
979
986
  operations.infoExampleJob,
980
987
  requestAdapter
@@ -1480,6 +1487,12 @@ export const infoCustomerServiceBuilder = (
1480
1487
  infoCustomer: requestFunctions.infoCustomer,
1481
1488
  });
1482
1489
 
1490
+ export const infoCampaignServiceBuilder = (
1491
+ requestFunctions: OperationRequestFunctionMap
1492
+ ) => ({
1493
+ infoCampaign: requestFunctions.infoCampaign,
1494
+ });
1495
+
1483
1496
  export const jobServiceBuilder = (
1484
1497
  requestFunctions: OperationRequestFunctionMap
1485
1498
  ) => ({
@@ -1842,6 +1855,7 @@ export interface Operations {
1842
1855
  infoOnboarding: typeof infoOnboardingOperation;
1843
1856
  infoDirector: typeof infoDirectorOperation;
1844
1857
  infoCustomer: typeof infoCustomerOperation;
1858
+ infoCampaign: typeof infoCampaignOperation;
1845
1859
  infoExampleJob: typeof infoExampleJobOperation;
1846
1860
  infoCredit: typeof infoCreditOperation;
1847
1861
  infoAuth: typeof infoAuthOperation;
@@ -0,0 +1,24 @@
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 InfoCampaignRequestParameters = {
7
+ q?: string;
8
+ };
9
+
10
+ export const infoCampaignOperation = {
11
+ path: "/api/info/campaign",
12
+ method: "get",
13
+ responses: {
14
+ "200": { _tag: "JsonResponse", decoder: t.array(schemas.Campaign) },
15
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
16
+ },
17
+ parameters: [parameters.q],
18
+ requestDefaultHeaders: { Accept: "application/json" },
19
+ } as const;
20
+
21
+ export type InfoCampaignRequestFunction = RequestFunction<
22
+ { params: InfoCampaignRequestParameters },
23
+ Array<schemas.Campaign>
24
+ >;