@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.
Files changed (186) hide show
  1. package/.devcontainer/devcontainer.json +38 -36
  2. package/README.md +164 -134
  3. package/dist/commonjs/funcs/contentGet.js +8 -0
  4. package/dist/commonjs/funcs/contentGet.js.map +1 -1
  5. package/dist/commonjs/funcs/webhooksCreate.d.ts +18 -0
  6. package/dist/commonjs/funcs/webhooksCreate.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/webhooksCreate.js +129 -0
  8. package/dist/commonjs/funcs/webhooksCreate.js.map +1 -0
  9. package/dist/commonjs/funcs/webhooksDelete.d.ts +18 -0
  10. package/dist/commonjs/funcs/webhooksDelete.d.ts.map +1 -0
  11. package/dist/commonjs/funcs/webhooksDelete.js +132 -0
  12. package/dist/commonjs/funcs/webhooksDelete.js.map +1 -0
  13. package/dist/commonjs/funcs/webhooksList.d.ts +18 -0
  14. package/dist/commonjs/funcs/webhooksList.d.ts.map +1 -0
  15. package/dist/commonjs/funcs/webhooksList.js +128 -0
  16. package/dist/commonjs/funcs/webhooksList.js.map +1 -0
  17. package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
  18. package/dist/commonjs/hooks/hooks.js +0 -2
  19. package/dist/commonjs/hooks/hooks.js.map +1 -1
  20. package/dist/commonjs/lib/config.d.ts +3 -3
  21. package/dist/commonjs/lib/config.js +3 -3
  22. package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.d.ts +151 -0
  23. package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
  24. package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.js +239 -0
  25. package/dist/commonjs/models/errors/deleteorgrepowebhookswebhookid.js.map +1 -0
  26. package/dist/commonjs/models/errors/getorgrepowebhooks.d.ts +151 -0
  27. package/dist/commonjs/models/errors/getorgrepowebhooks.d.ts.map +1 -0
  28. package/dist/commonjs/models/errors/getorgrepowebhooks.js +232 -0
  29. package/dist/commonjs/models/errors/getorgrepowebhooks.js.map +1 -0
  30. package/dist/commonjs/models/errors/index.d.ts +3 -0
  31. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  32. package/dist/commonjs/models/errors/index.js +3 -0
  33. package/dist/commonjs/models/errors/index.js.map +1 -1
  34. package/dist/commonjs/models/errors/postorgrepowebhooks.d.ts +151 -0
  35. package/dist/commonjs/models/errors/postorgrepowebhooks.d.ts.map +1 -0
  36. package/dist/commonjs/models/errors/postorgrepowebhooks.js +232 -0
  37. package/dist/commonjs/models/errors/postorgrepowebhooks.js.map +1 -0
  38. package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.d.ts +97 -0
  39. package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
  40. package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.js +138 -0
  41. package/dist/commonjs/models/operations/deleteorgrepowebhookswebhookid.js.map +1 -0
  42. package/dist/commonjs/models/operations/getorgrepobranches.d.ts +1 -1
  43. package/dist/commonjs/models/operations/getorgrepobranches.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/getorgrepobranches.js +1 -1
  45. package/dist/commonjs/models/operations/getorgrepobranches.js.map +1 -1
  46. package/dist/commonjs/models/operations/getorgrepocommits.d.ts +1 -1
  47. package/dist/commonjs/models/operations/getorgrepocommits.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/getorgrepocommits.js +1 -1
  49. package/dist/commonjs/models/operations/getorgrepocommits.js.map +1 -1
  50. package/dist/commonjs/models/operations/getorgrepocontent.d.ts +12 -2
  51. package/dist/commonjs/models/operations/getorgrepocontent.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/getorgrepocontent.js +7 -2
  53. package/dist/commonjs/models/operations/getorgrepocontent.js.map +1 -1
  54. package/dist/commonjs/models/operations/getorgrepos.d.ts +1 -1
  55. package/dist/commonjs/models/operations/getorgrepos.d.ts.map +1 -1
  56. package/dist/commonjs/models/operations/getorgrepos.js +1 -1
  57. package/dist/commonjs/models/operations/getorgrepos.js.map +1 -1
  58. package/dist/commonjs/models/operations/getorgrepowebhooks.d.ts +114 -0
  59. package/dist/commonjs/models/operations/getorgrepowebhooks.d.ts.map +1 -0
  60. package/dist/commonjs/models/operations/getorgrepowebhooks.js +155 -0
  61. package/dist/commonjs/models/operations/getorgrepowebhooks.js.map +1 -0
  62. package/dist/commonjs/models/operations/index.d.ts +3 -0
  63. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  64. package/dist/commonjs/models/operations/index.js +3 -0
  65. package/dist/commonjs/models/operations/index.js.map +1 -1
  66. package/dist/commonjs/models/operations/postorgapikeys.d.ts +2 -0
  67. package/dist/commonjs/models/operations/postorgapikeys.d.ts.map +1 -1
  68. package/dist/commonjs/models/operations/postorgapikeys.js +2 -0
  69. package/dist/commonjs/models/operations/postorgapikeys.js.map +1 -1
  70. package/dist/commonjs/models/operations/postorgrepowebhooks.d.ts +135 -0
  71. package/dist/commonjs/models/operations/postorgrepowebhooks.d.ts.map +1 -0
  72. package/dist/commonjs/models/operations/postorgrepowebhooks.js +168 -0
  73. package/dist/commonjs/models/operations/postorgrepowebhooks.js.map +1 -0
  74. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  75. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  76. package/dist/commonjs/sdk/sdk.js +4 -0
  77. package/dist/commonjs/sdk/sdk.js.map +1 -1
  78. package/dist/commonjs/sdk/webhooks.d.ts +26 -0
  79. package/dist/commonjs/sdk/webhooks.d.ts.map +1 -0
  80. package/dist/commonjs/sdk/webhooks.js +42 -0
  81. package/dist/commonjs/sdk/webhooks.js.map +1 -0
  82. package/dist/esm/funcs/contentGet.js +9 -1
  83. package/dist/esm/funcs/contentGet.js.map +1 -1
  84. package/dist/esm/funcs/webhooksCreate.d.ts +18 -0
  85. package/dist/esm/funcs/webhooksCreate.d.ts.map +1 -0
  86. package/dist/esm/funcs/webhooksCreate.js +93 -0
  87. package/dist/esm/funcs/webhooksCreate.js.map +1 -0
  88. package/dist/esm/funcs/webhooksDelete.d.ts +18 -0
  89. package/dist/esm/funcs/webhooksDelete.d.ts.map +1 -0
  90. package/dist/esm/funcs/webhooksDelete.js +96 -0
  91. package/dist/esm/funcs/webhooksDelete.js.map +1 -0
  92. package/dist/esm/funcs/webhooksList.d.ts +18 -0
  93. package/dist/esm/funcs/webhooksList.d.ts.map +1 -0
  94. package/dist/esm/funcs/webhooksList.js +92 -0
  95. package/dist/esm/funcs/webhooksList.js.map +1 -0
  96. package/dist/esm/hooks/hooks.d.ts.map +1 -1
  97. package/dist/esm/hooks/hooks.js +0 -2
  98. package/dist/esm/hooks/hooks.js.map +1 -1
  99. package/dist/esm/lib/config.d.ts +3 -3
  100. package/dist/esm/lib/config.js +3 -3
  101. package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.d.ts +151 -0
  102. package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
  103. package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.js +196 -0
  104. package/dist/esm/models/errors/deleteorgrepowebhookswebhookid.js.map +1 -0
  105. package/dist/esm/models/errors/getorgrepowebhooks.d.ts +151 -0
  106. package/dist/esm/models/errors/getorgrepowebhooks.d.ts.map +1 -0
  107. package/dist/esm/models/errors/getorgrepowebhooks.js +189 -0
  108. package/dist/esm/models/errors/getorgrepowebhooks.js.map +1 -0
  109. package/dist/esm/models/errors/index.d.ts +3 -0
  110. package/dist/esm/models/errors/index.d.ts.map +1 -1
  111. package/dist/esm/models/errors/index.js +3 -0
  112. package/dist/esm/models/errors/index.js.map +1 -1
  113. package/dist/esm/models/errors/postorgrepowebhooks.d.ts +151 -0
  114. package/dist/esm/models/errors/postorgrepowebhooks.d.ts.map +1 -0
  115. package/dist/esm/models/errors/postorgrepowebhooks.js +189 -0
  116. package/dist/esm/models/errors/postorgrepowebhooks.js.map +1 -0
  117. package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.d.ts +97 -0
  118. package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.d.ts.map +1 -0
  119. package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.js +93 -0
  120. package/dist/esm/models/operations/deleteorgrepowebhookswebhookid.js.map +1 -0
  121. package/dist/esm/models/operations/getorgrepobranches.d.ts +1 -1
  122. package/dist/esm/models/operations/getorgrepobranches.d.ts.map +1 -1
  123. package/dist/esm/models/operations/getorgrepobranches.js +1 -1
  124. package/dist/esm/models/operations/getorgrepobranches.js.map +1 -1
  125. package/dist/esm/models/operations/getorgrepocommits.d.ts +1 -1
  126. package/dist/esm/models/operations/getorgrepocommits.d.ts.map +1 -1
  127. package/dist/esm/models/operations/getorgrepocommits.js +1 -1
  128. package/dist/esm/models/operations/getorgrepocommits.js.map +1 -1
  129. package/dist/esm/models/operations/getorgrepocontent.d.ts +12 -2
  130. package/dist/esm/models/operations/getorgrepocontent.d.ts.map +1 -1
  131. package/dist/esm/models/operations/getorgrepocontent.js +7 -2
  132. package/dist/esm/models/operations/getorgrepocontent.js.map +1 -1
  133. package/dist/esm/models/operations/getorgrepos.d.ts +1 -1
  134. package/dist/esm/models/operations/getorgrepos.d.ts.map +1 -1
  135. package/dist/esm/models/operations/getorgrepos.js +1 -1
  136. package/dist/esm/models/operations/getorgrepos.js.map +1 -1
  137. package/dist/esm/models/operations/getorgrepowebhooks.d.ts +114 -0
  138. package/dist/esm/models/operations/getorgrepowebhooks.d.ts.map +1 -0
  139. package/dist/esm/models/operations/getorgrepowebhooks.js +109 -0
  140. package/dist/esm/models/operations/getorgrepowebhooks.js.map +1 -0
  141. package/dist/esm/models/operations/index.d.ts +3 -0
  142. package/dist/esm/models/operations/index.d.ts.map +1 -1
  143. package/dist/esm/models/operations/index.js +3 -0
  144. package/dist/esm/models/operations/index.js.map +1 -1
  145. package/dist/esm/models/operations/postorgapikeys.d.ts +2 -0
  146. package/dist/esm/models/operations/postorgapikeys.d.ts.map +1 -1
  147. package/dist/esm/models/operations/postorgapikeys.js +2 -0
  148. package/dist/esm/models/operations/postorgapikeys.js.map +1 -1
  149. package/dist/esm/models/operations/postorgrepowebhooks.d.ts +135 -0
  150. package/dist/esm/models/operations/postorgrepowebhooks.d.ts.map +1 -0
  151. package/dist/esm/models/operations/postorgrepowebhooks.js +122 -0
  152. package/dist/esm/models/operations/postorgrepowebhooks.js.map +1 -0
  153. package/dist/esm/sdk/sdk.d.ts +3 -0
  154. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  155. package/dist/esm/sdk/sdk.js +4 -0
  156. package/dist/esm/sdk/sdk.js.map +1 -1
  157. package/dist/esm/sdk/webhooks.d.ts +26 -0
  158. package/dist/esm/sdk/webhooks.d.ts.map +1 -0
  159. package/dist/esm/sdk/webhooks.js +38 -0
  160. package/dist/esm/sdk/webhooks.js.map +1 -0
  161. package/examples/adminCreateApiKey.example.ts +4 -6
  162. package/examples/package.json +1 -1
  163. package/jsr.json +14 -5
  164. package/package.json +1 -1
  165. package/src/funcs/contentGet.ts +10 -1
  166. package/src/funcs/webhooksCreate.ts +206 -0
  167. package/src/funcs/webhooksDelete.ts +236 -0
  168. package/src/funcs/webhooksList.ts +205 -0
  169. package/src/hooks/hooks.ts +0 -3
  170. package/src/lib/config.ts +3 -3
  171. package/src/models/errors/deleteorgrepowebhookswebhookid.ts +368 -0
  172. package/src/models/errors/getorgrepowebhooks.ts +371 -0
  173. package/src/models/errors/index.ts +3 -0
  174. package/src/models/errors/postorgrepowebhooks.ts +369 -0
  175. package/src/models/operations/deleteorgrepowebhookswebhookid.ts +285 -0
  176. package/src/models/operations/getorgrepobranches.ts +2 -2
  177. package/src/models/operations/getorgrepocommits.ts +2 -2
  178. package/src/models/operations/getorgrepocontent.ts +19 -4
  179. package/src/models/operations/getorgrepos.ts +2 -2
  180. package/src/models/operations/getorgrepowebhooks.ts +305 -0
  181. package/src/models/operations/index.ts +3 -0
  182. package/src/models/operations/postorgapikeys.ts +2 -0
  183. package/src/models/operations/postorgrepowebhooks.ts +339 -0
  184. package/src/sdk/sdk.ts +6 -0
  185. package/src/sdk/webhooks.ts +63 -0
  186. package/tsconfig.json +1 -0
@@ -15,6 +15,11 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
15
15
  export type GetOrgRepoContentRequest = {
16
16
  org: string;
17
17
  repo: string;
18
+ cursor?: string | undefined;
19
+ limit?: number | undefined;
20
+ ref?: string | undefined;
21
+ path?: string | undefined;
22
+ depth?: number | undefined;
18
23
  };
19
24
 
20
25
  export type GetOrgRepoContentInternalServerErrorError = {
@@ -80,6 +85,8 @@ export type Entry =
80
85
  | discriminatedUnionTypes.Unknown<"type">;
81
86
 
82
87
  export type Dir = {
88
+ nextCursor: string | null;
89
+ hasMore: boolean;
83
90
  type: "dir";
84
91
  name: string;
85
92
  path: string;
@@ -87,8 +94,6 @@ export type Dir = {
87
94
  entries: Array<
88
95
  EntryFile | EntryDir | discriminatedUnionTypes.Unknown<"type">
89
96
  >;
90
- nextCursor: string | null;
91
- hasMore: boolean;
92
97
  };
93
98
 
94
99
  export type Base64 = {
@@ -119,6 +124,11 @@ export type GetOrgRepoContentResponse =
119
124
  export type GetOrgRepoContentRequest$Outbound = {
120
125
  org: string;
121
126
  repo: string;
127
+ cursor?: string | undefined;
128
+ limit?: number | undefined;
129
+ ref?: string | undefined;
130
+ path?: string | undefined;
131
+ depth?: number | undefined;
122
132
  };
123
133
 
124
134
  /** @internal */
@@ -128,6 +138,11 @@ export const GetOrgRepoContentRequest$outboundSchema: z.ZodMiniType<
128
138
  > = z.object({
129
139
  org: z.string(),
130
140
  repo: z.string(),
141
+ cursor: z.optional(z.string()),
142
+ limit: z.optional(z.int()),
143
+ ref: z.optional(z.string()),
144
+ path: z.optional(z.string()),
145
+ depth: z.optional(z.int()),
131
146
  });
132
147
 
133
148
  export function getOrgRepoContentRequestToJSON(
@@ -343,6 +358,8 @@ export function entryFromJSON(
343
358
  /** @internal */
344
359
  export const Dir$inboundSchema: z.ZodMiniType<Dir, unknown> = z.pipe(
345
360
  z.object({
361
+ next_cursor: types.nullable(types.string()),
362
+ has_more: types.boolean(),
346
363
  type: types.literal("dir"),
347
364
  name: types.string(),
348
365
  path: types.string(),
@@ -351,8 +368,6 @@ export const Dir$inboundSchema: z.ZodMiniType<Dir, unknown> = z.pipe(
351
368
  file: z.lazy(() => EntryFile$inboundSchema),
352
369
  dir: z.lazy(() => EntryDir$inboundSchema),
353
370
  })),
354
- next_cursor: types.nullable(types.string()),
355
- has_more: types.boolean(),
356
371
  }),
357
372
  z.transform((v) => {
358
373
  return remap$(v, {
@@ -71,9 +71,9 @@ export type Repo = {
71
71
  * Repository list
72
72
  */
73
73
  export type GetOrgReposResponseBody = {
74
- repos: Array<Repo>;
75
74
  nextCursor: string | null;
76
75
  hasMore: boolean;
76
+ repos: Array<Repo>;
77
77
  };
78
78
 
79
79
  export type GetOrgReposResponse = {
@@ -283,9 +283,9 @@ export const GetOrgReposResponseBody$inboundSchema: z.ZodMiniType<
283
283
  unknown
284
284
  > = z.pipe(
285
285
  z.object({
286
- repos: z.array(z.lazy(() => Repo$inboundSchema)),
287
286
  next_cursor: types.nullable(types.string()),
288
287
  has_more: types.boolean(),
288
+ repos: z.array(z.lazy(() => Repo$inboundSchema)),
289
289
  }),
290
290
  z.transform((v) => {
291
291
  return remap$(v, {
@@ -0,0 +1,305 @@
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 type GetOrgRepoWebhooksRequest = {
14
+ org: string;
15
+ repo: string;
16
+ };
17
+
18
+ export type GetOrgRepoWebhooksInternalServerErrorError = {
19
+ code: string;
20
+ message: string;
21
+ details?: { [k: string]: any } | undefined;
22
+ };
23
+
24
+ export type GetOrgRepoWebhooksConflictError = {
25
+ code: string;
26
+ message: string;
27
+ details?: { [k: string]: any } | undefined;
28
+ };
29
+
30
+ export type GetOrgRepoWebhooksNotAcceptableError = {
31
+ code: string;
32
+ message: string;
33
+ details?: { [k: string]: any } | undefined;
34
+ };
35
+
36
+ export type GetOrgRepoWebhooksNotFoundError = {
37
+ code: string;
38
+ message: string;
39
+ details?: { [k: string]: any } | undefined;
40
+ };
41
+
42
+ export type GetOrgRepoWebhooksForbiddenError = {
43
+ code: string;
44
+ message: string;
45
+ details?: { [k: string]: any } | undefined;
46
+ };
47
+
48
+ export type GetOrgRepoWebhooksUnauthorizedError = {
49
+ code: string;
50
+ message: string;
51
+ details?: { [k: string]: any } | undefined;
52
+ };
53
+
54
+ export type GetOrgRepoWebhooksBadRequestError = {
55
+ code: string;
56
+ message: string;
57
+ details?: { [k: string]: any } | undefined;
58
+ };
59
+
60
+ export const GetOrgRepoWebhooksEvent = {
61
+ Push: "push",
62
+ } as const;
63
+ export type GetOrgRepoWebhooksEvent = ClosedEnum<
64
+ typeof GetOrgRepoWebhooksEvent
65
+ >;
66
+
67
+ export type Webhook = {
68
+ id: string;
69
+ url: string;
70
+ events: Array<GetOrgRepoWebhooksEvent>;
71
+ branches: Array<string> | null;
72
+ globs: Array<string> | null;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ };
76
+
77
+ /**
78
+ * Webhook list
79
+ */
80
+ export type GetOrgRepoWebhooksResponse = {
81
+ webhooks: Array<Webhook>;
82
+ };
83
+
84
+ /** @internal */
85
+ export type GetOrgRepoWebhooksRequest$Outbound = {
86
+ org: string;
87
+ repo: string;
88
+ };
89
+
90
+ /** @internal */
91
+ export const GetOrgRepoWebhooksRequest$outboundSchema: z.ZodMiniType<
92
+ GetOrgRepoWebhooksRequest$Outbound,
93
+ GetOrgRepoWebhooksRequest
94
+ > = z.object({
95
+ org: z.string(),
96
+ repo: z.string(),
97
+ });
98
+
99
+ export function getOrgRepoWebhooksRequestToJSON(
100
+ getOrgRepoWebhooksRequest: GetOrgRepoWebhooksRequest,
101
+ ): string {
102
+ return JSON.stringify(
103
+ GetOrgRepoWebhooksRequest$outboundSchema.parse(getOrgRepoWebhooksRequest),
104
+ );
105
+ }
106
+
107
+ /** @internal */
108
+ export const GetOrgRepoWebhooksInternalServerErrorError$inboundSchema:
109
+ z.ZodMiniType<GetOrgRepoWebhooksInternalServerErrorError, unknown> = z.object(
110
+ {
111
+ code: types.string(),
112
+ message: types.string(),
113
+ details: types.optional(z.record(z.string(), z.any())),
114
+ },
115
+ );
116
+
117
+ export function getOrgRepoWebhooksInternalServerErrorErrorFromJSON(
118
+ jsonString: string,
119
+ ): SafeParseResult<
120
+ GetOrgRepoWebhooksInternalServerErrorError,
121
+ SDKValidationError
122
+ > {
123
+ return safeParse(
124
+ jsonString,
125
+ (x) =>
126
+ GetOrgRepoWebhooksInternalServerErrorError$inboundSchema.parse(
127
+ JSON.parse(x),
128
+ ),
129
+ `Failed to parse 'GetOrgRepoWebhooksInternalServerErrorError' from JSON`,
130
+ );
131
+ }
132
+
133
+ /** @internal */
134
+ export const GetOrgRepoWebhooksConflictError$inboundSchema: z.ZodMiniType<
135
+ GetOrgRepoWebhooksConflictError,
136
+ unknown
137
+ > = z.object({
138
+ code: types.string(),
139
+ message: types.string(),
140
+ details: types.optional(z.record(z.string(), z.any())),
141
+ });
142
+
143
+ export function getOrgRepoWebhooksConflictErrorFromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<GetOrgRepoWebhooksConflictError, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) => GetOrgRepoWebhooksConflictError$inboundSchema.parse(JSON.parse(x)),
149
+ `Failed to parse 'GetOrgRepoWebhooksConflictError' from JSON`,
150
+ );
151
+ }
152
+
153
+ /** @internal */
154
+ export const GetOrgRepoWebhooksNotAcceptableError$inboundSchema: z.ZodMiniType<
155
+ GetOrgRepoWebhooksNotAcceptableError,
156
+ unknown
157
+ > = z.object({
158
+ code: types.string(),
159
+ message: types.string(),
160
+ details: types.optional(z.record(z.string(), z.any())),
161
+ });
162
+
163
+ export function getOrgRepoWebhooksNotAcceptableErrorFromJSON(
164
+ jsonString: string,
165
+ ): SafeParseResult<GetOrgRepoWebhooksNotAcceptableError, SDKValidationError> {
166
+ return safeParse(
167
+ jsonString,
168
+ (x) =>
169
+ GetOrgRepoWebhooksNotAcceptableError$inboundSchema.parse(JSON.parse(x)),
170
+ `Failed to parse 'GetOrgRepoWebhooksNotAcceptableError' from JSON`,
171
+ );
172
+ }
173
+
174
+ /** @internal */
175
+ export const GetOrgRepoWebhooksNotFoundError$inboundSchema: z.ZodMiniType<
176
+ GetOrgRepoWebhooksNotFoundError,
177
+ unknown
178
+ > = z.object({
179
+ code: types.string(),
180
+ message: types.string(),
181
+ details: types.optional(z.record(z.string(), z.any())),
182
+ });
183
+
184
+ export function getOrgRepoWebhooksNotFoundErrorFromJSON(
185
+ jsonString: string,
186
+ ): SafeParseResult<GetOrgRepoWebhooksNotFoundError, SDKValidationError> {
187
+ return safeParse(
188
+ jsonString,
189
+ (x) => GetOrgRepoWebhooksNotFoundError$inboundSchema.parse(JSON.parse(x)),
190
+ `Failed to parse 'GetOrgRepoWebhooksNotFoundError' from JSON`,
191
+ );
192
+ }
193
+
194
+ /** @internal */
195
+ export const GetOrgRepoWebhooksForbiddenError$inboundSchema: z.ZodMiniType<
196
+ GetOrgRepoWebhooksForbiddenError,
197
+ unknown
198
+ > = z.object({
199
+ code: types.string(),
200
+ message: types.string(),
201
+ details: types.optional(z.record(z.string(), z.any())),
202
+ });
203
+
204
+ export function getOrgRepoWebhooksForbiddenErrorFromJSON(
205
+ jsonString: string,
206
+ ): SafeParseResult<GetOrgRepoWebhooksForbiddenError, SDKValidationError> {
207
+ return safeParse(
208
+ jsonString,
209
+ (x) => GetOrgRepoWebhooksForbiddenError$inboundSchema.parse(JSON.parse(x)),
210
+ `Failed to parse 'GetOrgRepoWebhooksForbiddenError' from JSON`,
211
+ );
212
+ }
213
+
214
+ /** @internal */
215
+ export const GetOrgRepoWebhooksUnauthorizedError$inboundSchema: z.ZodMiniType<
216
+ GetOrgRepoWebhooksUnauthorizedError,
217
+ unknown
218
+ > = z.object({
219
+ code: types.string(),
220
+ message: types.string(),
221
+ details: types.optional(z.record(z.string(), z.any())),
222
+ });
223
+
224
+ export function getOrgRepoWebhooksUnauthorizedErrorFromJSON(
225
+ jsonString: string,
226
+ ): SafeParseResult<GetOrgRepoWebhooksUnauthorizedError, SDKValidationError> {
227
+ return safeParse(
228
+ jsonString,
229
+ (x) =>
230
+ GetOrgRepoWebhooksUnauthorizedError$inboundSchema.parse(JSON.parse(x)),
231
+ `Failed to parse 'GetOrgRepoWebhooksUnauthorizedError' from JSON`,
232
+ );
233
+ }
234
+
235
+ /** @internal */
236
+ export const GetOrgRepoWebhooksBadRequestError$inboundSchema: z.ZodMiniType<
237
+ GetOrgRepoWebhooksBadRequestError,
238
+ unknown
239
+ > = z.object({
240
+ code: types.string(),
241
+ message: types.string(),
242
+ details: types.optional(z.record(z.string(), z.any())),
243
+ });
244
+
245
+ export function getOrgRepoWebhooksBadRequestErrorFromJSON(
246
+ jsonString: string,
247
+ ): SafeParseResult<GetOrgRepoWebhooksBadRequestError, SDKValidationError> {
248
+ return safeParse(
249
+ jsonString,
250
+ (x) => GetOrgRepoWebhooksBadRequestError$inboundSchema.parse(JSON.parse(x)),
251
+ `Failed to parse 'GetOrgRepoWebhooksBadRequestError' from JSON`,
252
+ );
253
+ }
254
+
255
+ /** @internal */
256
+ export const GetOrgRepoWebhooksEvent$inboundSchema: z.ZodMiniEnum<
257
+ typeof GetOrgRepoWebhooksEvent
258
+ > = z.enum(GetOrgRepoWebhooksEvent);
259
+
260
+ /** @internal */
261
+ export const Webhook$inboundSchema: z.ZodMiniType<Webhook, unknown> = z.pipe(
262
+ z.object({
263
+ id: types.string(),
264
+ url: types.string(),
265
+ events: z.array(GetOrgRepoWebhooksEvent$inboundSchema),
266
+ branches: types.nullable(z.array(types.string())),
267
+ globs: types.nullable(z.array(types.string())),
268
+ created_at: types.string(),
269
+ updated_at: types.string(),
270
+ }),
271
+ z.transform((v) => {
272
+ return remap$(v, {
273
+ "created_at": "createdAt",
274
+ "updated_at": "updatedAt",
275
+ });
276
+ }),
277
+ );
278
+
279
+ export function webhookFromJSON(
280
+ jsonString: string,
281
+ ): SafeParseResult<Webhook, SDKValidationError> {
282
+ return safeParse(
283
+ jsonString,
284
+ (x) => Webhook$inboundSchema.parse(JSON.parse(x)),
285
+ `Failed to parse 'Webhook' from JSON`,
286
+ );
287
+ }
288
+
289
+ /** @internal */
290
+ export const GetOrgRepoWebhooksResponse$inboundSchema: z.ZodMiniType<
291
+ GetOrgRepoWebhooksResponse,
292
+ unknown
293
+ > = z.object({
294
+ webhooks: z.array(z.lazy(() => Webhook$inboundSchema)),
295
+ });
296
+
297
+ export function getOrgRepoWebhooksResponseFromJSON(
298
+ jsonString: string,
299
+ ): SafeParseResult<GetOrgRepoWebhooksResponse, SDKValidationError> {
300
+ return safeParse(
301
+ jsonString,
302
+ (x) => GetOrgRepoWebhooksResponse$inboundSchema.parse(JSON.parse(x)),
303
+ `Failed to parse 'GetOrgRepoWebhooksResponse' from JSON`,
304
+ );
305
+ }
@@ -5,6 +5,7 @@
5
5
  export * from "./deleteorgapikeysid.js";
6
6
  export * from "./deleteorgrepo.js";
7
7
  export * from "./deleteorgrepobranchesbranch.js";
8
+ export * from "./deleteorgrepowebhookswebhookid.js";
8
9
  export * from "./getorgapikeys.js";
9
10
  export * from "./getorgrepo.js";
10
11
  export * from "./getorgrepoagentblame.js";
@@ -15,9 +16,11 @@ export * from "./getorgrepocommitssha.js";
15
16
  export * from "./getorgrepocontent.js";
16
17
  export * from "./getorgrepodiff.js";
17
18
  export * from "./getorgrepos.js";
19
+ export * from "./getorgrepowebhooks.js";
18
20
  export * from "./patchorgrepo.js";
19
21
  export * from "./postorgapikeys.js";
20
22
  export * from "./postorgrepoanalyticsrefresh.js";
21
23
  export * from "./postorgrepobranches.js";
22
24
  export * from "./postorgrepocommits.js";
23
25
  export * from "./postorgrepos.js";
26
+ export * from "./postorgrepowebhooks.js";
@@ -16,6 +16,8 @@ export const Scope = {
16
16
  RepoRead: "repo:read",
17
17
  RepoCreate: "repo:create",
18
18
  RepoDelete: "repo:delete",
19
+ WebhookRead: "webhook:read",
20
+ WebhookWrite: "webhook:write",
19
21
  Admin: "admin",
20
22
  } as const;
21
23
  export type Scope = ClosedEnum<typeof Scope>;