@voyantjs/legal-react 0.52.1 → 0.52.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.
|
@@ -3,6 +3,18 @@ import type { z } from "zod";
|
|
|
3
3
|
export type CreateLegalContractInput = z.input<typeof insertContractSchema>;
|
|
4
4
|
export type UpdateLegalContractInput = z.input<typeof updateContractSchema>;
|
|
5
5
|
export type GenerateLegalContractDocumentInput = z.input<typeof generateContractDocumentInputSchema>;
|
|
6
|
+
export interface SendLegalContractInputBody {
|
|
7
|
+
/** Customer email to deliver the contract to. */
|
|
8
|
+
recipientEmail?: string | null;
|
|
9
|
+
/** Subject line for the outgoing email. */
|
|
10
|
+
subject?: string | null;
|
|
11
|
+
/** Plain-text or HTML body that the operator typed in the send dialog. */
|
|
12
|
+
message?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface SendLegalContractInput {
|
|
15
|
+
id: string;
|
|
16
|
+
input?: SendLegalContractInputBody;
|
|
17
|
+
}
|
|
6
18
|
export declare function useLegalContractMutation(): {
|
|
7
19
|
create: import("@tanstack/react-query").UseMutationResult<{
|
|
8
20
|
scope: "other" | "customer" | "supplier" | "partner" | "channel";
|
|
@@ -177,7 +189,7 @@ export declare function useLegalContractMutation(): {
|
|
|
177
189
|
executedAt?: string | null | undefined;
|
|
178
190
|
expiresAt?: string | null | undefined;
|
|
179
191
|
voidedAt?: string | null | undefined;
|
|
180
|
-
}, Error, string, unknown>;
|
|
192
|
+
}, Error, string | SendLegalContractInput, unknown>;
|
|
181
193
|
execute: import("@tanstack/react-query").UseMutationResult<{
|
|
182
194
|
scope: "other" | "customer" | "supplier" | "partner" | "channel";
|
|
183
195
|
status: "void" | "draft" | "issued" | "sent" | "signed" | "executed" | "expired";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-contract-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-contract-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK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C,CAAA;AAEpG,MAAM,WAAW,0BAA0B;IACzC,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,0BAA0B,CAAA;CACnC;AAED,wBAAgB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBI,MAAM;eAAS,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkHzE,MAAM;gBACF,kCAAkC;;;;;;;;;;;;;;;;;;;;YA6BtC,MAAM;gBACF,kCAAkC;;EA8B/C"}
|
|
@@ -49,8 +49,14 @@ export function useLegalContractMutation() {
|
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
const send = useMutation({
|
|
52
|
-
mutationFn: async (
|
|
53
|
-
|
|
52
|
+
mutationFn: async (input) => {
|
|
53
|
+
// Back-compat: callers that just need the status flip can keep
|
|
54
|
+
// passing the id string. New callers (ContractSendDialog) pass
|
|
55
|
+
// `{ id, input: { subject, message, recipientEmail } }` so the
|
|
56
|
+
// route can carry their customization onto the `contract.sent`
|
|
57
|
+
// lifecycle event.
|
|
58
|
+
const normalized = typeof input === "string" ? { id: input, input: {} } : input;
|
|
59
|
+
const { data } = await fetchWithValidation(`/v1/admin/legal/contracts/${normalized.id}/send`, legalContractSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(normalized.input ?? {}) });
|
|
54
60
|
return data;
|
|
55
61
|
},
|
|
56
62
|
onSuccess: (data) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/legal-react",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-dom": "^19.0.0",
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@voyantjs/legal": "0.52.
|
|
44
|
+
"@voyantjs/legal": "0.52.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"typescript": "^6.0.2",
|
|
53
53
|
"vitest": "^4.1.2",
|
|
54
54
|
"zod": "^4.3.6",
|
|
55
|
-
"@voyantjs/
|
|
56
|
-
"@voyantjs/
|
|
55
|
+
"@voyantjs/react": "0.52.2",
|
|
56
|
+
"@voyantjs/legal": "0.52.2",
|
|
57
57
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@voyantjs/react": "0.52.
|
|
60
|
+
"@voyantjs/react": "0.52.2"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|
|
63
63
|
"dist"
|