@mesadev/rest 0.3.3 → 0.4.1

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 (43) hide show
  1. package/README.md +9 -16
  2. package/dist/index.d.mts +3361 -0
  3. package/dist/index.d.mts.map +1 -0
  4. package/dist/index.mjs +944 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +17 -10
  7. package/src/client.gen.ts +1 -1
  8. package/src/index.ts +144 -2
  9. package/src/sdk.gen.ts +68 -31
  10. package/src/types.gen.ts +451 -89
  11. package/LICENSE +0 -201
  12. package/dist/client/client.gen.d.ts +0 -2
  13. package/dist/client/client.gen.js +0 -234
  14. package/dist/client/index.d.ts +0 -8
  15. package/dist/client/index.js +0 -6
  16. package/dist/client/types.gen.d.ts +0 -117
  17. package/dist/client/types.gen.js +0 -2
  18. package/dist/client/utils.gen.d.ts +0 -33
  19. package/dist/client/utils.gen.js +0 -228
  20. package/dist/client.gen.d.ts +0 -12
  21. package/dist/client.gen.js +0 -3
  22. package/dist/core/auth.gen.d.ts +0 -18
  23. package/dist/core/auth.gen.js +0 -14
  24. package/dist/core/bodySerializer.gen.d.ts +0 -25
  25. package/dist/core/bodySerializer.gen.js +0 -57
  26. package/dist/core/params.gen.d.ts +0 -43
  27. package/dist/core/params.gen.js +0 -100
  28. package/dist/core/pathSerializer.gen.d.ts +0 -33
  29. package/dist/core/pathSerializer.gen.js +0 -106
  30. package/dist/core/queryKeySerializer.gen.d.ts +0 -18
  31. package/dist/core/queryKeySerializer.gen.js +0 -92
  32. package/dist/core/serverSentEvents.gen.d.ts +0 -71
  33. package/dist/core/serverSentEvents.gen.js +0 -133
  34. package/dist/core/types.gen.d.ts +0 -78
  35. package/dist/core/types.gen.js +0 -2
  36. package/dist/core/utils.gen.d.ts +0 -19
  37. package/dist/core/utils.gen.js +0 -87
  38. package/dist/index.d.ts +0 -2
  39. package/dist/index.js +0 -2
  40. package/dist/sdk.gen.d.ts +0 -135
  41. package/dist/sdk.gen.js +0 -226
  42. package/dist/types.gen.d.ts +0 -2547
  43. package/dist/types.gen.js +0 -2
@@ -1,92 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- /**
3
- * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
4
- */
5
- export const queryKeyJsonReplacer = (_key, value) => {
6
- if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
7
- return undefined;
8
- }
9
- if (typeof value === 'bigint') {
10
- return value.toString();
11
- }
12
- if (value instanceof Date) {
13
- return value.toISOString();
14
- }
15
- return value;
16
- };
17
- /**
18
- * Safely stringifies a value and parses it back into a JsonValue.
19
- */
20
- export const stringifyToJsonValue = (input) => {
21
- try {
22
- const json = JSON.stringify(input, queryKeyJsonReplacer);
23
- if (json === undefined) {
24
- return undefined;
25
- }
26
- return JSON.parse(json);
27
- }
28
- catch {
29
- return undefined;
30
- }
31
- };
32
- /**
33
- * Detects plain objects (including objects with a null prototype).
34
- */
35
- const isPlainObject = (value) => {
36
- if (value === null || typeof value !== 'object') {
37
- return false;
38
- }
39
- const prototype = Object.getPrototypeOf(value);
40
- return prototype === Object.prototype || prototype === null;
41
- };
42
- /**
43
- * Turns URLSearchParams into a sorted JSON object for deterministic keys.
44
- */
45
- const serializeSearchParams = (params) => {
46
- const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
47
- const result = {};
48
- for (const [key, value] of entries) {
49
- const existing = result[key];
50
- if (existing === undefined) {
51
- result[key] = value;
52
- continue;
53
- }
54
- if (Array.isArray(existing)) {
55
- existing.push(value);
56
- }
57
- else {
58
- result[key] = [existing, value];
59
- }
60
- }
61
- return result;
62
- };
63
- /**
64
- * Normalizes any accepted value into a JSON-friendly shape for query keys.
65
- */
66
- export const serializeQueryKeyValue = (value) => {
67
- if (value === null) {
68
- return null;
69
- }
70
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
71
- return value;
72
- }
73
- if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
74
- return undefined;
75
- }
76
- if (typeof value === 'bigint') {
77
- return value.toString();
78
- }
79
- if (value instanceof Date) {
80
- return value.toISOString();
81
- }
82
- if (Array.isArray(value)) {
83
- return stringifyToJsonValue(value);
84
- }
85
- if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
86
- return serializeSearchParams(value);
87
- }
88
- if (isPlainObject(value)) {
89
- return stringifyToJsonValue(value);
90
- }
91
- return undefined;
92
- };
@@ -1,71 +0,0 @@
1
- import type { Config } from './types.gen';
2
- export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {
3
- /**
4
- * Fetch API implementation. You can use this option to provide a custom
5
- * fetch instance.
6
- *
7
- * @default globalThis.fetch
8
- */
9
- fetch?: typeof fetch;
10
- /**
11
- * Implementing clients can call request interceptors inside this hook.
12
- */
13
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
14
- /**
15
- * Callback invoked when a network or parsing error occurs during streaming.
16
- *
17
- * This option applies only if the endpoint returns a stream of events.
18
- *
19
- * @param error The error that occurred.
20
- */
21
- onSseError?: (error: unknown) => void;
22
- /**
23
- * Callback invoked when an event is streamed from the server.
24
- *
25
- * This option applies only if the endpoint returns a stream of events.
26
- *
27
- * @param event Event streamed from the server.
28
- * @returns Nothing (void).
29
- */
30
- onSseEvent?: (event: StreamEvent<TData>) => void;
31
- serializedBody?: RequestInit['body'];
32
- /**
33
- * Default retry delay in milliseconds.
34
- *
35
- * This option applies only if the endpoint returns a stream of events.
36
- *
37
- * @default 3000
38
- */
39
- sseDefaultRetryDelay?: number;
40
- /**
41
- * Maximum number of retry attempts before giving up.
42
- */
43
- sseMaxRetryAttempts?: number;
44
- /**
45
- * Maximum retry delay in milliseconds.
46
- *
47
- * Applies only when exponential backoff is used.
48
- *
49
- * This option applies only if the endpoint returns a stream of events.
50
- *
51
- * @default 30000
52
- */
53
- sseMaxRetryDelay?: number;
54
- /**
55
- * Optional sleep function for retry backoff.
56
- *
57
- * Defaults to using `setTimeout`.
58
- */
59
- sseSleepFn?: (ms: number) => Promise<void>;
60
- url: string;
61
- };
62
- export interface StreamEvent<TData = unknown> {
63
- data: TData;
64
- event?: string;
65
- id?: string;
66
- retry?: number;
67
- }
68
- export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
69
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
70
- };
71
- export declare const createSseClient: <TData = unknown>({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }: ServerSentEventsOptions) => ServerSentEventsResult<TData>;
@@ -1,133 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) => {
3
- let lastEventId;
4
- const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
5
- const createStream = async function* () {
6
- let retryDelay = sseDefaultRetryDelay ?? 3000;
7
- let attempt = 0;
8
- const signal = options.signal ?? new AbortController().signal;
9
- while (true) {
10
- if (signal.aborted)
11
- break;
12
- attempt++;
13
- const headers = options.headers instanceof Headers
14
- ? options.headers
15
- : new Headers(options.headers);
16
- if (lastEventId !== undefined) {
17
- headers.set('Last-Event-ID', lastEventId);
18
- }
19
- try {
20
- const requestInit = {
21
- redirect: 'follow',
22
- ...options,
23
- body: options.serializedBody,
24
- headers,
25
- signal,
26
- };
27
- let request = new Request(url, requestInit);
28
- if (onRequest) {
29
- request = await onRequest(url, requestInit);
30
- }
31
- // fetch must be assigned here, otherwise it would throw the error:
32
- // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
33
- const _fetch = options.fetch ?? globalThis.fetch;
34
- const response = await _fetch(request);
35
- if (!response.ok)
36
- throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
37
- if (!response.body)
38
- throw new Error('No body in SSE response');
39
- const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
40
- let buffer = '';
41
- const abortHandler = () => {
42
- try {
43
- reader.cancel();
44
- }
45
- catch {
46
- // noop
47
- }
48
- };
49
- signal.addEventListener('abort', abortHandler);
50
- try {
51
- while (true) {
52
- const { done, value } = await reader.read();
53
- if (done)
54
- break;
55
- buffer += value;
56
- // Normalize line endings: CRLF -> LF, then CR -> LF
57
- buffer = buffer.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
58
- const chunks = buffer.split('\n\n');
59
- buffer = chunks.pop() ?? '';
60
- for (const chunk of chunks) {
61
- const lines = chunk.split('\n');
62
- const dataLines = [];
63
- let eventName;
64
- for (const line of lines) {
65
- if (line.startsWith('data:')) {
66
- dataLines.push(line.replace(/^data:\s*/, ''));
67
- }
68
- else if (line.startsWith('event:')) {
69
- eventName = line.replace(/^event:\s*/, '');
70
- }
71
- else if (line.startsWith('id:')) {
72
- lastEventId = line.replace(/^id:\s*/, '');
73
- }
74
- else if (line.startsWith('retry:')) {
75
- const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10);
76
- if (!Number.isNaN(parsed)) {
77
- retryDelay = parsed;
78
- }
79
- }
80
- }
81
- let data;
82
- let parsedJson = false;
83
- if (dataLines.length) {
84
- const rawData = dataLines.join('\n');
85
- try {
86
- data = JSON.parse(rawData);
87
- parsedJson = true;
88
- }
89
- catch {
90
- data = rawData;
91
- }
92
- }
93
- if (parsedJson) {
94
- if (responseValidator) {
95
- await responseValidator(data);
96
- }
97
- if (responseTransformer) {
98
- data = await responseTransformer(data);
99
- }
100
- }
101
- onSseEvent?.({
102
- data,
103
- event: eventName,
104
- id: lastEventId,
105
- retry: retryDelay,
106
- });
107
- if (dataLines.length) {
108
- yield data;
109
- }
110
- }
111
- }
112
- }
113
- finally {
114
- signal.removeEventListener('abort', abortHandler);
115
- reader.releaseLock();
116
- }
117
- break; // exit loop on normal completion
118
- }
119
- catch (error) {
120
- // connection failed or aborted; retry after delay
121
- onSseError?.(error);
122
- if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
123
- break; // stop after firing error
124
- }
125
- // exponential backoff: double retry each attempt, cap at 30s
126
- const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
127
- await sleep(backoff);
128
- }
129
- }
130
- };
131
- const stream = createStream();
132
- return { stream };
133
- };
@@ -1,78 +0,0 @@
1
- import type { Auth, AuthToken } from './auth.gen';
2
- import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen';
3
- export type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
4
- export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
5
- /**
6
- * Returns the final request URL.
7
- */
8
- buildUrl: BuildUrlFn;
9
- getConfig: () => Config;
10
- request: RequestFn;
11
- setConfig: (config: Config) => Config;
12
- } & {
13
- [K in HttpMethod]: MethodFn;
14
- } & ([SseFn] extends [never] ? {
15
- sse?: never;
16
- } : {
17
- sse: {
18
- [K in HttpMethod]: SseFn;
19
- };
20
- });
21
- export interface Config {
22
- /**
23
- * Auth token or a function returning auth token. The resolved value will be
24
- * added to the request payload as defined by its `security` array.
25
- */
26
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
27
- /**
28
- * A function for serializing request body parameter. By default,
29
- * {@link JSON.stringify()} will be used.
30
- */
31
- bodySerializer?: BodySerializer | null;
32
- /**
33
- * An object containing any HTTP headers that you want to pre-populate your
34
- * `Headers` object with.
35
- *
36
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
37
- */
38
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
39
- /**
40
- * The request method.
41
- *
42
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
43
- */
44
- method?: Uppercase<HttpMethod>;
45
- /**
46
- * A function for serializing request query parameters. By default, arrays
47
- * will be exploded in form style, objects will be exploded in deepObject
48
- * style, and reserved characters are percent-encoded.
49
- *
50
- * This method will have no effect if the native `paramsSerializer()` Axios
51
- * API function is used.
52
- *
53
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
54
- */
55
- querySerializer?: QuerySerializer | QuerySerializerOptions;
56
- /**
57
- * A function validating request data. This is useful if you want to ensure
58
- * the request conforms to the desired shape, so it can be safely sent to
59
- * the server.
60
- */
61
- requestValidator?: (data: unknown) => Promise<unknown>;
62
- /**
63
- * A function transforming response data before it's returned. This is useful
64
- * for post-processing data, e.g. converting ISO strings into Date objects.
65
- */
66
- responseTransformer?: (data: unknown) => Promise<unknown>;
67
- /**
68
- * A function validating response data. This is useful if you want to ensure
69
- * the response conforms to the desired shape, so it can be safely passed to
70
- * the transformers and returned to the user.
71
- */
72
- responseValidator?: (data: unknown) => Promise<unknown>;
73
- }
74
- type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never] ? true : [T] extends [never | undefined] ? [undefined] extends [T] ? false : true : false;
75
- export type OmitNever<T extends Record<string, unknown>> = {
76
- [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
77
- };
78
- export {};
@@ -1,2 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export {};
@@ -1,19 +0,0 @@
1
- import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
2
- export interface PathSerializer {
3
- path: Record<string, unknown>;
4
- url: string;
5
- }
6
- export declare const PATH_PARAM_RE: RegExp;
7
- export declare const defaultPathSerializer: ({ path, url: _url }: PathSerializer) => string;
8
- export declare const getUrl: ({ baseUrl, path, query, querySerializer, url: _url, }: {
9
- baseUrl?: string;
10
- path?: Record<string, unknown>;
11
- query?: Record<string, unknown>;
12
- querySerializer: QuerySerializer;
13
- url: string;
14
- }) => string;
15
- export declare function getValidRequestBody(options: {
16
- body?: unknown;
17
- bodySerializer?: BodySerializer | null;
18
- serializedBody?: unknown;
19
- }): unknown;
@@ -1,87 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from './pathSerializer.gen';
3
- export const PATH_PARAM_RE = /\{[^{}]+\}/g;
4
- export const defaultPathSerializer = ({ path, url: _url }) => {
5
- let url = _url;
6
- const matches = _url.match(PATH_PARAM_RE);
7
- if (matches) {
8
- for (const match of matches) {
9
- let explode = false;
10
- let name = match.substring(1, match.length - 1);
11
- let style = 'simple';
12
- if (name.endsWith('*')) {
13
- explode = true;
14
- name = name.substring(0, name.length - 1);
15
- }
16
- if (name.startsWith('.')) {
17
- name = name.substring(1);
18
- style = 'label';
19
- }
20
- else if (name.startsWith(';')) {
21
- name = name.substring(1);
22
- style = 'matrix';
23
- }
24
- const value = path[name];
25
- if (value === undefined || value === null) {
26
- continue;
27
- }
28
- if (Array.isArray(value)) {
29
- url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
30
- continue;
31
- }
32
- if (typeof value === 'object') {
33
- url = url.replace(match, serializeObjectParam({
34
- explode,
35
- name,
36
- style,
37
- value: value,
38
- valueOnly: true,
39
- }));
40
- continue;
41
- }
42
- if (style === 'matrix') {
43
- url = url.replace(match, `;${serializePrimitiveParam({
44
- name,
45
- value: value,
46
- })}`);
47
- continue;
48
- }
49
- const replaceValue = encodeURIComponent(style === 'label' ? `.${value}` : value);
50
- url = url.replace(match, replaceValue);
51
- }
52
- }
53
- return url;
54
- };
55
- export const getUrl = ({ baseUrl, path, query, querySerializer, url: _url, }) => {
56
- const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
57
- let url = (baseUrl ?? '') + pathUrl;
58
- if (path) {
59
- url = defaultPathSerializer({ path, url });
60
- }
61
- let search = query ? querySerializer(query) : '';
62
- if (search.startsWith('?')) {
63
- search = search.substring(1);
64
- }
65
- if (search) {
66
- url += `?${search}`;
67
- }
68
- return url;
69
- };
70
- export function getValidRequestBody(options) {
71
- const hasBody = options.body !== undefined;
72
- const isSerializedBody = hasBody && options.bodySerializer;
73
- if (isSerializedBody) {
74
- if ('serializedBody' in options) {
75
- const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
76
- return hasSerializedBody ? options.serializedBody : null;
77
- }
78
- // not all clients implement a serializedBody property (i.e. client-axios)
79
- return options.body !== '' ? options.body : null;
80
- }
81
- // plain/text body
82
- if (hasBody) {
83
- return options.body;
84
- }
85
- // no body was provided
86
- return undefined;
87
- }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { deleteByOrgApiKeysById, deleteByOrgByRepo, deleteByOrgByRepoBranchesByBranch, deleteByOrgByRepoWebhooksByWebhookId, getByOrg, getByOrgApiKeys, getByOrgByRepo, getByOrgByRepoBranches, getByOrgByRepoCommits, getByOrgByRepoCommitsBySha, getByOrgByRepoContent, getByOrgByRepoDiff, getByOrgByRepoWebhooks, getByOrgRepos, type Options, patchByOrgByRepo, postByOrgApiKeys, postByOrgByRepoBranches, postByOrgByRepoCommits, postByOrgByRepoWebhooks, postByOrgRepos } from './sdk.gen';
2
- export type { ClientOptions, DeleteByOrgApiKeysByIdData, DeleteByOrgApiKeysByIdError, DeleteByOrgApiKeysByIdErrors, DeleteByOrgApiKeysByIdResponse, DeleteByOrgApiKeysByIdResponses, DeleteByOrgByRepoBranchesByBranchData, DeleteByOrgByRepoBranchesByBranchError, DeleteByOrgByRepoBranchesByBranchErrors, DeleteByOrgByRepoBranchesByBranchResponse, DeleteByOrgByRepoBranchesByBranchResponses, DeleteByOrgByRepoData, DeleteByOrgByRepoError, DeleteByOrgByRepoErrors, DeleteByOrgByRepoResponse, DeleteByOrgByRepoResponses, DeleteByOrgByRepoWebhooksByWebhookIdData, DeleteByOrgByRepoWebhooksByWebhookIdError, DeleteByOrgByRepoWebhooksByWebhookIdErrors, DeleteByOrgByRepoWebhooksByWebhookIdResponse, DeleteByOrgByRepoWebhooksByWebhookIdResponses, GetByOrgApiKeysData, GetByOrgApiKeysError, GetByOrgApiKeysErrors, GetByOrgApiKeysResponse, GetByOrgApiKeysResponses, GetByOrgByRepoBranchesData, GetByOrgByRepoBranchesError, GetByOrgByRepoBranchesErrors, GetByOrgByRepoBranchesResponse, GetByOrgByRepoBranchesResponses, GetByOrgByRepoCommitsByShaData, GetByOrgByRepoCommitsByShaError, GetByOrgByRepoCommitsByShaErrors, GetByOrgByRepoCommitsByShaResponse, GetByOrgByRepoCommitsByShaResponses, GetByOrgByRepoCommitsData, GetByOrgByRepoCommitsError, GetByOrgByRepoCommitsErrors, GetByOrgByRepoCommitsResponse, GetByOrgByRepoCommitsResponses, GetByOrgByRepoContentData, GetByOrgByRepoContentError, GetByOrgByRepoContentErrors, GetByOrgByRepoContentResponse, GetByOrgByRepoContentResponses, GetByOrgByRepoData, GetByOrgByRepoDiffData, GetByOrgByRepoDiffError, GetByOrgByRepoDiffErrors, GetByOrgByRepoDiffResponse, GetByOrgByRepoDiffResponses, GetByOrgByRepoError, GetByOrgByRepoErrors, GetByOrgByRepoResponse, GetByOrgByRepoResponses, GetByOrgByRepoWebhooksData, GetByOrgByRepoWebhooksError, GetByOrgByRepoWebhooksErrors, GetByOrgByRepoWebhooksResponse, GetByOrgByRepoWebhooksResponses, GetByOrgData, GetByOrgError, GetByOrgErrors, GetByOrgReposData, GetByOrgReposError, GetByOrgReposErrors, GetByOrgReposResponse, GetByOrgReposResponses, GetByOrgResponse, GetByOrgResponses, PatchByOrgByRepoData, PatchByOrgByRepoError, PatchByOrgByRepoErrors, PatchByOrgByRepoResponse, PatchByOrgByRepoResponses, PostByOrgApiKeysData, PostByOrgApiKeysError, PostByOrgApiKeysErrors, PostByOrgApiKeysResponse, PostByOrgApiKeysResponses, PostByOrgByRepoBranchesData, PostByOrgByRepoBranchesError, PostByOrgByRepoBranchesErrors, PostByOrgByRepoBranchesResponse, PostByOrgByRepoBranchesResponses, PostByOrgByRepoCommitsData, PostByOrgByRepoCommitsError, PostByOrgByRepoCommitsErrors, PostByOrgByRepoCommitsResponse, PostByOrgByRepoCommitsResponses, PostByOrgByRepoWebhooksData, PostByOrgByRepoWebhooksError, PostByOrgByRepoWebhooksErrors, PostByOrgByRepoWebhooksResponse, PostByOrgByRepoWebhooksResponses, PostByOrgReposData, PostByOrgReposError, PostByOrgReposErrors, PostByOrgReposResponse, PostByOrgReposResponses } from './types.gen';
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export { deleteByOrgApiKeysById, deleteByOrgByRepo, deleteByOrgByRepoBranchesByBranch, deleteByOrgByRepoWebhooksByWebhookId, getByOrg, getByOrgApiKeys, getByOrgByRepo, getByOrgByRepoBranches, getByOrgByRepoCommits, getByOrgByRepoCommitsBySha, getByOrgByRepoContent, getByOrgByRepoDiff, getByOrgByRepoWebhooks, getByOrgRepos, patchByOrgByRepo, postByOrgApiKeys, postByOrgByRepoBranches, postByOrgByRepoCommits, postByOrgByRepoWebhooks, postByOrgRepos } from './sdk.gen';
package/dist/sdk.gen.d.ts DELETED
@@ -1,135 +0,0 @@
1
- import type { Client, Options as Options2, TDataShape } from './client';
2
- 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, GetByOrgByRepoDiffData, GetByOrgByRepoDiffErrors, GetByOrgByRepoDiffResponses, GetByOrgByRepoErrors, GetByOrgByRepoResponses, GetByOrgByRepoWebhooksData, GetByOrgByRepoWebhooksErrors, GetByOrgByRepoWebhooksResponses, GetByOrgData, GetByOrgErrors, GetByOrgReposData, GetByOrgReposErrors, GetByOrgReposResponses, GetByOrgResponses, PatchByOrgByRepoData, PatchByOrgByRepoErrors, PatchByOrgByRepoResponses, PostByOrgApiKeysData, PostByOrgApiKeysErrors, PostByOrgApiKeysResponses, PostByOrgByRepoBranchesData, PostByOrgByRepoBranchesErrors, PostByOrgByRepoBranchesResponses, PostByOrgByRepoCommitsData, PostByOrgByRepoCommitsErrors, PostByOrgByRepoCommitsResponses, PostByOrgByRepoWebhooksData, PostByOrgByRepoWebhooksErrors, PostByOrgByRepoWebhooksResponses, PostByOrgReposData, PostByOrgReposErrors, PostByOrgReposResponses } from './types.gen';
3
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
- /**
5
- * You can provide a client instance returned by `createClient()` instead of
6
- * individual options. This might be also useful if you want to implement a
7
- * custom client.
8
- */
9
- client?: Client;
10
- /**
11
- * You can pass arbitrary values through the `meta` object. This can be
12
- * used to access values that aren't defined as part of the SDK function.
13
- */
14
- meta?: Record<string, unknown>;
15
- };
16
- /**
17
- * List API keys
18
- *
19
- * List all API keys for the organization (key values are not returned)
20
- */
21
- export declare const getByOrgApiKeys: <ThrowOnError extends boolean = false>(options: Options<GetByOrgApiKeysData, ThrowOnError>) => import("./client").RequestResult<GetByOrgApiKeysResponses, GetByOrgApiKeysErrors, ThrowOnError, "fields">;
22
- /**
23
- * Create API key
24
- *
25
- * Create a new API key for programmatic access
26
- */
27
- export declare const postByOrgApiKeys: <ThrowOnError extends boolean = false>(options: Options<PostByOrgApiKeysData, ThrowOnError>) => import("./client").RequestResult<PostByOrgApiKeysResponses, PostByOrgApiKeysErrors, ThrowOnError, "fields">;
28
- /**
29
- * Revoke API key
30
- *
31
- * Revoke an API key by its ID
32
- */
33
- export declare const deleteByOrgApiKeysById: <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgApiKeysByIdData, ThrowOnError>) => import("./client").RequestResult<DeleteByOrgApiKeysByIdResponses, DeleteByOrgApiKeysByIdErrors, ThrowOnError, "fields">;
34
- /**
35
- * List repositories
36
- *
37
- * List all repositories in the organization
38
- */
39
- export declare const getByOrgRepos: <ThrowOnError extends boolean = false>(options: Options<GetByOrgReposData, ThrowOnError>) => import("./client").RequestResult<GetByOrgReposResponses, GetByOrgReposErrors, ThrowOnError, "fields">;
40
- /**
41
- * Create repository
42
- *
43
- * Create a new repository in the organization
44
- */
45
- export declare const postByOrgRepos: <ThrowOnError extends boolean = false>(options: Options<PostByOrgReposData, ThrowOnError>) => import("./client").RequestResult<PostByOrgReposResponses, PostByOrgReposErrors, ThrowOnError, "fields">;
46
- /**
47
- * Delete repository
48
- *
49
- * Permanently delete a repository and all its data
50
- */
51
- export declare const deleteByOrgByRepo: <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoData, ThrowOnError>) => import("./client").RequestResult<DeleteByOrgByRepoResponses, DeleteByOrgByRepoErrors, ThrowOnError, "fields">;
52
- /**
53
- * Get repository
54
- *
55
- * Get metadata for a specific repository
56
- */
57
- export declare const getByOrgByRepo: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoResponses, GetByOrgByRepoErrors, ThrowOnError, "fields">;
58
- /**
59
- * Update repository
60
- *
61
- * Update repository name or upstream configuration
62
- */
63
- export declare const patchByOrgByRepo: <ThrowOnError extends boolean = false>(options: Options<PatchByOrgByRepoData, ThrowOnError>) => import("./client").RequestResult<PatchByOrgByRepoResponses, PatchByOrgByRepoErrors, ThrowOnError, "fields">;
64
- /**
65
- * Get content
66
- *
67
- * 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.
68
- */
69
- export declare const getByOrgByRepoContent: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoContentData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoContentResponses, GetByOrgByRepoContentErrors, ThrowOnError, "fields">;
70
- /**
71
- * List branches
72
- *
73
- * List all branches in a repository
74
- */
75
- export declare const getByOrgByRepoBranches: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoBranchesData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoBranchesResponses, GetByOrgByRepoBranchesErrors, ThrowOnError, "fields">;
76
- /**
77
- * Create branch
78
- *
79
- * Create a new branch from an existing ref
80
- */
81
- export declare const postByOrgByRepoBranches: <ThrowOnError extends boolean = false>(options: Options<PostByOrgByRepoBranchesData, ThrowOnError>) => import("./client").RequestResult<PostByOrgByRepoBranchesResponses, PostByOrgByRepoBranchesErrors, ThrowOnError, "fields">;
82
- /**
83
- * Delete branch
84
- *
85
- * Delete a branch from a repository
86
- */
87
- export declare const deleteByOrgByRepoBranchesByBranch: <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoBranchesByBranchData, ThrowOnError>) => import("./client").RequestResult<DeleteByOrgByRepoBranchesByBranchResponses, DeleteByOrgByRepoBranchesByBranchErrors, ThrowOnError, "fields">;
88
- /**
89
- * List commits
90
- *
91
- * List commits for a repository from a specific ref
92
- */
93
- export declare const getByOrgByRepoCommits: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoCommitsData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoCommitsResponses, GetByOrgByRepoCommitsErrors, ThrowOnError, "fields">;
94
- /**
95
- * Create commit
96
- *
97
- * Create a new commit on a branch with file changes
98
- */
99
- export declare const postByOrgByRepoCommits: <ThrowOnError extends boolean = false>(options: Options<PostByOrgByRepoCommitsData, ThrowOnError>) => import("./client").RequestResult<PostByOrgByRepoCommitsResponses, PostByOrgByRepoCommitsErrors, ThrowOnError, "fields">;
100
- /**
101
- * Get commit
102
- *
103
- * Retrieve a specific commit by its SHA
104
- */
105
- export declare const getByOrgByRepoCommitsBySha: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoCommitsByShaData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoCommitsByShaResponses, GetByOrgByRepoCommitsByShaErrors, ThrowOnError, "fields">;
106
- /**
107
- * Get diff
108
- *
109
- * Retrieve the diff between two commit OIDs
110
- */
111
- export declare const getByOrgByRepoDiff: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoDiffData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoDiffResponses, GetByOrgByRepoDiffErrors, ThrowOnError, "fields">;
112
- /**
113
- * List webhooks
114
- *
115
- * List webhooks for a repository
116
- */
117
- export declare const getByOrgByRepoWebhooks: <ThrowOnError extends boolean = false>(options: Options<GetByOrgByRepoWebhooksData, ThrowOnError>) => import("./client").RequestResult<GetByOrgByRepoWebhooksResponses, GetByOrgByRepoWebhooksErrors, ThrowOnError, "fields">;
118
- /**
119
- * Create webhook
120
- *
121
- * Create a webhook for a repository
122
- */
123
- export declare const postByOrgByRepoWebhooks: <ThrowOnError extends boolean = false>(options: Options<PostByOrgByRepoWebhooksData, ThrowOnError>) => import("./client").RequestResult<PostByOrgByRepoWebhooksResponses, PostByOrgByRepoWebhooksErrors, ThrowOnError, "fields">;
124
- /**
125
- * Delete webhook
126
- *
127
- * Delete a webhook from a repository
128
- */
129
- export declare const deleteByOrgByRepoWebhooksByWebhookId: <ThrowOnError extends boolean = false>(options: Options<DeleteByOrgByRepoWebhooksByWebhookIdData, ThrowOnError>) => import("./client").RequestResult<DeleteByOrgByRepoWebhooksByWebhookIdResponses, DeleteByOrgByRepoWebhooksByWebhookIdErrors, ThrowOnError, "fields">;
130
- /**
131
- * Get organization
132
- *
133
- * Get organization metadata and repository counts
134
- */
135
- export declare const getByOrg: <ThrowOnError extends boolean = false>(options: Options<GetByOrgData, ThrowOnError>) => import("./client").RequestResult<GetByOrgResponses, GetByOrgErrors, ThrowOnError, "fields">;