@iotopen/react-lynx 1.0.0 → 1.0.2-rc.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.
- package/README.md +1 -1
- package/dist/{cjs/Contexts → Contexts}/LynxClientProvider.d.ts +5 -4
- package/dist/Contexts/LynxProvider.d.ts +9 -0
- package/dist/{esm/Contexts → Contexts}/UserProvider.d.ts +2 -2
- package/dist/{esm/Contexts → Contexts}/index.d.ts +2 -2
- package/dist/{cjs/Hooks → Hooks}/index.d.ts +42 -26
- package/dist/Hooks/useCheckPermissions.d.ts +4 -0
- package/dist/{cjs/Hooks → Hooks}/useDevice.d.ts +4 -4
- package/dist/Hooks/useDevices.d.ts +9 -0
- package/dist/{esm/Hooks → Hooks}/useEdgeApp.d.ts +1 -1
- package/dist/{esm/Hooks → Hooks}/useFunction.d.ts +1 -1
- package/dist/Hooks/useFunctions.d.ts +9 -0
- package/dist/{cjs/Hooks → Hooks}/useInstallation.d.ts +1 -1
- package/dist/Hooks/useLiveInstallation.d.ts +10 -0
- package/dist/Hooks/useMQTT.d.ts +1 -0
- package/dist/Hooks/useMultiLiveInstallation.d.ts +11 -0
- package/dist/{esm/Hooks → Hooks}/useNewDevice.d.ts +4 -4
- package/dist/{esm/Hooks → Hooks}/useNewFunction.d.ts +4 -4
- package/dist/{esm/Hooks → Hooks}/useNewInstallation.d.ts +4 -4
- package/dist/{esm/Hooks → Hooks}/useNewNotificationMessage.d.ts +4 -4
- package/dist/{cjs/Hooks → Hooks}/useNewNotificationOutput.d.ts +4 -4
- package/dist/{esm/Hooks → Hooks}/useNewOAuth2Client.d.ts +4 -4
- package/dist/{esm/Hooks → Hooks}/useNewOrganization.d.ts +4 -4
- package/dist/{cjs/Hooks → Hooks}/useNewUser.d.ts +7 -8
- package/dist/{cjs/Hooks → Hooks}/useNotificationMessage.d.ts +1 -1
- package/dist/{esm/Hooks → Hooks}/useNotificationOutput.d.ts +1 -1
- package/dist/{cjs/Hooks → Hooks}/useNotificationOutputExecutor.d.ts +1 -1
- package/dist/{cjs/Hooks → Hooks}/useOAuth2Client.d.ts +2 -2
- package/dist/Hooks/useOAuth2Consent.d.ts +5 -0
- package/dist/{cjs/Hooks → Hooks}/useOrganization.d.ts +2 -2
- package/dist/{cjs/Hooks → Hooks}/useOrganizations.d.ts +3 -3
- package/dist/{esm/Hooks → Hooks}/usePahoMQTTClient.d.ts +2 -2
- package/dist/Hooks/useSimpleMQTT.d.ts +18 -0
- package/dist/{cjs/Hooks → Hooks}/useTokens.d.ts +1 -1
- package/dist/{esm/Hooks → Hooks}/useUser.d.ts +2 -2
- package/dist/{esm/Hooks → Hooks}/useUsers.d.ts +1 -1
- package/dist/cjs/index.js +1 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1427 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -439
- package/package.json +91 -48
- package/dist/cjs/Contexts/LynxProvider.d.ts +0 -8
- package/dist/cjs/Contexts/UserProvider.d.ts +0 -19
- package/dist/cjs/Contexts/index.d.ts +0 -3
- package/dist/cjs/Hooks/useDevices.d.ts +0 -10
- package/dist/cjs/Hooks/useEdgeApp.d.ts +0 -8
- package/dist/cjs/Hooks/useFunction.d.ts +0 -15
- package/dist/cjs/Hooks/useFunctions.d.ts +0 -10
- package/dist/cjs/Hooks/useNewDevice.d.ts +0 -12
- package/dist/cjs/Hooks/useNewFunction.d.ts +0 -12
- package/dist/cjs/Hooks/useNewInstallation.d.ts +0 -12
- package/dist/cjs/Hooks/useNewNotificationMessage.d.ts +0 -11
- package/dist/cjs/Hooks/useNewOAuth2Client.d.ts +0 -22
- package/dist/cjs/Hooks/useNewOrganization.d.ts +0 -18
- package/dist/cjs/Hooks/useNotificationOutput.d.ts +0 -10
- package/dist/cjs/Hooks/useOAuth2Consent.d.ts +0 -5
- package/dist/cjs/Hooks/usePahoMQTTClient.d.ts +0 -16
- package/dist/cjs/Hooks/useSimpleMQTT.d.ts +0 -12
- package/dist/cjs/Hooks/useUser.d.ts +0 -10
- package/dist/cjs/Hooks/useUsers.d.ts +0 -8
- package/dist/cjs/index.d.ts +0 -2
- package/dist/esm/Contexts/LynxClientProvider.d.ts +0 -14
- package/dist/esm/Contexts/LynxProvider.d.ts +0 -8
- package/dist/esm/Hooks/index.d.ts +0 -38
- package/dist/esm/Hooks/useConfiguredEdgeApps.d.ts +0 -7
- package/dist/esm/Hooks/useDevice.d.ts +0 -15
- package/dist/esm/Hooks/useDevices.d.ts +0 -10
- package/dist/esm/Hooks/useEdgeAppVersions.d.ts +0 -8
- package/dist/esm/Hooks/useEdgeApps.d.ts +0 -7
- package/dist/esm/Hooks/useFunctions.d.ts +0 -10
- package/dist/esm/Hooks/useIDTokenAlgorithms.d.ts +0 -7
- package/dist/esm/Hooks/useInstallation.d.ts +0 -9
- package/dist/esm/Hooks/useInstallationInfo.d.ts +0 -7
- package/dist/esm/Hooks/useInstallations.d.ts +0 -7
- package/dist/esm/Hooks/useMeta.d.ts +0 -15
- package/dist/esm/Hooks/useNewNotificationOutput.d.ts +0 -15
- package/dist/esm/Hooks/useNewUser.d.ts +0 -27
- package/dist/esm/Hooks/useNotificationMessage.d.ts +0 -10
- package/dist/esm/Hooks/useNotificationMessages.d.ts +0 -7
- package/dist/esm/Hooks/useNotificationOutputExecutor.d.ts +0 -8
- package/dist/esm/Hooks/useNotificationOutputExecutors.d.ts +0 -7
- package/dist/esm/Hooks/useNotificationOutputs.d.ts +0 -7
- package/dist/esm/Hooks/useOAuth2Client.d.ts +0 -10
- package/dist/esm/Hooks/useOAuth2Clients.d.ts +0 -7
- package/dist/esm/Hooks/useOAuth2Consent.d.ts +0 -5
- package/dist/esm/Hooks/useOrganization.d.ts +0 -10
- package/dist/esm/Hooks/useOrganizations.d.ts +0 -9
- package/dist/esm/Hooks/useRoles.d.ts +0 -7
- package/dist/esm/Hooks/useSimpleMQTT.d.ts +0 -12
- package/dist/esm/Hooks/useTokens.d.ts +0 -9
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/types.d.ts +0 -1
- /package/dist/{cjs/Hooks → Hooks}/useConfiguredEdgeApps.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useEdgeAppVersions.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useEdgeApps.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useIDTokenAlgorithms.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useInstallationInfo.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useInstallations.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useMeta.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useNotificationMessages.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useNotificationOutputExecutors.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useNotificationOutputs.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useOAuth2Clients.d.ts +0 -0
- /package/dist/{cjs/Hooks → Hooks}/useRoles.d.ts +0 -0
- /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,13 +2,14 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { LynxClient } from '@iotopen/node-lynx';
|
|
3
3
|
interface lynxClientContext {
|
|
4
4
|
lynxClient: LynxClient;
|
|
5
|
-
newLynxClient: (url: string, apiKey?: string) => void;
|
|
5
|
+
newLynxClient: (url: string, apiKey?: string, bearer?: boolean) => void;
|
|
6
6
|
}
|
|
7
7
|
interface LynxClientProviderProps {
|
|
8
8
|
children?: ReactNode;
|
|
9
|
-
url?: string;
|
|
10
|
-
apiKey?: string;
|
|
9
|
+
url?: string | undefined;
|
|
10
|
+
apiKey?: string | undefined;
|
|
11
|
+
bearer?: boolean | undefined;
|
|
11
12
|
}
|
|
12
|
-
export declare const LynxClientProvider: ({ children, url, apiKey }: LynxClientProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const LynxClientProvider: ({ children, url, apiKey, bearer }: LynxClientProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const useGlobalLynxClient: () => lynxClientContext;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface LynxProviderProps {
|
|
3
|
+
apiURL?: string;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
bearer?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const LynxProvider: ({ children, apiURL, apiKey, bearer }: LynxProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -13,7 +13,7 @@ interface UserProviderProps {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const UserProvider: ({ children }: UserProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare const useGlobalUser: () => userContext;
|
|
16
|
-
export declare const useGlobalPermissions: () =>
|
|
16
|
+
export declare const useGlobalPermissions: () => {
|
|
17
17
|
[key: string]: boolean;
|
|
18
|
-
} | null
|
|
18
|
+
} | null;
|
|
19
19
|
export {};
|
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export type { Permission } from './useCheckPermissions';
|
|
2
|
+
export * from './useCheckPermissions';
|
|
3
|
+
export * from './useConfiguredEdgeApps';
|
|
4
|
+
export * from './useDevice';
|
|
5
|
+
export * from './useDevices';
|
|
6
|
+
export * from './useEdgeApp';
|
|
7
|
+
export * from './useEdgeApps';
|
|
8
|
+
export * from './useEdgeAppVersions';
|
|
8
9
|
export * from './useFunction';
|
|
10
|
+
export * from './useFunctions';
|
|
11
|
+
export * from './useIDTokenAlgorithms';
|
|
9
12
|
export * from './useInstallation';
|
|
13
|
+
export * from './useInstallationInfo';
|
|
10
14
|
export * from './useInstallations';
|
|
11
|
-
export
|
|
15
|
+
export type { LiveInstallation } from './useLiveInstallation';
|
|
16
|
+
export * from './useLiveInstallation';
|
|
17
|
+
export * from './useMeta';
|
|
18
|
+
export * from './useMQTT';
|
|
19
|
+
export type { MultiLiveInstallation } from './useMultiLiveInstallation';
|
|
20
|
+
export * from './useMultiLiveInstallation';
|
|
21
|
+
export type { DeviceTemplate } from './useNewDevice';
|
|
12
22
|
export * from './useNewDevice';
|
|
13
|
-
export
|
|
14
|
-
export * from './
|
|
15
|
-
export
|
|
16
|
-
export * from './
|
|
17
|
-
export
|
|
18
|
-
export * from './
|
|
23
|
+
export type { FunctionTemplate } from './useNewFunction';
|
|
24
|
+
export * from './useNewFunction';
|
|
25
|
+
export type { InstallationTemplate } from './useNewInstallation';
|
|
26
|
+
export * from './useNewInstallation';
|
|
27
|
+
export type { NotificationMessageTemplate } from './useNewNotificationMessage';
|
|
28
|
+
export * from './useNewNotificationMessage';
|
|
29
|
+
export type { NotificationOutputTemplate } from './useNewNotificationOutput';
|
|
30
|
+
export * from './useNewNotificationOutput';
|
|
31
|
+
export type { OAuth2ClientTemplate } from './useNewOAuth2Client';
|
|
19
32
|
export * from './useNewOAuth2Client';
|
|
20
|
-
export
|
|
21
|
-
export * from './useOAuth2Clients';
|
|
22
|
-
export * from './useOAuth2Consent';
|
|
23
|
-
export * from './useIDTokenAlgorithms';
|
|
24
|
-
export * from './useOrganization';
|
|
25
|
-
export * from './useOrganizations';
|
|
33
|
+
export type { OrganizationTemplate } from './useNewOrganization';
|
|
26
34
|
export * from './useNewOrganization';
|
|
35
|
+
export type { UserTemplate } from './useNewUser';
|
|
27
36
|
export * from './useNewUser';
|
|
28
|
-
export * from './useUsers';
|
|
29
|
-
export * from './useUser';
|
|
30
|
-
export * from './useRoles';
|
|
31
|
-
export * from './useNewNotificationMessage';
|
|
32
37
|
export * from './useNotificationMessage';
|
|
33
38
|
export * from './useNotificationMessages';
|
|
34
|
-
export * from './useNewNotificationOutput';
|
|
35
39
|
export * from './useNotificationOutput';
|
|
36
|
-
export * from './useNotificationOutputs';
|
|
37
40
|
export * from './useNotificationOutputExecutor';
|
|
38
41
|
export * from './useNotificationOutputExecutors';
|
|
42
|
+
export * from './useNotificationOutputs';
|
|
43
|
+
export * from './useOAuth2Client';
|
|
44
|
+
export * from './useOAuth2Clients';
|
|
45
|
+
export * from './useOAuth2Consent';
|
|
46
|
+
export * from './useOrganization';
|
|
47
|
+
export * from './useOrganizations';
|
|
48
|
+
export * from './usePahoMQTTClient';
|
|
49
|
+
export * from './useRoles';
|
|
50
|
+
export type { Binder, Binding, ExactBinder, ExactUnbinder, Publisher, SimpleMQTT, Unbinder } from './useSimpleMQTT';
|
|
51
|
+
export * from './useSimpleMQTT';
|
|
52
|
+
export * from './useTokens';
|
|
53
|
+
export * from './useUser';
|
|
54
|
+
export * from './useUsers';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Permissions } from '@iotopen/node-lynx';
|
|
2
|
+
export type Permission = Permissions | string;
|
|
3
|
+
export declare const usePermissionsCheckAll: (...permissions: Permission[]) => boolean;
|
|
4
|
+
export declare const usePermissionsCheckAny: (...permissions: Permission[]) => boolean;
|
|
@@ -3,13 +3,13 @@ export declare const useDevice: (installationId: number | string, deviceId: numb
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error: ErrorResponse | undefined;
|
|
5
5
|
Device: Devicex;
|
|
6
|
-
setDevice: import(
|
|
6
|
+
setDevice: import('react').Dispatch<import('react').SetStateAction<Devicex>>;
|
|
7
7
|
update: () => Promise<Devicex>;
|
|
8
8
|
remove: () => Promise<OKResponse>;
|
|
9
9
|
setType: (t: string) => void;
|
|
10
10
|
};
|
|
11
11
|
export declare const useDeviceMeta: (installationId: number | string, deviceId?: number | string) => {
|
|
12
|
-
createMeta: (key: string, meta: MetaObject,
|
|
13
|
-
updateMeta: (key: string, meta: MetaObject, createMissing?: boolean,
|
|
14
|
-
removeMeta: (key: string,
|
|
12
|
+
createMeta: (key: string, meta: MetaObject, overrideDevId?: number, silent?: boolean) => Promise<MetaObject>;
|
|
13
|
+
updateMeta: (key: string, meta: MetaObject, createMissing?: boolean, overrideDevId?: number, silent?: boolean) => Promise<MetaObject>;
|
|
14
|
+
removeMeta: (key: string, overrideDevId?: number, silent?: boolean) => Promise<MetaObject>;
|
|
15
15
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Devicex, ErrorResponse, Metadata } from '@iotopen/node-lynx';
|
|
2
|
+
export declare const useDevices: (installationId: number | string, filter?: Metadata) => {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: ErrorResponse | undefined;
|
|
5
|
+
create: (...args: any[]) => any;
|
|
6
|
+
remove: (...args: any[]) => any;
|
|
7
|
+
devices: Devicex[];
|
|
8
|
+
refresh: () => void;
|
|
9
|
+
};
|
|
@@ -3,6 +3,6 @@ export declare const useEdgeApp: (appId: number | string) => {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error: ErrorResponse | undefined;
|
|
5
5
|
app: EdgeApp;
|
|
6
|
-
setApp: import(
|
|
6
|
+
setApp: import('react').Dispatch<import('react').SetStateAction<EdgeApp>>;
|
|
7
7
|
refresh: () => void;
|
|
8
8
|
};
|
|
@@ -3,7 +3,7 @@ export declare const useFunction: (installationId: number | string, functionId:
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error: ErrorResponse | undefined;
|
|
5
5
|
Function: Functionx;
|
|
6
|
-
setFunction: import(
|
|
6
|
+
setFunction: import('react').Dispatch<import('react').SetStateAction<Functionx>>;
|
|
7
7
|
update: () => Promise<Functionx>;
|
|
8
8
|
remove: () => Promise<OKResponse>;
|
|
9
9
|
setType: (t: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorResponse, Functionx, Metadata } from '@iotopen/node-lynx';
|
|
2
|
+
export declare const useFunctions: (installationId: number | string, filter?: Metadata) => {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: ErrorResponse | undefined;
|
|
5
|
+
create: (...args: any[]) => any;
|
|
6
|
+
remove: (...args: any[]) => any;
|
|
7
|
+
functions: Functionx[];
|
|
8
|
+
refresh: () => void;
|
|
9
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Installation } from '@iotopen/node-lynx';
|
|
2
2
|
export declare const useInstallation: (installationId: number | string) => {
|
|
3
3
|
installation: Installation;
|
|
4
|
-
setInstallation: import(
|
|
4
|
+
setInstallation: import('react').Dispatch<import('react').SetStateAction<Installation>>;
|
|
5
5
|
update: () => Promise<Installation>;
|
|
6
6
|
remove: () => Promise<Installation>;
|
|
7
7
|
error: Error | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Devicex, Functionx, Installation } from '@iotopen/node-lynx';
|
|
2
|
+
import { SimpleMQTT } from './useSimpleMQTT';
|
|
3
|
+
export interface LiveInstallation {
|
|
4
|
+
installation: Installation;
|
|
5
|
+
functions: Functionx[];
|
|
6
|
+
devices: Devicex[];
|
|
7
|
+
mqtt: SimpleMQTT;
|
|
8
|
+
}
|
|
9
|
+
export declare const useLiveInstallation: (installation: Installation) => LiveInstallation;
|
|
10
|
+
export declare const useLiveInstallationId: (installationId: number | string) => LiveInstallation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMQTT: () => import('./useSimpleMQTT').SimpleMQTT;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Devicex, Functionx, Installation } from '@iotopen/node-lynx';
|
|
2
|
+
import { SimpleMQTT } from './useSimpleMQTT';
|
|
3
|
+
export interface MultiLiveInstallation {
|
|
4
|
+
installationMap: Map<number, Installation>;
|
|
5
|
+
functionMap: Map<number, Functionx[]>;
|
|
6
|
+
deviceMap: Map<number, Devicex[]>;
|
|
7
|
+
mqtt: SimpleMQTT;
|
|
8
|
+
toClientId: (iid: number) => number;
|
|
9
|
+
toInstallationId: (cid: number) => number;
|
|
10
|
+
}
|
|
11
|
+
export declare const useMultiLiveInstallation: (installations: Installation[]) => MultiLiveInstallation;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EmptyDevicex, Metadata } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface DeviceTemplate {
|
|
3
3
|
type?: string;
|
|
4
4
|
meta?: Metadata;
|
|
5
5
|
protected_meta?: Metadata;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
export declare const useNewDevice: (installationId: number | string, template?: DeviceTemplate) => {
|
|
8
8
|
newDevice: EmptyDevicex;
|
|
9
|
-
setNewDevice: import(
|
|
10
|
-
create: () => Promise<import(
|
|
9
|
+
setNewDevice: import('react').Dispatch<import('react').SetStateAction<EmptyDevicex>>;
|
|
10
|
+
create: () => Promise<import('@iotopen/node-lynx').Devicex>;
|
|
11
11
|
setType: (t: string) => void;
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EmptyFunctionx, Metadata } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface FunctionTemplate {
|
|
3
3
|
type?: string;
|
|
4
4
|
meta?: Metadata;
|
|
5
5
|
protected_meta?: Metadata;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
export declare const useNewFunction: (installationId: number | string, template?: FunctionTemplate) => {
|
|
8
8
|
newFunction: EmptyFunctionx;
|
|
9
|
-
setNewFunction: import(
|
|
10
|
-
create: () => Promise<import(
|
|
9
|
+
setNewFunction: import('react').Dispatch<import('react').SetStateAction<EmptyFunctionx>>;
|
|
10
|
+
create: () => Promise<import('@iotopen/node-lynx').Functionx>;
|
|
11
11
|
setType: (t: string) => void;
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EmptyInstallation, Metadata } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface InstallationTemplate {
|
|
3
3
|
name?: string;
|
|
4
4
|
notes?: string;
|
|
5
5
|
meta?: Metadata;
|
|
6
6
|
protected_meta?: Metadata;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
export declare const useNewInstallation: (organizationId: number | string, template?: InstallationTemplate) => {
|
|
9
9
|
newInstallation: EmptyInstallation;
|
|
10
|
-
setNewInstallation: import(
|
|
11
|
-
create: () => Promise<import(
|
|
10
|
+
setNewInstallation: import('react').Dispatch<import('react').SetStateAction<EmptyInstallation>>;
|
|
11
|
+
create: () => Promise<import('@iotopen/node-lynx').Installation>;
|
|
12
12
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EmptyNotificationMessage } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface NotificationMessageTemplate {
|
|
3
3
|
installation_id?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
text?: string;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
export declare const useNewNotificationMessage: (installationId: number | string, template?: NotificationMessageTemplate) => {
|
|
8
8
|
newNotificationMessage: EmptyNotificationMessage;
|
|
9
|
-
setNewNotificationMessage: import(
|
|
10
|
-
create: () => Promise<import(
|
|
9
|
+
setNewNotificationMessage: import('react').Dispatch<import('react').SetStateAction<EmptyNotificationMessage>>;
|
|
10
|
+
create: () => Promise<import('@iotopen/node-lynx').NotificationMessage>;
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmptyNotificationOutput } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface NotificationOutputTemplate {
|
|
3
3
|
installation_id?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
notification_message_id?: number;
|
|
@@ -7,9 +7,9 @@ export type NotificationOutputTemplate = {
|
|
|
7
7
|
config?: {
|
|
8
8
|
[key: string]: string;
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export declare const useNewNotificationOutput: (installationId: number | string, template?: NotificationOutputTemplate) => {
|
|
12
12
|
newNotificationOutput: EmptyNotificationOutput;
|
|
13
|
-
setNewNotificationOutput: import(
|
|
14
|
-
create: () => Promise<import(
|
|
13
|
+
setNewNotificationOutput: import('react').Dispatch<import('react').SetStateAction<EmptyNotificationOutput>>;
|
|
14
|
+
create: () => Promise<import('@iotopen/node-lynx').NotificationOutput>;
|
|
15
15
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmptyOAuth2Client } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface OAuth2ClientTemplate {
|
|
3
3
|
name?: string;
|
|
4
4
|
trusted?: boolean;
|
|
5
5
|
allowed_scopes?: string[];
|
|
@@ -8,15 +8,15 @@ export type OAuth2ClientTemplate = {
|
|
|
8
8
|
policy_uri?: string;
|
|
9
9
|
redirect_uris?: string[];
|
|
10
10
|
id_token_alg?: string;
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
export declare const useNewOAuth2Client: (template?: OAuth2ClientTemplate) => {
|
|
13
13
|
newClient: EmptyOAuth2Client;
|
|
14
|
-
create: () => Promise<import(
|
|
14
|
+
create: () => Promise<import('@iotopen/node-lynx').OAuth2Client>;
|
|
15
15
|
setName: (name: string) => void;
|
|
16
16
|
setScope: (scopes: string[]) => void;
|
|
17
17
|
setIconURI: (uri: string) => void;
|
|
18
18
|
setTosURI: (uri: string) => void;
|
|
19
19
|
setPolicyURI: (uri: string) => void;
|
|
20
20
|
setRedirectURIs: (uris: string[]) => void;
|
|
21
|
-
setClient: import(
|
|
21
|
+
setClient: import('react').Dispatch<import('react').SetStateAction<EmptyOAuth2Client>>;
|
|
22
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, EmptyOrganization, Metadata, OrganizationChild } from '@iotopen/node-lynx';
|
|
2
|
-
export
|
|
2
|
+
export interface OrganizationTemplate {
|
|
3
3
|
address?: Address;
|
|
4
4
|
children?: OrganizationChild[];
|
|
5
5
|
email?: string;
|
|
@@ -10,9 +10,9 @@ export type OrganizationTemplate = {
|
|
|
10
10
|
password_valid_days?: number;
|
|
11
11
|
meta?: Metadata;
|
|
12
12
|
protected_meta?: Metadata;
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
export declare const useNewOrganization: (parentId: number | string, template?: OrganizationTemplate) => {
|
|
15
15
|
newOrganization: EmptyOrganization;
|
|
16
|
-
setNewOrganization: import(
|
|
17
|
-
create: () => Promise<import(
|
|
16
|
+
setNewOrganization: import('react').Dispatch<import('react').SetStateAction<EmptyOrganization>>;
|
|
17
|
+
create: () => Promise<import('@iotopen/node-lynx').Organization>;
|
|
18
18
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { EmptyUser } from '@iotopen/node-lynx';
|
|
2
|
-
|
|
3
|
-
export type UserTemplate = {
|
|
1
|
+
import { Address, EmptyUser } from '@iotopen/node-lynx';
|
|
2
|
+
export interface UserTemplate {
|
|
4
3
|
email?: string;
|
|
5
4
|
password?: string;
|
|
6
5
|
first_name?: string;
|
|
@@ -14,14 +13,14 @@ export type UserTemplate = {
|
|
|
14
13
|
address?: Address;
|
|
15
14
|
expire_at?: number;
|
|
16
15
|
meta?: {
|
|
17
|
-
[key: string]:
|
|
16
|
+
[key: string]: unknown;
|
|
18
17
|
};
|
|
19
18
|
protected_meta?: {
|
|
20
|
-
[key: string]:
|
|
19
|
+
[key: string]: unknown;
|
|
21
20
|
};
|
|
22
|
-
}
|
|
21
|
+
}
|
|
23
22
|
export declare const useNewUser: (template?: UserTemplate) => {
|
|
24
23
|
newUser: EmptyUser;
|
|
25
|
-
setNewUser: import(
|
|
26
|
-
create: () => Promise<import(
|
|
24
|
+
setNewUser: import('react').Dispatch<import('react').SetStateAction<EmptyUser>>;
|
|
25
|
+
create: () => Promise<import('@iotopen/node-lynx').User>;
|
|
27
26
|
};
|
|
@@ -2,7 +2,7 @@ import { ErrorResponse, NotificationMessage } from '@iotopen/node-lynx';
|
|
|
2
2
|
export declare const useNotificationMessage: (installationId: number | string, notificationId: number | string) => {
|
|
3
3
|
refresh: () => void;
|
|
4
4
|
message: NotificationMessage;
|
|
5
|
-
setMessage: import(
|
|
5
|
+
setMessage: import('react').Dispatch<import('react').SetStateAction<NotificationMessage>>;
|
|
6
6
|
error: ErrorResponse | undefined;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
remove: () => void;
|
|
@@ -2,7 +2,7 @@ import { ErrorResponse, NotificationOutput } from '@iotopen/node-lynx';
|
|
|
2
2
|
export declare const useNotificationOutput: (installationId: number | string, notificationId: number | string) => {
|
|
3
3
|
refresh: () => void;
|
|
4
4
|
output: NotificationOutput;
|
|
5
|
-
setOutput: import(
|
|
5
|
+
setOutput: import('react').Dispatch<import('react').SetStateAction<NotificationOutput>>;
|
|
6
6
|
error: ErrorResponse | undefined;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
remove: () => void;
|
|
@@ -2,7 +2,7 @@ import { ErrorResponse, NotificationOutputExecutor } from '@iotopen/node-lynx';
|
|
|
2
2
|
export declare const useNotificationOutputExecutor: (installationId: number | string, executorId: number | string) => {
|
|
3
3
|
refresh: () => void;
|
|
4
4
|
outputExecutor: NotificationOutputExecutor;
|
|
5
|
-
setOutputExecutor: import(
|
|
5
|
+
setOutputExecutor: import('react').Dispatch<import('react').SetStateAction<NotificationOutputExecutor>>;
|
|
6
6
|
error: ErrorResponse | undefined;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
};
|
|
@@ -2,9 +2,9 @@ import { ErrorResponse, OAuth2Client } from '@iotopen/node-lynx';
|
|
|
2
2
|
export declare const useOAuth2Client: (id: string) => {
|
|
3
3
|
refresh: () => void;
|
|
4
4
|
client: OAuth2Client;
|
|
5
|
-
setClient: import(
|
|
5
|
+
setClient: import('react').Dispatch<import('react').SetStateAction<OAuth2Client>>;
|
|
6
6
|
error: ErrorResponse | undefined;
|
|
7
7
|
loading: boolean;
|
|
8
|
-
remove: () => Promise<import(
|
|
8
|
+
remove: () => Promise<import('@iotopen/node-lynx').OKResponse>;
|
|
9
9
|
update: () => Promise<OAuth2Client>;
|
|
10
10
|
};
|
|
@@ -2,9 +2,9 @@ import { Organization } from '@iotopen/node-lynx';
|
|
|
2
2
|
export declare const useOrganization: (organizationId: number | string) => {
|
|
3
3
|
loading: boolean;
|
|
4
4
|
organization: Organization;
|
|
5
|
-
setOrganization: import(
|
|
5
|
+
setOrganization: import('react').Dispatch<import('react').SetStateAction<Organization>>;
|
|
6
6
|
error: Error | undefined;
|
|
7
7
|
update: () => Promise<Organization>;
|
|
8
|
-
remove: () => Promise<import(
|
|
8
|
+
remove: () => Promise<import('@iotopen/node-lynx').OKResponse>;
|
|
9
9
|
refresh: () => void;
|
|
10
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ErrorResponse, MinimalOrg, Organization } from '@iotopen/node-lynx';
|
|
2
|
-
export declare const useOrganizations: <T extends boolean = false>(minimal?: T
|
|
2
|
+
export declare const useOrganizations: <T extends boolean = false>(minimal?: T) => {
|
|
3
3
|
loading: boolean;
|
|
4
4
|
organizations: MinimalOrg<T>[];
|
|
5
|
-
setOrganizations: import(
|
|
5
|
+
setOrganizations: import('react').Dispatch<import('react').SetStateAction<MinimalOrg<T>[]>>;
|
|
6
6
|
error: ErrorResponse | undefined;
|
|
7
7
|
create: (org: Organization) => Promise<Organization>;
|
|
8
|
-
remove: (org: Organization) => Promise<import(
|
|
8
|
+
remove: (org: Organization) => Promise<import('@iotopen/node-lynx').OKResponse>;
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Paho,
|
|
1
|
+
import { default as Paho, Qos, TypedArray } from 'paho-mqtt';
|
|
2
2
|
interface MQTTHandlers {
|
|
3
3
|
onMessage?: Paho.OnMessageHandler;
|
|
4
4
|
onDelivery?: Paho.OnMessageHandler;
|
|
@@ -6,7 +6,7 @@ interface MQTTHandlers {
|
|
|
6
6
|
onDisconnect?: Paho.OnConnectionLostHandler;
|
|
7
7
|
}
|
|
8
8
|
export declare const usePahoMQTTClient: (uri: string, handlers?: MQTTHandlers, connectionOptions?: Paho.ConnectionOptions, clientId?: string) => {
|
|
9
|
-
client: import(
|
|
9
|
+
client: import('react').RefObject<Paho.Client>;
|
|
10
10
|
connected: boolean;
|
|
11
11
|
error: Paho.MQTTError | undefined;
|
|
12
12
|
sub: (topic: string, qos?: Qos) => Promise<Paho.Qos>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Qos, TypedArray, default as Paho } from 'paho-mqtt';
|
|
2
|
+
export type Binding = (topic: string, payload: string, qos: Qos, retained: boolean) => void;
|
|
3
|
+
export type Binder = (topic: RegExp | string, binder: Binding) => void;
|
|
4
|
+
export type Unbinder = (binder: Binding) => void;
|
|
5
|
+
export type ExactBinder = (topic: string, binder: Binding) => void;
|
|
6
|
+
export type ExactUnbinder = (topic: string, binder: Binding) => void;
|
|
7
|
+
export type Publisher = (topic: string, payload: string | TypedArray, qos?: Qos, retained?: boolean) => void;
|
|
8
|
+
export interface SimpleMQTT {
|
|
9
|
+
setSubs: (subscriptions: string[]) => void;
|
|
10
|
+
error?: Paho.MQTTError;
|
|
11
|
+
connected: boolean;
|
|
12
|
+
bind: Binder;
|
|
13
|
+
unbind: Unbinder;
|
|
14
|
+
bindExact: ExactBinder;
|
|
15
|
+
unbindExact: ExactUnbinder;
|
|
16
|
+
pub: Publisher;
|
|
17
|
+
}
|
|
18
|
+
export declare const useSimpleMQTT: (uri?: string, username?: string, password?: string) => SimpleMQTT;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmptyToken, ErrorResponse, Token } from '@iotopen/node-lynx';
|
|
2
2
|
export declare const useTokens: () => {
|
|
3
3
|
tokens: Token[];
|
|
4
|
-
remove: (token: Token) => Promise<import(
|
|
4
|
+
remove: (token: Token) => Promise<import('@iotopen/node-lynx').OKResponse>;
|
|
5
5
|
create: (token: EmptyToken) => Promise<Token>;
|
|
6
6
|
refresh: () => void;
|
|
7
7
|
loading: boolean;
|
|
@@ -3,8 +3,8 @@ export declare const useUser: (userId: number | string) => {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error: Error | undefined;
|
|
5
5
|
user: User;
|
|
6
|
-
setUser: import(
|
|
6
|
+
setUser: import('react').Dispatch<import('react').SetStateAction<User>>;
|
|
7
7
|
update: () => Promise<User>;
|
|
8
8
|
refresh: () => void;
|
|
9
|
-
remove: () => Promise<import(
|
|
9
|
+
remove: () => Promise<import('@iotopen/node-lynx').OKResponse>;
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Metadata, User } from '@iotopen/node-lynx';
|
|
2
2
|
export declare const useUsers: (filter?: Metadata) => {
|
|
3
3
|
users: User[];
|
|
4
|
-
setUsers: import(
|
|
4
|
+
setUsers: import('react').Dispatch<import('react').SetStateAction<User[]>>;
|
|
5
5
|
refresh: () => void;
|
|
6
6
|
loading: boolean;
|
|
7
7
|
error: Error | undefined;
|