@mesadev/sdk 0.1.7 → 0.2.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.
- package/README.md +220 -183
- package/dist/commonjs/funcs/contentGet.d.ts +1 -1
- package/dist/commonjs/funcs/contentGet.js +1 -1
- package/dist/commonjs/funcs/lfsDownload.d.ts +18 -0
- package/dist/commonjs/funcs/lfsDownload.d.ts.map +1 -0
- package/dist/commonjs/funcs/lfsDownload.js +129 -0
- package/dist/commonjs/funcs/lfsDownload.js.map +1 -0
- package/dist/commonjs/funcs/lfsUpload.d.ts +18 -0
- package/dist/commonjs/funcs/lfsUpload.d.ts.map +1 -0
- package/dist/commonjs/funcs/lfsUpload.js +129 -0
- package/dist/commonjs/funcs/lfsUpload.js.map +1 -0
- package/dist/commonjs/funcs/mergePerform.d.ts +18 -0
- package/dist/commonjs/funcs/mergePerform.d.ts.map +1 -0
- package/dist/commonjs/funcs/mergePerform.js +133 -0
- package/dist/commonjs/funcs/mergePerform.js.map +1 -0
- package/dist/commonjs/funcs/reposGet.js +1 -1
- package/dist/commonjs/funcs/reposGet.js.map +1 -1
- package/dist/commonjs/helpers/index.d.ts +8 -0
- package/dist/commonjs/helpers/index.d.ts.map +1 -0
- package/dist/commonjs/helpers/index.js +24 -0
- package/dist/commonjs/helpers/index.js.map +1 -0
- package/dist/commonjs/helpers/lfs.d.ts +103 -0
- package/dist/commonjs/helpers/lfs.d.ts.map +1 -0
- package/dist/commonjs/helpers/lfs.js +266 -0
- package/dist/commonjs/helpers/lfs.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/errors/index.d.ts +3 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +3 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjects.d.ts +151 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjects.d.ts.map +1 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjects.js +233 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjects.js.map +1 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjectsdownload.d.ts +151 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjectsdownload.d.ts.map +1 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjectsdownload.js +244 -0
- package/dist/commonjs/models/errors/postbyorgbyrepolfsobjectsdownload.js.map +1 -0
- package/dist/commonjs/models/errors/postbyorgbyrepomergebybase.d.ts +151 -0
- package/dist/commonjs/models/errors/postbyorgbyrepomergebybase.d.ts.map +1 -0
- package/dist/commonjs/models/errors/postbyorgbyrepomergebybase.js +234 -0
- package/dist/commonjs/models/errors/postbyorgbyrepomergebybase.js.map +1 -0
- package/dist/commonjs/models/operations/getbyorg.d.ts +0 -1
- package/dist/commonjs/models/operations/getbyorg.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbyorg.js +0 -2
- package/dist/commonjs/models/operations/getbyorg.js.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyrepo.d.ts +105 -14
- package/dist/commonjs/models/operations/getbyorgbyrepo.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyrepo.js +98 -17
- package/dist/commonjs/models/operations/getbyorgbyrepo.js.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyrepocontent.d.ts +2 -0
- package/dist/commonjs/models/operations/getbyorgbyrepocontent.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyrepocontent.js +4 -0
- package/dist/commonjs/models/operations/getbyorgbyrepocontent.js.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyreposync.d.ts +11 -2
- package/dist/commonjs/models/operations/getbyorgbyreposync.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbyorgbyreposync.js +11 -1
- package/dist/commonjs/models/operations/getbyorgbyreposync.js.map +1 -1
- package/dist/commonjs/models/operations/getbyorgrepos.d.ts +9 -1
- package/dist/commonjs/models/operations/getbyorgrepos.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbyorgrepos.js +6 -2
- package/dist/commonjs/models/operations/getbyorgrepos.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/patchbyorgbyrepo.d.ts +33 -13
- package/dist/commonjs/models/operations/patchbyorgbyrepo.d.ts.map +1 -1
- package/dist/commonjs/models/operations/patchbyorgbyrepo.js +35 -20
- package/dist/commonjs/models/operations/patchbyorgbyrepo.js.map +1 -1
- package/dist/commonjs/models/operations/postbyorgbyrepocommits.d.ts +28 -4
- package/dist/commonjs/models/operations/postbyorgbyrepocommits.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postbyorgbyrepocommits.js +21 -1
- package/dist/commonjs/models/operations/postbyorgbyrepocommits.js.map +1 -1
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjects.d.ts +138 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjects.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjects.js +180 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjects.js.map +1 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjectsdownload.d.ts +138 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjectsdownload.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjectsdownload.js +186 -0
- package/dist/commonjs/models/operations/postbyorgbyrepolfsobjectsdownload.js.map +1 -0
- package/dist/commonjs/models/operations/postbyorgbyrepomergebybase.d.ts +177 -0
- package/dist/commonjs/models/operations/postbyorgbyrepomergebybase.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postbyorgbyrepomergebybase.js +180 -0
- package/dist/commonjs/models/operations/postbyorgbyrepomergebybase.js.map +1 -0
- package/dist/commonjs/models/operations/postbyorgrepos.d.ts +31 -13
- package/dist/commonjs/models/operations/postbyorgrepos.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postbyorgrepos.js +28 -18
- package/dist/commonjs/models/operations/postbyorgrepos.js.map +1 -1
- package/dist/commonjs/sdk/content.d.ts +1 -1
- package/dist/commonjs/sdk/content.js +1 -1
- package/dist/commonjs/sdk/lfs.d.ts +19 -0
- package/dist/commonjs/sdk/lfs.d.ts.map +1 -0
- package/dist/commonjs/sdk/lfs.js +32 -0
- package/dist/commonjs/sdk/lfs.js.map +1 -0
- package/dist/commonjs/sdk/merge.d.ts +12 -0
- package/dist/commonjs/sdk/merge.d.ts.map +1 -0
- package/dist/commonjs/sdk/merge.js +22 -0
- package/dist/commonjs/sdk/merge.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +6 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +8 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/types/smartUnion.js +7 -0
- package/dist/commonjs/types/smartUnion.js.map +1 -1
- package/dist/esm/funcs/contentGet.d.ts +1 -1
- package/dist/esm/funcs/contentGet.js +1 -1
- package/dist/esm/funcs/lfsDownload.d.ts +18 -0
- package/dist/esm/funcs/lfsDownload.d.ts.map +1 -0
- package/dist/esm/funcs/lfsDownload.js +93 -0
- package/dist/esm/funcs/lfsDownload.js.map +1 -0
- package/dist/esm/funcs/lfsUpload.d.ts +18 -0
- package/dist/esm/funcs/lfsUpload.d.ts.map +1 -0
- package/dist/esm/funcs/lfsUpload.js +93 -0
- package/dist/esm/funcs/lfsUpload.js.map +1 -0
- package/dist/esm/funcs/mergePerform.d.ts +18 -0
- package/dist/esm/funcs/mergePerform.d.ts.map +1 -0
- package/dist/esm/funcs/mergePerform.js +97 -0
- package/dist/esm/funcs/mergePerform.js.map +1 -0
- package/dist/esm/funcs/reposGet.js +1 -1
- package/dist/esm/funcs/reposGet.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +8 -0
- package/dist/esm/helpers/index.d.ts.map +1 -0
- package/dist/esm/helpers/index.js +8 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/lfs.d.ts +103 -0
- package/dist/esm/helpers/lfs.d.ts.map +1 -0
- package/dist/esm/helpers/lfs.js +263 -0
- package/dist/esm/helpers/lfs.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/errors/index.d.ts +3 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +3 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/postbyorgbyrepolfsobjects.d.ts +151 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjects.d.ts.map +1 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjects.js +190 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjects.js.map +1 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjectsdownload.d.ts +151 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjectsdownload.d.ts.map +1 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjectsdownload.js +201 -0
- package/dist/esm/models/errors/postbyorgbyrepolfsobjectsdownload.js.map +1 -0
- package/dist/esm/models/errors/postbyorgbyrepomergebybase.d.ts +151 -0
- package/dist/esm/models/errors/postbyorgbyrepomergebybase.d.ts.map +1 -0
- package/dist/esm/models/errors/postbyorgbyrepomergebybase.js +191 -0
- package/dist/esm/models/errors/postbyorgbyrepomergebybase.js.map +1 -0
- package/dist/esm/models/operations/getbyorg.d.ts +0 -1
- package/dist/esm/models/operations/getbyorg.d.ts.map +1 -1
- package/dist/esm/models/operations/getbyorg.js +0 -2
- package/dist/esm/models/operations/getbyorg.js.map +1 -1
- package/dist/esm/models/operations/getbyorgbyrepo.d.ts +105 -14
- package/dist/esm/models/operations/getbyorgbyrepo.d.ts.map +1 -1
- package/dist/esm/models/operations/getbyorgbyrepo.js +91 -14
- package/dist/esm/models/operations/getbyorgbyrepo.js.map +1 -1
- package/dist/esm/models/operations/getbyorgbyrepocontent.d.ts +2 -0
- package/dist/esm/models/operations/getbyorgbyrepocontent.d.ts.map +1 -1
- package/dist/esm/models/operations/getbyorgbyrepocontent.js +4 -0
- package/dist/esm/models/operations/getbyorgbyrepocontent.js.map +1 -1
- package/dist/esm/models/operations/getbyorgbyreposync.d.ts +11 -2
- package/dist/esm/models/operations/getbyorgbyreposync.d.ts.map +1 -1
- package/dist/esm/models/operations/getbyorgbyreposync.js +9 -0
- package/dist/esm/models/operations/getbyorgbyreposync.js.map +1 -1
- package/dist/esm/models/operations/getbyorgrepos.d.ts +9 -1
- package/dist/esm/models/operations/getbyorgrepos.d.ts.map +1 -1
- package/dist/esm/models/operations/getbyorgrepos.js +6 -2
- package/dist/esm/models/operations/getbyorgrepos.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/patchbyorgbyrepo.d.ts +33 -13
- package/dist/esm/models/operations/patchbyorgbyrepo.d.ts.map +1 -1
- package/dist/esm/models/operations/patchbyorgbyrepo.js +32 -17
- package/dist/esm/models/operations/patchbyorgbyrepo.js.map +1 -1
- package/dist/esm/models/operations/postbyorgbyrepocommits.d.ts +28 -4
- package/dist/esm/models/operations/postbyorgbyrepocommits.d.ts.map +1 -1
- package/dist/esm/models/operations/postbyorgbyrepocommits.js +18 -0
- package/dist/esm/models/operations/postbyorgbyrepocommits.js.map +1 -1
- package/dist/esm/models/operations/postbyorgbyrepolfsobjects.d.ts +138 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjects.d.ts.map +1 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjects.js +131 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjects.js.map +1 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjectsdownload.d.ts +138 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjectsdownload.d.ts.map +1 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjectsdownload.js +137 -0
- package/dist/esm/models/operations/postbyorgbyrepolfsobjectsdownload.js.map +1 -0
- package/dist/esm/models/operations/postbyorgbyrepomergebybase.d.ts +177 -0
- package/dist/esm/models/operations/postbyorgbyrepomergebybase.d.ts.map +1 -0
- package/dist/esm/models/operations/postbyorgbyrepomergebybase.js +133 -0
- package/dist/esm/models/operations/postbyorgbyrepomergebybase.js.map +1 -0
- package/dist/esm/models/operations/postbyorgrepos.d.ts +31 -13
- package/dist/esm/models/operations/postbyorgrepos.d.ts.map +1 -1
- package/dist/esm/models/operations/postbyorgrepos.js +25 -15
- package/dist/esm/models/operations/postbyorgrepos.js.map +1 -1
- package/dist/esm/sdk/content.d.ts +1 -1
- package/dist/esm/sdk/content.js +1 -1
- package/dist/esm/sdk/lfs.d.ts +19 -0
- package/dist/esm/sdk/lfs.d.ts.map +1 -0
- package/dist/esm/sdk/lfs.js +28 -0
- package/dist/esm/sdk/lfs.js.map +1 -0
- package/dist/esm/sdk/merge.d.ts +12 -0
- package/dist/esm/sdk/merge.d.ts.map +1 -0
- package/dist/esm/sdk/merge.js +18 -0
- package/dist/esm/sdk/merge.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +6 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +8 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/types/smartUnion.js +7 -0
- package/dist/esm/types/smartUnion.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/contentGet.ts +1 -1
- package/src/funcs/lfsDownload.ts +233 -0
- package/src/funcs/lfsUpload.ts +224 -0
- package/src/funcs/mergePerform.ts +234 -0
- package/src/funcs/reposGet.ts +1 -0
- package/src/helpers/index.ts +8 -0
- package/src/helpers/lfs.ts +410 -0
- package/src/lib/config.ts +3 -3
- package/src/models/errors/index.ts +3 -0
- package/src/models/errors/postbyorgbyrepolfsobjects.ts +358 -0
- package/src/models/errors/postbyorgbyrepolfsobjectsdownload.ts +379 -0
- package/src/models/errors/postbyorgbyrepomergebybase.ts +359 -0
- package/src/models/operations/getbyorg.ts +0 -3
- package/src/models/operations/getbyorgbyrepo.ts +249 -32
- package/src/models/operations/getbyorgbyrepocontent.ts +6 -0
- package/src/models/operations/getbyorgbyreposync.ts +33 -1
- package/src/models/operations/getbyorgrepos.ts +15 -3
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/patchbyorgbyrepo.ts +84 -41
- package/src/models/operations/postbyorgbyrepocommits.ts +62 -4
- package/src/models/operations/postbyorgbyrepolfsobjects.ts +411 -0
- package/src/models/operations/postbyorgbyrepolfsobjectsdownload.ts +442 -0
- package/src/models/operations/postbyorgbyrepomergebybase.ts +428 -0
- package/src/models/operations/postbyorgrepos.ts +69 -35
- package/src/sdk/content.ts +1 -1
- package/src/sdk/lfs.ts +45 -0
- package/src/sdk/merge.ts +27 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/types/smartUnion.ts +8 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { MesaCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { MesaError } from "../models/errors/mesaerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Merge branches
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Merge a head branch into a base branch. Performs a fast-forward merge when possible, otherwise creates a merge commit. Returns 409 if there are merge conflicts.
|
|
34
|
+
*/
|
|
35
|
+
export function mergePerform(
|
|
36
|
+
client: MesaCore,
|
|
37
|
+
request: operations.PostByOrgByRepoMergeByBaseRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.PostByOrgByRepoMergeByBaseResponse,
|
|
42
|
+
| errors.PostByOrgByRepoMergeByBaseBadRequestError
|
|
43
|
+
| errors.PostByOrgByRepoMergeByBaseUnauthorizedError
|
|
44
|
+
| errors.PostByOrgByRepoMergeByBaseForbiddenError
|
|
45
|
+
| errors.PostByOrgByRepoMergeByBaseNotFoundError
|
|
46
|
+
| errors.PostByOrgByRepoMergeByBaseNotAcceptableError
|
|
47
|
+
| errors.PostByOrgByRepoMergeByBaseConflictError
|
|
48
|
+
| errors.PostByOrgByRepoMergeByBaseInternalServerError
|
|
49
|
+
| MesaError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: MesaCore,
|
|
68
|
+
request: operations.PostByOrgByRepoMergeByBaseRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.PostByOrgByRepoMergeByBaseResponse,
|
|
74
|
+
| errors.PostByOrgByRepoMergeByBaseBadRequestError
|
|
75
|
+
| errors.PostByOrgByRepoMergeByBaseUnauthorizedError
|
|
76
|
+
| errors.PostByOrgByRepoMergeByBaseForbiddenError
|
|
77
|
+
| errors.PostByOrgByRepoMergeByBaseNotFoundError
|
|
78
|
+
| errors.PostByOrgByRepoMergeByBaseNotAcceptableError
|
|
79
|
+
| errors.PostByOrgByRepoMergeByBaseConflictError
|
|
80
|
+
| errors.PostByOrgByRepoMergeByBaseInternalServerError
|
|
81
|
+
| MesaError
|
|
82
|
+
| ResponseValidationError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| InvalidRequestError
|
|
87
|
+
| UnexpectedClientError
|
|
88
|
+
| SDKValidationError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
z.parse(
|
|
97
|
+
operations.PostByOrgByRepoMergeByBaseRequest$outboundSchema,
|
|
98
|
+
value,
|
|
99
|
+
),
|
|
100
|
+
"Input validation failed",
|
|
101
|
+
);
|
|
102
|
+
if (!parsed.ok) {
|
|
103
|
+
return [parsed, { status: "invalid" }];
|
|
104
|
+
}
|
|
105
|
+
const payload = parsed.value;
|
|
106
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
107
|
+
|
|
108
|
+
const pathParams = {
|
|
109
|
+
base: encodeSimple("base", payload.base, {
|
|
110
|
+
explode: false,
|
|
111
|
+
charEncoding: "percent",
|
|
112
|
+
}),
|
|
113
|
+
org: encodeSimple("org", payload.org, {
|
|
114
|
+
explode: false,
|
|
115
|
+
charEncoding: "percent",
|
|
116
|
+
}),
|
|
117
|
+
repo: encodeSimple("repo", payload.repo, {
|
|
118
|
+
explode: false,
|
|
119
|
+
charEncoding: "percent",
|
|
120
|
+
}),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const path = pathToFunc("/{org}/{repo}/merge/{base}")(pathParams);
|
|
124
|
+
|
|
125
|
+
const headers = new Headers(compactMap({
|
|
126
|
+
"Content-Type": "application/json",
|
|
127
|
+
Accept: "application/json",
|
|
128
|
+
}));
|
|
129
|
+
|
|
130
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
131
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
132
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
133
|
+
|
|
134
|
+
const context = {
|
|
135
|
+
options: client._options,
|
|
136
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
137
|
+
operationID: "postByOrgByRepoMergeByBase",
|
|
138
|
+
oAuth2Scopes: null,
|
|
139
|
+
|
|
140
|
+
resolvedSecurity: requestSecurity,
|
|
141
|
+
|
|
142
|
+
securitySource: client._options.apiKey,
|
|
143
|
+
retryConfig: options?.retries
|
|
144
|
+
|| client._options.retryConfig
|
|
145
|
+
|| { strategy: "none" },
|
|
146
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const requestRes = client._createRequest(context, {
|
|
150
|
+
security: requestSecurity,
|
|
151
|
+
method: "POST",
|
|
152
|
+
baseURL: options?.serverURL,
|
|
153
|
+
path: path,
|
|
154
|
+
headers: headers,
|
|
155
|
+
body: body,
|
|
156
|
+
userAgent: client._options.userAgent,
|
|
157
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
158
|
+
}, options);
|
|
159
|
+
if (!requestRes.ok) {
|
|
160
|
+
return [requestRes, { status: "invalid" }];
|
|
161
|
+
}
|
|
162
|
+
const req = requestRes.value;
|
|
163
|
+
|
|
164
|
+
const doResult = await client._do(req, {
|
|
165
|
+
context,
|
|
166
|
+
errorCodes: ["400", "401", "403", "404", "406", "409", "4XX", "500", "5XX"],
|
|
167
|
+
retryConfig: context.retryConfig,
|
|
168
|
+
retryCodes: context.retryCodes,
|
|
169
|
+
});
|
|
170
|
+
if (!doResult.ok) {
|
|
171
|
+
return [doResult, { status: "request-error", request: req }];
|
|
172
|
+
}
|
|
173
|
+
const response = doResult.value;
|
|
174
|
+
|
|
175
|
+
const responseFields = {
|
|
176
|
+
HttpMeta: { Response: response, Request: req },
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const [result] = await M.match<
|
|
180
|
+
operations.PostByOrgByRepoMergeByBaseResponse,
|
|
181
|
+
| errors.PostByOrgByRepoMergeByBaseBadRequestError
|
|
182
|
+
| errors.PostByOrgByRepoMergeByBaseUnauthorizedError
|
|
183
|
+
| errors.PostByOrgByRepoMergeByBaseForbiddenError
|
|
184
|
+
| errors.PostByOrgByRepoMergeByBaseNotFoundError
|
|
185
|
+
| errors.PostByOrgByRepoMergeByBaseNotAcceptableError
|
|
186
|
+
| errors.PostByOrgByRepoMergeByBaseConflictError
|
|
187
|
+
| errors.PostByOrgByRepoMergeByBaseInternalServerError
|
|
188
|
+
| MesaError
|
|
189
|
+
| ResponseValidationError
|
|
190
|
+
| ConnectionError
|
|
191
|
+
| RequestAbortedError
|
|
192
|
+
| RequestTimeoutError
|
|
193
|
+
| InvalidRequestError
|
|
194
|
+
| UnexpectedClientError
|
|
195
|
+
| SDKValidationError
|
|
196
|
+
>(
|
|
197
|
+
M.json(200, operations.PostByOrgByRepoMergeByBaseResponse$inboundSchema),
|
|
198
|
+
M.jsonErr(
|
|
199
|
+
400,
|
|
200
|
+
errors.PostByOrgByRepoMergeByBaseBadRequestError$inboundSchema,
|
|
201
|
+
),
|
|
202
|
+
M.jsonErr(
|
|
203
|
+
401,
|
|
204
|
+
errors.PostByOrgByRepoMergeByBaseUnauthorizedError$inboundSchema,
|
|
205
|
+
),
|
|
206
|
+
M.jsonErr(
|
|
207
|
+
403,
|
|
208
|
+
errors.PostByOrgByRepoMergeByBaseForbiddenError$inboundSchema,
|
|
209
|
+
),
|
|
210
|
+
M.jsonErr(
|
|
211
|
+
404,
|
|
212
|
+
errors.PostByOrgByRepoMergeByBaseNotFoundError$inboundSchema,
|
|
213
|
+
),
|
|
214
|
+
M.jsonErr(
|
|
215
|
+
406,
|
|
216
|
+
errors.PostByOrgByRepoMergeByBaseNotAcceptableError$inboundSchema,
|
|
217
|
+
),
|
|
218
|
+
M.jsonErr(
|
|
219
|
+
409,
|
|
220
|
+
errors.PostByOrgByRepoMergeByBaseConflictError$inboundSchema,
|
|
221
|
+
),
|
|
222
|
+
M.jsonErr(
|
|
223
|
+
500,
|
|
224
|
+
errors.PostByOrgByRepoMergeByBaseInternalServerError$inboundSchema,
|
|
225
|
+
),
|
|
226
|
+
M.fail("4XX"),
|
|
227
|
+
M.fail("5XX"),
|
|
228
|
+
)(response, req, { extraFields: responseFields });
|
|
229
|
+
if (!result.ok) {
|
|
230
|
+
return [result, { status: "complete", request: req, response }];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return [result, { status: "complete", request: req, response }];
|
|
234
|
+
}
|
package/src/funcs/reposGet.ts
CHANGED
|
@@ -186,6 +186,7 @@ async function $do(
|
|
|
186
186
|
| SDKValidationError
|
|
187
187
|
>(
|
|
188
188
|
M.json(200, operations.GetByOrgByRepoResponse$inboundSchema),
|
|
189
|
+
M.json(202, operations.GetByOrgByRepoResponse$inboundSchema),
|
|
189
190
|
M.jsonErr(400, errors.GetByOrgByRepoBadRequestError$inboundSchema),
|
|
190
191
|
M.jsonErr(401, errors.GetByOrgByRepoUnauthorizedError$inboundSchema),
|
|
191
192
|
M.jsonErr(403, errors.GetByOrgByRepoForbiddenError$inboundSchema),
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LFS (Large File Storage) helpers for uploading large files.
|
|
3
|
+
*
|
|
4
|
+
* These helpers provide a convenient way to upload large files to a repository
|
|
5
|
+
* using Git LFS, without needing to clone the repository.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Mesa } from '@mesadev/sdk';
|
|
10
|
+
* import { uploadLargeFiles } from '@mesadev/sdk/helpers/lfs';
|
|
11
|
+
*
|
|
12
|
+
* const mesa = new Mesa({ apiKey: 'your-api-key' });
|
|
13
|
+
*
|
|
14
|
+
* const result = await uploadLargeFiles(mesa, {
|
|
15
|
+
* org: 'my-org',
|
|
16
|
+
* repo: 'my-repo',
|
|
17
|
+
* branch: 'main',
|
|
18
|
+
* message: 'Add large model file',
|
|
19
|
+
* author: { name: 'Bot', email: 'bot@example.com' },
|
|
20
|
+
* files: [{ path: 'models/model.bin', content: fileBuffer }]
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* console.log('Created commit:', result.sha);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { MesaCore } from '../core.js';
|
|
28
|
+
import { encodeJSON, encodeSimple } from '../lib/encodings.js';
|
|
29
|
+
import { compactMap } from '../lib/primitives.js';
|
|
30
|
+
import { RequestOptions } from '../lib/sdks.js';
|
|
31
|
+
import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
|
|
32
|
+
import { pathToFunc } from '../lib/url.js';
|
|
33
|
+
|
|
34
|
+
/** Input for a large file to upload via LFS */
|
|
35
|
+
export interface LargeFileInput {
|
|
36
|
+
/** File path in the repository (e.g., 'models/large-model.bin') */
|
|
37
|
+
path: string;
|
|
38
|
+
/** File content as ArrayBuffer, Uint8Array, or Blob */
|
|
39
|
+
content: ArrayBuffer | Uint8Array | Blob;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Options for uploading large files */
|
|
43
|
+
export interface UploadLargeFilesOptions {
|
|
44
|
+
/** Organization slug */
|
|
45
|
+
org: string;
|
|
46
|
+
/** Repository name */
|
|
47
|
+
repo: string;
|
|
48
|
+
/** Target branch name */
|
|
49
|
+
branch: string;
|
|
50
|
+
/** Commit message */
|
|
51
|
+
message: string;
|
|
52
|
+
/** Commit author */
|
|
53
|
+
author: {
|
|
54
|
+
name: string;
|
|
55
|
+
email: string;
|
|
56
|
+
date?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** Large files to upload */
|
|
59
|
+
files: LargeFileInput[];
|
|
60
|
+
/** Optional base SHA for optimistic locking */
|
|
61
|
+
baseSha?: string | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Result of uploading large files */
|
|
65
|
+
export interface UploadLargeFilesResult {
|
|
66
|
+
/** The commit SHA */
|
|
67
|
+
sha: string;
|
|
68
|
+
/** The branch name */
|
|
69
|
+
branch: string;
|
|
70
|
+
/** The commit message */
|
|
71
|
+
message: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Response from LFS upload endpoint */
|
|
75
|
+
interface LfsUploadResponse {
|
|
76
|
+
objects: Array<{
|
|
77
|
+
oid: string;
|
|
78
|
+
size: number;
|
|
79
|
+
upload_url?: string;
|
|
80
|
+
expires_in?: number;
|
|
81
|
+
exists: boolean;
|
|
82
|
+
error?: { code: string; message: string };
|
|
83
|
+
}>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Compute SHA-256 hash of content.
|
|
88
|
+
* Uses Web Crypto API which is available in browsers and Node.js 18+.
|
|
89
|
+
*/
|
|
90
|
+
async function computeSha256(data: ArrayBuffer): Promise<string> {
|
|
91
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
92
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
93
|
+
return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Convert various input types to ArrayBuffer
|
|
98
|
+
*/
|
|
99
|
+
async function toArrayBuffer(content: ArrayBuffer | Uint8Array | Blob): Promise<ArrayBuffer> {
|
|
100
|
+
if (content instanceof Blob) {
|
|
101
|
+
return content.arrayBuffer();
|
|
102
|
+
}
|
|
103
|
+
if (content instanceof Uint8Array) {
|
|
104
|
+
// Create a new ArrayBuffer copy to ensure we have a proper ArrayBuffer (not SharedArrayBuffer)
|
|
105
|
+
const copy = new ArrayBuffer(content.byteLength);
|
|
106
|
+
new Uint8Array(copy).set(content);
|
|
107
|
+
return copy;
|
|
108
|
+
}
|
|
109
|
+
return content;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Upload large files to a repository using LFS.
|
|
114
|
+
*
|
|
115
|
+
* This convenience method:
|
|
116
|
+
* 1. Computes SHA-256 of each file
|
|
117
|
+
* 2. Requests pre-signed upload URLs from the LFS endpoint
|
|
118
|
+
* 3. Uploads file content directly to S3
|
|
119
|
+
* 4. Creates a commit with LFS pointer references
|
|
120
|
+
*
|
|
121
|
+
* @param client - The Mesa SDK client instance
|
|
122
|
+
* @param options - Upload configuration
|
|
123
|
+
* @param requestOptions - Optional request configuration (timeout, retries, etc.)
|
|
124
|
+
* @returns The created commit details
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* import { Mesa } from '@mesadev/sdk';
|
|
129
|
+
* import { uploadLargeFiles } from '@mesadev/sdk/helpers/lfs';
|
|
130
|
+
* import { readFile } from 'fs/promises';
|
|
131
|
+
*
|
|
132
|
+
* const mesa = new Mesa({ apiKey: process.env.MESA_API_KEY });
|
|
133
|
+
* const fileContent = await readFile('./large-model.bin');
|
|
134
|
+
*
|
|
135
|
+
* const result = await uploadLargeFiles(mesa, {
|
|
136
|
+
* org: 'my-org',
|
|
137
|
+
* repo: 'my-repo',
|
|
138
|
+
* branch: 'main',
|
|
139
|
+
* message: 'Add ML model',
|
|
140
|
+
* author: { name: 'Deploy Bot', email: 'deploy@example.com' },
|
|
141
|
+
* files: [
|
|
142
|
+
* { path: 'models/classifier.bin', content: fileContent }
|
|
143
|
+
* ]
|
|
144
|
+
* });
|
|
145
|
+
*
|
|
146
|
+
* console.log(`Created commit: ${result.sha}`);
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export async function uploadLargeFiles(
|
|
150
|
+
client: MesaCore,
|
|
151
|
+
options: UploadLargeFilesOptions,
|
|
152
|
+
requestOptions?: RequestOptions
|
|
153
|
+
): Promise<UploadLargeFilesResult> {
|
|
154
|
+
const { org, repo, branch, message, author, files, baseSha } = options;
|
|
155
|
+
|
|
156
|
+
// 1. Prepare files: compute SHA-256 and convert to ArrayBuffer
|
|
157
|
+
const preparedFiles: Array<{
|
|
158
|
+
path: string;
|
|
159
|
+
oid: string;
|
|
160
|
+
size: number;
|
|
161
|
+
content: ArrayBuffer;
|
|
162
|
+
}> = [];
|
|
163
|
+
|
|
164
|
+
for (const file of files) {
|
|
165
|
+
const content = await toArrayBuffer(file.content);
|
|
166
|
+
const oid = await computeSha256(content);
|
|
167
|
+
preparedFiles.push({
|
|
168
|
+
path: file.path,
|
|
169
|
+
oid,
|
|
170
|
+
size: content.byteLength,
|
|
171
|
+
content,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// 2. Request upload URLs from LFS endpoint
|
|
176
|
+
const lfsResponse = await requestLfsUpload(client, org, repo, preparedFiles, requestOptions);
|
|
177
|
+
|
|
178
|
+
// 3. Upload files that need uploading
|
|
179
|
+
for (const obj of lfsResponse.objects) {
|
|
180
|
+
if (obj.error) {
|
|
181
|
+
throw new Error(`LFS upload failed for ${obj.oid}: ${obj.error.message}`);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (obj.upload_url) {
|
|
185
|
+
const file = preparedFiles.find((f) => f.oid === obj.oid);
|
|
186
|
+
if (!file) continue;
|
|
187
|
+
|
|
188
|
+
const uploadResponse = await fetch(obj.upload_url, {
|
|
189
|
+
method: 'PUT',
|
|
190
|
+
body: file.content,
|
|
191
|
+
headers: {
|
|
192
|
+
'Content-Length': String(file.size),
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (!uploadResponse.ok) {
|
|
197
|
+
throw new Error(`Failed to upload ${file.path} to S3: ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 4. Create commit with LFS pointers
|
|
203
|
+
// Note: The SDK needs to be regenerated to include LFS file types.
|
|
204
|
+
// For now, we make the request directly with the correct shape.
|
|
205
|
+
const commitResponse = await requestCommitWithLfs(
|
|
206
|
+
client,
|
|
207
|
+
org,
|
|
208
|
+
repo,
|
|
209
|
+
{
|
|
210
|
+
branch,
|
|
211
|
+
message,
|
|
212
|
+
author,
|
|
213
|
+
base_sha: baseSha,
|
|
214
|
+
files: preparedFiles.map((f) => ({
|
|
215
|
+
path: f.path,
|
|
216
|
+
lfs: { oid: f.oid, size: f.size },
|
|
217
|
+
})),
|
|
218
|
+
},
|
|
219
|
+
requestOptions
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
return {
|
|
223
|
+
sha: commitResponse.sha,
|
|
224
|
+
branch: commitResponse.branch,
|
|
225
|
+
message: commitResponse.message,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Make LFS upload request to get pre-signed URLs
|
|
231
|
+
*/
|
|
232
|
+
async function requestLfsUpload(
|
|
233
|
+
client: MesaCore,
|
|
234
|
+
org: string,
|
|
235
|
+
repo: string,
|
|
236
|
+
files: Array<{ oid: string; size: number }>,
|
|
237
|
+
options?: RequestOptions
|
|
238
|
+
): Promise<LfsUploadResponse> {
|
|
239
|
+
const body = encodeJSON(
|
|
240
|
+
'body',
|
|
241
|
+
{
|
|
242
|
+
objects: files.map((f) => ({ oid: f.oid, size: f.size })),
|
|
243
|
+
},
|
|
244
|
+
{ explode: true }
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
const pathParams = {
|
|
248
|
+
org: encodeSimple('org', org, { explode: false, charEncoding: 'percent' }),
|
|
249
|
+
repo: encodeSimple('repo', repo, { explode: false, charEncoding: 'percent' }),
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const path = pathToFunc('/{org}/{repo}/lfs/objects')(pathParams);
|
|
253
|
+
|
|
254
|
+
const headers = new Headers(
|
|
255
|
+
compactMap({
|
|
256
|
+
'Content-Type': 'application/json',
|
|
257
|
+
Accept: 'application/json',
|
|
258
|
+
})
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
262
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
263
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
264
|
+
|
|
265
|
+
const context = {
|
|
266
|
+
options: client._options,
|
|
267
|
+
baseURL: options?.serverURL ?? client._baseURL ?? '',
|
|
268
|
+
operationID: 'lfsUpload',
|
|
269
|
+
oAuth2Scopes: null,
|
|
270
|
+
resolvedSecurity: requestSecurity,
|
|
271
|
+
securitySource: client._options.apiKey,
|
|
272
|
+
retryConfig: options?.retries || client._options.retryConfig || { strategy: 'none' as const },
|
|
273
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const requestRes = client._createRequest(context, {
|
|
277
|
+
security: requestSecurity,
|
|
278
|
+
method: 'POST',
|
|
279
|
+
baseURL: options?.serverURL,
|
|
280
|
+
path: path,
|
|
281
|
+
headers: headers,
|
|
282
|
+
body: body,
|
|
283
|
+
userAgent: client._options.userAgent,
|
|
284
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
if (!requestRes.ok) {
|
|
288
|
+
throw new Error('Failed to create LFS upload request');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const req = requestRes.value;
|
|
292
|
+
const doResult = await client._do(req, {
|
|
293
|
+
context,
|
|
294
|
+
errorCodes: ['400', '401', '403', '404', '4XX', '500', '5XX'],
|
|
295
|
+
retryConfig: context.retryConfig,
|
|
296
|
+
retryCodes: context.retryCodes,
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
if (!doResult.ok) {
|
|
300
|
+
throw new Error(`LFS upload request failed: ${doResult.error}`);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const response = doResult.value;
|
|
304
|
+
if (!response.ok) {
|
|
305
|
+
const errorText = await response.text();
|
|
306
|
+
throw new Error(`LFS upload failed: ${response.status} ${errorText}`);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return (await response.json()) as LfsUploadResponse;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Request body for creating a commit with LFS files */
|
|
313
|
+
interface CommitWithLfsRequest {
|
|
314
|
+
branch: string;
|
|
315
|
+
message: string;
|
|
316
|
+
author: {
|
|
317
|
+
name: string;
|
|
318
|
+
email: string;
|
|
319
|
+
date?: string | undefined;
|
|
320
|
+
};
|
|
321
|
+
base_sha?: string | undefined;
|
|
322
|
+
files: Array<{
|
|
323
|
+
path: string;
|
|
324
|
+
lfs: { oid: string; size: number };
|
|
325
|
+
}>;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/** Response from create commit endpoint */
|
|
329
|
+
interface CommitResponse {
|
|
330
|
+
sha: string;
|
|
331
|
+
branch: string;
|
|
332
|
+
message: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Make commit request with LFS file references
|
|
337
|
+
*/
|
|
338
|
+
async function requestCommitWithLfs(
|
|
339
|
+
client: MesaCore,
|
|
340
|
+
org: string,
|
|
341
|
+
repo: string,
|
|
342
|
+
commitData: CommitWithLfsRequest,
|
|
343
|
+
options?: RequestOptions
|
|
344
|
+
): Promise<CommitResponse> {
|
|
345
|
+
const body = encodeJSON('body', commitData, { explode: true });
|
|
346
|
+
|
|
347
|
+
const pathParams = {
|
|
348
|
+
org: encodeSimple('org', org, { explode: false, charEncoding: 'percent' }),
|
|
349
|
+
repo: encodeSimple('repo', repo, { explode: false, charEncoding: 'percent' }),
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
const path = pathToFunc('/{org}/{repo}/commits')(pathParams);
|
|
353
|
+
|
|
354
|
+
const headers = new Headers(
|
|
355
|
+
compactMap({
|
|
356
|
+
'Content-Type': 'application/json',
|
|
357
|
+
Accept: 'application/json',
|
|
358
|
+
})
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
362
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
363
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
364
|
+
|
|
365
|
+
const context = {
|
|
366
|
+
options: client._options,
|
|
367
|
+
baseURL: options?.serverURL ?? client._baseURL ?? '',
|
|
368
|
+
operationID: 'commitsCreate',
|
|
369
|
+
oAuth2Scopes: null,
|
|
370
|
+
resolvedSecurity: requestSecurity,
|
|
371
|
+
securitySource: client._options.apiKey,
|
|
372
|
+
retryConfig: options?.retries || client._options.retryConfig || { strategy: 'none' as const },
|
|
373
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const requestRes = client._createRequest(context, {
|
|
377
|
+
security: requestSecurity,
|
|
378
|
+
method: 'POST',
|
|
379
|
+
baseURL: options?.serverURL,
|
|
380
|
+
path: path,
|
|
381
|
+
headers: headers,
|
|
382
|
+
body: body,
|
|
383
|
+
userAgent: client._options.userAgent,
|
|
384
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
if (!requestRes.ok) {
|
|
388
|
+
throw new Error('Failed to create commit request');
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const req = requestRes.value;
|
|
392
|
+
const doResult = await client._do(req, {
|
|
393
|
+
context,
|
|
394
|
+
errorCodes: ['400', '401', '403', '404', '406', '409', '4XX', '500', '5XX'],
|
|
395
|
+
retryConfig: context.retryConfig,
|
|
396
|
+
retryCodes: context.retryCodes,
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
if (!doResult.ok) {
|
|
400
|
+
throw new Error(`Commit request failed: ${doResult.error}`);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const response = doResult.value;
|
|
404
|
+
if (!response.ok) {
|
|
405
|
+
const errorText = await response.text();
|
|
406
|
+
throw new Error(`Commit failed: ${response.status} ${errorText}`);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return (await response.json()) as CommitResponse;
|
|
410
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "1.0.0",
|
|
61
|
-
sdkVersion: "0.
|
|
62
|
-
genVersion: "2.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
61
|
+
sdkVersion: "0.2.2",
|
|
62
|
+
genVersion: "2.821.4",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 0.2.2 2.821.4 1.0.0 @mesadev/sdk",
|
|
64
64
|
} as const;
|
|
@@ -27,6 +27,9 @@ export * from "./postbyorgapikeys.js";
|
|
|
27
27
|
export * from "./postbyorgbyrepoanalyticsrefresh.js";
|
|
28
28
|
export * from "./postbyorgbyrepobranches.js";
|
|
29
29
|
export * from "./postbyorgbyrepocommits.js";
|
|
30
|
+
export * from "./postbyorgbyrepolfsobjects.js";
|
|
31
|
+
export * from "./postbyorgbyrepolfsobjectsdownload.js";
|
|
32
|
+
export * from "./postbyorgbyrepomergebybase.js";
|
|
30
33
|
export * from "./postbyorgbyreposync.js";
|
|
31
34
|
export * from "./postbyorgbyrepowebhooks.js";
|
|
32
35
|
export * from "./postbyorgrepos.js";
|