@gofranz/formshive-submit 1.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.
- package/README.md +619 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/field-errors.d.ts +95 -0
- package/dist/field-errors.d.ts.map +1 -0
- package/dist/file-handler.d.ts +43 -0
- package/dist/file-handler.d.ts.map +1 -0
- package/dist/formshive-submit.cjs +1714 -0
- package/dist/formshive-submit.cjs.map +1 -0
- package/dist/formshive-submit.esm.js +1644 -0
- package/dist/formshive-submit.esm.js.map +1 -0
- package/dist/formshive-submit.js +1720 -0
- package/dist/formshive-submit.js.map +1 -0
- package/dist/formshive-submit.min.js +2 -0
- package/dist/formshive-submit.min.js.map +1 -0
- package/dist/main.d.ts +66 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/retry.d.ts +73 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/submit.d.ts +49 -0
- package/dist/submit.d.ts.map +1 -0
- package/dist/test.html +1074 -0
- package/dist/types.d.ts +145 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +115 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +52 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript type definitions for Formshive Submit library
|
|
3
|
+
*/
|
|
4
|
+
import type { AxiosInstance, AxiosError } from 'axios';
|
|
5
|
+
export type HttpClient = 'fetch' | 'axios' | AxiosInstance;
|
|
6
|
+
export interface RetryConfig {
|
|
7
|
+
/** Maximum number of retry attempts (default: 3) */
|
|
8
|
+
maxAttempts?: number;
|
|
9
|
+
/** Base delay in milliseconds between retries (default: 1000) */
|
|
10
|
+
baseDelay?: number;
|
|
11
|
+
/** Maximum delay in milliseconds (default: 30000) */
|
|
12
|
+
maxDelay?: number;
|
|
13
|
+
/** Enable jitter to avoid thundering herd (default: true) */
|
|
14
|
+
enableJitter?: boolean;
|
|
15
|
+
/** Multiplier for exponential backoff (default: 2) */
|
|
16
|
+
backoffMultiplier?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface FileConfig {
|
|
19
|
+
/** Maximum file size in bytes (default: 10MB) */
|
|
20
|
+
maxFileSize?: number;
|
|
21
|
+
/** Allowed MIME types (default: allow all) */
|
|
22
|
+
allowedTypes?: string[];
|
|
23
|
+
/** Enable upload progress tracking (default: true) */
|
|
24
|
+
trackProgress?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface FormshiveCallbacks {
|
|
27
|
+
/** Called when form submission succeeds */
|
|
28
|
+
onSuccess?: (response: SubmitResponse) => void;
|
|
29
|
+
/** Called when form submission fails (after all retries) */
|
|
30
|
+
onError?: (error: SubmitError) => void;
|
|
31
|
+
/** Called before each retry attempt */
|
|
32
|
+
onRetry?: (attempt: number, maxAttempts: number, error: Error) => void;
|
|
33
|
+
/** Called during file upload progress */
|
|
34
|
+
onProgress?: (percent: number, loaded: number, total: number) => void;
|
|
35
|
+
/** Called when starting submission */
|
|
36
|
+
onStart?: () => void;
|
|
37
|
+
}
|
|
38
|
+
export interface FormshiveSubmitOptions {
|
|
39
|
+
/** Formshive form ID */
|
|
40
|
+
formId: string;
|
|
41
|
+
/** Form data to submit (object or FormData) */
|
|
42
|
+
data: Record<string, any> | FormData;
|
|
43
|
+
/** API endpoint URL (default: https://api.formshive.com/v1) */
|
|
44
|
+
endpoint?: string;
|
|
45
|
+
/** HTTP client to use (default: fetch) */
|
|
46
|
+
httpClient?: HttpClient;
|
|
47
|
+
/** Retry configuration */
|
|
48
|
+
retry?: RetryConfig;
|
|
49
|
+
/** File upload configuration */
|
|
50
|
+
files?: FileConfig;
|
|
51
|
+
/** Callback functions */
|
|
52
|
+
callbacks?: FormshiveCallbacks;
|
|
53
|
+
/** Additional HTTP headers */
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
56
|
+
timeout?: number;
|
|
57
|
+
/** Enable debug logging (default: false) */
|
|
58
|
+
debug?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface SubmitResponse {
|
|
61
|
+
success: boolean;
|
|
62
|
+
data?: any;
|
|
63
|
+
statusCode: number;
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
redirectUrl?: string;
|
|
66
|
+
attempt: number;
|
|
67
|
+
duration: number;
|
|
68
|
+
}
|
|
69
|
+
export interface FieldValidationError {
|
|
70
|
+
field: string;
|
|
71
|
+
code: string;
|
|
72
|
+
message: string;
|
|
73
|
+
params: Record<string, any>;
|
|
74
|
+
}
|
|
75
|
+
export interface FieldValidationErrorResponse {
|
|
76
|
+
error: string;
|
|
77
|
+
action?: string;
|
|
78
|
+
message: string;
|
|
79
|
+
errors: FieldValidationError[];
|
|
80
|
+
}
|
|
81
|
+
export interface SubmitError extends Error {
|
|
82
|
+
code: string;
|
|
83
|
+
statusCode?: number;
|
|
84
|
+
response?: any;
|
|
85
|
+
attempt: number;
|
|
86
|
+
isRetryable: boolean;
|
|
87
|
+
originalError?: Error | AxiosError;
|
|
88
|
+
/** Field validation errors (if this is a validation error) */
|
|
89
|
+
fieldErrors?: FieldValidationError[];
|
|
90
|
+
/** Original validation error response (if available) */
|
|
91
|
+
validationResponse?: FieldValidationErrorResponse;
|
|
92
|
+
}
|
|
93
|
+
export interface HttpResponse {
|
|
94
|
+
data: any;
|
|
95
|
+
status: number;
|
|
96
|
+
statusText: string;
|
|
97
|
+
headers: Record<string, string>;
|
|
98
|
+
}
|
|
99
|
+
export interface HttpClientAdapter {
|
|
100
|
+
request(config: RequestConfig): Promise<HttpResponse>;
|
|
101
|
+
supportsProgress(): boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface RequestConfig {
|
|
104
|
+
url: string;
|
|
105
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
106
|
+
data?: any;
|
|
107
|
+
headers?: Record<string, string>;
|
|
108
|
+
timeout?: number;
|
|
109
|
+
onUploadProgress?: (progressEvent: ProgressEvent) => void;
|
|
110
|
+
}
|
|
111
|
+
export interface FileInfo {
|
|
112
|
+
field: string;
|
|
113
|
+
file: File;
|
|
114
|
+
name: string;
|
|
115
|
+
size: number;
|
|
116
|
+
type: string;
|
|
117
|
+
}
|
|
118
|
+
export interface ProcessedData {
|
|
119
|
+
data: Record<string, any> | FormData;
|
|
120
|
+
hasFiles: boolean;
|
|
121
|
+
files: FileInfo[];
|
|
122
|
+
}
|
|
123
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
124
|
+
export interface Logger {
|
|
125
|
+
debug(message: string, ...args: any[]): void;
|
|
126
|
+
info(message: string, ...args: any[]): void;
|
|
127
|
+
warn(message: string, ...args: any[]): void;
|
|
128
|
+
error(message: string, ...args: any[]): void;
|
|
129
|
+
}
|
|
130
|
+
export declare const DEFAULT_RETRY_CONFIG: Required<RetryConfig>;
|
|
131
|
+
export declare const DEFAULT_FILE_CONFIG: Required<FileConfig>;
|
|
132
|
+
export declare const DEFAULT_OPTIONS: Partial<FormshiveSubmitOptions>;
|
|
133
|
+
export declare const ERROR_CODES: {
|
|
134
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
135
|
+
readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
|
|
136
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
137
|
+
readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
|
|
138
|
+
readonly INVALID_FILE_TYPE: "INVALID_FILE_TYPE";
|
|
139
|
+
readonly FORM_NOT_FOUND: "FORM_NOT_FOUND";
|
|
140
|
+
readonly SERVER_ERROR: "SERVER_ERROR";
|
|
141
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
142
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
143
|
+
};
|
|
144
|
+
export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
|
|
145
|
+
//# sourceM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CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAGD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CAC9C;AAGD,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAMtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,UAAU,CAIpD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,sBAAsB,CAO3D,CAAC;AAGF,eAAO,MAAM,WAAW;;;;;;;;;;CAUd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions and logging
|
|
3
|
+
*/
|
|
4
|
+
import type { Logger } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Simple console-based logger implementation
|
|
7
|
+
*/
|
|
8
|
+
export declare class ConsoleLogger implements Logger {
|
|
9
|
+
private enabled;
|
|
10
|
+
constructor(enabled?: boolean);
|
|
11
|
+
debug(message: string, ...args: any[]): void;
|
|
12
|
+
info(message: string, ...args: any[]): void;
|
|
13
|
+
warn(message: string, ...args: any[]): void;
|
|
14
|
+
error(message: string, ...args: any[]): void;
|
|
15
|
+
setEnabled(enabled: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* No-op logger for production builds
|
|
19
|
+
*/
|
|
20
|
+
export declare class NoOpLogger implements Logger {
|
|
21
|
+
debug(): void;
|
|
22
|
+
info(): void;
|
|
23
|
+
warn(): void;
|
|
24
|
+
error(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create logger based on debug flag
|
|
28
|
+
*/
|
|
29
|
+
export declare function createLogger(debug?: boolean): Logger;
|
|
30
|
+
/**
|
|
31
|
+
* Validate URL format
|
|
32
|
+
*/
|
|
33
|
+
export declare function isValidUrl(url: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Ensure URL has protocol
|
|
36
|
+
*/
|
|
37
|
+
export declare function ensureProtocol(url: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Build form submission URL
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildSubmissionUrl(endpoint: string, formId: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Generate unique request ID for tracking
|
|
44
|
+
*/
|
|
45
|
+
export declare function generateRequestId(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Format duration in milliseconds to human readable string
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatDuration(ms: number): string;
|
|
50
|
+
/**
|
|
51
|
+
* Deep clone object (simple implementation)
|
|
52
|
+
*/
|
|
53
|
+
export declare function deepClone<T>(obj: T): T;
|
|
54
|
+
/**
|
|
55
|
+
* Safely get nested object property
|
|
56
|
+
*/
|
|
57
|
+
export declare function getNestedProperty(obj: any, path: string): any;
|
|
58
|
+
/**
|
|
59
|
+
* Debounce function
|
|
60
|
+
*/
|
|
61
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Throttle function
|
|
64
|
+
*/
|
|
65
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Check if running in browser environment
|
|
68
|
+
*/
|
|
69
|
+
export declare function isBrowser(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Check if fetch is available
|
|
72
|
+
*/
|
|
73
|
+
export declare function isFetchAvailable(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Check if FormData is available
|
|
76
|
+
*/
|
|
77
|
+
export declare function isFormDataAvailable(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get environment info for debugging
|
|
80
|
+
*/
|
|
81
|
+
export declare function getEnvironmentInfo(): {
|
|
82
|
+
browser: boolean;
|
|
83
|
+
fetch: boolean;
|
|
84
|
+
formData: boolean;
|
|
85
|
+
userAgent?: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Parse error message from various error types
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseErrorMessage(error: any): string;
|
|
91
|
+
/**
|
|
92
|
+
* Sanitize string for logging (remove sensitive information)
|
|
93
|
+
*/
|
|
94
|
+
export declare function sanitizeForLogging(input: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Create a timeout promise that rejects after specified time
|
|
97
|
+
*/
|
|
98
|
+
export declare function createTimeoutPromise<T>(ms: number): Promise<T>;
|
|
99
|
+
/**
|
|
100
|
+
* Race a promise against a timeout
|
|
101
|
+
*/
|
|
102
|
+
export declare function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T>;
|
|
103
|
+
/**
|
|
104
|
+
* Retry a promise with simple linear backoff
|
|
105
|
+
*/
|
|
106
|
+
export declare function simpleRetry<T>(fn: () => Promise<T>, maxRetries?: number, delay?: number): Promise<T>;
|
|
107
|
+
/**
|
|
108
|
+
* Convert object to query string
|
|
109
|
+
*/
|
|
110
|
+
export declare function objectToQueryString(obj: Record<string, any>): string;
|
|
111
|
+
/**
|
|
112
|
+
* Merge objects with deep merging for nested objects
|
|
113
|
+
*/
|
|
114
|
+
export declare function mergeObjects<T extends object>(target: T, ...sources: Partial<T>[]): T;
|
|
115
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;GAEG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC9B,OAAO,CAAC,OAAO;gBAAP,OAAO,GAAE,OAAe;IAE5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM3C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM3C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAGnC;AAED;;GAEG;AACH,qBAAa,UAAW,YAAW,MAAM;IACvC,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;CACd;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,OAAe,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED;;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E,GAAG,GAAG,MAAM,CA4BpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAM9D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAK1E;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,GAAE,MAAU,EACtB,KAAK,GAAE,MAAa,GACnB,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAUpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAkBrF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gofranz/formshive-submit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JavaScript library for submitting forms to Formshive with retry logic, file support, and flexible HTTP client options",
|
|
5
|
+
"main": "dist/formshive-submit.js",
|
|
6
|
+
"module": "dist/formshive-submit.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"author": "Franz Geffke <mail@gofranz.com>",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"formshive",
|
|
13
|
+
"form-submission",
|
|
14
|
+
"javascript",
|
|
15
|
+
"typescript",
|
|
16
|
+
"retry-logic",
|
|
17
|
+
"file-upload"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
21
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
22
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
23
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
24
|
+
"@types/node": "^22.0.0",
|
|
25
|
+
"rollup": "^4.0.0",
|
|
26
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
27
|
+
"tslib": "^2.8.1",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"axios": "^1.9.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"axios": "^1.0.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"axios": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist/"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "rollup -c --watch",
|
|
46
|
+
"build": "rollup -c",
|
|
47
|
+
"serve": "python3 -m http.server 8080",
|
|
48
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"publish:dual": "./publish.sh"
|
|
51
|
+
}
|
|
52
|
+
}
|