@inploi/flows 0.0.0

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,60 @@
1
+ import { F as FlowSubmissions, E as Err, O as Ok, P as PhoneInput, b as Output, c as ObjectSchema, L as LiteralSchema, S as StringSchema, d as OptionalSchema, N as NullableSchema } from './result-6033e9fc.js';
2
+
3
+ declare const genId: (size?: number | undefined) => string;
4
+ declare const getFlowSubmissionsPayload: (submissions: FlowSubmissions) => Record<string, unknown>;
5
+ declare const getSubmissionValue: ({ key, submissions }: {
6
+ submissions: FlowSubmissions;
7
+ key: string;
8
+ }) => string | number;
9
+ /** Gets a submission value from either submissions or context */
10
+ declare const getSubmissionValueToCheck: ({ key, path, submissions, context, }: {
11
+ submissions: FlowSubmissions;
12
+ context: Record<string, unknown>;
13
+ key: string;
14
+ path?: string[];
15
+ }) => FlowSubmissions[string] | undefined;
16
+ declare const getFileExtension: (fileName: string) => Err<"No file extension found"> | Ok<string>;
17
+ declare const kbToReadableSize: (kb: number) => string;
18
+ declare const formatPhoneNumber: (phoneNumber: PhoneInput['submission']['value']) => string;
19
+ declare const redirectResponseSchema: ObjectSchema<{
20
+ success: LiteralSchema<true, true>;
21
+ integration_response: ObjectSchema<{
22
+ data: ObjectSchema<{
23
+ redirect_url: StringSchema<string>;
24
+ message: OptionalSchema<NullableSchema<StringSchema<string>, undefined, string | null>, undefined, string | null | undefined>;
25
+ button_text: OptionalSchema<NullableSchema<StringSchema<string>, undefined, string | null>, undefined, string | null | undefined>;
26
+ }, undefined, {
27
+ redirect_url: string;
28
+ message?: string | null | undefined;
29
+ button_text?: string | null | undefined;
30
+ }>;
31
+ }, undefined, {
32
+ data: {
33
+ redirect_url: string;
34
+ message?: string | null | undefined;
35
+ button_text?: string | null | undefined;
36
+ };
37
+ }>;
38
+ }, undefined, {
39
+ success: true;
40
+ integration_response: {
41
+ data: {
42
+ redirect_url: string;
43
+ message?: string | null | undefined;
44
+ button_text?: string | null | undefined;
45
+ };
46
+ };
47
+ }>;
48
+ type RedirectIntegrationResponse = Output<typeof redirectResponseSchema>;
49
+ declare const isRedirectResponse: (response: unknown) => response is {
50
+ success: true;
51
+ integration_response: {
52
+ data: {
53
+ redirect_url: string;
54
+ message?: string | null | undefined;
55
+ button_text?: string | null | undefined;
56
+ };
57
+ };
58
+ };
59
+
60
+ export { RedirectIntegrationResponse, formatPhoneNumber, genId, getFileExtension, getFlowSubmissionsPayload, getSubmissionValue, getSubmissionValueToCheck, isRedirectResponse, kbToReadableSize };
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{D as a,E as b,F as c,G as d,H as e,I as f,J as g,K as h}from"./chunk-3QWHH45C.mjs";export{g as formatPhoneNumber,a as genId,e as getFileExtension,b as getFlowSubmissionsPayload,c as getSubmissionValue,d as getSubmissionValueToCheck,h as isRedirectResponse,f as kbToReadableSize};
2
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@inploi/flows",
3
+ "version": "0.0.0",
4
+ "license": "MIT",
5
+ "exports": {
6
+ "./interpreter": {
7
+ "import": "./dist/interpreter.mjs",
8
+ "types": "./dist/interpreter.d.ts"
9
+ },
10
+ "./utils": {
11
+ "import": "./dist/utils.mjs",
12
+ "types": "./dist/utils.d.ts"
13
+ },
14
+ "./linked-list": {
15
+ "import": "./dist/linked-list.mjs",
16
+ "types": "./dist/linked-list.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "/dist"
21
+ ],
22
+ "peerDependencies": {
23
+ "@inploi/core": "*",
24
+ "@inploi/sdk": "*",
25
+ "@inploi/i18n": "*"
26
+ },
27
+ "devDependencies": {
28
+ "@types/bun": "^1.2.5",
29
+ "@types/lodash": "^4.17.7",
30
+ "@types/uuid": "^9.0.2",
31
+ "eslint": "^7.32.0",
32
+ "lodash": "^4.17.21",
33
+ "tsup": "^7.2.0",
34
+ "valibot": "^0.21.0",
35
+ "nanoid": "^5.1.5",
36
+ "@inploi/core": "1.15.3",
37
+ "@inploi/sdk": "1.14.11",
38
+ "@inploi/i18n": "0.1.2",
39
+ "eslint-config-custom": "0.1.0",
40
+ "tsconfig": "0.1.0"
41
+ },
42
+ "dependencies": {},
43
+ "scripts": {
44
+ "check": "eslint ./src --fix --max-warnings 0 && tsc",
45
+ "build": "tsup --dts-resolve"
46
+ }
47
+ }