@openzeppelin/defender-sentinel-client
Advanced tools
Comparing version 1.47.0 to 1.47.1
@@ -1,2 +0,2 @@ | ||
import { BaseApiClient } from '@openzeppelin/defender-base-client'; | ||
import { BaseApiClient, Network } from '@openzeppelin/defender-base-client'; | ||
import { ExternalCreateSubscriberRequest as CreateSentinelRequest, ExternalUpdateSubscriberRequest as UpdateSentinelRequest } from '../models/subscriber'; | ||
@@ -7,2 +7,3 @@ import { DeletedSentinelResponse, CreateSentinelResponse, ListSentinelResponse } from '../models/response'; | ||
import { NotificationCategory as NotificationCategoryResponse, UpdateNotificationCategoryRequest } from '../models/category'; | ||
import { ListNetworkRequestOptions } from '../models/networks'; | ||
export declare class SentinelClient extends BaseApiClient { | ||
@@ -12,2 +13,3 @@ protected getPoolId(): string; | ||
protected getApiUrl(): string; | ||
listNetworks(opts?: ListNetworkRequestOptions): Promise<Network[]>; | ||
list(): Promise<ListSentinelResponse>; | ||
@@ -14,0 +16,0 @@ create(sentinel: CreateSentinelRequest): Promise<CreateSentinelResponse>; |
@@ -43,2 +43,7 @@ "use strict"; | ||
} | ||
async listNetworks(opts) { | ||
return this.apiCall(async (api) => { | ||
return await api.get(opts && opts.networkType ? `/networks?type=${opts.networkType}` : `/networks`); | ||
}); | ||
} | ||
async list() { | ||
@@ -45,0 +50,0 @@ return this.apiCall(async (api) => { |
{ | ||
"name": "@openzeppelin/defender-sentinel-client", | ||
"version": "1.47.0", | ||
"version": "1.47.1", | ||
"description": "", | ||
@@ -33,3 +33,3 @@ "main": "./lib/index.js", | ||
}, | ||
"gitHead": "12d67c544a12ff299c02fad3c8c1848e164e0e5b" | ||
"gitHead": "daddff62731a4b55075b57905d8c5b8c4eb3b80e" | ||
} |
@@ -376,2 +376,12 @@ # Defender Sentinel Client | ||
### List Networks | ||
To list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object: | ||
```js | ||
await client.listNetworks(); // lists all networks | ||
await client.listNetworks({ networkType: 'production' }); // lists only production networks | ||
await client.listNetworks({ networkType: 'test' }); // lists only test networks | ||
``` | ||
### Failed Requests | ||
@@ -378,0 +388,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153818
55
2326
412
1