@fern-api/fdr-sdk 1.1.23-2bdec6cd78 → 1.1.23-bebb482a16
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/js/orpc-client.js +55 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +49 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/orpc-client/files/contract.d.ts +138 -0
- package/dist/types/orpc-client/files/contract.d.ts.map +1 -0
- package/dist/types/orpc-client/files/index.d.ts +2 -0
- package/dist/types/orpc-client/files/index.d.ts.map +1 -0
- package/dist/types/orpc-client/index.d.ts +1 -0
- package/dist/types/orpc-client/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Client checks whether content already exists before uploading.
|
|
4
|
+
* hash is in the URL path; contentType and contentLength describe the file.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PutContentInputSchema: z.ZodObject<{
|
|
7
|
+
contentType: z.ZodString;
|
|
8
|
+
contentLength: z.ZodNumber;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
contentType: string;
|
|
11
|
+
contentLength: number;
|
|
12
|
+
}, {
|
|
13
|
+
contentType: string;
|
|
14
|
+
contentLength: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const PutContentResponseSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
17
|
+
status: z.ZodLiteral<"exists">;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
status: "exists";
|
|
20
|
+
}, {
|
|
21
|
+
status: "exists";
|
|
22
|
+
}>, z.ZodObject<{
|
|
23
|
+
status: z.ZodLiteral<"upload_required">;
|
|
24
|
+
uploadUrl: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
status: "upload_required";
|
|
27
|
+
uploadUrl: string;
|
|
28
|
+
}, {
|
|
29
|
+
status: "upload_required";
|
|
30
|
+
uploadUrl: string;
|
|
31
|
+
}>]>;
|
|
32
|
+
/**
|
|
33
|
+
* Finalises an upload by binding a hash to an org-scoped file path.
|
|
34
|
+
* orgId and filePath are in the URL path.
|
|
35
|
+
* contentType is required so FDR can write the content record if not yet present.
|
|
36
|
+
* Supports If-Match header for optimistic concurrency on the path binding.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PutFileInputSchema: z.ZodObject<{
|
|
39
|
+
hash: z.ZodString;
|
|
40
|
+
contentType: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
contentType: string;
|
|
43
|
+
hash: string;
|
|
44
|
+
}, {
|
|
45
|
+
contentType: string;
|
|
46
|
+
hash: string;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const FileResponseSchema: z.ZodObject<{
|
|
49
|
+
/** SHA-256 hex digest of the file content (64 characters). */
|
|
50
|
+
hash: z.ZodString;
|
|
51
|
+
/** Presigned S3 GET URL. TTL is configurable (default 3600 seconds). */
|
|
52
|
+
downloadUrl: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
downloadUrl: string;
|
|
55
|
+
hash: string;
|
|
56
|
+
}, {
|
|
57
|
+
downloadUrl: string;
|
|
58
|
+
hash: string;
|
|
59
|
+
}>;
|
|
60
|
+
export type PutContentInput = z.infer<typeof PutContentInputSchema>;
|
|
61
|
+
export type PutContentResponse = z.infer<typeof PutContentResponseSchema>;
|
|
62
|
+
export type PutFileInput = z.infer<typeof PutFileInputSchema>;
|
|
63
|
+
export type FileResponse = z.infer<typeof FileResponseSchema>;
|
|
64
|
+
export declare const contentContract: {
|
|
65
|
+
/**
|
|
66
|
+
* Check whether content exists or obtain a presigned S3 upload URL.
|
|
67
|
+
* Requires org membership or super-user.
|
|
68
|
+
*/
|
|
69
|
+
putContent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
70
|
+
contentType: z.ZodString;
|
|
71
|
+
contentLength: z.ZodNumber;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
contentType: string;
|
|
74
|
+
contentLength: number;
|
|
75
|
+
}, {
|
|
76
|
+
contentType: string;
|
|
77
|
+
contentLength: number;
|
|
78
|
+
}>, z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
79
|
+
status: z.ZodLiteral<"exists">;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
status: "exists";
|
|
82
|
+
}, {
|
|
83
|
+
status: "exists";
|
|
84
|
+
}>, z.ZodObject<{
|
|
85
|
+
status: z.ZodLiteral<"upload_required">;
|
|
86
|
+
uploadUrl: z.ZodString;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
status: "upload_required";
|
|
89
|
+
uploadUrl: string;
|
|
90
|
+
}, {
|
|
91
|
+
status: "upload_required";
|
|
92
|
+
uploadUrl: string;
|
|
93
|
+
}>]>, Record<never, never>, Record<never, never>>;
|
|
94
|
+
};
|
|
95
|
+
export declare const filesContract: {
|
|
96
|
+
/**
|
|
97
|
+
* Bind a content hash to an org-scoped file path, confirming the S3 upload.
|
|
98
|
+
* Requires org admin or super-user.
|
|
99
|
+
*/
|
|
100
|
+
putFile: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
101
|
+
hash: z.ZodString;
|
|
102
|
+
contentType: z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
contentType: string;
|
|
105
|
+
hash: string;
|
|
106
|
+
}, {
|
|
107
|
+
contentType: string;
|
|
108
|
+
hash: string;
|
|
109
|
+
}>, z.ZodObject<{
|
|
110
|
+
/** SHA-256 hex digest of the file content (64 characters). */
|
|
111
|
+
hash: z.ZodString;
|
|
112
|
+
/** Presigned S3 GET URL. TTL is configurable (default 3600 seconds). */
|
|
113
|
+
downloadUrl: z.ZodString;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
downloadUrl: string;
|
|
116
|
+
hash: string;
|
|
117
|
+
}, {
|
|
118
|
+
downloadUrl: string;
|
|
119
|
+
hash: string;
|
|
120
|
+
}>, Record<never, never>, Record<never, never>>;
|
|
121
|
+
/**
|
|
122
|
+
* Get a presigned download URL for an org file.
|
|
123
|
+
* Requires org membership or super-user.
|
|
124
|
+
*/
|
|
125
|
+
getFile: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
126
|
+
/** SHA-256 hex digest of the file content (64 characters). */
|
|
127
|
+
hash: z.ZodString;
|
|
128
|
+
/** Presigned S3 GET URL. TTL is configurable (default 3600 seconds). */
|
|
129
|
+
downloadUrl: z.ZodString;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
downloadUrl: string;
|
|
132
|
+
hash: string;
|
|
133
|
+
}, {
|
|
134
|
+
downloadUrl: string;
|
|
135
|
+
hash: string;
|
|
136
|
+
}>, Record<never, never>, Record<never, never>>;
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/orpc-client/files/contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;IAKnC,CAAC;AAIH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAIH,eAAO,MAAM,kBAAkB;IAC3B,8DAA8D;;IAE9D,wEAAwE;;;;;;;;EAE1E,CAAC;AAIH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,eAAe;IACxB;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;CAEN,CAAC;AAEF,eAAO,MAAM,aAAa;IACtB;;;OAGG;;;;;;;;;;;QA3BH,8DAA8D;;QAE9D,wEAAwE;;;;;;;;;IA4BxE;;;OAGG;;QAjCH,8DAA8D;;QAE9D,wEAAwE;;;;;;;;;CAiC3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/orpc-client/files/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -4,6 +4,7 @@ export * from "./dashboard/index.js";
|
|
|
4
4
|
export * from "./docs/index.js";
|
|
5
5
|
export * from "./docs-cache/index.js";
|
|
6
6
|
export * from "./docs-deployment/index.js";
|
|
7
|
+
export * from "./files/index.js";
|
|
7
8
|
export * from "./generators/index.js";
|
|
8
9
|
export * from "./git/index.js";
|
|
9
10
|
export * from "./pdf-export/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orpc-client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orpc-client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|