@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
package/dist/js/orpc-client.js
CHANGED
|
@@ -136,6 +136,7 @@ __export(orpc_client_exports, {
|
|
|
136
136
|
FilePathSchema: () => FilePathSchema2,
|
|
137
137
|
FilePropertyArraySchema: () => FilePropertyArraySchema,
|
|
138
138
|
FilePropertySingleSchema: () => FilePropertySingleSchema,
|
|
139
|
+
FileResponseSchema: () => FileResponseSchema,
|
|
139
140
|
FileS3UploadUrlSchema: () => FileS3UploadUrlSchema,
|
|
140
141
|
FilenameWithDataSchema: () => FilenameWithDataSchema,
|
|
141
142
|
FinishDocsRegisterV1InputSchema: () => FinishDocsRegisterV1InputSchema,
|
|
@@ -329,6 +330,9 @@ __export(orpc_client_exports, {
|
|
|
329
330
|
PullRequestSchema: () => PullRequestSchema,
|
|
330
331
|
PullRequestState: () => PullRequestState,
|
|
331
332
|
PullRequestStateSchema: () => PullRequestStateSchema,
|
|
333
|
+
PutContentInputSchema: () => PutContentInputSchema,
|
|
334
|
+
PutContentResponseSchema: () => PutContentResponseSchema,
|
|
335
|
+
PutFileInputSchema: () => PutFileInputSchema,
|
|
332
336
|
PythonLibraryDocsConfigSchema: () => PythonLibraryDocsConfigSchema,
|
|
333
337
|
PythonPackageSchema: () => PythonPackageSchema,
|
|
334
338
|
QueryParameterSchema: () => QueryParameterSchema,
|
|
@@ -475,6 +479,7 @@ __export(orpc_client_exports, {
|
|
|
475
479
|
WithDescriptionSchema: () => WithDescriptionSchema,
|
|
476
480
|
WithNamespaceSchema: () => WithNamespaceSchema,
|
|
477
481
|
YankSchema: () => YankSchema,
|
|
482
|
+
contentContract: () => contentContract,
|
|
478
483
|
createApiClient: () => createApiClient,
|
|
479
484
|
createDashboardClient: () => createDashboardClient,
|
|
480
485
|
createDocsCacheClient: () => createDocsCacheClient,
|
|
@@ -505,6 +510,7 @@ __export(orpc_client_exports, {
|
|
|
505
510
|
docsV1WriteContract: () => docsV1WriteContract,
|
|
506
511
|
docsV2ReadContract: () => docsV2ReadContract,
|
|
507
512
|
docsV2WriteContract: () => docsV2WriteContract,
|
|
513
|
+
filesContract: () => filesContract,
|
|
508
514
|
generatorCliContract: () => generatorCliContract,
|
|
509
515
|
generatorVersionsContract: () => generatorVersionsContract,
|
|
510
516
|
generatorsContract: () => generatorsContract,
|
|
@@ -4942,6 +4948,49 @@ function createFdrORPCClient(options) {
|
|
|
4942
4948
|
tokens: createTokensClient(normalizedOptions)
|
|
4943
4949
|
};
|
|
4944
4950
|
}
|
|
4951
|
+
|
|
4952
|
+
// src/orpc-client/files/contract.ts
|
|
4953
|
+
var import_contract39 = require("@orpc/contract");
|
|
4954
|
+
var z30 = __toESM(require("zod"), 1);
|
|
4955
|
+
var PutContentInputSchema = z30.object({
|
|
4956
|
+
contentType: z30.string(),
|
|
4957
|
+
contentLength: z30.number().int().positive()
|
|
4958
|
+
});
|
|
4959
|
+
var PutContentResponseSchema = z30.discriminatedUnion("status", [
|
|
4960
|
+
/** Content already exists in storage — client can skip the S3 upload. */
|
|
4961
|
+
z30.object({ status: z30.literal("exists") }),
|
|
4962
|
+
/** Content is new — client should PUT the file bytes to uploadUrl, then call PUT /files. */
|
|
4963
|
+
z30.object({ status: z30.literal("upload_required"), uploadUrl: z30.string() })
|
|
4964
|
+
]);
|
|
4965
|
+
var PutFileInputSchema = z30.object({
|
|
4966
|
+
hash: z30.string(),
|
|
4967
|
+
contentType: z30.string()
|
|
4968
|
+
});
|
|
4969
|
+
var FileResponseSchema = z30.object({
|
|
4970
|
+
/** SHA-256 hex digest of the file content (64 characters). */
|
|
4971
|
+
hash: z30.string(),
|
|
4972
|
+
/** Presigned S3 GET URL. TTL is configurable (default 3600 seconds). */
|
|
4973
|
+
downloadUrl: z30.string()
|
|
4974
|
+
});
|
|
4975
|
+
var contentContract = {
|
|
4976
|
+
/**
|
|
4977
|
+
* Check whether content exists or obtain a presigned S3 upload URL.
|
|
4978
|
+
* Requires org membership or super-user.
|
|
4979
|
+
*/
|
|
4980
|
+
putContent: import_contract39.oc.route({ method: "PUT", path: "/" }).input(PutContentInputSchema).output(PutContentResponseSchema)
|
|
4981
|
+
};
|
|
4982
|
+
var filesContract = {
|
|
4983
|
+
/**
|
|
4984
|
+
* Bind a content hash to an org-scoped file path, confirming the S3 upload.
|
|
4985
|
+
* Requires org admin or super-user.
|
|
4986
|
+
*/
|
|
4987
|
+
putFile: import_contract39.oc.route({ method: "PUT", path: "/" }).input(PutFileInputSchema).output(FileResponseSchema),
|
|
4988
|
+
/**
|
|
4989
|
+
* Get a presigned download URL for an org file.
|
|
4990
|
+
* Requires org membership or super-user.
|
|
4991
|
+
*/
|
|
4992
|
+
getFile: import_contract39.oc.route({ method: "GET", path: "/" }).output(FileResponseSchema)
|
|
4993
|
+
};
|
|
4945
4994
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4946
4995
|
0 && (module.exports = {
|
|
4947
4996
|
AlgoliaDomainInputSchema,
|
|
@@ -5050,6 +5099,7 @@ function createFdrORPCClient(options) {
|
|
|
5050
5099
|
FilePathSchema,
|
|
5051
5100
|
FilePropertyArraySchema,
|
|
5052
5101
|
FilePropertySingleSchema,
|
|
5102
|
+
FileResponseSchema,
|
|
5053
5103
|
FileS3UploadUrlSchema,
|
|
5054
5104
|
FilenameWithDataSchema,
|
|
5055
5105
|
FinishDocsRegisterV1InputSchema,
|
|
@@ -5243,6 +5293,9 @@ function createFdrORPCClient(options) {
|
|
|
5243
5293
|
PullRequestSchema,
|
|
5244
5294
|
PullRequestState,
|
|
5245
5295
|
PullRequestStateSchema,
|
|
5296
|
+
PutContentInputSchema,
|
|
5297
|
+
PutContentResponseSchema,
|
|
5298
|
+
PutFileInputSchema,
|
|
5246
5299
|
PythonLibraryDocsConfigSchema,
|
|
5247
5300
|
PythonPackageSchema,
|
|
5248
5301
|
QueryParameterSchema,
|
|
@@ -5389,6 +5442,7 @@ function createFdrORPCClient(options) {
|
|
|
5389
5442
|
WithDescriptionSchema,
|
|
5390
5443
|
WithNamespaceSchema,
|
|
5391
5444
|
YankSchema,
|
|
5445
|
+
contentContract,
|
|
5392
5446
|
createApiClient,
|
|
5393
5447
|
createDashboardClient,
|
|
5394
5448
|
createDocsCacheClient,
|
|
@@ -5419,6 +5473,7 @@ function createFdrORPCClient(options) {
|
|
|
5419
5473
|
docsV1WriteContract,
|
|
5420
5474
|
docsV2ReadContract,
|
|
5421
5475
|
docsV2WriteContract,
|
|
5476
|
+
filesContract,
|
|
5422
5477
|
generatorCliContract,
|
|
5423
5478
|
generatorVersionsContract,
|
|
5424
5479
|
generatorsContract,
|