@space-df/sdk 0.0.1-dev.14 → 0.0.1-dev.15
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/api.doc.md +841 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/device/device-connector.d.ts +25 -0
- package/dist/resources/device/device-connector.d.ts.map +1 -0
- package/dist/resources/device/device-connector.js +30 -0
- package/dist/resources/device/device-connector.js.map +1 -0
- package/dist/resources/device/device-connector.mjs +26 -0
- package/dist/resources/device/device-connector.mjs.map +1 -0
- package/dist/resources/device/device-model.d.ts +20 -0
- package/dist/resources/device/device-model.d.ts.map +1 -0
- package/dist/resources/device/device-model.js +52 -0
- package/dist/resources/device/device-model.js.map +1 -0
- package/dist/resources/device/device-model.mjs +48 -0
- package/dist/resources/device/device-model.mjs.map +1 -0
- package/dist/resources/device/devices.d.ts +18 -0
- package/dist/resources/device/devices.d.ts.map +1 -0
- package/dist/resources/device/devices.js +52 -0
- package/dist/resources/device/devices.js.map +1 -0
- package/dist/resources/device/devices.mjs +48 -0
- package/dist/resources/device/devices.mjs.map +1 -0
- package/dist/resources/device/index.d.ts +6 -0
- package/dist/resources/device/index.d.ts.map +1 -0
- package/dist/resources/device/index.js +22 -0
- package/dist/resources/device/index.js.map +1 -0
- package/dist/resources/device/index.mjs +6 -0
- package/dist/resources/device/index.mjs.map +1 -0
- package/dist/resources/device/manufacturers.d.ts +20 -0
- package/dist/resources/device/manufacturers.d.ts.map +1 -0
- package/dist/resources/device/manufacturers.js +52 -0
- package/dist/resources/device/manufacturers.js.map +1 -0
- package/dist/resources/device/manufacturers.mjs +48 -0
- package/dist/resources/device/manufacturers.mjs.map +1 -0
- package/dist/resources/device/network-server.d.ts +19 -0
- package/dist/resources/device/network-server.d.ts.map +1 -0
- package/dist/resources/device/network-server.js +52 -0
- package/dist/resources/device/network-server.js.map +1 -0
- package/dist/resources/device/network-server.mjs +48 -0
- package/dist/resources/device/network-server.mjs.map +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs +1 -0
- package/dist/src/index.ts +5 -0
- package/dist/src/resources/auth/presigned-url.ts +1 -1
- package/dist/src/resources/device/device-connector.ts +49 -0
- package/dist/src/resources/device/device-model.ts +65 -0
- package/dist/src/resources/device/devices.ts +63 -0
- package/dist/src/resources/device/index.ts +5 -0
- package/dist/src/resources/device/manufacturers.ts +65 -0
- package/dist/src/resources/device/network-server.ts +64 -0
- package/dist/src/resources/index.ts +1 -0
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -0
- package/src/resources/auth/presigned-url.ts +1 -1
- package/src/resources/device/device-connector.ts +49 -0
- package/src/resources/device/device-model.ts +65 -0
- package/src/resources/device/devices.ts +63 -0
- package/src/resources/device/index.ts +5 -0
- package/src/resources/device/manufacturers.ts +65 -0
- package/src/resources/device/network-server.ts +64 -0
- package/src/resources/index.ts +1 -0
- package/src/version.ts +1 -1
package/api.doc.md
CHANGED
|
@@ -1649,3 +1649,844 @@ console.log(response.file_name);
|
|
|
1649
1649
|
```
|
|
1650
1650
|
|
|
1651
1651
|
</details>
|
|
1652
|
+
|
|
1653
|
+
# DeviceConnector
|
|
1654
|
+
|
|
1655
|
+
## Overview
|
|
1656
|
+
|
|
1657
|
+
The `DeviceConnector` class provides methods for retrieving and listing connector. Below are the details for each method, including parameters, return types, and example usage.
|
|
1658
|
+
|
|
1659
|
+
## Methods
|
|
1660
|
+
|
|
1661
|
+
<details>
|
|
1662
|
+
<summary><strong>create</strong></summary>
|
|
1663
|
+
|
|
1664
|
+
Create a new device connector.
|
|
1665
|
+
|
|
1666
|
+
**Signature:**
|
|
1667
|
+
|
|
1668
|
+
```typescript
|
|
1669
|
+
create(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<DeviceConnectorParams>
|
|
1670
|
+
```
|
|
1671
|
+
|
|
1672
|
+
**Parameters:**
|
|
1673
|
+
|
|
1674
|
+
- params (DeviceConnectorParams): Parameters for creating a device connector:
|
|
1675
|
+
- network_server (string): The URL or address of the network server.
|
|
1676
|
+
- name (string): The name of the device connector.
|
|
1677
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1678
|
+
- status? (string): Optional status of the connector.
|
|
1679
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1680
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1681
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1682
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1683
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1684
|
+
- username (string): Username for broker authentication.
|
|
1685
|
+
- password (string): Password for broker authentication.
|
|
1686
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1687
|
+
|
|
1688
|
+
**Returns:** Promise `<DeviceConnectorParams>`
|
|
1689
|
+
|
|
1690
|
+
**Example:**
|
|
1691
|
+
|
|
1692
|
+
```typescript
|
|
1693
|
+
const newMqttConnector = await client.deviceConnector.create({
|
|
1694
|
+
network_server: 'poue4567-e89...',
|
|
1695
|
+
name: 'MQTT Connector 1',
|
|
1696
|
+
connector_type: 'mqtt_broker',
|
|
1697
|
+
deviceMqttConfig: {
|
|
1698
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1699
|
+
username: 'user123',
|
|
1700
|
+
password: 'secretpass',
|
|
1701
|
+
},
|
|
1702
|
+
});
|
|
1703
|
+
|
|
1704
|
+
const newHttpConnector = await client.deviceConnector.create({
|
|
1705
|
+
network_server: 'poue4567-e89...',
|
|
1706
|
+
name: 'HTTP Connector 1',
|
|
1707
|
+
connector_type: 'http_server',
|
|
1708
|
+
deviceHttpConfig: {
|
|
1709
|
+
api_token: 'your_api_token_here',
|
|
1710
|
+
address_url: 'http://api.example.com/data',
|
|
1711
|
+
},
|
|
1712
|
+
});
|
|
1713
|
+
```
|
|
1714
|
+
|
|
1715
|
+
</details>
|
|
1716
|
+
|
|
1717
|
+
<details>
|
|
1718
|
+
<summary><strong>testConnectionPreview</strong></summary>
|
|
1719
|
+
|
|
1720
|
+
Test connection to a device connector without saving it (preview only).
|
|
1721
|
+
|
|
1722
|
+
**Signature:**
|
|
1723
|
+
|
|
1724
|
+
```typescript
|
|
1725
|
+
testConnectionPreview(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1726
|
+
```
|
|
1727
|
+
|
|
1728
|
+
**Parameters:**
|
|
1729
|
+
|
|
1730
|
+
- params (DeviceConnectorParams): Parameters for testing a device connector connection:
|
|
1731
|
+
- network_server (string): The URL or address of the network server.
|
|
1732
|
+
- name (string): The name of the device connector.
|
|
1733
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1734
|
+
- status? (string): Optional status of the connector.
|
|
1735
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1736
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1737
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1738
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1739
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1740
|
+
- username (string): Username for broker authentication.
|
|
1741
|
+
- password (string): Password for broker authentication.
|
|
1742
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1743
|
+
|
|
1744
|
+
**Returns:** Promise `<void>`
|
|
1745
|
+
|
|
1746
|
+
**Example:**
|
|
1747
|
+
|
|
1748
|
+
```typescript
|
|
1749
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1750
|
+
network_server: 'poue4567-e89...',
|
|
1751
|
+
name: 'MQTT Connector Preview',
|
|
1752
|
+
connector_type: 'mqtt_broker',
|
|
1753
|
+
deviceMqttConfig: {
|
|
1754
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1755
|
+
username: 'testuser',
|
|
1756
|
+
password: 'testpass',
|
|
1757
|
+
},
|
|
1758
|
+
});
|
|
1759
|
+
|
|
1760
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1761
|
+
network_server: 'poue4567-e89...',
|
|
1762
|
+
name: 'HTTP Connector Preview',
|
|
1763
|
+
connector_type: 'http_server',
|
|
1764
|
+
deviceHttpConfig: {
|
|
1765
|
+
api_token: 'test_api_token',
|
|
1766
|
+
address_url: 'http://api.example.com/data',
|
|
1767
|
+
},
|
|
1768
|
+
});
|
|
1769
|
+
```
|
|
1770
|
+
|
|
1771
|
+
</details>
|
|
1772
|
+
|
|
1773
|
+
<details>
|
|
1774
|
+
<summary><strong>testConnection</strong></summary>
|
|
1775
|
+
|
|
1776
|
+
Test an existing device connector by ID.
|
|
1777
|
+
|
|
1778
|
+
**Signature:**
|
|
1779
|
+
|
|
1780
|
+
```typescript
|
|
1781
|
+
testConnection(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1782
|
+
```
|
|
1783
|
+
|
|
1784
|
+
**Parameters:**
|
|
1785
|
+
|
|
1786
|
+
- `id` (string): A UUID string identifying the device connector to test.
|
|
1787
|
+
- `options`? (Core.RequestOptions): Additional request options such as custom headers.
|
|
1788
|
+
|
|
1789
|
+
**Returns:** `Promise <void>`
|
|
1790
|
+
|
|
1791
|
+
**Example:**
|
|
1792
|
+
|
|
1793
|
+
```typescript
|
|
1794
|
+
await client.deviceConnector.testConnection('123e4567-e89b-12d3-a456-426614174000');
|
|
1795
|
+
```
|
|
1796
|
+
|
|
1797
|
+
</details>
|
|
1798
|
+
|
|
1799
|
+
---
|
|
1800
|
+
|
|
1801
|
+
# DeviceModel
|
|
1802
|
+
|
|
1803
|
+
## Overview
|
|
1804
|
+
|
|
1805
|
+
The `DeviceModel` class provides methods for retrieving and listing device model. Below are the details for each method, including parameters, return types, and example usage.
|
|
1806
|
+
|
|
1807
|
+
## Methods
|
|
1808
|
+
|
|
1809
|
+
<details>
|
|
1810
|
+
<summary><strong>create</strong></summary>
|
|
1811
|
+
|
|
1812
|
+
Create a new device model.
|
|
1813
|
+
|
|
1814
|
+
**Signature:**
|
|
1815
|
+
|
|
1816
|
+
```typescript
|
|
1817
|
+
create(params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1818
|
+
```
|
|
1819
|
+
|
|
1820
|
+
**Parameters:**
|
|
1821
|
+
|
|
1822
|
+
- params (DeviceModelParams): Parameters for creating a device model:
|
|
1823
|
+
- name (string): The name of the device model.
|
|
1824
|
+
- alias (string): The alias of the device model.
|
|
1825
|
+
- image_url (string): The image URL of the device model.
|
|
1826
|
+
- default_config (object): The default configuration object.
|
|
1827
|
+
- manufacture (string): The manufacturer of the device model.
|
|
1828
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1829
|
+
|
|
1830
|
+
**Returns:** Promise<DeviceModelParams>
|
|
1831
|
+
|
|
1832
|
+
**Example:**
|
|
1833
|
+
|
|
1834
|
+
```typescript
|
|
1835
|
+
const newDeviceModel = await client.deviceModel.create({
|
|
1836
|
+
name: 'Model X',
|
|
1837
|
+
alias: 'model_x',
|
|
1838
|
+
image_url: 'http://example.com/image.png',
|
|
1839
|
+
default_config: {},
|
|
1840
|
+
manufacture: '123e4567-e89...',
|
|
1841
|
+
});
|
|
1842
|
+
```
|
|
1843
|
+
|
|
1844
|
+
</details>
|
|
1845
|
+
|
|
1846
|
+
<details>
|
|
1847
|
+
<summary><strong>retrieve</strong></summary>
|
|
1848
|
+
|
|
1849
|
+
Retrieve a device model by its ID.
|
|
1850
|
+
|
|
1851
|
+
**Signature:**
|
|
1852
|
+
|
|
1853
|
+
```typescript
|
|
1854
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1855
|
+
```
|
|
1856
|
+
|
|
1857
|
+
**Parameters:**
|
|
1858
|
+
|
|
1859
|
+
- `id` (string): The unique identifier of the device model to retrieve.
|
|
1860
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1861
|
+
|
|
1862
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1863
|
+
|
|
1864
|
+
**Example:**
|
|
1865
|
+
|
|
1866
|
+
```typescript
|
|
1867
|
+
const deviceModel = await client.deviceModel.retrieve('123e4567-e89b-12d3-a456-426614174000');
|
|
1868
|
+
console.log(deviceModel.name);
|
|
1869
|
+
```
|
|
1870
|
+
|
|
1871
|
+
</details>
|
|
1872
|
+
|
|
1873
|
+
<details>
|
|
1874
|
+
<summary><strong>update</strong></summary>
|
|
1875
|
+
|
|
1876
|
+
Update an existing device model by its ID.
|
|
1877
|
+
|
|
1878
|
+
**Signature:**
|
|
1879
|
+
|
|
1880
|
+
```typescript
|
|
1881
|
+
update(id: string, params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1882
|
+
```
|
|
1883
|
+
|
|
1884
|
+
**Parameters:**
|
|
1885
|
+
|
|
1886
|
+
- `id` (string): The unique identifier of the device model to update.
|
|
1887
|
+
- `params` (DeviceModelParams): The data to update the device model with:
|
|
1888
|
+
- `name` (string): The name of the device model.
|
|
1889
|
+
- `alias` (string): The alias of the device model.
|
|
1890
|
+
- `image_url` (string): The image URL of the device model.
|
|
1891
|
+
- `default_config` (object): The default configuration object.
|
|
1892
|
+
- `manufacture` (string): The manufacturer of the device model.
|
|
1893
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1894
|
+
|
|
1895
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1896
|
+
|
|
1897
|
+
**Example:**
|
|
1898
|
+
|
|
1899
|
+
```typescript
|
|
1900
|
+
const updatedDeviceModel = await client.deviceModel.update('123e4567-e89b-12d3-a456-426614174000', {
|
|
1901
|
+
name: 'Model Y',
|
|
1902
|
+
alias: 'model_y',
|
|
1903
|
+
image_url: 'http://example.com/image2.png',
|
|
1904
|
+
default_config: { setting: true },
|
|
1905
|
+
manufacture: '123e4567-e89...',
|
|
1906
|
+
});
|
|
1907
|
+
console.log(updatedDeviceModel);
|
|
1908
|
+
```
|
|
1909
|
+
|
|
1910
|
+
</details>
|
|
1911
|
+
|
|
1912
|
+
<details>
|
|
1913
|
+
<summary><strong>list</strong></summary>
|
|
1914
|
+
|
|
1915
|
+
Retrieve a list of device models with optional filters.
|
|
1916
|
+
|
|
1917
|
+
**Signature:**
|
|
1918
|
+
|
|
1919
|
+
```typescript
|
|
1920
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceModelListResponse>
|
|
1921
|
+
```
|
|
1922
|
+
|
|
1923
|
+
**Parameters:**
|
|
1924
|
+
|
|
1925
|
+
- `params` (ListParamsResponse): Query parameters to filter and paginate the results:
|
|
1926
|
+
- `ordering` (string, optional): Which field to use when ordering the results.
|
|
1927
|
+
- `search` (string, optional): A search term.
|
|
1928
|
+
- `limit` (integer, optional): Number of results to return per page.
|
|
1929
|
+
- `offset` (integer, optional): The initial index from which to return the results.
|
|
1930
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1931
|
+
|
|
1932
|
+
**Returns:** `Promise<DeviceModelListResponse>`
|
|
1933
|
+
|
|
1934
|
+
**Example:**
|
|
1935
|
+
|
|
1936
|
+
```typescript
|
|
1937
|
+
const deviceModels = await client.deviceModel.list({
|
|
1938
|
+
ordering: 'name',
|
|
1939
|
+
search: 'model',
|
|
1940
|
+
limit: 10,
|
|
1941
|
+
offset: 0,
|
|
1942
|
+
});
|
|
1943
|
+
console.log(deviceModels.results);
|
|
1944
|
+
```
|
|
1945
|
+
|
|
1946
|
+
</details>
|
|
1947
|
+
|
|
1948
|
+
<details>
|
|
1949
|
+
<summary><strong>delete</strong></summary>
|
|
1950
|
+
|
|
1951
|
+
Delete a device models by its ID.
|
|
1952
|
+
|
|
1953
|
+
**Signature:**
|
|
1954
|
+
|
|
1955
|
+
```typescript
|
|
1956
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1957
|
+
```
|
|
1958
|
+
|
|
1959
|
+
**Parameters:**
|
|
1960
|
+
|
|
1961
|
+
- `id` _(string)_: A UUID string identifying this device models.
|
|
1962
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1963
|
+
|
|
1964
|
+
**Returns:** `Promise<void>`
|
|
1965
|
+
|
|
1966
|
+
**Example:**
|
|
1967
|
+
|
|
1968
|
+
```typescript
|
|
1969
|
+
await client.deviceModel.delete('a557d013-f6...');
|
|
1970
|
+
```
|
|
1971
|
+
|
|
1972
|
+
</details>
|
|
1973
|
+
|
|
1974
|
+
---
|
|
1975
|
+
|
|
1976
|
+
# Device
|
|
1977
|
+
|
|
1978
|
+
## Overview
|
|
1979
|
+
|
|
1980
|
+
The `Device` class provides methods for retrieving and listing device. Below are the details for each method, including parameters, return types, and example usage.
|
|
1981
|
+
|
|
1982
|
+
## Methods
|
|
1983
|
+
|
|
1984
|
+
<details>
|
|
1985
|
+
<summary><strong>create</strong></summary>
|
|
1986
|
+
|
|
1987
|
+
Create a new device.
|
|
1988
|
+
|
|
1989
|
+
**Signature:**
|
|
1990
|
+
|
|
1991
|
+
```typescript
|
|
1992
|
+
create(params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
1993
|
+
```
|
|
1994
|
+
|
|
1995
|
+
**Parameters:**
|
|
1996
|
+
|
|
1997
|
+
- `params` _(DeviceParams)_: Parameters for creating a device:
|
|
1998
|
+
- `status` _(string, optional)_: The status of the device.
|
|
1999
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2000
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2001
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2002
|
+
|
|
2003
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2004
|
+
|
|
2005
|
+
**Example:**
|
|
2006
|
+
|
|
2007
|
+
```typescript
|
|
2008
|
+
const newDevice = await client.devices.create({
|
|
2009
|
+
status: 'active',
|
|
2010
|
+
device_connector: '123e4567-e89...',
|
|
2011
|
+
device_model: 'poye4567-e89...',
|
|
2012
|
+
});
|
|
2013
|
+
```
|
|
2014
|
+
|
|
2015
|
+
</details>
|
|
2016
|
+
|
|
2017
|
+
<details>
|
|
2018
|
+
<summary><strong>retrieve</strong></summary>
|
|
2019
|
+
|
|
2020
|
+
Retrieve details of a device by its ID.
|
|
2021
|
+
|
|
2022
|
+
**Signature:**
|
|
2023
|
+
|
|
2024
|
+
```typescript
|
|
2025
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2026
|
+
```
|
|
2027
|
+
|
|
2028
|
+
**Parameters:**
|
|
2029
|
+
|
|
2030
|
+
- `id` _(string)_: The unique identifier of the device to retrieve.
|
|
2031
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2032
|
+
|
|
2033
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2034
|
+
|
|
2035
|
+
**Example:**
|
|
2036
|
+
|
|
2037
|
+
```typescript
|
|
2038
|
+
const device = await client.devices.retrieve('1l3e4567-e89...');
|
|
2039
|
+
console.log(device.device_model);
|
|
2040
|
+
```
|
|
2041
|
+
|
|
2042
|
+
</details>
|
|
2043
|
+
|
|
2044
|
+
<details>
|
|
2045
|
+
<summary><strong>update</strong></summary>
|
|
2046
|
+
|
|
2047
|
+
Update an existing device by its ID.
|
|
2048
|
+
|
|
2049
|
+
**Signature:**
|
|
2050
|
+
|
|
2051
|
+
```typescript
|
|
2052
|
+
update(id: string, params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2053
|
+
```
|
|
2054
|
+
|
|
2055
|
+
**Parameters:**
|
|
2056
|
+
|
|
2057
|
+
- `id` _(string)_: The unique identifier of the device to update.
|
|
2058
|
+
- `params` _(DeviceParams)_: Parameters to update the device with:
|
|
2059
|
+
- `status` _(string, optional)_: The status of the device.
|
|
2060
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2061
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2062
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2063
|
+
|
|
2064
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2065
|
+
|
|
2066
|
+
**Example:**
|
|
2067
|
+
|
|
2068
|
+
```typescript
|
|
2069
|
+
const updatedDevice = await client.devices.update('device-id-123', {
|
|
2070
|
+
status: 'active',
|
|
2071
|
+
device_connector: '123e4567-e89...',
|
|
2072
|
+
device_model: 'ks3e4567-e89...',
|
|
2073
|
+
});
|
|
2074
|
+
```
|
|
2075
|
+
|
|
2076
|
+
</details>
|
|
2077
|
+
|
|
2078
|
+
<details>
|
|
2079
|
+
<summary><strong>list</strong></summary>
|
|
2080
|
+
|
|
2081
|
+
List devices with optional pagination.
|
|
2082
|
+
|
|
2083
|
+
**Signature:**
|
|
2084
|
+
|
|
2085
|
+
```typescript
|
|
2086
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceListResponse>
|
|
2087
|
+
```
|
|
2088
|
+
|
|
2089
|
+
**Parameters:**
|
|
2090
|
+
|
|
2091
|
+
- `params` _(ListParamsResponse)_: Query parameters for listing devices:
|
|
2092
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2093
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2094
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2095
|
+
|
|
2096
|
+
**Returns:** `Promise<DeviceListResponse>`
|
|
2097
|
+
|
|
2098
|
+
**Example:**
|
|
2099
|
+
|
|
2100
|
+
```typescript
|
|
2101
|
+
const devices = await client.devices.list({ limit: 10, offset: 0 });
|
|
2102
|
+
console.log(devices.results);
|
|
2103
|
+
```
|
|
2104
|
+
|
|
2105
|
+
</details>
|
|
2106
|
+
|
|
2107
|
+
<details>
|
|
2108
|
+
<summary><strong>delete</strong></summary>
|
|
2109
|
+
|
|
2110
|
+
Delete a device by its ID.
|
|
2111
|
+
|
|
2112
|
+
**Signature:**
|
|
2113
|
+
|
|
2114
|
+
```typescript
|
|
2115
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2116
|
+
```
|
|
2117
|
+
|
|
2118
|
+
**Parameters:**
|
|
2119
|
+
|
|
2120
|
+
- `id` _(number)_: The unique identifier of the device to delete.
|
|
2121
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2122
|
+
|
|
2123
|
+
**Returns:** `Promise<void>`
|
|
2124
|
+
|
|
2125
|
+
**Example:**
|
|
2126
|
+
|
|
2127
|
+
```typescript
|
|
2128
|
+
await client.devices.delete('123e4567-e89...');
|
|
2129
|
+
console.log('Device deleted successfully.');
|
|
2130
|
+
```
|
|
2131
|
+
|
|
2132
|
+
</details>
|
|
2133
|
+
|
|
2134
|
+
---
|
|
2135
|
+
|
|
2136
|
+
# Manufacturers
|
|
2137
|
+
|
|
2138
|
+
## Overview
|
|
2139
|
+
|
|
2140
|
+
The `Manufacturers` class provides methods for retrieving and listing manufacturers of device. Below are the details for each method, including parameters, return types, and example usage.
|
|
2141
|
+
|
|
2142
|
+
## Methods
|
|
2143
|
+
|
|
2144
|
+
<details>
|
|
2145
|
+
<summary><strong>create</strong></summary>
|
|
2146
|
+
|
|
2147
|
+
Create a new manufacturer.
|
|
2148
|
+
|
|
2149
|
+
**Signature:**
|
|
2150
|
+
|
|
2151
|
+
```typescript
|
|
2152
|
+
create(params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2153
|
+
```
|
|
2154
|
+
|
|
2155
|
+
**Parameters:**
|
|
2156
|
+
|
|
2157
|
+
- `params` _(ManufacturersParams)_: Parameters for creating a manufacturer:
|
|
2158
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2159
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2160
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2161
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2162
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2163
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2164
|
+
|
|
2165
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2166
|
+
|
|
2167
|
+
**Example:**
|
|
2168
|
+
|
|
2169
|
+
````typescript
|
|
2170
|
+
const newManufacturer = await client.manufacturers.create({
|
|
2171
|
+
name: 'Acme Corp',
|
|
2172
|
+
location: 'USA',
|
|
2173
|
+
description: 'Leading manufacturer of widgets',
|
|
2174
|
+
portal_url: 'https://acme.example.com',
|
|
2175
|
+
national: 'US',
|
|
2176
|
+
});
|
|
2177
|
+
```
|
|
2178
|
+
</details>
|
|
2179
|
+
|
|
2180
|
+
<details>
|
|
2181
|
+
<summary><strong>retrieve</strong></summary>
|
|
2182
|
+
|
|
2183
|
+
Retrieve details of a manufacturer by its ID.
|
|
2184
|
+
|
|
2185
|
+
**Signature:**
|
|
2186
|
+
```typescript
|
|
2187
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2188
|
+
````
|
|
2189
|
+
|
|
2190
|
+
**Parameters:**
|
|
2191
|
+
|
|
2192
|
+
- `id` _(string)_: The unique identifier of the manufacturer to retrieve.
|
|
2193
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2194
|
+
|
|
2195
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2196
|
+
|
|
2197
|
+
**Example:**
|
|
2198
|
+
|
|
2199
|
+
```typescript
|
|
2200
|
+
const manufacturer = await client.manufacturers.retrieve('123e4567-e89...');
|
|
2201
|
+
console.log(manufacturer.name);
|
|
2202
|
+
```
|
|
2203
|
+
|
|
2204
|
+
</details>
|
|
2205
|
+
|
|
2206
|
+
<details>
|
|
2207
|
+
<summary><strong>update</strong></summary>
|
|
2208
|
+
|
|
2209
|
+
Update an existing manufacturer by its ID.
|
|
2210
|
+
|
|
2211
|
+
**Signature:**
|
|
2212
|
+
|
|
2213
|
+
```typescript
|
|
2214
|
+
update(id: string, params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2215
|
+
```
|
|
2216
|
+
|
|
2217
|
+
**Parameters:**
|
|
2218
|
+
|
|
2219
|
+
- `id` _(string)_: The unique identifier of the manufacturer to update.
|
|
2220
|
+
- `params` _(ManufacturersParams)_: Parameters for updating the manufacturer:
|
|
2221
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2222
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2223
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2224
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2225
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2226
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2227
|
+
|
|
2228
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2229
|
+
|
|
2230
|
+
**Example:**
|
|
2231
|
+
|
|
2232
|
+
```typescript
|
|
2233
|
+
const updatedManufacturer = await client.manufacturers.update('123e4567-e89...', {
|
|
2234
|
+
name: 'Acme Corp Updated',
|
|
2235
|
+
location: 'USA',
|
|
2236
|
+
description: 'Updated description',
|
|
2237
|
+
portal_url: 'https://acme.example.com',
|
|
2238
|
+
national: 'US',
|
|
2239
|
+
});
|
|
2240
|
+
```
|
|
2241
|
+
|
|
2242
|
+
</details>
|
|
2243
|
+
|
|
2244
|
+
<details>
|
|
2245
|
+
<summary><strong>list</strong></summary>
|
|
2246
|
+
|
|
2247
|
+
List manufacturers with optional filtering, ordering, and pagination.
|
|
2248
|
+
|
|
2249
|
+
**Signature:**
|
|
2250
|
+
|
|
2251
|
+
```typescript
|
|
2252
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<ManufacturersListResponse>
|
|
2253
|
+
```
|
|
2254
|
+
|
|
2255
|
+
**Parameters:**
|
|
2256
|
+
|
|
2257
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2258
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2259
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2260
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2261
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2262
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2263
|
+
|
|
2264
|
+
**Returns:** `Promise<ManufacturersListResponse>`
|
|
2265
|
+
|
|
2266
|
+
**Response shape:**
|
|
2267
|
+
|
|
2268
|
+
- `count` _(integer)_: Total number of manufacturers matching the query.
|
|
2269
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2270
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2271
|
+
- `results` _(ManufacturersParams[])_: Array of manufacturer objects.
|
|
2272
|
+
|
|
2273
|
+
**Example:**
|
|
2274
|
+
|
|
2275
|
+
```typescript
|
|
2276
|
+
const listResponse = await client.manufacturers.list({
|
|
2277
|
+
ordering: 'name',
|
|
2278
|
+
search: 'acme',
|
|
2279
|
+
limit: 10,
|
|
2280
|
+
offset: 0,
|
|
2281
|
+
});
|
|
2282
|
+
console.log(listResponse.results);
|
|
2283
|
+
```
|
|
2284
|
+
|
|
2285
|
+
</details>
|
|
2286
|
+
|
|
2287
|
+
<details>
|
|
2288
|
+
<summary><strong>delete</strong></summary>
|
|
2289
|
+
|
|
2290
|
+
Delete a manufacturer by its ID.
|
|
2291
|
+
|
|
2292
|
+
**Signature:**
|
|
2293
|
+
|
|
2294
|
+
```typescript
|
|
2295
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2296
|
+
```
|
|
2297
|
+
|
|
2298
|
+
**Parameters:**
|
|
2299
|
+
|
|
2300
|
+
- `id` _(number)_: A UUID string identifying this manufacturer. (Note: Type is `number` in code but described as UUID string)
|
|
2301
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2302
|
+
|
|
2303
|
+
**Returns:** `Promise<void>` (No content on success)
|
|
2304
|
+
|
|
2305
|
+
**Example:**
|
|
2306
|
+
|
|
2307
|
+
```typescript
|
|
2308
|
+
await client.manufacturers.delete('123e4567-e89...');
|
|
2309
|
+
```
|
|
2310
|
+
|
|
2311
|
+
</details>
|
|
2312
|
+
|
|
2313
|
+
---
|
|
2314
|
+
|
|
2315
|
+
# NetworkServer
|
|
2316
|
+
|
|
2317
|
+
## Overview
|
|
2318
|
+
|
|
2319
|
+
The `NetworkServer` class provides methods for retrieving and listing network server. Below are the details for each method, including parameters, return types, and example usage.
|
|
2320
|
+
|
|
2321
|
+
## Methods
|
|
2322
|
+
|
|
2323
|
+
<details>
|
|
2324
|
+
<summary><strong>create</strong></summary>
|
|
2325
|
+
|
|
2326
|
+
Create a new network server.
|
|
2327
|
+
|
|
2328
|
+
**Signature:**
|
|
2329
|
+
|
|
2330
|
+
```typescript
|
|
2331
|
+
reate(params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2332
|
+
```
|
|
2333
|
+
|
|
2334
|
+
**Parameters:**
|
|
2335
|
+
|
|
2336
|
+
- `params` _(NetworkServerParams)_: Parameters for creating a new network server.
|
|
2337
|
+
- `name`: _(string)_: The name of the network server.
|
|
2338
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2339
|
+
- `description`: _(string)_: The description of the network server.
|
|
2340
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server.
|
|
2341
|
+
Possible values may include:
|
|
2342
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2343
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2344
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2345
|
+
|
|
2346
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2347
|
+
|
|
2348
|
+
**Example:**
|
|
2349
|
+
|
|
2350
|
+
```typescript
|
|
2351
|
+
const newNetworkServer = await client.networkServer.create({
|
|
2352
|
+
name: 'Chirpstack',
|
|
2353
|
+
logo: 'logo-url',
|
|
2354
|
+
description: 'example-description',
|
|
2355
|
+
type_connect: ['mqtt_broker', 'http_server'],
|
|
2356
|
+
});
|
|
2357
|
+
```
|
|
2358
|
+
|
|
2359
|
+
</details>
|
|
2360
|
+
|
|
2361
|
+
<details>
|
|
2362
|
+
<summary><strong>retrieve</strong></summary>
|
|
2363
|
+
Retrieve details of a network server by its ID.
|
|
2364
|
+
|
|
2365
|
+
**Signature:**
|
|
2366
|
+
|
|
2367
|
+
```typescript
|
|
2368
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2369
|
+
```
|
|
2370
|
+
|
|
2371
|
+
**Parameters:**
|
|
2372
|
+
|
|
2373
|
+
- `id` _(string)_: The unique identifier of the network server to retrieve.
|
|
2374
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2375
|
+
|
|
2376
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2377
|
+
|
|
2378
|
+
**Example:**
|
|
2379
|
+
|
|
2380
|
+
```typescript
|
|
2381
|
+
const networkServer = await client.networkServer.retrieve('a557d013-f6...');
|
|
2382
|
+
console.log(networkServer.name);
|
|
2383
|
+
```
|
|
2384
|
+
|
|
2385
|
+
</details>
|
|
2386
|
+
|
|
2387
|
+
<details>
|
|
2388
|
+
<summary><strong>update</strong></summary>
|
|
2389
|
+
|
|
2390
|
+
Update an existing network server by its ID.
|
|
2391
|
+
|
|
2392
|
+
**Signature:**
|
|
2393
|
+
|
|
2394
|
+
```typescript
|
|
2395
|
+
update(id: string, params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2396
|
+
```
|
|
2397
|
+
|
|
2398
|
+
**Parameters:**
|
|
2399
|
+
|
|
2400
|
+
- `id` _(string)_: The unique identifier of the network server to update.
|
|
2401
|
+
- `params` _(NetworkServerParams)_: Parameters for updating the network server.
|
|
2402
|
+
- `name`: _(string)_: The name of the network server.
|
|
2403
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2404
|
+
- `description`: _(string)_: The description of the network server.
|
|
2405
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server. Possible values include:
|
|
2406
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2407
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2408
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2409
|
+
|
|
2410
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2411
|
+
|
|
2412
|
+
**Example:**
|
|
2413
|
+
|
|
2414
|
+
```typescript
|
|
2415
|
+
const updatedNetworkServer = await client.networkServer.update('a557d013-f6 ...', {
|
|
2416
|
+
name: 'Chirpstack Updated',
|
|
2417
|
+
logo: 'new-logo-url',
|
|
2418
|
+
description: 'updated-description',
|
|
2419
|
+
type_connect: ['mqtt_broker'],
|
|
2420
|
+
});
|
|
2421
|
+
```
|
|
2422
|
+
|
|
2423
|
+
</details>
|
|
2424
|
+
|
|
2425
|
+
<details>
|
|
2426
|
+
<summary><strong>list</strong></summary>
|
|
2427
|
+
|
|
2428
|
+
List network servers with optional filtering, ordering, and pagination.
|
|
2429
|
+
|
|
2430
|
+
**Signature:**
|
|
2431
|
+
|
|
2432
|
+
```typescript
|
|
2433
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<NetworkServerListResponse>
|
|
2434
|
+
```
|
|
2435
|
+
|
|
2436
|
+
**Parameters:**
|
|
2437
|
+
|
|
2438
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2439
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2440
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2441
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2442
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2443
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2444
|
+
|
|
2445
|
+
**Returns:** `Promise<NetworkServerListResponse>`
|
|
2446
|
+
|
|
2447
|
+
**Response shape:**
|
|
2448
|
+
|
|
2449
|
+
- `count` _(integer)_: Total number of network servers matching the query.
|
|
2450
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2451
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2452
|
+
- `results` _(NetworkServer[])_: Array of network server objects.
|
|
2453
|
+
|
|
2454
|
+
**Example:**
|
|
2455
|
+
|
|
2456
|
+
```typescript
|
|
2457
|
+
const listResponse = await client.networkServer.list({
|
|
2458
|
+
ordering: 'name',
|
|
2459
|
+
search: 'chirpstack',
|
|
2460
|
+
limit: 10,
|
|
2461
|
+
offset: 0,
|
|
2462
|
+
});
|
|
2463
|
+
console.log(listResponse.results);
|
|
2464
|
+
```
|
|
2465
|
+
|
|
2466
|
+
</details>
|
|
2467
|
+
|
|
2468
|
+
<details>
|
|
2469
|
+
<summary><strong>delete</strong></summary>
|
|
2470
|
+
|
|
2471
|
+
Delete a network server by its ID.
|
|
2472
|
+
|
|
2473
|
+
**Signature:**
|
|
2474
|
+
|
|
2475
|
+
```typescript
|
|
2476
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2477
|
+
```
|
|
2478
|
+
|
|
2479
|
+
**Parameters:**
|
|
2480
|
+
|
|
2481
|
+
- `id` _(string)_: A UUID string identifying this network server.
|
|
2482
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2483
|
+
|
|
2484
|
+
**Returns:** `Promise<void>`
|
|
2485
|
+
|
|
2486
|
+
**Example:**
|
|
2487
|
+
|
|
2488
|
+
```typescript
|
|
2489
|
+
await client.networkServer.delete('a557d013-f6...');
|
|
2490
|
+
```
|
|
2491
|
+
|
|
2492
|
+
</details>
|