@flashstart/client 0.1.0
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/README.md +37 -0
- package/dist/src/generated/client/client.gen.d.ts +2 -0
- package/dist/src/generated/client/client.gen.js +216 -0
- package/dist/src/generated/client/index.d.ts +10 -0
- package/dist/src/generated/client/index.js +6 -0
- package/dist/src/generated/client/types.gen.d.ts +120 -0
- package/dist/src/generated/client/types.gen.js +2 -0
- package/dist/src/generated/client/utils.gen.d.ts +37 -0
- package/dist/src/generated/client/utils.gen.js +228 -0
- package/dist/src/generated/client.gen.d.ts +12 -0
- package/dist/src/generated/client.gen.js +3 -0
- package/dist/src/generated/core/auth.gen.d.ts +25 -0
- package/dist/src/generated/core/auth.gen.js +14 -0
- package/dist/src/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/src/generated/core/bodySerializer.gen.js +57 -0
- package/dist/src/generated/core/params.gen.d.ts +43 -0
- package/dist/src/generated/core/params.gen.js +109 -0
- package/dist/src/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/src/generated/core/pathSerializer.gen.js +106 -0
- package/dist/src/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/src/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/src/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/src/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/src/generated/core/types.gen.d.ts +83 -0
- package/dist/src/generated/core/types.gen.js +2 -0
- package/dist/src/generated/core/utils.gen.d.ts +19 -0
- package/dist/src/generated/core/utils.gen.js +87 -0
- package/dist/src/generated/index.d.ts +2 -0
- package/dist/src/generated/index.js +2 -0
- package/dist/src/generated/network/client/client.gen.d.ts +2 -0
- package/dist/src/generated/network/client/client.gen.js +216 -0
- package/dist/src/generated/network/client/index.d.ts +10 -0
- package/dist/src/generated/network/client/index.js +6 -0
- package/dist/src/generated/network/client/types.gen.d.ts +120 -0
- package/dist/src/generated/network/client/types.gen.js +2 -0
- package/dist/src/generated/network/client/utils.gen.d.ts +37 -0
- package/dist/src/generated/network/client/utils.gen.js +228 -0
- package/dist/src/generated/network/client.gen.d.ts +12 -0
- package/dist/src/generated/network/client.gen.js +3 -0
- package/dist/src/generated/network/core/auth.gen.d.ts +25 -0
- package/dist/src/generated/network/core/auth.gen.js +14 -0
- package/dist/src/generated/network/core/bodySerializer.gen.d.ts +25 -0
- package/dist/src/generated/network/core/bodySerializer.gen.js +57 -0
- package/dist/src/generated/network/core/params.gen.d.ts +43 -0
- package/dist/src/generated/network/core/params.gen.js +109 -0
- package/dist/src/generated/network/core/pathSerializer.gen.d.ts +33 -0
- package/dist/src/generated/network/core/pathSerializer.gen.js +106 -0
- package/dist/src/generated/network/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/src/generated/network/core/queryKeySerializer.gen.js +92 -0
- package/dist/src/generated/network/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/src/generated/network/core/serverSentEvents.gen.js +132 -0
- package/dist/src/generated/network/core/types.gen.d.ts +83 -0
- package/dist/src/generated/network/core/types.gen.js +2 -0
- package/dist/src/generated/network/core/utils.gen.d.ts +19 -0
- package/dist/src/generated/network/core/utils.gen.js +87 -0
- package/dist/src/generated/network/index.d.ts +2 -0
- package/dist/src/generated/network/index.js +2 -0
- package/dist/src/generated/network/sdk.gen.d.ts +135 -0
- package/dist/src/generated/network/sdk.gen.js +339 -0
- package/dist/src/generated/network/types.gen.d.ts +1188 -0
- package/dist/src/generated/network/types.gen.js +2 -0
- package/dist/src/generated/protection/client/client.gen.d.ts +2 -0
- package/dist/src/generated/protection/client/client.gen.js +216 -0
- package/dist/src/generated/protection/client/index.d.ts +10 -0
- package/dist/src/generated/protection/client/index.js +6 -0
- package/dist/src/generated/protection/client/types.gen.d.ts +120 -0
- package/dist/src/generated/protection/client/types.gen.js +2 -0
- package/dist/src/generated/protection/client/utils.gen.d.ts +37 -0
- package/dist/src/generated/protection/client/utils.gen.js +228 -0
- package/dist/src/generated/protection/client.gen.d.ts +12 -0
- package/dist/src/generated/protection/client.gen.js +3 -0
- package/dist/src/generated/protection/core/auth.gen.d.ts +25 -0
- package/dist/src/generated/protection/core/auth.gen.js +14 -0
- package/dist/src/generated/protection/core/bodySerializer.gen.d.ts +25 -0
- package/dist/src/generated/protection/core/bodySerializer.gen.js +57 -0
- package/dist/src/generated/protection/core/params.gen.d.ts +43 -0
- package/dist/src/generated/protection/core/params.gen.js +109 -0
- package/dist/src/generated/protection/core/pathSerializer.gen.d.ts +33 -0
- package/dist/src/generated/protection/core/pathSerializer.gen.js +106 -0
- package/dist/src/generated/protection/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/src/generated/protection/core/queryKeySerializer.gen.js +92 -0
- package/dist/src/generated/protection/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/src/generated/protection/core/serverSentEvents.gen.js +132 -0
- package/dist/src/generated/protection/core/types.gen.d.ts +83 -0
- package/dist/src/generated/protection/core/types.gen.js +2 -0
- package/dist/src/generated/protection/core/utils.gen.d.ts +19 -0
- package/dist/src/generated/protection/core/utils.gen.js +87 -0
- package/dist/src/generated/protection/index.d.ts +2 -0
- package/dist/src/generated/protection/index.js +2 -0
- package/dist/src/generated/protection/sdk.gen.d.ts +255 -0
- package/dist/src/generated/protection/sdk.gen.js +663 -0
- package/dist/src/generated/protection/types.gen.d.ts +2199 -0
- package/dist/src/generated/protection/types.gen.js +2 -0
- package/dist/src/generated/sdk.gen.d.ts +91 -0
- package/dist/src/generated/sdk.gen.js +206 -0
- package/dist/src/generated/types.gen.d.ts +909 -0
- package/dist/src/generated/types.gen.js +2 -0
- package/dist/src/index.d.ts +50 -0
- package/dist/src/index.js +85 -0
- package/package.json +34 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from './pathSerializer.gen.js';
|
|
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
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { NetworkSdk, type Options } from './sdk.gen.js';
|
|
2
|
+
export type { AddNetworkPolicyData, AddNetworkPolicyError, AddNetworkPolicyErrors, AddNetworkPolicyResponse, AddNetworkPolicyResponses, BaseNetwork, BaseNetworkCreation, CidrStaticNetwork, CidrStaticNetworkCreation, CidrStaticNetworkCreation2, ClientOptions, CreateCidrStaticNetworkData, CreateCidrStaticNetworkError, CreateCidrStaticNetworkErrors, CreateCidrStaticNetworkResponse, CreateCidrStaticNetworkResponses, CreateEdnsData, CreateEdnsError, CreateEdnsErrors, CreateEdnsResponse, CreateEdnsResponses, CreateEncryptedNetworkData, CreateEncryptedNetworkError, CreateEncryptedNetworkErrors, CreateEncryptedNetworkResponse, CreateEncryptedNetworkResponses, CreateExternalDynamicNetworkData, CreateExternalDynamicNetworkError, CreateExternalDynamicNetworkErrors, CreateExternalDynamicNetworkResponse, CreateExternalDynamicNetworkResponses, CreateInternalDynamicNetworkData, CreateInternalDynamicNetworkError, CreateInternalDynamicNetworkErrors, CreateInternalDynamicNetworkResponse, CreateInternalDynamicNetworkResponses, CreateRangeStaticNetworkData, CreateRangeStaticNetworkError, CreateRangeStaticNetworkErrors, CreateRangeStaticNetworkResponse, CreateRangeStaticNetworkResponses, CreateSingleStaticNetworkData, CreateSingleStaticNetworkError, CreateSingleStaticNetworkErrors, CreateSingleStaticNetworkResponse, CreateSingleStaticNetworkResponses, Ddns, DdnsUpdate, DeleteEdnsData, DeleteEdnsError, DeleteEdnsErrors, DeleteEdnsResponse, DeleteEdnsResponses, DeleteNetworkData, DeleteNetworkError, DeleteNetworkErrors, DeleteNetworkPolicyData, DeleteNetworkPolicyError, DeleteNetworkPolicyErrors, DeleteNetworkPolicyResponse, DeleteNetworkPolicyResponses, DeleteNetworkResponse, DeleteNetworkResponses, Edns, EdnsCreation, EdnsId, EdnsUpdate, EncryptedNetwork, EncryptedNetworkCreation, EncryptedNetworkCreation2, ExternalDynamicNetwork, ExternalDynamicNetworkCreation, ExternalDynamicNetworkCreation2, ExternalDynamicNetworkUpdate, ExternalDynamicNetworkUpdate2, FlashStartErrorBody, GetEdnsData, GetEdnsError, GetEdnsErrors, GetEdnsResponse, GetEdnsResponses, GetNetworkData, GetNetworkError, GetNetworkErrors, GetNetworkResponse, GetNetworkResponses, IncludePolicies, InternalDynamicNetwork, InternalDynamicNetworkCreation, InternalDynamicNetworkCreation2, InternalDynamicNetworkUpdate, InternalDynamicNetworkUpdate2, ListAvailableNetworkDnsData, ListAvailableNetworkDnsError, ListAvailableNetworkDnsErrors, ListAvailableNetworkDnsResponse, ListAvailableNetworkDnsResponses, ListEdnsData, ListEdnsError, ListEdnsErrors, ListEdnsResponse, ListEdnsResponses, ListNetworkDnsData, ListNetworkDnsError, ListNetworkDnsErrors, ListNetworkDnsResponse, ListNetworkDnsResponses, ListNetworkPoliciesData, ListNetworkPoliciesError, ListNetworkPoliciesErrors, ListNetworkPoliciesResponse, ListNetworkPoliciesResponses, ListNetworksData, ListNetworksError, ListNetworksErrors, ListNetworksResponse, ListNetworksResponses, MissingCredentialsErrorBody, Network, NetworkDns, NetworkId, NetworkPolicy, NetworkPolicyCreation, NetworkResult, NetworkWithPolicies, OrganizationId, Policy, PolicyId, RangeIp, RangeStaticNetwork, RangeStaticNetworkCreation, RangeStaticNetworkCreation2, SingleStaticNetwork, SingleStaticNetworkCreation, SingleStaticNetworkCreation2, StaticNetworkUpdate, StaticNetworkUpdate2, UpdateCidrStaticNetworkData, UpdateCidrStaticNetworkError, UpdateCidrStaticNetworkErrors, UpdateCidrStaticNetworkResponse, UpdateCidrStaticNetworkResponses, UpdateEdnsData, UpdateEdnsError, UpdateEdnsErrors, UpdateEdnsResponse, UpdateEdnsResponses, UpdateEncryptedNetworkData, UpdateEncryptedNetworkError, UpdateEncryptedNetworkErrors, UpdateEncryptedNetworkResponse, UpdateEncryptedNetworkResponses, UpdateExternalDynamicNetworkData, UpdateExternalDynamicNetworkError, UpdateExternalDynamicNetworkErrors, UpdateExternalDynamicNetworkResponse, UpdateExternalDynamicNetworkResponses, UpdateInternalDynamicNetworkData, UpdateInternalDynamicNetworkError, UpdateInternalDynamicNetworkErrors, UpdateInternalDynamicNetworkResponse, UpdateInternalDynamicNetworkResponses, UpdateRangeStaticNetworkData, UpdateRangeStaticNetworkError, UpdateRangeStaticNetworkErrors, UpdateRangeStaticNetworkResponse, UpdateRangeStaticNetworkResponses, UpdateSingleStaticNetworkData, UpdateSingleStaticNetworkError, UpdateSingleStaticNetworkErrors, UpdateSingleStaticNetworkResponse, UpdateSingleStaticNetworkResponses, Uuid } from './types.gen.js';
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
+
import type { AddNetworkPolicyData, AddNetworkPolicyErrors, AddNetworkPolicyResponses, CreateCidrStaticNetworkData, CreateCidrStaticNetworkErrors, CreateCidrStaticNetworkResponses, CreateEdnsData, CreateEdnsErrors, CreateEdnsResponses, CreateEncryptedNetworkData, CreateEncryptedNetworkErrors, CreateEncryptedNetworkResponses, CreateExternalDynamicNetworkData, CreateExternalDynamicNetworkErrors, CreateExternalDynamicNetworkResponses, CreateInternalDynamicNetworkData, CreateInternalDynamicNetworkErrors, CreateInternalDynamicNetworkResponses, CreateRangeStaticNetworkData, CreateRangeStaticNetworkErrors, CreateRangeStaticNetworkResponses, CreateSingleStaticNetworkData, CreateSingleStaticNetworkErrors, CreateSingleStaticNetworkResponses, DeleteEdnsData, DeleteEdnsErrors, DeleteEdnsResponses, DeleteNetworkData, DeleteNetworkErrors, DeleteNetworkPolicyData, DeleteNetworkPolicyErrors, DeleteNetworkPolicyResponses, DeleteNetworkResponses, GetEdnsData, GetEdnsErrors, GetEdnsResponses, GetNetworkData, GetNetworkErrors, GetNetworkResponses, ListAvailableNetworkDnsData, ListAvailableNetworkDnsErrors, ListAvailableNetworkDnsResponses, ListEdnsData, ListEdnsErrors, ListEdnsResponses, ListNetworkDnsData, ListNetworkDnsErrors, ListNetworkDnsResponses, ListNetworkPoliciesData, ListNetworkPoliciesErrors, ListNetworkPoliciesResponses, ListNetworksData, ListNetworksErrors, ListNetworksResponses, UpdateCidrStaticNetworkData, UpdateCidrStaticNetworkErrors, UpdateCidrStaticNetworkResponses, UpdateEdnsData, UpdateEdnsErrors, UpdateEdnsResponses, UpdateEncryptedNetworkData, UpdateEncryptedNetworkErrors, UpdateEncryptedNetworkResponses, UpdateExternalDynamicNetworkData, UpdateExternalDynamicNetworkErrors, UpdateExternalDynamicNetworkResponses, UpdateInternalDynamicNetworkData, UpdateInternalDynamicNetworkErrors, UpdateInternalDynamicNetworkResponses, UpdateRangeStaticNetworkData, UpdateRangeStaticNetworkErrors, UpdateRangeStaticNetworkResponses, UpdateSingleStaticNetworkData, UpdateSingleStaticNetworkErrors, UpdateSingleStaticNetworkResponses } from './types.gen.js';
|
|
3
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
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?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
15
|
+
};
|
|
16
|
+
declare class HeyApiClient {
|
|
17
|
+
protected client: Client;
|
|
18
|
+
constructor(args?: {
|
|
19
|
+
client?: Client;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
declare class HeyApiRegistry<T> {
|
|
23
|
+
private readonly defaultKey;
|
|
24
|
+
private readonly instances;
|
|
25
|
+
get(key?: string): T;
|
|
26
|
+
set(value: T, key?: string): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class NetworkSdk extends HeyApiClient {
|
|
29
|
+
static readonly __registry: HeyApiRegistry<NetworkSdk>;
|
|
30
|
+
constructor(args?: {
|
|
31
|
+
client?: Client;
|
|
32
|
+
key?: string;
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* List networks
|
|
36
|
+
*/
|
|
37
|
+
listNetworks<ThrowOnError extends boolean = false>(options?: Options<ListNetworksData, ThrowOnError>): RequestResult<ListNetworksResponses, ListNetworksErrors, ThrowOnError>;
|
|
38
|
+
/**
|
|
39
|
+
* List network DNS entries
|
|
40
|
+
*/
|
|
41
|
+
listNetworkDns<ThrowOnError extends boolean = false>(options?: Options<ListNetworkDnsData, ThrowOnError>): RequestResult<ListNetworkDnsResponses, ListNetworkDnsErrors, ThrowOnError>;
|
|
42
|
+
/**
|
|
43
|
+
* List EDNS entries
|
|
44
|
+
*/
|
|
45
|
+
listEdns<ThrowOnError extends boolean = false>(options?: Options<ListEdnsData, ThrowOnError>): RequestResult<ListEdnsResponses, ListEdnsErrors, ThrowOnError>;
|
|
46
|
+
/**
|
|
47
|
+
* Create an EDNS entry
|
|
48
|
+
*/
|
|
49
|
+
createEdns<ThrowOnError extends boolean = false>(options: Options<CreateEdnsData, ThrowOnError>): RequestResult<CreateEdnsResponses, CreateEdnsErrors, ThrowOnError>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete an EDNS entry
|
|
52
|
+
*/
|
|
53
|
+
deleteEdns<ThrowOnError extends boolean = false>(options: Options<DeleteEdnsData, ThrowOnError>): RequestResult<DeleteEdnsResponses, DeleteEdnsErrors, ThrowOnError>;
|
|
54
|
+
/**
|
|
55
|
+
* Get an EDNS entry
|
|
56
|
+
*/
|
|
57
|
+
getEdns<ThrowOnError extends boolean = false>(options: Options<GetEdnsData, ThrowOnError>): RequestResult<GetEdnsResponses, GetEdnsErrors, ThrowOnError>;
|
|
58
|
+
/**
|
|
59
|
+
* Update an EDNS entry
|
|
60
|
+
*/
|
|
61
|
+
updateEdns<ThrowOnError extends boolean = false>(options: Options<UpdateEdnsData, ThrowOnError>): RequestResult<UpdateEdnsResponses, UpdateEdnsErrors, ThrowOnError>;
|
|
62
|
+
/**
|
|
63
|
+
* List available network DNS entries
|
|
64
|
+
*/
|
|
65
|
+
listAvailableNetworkDns<ThrowOnError extends boolean = false>(options: Options<ListAvailableNetworkDnsData, ThrowOnError>): RequestResult<ListAvailableNetworkDnsResponses, ListAvailableNetworkDnsErrors, ThrowOnError>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete a network
|
|
68
|
+
*/
|
|
69
|
+
deleteNetwork<ThrowOnError extends boolean = false>(options: Options<DeleteNetworkData, ThrowOnError>): RequestResult<DeleteNetworkResponses, DeleteNetworkErrors, ThrowOnError>;
|
|
70
|
+
/**
|
|
71
|
+
* Get a network
|
|
72
|
+
*/
|
|
73
|
+
getNetwork<ThrowOnError extends boolean = false>(options: Options<GetNetworkData, ThrowOnError>): RequestResult<GetNetworkResponses, GetNetworkErrors, ThrowOnError>;
|
|
74
|
+
/**
|
|
75
|
+
* List network policies
|
|
76
|
+
*/
|
|
77
|
+
listNetworkPolicies<ThrowOnError extends boolean = false>(options: Options<ListNetworkPoliciesData, ThrowOnError>): RequestResult<ListNetworkPoliciesResponses, ListNetworkPoliciesErrors, ThrowOnError>;
|
|
78
|
+
/**
|
|
79
|
+
* Add a network policy
|
|
80
|
+
*/
|
|
81
|
+
addNetworkPolicy<ThrowOnError extends boolean = false>(options: Options<AddNetworkPolicyData, ThrowOnError>): RequestResult<AddNetworkPolicyResponses, AddNetworkPolicyErrors, ThrowOnError>;
|
|
82
|
+
/**
|
|
83
|
+
* Delete a network policy
|
|
84
|
+
*/
|
|
85
|
+
deleteNetworkPolicy<ThrowOnError extends boolean = false>(options: Options<DeleteNetworkPolicyData, ThrowOnError>): RequestResult<DeleteNetworkPolicyResponses, DeleteNetworkPolicyErrors, ThrowOnError>;
|
|
86
|
+
/**
|
|
87
|
+
* Create a single static network
|
|
88
|
+
*/
|
|
89
|
+
createSingleStaticNetwork<ThrowOnError extends boolean = false>(options: Options<CreateSingleStaticNetworkData, ThrowOnError>): RequestResult<CreateSingleStaticNetworkResponses, CreateSingleStaticNetworkErrors, ThrowOnError>;
|
|
90
|
+
/**
|
|
91
|
+
* Create a CIDR static network
|
|
92
|
+
*/
|
|
93
|
+
createCidrStaticNetwork<ThrowOnError extends boolean = false>(options: Options<CreateCidrStaticNetworkData, ThrowOnError>): RequestResult<CreateCidrStaticNetworkResponses, CreateCidrStaticNetworkErrors, ThrowOnError>;
|
|
94
|
+
/**
|
|
95
|
+
* Create a range static network
|
|
96
|
+
*/
|
|
97
|
+
createRangeStaticNetwork<ThrowOnError extends boolean = false>(options: Options<CreateRangeStaticNetworkData, ThrowOnError>): RequestResult<CreateRangeStaticNetworkResponses, CreateRangeStaticNetworkErrors, ThrowOnError>;
|
|
98
|
+
/**
|
|
99
|
+
* Create an internal dynamic network
|
|
100
|
+
*/
|
|
101
|
+
createInternalDynamicNetwork<ThrowOnError extends boolean = false>(options: Options<CreateInternalDynamicNetworkData, ThrowOnError>): RequestResult<CreateInternalDynamicNetworkResponses, CreateInternalDynamicNetworkErrors, ThrowOnError>;
|
|
102
|
+
/**
|
|
103
|
+
* Create an external dynamic network
|
|
104
|
+
*/
|
|
105
|
+
createExternalDynamicNetwork<ThrowOnError extends boolean = false>(options: Options<CreateExternalDynamicNetworkData, ThrowOnError>): RequestResult<CreateExternalDynamicNetworkResponses, CreateExternalDynamicNetworkErrors, ThrowOnError>;
|
|
106
|
+
/**
|
|
107
|
+
* Create an encrypted network
|
|
108
|
+
*/
|
|
109
|
+
createEncryptedNetwork<ThrowOnError extends boolean = false>(options: Options<CreateEncryptedNetworkData, ThrowOnError>): RequestResult<CreateEncryptedNetworkResponses, CreateEncryptedNetworkErrors, ThrowOnError>;
|
|
110
|
+
/**
|
|
111
|
+
* Update a single static network
|
|
112
|
+
*/
|
|
113
|
+
updateSingleStaticNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateSingleStaticNetworkData, ThrowOnError>): RequestResult<UpdateSingleStaticNetworkResponses, UpdateSingleStaticNetworkErrors, ThrowOnError>;
|
|
114
|
+
/**
|
|
115
|
+
* Update a CIDR static network
|
|
116
|
+
*/
|
|
117
|
+
updateCidrStaticNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateCidrStaticNetworkData, ThrowOnError>): RequestResult<UpdateCidrStaticNetworkResponses, UpdateCidrStaticNetworkErrors, ThrowOnError>;
|
|
118
|
+
/**
|
|
119
|
+
* Update a range static network
|
|
120
|
+
*/
|
|
121
|
+
updateRangeStaticNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateRangeStaticNetworkData, ThrowOnError>): RequestResult<UpdateRangeStaticNetworkResponses, UpdateRangeStaticNetworkErrors, ThrowOnError>;
|
|
122
|
+
/**
|
|
123
|
+
* Update an internal dynamic network
|
|
124
|
+
*/
|
|
125
|
+
updateInternalDynamicNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateInternalDynamicNetworkData, ThrowOnError>): RequestResult<UpdateInternalDynamicNetworkResponses, UpdateInternalDynamicNetworkErrors, ThrowOnError>;
|
|
126
|
+
/**
|
|
127
|
+
* Update an external dynamic network
|
|
128
|
+
*/
|
|
129
|
+
updateExternalDynamicNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateExternalDynamicNetworkData, ThrowOnError>): RequestResult<UpdateExternalDynamicNetworkResponses, UpdateExternalDynamicNetworkErrors, ThrowOnError>;
|
|
130
|
+
/**
|
|
131
|
+
* Update an encrypted network
|
|
132
|
+
*/
|
|
133
|
+
updateEncryptedNetwork<ThrowOnError extends boolean = false>(options: Options<UpdateEncryptedNetworkData, ThrowOnError>): RequestResult<UpdateEncryptedNetworkResponses, UpdateEncryptedNetworkErrors, ThrowOnError>;
|
|
134
|
+
}
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { client } from './client.gen.js';
|
|
3
|
+
class HeyApiClient {
|
|
4
|
+
client;
|
|
5
|
+
constructor(args) {
|
|
6
|
+
this.client = args?.client ?? client;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
class HeyApiRegistry {
|
|
10
|
+
defaultKey = 'default';
|
|
11
|
+
instances = new Map();
|
|
12
|
+
get(key) {
|
|
13
|
+
const instance = this.instances.get(key ?? this.defaultKey);
|
|
14
|
+
if (!instance) {
|
|
15
|
+
throw new Error(`No SDK client found. Create one with "new NetworkSdk()" to fix this error.`);
|
|
16
|
+
}
|
|
17
|
+
return instance;
|
|
18
|
+
}
|
|
19
|
+
set(value, key) {
|
|
20
|
+
this.instances.set(key ?? this.defaultKey, value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class NetworkSdk extends HeyApiClient {
|
|
24
|
+
static __registry = new HeyApiRegistry();
|
|
25
|
+
constructor(args) {
|
|
26
|
+
super(args);
|
|
27
|
+
NetworkSdk.__registry.set(this, args?.key);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List networks
|
|
31
|
+
*/
|
|
32
|
+
listNetworks(options) {
|
|
33
|
+
return (options?.client ?? this.client).get({
|
|
34
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
35
|
+
url: '/v1/',
|
|
36
|
+
...options
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* List network DNS entries
|
|
41
|
+
*/
|
|
42
|
+
listNetworkDns(options) {
|
|
43
|
+
return (options?.client ?? this.client).get({
|
|
44
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
45
|
+
url: '/v1/dns',
|
|
46
|
+
...options
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* List EDNS entries
|
|
51
|
+
*/
|
|
52
|
+
listEdns(options) {
|
|
53
|
+
return (options?.client ?? this.client).get({
|
|
54
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
55
|
+
url: '/v1/edns',
|
|
56
|
+
...options
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create an EDNS entry
|
|
61
|
+
*/
|
|
62
|
+
createEdns(options) {
|
|
63
|
+
return (options.client ?? this.client).post({
|
|
64
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
65
|
+
url: '/v1/edns',
|
|
66
|
+
...options,
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
...options.headers
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Delete an EDNS entry
|
|
75
|
+
*/
|
|
76
|
+
deleteEdns(options) {
|
|
77
|
+
return (options.client ?? this.client).delete({
|
|
78
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
79
|
+
url: '/v1/edns/{ednsId}',
|
|
80
|
+
...options
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get an EDNS entry
|
|
85
|
+
*/
|
|
86
|
+
getEdns(options) {
|
|
87
|
+
return (options.client ?? this.client).get({
|
|
88
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
89
|
+
url: '/v1/edns/{ednsId}',
|
|
90
|
+
...options
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Update an EDNS entry
|
|
95
|
+
*/
|
|
96
|
+
updateEdns(options) {
|
|
97
|
+
return (options.client ?? this.client).patch({
|
|
98
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
99
|
+
url: '/v1/edns/{ednsId}',
|
|
100
|
+
...options,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
...options.headers
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* List available network DNS entries
|
|
109
|
+
*/
|
|
110
|
+
listAvailableNetworkDns(options) {
|
|
111
|
+
return (options.client ?? this.client).get({
|
|
112
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
113
|
+
url: '/v1/{networkId}/dns/available',
|
|
114
|
+
...options
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Delete a network
|
|
119
|
+
*/
|
|
120
|
+
deleteNetwork(options) {
|
|
121
|
+
return (options.client ?? this.client).delete({
|
|
122
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
123
|
+
url: '/v1/{networkId}',
|
|
124
|
+
...options
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get a network
|
|
129
|
+
*/
|
|
130
|
+
getNetwork(options) {
|
|
131
|
+
return (options.client ?? this.client).get({
|
|
132
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
133
|
+
url: '/v1/{networkId}',
|
|
134
|
+
...options
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* List network policies
|
|
139
|
+
*/
|
|
140
|
+
listNetworkPolicies(options) {
|
|
141
|
+
return (options.client ?? this.client).get({
|
|
142
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
143
|
+
url: '/v1/{networkId}/policies',
|
|
144
|
+
...options
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Add a network policy
|
|
149
|
+
*/
|
|
150
|
+
addNetworkPolicy(options) {
|
|
151
|
+
return (options.client ?? this.client).post({
|
|
152
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
153
|
+
url: '/v1/{networkId}/policies',
|
|
154
|
+
...options,
|
|
155
|
+
headers: {
|
|
156
|
+
'Content-Type': 'application/json',
|
|
157
|
+
...options.headers
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Delete a network policy
|
|
163
|
+
*/
|
|
164
|
+
deleteNetworkPolicy(options) {
|
|
165
|
+
return (options.client ?? this.client).delete({
|
|
166
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
167
|
+
url: '/v1/{networkId}/policies/{policyId}',
|
|
168
|
+
...options
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create a single static network
|
|
173
|
+
*/
|
|
174
|
+
createSingleStaticNetwork(options) {
|
|
175
|
+
return (options.client ?? this.client).post({
|
|
176
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
177
|
+
url: '/v1/static/single',
|
|
178
|
+
...options,
|
|
179
|
+
headers: {
|
|
180
|
+
'Content-Type': 'application/json',
|
|
181
|
+
...options.headers
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Create a CIDR static network
|
|
187
|
+
*/
|
|
188
|
+
createCidrStaticNetwork(options) {
|
|
189
|
+
return (options.client ?? this.client).post({
|
|
190
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
191
|
+
url: '/v1/static/cidr',
|
|
192
|
+
...options,
|
|
193
|
+
headers: {
|
|
194
|
+
'Content-Type': 'application/json',
|
|
195
|
+
...options.headers
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Create a range static network
|
|
201
|
+
*/
|
|
202
|
+
createRangeStaticNetwork(options) {
|
|
203
|
+
return (options.client ?? this.client).post({
|
|
204
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
205
|
+
url: '/v1/static/range',
|
|
206
|
+
...options,
|
|
207
|
+
headers: {
|
|
208
|
+
'Content-Type': 'application/json',
|
|
209
|
+
...options.headers
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Create an internal dynamic network
|
|
215
|
+
*/
|
|
216
|
+
createInternalDynamicNetwork(options) {
|
|
217
|
+
return (options.client ?? this.client).post({
|
|
218
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
219
|
+
url: '/v1/dynamic/internal',
|
|
220
|
+
...options,
|
|
221
|
+
headers: {
|
|
222
|
+
'Content-Type': 'application/json',
|
|
223
|
+
...options.headers
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Create an external dynamic network
|
|
229
|
+
*/
|
|
230
|
+
createExternalDynamicNetwork(options) {
|
|
231
|
+
return (options.client ?? this.client).post({
|
|
232
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
233
|
+
url: '/v1/dynamic/external',
|
|
234
|
+
...options,
|
|
235
|
+
headers: {
|
|
236
|
+
'Content-Type': 'application/json',
|
|
237
|
+
...options.headers
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Create an encrypted network
|
|
243
|
+
*/
|
|
244
|
+
createEncryptedNetwork(options) {
|
|
245
|
+
return (options.client ?? this.client).post({
|
|
246
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
247
|
+
url: '/v1/encrypted',
|
|
248
|
+
...options,
|
|
249
|
+
headers: {
|
|
250
|
+
'Content-Type': 'application/json',
|
|
251
|
+
...options.headers
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Update a single static network
|
|
257
|
+
*/
|
|
258
|
+
updateSingleStaticNetwork(options) {
|
|
259
|
+
return (options.client ?? this.client).patch({
|
|
260
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
261
|
+
url: '/v1/static/single/{networkId}',
|
|
262
|
+
...options,
|
|
263
|
+
headers: {
|
|
264
|
+
'Content-Type': 'application/json',
|
|
265
|
+
...options.headers
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Update a CIDR static network
|
|
271
|
+
*/
|
|
272
|
+
updateCidrStaticNetwork(options) {
|
|
273
|
+
return (options.client ?? this.client).patch({
|
|
274
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
275
|
+
url: '/v1/static/cidr/{networkId}',
|
|
276
|
+
...options,
|
|
277
|
+
headers: {
|
|
278
|
+
'Content-Type': 'application/json',
|
|
279
|
+
...options.headers
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Update a range static network
|
|
285
|
+
*/
|
|
286
|
+
updateRangeStaticNetwork(options) {
|
|
287
|
+
return (options.client ?? this.client).patch({
|
|
288
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
289
|
+
url: '/v1/static/range/{networkId}',
|
|
290
|
+
...options,
|
|
291
|
+
headers: {
|
|
292
|
+
'Content-Type': 'application/json',
|
|
293
|
+
...options.headers
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Update an internal dynamic network
|
|
299
|
+
*/
|
|
300
|
+
updateInternalDynamicNetwork(options) {
|
|
301
|
+
return (options.client ?? this.client).patch({
|
|
302
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
303
|
+
url: '/v1/dynamic/internal/{networkId}',
|
|
304
|
+
...options,
|
|
305
|
+
headers: {
|
|
306
|
+
'Content-Type': 'application/json',
|
|
307
|
+
...options.headers
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Update an external dynamic network
|
|
313
|
+
*/
|
|
314
|
+
updateExternalDynamicNetwork(options) {
|
|
315
|
+
return (options.client ?? this.client).patch({
|
|
316
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
317
|
+
url: '/v1/dynamic/external/{networkId}',
|
|
318
|
+
...options,
|
|
319
|
+
headers: {
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
...options.headers
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Update an encrypted network
|
|
327
|
+
*/
|
|
328
|
+
updateEncryptedNetwork(options) {
|
|
329
|
+
return (options.client ?? this.client).patch({
|
|
330
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
331
|
+
url: '/v1/encrypted/{networkId}',
|
|
332
|
+
...options,
|
|
333
|
+
headers: {
|
|
334
|
+
'Content-Type': 'application/json',
|
|
335
|
+
...options.headers
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|