Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions types/docusign-esign/docusign-esign-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,13 @@ const getDocumentWithCallback = async (envelopeId: string, documentId: string, o
const results = await envelopesApi.getDocument(params.accountId, envelopeId, documentId, options, callback);
return results;
};

const updateEnvelopeDocGenFormFields = async (envelopeId: string) => {
const params = await getDsRequestParams();
const client = await getClient(params.token);
const envelopesApi = new docusign.EnvelopesApi(client);

const formFields = await envelopesApi.getEnvelopeDocGenFormFields(params.accountId, envelopeId);
const results = await envelopesApi.updateEnvelopeDocGenFormFields(params.accountId, envelopeId, formFields);
return results;
};
7 changes: 7 additions & 0 deletions types/docusign-esign/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,13 @@ export class EnvelopesApi {
callback?: (() => void) | ((error: any, data: any, response: any) => void),
): Promise<EmailSettings>;

updateEnvelopeDocGenFormFields(
accountId: string,
envelopeId: string,
optsOrCallback?: any,
callback?: (() => void) | ((error: any, data: any, response: any) => void),
): Promise<DocGenFormFieldResponse>;

updateEnvelopeTransferRule(
accountId: string,
envelopeTransferRuleId: string,
Expand Down
94 changes: 93 additions & 1 deletion types/node-unifi/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,103 @@ declare namespace nodeUnifi {
[key: string]: any;
}

interface WlanStatsSubsystem {
subsystem: "wlan";
num_user: number;
num_guest: number;
num_iot: number;
"tx_bytes-r": number;
"rx_bytes-r": number;
status: string;
num_ap: number;
num_adopted: string;
num_disabled: number;
num_disconnected: number;
num_pending: number;
}

interface WanStatsSubsystem {
subsystem: "wan";
num_gw: number;
num_adopted: number;
num_disconnected: number;
num_pending: number;
status: string;
wan_ip: string;
gateways: string[];
netmask: string;
nameservers: string[];
num_sta: number;
"tx_bytes-r": number;
"rx_bytes-r": number;
gw_mac: string;
gw_name: string;
"gw_system-stats": { cpu: string; mem: string; uptime: string };
gw_version: string;
isp_name: string;
isp_organization: string;
uptime_stats: Record<string, unknown>;
}

interface WwwStatsSubsystem {
subsystem: "www";
status: string;
"tx_bytes-r": number;
"rx_bytes-r": number;
latency: number;
uptime: number;
drops: number;
xput_up: number;
xput_down: number;
speedtest_status: string;
speedtest_lastrun: number;
speedtest_ping: number;
gw_mac: string;
}

interface LanStatsSubsystem {
subsystem: "lan";
lap_ip: string | null;
status: string;
num_user: number;
num_guest: number;
num_iot: number;
"tx_bytes-r": number;
"rx_bytes-r": number;
num_sw: number;
num_adopted: number;
num_disconnected: number;
num_pending: number;
}

interface VpnStatsSubsystem {
subsystem: "vpn";
status: string;
remote_user_enabled: boolean;
remote_user_num_active: number;
remote_user_num_inactive: number;
remote_user_rx_bytes: number;
remote_user_tx_bytes: number;
remote_user_rx_packets: number;
remote_user_tx_packets: number;
site_to_site_enabled: boolean;
}

interface SiteStats {
_id: string;
external_id: string;
attr_no_delete: boolean;
attr_hidden_id: string;
name: string;
desc: string;
[key: string]: any;
num_new_alarms: number;
health: (
| WlanStatsSubsystem
| WanStatsSubsystem
| WwwStatsSubsystem
| LanStatsSubsystem
| VpnStatsSubsystem
)[];
}

interface GuestAuthorization {
Expand Down
136 changes: 136 additions & 0 deletions types/node-unifi/node-unifi-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import nodeUnifi, {
DeviceNameMapping,
FullStatus,
GuestAuthorization,
LanStatsSubsystem,
SelfInfo,
SiteStats,
SiteSysinfo,
UserGroup,
VpnStatsSubsystem,
WanStatsSubsystem,
WlanStatsSubsystem,
WwwStatsSubsystem,
} from "node-unifi";

// $ExpectType { Controller: typeof Controller; }
Expand Down Expand Up @@ -753,3 +758,134 @@ controller.customApiRequest("/api/s/default/stat/device");

// $ExpectType Promise<true>
controller.listen();

declare let stats: SiteStats;

// $ExpectType string
stats.external_id;
// ... and more test

// $ExpectType (WlanStatsSubsystem | WanStatsSubsystem | WwwStatsSubsystem | LanStatsSubsystem | VpnStatsSubsystem)[]
stats.health;

declare let wlanSubsystemHealthStats: WlanStatsSubsystem;
// $ExpectType "wlan"
wlanSubsystemHealthStats.subsystem;

declare let wwwSubsystemHealthStats: WwwStatsSubsystem;
// $ExpectType "www"
wwwSubsystemHealthStats.subsystem;
// $ExpectType number;
wwwSubsystemHealthStats.drops;
// $ExpectType string;
wwwSubsystemHealthStats.gw_mac;
// $ExpectType number;
wwwSubsystemHealthStats.latency;
// $ExpectType number;
wwwSubsystemHealthStats["rx_bytes-r"];
// $ExpectType number;
wwwSubsystemHealthStats.speedtest_lastrun;
// $ExpectType number;
wwwSubsystemHealthStats.speedtest_ping;
// $ExpectType string;
wwwSubsystemHealthStats.speedtest_status;
// $ExpectType string;
wwwSubsystemHealthStats.status;
// $ExpectType number;
wwwSubsystemHealthStats["tx_bytes-r"];
// $ExpectType number;
wwwSubsystemHealthStats.uptime;
// $ExpectType number;
wwwSubsystemHealthStats.xput_down;
// $ExpectType number;
wwwSubsystemHealthStats.xput_up;

declare let lanSubsystemHealthStats: LanStatsSubsystem;
// $ExpectType "lan"
lanSubsystemHealthStats.subsystem;
// $ExpectType string | null
lanSubsystemHealthStats.lap_ip;
// $ExpectType number
lanSubsystemHealthStats.num_adopted;
// $ExpectType number
lanSubsystemHealthStats.num_disconnected;
// $ExpectType number
lanSubsystemHealthStats.num_guest;
// $ExpectType number
lanSubsystemHealthStats.num_iot;
// $ExpectType number
lanSubsystemHealthStats.num_pending;
// $ExpectType number
lanSubsystemHealthStats.num_sw;
// $ExpectType number
lanSubsystemHealthStats.num_user;
// $ExpectType number
lanSubsystemHealthStats["rx_bytes-r"];
// $ExpectType string
lanSubsystemHealthStats.status;
// $ExpectType number
lanSubsystemHealthStats["tx_bytes-r"];

declare let vpnSubsystemHealthStats: VpnStatsSubsystem;
// $ExpectType "vpn"
vpnSubsystemHealthStats.subsystem;
// $ExpectType boolean
vpnSubsystemHealthStats.remote_user_enabled;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_num_active;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_num_inactive;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_rx_bytes;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_rx_packets;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_tx_bytes;
// $ExpectType number
vpnSubsystemHealthStats.remote_user_tx_packets;
// $ExpectType boolean
vpnSubsystemHealthStats.site_to_site_enabled;
// $ExpectType string
vpnSubsystemHealthStats.status;

declare let wanSubsystemHealthStats: WanStatsSubsystem;
// $ExpectType "wan"
wanSubsystemHealthStats.subsystem;
// $ExpectType string[]
wanSubsystemHealthStats.gateways;
// $ExpectType string
wanSubsystemHealthStats.gw_mac;
// $ExpectType string
wanSubsystemHealthStats.gw_name;
// $ExpectType { cpu: string, mem: string, uptime: string }
wanSubsystemHealthStats["gw_system-stats"];
// $ExpectType string
wanSubsystemHealthStats.gw_version;
// $ExpectType string
wanSubsystemHealthStats.isp_name;
// $ExpectType string
wanSubsystemHealthStats.isp_organization;
// $ExpectType string[]
wanSubsystemHealthStats.nameservers;
// $ExpectType string
wanSubsystemHealthStats.netmask;
// $ExpectType number
wanSubsystemHealthStats.num_adopted;
// $ExpectType number
wanSubsystemHealthStats.num_disconnected;
// $ExpectType number
wanSubsystemHealthStats.num_gw;
// $ExpectType number
wanSubsystemHealthStats.num_pending;
// $ExpectType number
wanSubsystemHealthStats.num_sta;
// $ExpectType number
wanSubsystemHealthStats["rx_bytes-r"];
// $ExpectType string
wanSubsystemHealthStats.status;
// $ExpectType number
wanSubsystemHealthStats["tx_bytes-r"];
// $ExpectType Record<string, unknown>
wanSubsystemHealthStats.uptime_stats;
// $ExpectType string
wanSubsystemHealthStats.wan_ip;