@mesadev/sdk 0.1.2 → 0.1.4
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/.devcontainer/devcontainer.json +38 -36
- package/README.md +164 -134
- package/dist/commonjs/funcs/contentGet.js +8 -0
- package/dist/commonjs/funcs/contentGet.js.map +1 -1
- package/dist/commonjs/funcs/webhooksCreate.d.ts +18 -0
- package/dist/commonjs/funcs/webhooksCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksCreate.js +129 -0
- package/dist/commonjs/funcs/webhooksCreate.js.map +1 -0
- package/dist/commonjs/funcs/webhooksDelete.d.ts +18 -0
- package/dist/commonjs/funcs/webhooksDelete.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksDelete.js +132 -0
- package/dist/commonjs/funcs/webhooksDelete.js.map +1 -0
- package/dist/commonjs/funcs/webhooksList.d.ts +18 -0
- package/dist/commonjs/funcs/webhooksList.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksList.js +128 -0
- package/dist/commonjs/funcs/webhooksList.js.map +1 -0
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/hooks.js +0 -2
- package/dist/commonjs/hooks/hooks.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.d.ts +151 -0
- package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
- package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.js +239 -0
- package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.js.map +1 -0
- package/dist/commonjs/models/errors/getorgrepowebhooks.d.ts +151 -0
- package/dist/commonjs/models/errors/getorgrepowebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/errors/getorgrepowebhooks.js +232 -0
- package/dist/commonjs/models/errors/getorgrepowebhooks.js.map +1 -0
- 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/postorgrepowebhooks.d.ts +151 -0
- package/dist/commonjs/models/errors/postorgrepowebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/errors/postorgrepowebhooks.js +232 -0
- package/dist/commonjs/models/errors/postorgrepowebhooks.js.map +1 -0
- package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.d.ts +97 -0
- package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
- package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.js +138 -0
- package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.js.map +1 -0
- package/dist/commonjs/models/operations/getorgrepobranches.d.ts +1 -1
- package/dist/commonjs/models/operations/getorgrepobranches.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getorgrepobranches.js +1 -1
- package/dist/commonjs/models/operations/getorgrepobranches.js.map +1 -1
- package/dist/commonjs/models/operations/getorgrepocommits.d.ts +1 -1
- package/dist/commonjs/models/operations/getorgrepocommits.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getorgrepocommits.js +1 -1
- package/dist/commonjs/models/operations/getorgrepocommits.js.map +1 -1
- package/dist/commonjs/models/operations/getorgrepocontent.d.ts +12 -2
- package/dist/commonjs/models/operations/getorgrepocontent.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getorgrepocontent.js +7 -2
- package/dist/commonjs/models/operations/getorgrepocontent.js.map +1 -1
- package/dist/commonjs/models/operations/getorgrepos.d.ts +1 -1
- package/dist/commonjs/models/operations/getorgrepos.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getorgrepos.js +1 -1
- package/dist/commonjs/models/operations/getorgrepos.js.map +1 -1
- package/dist/commonjs/models/operations/getorgrepowebhooks.d.ts +114 -0
- package/dist/commonjs/models/operations/getorgrepowebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getorgrepowebhooks.js +155 -0
- package/dist/commonjs/models/operations/getorgrepowebhooks.js.map +1 -0
- 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/postorgapikeys.d.ts +2 -0
- package/dist/commonjs/models/operations/postorgapikeys.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postorgapikeys.js +2 -0
- package/dist/commonjs/models/operations/postorgapikeys.js.map +1 -1
- package/dist/commonjs/models/operations/postorgrepowebhooks.d.ts +135 -0
- package/dist/commonjs/models/operations/postorgrepowebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postorgrepowebhooks.js +168 -0
- package/dist/commonjs/models/operations/postorgrepowebhooks.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/webhooks.d.ts +26 -0
- package/dist/commonjs/sdk/webhooks.d.ts.map +1 -0
- package/dist/commonjs/sdk/webhooks.js +42 -0
- package/dist/commonjs/sdk/webhooks.js.map +1 -0
- package/dist/esm/funcs/contentGet.js +9 -1
- package/dist/esm/funcs/contentGet.js.map +1 -1
- package/dist/esm/funcs/webhooksCreate.d.ts +18 -0
- package/dist/esm/funcs/webhooksCreate.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksCreate.js +93 -0
- package/dist/esm/funcs/webhooksCreate.js.map +1 -0
- package/dist/esm/funcs/webhooksDelete.d.ts +18 -0
- package/dist/esm/funcs/webhooksDelete.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksDelete.js +96 -0
- package/dist/esm/funcs/webhooksDelete.js.map +1 -0
- package/dist/esm/funcs/webhooksList.d.ts +18 -0
- package/dist/esm/funcs/webhooksList.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksList.js +92 -0
- package/dist/esm/funcs/webhooksList.js.map +1 -0
- package/dist/esm/hooks/hooks.d.ts.map +1 -1
- package/dist/esm/hooks/hooks.js +0 -2
- package/dist/esm/hooks/hooks.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.d.ts +151 -0
- package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
- package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.js +196 -0
- package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.js.map +1 -0
- package/dist/esm/models/errors/getorgrepowebhooks.d.ts +151 -0
- package/dist/esm/models/errors/getorgrepowebhooks.d.ts.map +1 -0
- package/dist/esm/models/errors/getorgrepowebhooks.js +189 -0
- package/dist/esm/models/errors/getorgrepowebhooks.js.map +1 -0
- 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/postorgrepowebhooks.d.ts +151 -0
- package/dist/esm/models/errors/postorgrepowebhooks.d.ts.map +1 -0
- package/dist/esm/models/errors/postorgrepowebhooks.js +189 -0
- package/dist/esm/models/errors/postorgrepowebhooks.js.map +1 -0
- package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.d.ts +97 -0
- package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
- package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.js +93 -0
- package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.js.map +1 -0
- package/dist/esm/models/operations/getorgrepobranches.d.ts +1 -1
- package/dist/esm/models/operations/getorgrepobranches.d.ts.map +1 -1
- package/dist/esm/models/operations/getorgrepobranches.js +1 -1
- package/dist/esm/models/operations/getorgrepobranches.js.map +1 -1
- package/dist/esm/models/operations/getorgrepocommits.d.ts +1 -1
- package/dist/esm/models/operations/getorgrepocommits.d.ts.map +1 -1
- package/dist/esm/models/operations/getorgrepocommits.js +1 -1
- package/dist/esm/models/operations/getorgrepocommits.js.map +1 -1
- package/dist/esm/models/operations/getorgrepocontent.d.ts +12 -2
- package/dist/esm/models/operations/getorgrepocontent.d.ts.map +1 -1
- package/dist/esm/models/operations/getorgrepocontent.js +7 -2
- package/dist/esm/models/operations/getorgrepocontent.js.map +1 -1
- package/dist/esm/models/operations/getorgrepos.d.ts +1 -1
- package/dist/esm/models/operations/getorgrepos.d.ts.map +1 -1
- package/dist/esm/models/operations/getorgrepos.js +1 -1
- package/dist/esm/models/operations/getorgrepos.js.map +1 -1
- package/dist/esm/models/operations/getorgrepowebhooks.d.ts +114 -0
- package/dist/esm/models/operations/getorgrepowebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/getorgrepowebhooks.js +109 -0
- package/dist/esm/models/operations/getorgrepowebhooks.js.map +1 -0
- 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/postorgapikeys.d.ts +2 -0
- package/dist/esm/models/operations/postorgapikeys.d.ts.map +1 -1
- package/dist/esm/models/operations/postorgapikeys.js +2 -0
- package/dist/esm/models/operations/postorgapikeys.js.map +1 -1
- package/dist/esm/models/operations/postorgrepowebhooks.d.ts +135 -0
- package/dist/esm/models/operations/postorgrepowebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/postorgrepowebhooks.js +122 -0
- package/dist/esm/models/operations/postorgrepowebhooks.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/webhooks.d.ts +26 -0
- package/dist/esm/sdk/webhooks.d.ts.map +1 -0
- package/dist/esm/sdk/webhooks.js +38 -0
- package/dist/esm/sdk/webhooks.js.map +1 -0
- package/examples/adminCreateApiKey.example.ts +4 -6
- package/examples/package.json +1 -1
- package/jsr.json +14 -5
- package/package.json +1 -1
- package/src/funcs/contentGet.ts +10 -1
- package/src/funcs/webhooksCreate.ts +206 -0
- package/src/funcs/webhooksDelete.ts +236 -0
- package/src/funcs/webhooksList.ts +205 -0
- package/src/hooks/hooks.ts +0 -3
- package/src/lib/config.ts +3 -3
- package/src/models/errors/deleteorgrepowebhookswebhookid.ts +368 -0
- package/src/models/errors/getorgrepowebhooks.ts +371 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/errors/postorgrepowebhooks.ts +369 -0
- package/src/models/operations/deleteorgrepowebhookswebhookid.ts +285 -0
- package/src/models/operations/getorgrepobranches.ts +2 -2
- package/src/models/operations/getorgrepocommits.ts +2 -2
- package/src/models/operations/getorgrepocontent.ts +19 -4
- package/src/models/operations/getorgrepos.ts +2 -2
- package/src/models/operations/getorgrepowebhooks.ts +305 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/postorgapikeys.ts +2 -0
- package/src/models/operations/postorgrepowebhooks.ts +339 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/webhooks.ts +63 -0
- package/tsconfig.json +1 -0
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
* Create webhook
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Create a webhook for a repository
|
|
34
|
+
*/
|
|
35
|
+
export function webhooksCreate(
|
|
36
|
+
client: MesaCore,
|
|
37
|
+
request: operations.PostOrgRepoWebhooksRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.PostOrgRepoWebhooksResponse,
|
|
42
|
+
| errors.PostOrgRepoWebhooksBadRequestError
|
|
43
|
+
| errors.PostOrgRepoWebhooksUnauthorizedError
|
|
44
|
+
| errors.PostOrgRepoWebhooksForbiddenError
|
|
45
|
+
| errors.PostOrgRepoWebhooksNotFoundError
|
|
46
|
+
| errors.PostOrgRepoWebhooksNotAcceptableError
|
|
47
|
+
| errors.PostOrgRepoWebhooksConflictError
|
|
48
|
+
| errors.PostOrgRepoWebhooksInternalServerError
|
|
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.PostOrgRepoWebhooksRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.PostOrgRepoWebhooksResponse,
|
|
74
|
+
| errors.PostOrgRepoWebhooksBadRequestError
|
|
75
|
+
| errors.PostOrgRepoWebhooksUnauthorizedError
|
|
76
|
+
| errors.PostOrgRepoWebhooksForbiddenError
|
|
77
|
+
| errors.PostOrgRepoWebhooksNotFoundError
|
|
78
|
+
| errors.PostOrgRepoWebhooksNotAcceptableError
|
|
79
|
+
| errors.PostOrgRepoWebhooksConflictError
|
|
80
|
+
| errors.PostOrgRepoWebhooksInternalServerError
|
|
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(operations.PostOrgRepoWebhooksRequest$outboundSchema, value),
|
|
97
|
+
"Input validation failed",
|
|
98
|
+
);
|
|
99
|
+
if (!parsed.ok) {
|
|
100
|
+
return [parsed, { status: "invalid" }];
|
|
101
|
+
}
|
|
102
|
+
const payload = parsed.value;
|
|
103
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
104
|
+
|
|
105
|
+
const pathParams = {
|
|
106
|
+
org: encodeSimple("org", payload.org, {
|
|
107
|
+
explode: false,
|
|
108
|
+
charEncoding: "percent",
|
|
109
|
+
}),
|
|
110
|
+
repo: encodeSimple("repo", payload.repo, {
|
|
111
|
+
explode: false,
|
|
112
|
+
charEncoding: "percent",
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const path = pathToFunc("/{org}/{repo}/webhooks")(pathParams);
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
"Content-Type": "application/json",
|
|
120
|
+
Accept: "application/json",
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
124
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
125
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
126
|
+
|
|
127
|
+
const context = {
|
|
128
|
+
options: client._options,
|
|
129
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
130
|
+
operationID: "post:org:repoWebhooks",
|
|
131
|
+
oAuth2Scopes: null,
|
|
132
|
+
|
|
133
|
+
resolvedSecurity: requestSecurity,
|
|
134
|
+
|
|
135
|
+
securitySource: client._options.apiKey,
|
|
136
|
+
retryConfig: options?.retries
|
|
137
|
+
|| client._options.retryConfig
|
|
138
|
+
|| { strategy: "none" },
|
|
139
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const requestRes = client._createRequest(context, {
|
|
143
|
+
security: requestSecurity,
|
|
144
|
+
method: "POST",
|
|
145
|
+
baseURL: options?.serverURL,
|
|
146
|
+
path: path,
|
|
147
|
+
headers: headers,
|
|
148
|
+
body: body,
|
|
149
|
+
userAgent: client._options.userAgent,
|
|
150
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
151
|
+
}, options);
|
|
152
|
+
if (!requestRes.ok) {
|
|
153
|
+
return [requestRes, { status: "invalid" }];
|
|
154
|
+
}
|
|
155
|
+
const req = requestRes.value;
|
|
156
|
+
|
|
157
|
+
const doResult = await client._do(req, {
|
|
158
|
+
context,
|
|
159
|
+
errorCodes: ["400", "401", "403", "404", "406", "409", "4XX", "500", "5XX"],
|
|
160
|
+
retryConfig: context.retryConfig,
|
|
161
|
+
retryCodes: context.retryCodes,
|
|
162
|
+
});
|
|
163
|
+
if (!doResult.ok) {
|
|
164
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
|
+
}
|
|
166
|
+
const response = doResult.value;
|
|
167
|
+
|
|
168
|
+
const responseFields = {
|
|
169
|
+
HttpMeta: { Response: response, Request: req },
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const [result] = await M.match<
|
|
173
|
+
operations.PostOrgRepoWebhooksResponse,
|
|
174
|
+
| errors.PostOrgRepoWebhooksBadRequestError
|
|
175
|
+
| errors.PostOrgRepoWebhooksUnauthorizedError
|
|
176
|
+
| errors.PostOrgRepoWebhooksForbiddenError
|
|
177
|
+
| errors.PostOrgRepoWebhooksNotFoundError
|
|
178
|
+
| errors.PostOrgRepoWebhooksNotAcceptableError
|
|
179
|
+
| errors.PostOrgRepoWebhooksConflictError
|
|
180
|
+
| errors.PostOrgRepoWebhooksInternalServerError
|
|
181
|
+
| MesaError
|
|
182
|
+
| ResponseValidationError
|
|
183
|
+
| ConnectionError
|
|
184
|
+
| RequestAbortedError
|
|
185
|
+
| RequestTimeoutError
|
|
186
|
+
| InvalidRequestError
|
|
187
|
+
| UnexpectedClientError
|
|
188
|
+
| SDKValidationError
|
|
189
|
+
>(
|
|
190
|
+
M.json(201, operations.PostOrgRepoWebhooksResponse$inboundSchema),
|
|
191
|
+
M.jsonErr(400, errors.PostOrgRepoWebhooksBadRequestError$inboundSchema),
|
|
192
|
+
M.jsonErr(401, errors.PostOrgRepoWebhooksUnauthorizedError$inboundSchema),
|
|
193
|
+
M.jsonErr(403, errors.PostOrgRepoWebhooksForbiddenError$inboundSchema),
|
|
194
|
+
M.jsonErr(404, errors.PostOrgRepoWebhooksNotFoundError$inboundSchema),
|
|
195
|
+
M.jsonErr(406, errors.PostOrgRepoWebhooksNotAcceptableError$inboundSchema),
|
|
196
|
+
M.jsonErr(409, errors.PostOrgRepoWebhooksConflictError$inboundSchema),
|
|
197
|
+
M.jsonErr(500, errors.PostOrgRepoWebhooksInternalServerError$inboundSchema),
|
|
198
|
+
M.fail("4XX"),
|
|
199
|
+
M.fail("5XX"),
|
|
200
|
+
)(response, req, { extraFields: responseFields });
|
|
201
|
+
if (!result.ok) {
|
|
202
|
+
return [result, { status: "complete", request: req, response }];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return [result, { status: "complete", request: req, response }];
|
|
206
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
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 { 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
|
+
* Delete webhook
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Delete a webhook from a repository
|
|
34
|
+
*/
|
|
35
|
+
export function webhooksDelete(
|
|
36
|
+
client: MesaCore,
|
|
37
|
+
request: operations.DeleteOrgRepoWebhooksWebhookIdRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.DeleteOrgRepoWebhooksWebhookIdResponse,
|
|
42
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdBadRequestError
|
|
43
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdUnauthorizedError
|
|
44
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdForbiddenError
|
|
45
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotFoundError
|
|
46
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotAcceptableError
|
|
47
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdConflictError
|
|
48
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdInternalServerError
|
|
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.DeleteOrgRepoWebhooksWebhookIdRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.DeleteOrgRepoWebhooksWebhookIdResponse,
|
|
74
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdBadRequestError
|
|
75
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdUnauthorizedError
|
|
76
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdForbiddenError
|
|
77
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotFoundError
|
|
78
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotAcceptableError
|
|
79
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdConflictError
|
|
80
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdInternalServerError
|
|
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.DeleteOrgRepoWebhooksWebhookIdRequest$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 = null;
|
|
107
|
+
|
|
108
|
+
const pathParams = {
|
|
109
|
+
org: encodeSimple("org", payload.org, {
|
|
110
|
+
explode: false,
|
|
111
|
+
charEncoding: "percent",
|
|
112
|
+
}),
|
|
113
|
+
repo: encodeSimple("repo", payload.repo, {
|
|
114
|
+
explode: false,
|
|
115
|
+
charEncoding: "percent",
|
|
116
|
+
}),
|
|
117
|
+
webhookId: encodeSimple("webhookId", payload.webhookId, {
|
|
118
|
+
explode: false,
|
|
119
|
+
charEncoding: "percent",
|
|
120
|
+
}),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const path = pathToFunc("/{org}/{repo}/webhooks/{webhookId}")(pathParams);
|
|
124
|
+
|
|
125
|
+
const headers = new Headers(compactMap({
|
|
126
|
+
Accept: "application/json",
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
130
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
131
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
132
|
+
|
|
133
|
+
const context = {
|
|
134
|
+
options: client._options,
|
|
135
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
136
|
+
operationID: "delete:org:repoWebhooks:webhookId",
|
|
137
|
+
oAuth2Scopes: null,
|
|
138
|
+
|
|
139
|
+
resolvedSecurity: requestSecurity,
|
|
140
|
+
|
|
141
|
+
securitySource: client._options.apiKey,
|
|
142
|
+
retryConfig: options?.retries
|
|
143
|
+
|| client._options.retryConfig
|
|
144
|
+
|| { strategy: "none" },
|
|
145
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const requestRes = client._createRequest(context, {
|
|
149
|
+
security: requestSecurity,
|
|
150
|
+
method: "DELETE",
|
|
151
|
+
baseURL: options?.serverURL,
|
|
152
|
+
path: path,
|
|
153
|
+
headers: headers,
|
|
154
|
+
body: body,
|
|
155
|
+
userAgent: client._options.userAgent,
|
|
156
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
157
|
+
}, options);
|
|
158
|
+
if (!requestRes.ok) {
|
|
159
|
+
return [requestRes, { status: "invalid" }];
|
|
160
|
+
}
|
|
161
|
+
const req = requestRes.value;
|
|
162
|
+
|
|
163
|
+
const doResult = await client._do(req, {
|
|
164
|
+
context,
|
|
165
|
+
errorCodes: ["400", "401", "403", "404", "406", "409", "4XX", "500", "5XX"],
|
|
166
|
+
retryConfig: context.retryConfig,
|
|
167
|
+
retryCodes: context.retryCodes,
|
|
168
|
+
});
|
|
169
|
+
if (!doResult.ok) {
|
|
170
|
+
return [doResult, { status: "request-error", request: req }];
|
|
171
|
+
}
|
|
172
|
+
const response = doResult.value;
|
|
173
|
+
|
|
174
|
+
const responseFields = {
|
|
175
|
+
HttpMeta: { Response: response, Request: req },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const [result] = await M.match<
|
|
179
|
+
operations.DeleteOrgRepoWebhooksWebhookIdResponse,
|
|
180
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdBadRequestError
|
|
181
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdUnauthorizedError
|
|
182
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdForbiddenError
|
|
183
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotFoundError
|
|
184
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdNotAcceptableError
|
|
185
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdConflictError
|
|
186
|
+
| errors.DeleteOrgRepoWebhooksWebhookIdInternalServerError
|
|
187
|
+
| MesaError
|
|
188
|
+
| ResponseValidationError
|
|
189
|
+
| ConnectionError
|
|
190
|
+
| RequestAbortedError
|
|
191
|
+
| RequestTimeoutError
|
|
192
|
+
| InvalidRequestError
|
|
193
|
+
| UnexpectedClientError
|
|
194
|
+
| SDKValidationError
|
|
195
|
+
>(
|
|
196
|
+
M.json(
|
|
197
|
+
200,
|
|
198
|
+
operations.DeleteOrgRepoWebhooksWebhookIdResponse$inboundSchema,
|
|
199
|
+
),
|
|
200
|
+
M.jsonErr(
|
|
201
|
+
400,
|
|
202
|
+
errors.DeleteOrgRepoWebhooksWebhookIdBadRequestError$inboundSchema,
|
|
203
|
+
),
|
|
204
|
+
M.jsonErr(
|
|
205
|
+
401,
|
|
206
|
+
errors.DeleteOrgRepoWebhooksWebhookIdUnauthorizedError$inboundSchema,
|
|
207
|
+
),
|
|
208
|
+
M.jsonErr(
|
|
209
|
+
403,
|
|
210
|
+
errors.DeleteOrgRepoWebhooksWebhookIdForbiddenError$inboundSchema,
|
|
211
|
+
),
|
|
212
|
+
M.jsonErr(
|
|
213
|
+
404,
|
|
214
|
+
errors.DeleteOrgRepoWebhooksWebhookIdNotFoundError$inboundSchema,
|
|
215
|
+
),
|
|
216
|
+
M.jsonErr(
|
|
217
|
+
406,
|
|
218
|
+
errors.DeleteOrgRepoWebhooksWebhookIdNotAcceptableError$inboundSchema,
|
|
219
|
+
),
|
|
220
|
+
M.jsonErr(
|
|
221
|
+
409,
|
|
222
|
+
errors.DeleteOrgRepoWebhooksWebhookIdConflictError$inboundSchema,
|
|
223
|
+
),
|
|
224
|
+
M.jsonErr(
|
|
225
|
+
500,
|
|
226
|
+
errors.DeleteOrgRepoWebhooksWebhookIdInternalServerError$inboundSchema,
|
|
227
|
+
),
|
|
228
|
+
M.fail("4XX"),
|
|
229
|
+
M.fail("5XX"),
|
|
230
|
+
)(response, req, { extraFields: responseFields });
|
|
231
|
+
if (!result.ok) {
|
|
232
|
+
return [result, { status: "complete", request: req, response }];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return [result, { status: "complete", request: req, response }];
|
|
236
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
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 { 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
|
+
* List webhooks
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* List webhooks for a repository
|
|
34
|
+
*/
|
|
35
|
+
export function webhooksList(
|
|
36
|
+
client: MesaCore,
|
|
37
|
+
request: operations.GetOrgRepoWebhooksRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.GetOrgRepoWebhooksResponse,
|
|
42
|
+
| errors.GetOrgRepoWebhooksBadRequestError
|
|
43
|
+
| errors.GetOrgRepoWebhooksUnauthorizedError
|
|
44
|
+
| errors.GetOrgRepoWebhooksForbiddenError
|
|
45
|
+
| errors.GetOrgRepoWebhooksNotFoundError
|
|
46
|
+
| errors.GetOrgRepoWebhooksNotAcceptableError
|
|
47
|
+
| errors.GetOrgRepoWebhooksConflictError
|
|
48
|
+
| errors.GetOrgRepoWebhooksInternalServerError
|
|
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.GetOrgRepoWebhooksRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.GetOrgRepoWebhooksResponse,
|
|
74
|
+
| errors.GetOrgRepoWebhooksBadRequestError
|
|
75
|
+
| errors.GetOrgRepoWebhooksUnauthorizedError
|
|
76
|
+
| errors.GetOrgRepoWebhooksForbiddenError
|
|
77
|
+
| errors.GetOrgRepoWebhooksNotFoundError
|
|
78
|
+
| errors.GetOrgRepoWebhooksNotAcceptableError
|
|
79
|
+
| errors.GetOrgRepoWebhooksConflictError
|
|
80
|
+
| errors.GetOrgRepoWebhooksInternalServerError
|
|
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(operations.GetOrgRepoWebhooksRequest$outboundSchema, value),
|
|
97
|
+
"Input validation failed",
|
|
98
|
+
);
|
|
99
|
+
if (!parsed.ok) {
|
|
100
|
+
return [parsed, { status: "invalid" }];
|
|
101
|
+
}
|
|
102
|
+
const payload = parsed.value;
|
|
103
|
+
const body = null;
|
|
104
|
+
|
|
105
|
+
const pathParams = {
|
|
106
|
+
org: encodeSimple("org", payload.org, {
|
|
107
|
+
explode: false,
|
|
108
|
+
charEncoding: "percent",
|
|
109
|
+
}),
|
|
110
|
+
repo: encodeSimple("repo", payload.repo, {
|
|
111
|
+
explode: false,
|
|
112
|
+
charEncoding: "percent",
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const path = pathToFunc("/{org}/{repo}/webhooks")(pathParams);
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
Accept: "application/json",
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
123
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
124
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
125
|
+
|
|
126
|
+
const context = {
|
|
127
|
+
options: client._options,
|
|
128
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
129
|
+
operationID: "get:org:repoWebhooks",
|
|
130
|
+
oAuth2Scopes: null,
|
|
131
|
+
|
|
132
|
+
resolvedSecurity: requestSecurity,
|
|
133
|
+
|
|
134
|
+
securitySource: client._options.apiKey,
|
|
135
|
+
retryConfig: options?.retries
|
|
136
|
+
|| client._options.retryConfig
|
|
137
|
+
|| { strategy: "none" },
|
|
138
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const requestRes = client._createRequest(context, {
|
|
142
|
+
security: requestSecurity,
|
|
143
|
+
method: "GET",
|
|
144
|
+
baseURL: options?.serverURL,
|
|
145
|
+
path: path,
|
|
146
|
+
headers: headers,
|
|
147
|
+
body: body,
|
|
148
|
+
userAgent: client._options.userAgent,
|
|
149
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
150
|
+
}, options);
|
|
151
|
+
if (!requestRes.ok) {
|
|
152
|
+
return [requestRes, { status: "invalid" }];
|
|
153
|
+
}
|
|
154
|
+
const req = requestRes.value;
|
|
155
|
+
|
|
156
|
+
const doResult = await client._do(req, {
|
|
157
|
+
context,
|
|
158
|
+
errorCodes: ["400", "401", "403", "404", "406", "409", "4XX", "500", "5XX"],
|
|
159
|
+
retryConfig: context.retryConfig,
|
|
160
|
+
retryCodes: context.retryCodes,
|
|
161
|
+
});
|
|
162
|
+
if (!doResult.ok) {
|
|
163
|
+
return [doResult, { status: "request-error", request: req }];
|
|
164
|
+
}
|
|
165
|
+
const response = doResult.value;
|
|
166
|
+
|
|
167
|
+
const responseFields = {
|
|
168
|
+
HttpMeta: { Response: response, Request: req },
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const [result] = await M.match<
|
|
172
|
+
operations.GetOrgRepoWebhooksResponse,
|
|
173
|
+
| errors.GetOrgRepoWebhooksBadRequestError
|
|
174
|
+
| errors.GetOrgRepoWebhooksUnauthorizedError
|
|
175
|
+
| errors.GetOrgRepoWebhooksForbiddenError
|
|
176
|
+
| errors.GetOrgRepoWebhooksNotFoundError
|
|
177
|
+
| errors.GetOrgRepoWebhooksNotAcceptableError
|
|
178
|
+
| errors.GetOrgRepoWebhooksConflictError
|
|
179
|
+
| errors.GetOrgRepoWebhooksInternalServerError
|
|
180
|
+
| MesaError
|
|
181
|
+
| ResponseValidationError
|
|
182
|
+
| ConnectionError
|
|
183
|
+
| RequestAbortedError
|
|
184
|
+
| RequestTimeoutError
|
|
185
|
+
| InvalidRequestError
|
|
186
|
+
| UnexpectedClientError
|
|
187
|
+
| SDKValidationError
|
|
188
|
+
>(
|
|
189
|
+
M.json(200, operations.GetOrgRepoWebhooksResponse$inboundSchema),
|
|
190
|
+
M.jsonErr(400, errors.GetOrgRepoWebhooksBadRequestError$inboundSchema),
|
|
191
|
+
M.jsonErr(401, errors.GetOrgRepoWebhooksUnauthorizedError$inboundSchema),
|
|
192
|
+
M.jsonErr(403, errors.GetOrgRepoWebhooksForbiddenError$inboundSchema),
|
|
193
|
+
M.jsonErr(404, errors.GetOrgRepoWebhooksNotFoundError$inboundSchema),
|
|
194
|
+
M.jsonErr(406, errors.GetOrgRepoWebhooksNotAcceptableError$inboundSchema),
|
|
195
|
+
M.jsonErr(409, errors.GetOrgRepoWebhooksConflictError$inboundSchema),
|
|
196
|
+
M.jsonErr(500, errors.GetOrgRepoWebhooksInternalServerError$inboundSchema),
|
|
197
|
+
M.fail("4XX"),
|
|
198
|
+
M.fail("5XX"),
|
|
199
|
+
)(response, req, { extraFields: responseFields });
|
|
200
|
+
if (!result.ok) {
|
|
201
|
+
return [result, { status: "complete", request: req, response }];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return [result, { status: "complete", request: req, response }];
|
|
205
|
+
}
|
package/src/hooks/hooks.ts
CHANGED
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
SDKInitHook,
|
|
19
19
|
} from "./types.js";
|
|
20
20
|
|
|
21
|
-
import { initHooks } from "./registration.js";
|
|
22
|
-
|
|
23
21
|
export class SDKHooks implements Hooks {
|
|
24
22
|
sdkInitHooks: SDKInitHook[] = [];
|
|
25
23
|
beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
|
|
@@ -47,7 +45,6 @@ export class SDKHooks implements Hooks {
|
|
|
47
45
|
this.registerAfterErrorHook(hook);
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
|
-
initHooks(this);
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
registerSDKInitHook(hook: SDKInitHook) {
|
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.1.
|
|
62
|
-
genVersion: "2.801.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 0.1.
|
|
61
|
+
sdkVersion: "0.1.4",
|
|
62
|
+
genVersion: "2.801.2",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 0.1.4 2.801.2 1.0.0 @mesadev/sdk",
|
|
64
64
|
} as const;
|