@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,339 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as types from "../../types/primitives.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export const EventRequest = {
|
|
14
|
+
Push: "push",
|
|
15
|
+
} as const;
|
|
16
|
+
export type EventRequest = ClosedEnum<typeof EventRequest>;
|
|
17
|
+
|
|
18
|
+
export type PostOrgRepoWebhooksRequestBody = {
|
|
19
|
+
url: string;
|
|
20
|
+
events?: Array<EventRequest> | undefined;
|
|
21
|
+
branches?: Array<string> | undefined;
|
|
22
|
+
globs?: Array<string> | undefined;
|
|
23
|
+
secret?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PostOrgRepoWebhooksRequest = {
|
|
27
|
+
org: string;
|
|
28
|
+
repo: string;
|
|
29
|
+
body?: PostOrgRepoWebhooksRequestBody | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type PostOrgRepoWebhooksInternalServerErrorError = {
|
|
33
|
+
code: string;
|
|
34
|
+
message: string;
|
|
35
|
+
details?: { [k: string]: any } | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type PostOrgRepoWebhooksConflictError = {
|
|
39
|
+
code: string;
|
|
40
|
+
message: string;
|
|
41
|
+
details?: { [k: string]: any } | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type PostOrgRepoWebhooksNotAcceptableError = {
|
|
45
|
+
code: string;
|
|
46
|
+
message: string;
|
|
47
|
+
details?: { [k: string]: any } | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type PostOrgRepoWebhooksNotFoundError = {
|
|
51
|
+
code: string;
|
|
52
|
+
message: string;
|
|
53
|
+
details?: { [k: string]: any } | undefined;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type PostOrgRepoWebhooksForbiddenError = {
|
|
57
|
+
code: string;
|
|
58
|
+
message: string;
|
|
59
|
+
details?: { [k: string]: any } | undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type PostOrgRepoWebhooksUnauthorizedError = {
|
|
63
|
+
code: string;
|
|
64
|
+
message: string;
|
|
65
|
+
details?: { [k: string]: any } | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type PostOrgRepoWebhooksBadRequestError = {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
details?: { [k: string]: any } | undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const PostOrgRepoWebhooksEventResponse = {
|
|
75
|
+
Push: "push",
|
|
76
|
+
} as const;
|
|
77
|
+
export type PostOrgRepoWebhooksEventResponse = ClosedEnum<
|
|
78
|
+
typeof PostOrgRepoWebhooksEventResponse
|
|
79
|
+
>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Webhook created
|
|
83
|
+
*/
|
|
84
|
+
export type PostOrgRepoWebhooksResponse = {
|
|
85
|
+
id: string;
|
|
86
|
+
url: string;
|
|
87
|
+
events: Array<PostOrgRepoWebhooksEventResponse>;
|
|
88
|
+
branches: Array<string> | null;
|
|
89
|
+
globs: Array<string> | null;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
secret: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const EventRequest$outboundSchema: z.ZodMiniEnum<typeof EventRequest> = z
|
|
97
|
+
.enum(EventRequest);
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export type PostOrgRepoWebhooksRequestBody$Outbound = {
|
|
101
|
+
url: string;
|
|
102
|
+
events?: Array<string> | undefined;
|
|
103
|
+
branches?: Array<string> | undefined;
|
|
104
|
+
globs?: Array<string> | undefined;
|
|
105
|
+
secret?: string | undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const PostOrgRepoWebhooksRequestBody$outboundSchema: z.ZodMiniType<
|
|
110
|
+
PostOrgRepoWebhooksRequestBody$Outbound,
|
|
111
|
+
PostOrgRepoWebhooksRequestBody
|
|
112
|
+
> = z.object({
|
|
113
|
+
url: z.string(),
|
|
114
|
+
events: z.optional(z.array(EventRequest$outboundSchema)),
|
|
115
|
+
branches: z.optional(z.array(z.string())),
|
|
116
|
+
globs: z.optional(z.array(z.string())),
|
|
117
|
+
secret: z.optional(z.string()),
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export function postOrgRepoWebhooksRequestBodyToJSON(
|
|
121
|
+
postOrgRepoWebhooksRequestBody: PostOrgRepoWebhooksRequestBody,
|
|
122
|
+
): string {
|
|
123
|
+
return JSON.stringify(
|
|
124
|
+
PostOrgRepoWebhooksRequestBody$outboundSchema.parse(
|
|
125
|
+
postOrgRepoWebhooksRequestBody,
|
|
126
|
+
),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export type PostOrgRepoWebhooksRequest$Outbound = {
|
|
132
|
+
org: string;
|
|
133
|
+
repo: string;
|
|
134
|
+
body?: PostOrgRepoWebhooksRequestBody$Outbound | undefined;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const PostOrgRepoWebhooksRequest$outboundSchema: z.ZodMiniType<
|
|
139
|
+
PostOrgRepoWebhooksRequest$Outbound,
|
|
140
|
+
PostOrgRepoWebhooksRequest
|
|
141
|
+
> = z.object({
|
|
142
|
+
org: z.string(),
|
|
143
|
+
repo: z.string(),
|
|
144
|
+
body: z.optional(z.lazy(() => PostOrgRepoWebhooksRequestBody$outboundSchema)),
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export function postOrgRepoWebhooksRequestToJSON(
|
|
148
|
+
postOrgRepoWebhooksRequest: PostOrgRepoWebhooksRequest,
|
|
149
|
+
): string {
|
|
150
|
+
return JSON.stringify(
|
|
151
|
+
PostOrgRepoWebhooksRequest$outboundSchema.parse(postOrgRepoWebhooksRequest),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** @internal */
|
|
156
|
+
export const PostOrgRepoWebhooksInternalServerErrorError$inboundSchema:
|
|
157
|
+
z.ZodMiniType<PostOrgRepoWebhooksInternalServerErrorError, unknown> = z
|
|
158
|
+
.object({
|
|
159
|
+
code: types.string(),
|
|
160
|
+
message: types.string(),
|
|
161
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export function postOrgRepoWebhooksInternalServerErrorErrorFromJSON(
|
|
165
|
+
jsonString: string,
|
|
166
|
+
): SafeParseResult<
|
|
167
|
+
PostOrgRepoWebhooksInternalServerErrorError,
|
|
168
|
+
SDKValidationError
|
|
169
|
+
> {
|
|
170
|
+
return safeParse(
|
|
171
|
+
jsonString,
|
|
172
|
+
(x) =>
|
|
173
|
+
PostOrgRepoWebhooksInternalServerErrorError$inboundSchema.parse(
|
|
174
|
+
JSON.parse(x),
|
|
175
|
+
),
|
|
176
|
+
`Failed to parse 'PostOrgRepoWebhooksInternalServerErrorError' from JSON`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const PostOrgRepoWebhooksConflictError$inboundSchema: z.ZodMiniType<
|
|
182
|
+
PostOrgRepoWebhooksConflictError,
|
|
183
|
+
unknown
|
|
184
|
+
> = z.object({
|
|
185
|
+
code: types.string(),
|
|
186
|
+
message: types.string(),
|
|
187
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
export function postOrgRepoWebhooksConflictErrorFromJSON(
|
|
191
|
+
jsonString: string,
|
|
192
|
+
): SafeParseResult<PostOrgRepoWebhooksConflictError, SDKValidationError> {
|
|
193
|
+
return safeParse(
|
|
194
|
+
jsonString,
|
|
195
|
+
(x) => PostOrgRepoWebhooksConflictError$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
+
`Failed to parse 'PostOrgRepoWebhooksConflictError' from JSON`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** @internal */
|
|
201
|
+
export const PostOrgRepoWebhooksNotAcceptableError$inboundSchema: z.ZodMiniType<
|
|
202
|
+
PostOrgRepoWebhooksNotAcceptableError,
|
|
203
|
+
unknown
|
|
204
|
+
> = z.object({
|
|
205
|
+
code: types.string(),
|
|
206
|
+
message: types.string(),
|
|
207
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
export function postOrgRepoWebhooksNotAcceptableErrorFromJSON(
|
|
211
|
+
jsonString: string,
|
|
212
|
+
): SafeParseResult<PostOrgRepoWebhooksNotAcceptableError, SDKValidationError> {
|
|
213
|
+
return safeParse(
|
|
214
|
+
jsonString,
|
|
215
|
+
(x) =>
|
|
216
|
+
PostOrgRepoWebhooksNotAcceptableError$inboundSchema.parse(JSON.parse(x)),
|
|
217
|
+
`Failed to parse 'PostOrgRepoWebhooksNotAcceptableError' from JSON`,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** @internal */
|
|
222
|
+
export const PostOrgRepoWebhooksNotFoundError$inboundSchema: z.ZodMiniType<
|
|
223
|
+
PostOrgRepoWebhooksNotFoundError,
|
|
224
|
+
unknown
|
|
225
|
+
> = z.object({
|
|
226
|
+
code: types.string(),
|
|
227
|
+
message: types.string(),
|
|
228
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
export function postOrgRepoWebhooksNotFoundErrorFromJSON(
|
|
232
|
+
jsonString: string,
|
|
233
|
+
): SafeParseResult<PostOrgRepoWebhooksNotFoundError, SDKValidationError> {
|
|
234
|
+
return safeParse(
|
|
235
|
+
jsonString,
|
|
236
|
+
(x) => PostOrgRepoWebhooksNotFoundError$inboundSchema.parse(JSON.parse(x)),
|
|
237
|
+
`Failed to parse 'PostOrgRepoWebhooksNotFoundError' from JSON`,
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** @internal */
|
|
242
|
+
export const PostOrgRepoWebhooksForbiddenError$inboundSchema: z.ZodMiniType<
|
|
243
|
+
PostOrgRepoWebhooksForbiddenError,
|
|
244
|
+
unknown
|
|
245
|
+
> = z.object({
|
|
246
|
+
code: types.string(),
|
|
247
|
+
message: types.string(),
|
|
248
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export function postOrgRepoWebhooksForbiddenErrorFromJSON(
|
|
252
|
+
jsonString: string,
|
|
253
|
+
): SafeParseResult<PostOrgRepoWebhooksForbiddenError, SDKValidationError> {
|
|
254
|
+
return safeParse(
|
|
255
|
+
jsonString,
|
|
256
|
+
(x) => PostOrgRepoWebhooksForbiddenError$inboundSchema.parse(JSON.parse(x)),
|
|
257
|
+
`Failed to parse 'PostOrgRepoWebhooksForbiddenError' from JSON`,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** @internal */
|
|
262
|
+
export const PostOrgRepoWebhooksUnauthorizedError$inboundSchema: z.ZodMiniType<
|
|
263
|
+
PostOrgRepoWebhooksUnauthorizedError,
|
|
264
|
+
unknown
|
|
265
|
+
> = z.object({
|
|
266
|
+
code: types.string(),
|
|
267
|
+
message: types.string(),
|
|
268
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
export function postOrgRepoWebhooksUnauthorizedErrorFromJSON(
|
|
272
|
+
jsonString: string,
|
|
273
|
+
): SafeParseResult<PostOrgRepoWebhooksUnauthorizedError, SDKValidationError> {
|
|
274
|
+
return safeParse(
|
|
275
|
+
jsonString,
|
|
276
|
+
(x) =>
|
|
277
|
+
PostOrgRepoWebhooksUnauthorizedError$inboundSchema.parse(JSON.parse(x)),
|
|
278
|
+
`Failed to parse 'PostOrgRepoWebhooksUnauthorizedError' from JSON`,
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** @internal */
|
|
283
|
+
export const PostOrgRepoWebhooksBadRequestError$inboundSchema: z.ZodMiniType<
|
|
284
|
+
PostOrgRepoWebhooksBadRequestError,
|
|
285
|
+
unknown
|
|
286
|
+
> = z.object({
|
|
287
|
+
code: types.string(),
|
|
288
|
+
message: types.string(),
|
|
289
|
+
details: types.optional(z.record(z.string(), z.any())),
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
export function postOrgRepoWebhooksBadRequestErrorFromJSON(
|
|
293
|
+
jsonString: string,
|
|
294
|
+
): SafeParseResult<PostOrgRepoWebhooksBadRequestError, SDKValidationError> {
|
|
295
|
+
return safeParse(
|
|
296
|
+
jsonString,
|
|
297
|
+
(x) =>
|
|
298
|
+
PostOrgRepoWebhooksBadRequestError$inboundSchema.parse(JSON.parse(x)),
|
|
299
|
+
`Failed to parse 'PostOrgRepoWebhooksBadRequestError' from JSON`,
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** @internal */
|
|
304
|
+
export const PostOrgRepoWebhooksEventResponse$inboundSchema: z.ZodMiniEnum<
|
|
305
|
+
typeof PostOrgRepoWebhooksEventResponse
|
|
306
|
+
> = z.enum(PostOrgRepoWebhooksEventResponse);
|
|
307
|
+
|
|
308
|
+
/** @internal */
|
|
309
|
+
export const PostOrgRepoWebhooksResponse$inboundSchema: z.ZodMiniType<
|
|
310
|
+
PostOrgRepoWebhooksResponse,
|
|
311
|
+
unknown
|
|
312
|
+
> = z.pipe(
|
|
313
|
+
z.object({
|
|
314
|
+
id: types.string(),
|
|
315
|
+
url: types.string(),
|
|
316
|
+
events: z.array(PostOrgRepoWebhooksEventResponse$inboundSchema),
|
|
317
|
+
branches: types.nullable(z.array(types.string())),
|
|
318
|
+
globs: types.nullable(z.array(types.string())),
|
|
319
|
+
created_at: types.string(),
|
|
320
|
+
updated_at: types.string(),
|
|
321
|
+
secret: types.string(),
|
|
322
|
+
}),
|
|
323
|
+
z.transform((v) => {
|
|
324
|
+
return remap$(v, {
|
|
325
|
+
"created_at": "createdAt",
|
|
326
|
+
"updated_at": "updatedAt",
|
|
327
|
+
});
|
|
328
|
+
}),
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
export function postOrgRepoWebhooksResponseFromJSON(
|
|
332
|
+
jsonString: string,
|
|
333
|
+
): SafeParseResult<PostOrgRepoWebhooksResponse, SDKValidationError> {
|
|
334
|
+
return safeParse(
|
|
335
|
+
jsonString,
|
|
336
|
+
(x) => PostOrgRepoWebhooksResponse$inboundSchema.parse(JSON.parse(x)),
|
|
337
|
+
`Failed to parse 'PostOrgRepoWebhooksResponse' from JSON`,
|
|
338
|
+
);
|
|
339
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Commits } from "./commits.js";
|
|
|
10
10
|
import { Content } from "./content.js";
|
|
11
11
|
import { Diffs } from "./diffs.js";
|
|
12
12
|
import { Repos } from "./repos.js";
|
|
13
|
+
import { Webhooks } from "./webhooks.js";
|
|
13
14
|
|
|
14
15
|
export class Mesa extends ClientSDK {
|
|
15
16
|
private _admin?: Admin;
|
|
@@ -46,4 +47,9 @@ export class Mesa extends ClientSDK {
|
|
|
46
47
|
get agentBlame(): AgentBlame {
|
|
47
48
|
return (this._agentBlame ??= new AgentBlame(this._options));
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
private _webhooks?: Webhooks;
|
|
52
|
+
get webhooks(): Webhooks {
|
|
53
|
+
return (this._webhooks ??= new Webhooks(this._options));
|
|
54
|
+
}
|
|
49
55
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksCreate } from "../funcs/webhooksCreate.js";
|
|
6
|
+
import { webhooksDelete } from "../funcs/webhooksDelete.js";
|
|
7
|
+
import { webhooksList } from "../funcs/webhooksList.js";
|
|
8
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
11
|
+
|
|
12
|
+
export class Webhooks extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* List webhooks
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* List webhooks for a repository
|
|
18
|
+
*/
|
|
19
|
+
async list(
|
|
20
|
+
request: operations.GetOrgRepoWebhooksRequest,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<operations.GetOrgRepoWebhooksResponse> {
|
|
23
|
+
return unwrapAsync(webhooksList(
|
|
24
|
+
this,
|
|
25
|
+
request,
|
|
26
|
+
options,
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create webhook
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Create a webhook for a repository
|
|
35
|
+
*/
|
|
36
|
+
async create(
|
|
37
|
+
request: operations.PostOrgRepoWebhooksRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): Promise<operations.PostOrgRepoWebhooksResponse> {
|
|
40
|
+
return unwrapAsync(webhooksCreate(
|
|
41
|
+
this,
|
|
42
|
+
request,
|
|
43
|
+
options,
|
|
44
|
+
));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Delete webhook
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Delete a webhook from a repository
|
|
52
|
+
*/
|
|
53
|
+
async delete(
|
|
54
|
+
request: operations.DeleteOrgRepoWebhooksWebhookIdRequest,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): Promise<operations.DeleteOrgRepoWebhooksWebhookIdResponse> {
|
|
57
|
+
return unwrapAsync(webhooksDelete(
|
|
58
|
+
this,
|
|
59
|
+
request,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
}
|