@arkyn/types 1.2.0 → 1.2.2

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.
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ import type { InboxFlowDTO } from "./config/InboxFlowDTO";
3
+ type ConfigProps = {
4
+ request: Request;
5
+ inbox_flow?: InboxFlowDTO;
6
+ };
7
+ type MonitoringErrorsDTO = (error: any, config: ConfigProps) => Promise<void>;
8
+ export type { MonitoringErrorsDTO };
9
+ //# sourceMappingURL=MonitoringErrorsDTO.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonitoringErrorsDTO.d.ts","sourceRoot":"","sources":["../../src/api/MonitoringErrorsDTO.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B,CAAC;AAEF,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./api/DeleteDTO";
2
2
  export * from "./api/GetDTO";
3
3
  export * from "./api/InstanceConstructorProps";
4
+ export * from "./api/MonitoringErrorsDTO";
4
5
  export * from "./api/PatchDTO";
5
6
  export * from "./api/PostDTO";
6
7
  export * from "./api/PutDTO";
@@ -16,5 +17,6 @@ export * from "./components/IconButtonProps";
16
17
  export * from "./components/InputProps";
17
18
  export * from "./components/ModalProps";
18
19
  export * from "./components/TooltipProps";
19
- export * from "./utils/CalculateCardInstallmentProps";
20
+ export * from "./server/formParseProps";
21
+ export * from "./shared/CalculateCardInstallmentProps";
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,yBAAyB,CAAC;AAGxC,cAAc,wCAAwC,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  export * from "./api/DeleteDTO";
3
3
  export * from "./api/GetDTO";
4
4
  export * from "./api/InstanceConstructorProps";
5
+ export * from "./api/MonitoringErrorsDTO";
5
6
  export * from "./api/PatchDTO";
6
7
  export * from "./api/PostDTO";
7
8
  export * from "./api/PutDTO";
@@ -18,5 +19,7 @@ export * from "./components/IconButtonProps";
18
19
  export * from "./components/InputProps";
19
20
  export * from "./components/ModalProps";
20
21
  export * from "./components/TooltipProps";
21
- // Utils
22
- export * from "./utils/CalculateCardInstallmentProps";
22
+ // Server
23
+ export * from "./server/formParseProps";
24
+ // Shared
25
+ export * from "./shared/CalculateCardInstallmentProps";
@@ -0,0 +1,20 @@
1
+ import { Schema } from "zod";
2
+ type SuccessResponse<T extends FormControlProps> = {
3
+ success: true;
4
+ data: T[1] extends Schema<infer U> ? U : never;
5
+ };
6
+ type ErrorResponse = {
7
+ success: false;
8
+ fields: {
9
+ [x: string]: string;
10
+ };
11
+ fieldErrors: {
12
+ [x: string]: string;
13
+ };
14
+ };
15
+ type FormControlProps = [formData: {
16
+ [k: string]: any;
17
+ }, schema: Schema];
18
+ type FormControlReturnType<T extends FormControlProps> = SuccessResponse<T> | ErrorResponse;
19
+ export type { FormControlProps, FormControlReturnType };
20
+ //# sourceMappingURL=formControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formControl.d.ts","sourceRoot":"","sources":["../../src/server/formControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,eAAe,CAAC,CAAC,SAAS,gBAAgB,IAAI;IACjD,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CAChD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,WAAW,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC,CAAC;AAEF,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzE,KAAK,qBAAqB,CAAC,CAAC,SAAS,gBAAgB,IACjD,eAAe,CAAC,CAAC,CAAC,GAClB,aAAa,CAAC;AAElB,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ import { Schema } from "zod";
@@ -0,0 +1,20 @@
1
+ import { Schema } from "zod";
2
+ type SuccessResponse<T extends FormParseProps> = {
3
+ success: true;
4
+ data: T[1] extends Schema<infer U> ? U : never;
5
+ };
6
+ type ErrorResponse = {
7
+ success: false;
8
+ fields: {
9
+ [x: string]: string;
10
+ };
11
+ fieldErrors: {
12
+ [x: string]: string;
13
+ };
14
+ };
15
+ type FormParseProps = [formData: {
16
+ [k: string]: any;
17
+ }, schema: Schema];
18
+ type FormParseReturnType<T extends FormParseProps> = SuccessResponse<T> | ErrorResponse;
19
+ export type { FormParseProps, FormParseReturnType };
20
+ //# sourceMappingURL=formParseProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formParseProps.d.ts","sourceRoot":"","sources":["../../src/server/formParseProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CAChD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,WAAW,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC,CAAC;AAEF,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAC7C,eAAe,CAAC,CAAC,CAAC,GAClB,aAAa,CAAC;AAElB,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ import { Schema } from "zod";
@@ -0,0 +1,7 @@
1
+ type CalculateCardInstallmentProps = {
2
+ cash_price: number;
3
+ number_installments: number;
4
+ fees?: number;
5
+ };
6
+ export type { CalculateCardInstallmentProps };
7
+ //# sourceMappingURL=CalculateCardInstallmentProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalculateCardInstallmentProps.d.ts","sourceRoot":"","sources":["../../src/shared/CalculateCardInstallmentProps.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/types",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./src/index.ts",
6
6
  "type": "module",
@@ -0,0 +1,10 @@
1
+ import type { InboxFlowDTO } from "./config/InboxFlowDTO";
2
+
3
+ type ConfigProps = {
4
+ request: Request;
5
+ inbox_flow?: InboxFlowDTO;
6
+ };
7
+
8
+ type MonitoringErrorsDTO = (error: any, config: ConfigProps) => Promise<void>;
9
+
10
+ export type { MonitoringErrorsDTO };
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  export * from "./api/DeleteDTO";
3
3
  export * from "./api/GetDTO";
4
4
  export * from "./api/InstanceConstructorProps";
5
+ export * from "./api/MonitoringErrorsDTO";
5
6
  export * from "./api/PatchDTO";
6
7
  export * from "./api/PostDTO";
7
8
  export * from "./api/PutDTO";
@@ -20,5 +21,8 @@ export * from "./components/InputProps";
20
21
  export * from "./components/ModalProps";
21
22
  export * from "./components/TooltipProps";
22
23
 
23
- // Utils
24
- export * from "./utils/CalculateCardInstallmentProps";
24
+ // Server
25
+ export * from "./server/formParseProps";
26
+
27
+ // Shared
28
+ export * from "./shared/CalculateCardInstallmentProps";
@@ -0,0 +1,20 @@
1
+ import { Schema } from "zod";
2
+
3
+ type SuccessResponse<T extends FormParseProps> = {
4
+ success: true;
5
+ data: T[1] extends Schema<infer U> ? U : never;
6
+ };
7
+
8
+ type ErrorResponse = {
9
+ success: false;
10
+ fields: { [x: string]: string };
11
+ fieldErrors: { [x: string]: string };
12
+ };
13
+
14
+ type FormParseProps = [formData: { [k: string]: any }, schema: Schema];
15
+
16
+ type FormParseReturnType<T extends FormParseProps> =
17
+ | SuccessResponse<T>
18
+ | ErrorResponse;
19
+
20
+ export type { FormParseProps, FormParseReturnType };