@mesadev/sdk 0.3.1 → 0.3.3

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 (89) hide show
  1. package/README.md +53 -13
  2. package/dist/api/client.d.ts +26 -0
  3. package/dist/api/client.d.ts.map +1 -0
  4. package/dist/api/client.js +40 -0
  5. package/dist/api/client.js.map +1 -0
  6. package/dist/api/index.d.ts +2 -0
  7. package/dist/api/index.d.ts.map +1 -0
  8. package/dist/api/index.js +2 -0
  9. package/dist/api/index.js.map +1 -0
  10. package/dist/api/resources.d.ts +134 -0
  11. package/dist/api/resources.d.ts.map +1 -0
  12. package/dist/api/resources.js +151 -0
  13. package/dist/api/resources.js.map +1 -0
  14. package/dist/git/index.d.ts +2 -0
  15. package/dist/git/index.d.ts.map +1 -0
  16. package/dist/git/index.js +2 -0
  17. package/dist/git/index.js.map +1 -0
  18. package/dist/git/path-utils.d.ts +4 -0
  19. package/dist/git/path-utils.d.ts.map +1 -0
  20. package/dist/git/path-utils.js +47 -0
  21. package/dist/git/path-utils.js.map +1 -0
  22. package/dist/git/service.d.ts +3 -0
  23. package/dist/git/service.d.ts.map +1 -0
  24. package/dist/git/service.js +308 -0
  25. package/dist/git/service.js.map +1 -0
  26. package/dist/git/types.d.ts +30 -0
  27. package/dist/git/types.d.ts.map +1 -0
  28. package/dist/git/types.js +2 -0
  29. package/dist/git/types.js.map +1 -0
  30. package/dist/index.d.ts +4 -1
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +3 -2
  33. package/dist/index.js.map +1 -0
  34. package/dist/lib/errors.d.ts +15 -0
  35. package/dist/lib/errors.d.ts.map +1 -0
  36. package/dist/lib/errors.js +27 -0
  37. package/dist/lib/errors.js.map +1 -0
  38. package/dist/mesa.d.ts +35 -0
  39. package/dist/mesa.d.ts.map +1 -0
  40. package/dist/mesa.js +126 -0
  41. package/dist/mesa.js.map +1 -0
  42. package/package.json +43 -20
  43. package/LICENSE +0 -201
  44. package/dist/client/client.gen.d.ts +0 -2
  45. package/dist/client/client.gen.js +0 -234
  46. package/dist/client/index.d.ts +0 -8
  47. package/dist/client/index.js +0 -6
  48. package/dist/client/types.gen.d.ts +0 -117
  49. package/dist/client/types.gen.js +0 -2
  50. package/dist/client/utils.gen.d.ts +0 -33
  51. package/dist/client/utils.gen.js +0 -228
  52. package/dist/client.gen.d.ts +0 -12
  53. package/dist/client.gen.js +0 -3
  54. package/dist/core/auth.gen.d.ts +0 -18
  55. package/dist/core/auth.gen.js +0 -14
  56. package/dist/core/bodySerializer.gen.d.ts +0 -25
  57. package/dist/core/bodySerializer.gen.js +0 -57
  58. package/dist/core/params.gen.d.ts +0 -43
  59. package/dist/core/params.gen.js +0 -100
  60. package/dist/core/pathSerializer.gen.d.ts +0 -33
  61. package/dist/core/pathSerializer.gen.js +0 -106
  62. package/dist/core/queryKeySerializer.gen.d.ts +0 -18
  63. package/dist/core/queryKeySerializer.gen.js +0 -92
  64. package/dist/core/serverSentEvents.gen.d.ts +0 -71
  65. package/dist/core/serverSentEvents.gen.js +0 -133
  66. package/dist/core/types.gen.d.ts +0 -78
  67. package/dist/core/types.gen.js +0 -2
  68. package/dist/core/utils.gen.d.ts +0 -19
  69. package/dist/core/utils.gen.js +0 -87
  70. package/dist/sdk.gen.d.ts +0 -123
  71. package/dist/sdk.gen.js +0 -202
  72. package/dist/types.gen.d.ts +0 -2285
  73. package/dist/types.gen.js +0 -2
  74. package/src/client/client.gen.ts +0 -288
  75. package/src/client/index.ts +0 -25
  76. package/src/client/types.gen.ts +0 -214
  77. package/src/client/utils.gen.ts +0 -316
  78. package/src/client.gen.ts +0 -16
  79. package/src/core/auth.gen.ts +0 -41
  80. package/src/core/bodySerializer.gen.ts +0 -84
  81. package/src/core/params.gen.ts +0 -169
  82. package/src/core/pathSerializer.gen.ts +0 -171
  83. package/src/core/queryKeySerializer.gen.ts +0 -117
  84. package/src/core/serverSentEvents.gen.ts +0 -243
  85. package/src/core/types.gen.ts +0 -104
  86. package/src/core/utils.gen.ts +0 -140
  87. package/src/index.ts +0 -2
  88. package/src/sdk.gen.ts +0 -237
  89. package/src/types.gen.ts +0 -2377
@@ -1,140 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
4
- import {
5
- type ArraySeparatorStyle,
6
- serializeArrayParam,
7
- serializeObjectParam,
8
- serializePrimitiveParam,
9
- } from './pathSerializer.gen';
10
-
11
- export interface PathSerializer {
12
- path: Record<string, unknown>;
13
- url: string;
14
- }
15
-
16
- export const PATH_PARAM_RE = /\{[^{}]+\}/g;
17
-
18
- export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
19
- let url = _url;
20
- const matches = _url.match(PATH_PARAM_RE);
21
- if (matches) {
22
- for (const match of matches) {
23
- let explode = false;
24
- let name = match.substring(1, match.length - 1);
25
- let style: ArraySeparatorStyle = 'simple';
26
-
27
- if (name.endsWith('*')) {
28
- explode = true;
29
- name = name.substring(0, name.length - 1);
30
- }
31
-
32
- if (name.startsWith('.')) {
33
- name = name.substring(1);
34
- style = 'label';
35
- } else if (name.startsWith(';')) {
36
- name = name.substring(1);
37
- style = 'matrix';
38
- }
39
-
40
- const value = path[name];
41
-
42
- if (value === undefined || value === null) {
43
- continue;
44
- }
45
-
46
- if (Array.isArray(value)) {
47
- url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
48
- continue;
49
- }
50
-
51
- if (typeof value === 'object') {
52
- url = url.replace(
53
- match,
54
- serializeObjectParam({
55
- explode,
56
- name,
57
- style,
58
- value: value as Record<string, unknown>,
59
- valueOnly: true,
60
- }),
61
- );
62
- continue;
63
- }
64
-
65
- if (style === 'matrix') {
66
- url = url.replace(
67
- match,
68
- `;${serializePrimitiveParam({
69
- name,
70
- value: value as string,
71
- })}`,
72
- );
73
- continue;
74
- }
75
-
76
- const replaceValue = encodeURIComponent(
77
- style === 'label' ? `.${value as string}` : (value as string),
78
- );
79
- url = url.replace(match, replaceValue);
80
- }
81
- }
82
- return url;
83
- };
84
-
85
- export const getUrl = ({
86
- baseUrl,
87
- path,
88
- query,
89
- querySerializer,
90
- url: _url,
91
- }: {
92
- baseUrl?: string;
93
- path?: Record<string, unknown>;
94
- query?: Record<string, unknown>;
95
- querySerializer: QuerySerializer;
96
- url: string;
97
- }) => {
98
- const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
99
- let url = (baseUrl ?? '') + pathUrl;
100
- if (path) {
101
- url = defaultPathSerializer({ path, url });
102
- }
103
- let search = query ? querySerializer(query) : '';
104
- if (search.startsWith('?')) {
105
- search = search.substring(1);
106
- }
107
- if (search) {
108
- url += `?${search}`;
109
- }
110
- return url;
111
- };
112
-
113
- export function getValidRequestBody(options: {
114
- body?: unknown;
115
- bodySerializer?: BodySerializer | null;
116
- serializedBody?: unknown;
117
- }) {
118
- const hasBody = options.body !== undefined;
119
- const isSerializedBody = hasBody && options.bodySerializer;
120
-
121
- if (isSerializedBody) {
122
- if ('serializedBody' in options) {
123
- const hasSerializedBody =
124
- options.serializedBody !== undefined && options.serializedBody !== '';
125
-
126
- return hasSerializedBody ? options.serializedBody : null;
127
- }
128
-
129
- // not all clients implement a serializedBody property (i.e. client-axios)
130
- return options.body !== '' ? options.body : null;
131
- }
132
-
133
- // plain/text body
134
- if (hasBody) {
135
- return options.body;
136
- }
137
-
138
- // no body was provided
139
- return undefined;
140
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- // Generated by @hey-api/openapi-ts — do not edit manually
2
- export * from "./client/index.js";
package/src/sdk.gen.ts DELETED
@@ -1,237 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import type { Client, Options as Options2, TDataShape } from './client';
4
- import { client } from './client.gen';
5
- import type { DeleteByOrgApiKeysByIdData, DeleteByOrgApiKeysByIdErrors, DeleteByOrgApiKeysByIdResponses, DeleteByOrgByRepoBranchesByBranchData, DeleteByOrgByRepoBranchesByBranchErrors, DeleteByOrgByRepoBranchesByBranchResponses, DeleteByOrgByRepoData, DeleteByOrgByRepoErrors, DeleteByOrgByRepoResponses, DeleteByOrgByRepoWebhooksByWebhookIdData, DeleteByOrgByRepoWebhooksByWebhookIdErrors, DeleteByOrgByRepoWebhooksByWebhookIdResponses, GetByOrgApiKeysData, GetByOrgApiKeysErrors, GetByOrgApiKeysResponses, GetByOrgByRepoBranchesData, GetByOrgByRepoBranchesErrors, GetByOrgByRepoBranchesResponses, GetByOrgByRepoCommitsByShaData, GetByOrgByRepoCommitsByShaErrors, GetByOrgByRepoCommitsByShaResponses, GetByOrgByRepoCommitsData, GetByOrgByRepoCommitsErrors, GetByOrgByRepoCommitsResponses, GetByOrgByRepoContentData, GetByOrgByRepoContentErrors, GetByOrgByRepoContentResponses, GetByOrgByRepoData, GetByOrgByRepoErrors, GetByOrgByRepoResponses, GetByOrgByRepoWebhooksData, GetByOrgByRepoWebhooksErrors, GetByOrgByRepoWebhooksResponses, GetByOrgData, GetByOrgErrors, GetByOrgReposData, GetByOrgReposErrors, GetByOrgReposResponses, GetByOrgResponses, PatchByOrgByRepoData, PatchByOrgByRepoErrors, PatchByOrgByRepoResponses, PostByOrgApiKeysData, PostByOrgApiKeysErrors, PostByOrgApiKeysResponses, PostByOrgByRepoBranchesData, PostByOrgByRepoBranchesErrors, PostByOrgByRepoBranchesResponses, PostByOrgByRepoWebhooksData, PostByOrgByRepoWebhooksErrors, PostByOrgByRepoWebhooksResponses, PostByOrgReposData, PostByOrgReposErrors, PostByOrgReposResponses } from './types.gen';
6
-
7
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
- /**
9
- * You can provide a client instance returned by `createClient()` instead of
10
- * individual options. This might be also useful if you want to implement a
11
- * custom client.
12
- */
13
- client?: Client;
14
- /**
15
- * You can pass arbitrary values through the `meta` object. This can be
16
- * used to access values that aren't defined as part of the SDK function.
17
- */
18
- meta?: Record<string, unknown>;
19
- };
20
-
21
- /**
22
- * List API keys
23
- *
24
- * List all API keys for the organization (key values are not returned)
25
- */
26
- export const getByOrgApiKeys = <ThrowOnError extends boolean = false>(options: Options<GetByOrgApiKeysData, ThrowOnError>) => (options.client ?? client).get<GetByOrgApiKeysResponses, GetByOrgApiKeysErrors, ThrowOnError>({
27
- security: [{ scheme: 'bearer', type: 'http' }],
28
- url: '/{org}/api-keys',
29
- ...options
30
- });
31
-
32
- /**
33
- * Create API key
34
- *
35
- * Create a new API key for programmatic access
36
- */
37
- export const postByOrgApiKeys = <ThrowOnError extends boolean = false>(options: Options<PostByOrgApiKeysData, ThrowOnError>) => (options.client ?? client).post<PostByOrgApiKeysResponses, PostByOrgApiKeysErrors, ThrowOnError>({
38
- security: [{ scheme: 'bearer', type: 'http' }],
39
- url: '/{org}/api-keys',
40
- ...options,
41
- headers: {
42
- 'Content-Type': 'application/json',
43
- ...options.headers
44
- }
45
- });
46
-
47
- /**
48
- * Revoke API key
49
- *
50
- * Revoke an API key by its ID
51
- */
52
- export const deleteByOrgApiKeysById = <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgApiKeysByIdData, ThrowOnError>) => (options.client ?? client).delete<DeleteByOrgApiKeysByIdResponses, DeleteByOrgApiKeysByIdErrors, ThrowOnError>({
53
- security: [{ scheme: 'bearer', type: 'http' }],
54
- url: '/{org}/api-keys/{id}',
55
- ...options
56
- });
57
-
58
- /**
59
- * List repositories
60
- *
61
- * List all repositories in the organization
62
- */
63
- export const getByOrgRepos = <ThrowOnError extends boolean = false>(options: Options<GetByOrgReposData, ThrowOnError>) => (options.client ?? client).get<GetByOrgReposResponses, GetByOrgReposErrors, ThrowOnError>({
64
- security: [{ scheme: 'bearer', type: 'http' }],
65
- url: '/{org}/repos',
66
- ...options
67
- });
68
-
69
- /**
70
- * Create repository
71
- *
72
- * Create a new repository in the organization
73
- */
74
- export const postByOrgRepos = <ThrowOnError extends boolean = false>(options: Options<PostByOrgReposData, ThrowOnError>) => (options.client ?? client).post<PostByOrgReposResponses, PostByOrgReposErrors, ThrowOnError>({
75
- security: [{ scheme: 'bearer', type: 'http' }],
76
- url: '/{org}/repos',
77
- ...options,
78
- headers: {
79
- 'Content-Type': 'application/json',
80
- ...options.headers
81
- }
82
- });
83
-
84
- /**
85
- * Delete repository
86
- *
87
- * Permanently delete a repository and all its data
88
- */
89
- export const deleteByOrgByRepo = <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoData, ThrowOnError>) => (options.client ?? client).delete<DeleteByOrgByRepoResponses, DeleteByOrgByRepoErrors, ThrowOnError>({
90
- security: [{ scheme: 'bearer', type: 'http' }],
91
- url: '/{org}/{repo}',
92
- ...options
93
- });
94
-
95
- /**
96
- * Get repository
97
- *
98
- * Get metadata for a specific repository
99
- */
100
- export const getByOrgByRepo = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoResponses, GetByOrgByRepoErrors, ThrowOnError>({
101
- security: [{ scheme: 'bearer', type: 'http' }],
102
- url: '/{org}/{repo}',
103
- ...options
104
- });
105
-
106
- /**
107
- * Update repository
108
- *
109
- * Update repository name or upstream configuration
110
- */
111
- export const patchByOrgByRepo = <ThrowOnError extends boolean = false>(options: Options<PatchByOrgByRepoData, ThrowOnError>) => (options.client ?? client).patch<PatchByOrgByRepoResponses, PatchByOrgByRepoErrors, ThrowOnError>({
112
- security: [{ scheme: 'bearer', type: 'http' }],
113
- url: '/{org}/{repo}',
114
- ...options,
115
- headers: {
116
- 'Content-Type': 'application/json',
117
- ...options.headers
118
- }
119
- });
120
-
121
- /**
122
- * Get content
123
- *
124
- * Get file content or directory listing at a path. Use Accept: application/json for the JSON union response, or Accept: application/octet-stream for raw file bytes. Directory + octet-stream requests return 406 Not Acceptable.
125
- */
126
- export const getByOrgByRepoContent = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoContentData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoContentResponses, GetByOrgByRepoContentErrors, ThrowOnError>({
127
- security: [{ scheme: 'bearer', type: 'http' }],
128
- url: '/{org}/{repo}/content',
129
- ...options
130
- });
131
-
132
- /**
133
- * List branches
134
- *
135
- * List all branches in a repository
136
- */
137
- export const getByOrgByRepoBranches = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoBranchesData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoBranchesResponses, GetByOrgByRepoBranchesErrors, ThrowOnError>({
138
- security: [{ scheme: 'bearer', type: 'http' }],
139
- url: '/{org}/{repo}/branches',
140
- ...options
141
- });
142
-
143
- /**
144
- * Create branch
145
- *
146
- * Create a new branch from an existing ref
147
- */
148
- export const postByOrgByRepoBranches = <ThrowOnError extends boolean = false>(options: Options<PostByOrgByRepoBranchesData, ThrowOnError>) => (options.client ?? client).post<PostByOrgByRepoBranchesResponses, PostByOrgByRepoBranchesErrors, ThrowOnError>({
149
- security: [{ scheme: 'bearer', type: 'http' }],
150
- url: '/{org}/{repo}/branches',
151
- ...options,
152
- headers: {
153
- 'Content-Type': 'application/json',
154
- ...options.headers
155
- }
156
- });
157
-
158
- /**
159
- * Delete branch
160
- *
161
- * Delete a branch from a repository
162
- */
163
- export const deleteByOrgByRepoBranchesByBranch = <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoBranchesByBranchData, ThrowOnError>) => (options.client ?? client).delete<DeleteByOrgByRepoBranchesByBranchResponses, DeleteByOrgByRepoBranchesByBranchErrors, ThrowOnError>({
164
- security: [{ scheme: 'bearer', type: 'http' }],
165
- url: '/{org}/{repo}/branches/{branch}',
166
- ...options
167
- });
168
-
169
- /**
170
- * List commits
171
- *
172
- * List commits for a repository from a specific ref
173
- */
174
- export const getByOrgByRepoCommits = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoCommitsData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoCommitsResponses, GetByOrgByRepoCommitsErrors, ThrowOnError>({
175
- security: [{ scheme: 'bearer', type: 'http' }],
176
- url: '/{org}/{repo}/commits',
177
- ...options
178
- });
179
-
180
- /**
181
- * Get commit
182
- *
183
- * Retrieve a specific commit by its SHA
184
- */
185
- export const getByOrgByRepoCommitsBySha = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoCommitsByShaData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoCommitsByShaResponses, GetByOrgByRepoCommitsByShaErrors, ThrowOnError>({
186
- security: [{ scheme: 'bearer', type: 'http' }],
187
- url: '/{org}/{repo}/commits/{sha}',
188
- ...options
189
- });
190
-
191
- /**
192
- * List webhooks
193
- *
194
- * List webhooks for a repository
195
- */
196
- export const getByOrgByRepoWebhooks = <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoWebhooksData, ThrowOnError>) => (options.client ?? client).get<GetByOrgByRepoWebhooksResponses, GetByOrgByRepoWebhooksErrors, ThrowOnError>({
197
- security: [{ scheme: 'bearer', type: 'http' }],
198
- url: '/{org}/{repo}/webhooks',
199
- ...options
200
- });
201
-
202
- /**
203
- * Create webhook
204
- *
205
- * Create a webhook for a repository
206
- */
207
- export const postByOrgByRepoWebhooks = <ThrowOnError extends boolean = false>(options: Options<PostByOrgByRepoWebhooksData, ThrowOnError>) => (options.client ?? client).post<PostByOrgByRepoWebhooksResponses, PostByOrgByRepoWebhooksErrors, ThrowOnError>({
208
- security: [{ scheme: 'bearer', type: 'http' }],
209
- url: '/{org}/{repo}/webhooks',
210
- ...options,
211
- headers: {
212
- 'Content-Type': 'application/json',
213
- ...options.headers
214
- }
215
- });
216
-
217
- /**
218
- * Delete webhook
219
- *
220
- * Delete a webhook from a repository
221
- */
222
- export const deleteByOrgByRepoWebhooksByWebhookId = <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoWebhooksByWebhookIdData, ThrowOnError>) => (options.client ?? client).delete<DeleteByOrgByRepoWebhooksByWebhookIdResponses, DeleteByOrgByRepoWebhooksByWebhookIdErrors, ThrowOnError>({
223
- security: [{ scheme: 'bearer', type: 'http' }],
224
- url: '/{org}/{repo}/webhooks/{webhookId}',
225
- ...options
226
- });
227
-
228
- /**
229
- * Get organization
230
- *
231
- * Get organization metadata and repository counts
232
- */
233
- export const getByOrg = <ThrowOnError extends boolean = false>(options: Options<GetByOrgData, ThrowOnError>) => (options.client ?? client).get<GetByOrgResponses, GetByOrgErrors, ThrowOnError>({
234
- security: [{ scheme: 'bearer', type: 'http' }],
235
- url: '/{org}',
236
- ...options
237
- });