@serkonda7/unifi-api 0.0.0-stage → 0.1.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 (31) hide show
  1. package/README.md +149 -2
  2. package/dist/generated/client/client.gen.d.ts +2 -0
  3. package/dist/generated/client/index.d.ts +10 -0
  4. package/dist/generated/client/types.gen.d.ts +120 -0
  5. package/dist/generated/client/utils.gen.d.ts +37 -0
  6. package/dist/generated/client.gen.d.ts +12 -0
  7. package/dist/generated/core/auth.gen.d.ts +25 -0
  8. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  9. package/dist/generated/core/params.gen.d.ts +43 -0
  10. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  11. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  12. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  13. package/dist/generated/core/types.gen.d.ts +83 -0
  14. package/dist/generated/core/utils.gen.d.ts +19 -0
  15. package/dist/generated/index.d.ts +2 -0
  16. package/dist/generated/sdk.gen.d.ts +99 -0
  17. package/dist/generated/types.gen.d.ts +2718 -0
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.js +6 -0
  20. package/dist/shared/client.d.ts +26 -0
  21. package/dist/shared/errors.d.ts +47 -0
  22. package/dist/shared/pagination.d.ts +18 -0
  23. package/dist/site-manager/client.d.ts +32 -0
  24. package/dist/site-manager/index.d.ts +64 -0
  25. package/dist/site-manager/resources/connector.d.ts +107 -0
  26. package/dist/site-manager/resources/devices.d.ts +36 -0
  27. package/dist/site-manager/resources/hosts.d.ts +41 -0
  28. package/dist/site-manager/resources/ispMetrics.d.ts +48 -0
  29. package/dist/site-manager/resources/sdWan.d.ts +27 -0
  30. package/dist/site-manager/resources/sites.d.ts +34 -0
  31. package/package.json +52 -4
@@ -0,0 +1,2 @@
1
+ export { connectorDelete, connectorGet, connectorPatch, connectorPost, connectorPut, getHostById, getIspMetrics, getSdWanConfigById, getSdWanConfigStatus, listDevices, listHosts, listSdWanConfigs, listSites, type Options, queryIspMetrics } from './sdk.gen';
2
+ export type { ClientOptions, ConnectorDeleteData, ConnectorDeleteError, ConnectorDeleteErrors, ConnectorDeleteResponse, ConnectorDeleteResponses, ConnectorGetData, ConnectorGetError, ConnectorGetErrors, ConnectorGetResponse, ConnectorGetResponses, ConnectorPatchData, ConnectorPatchError, ConnectorPatchErrors, ConnectorPatchResponse, ConnectorPatchResponses, ConnectorPostData, ConnectorPostError, ConnectorPostErrors, ConnectorPostResponse, ConnectorPostResponses, ConnectorPutData, ConnectorPutError, ConnectorPutErrors, ConnectorPutResponse, ConnectorPutResponses, GetHostByIdData, GetHostByIdError, GetHostByIdErrors, GetHostByIdResponse, GetHostByIdResponses, GetIspMetricsData, GetIspMetricsError, GetIspMetricsErrors, GetIspMetricsResponse, GetIspMetricsResponses, GetSdWanConfigByIdData, GetSdWanConfigByIdError, GetSdWanConfigByIdErrors, GetSdWanConfigByIdResponse, GetSdWanConfigByIdResponses, GetSdWanConfigStatusData, GetSdWanConfigStatusError, GetSdWanConfigStatusErrors, GetSdWanConfigStatusResponse, GetSdWanConfigStatusResponses, ListDevicesData, ListDevicesError, ListDevicesErrors, ListDevicesResponse, ListDevicesResponses, ListHostsData, ListHostsError, ListHostsErrors, ListHostsResponse, ListHostsResponses, ListSdWanConfigsData, ListSdWanConfigsError, ListSdWanConfigsErrors, ListSdWanConfigsResponse, ListSdWanConfigsResponses, ListSitesData, ListSitesError, ListSitesErrors, ListSitesResponse, ListSitesResponses, QueryIspMetricsData, QueryIspMetricsError, QueryIspMetricsErrors, QueryIspMetricsResponse, QueryIspMetricsResponses } from './types.gen';
@@ -0,0 +1,99 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
2
+ import type { ConnectorDeleteData, ConnectorDeleteErrors, ConnectorDeleteResponses, ConnectorGetData, ConnectorGetErrors, ConnectorGetResponses, ConnectorPatchData, ConnectorPatchErrors, ConnectorPatchResponses, ConnectorPostData, ConnectorPostErrors, ConnectorPostResponses, ConnectorPutData, ConnectorPutErrors, ConnectorPutResponses, GetHostByIdData, GetHostByIdErrors, GetHostByIdResponses, GetIspMetricsData, GetIspMetricsErrors, GetIspMetricsResponses, GetSdWanConfigByIdData, GetSdWanConfigByIdErrors, GetSdWanConfigByIdResponses, GetSdWanConfigStatusData, GetSdWanConfigStatusErrors, GetSdWanConfigStatusResponses, ListDevicesData, ListDevicesErrors, ListDevicesResponses, ListHostsData, ListHostsErrors, ListHostsResponses, ListSdWanConfigsData, ListSdWanConfigsErrors, ListSdWanConfigsResponses, ListSitesData, ListSitesErrors, ListSitesResponses, QueryIspMetricsData, QueryIspMetricsErrors, QueryIspMetricsResponses } from './types.gen';
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
+ /**
17
+ * Connector - DELETE
18
+ *
19
+ * Forward DELETE requests to UniFi applications using RESTful HTTP methods. <br/><br/>**Request Flow**: The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with DELETE method. <br/><br/>**Requirements**: <br/>- Console firmware version must >= 5.0.3<br/>- For non-organization API keys: Limited to API key owner's consoles only (cannot access other admins' consoles)<br/>- For organization API keys: Can access any console within the organization<br/><br/>**Rate Limit**: <br/>- Each console is limited to 100 requests per minute<br/><br/>**Limits**: <br/>- Request timeout: each proxied request must complete within 25 seconds; otherwise it is terminated and a timeout error is returned<br/>- Response body size: the upstream response body is limited to 10 MB; larger responses are not supported<br/><br/>**API Documentation**: <br/>- Network API: [https://developer.ui.com/network](https://developer.ui.com/network)<br/>- Protect API: [https://developer.ui.com/protect](https://developer.ui.com/protect)<br/>- InnerSpace API: [https://developer.ui.com/innerspace](https://developer.ui.com/innerspace)<br/><br/>**Response**: On success, the upstream API response is passed through directly. On error, a standardized error schema is returned.
20
+ */
21
+ export declare const connectorDelete: <ThrowOnError extends boolean = false>(options: Options<ConnectorDeleteData, ThrowOnError>) => RequestResult<ConnectorDeleteResponses, ConnectorDeleteErrors, ThrowOnError>;
22
+ /**
23
+ * Connector - GET
24
+ *
25
+ * Forward GET requests to UniFi applications using RESTful HTTP methods. <br/><br/>**Request Flow**: The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with GET method. <br/><br/>**Requirements**: <br/>- Console firmware version must >= 5.0.3<br/>- For non-organization API keys: Limited to API key owner's consoles only (cannot access other admins' consoles)<br/>- For organization API keys: Can access any console within the organization<br/><br/>**Rate Limit**: <br/>- Each console is limited to 100 requests per minute<br/><br/>**Limits**: <br/>- Request timeout: each proxied request must complete within 25 seconds; otherwise it is terminated and a timeout error is returned<br/>- Response body size: the upstream response body is limited to 10 MB; larger responses are not supported<br/><br/>**API Documentation**: <br/>- Network API: [https://developer.ui.com/network](https://developer.ui.com/network)<br/>- Protect API: [https://developer.ui.com/protect](https://developer.ui.com/protect)<br/>- InnerSpace API: [https://developer.ui.com/innerspace](https://developer.ui.com/innerspace)<br/><br/>**Examples**: <br/>- Network: `GET /v1/connector/consoles/{id}/network/integration/v1/sites` retrieves network sites<br/>- Protect: `GET /v1/connector/consoles/{id}/protect/integration/v1/meta/info` retrieves protect application info<br/><br/>**Response**: On success, the upstream API response is passed through directly. On error, a standardized error schema is returned.
26
+ */
27
+ export declare const connectorGet: <ThrowOnError extends boolean = false>(options: Options<ConnectorGetData, ThrowOnError>) => RequestResult<ConnectorGetResponses, ConnectorGetErrors, ThrowOnError>;
28
+ /**
29
+ * Connector - PATCH
30
+ *
31
+ * Forward PATCH requests to UniFi applications using RESTful HTTP methods. <br/><br/>**Request Flow**: The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with PATCH method. <br/><br/>**Requirements**: <br/>- Console firmware version must >= 5.0.3<br/>- For non-organization API keys: Limited to API key owner's consoles only (cannot access other admins' consoles)<br/>- For organization API keys: Can access any console within the organization<br/><br/>**Rate Limit**: <br/>- Each console is limited to 100 requests per minute<br/><br/>**Limits**: <br/>- Request timeout: each proxied request must complete within 25 seconds; otherwise it is terminated and a timeout error is returned<br/>- Response body size: the upstream response body is limited to 10 MB; larger responses are not supported<br/><br/>**API Documentation**: <br/>- Network API: [https://developer.ui.com/network](https://developer.ui.com/network)<br/>- Protect API: [https://developer.ui.com/protect](https://developer.ui.com/protect)<br/>- InnerSpace API: [https://developer.ui.com/innerspace](https://developer.ui.com/innerspace)<br/><br/>**Response**: On success, the upstream API response is passed through directly. On error, a standardized error schema is returned.
32
+ */
33
+ export declare const connectorPatch: <ThrowOnError extends boolean = false>(options: Options<ConnectorPatchData, ThrowOnError>) => RequestResult<ConnectorPatchResponses, ConnectorPatchErrors, ThrowOnError>;
34
+ /**
35
+ * Connector - POST
36
+ *
37
+ * Forward POST requests to UniFi applications using RESTful HTTP methods. <br/><br/>**Request Flow**: The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with POST method. <br/><br/>**Requirements**: <br/>- Console firmware version must >= 5.0.3<br/>- For non-organization API keys: Limited to API key owner's consoles only (cannot access other admins' consoles)<br/>- For organization API keys: Can access any console within the organization<br/><br/>**Rate Limit**: <br/>- Each console is limited to 100 requests per minute<br/><br/>**Limits**: <br/>- Request timeout: each proxied request must complete within 25 seconds; otherwise it is terminated and a timeout error is returned<br/>- Response body size: the upstream response body is limited to 10 MB; larger responses are not supported<br/><br/>**API Documentation**: <br/>- Network API: [https://developer.ui.com/network](https://developer.ui.com/network)<br/>- Protect API: [https://developer.ui.com/protect](https://developer.ui.com/protect)<br/>- InnerSpace API: [https://developer.ui.com/innerspace](https://developer.ui.com/innerspace)<br/><br/>**Response**: On success, the upstream API response is passed through directly. On error, a standardized error schema is returned.
38
+ */
39
+ export declare const connectorPost: <ThrowOnError extends boolean = false>(options: Options<ConnectorPostData, ThrowOnError>) => RequestResult<ConnectorPostResponses, ConnectorPostErrors, ThrowOnError>;
40
+ /**
41
+ * Connector - PUT
42
+ *
43
+ * Forward PUT requests to UniFi applications using RESTful HTTP methods. <br/><br/>**Request Flow**: The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with PUT method. <br/><br/>**Requirements**: <br/>- Console firmware version must >= 5.0.3<br/>- For non-organization API keys: Limited to API key owner's consoles only (cannot access other admins' consoles)<br/>- For organization API keys: Can access any console within the organization<br/><br/>**Rate Limit**: <br/>- Each console is limited to 100 requests per minute<br/><br/>**Limits**: <br/>- Request timeout: each proxied request must complete within 25 seconds; otherwise it is terminated and a timeout error is returned<br/>- Response body size: the upstream response body is limited to 10 MB; larger responses are not supported<br/><br/>**API Documentation**: <br/>- Network API: [https://developer.ui.com/network](https://developer.ui.com/network)<br/>- Protect API: [https://developer.ui.com/protect](https://developer.ui.com/protect)<br/>- InnerSpace API: [https://developer.ui.com/innerspace](https://developer.ui.com/innerspace)<br/><br/>**Response**: On success, the upstream API response is passed through directly. On error, a standardized error schema is returned.
44
+ */
45
+ export declare const connectorPut: <ThrowOnError extends boolean = false>(options: Options<ConnectorPutData, ThrowOnError>) => RequestResult<ConnectorPutResponses, ConnectorPutErrors, ThrowOnError>;
46
+ /**
47
+ * List Devices
48
+ *
49
+ * Retrieves a list of UniFi devices managed by hosts where the UI account making the API call is the owner or a super admin. <br/><br/>**Note**: The structure of the `devices.uidb` field may vary depending on the UniFi OS or Network Server version. The example provided is based on UniFi OS 4.1.13.
50
+ */
51
+ export declare const listDevices: <ThrowOnError extends boolean = false>(options?: Options<ListDevicesData, ThrowOnError>) => RequestResult<ListDevicesResponses, ListDevicesErrors, ThrowOnError>;
52
+ /**
53
+ * List Hosts
54
+ *
55
+ * Retrieves a list of all hosts associated with the UI account making the API call. <br/><br/>**Note**: The structure of `userData` and `reportedState` fields may vary depending on the UniFi OS or Network Server version. The example provided is based on UniFi OS 4.1.13.
56
+ */
57
+ export declare const listHosts: <ThrowOnError extends boolean = false>(options?: Options<ListHostsData, ThrowOnError>) => RequestResult<ListHostsResponses, ListHostsErrors, ThrowOnError>;
58
+ /**
59
+ * Get Host by ID
60
+ *
61
+ * Retrieves detailed information about a specific host by ID. <br/><br/>**Note**: The structure of the `userData` and `reportedState` fields may vary depending on the UniFi OS or Network Server version. The example provided is based on UniFi OS 4.1.13.
62
+ */
63
+ export declare const getHostById: <ThrowOnError extends boolean = false>(options: Options<GetHostByIdData, ThrowOnError>) => RequestResult<GetHostByIdResponses, GetHostByIdErrors, ThrowOnError>;
64
+ /**
65
+ * Get ISP Metrics
66
+ *
67
+ * Retrieves ISP metrics data for all sites linked to the UI account's API key. 5-minute interval metrics are available for at least 24 hours, and 1-hour interval metrics are available for at least 30 days.
68
+ */
69
+ export declare const getIspMetrics: <ThrowOnError extends boolean = false>(options: Options<GetIspMetricsData, ThrowOnError>) => RequestResult<GetIspMetricsResponses, GetIspMetricsErrors, ThrowOnError>;
70
+ /**
71
+ * Query ISP Metrics
72
+ *
73
+ * Retrieves ISP metrics data based on specific query parameters. 5-minute interval metrics are available for at least 24 hours, and 1-hour interval metrics are available for at least 30 days. <br/><br/>**Note:** If the UI account lacks access to all requested sites, a 502 error is returned. If partial access is granted, the response will include `status: partialSuccess`.
74
+ */
75
+ export declare const queryIspMetrics: <ThrowOnError extends boolean = false>(options: Options<QueryIspMetricsData, ThrowOnError>) => RequestResult<QueryIspMetricsResponses, QueryIspMetricsErrors, ThrowOnError>;
76
+ /**
77
+ * List SD-WAN Configs
78
+ *
79
+ * Retrieves a list of all SD-WAN configurations associated with the UI account making the API call.
80
+ */
81
+ export declare const listSdWanConfigs: <ThrowOnError extends boolean = false>(options?: Options<ListSdWanConfigsData, ThrowOnError>) => RequestResult<ListSdWanConfigsResponses, ListSdWanConfigsErrors, ThrowOnError>;
82
+ /**
83
+ * Get SD-WAN Config by ID
84
+ *
85
+ * Retrieves detailed information about a specific SD-WAN configuration by ID.
86
+ */
87
+ export declare const getSdWanConfigById: <ThrowOnError extends boolean = false>(options: Options<GetSdWanConfigByIdData, ThrowOnError>) => RequestResult<GetSdWanConfigByIdResponses, GetSdWanConfigByIdErrors, ThrowOnError>;
88
+ /**
89
+ * Get SD-WAN Config Status
90
+ *
91
+ * Retrieves the status of a specific SD-WAN configuration, including deployment progress, errors, and associated hubs.
92
+ */
93
+ export declare const getSdWanConfigStatus: <ThrowOnError extends boolean = false>(options: Options<GetSdWanConfigStatusData, ThrowOnError>) => RequestResult<GetSdWanConfigStatusResponses, GetSdWanConfigStatusErrors, ThrowOnError>;
94
+ /**
95
+ * List Sites
96
+ *
97
+ * Retrieves a list of all sites (from hosts running the UniFi Network application) associated with the UI account making the API call. <br/><br/>**Note**: The structure of the `meta` and `statistics` fields may vary depending on the UniFi Network version. The example provided is based on UniFi OS 4.1.13.
98
+ */
99
+ export declare const listSites: <ThrowOnError extends boolean = false>(options?: Options<ListSitesData, ThrowOnError>) => RequestResult<ListSitesResponses, ListSitesErrors, ThrowOnError>;