@chainpatrol/sdk 0.5.0 → 0.6.0

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 CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  Typescript SDK for ChainPatrol.
4
4
 
5
- [Documentation](https://chainpatrol.io/docs/sdk/overview)
5
+ [Documentation](https://chainpatrol.com/docs/sdk/overview)
package/dist/index.d.mts CHANGED
@@ -85,7 +85,7 @@ declare class ChainPatrolClient {
85
85
  };
86
86
  }
87
87
 
88
- interface Storage {
88
+ interface Storage$1 {
89
89
  get: (key: string) => Promise<string | null>;
90
90
  set: (key: string, value: string) => Promise<void>;
91
91
  delete: (key: string) => Promise<void>;
@@ -108,11 +108,6 @@ declare class DomainParseError extends Error {
108
108
  constructor(message: string);
109
109
  }
110
110
  declare class ThreatDetector {
111
- static StorageKeys: {
112
- ALLOWLIST: string;
113
- BLOCKLIST: string;
114
- IGNORELIST: string;
115
- };
116
111
  private static readonly CHAINPATROL_WARNING_URL;
117
112
  private static readonly Schema;
118
113
  private mode;
@@ -122,20 +117,20 @@ declare class ThreatDetector {
122
117
  private readonly logger;
123
118
  constructor({ mode, storage, redirectUrl, }: {
124
119
  mode: "local";
125
- storage?: Storage;
120
+ storage?: Storage$1;
126
121
  redirectUrl?: string | ((url: string) => string);
127
122
  });
128
123
  constructor({ mode, apiKey, storage, redirectUrl, }: {
129
124
  mode: "cloud";
130
125
  apiKey: string;
131
- storage?: Storage;
126
+ storage?: Storage$1;
132
127
  redirectUrl?: string | ((url: string) => string);
133
128
  });
134
129
  constructor({ mode, apiKey, proxyUrl, storage, redirectUrl, }: {
135
130
  mode: "cloud";
136
131
  apiKey: string;
137
132
  proxyUrl?: string;
138
- storage?: Storage;
133
+ storage?: Storage$1;
139
134
  redirectUrl?: string | ((url: string) => string);
140
135
  });
141
136
  url(url: string): Promise<URLResult>;
@@ -175,39 +170,25 @@ declare class ThreatDetector {
175
170
  private getStatusFromCache;
176
171
  }
177
172
 
178
- declare const Extension: () => {
179
- get: (key: string) => Promise<any>;
180
- set: (key: string, value: string) => Promise<void>;
181
- delete: (key: string) => Promise<void>;
182
- size: () => Promise<number>;
183
- };
184
-
185
- declare const Browser: () => {
186
- get: (key: string) => Promise<string | null>;
187
- set: (key: string, value: string) => Promise<void>;
188
- delete: (key: string) => Promise<void>;
189
- size: () => Promise<number>;
190
- };
191
-
192
- declare const Memory: () => {
193
- get: (key: string) => Promise<string | null>;
194
- set: (key: string, value: string) => Promise<void>;
195
- delete: (key: string) => Promise<void>;
196
- size: () => Promise<number>;
173
+ declare const Storage: {
174
+ Memory: () => {
175
+ get: (key: string) => Promise<string | null>;
176
+ set: (key: string, value: string) => Promise<void>;
177
+ delete: (key: string) => Promise<void>;
178
+ size: () => Promise<number>;
179
+ };
180
+ Extension: () => {
181
+ get: (key: string) => Promise<any>;
182
+ set: (key: string, value: string) => Promise<void>;
183
+ delete: (key: string) => Promise<void>;
184
+ size: () => Promise<number>;
185
+ };
186
+ Browser: () => {
187
+ get: (key: string) => Promise<string | null>;
188
+ set: (key: string, value: string) => Promise<void>;
189
+ delete: (key: string) => Promise<void>;
190
+ size: () => Promise<number>;
191
+ };
197
192
  };
198
193
 
199
- interface Context {
200
- keys: string[];
201
- }
202
- declare function defineStorage<T extends Storage>(config: (ctx: Context) => T): () => T;
203
-
204
- declare const index_Browser: typeof Browser;
205
- declare const index_Extension: typeof Extension;
206
- declare const index_Memory: typeof Memory;
207
- type index_Storage = Storage;
208
- declare const index_defineStorage: typeof defineStorage;
209
- declare namespace index {
210
- export { index_Browser as Browser, index_Extension as Extension, index_Memory as Memory, type index_Storage as Storage, index_defineStorage as defineStorage };
211
- }
212
-
213
- export { type AssetStatus, type AssetType, ChainPatrolClient, ChainPatrolClientError, ChainPatrolClientErrorCodes, type ChainPatrolClientOptions, type DetectorAssetStatus, DomainParseError, type EventData, Events, Relay, index as Storage, ThreatDetector, type URLResult };
194
+ export { type AssetStatus, type AssetType, ChainPatrolClient, ChainPatrolClientError, ChainPatrolClientErrorCodes, type ChainPatrolClientOptions, type DetectorAssetStatus, DomainParseError, type EventData, Events, Relay, Storage, ThreatDetector, type URLResult };
package/dist/index.d.ts CHANGED
@@ -85,7 +85,7 @@ declare class ChainPatrolClient {
85
85
  };
86
86
  }
87
87
 
88
- interface Storage {
88
+ interface Storage$1 {
89
89
  get: (key: string) => Promise<string | null>;
90
90
  set: (key: string, value: string) => Promise<void>;
91
91
  delete: (key: string) => Promise<void>;
@@ -108,11 +108,6 @@ declare class DomainParseError extends Error {
108
108
  constructor(message: string);
109
109
  }
110
110
  declare class ThreatDetector {
111
- static StorageKeys: {
112
- ALLOWLIST: string;
113
- BLOCKLIST: string;
114
- IGNORELIST: string;
115
- };
116
111
  private static readonly CHAINPATROL_WARNING_URL;
117
112
  private static readonly Schema;
118
113
  private mode;
@@ -122,20 +117,20 @@ declare class ThreatDetector {
122
117
  private readonly logger;
123
118
  constructor({ mode, storage, redirectUrl, }: {
124
119
  mode: "local";
125
- storage?: Storage;
120
+ storage?: Storage$1;
126
121
  redirectUrl?: string | ((url: string) => string);
127
122
  });
128
123
  constructor({ mode, apiKey, storage, redirectUrl, }: {
129
124
  mode: "cloud";
130
125
  apiKey: string;
131
- storage?: Storage;
126
+ storage?: Storage$1;
132
127
  redirectUrl?: string | ((url: string) => string);
133
128
  });
134
129
  constructor({ mode, apiKey, proxyUrl, storage, redirectUrl, }: {
135
130
  mode: "cloud";
136
131
  apiKey: string;
137
132
  proxyUrl?: string;
138
- storage?: Storage;
133
+ storage?: Storage$1;
139
134
  redirectUrl?: string | ((url: string) => string);
140
135
  });
141
136
  url(url: string): Promise<URLResult>;
@@ -175,39 +170,25 @@ declare class ThreatDetector {
175
170
  private getStatusFromCache;
176
171
  }
177
172
 
178
- declare const Extension: () => {
179
- get: (key: string) => Promise<any>;
180
- set: (key: string, value: string) => Promise<void>;
181
- delete: (key: string) => Promise<void>;
182
- size: () => Promise<number>;
183
- };
184
-
185
- declare const Browser: () => {
186
- get: (key: string) => Promise<string | null>;
187
- set: (key: string, value: string) => Promise<void>;
188
- delete: (key: string) => Promise<void>;
189
- size: () => Promise<number>;
190
- };
191
-
192
- declare const Memory: () => {
193
- get: (key: string) => Promise<string | null>;
194
- set: (key: string, value: string) => Promise<void>;
195
- delete: (key: string) => Promise<void>;
196
- size: () => Promise<number>;
173
+ declare const Storage: {
174
+ Memory: () => {
175
+ get: (key: string) => Promise<string | null>;
176
+ set: (key: string, value: string) => Promise<void>;
177
+ delete: (key: string) => Promise<void>;
178
+ size: () => Promise<number>;
179
+ };
180
+ Extension: () => {
181
+ get: (key: string) => Promise<any>;
182
+ set: (key: string, value: string) => Promise<void>;
183
+ delete: (key: string) => Promise<void>;
184
+ size: () => Promise<number>;
185
+ };
186
+ Browser: () => {
187
+ get: (key: string) => Promise<string | null>;
188
+ set: (key: string, value: string) => Promise<void>;
189
+ delete: (key: string) => Promise<void>;
190
+ size: () => Promise<number>;
191
+ };
197
192
  };
198
193
 
199
- interface Context {
200
- keys: string[];
201
- }
202
- declare function defineStorage<T extends Storage>(config: (ctx: Context) => T): () => T;
203
-
204
- declare const index_Browser: typeof Browser;
205
- declare const index_Extension: typeof Extension;
206
- declare const index_Memory: typeof Memory;
207
- type index_Storage = Storage;
208
- declare const index_defineStorage: typeof defineStorage;
209
- declare namespace index {
210
- export { index_Browser as Browser, index_Extension as Extension, index_Memory as Memory, type index_Storage as Storage, index_defineStorage as defineStorage };
211
- }
212
-
213
- export { type AssetStatus, type AssetType, ChainPatrolClient, ChainPatrolClientError, ChainPatrolClientErrorCodes, type ChainPatrolClientOptions, type DetectorAssetStatus, DomainParseError, type EventData, Events, Relay, index as Storage, ThreatDetector, type URLResult };
194
+ export { type AssetStatus, type AssetType, ChainPatrolClient, ChainPatrolClientError, ChainPatrolClientErrorCodes, type ChainPatrolClientOptions, type DetectorAssetStatus, DomainParseError, type EventData, Events, Relay, Storage, ThreatDetector, type URLResult };