@smvtech/x-flux 1.0.1 → 1.0.3
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/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +18 -2
- package/dist/index.mjs +18 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -303,16 +303,19 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
303
303
|
error_text: z.ZodString;
|
|
304
304
|
result: z.ZodBoolean;
|
|
305
305
|
fix_type: z.ZodEnum<["auto", "manual", "none"]>;
|
|
306
|
+
time_saved: z.ZodNumber;
|
|
306
307
|
}, "strip", z.ZodTypeAny, {
|
|
307
308
|
validation_name: string;
|
|
308
309
|
error_text: string;
|
|
309
310
|
result: boolean;
|
|
310
311
|
fix_type: "auto" | "manual" | "none";
|
|
312
|
+
time_saved: number;
|
|
311
313
|
}, {
|
|
312
314
|
validation_name: string;
|
|
313
315
|
error_text: string;
|
|
314
316
|
result: boolean;
|
|
315
317
|
fix_type: "auto" | "manual" | "none";
|
|
318
|
+
time_saved: number;
|
|
316
319
|
}>, "many">;
|
|
317
320
|
created_by: z.ZodString;
|
|
318
321
|
created_at: z.ZodString;
|
|
@@ -340,6 +343,7 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
340
343
|
error_text: string;
|
|
341
344
|
result: boolean;
|
|
342
345
|
fix_type: "auto" | "manual" | "none";
|
|
346
|
+
time_saved: number;
|
|
343
347
|
}[];
|
|
344
348
|
}, {
|
|
345
349
|
status: "NA" | "ANSWERED" | "APPROVED" | "REJECTED" | "UNSTARTED" | "PENDING";
|
|
@@ -364,6 +368,7 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
364
368
|
error_text: string;
|
|
365
369
|
result: boolean;
|
|
366
370
|
fix_type: "auto" | "manual" | "none";
|
|
371
|
+
time_saved: number;
|
|
367
372
|
}[];
|
|
368
373
|
}>;
|
|
369
374
|
|
|
@@ -5224,6 +5229,7 @@ type TEDCFlowContext = {
|
|
|
5224
5229
|
deleteApplicant: (application_id: string) => Promise<void>;
|
|
5225
5230
|
updateAnswer: (application_id: string, question_type: string, question: string, data: TUpdateAnswerPayload, onProgress?: (event: TUploadProgressEvent) => void) => Promise<void>;
|
|
5226
5231
|
getS3UrlForAsset: (doc_id: string) => Promise<string | null>;
|
|
5232
|
+
acceptOrderQCTermsAndConditions: () => Promise<void>;
|
|
5227
5233
|
};
|
|
5228
5234
|
type TEDCFlowProviderProps = {
|
|
5229
5235
|
children: ReactNode;
|
|
@@ -5264,6 +5270,7 @@ declare const EDCFlow: {
|
|
|
5264
5270
|
deleteApplicant: (application_id: string) => Promise<void>;
|
|
5265
5271
|
updateAnswer: (application_id: string, question_type: string, question: string, data: TUpdateAnswerPayload, onProgress?: (event: TUploadProgressEvent) => void) => Promise<void>;
|
|
5266
5272
|
getS3UrlForAsset: (doc_id: string) => Promise<string | null>;
|
|
5273
|
+
acceptOrderQCTermsAndConditions: () => Promise<void>;
|
|
5267
5274
|
};
|
|
5268
5275
|
};
|
|
5269
5276
|
|
package/dist/index.d.ts
CHANGED
|
@@ -303,16 +303,19 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
303
303
|
error_text: z.ZodString;
|
|
304
304
|
result: z.ZodBoolean;
|
|
305
305
|
fix_type: z.ZodEnum<["auto", "manual", "none"]>;
|
|
306
|
+
time_saved: z.ZodNumber;
|
|
306
307
|
}, "strip", z.ZodTypeAny, {
|
|
307
308
|
validation_name: string;
|
|
308
309
|
error_text: string;
|
|
309
310
|
result: boolean;
|
|
310
311
|
fix_type: "auto" | "manual" | "none";
|
|
312
|
+
time_saved: number;
|
|
311
313
|
}, {
|
|
312
314
|
validation_name: string;
|
|
313
315
|
error_text: string;
|
|
314
316
|
result: boolean;
|
|
315
317
|
fix_type: "auto" | "manual" | "none";
|
|
318
|
+
time_saved: number;
|
|
316
319
|
}>, "many">;
|
|
317
320
|
created_by: z.ZodString;
|
|
318
321
|
created_at: z.ZodString;
|
|
@@ -340,6 +343,7 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
340
343
|
error_text: string;
|
|
341
344
|
result: boolean;
|
|
342
345
|
fix_type: "auto" | "manual" | "none";
|
|
346
|
+
time_saved: number;
|
|
343
347
|
}[];
|
|
344
348
|
}, {
|
|
345
349
|
status: "NA" | "ANSWERED" | "APPROVED" | "REJECTED" | "UNSTARTED" | "PENDING";
|
|
@@ -364,6 +368,7 @@ declare const AnswerSchema: z.ZodObject<{
|
|
|
364
368
|
error_text: string;
|
|
365
369
|
result: boolean;
|
|
366
370
|
fix_type: "auto" | "manual" | "none";
|
|
371
|
+
time_saved: number;
|
|
367
372
|
}[];
|
|
368
373
|
}>;
|
|
369
374
|
|
|
@@ -5224,6 +5229,7 @@ type TEDCFlowContext = {
|
|
|
5224
5229
|
deleteApplicant: (application_id: string) => Promise<void>;
|
|
5225
5230
|
updateAnswer: (application_id: string, question_type: string, question: string, data: TUpdateAnswerPayload, onProgress?: (event: TUploadProgressEvent) => void) => Promise<void>;
|
|
5226
5231
|
getS3UrlForAsset: (doc_id: string) => Promise<string | null>;
|
|
5232
|
+
acceptOrderQCTermsAndConditions: () => Promise<void>;
|
|
5227
5233
|
};
|
|
5228
5234
|
type TEDCFlowProviderProps = {
|
|
5229
5235
|
children: ReactNode;
|
|
@@ -5264,6 +5270,7 @@ declare const EDCFlow: {
|
|
|
5264
5270
|
deleteApplicant: (application_id: string) => Promise<void>;
|
|
5265
5271
|
updateAnswer: (application_id: string, question_type: string, question: string, data: TUpdateAnswerPayload, onProgress?: (event: TUploadProgressEvent) => void) => Promise<void>;
|
|
5266
5272
|
getS3UrlForAsset: (doc_id: string) => Promise<string | null>;
|
|
5273
|
+
acceptOrderQCTermsAndConditions: () => Promise<void>;
|
|
5267
5274
|
};
|
|
5268
5275
|
};
|
|
5269
5276
|
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,8 @@ var AnswerSchema = z2__namespace.object({
|
|
|
165
165
|
validation_name: z2__namespace.string(),
|
|
166
166
|
error_text: z2__namespace.string(),
|
|
167
167
|
result: z2__namespace.boolean(),
|
|
168
|
-
fix_type: z2__namespace.enum(["auto", "manual", "none"])
|
|
168
|
+
fix_type: z2__namespace.enum(["auto", "manual", "none"]),
|
|
169
|
+
time_saved: z2__namespace.number()
|
|
169
170
|
})),
|
|
170
171
|
created_by: z2__namespace.string(),
|
|
171
172
|
created_at: z2__namespace.string(),
|
|
@@ -579,6 +580,11 @@ var getFileURLfromFilename = async (filename, signal) => {
|
|
|
579
580
|
});
|
|
580
581
|
return { data: signedURLs };
|
|
581
582
|
};
|
|
583
|
+
var updateOrderQCTermsAndConditions = async (orderId) => {
|
|
584
|
+
const client = getClient();
|
|
585
|
+
const response = await client.patch(`/visa_orders/update-order-qc-terms-conditions/${orderId}`);
|
|
586
|
+
return { data: response.data.data };
|
|
587
|
+
};
|
|
582
588
|
var EDCFlowContext = react.createContext(void 0);
|
|
583
589
|
var EDCFlowProvider = ({ children, orderId }) => {
|
|
584
590
|
const [order, setOrder] = react.useState(null);
|
|
@@ -806,6 +812,15 @@ var EDCFlowProvider = ({ children, orderId }) => {
|
|
|
806
812
|
s3UrlFetchFlightRequests.current.set(doc_id, request);
|
|
807
813
|
return request;
|
|
808
814
|
}, [docIdToS3Url]);
|
|
815
|
+
const acceptOrderQCTermsAndConditions = react.useCallback(async () => {
|
|
816
|
+
if (!order) return;
|
|
817
|
+
try {
|
|
818
|
+
await updateOrderQCTermsAndConditions(order._id);
|
|
819
|
+
} catch (err) {
|
|
820
|
+
console.error("Failed to accept order QCTerms and Conditions:", err);
|
|
821
|
+
setError("Failed to accept order QCTerms and Conditions");
|
|
822
|
+
}
|
|
823
|
+
}, [order]);
|
|
809
824
|
react.useEffect(() => {
|
|
810
825
|
if (!orderId) return;
|
|
811
826
|
const initialize = async () => {
|
|
@@ -850,13 +865,14 @@ var EDCFlowProvider = ({ children, orderId }) => {
|
|
|
850
865
|
setActiveApplicant,
|
|
851
866
|
loading,
|
|
852
867
|
error,
|
|
868
|
+
success,
|
|
853
869
|
addApplicant: addApplicant2,
|
|
854
870
|
updateAnswer: updateAnswer2,
|
|
855
871
|
deleteApplicant: deleteApplicantById,
|
|
856
872
|
refreshOrder,
|
|
857
873
|
refreshApplicant,
|
|
858
874
|
getS3UrlForAsset,
|
|
859
|
-
|
|
875
|
+
acceptOrderQCTermsAndConditions
|
|
860
876
|
};
|
|
861
877
|
return /* @__PURE__ */ jsxRuntime.jsx(EDCFlowContext.Provider, { value, children });
|
|
862
878
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -139,7 +139,8 @@ var AnswerSchema = z2.object({
|
|
|
139
139
|
validation_name: z2.string(),
|
|
140
140
|
error_text: z2.string(),
|
|
141
141
|
result: z2.boolean(),
|
|
142
|
-
fix_type: z2.enum(["auto", "manual", "none"])
|
|
142
|
+
fix_type: z2.enum(["auto", "manual", "none"]),
|
|
143
|
+
time_saved: z2.number()
|
|
143
144
|
})),
|
|
144
145
|
created_by: z2.string(),
|
|
145
146
|
created_at: z2.string(),
|
|
@@ -553,6 +554,11 @@ var getFileURLfromFilename = async (filename, signal) => {
|
|
|
553
554
|
});
|
|
554
555
|
return { data: signedURLs };
|
|
555
556
|
};
|
|
557
|
+
var updateOrderQCTermsAndConditions = async (orderId) => {
|
|
558
|
+
const client = getClient();
|
|
559
|
+
const response = await client.patch(`/visa_orders/update-order-qc-terms-conditions/${orderId}`);
|
|
560
|
+
return { data: response.data.data };
|
|
561
|
+
};
|
|
556
562
|
var EDCFlowContext = createContext(void 0);
|
|
557
563
|
var EDCFlowProvider = ({ children, orderId }) => {
|
|
558
564
|
const [order, setOrder] = useState(null);
|
|
@@ -780,6 +786,15 @@ var EDCFlowProvider = ({ children, orderId }) => {
|
|
|
780
786
|
s3UrlFetchFlightRequests.current.set(doc_id, request);
|
|
781
787
|
return request;
|
|
782
788
|
}, [docIdToS3Url]);
|
|
789
|
+
const acceptOrderQCTermsAndConditions = useCallback(async () => {
|
|
790
|
+
if (!order) return;
|
|
791
|
+
try {
|
|
792
|
+
await updateOrderQCTermsAndConditions(order._id);
|
|
793
|
+
} catch (err) {
|
|
794
|
+
console.error("Failed to accept order QCTerms and Conditions:", err);
|
|
795
|
+
setError("Failed to accept order QCTerms and Conditions");
|
|
796
|
+
}
|
|
797
|
+
}, [order]);
|
|
783
798
|
useEffect(() => {
|
|
784
799
|
if (!orderId) return;
|
|
785
800
|
const initialize = async () => {
|
|
@@ -824,13 +839,14 @@ var EDCFlowProvider = ({ children, orderId }) => {
|
|
|
824
839
|
setActiveApplicant,
|
|
825
840
|
loading,
|
|
826
841
|
error,
|
|
842
|
+
success,
|
|
827
843
|
addApplicant: addApplicant2,
|
|
828
844
|
updateAnswer: updateAnswer2,
|
|
829
845
|
deleteApplicant: deleteApplicantById,
|
|
830
846
|
refreshOrder,
|
|
831
847
|
refreshApplicant,
|
|
832
848
|
getS3UrlForAsset,
|
|
833
|
-
|
|
849
|
+
acceptOrderQCTermsAndConditions
|
|
834
850
|
};
|
|
835
851
|
return /* @__PURE__ */ jsx(EDCFlowContext.Provider, { value, children });
|
|
836
852
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smvtech/x-flux",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "x-flux - A powerful React package for managing effective document collection flows, visa questionnaires, travellers, and applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|