@notifi-network/notifi-dataplane
Advanced tools
Comparing version 0.90.1 to 0.90.2
@@ -20,2 +20,2 @@ interface FusionMessage { | ||
export { NotifiDataplaneClient }; | ||
export { FusionMessage, NotifiDataplaneClient, PublishFusionMessageResponse }; |
@@ -36,3 +36,3 @@ "use strict"; | ||
const response = await fetch(url, { | ||
"headers": new Headers([ | ||
headers: new Headers([ | ||
["Accept", "*/*"], | ||
@@ -45,9 +45,9 @@ ["Accept-Language", "en-US,en;q=0.9"], | ||
]), | ||
"body": body, | ||
"method": "POST", | ||
"mode": "cors", | ||
"credentials": "include" | ||
body, | ||
method: "POST", | ||
mode: "cors", | ||
credentials: "include" | ||
}); | ||
if (!response.ok) { | ||
throw new Error("Error in response :" + await response.text()); | ||
throw new Error(`ERROR: ${response.status} - ${response.statusText}`); | ||
} | ||
@@ -54,0 +54,0 @@ const result = await response.json(); |
@@ -1,1 +0,2 @@ | ||
export { NotifiDataplaneClient } from './NotifiDataplaneClient'; | ||
export { NotifiDataplaneClient } from './NotifiDataplaneClient'; | ||
export * from './types'; |
@@ -1,3 +0,3 @@ | ||
import { FusionMessage } from "./types/FusionMessage"; | ||
import { PublishFusionMessageResponse } from "./types/PublishFusionMessageResponse"; | ||
import { FusionMessage } from './types/FusionMessage'; | ||
import { PublishFusionMessageResponse } from './types/PublishFusionMessageResponse'; | ||
@@ -10,22 +10,24 @@ export class NotifiDataplaneClient { | ||
async publishFusionMessage(jwt: string, messages: Readonly<FusionMessage[]>): Promise<PublishFusionMessageResponse> { | ||
const url = this._dpapiUrl + "/FusionIngest/"; | ||
async publishFusionMessage( | ||
jwt: string, | ||
messages: Readonly<FusionMessage[]>, | ||
): Promise<PublishFusionMessageResponse> { | ||
const url = this._dpapiUrl + '/FusionIngest/'; | ||
const body = JSON.stringify({ data: messages }); | ||
const response = await fetch(url, { | ||
"headers": new Headers([ | ||
["Accept", "*/*"], | ||
["Accept-Language", "en-US,en;q=0.9"], | ||
["Authorization", `Bearer ${jwt}`], | ||
["Cache-Control", "no-cache"], | ||
["Content-Type", "application/json"], | ||
["Pragma", "no-cache"], | ||
headers: new Headers([ | ||
['Accept', '*/*'], | ||
['Accept-Language', 'en-US,en;q=0.9'], | ||
['Authorization', `Bearer ${jwt}`], | ||
['Cache-Control', 'no-cache'], | ||
['Content-Type', 'application/json'], | ||
['Pragma', 'no-cache'], | ||
]), | ||
"body": body, | ||
"method": "POST", | ||
"mode": "cors", | ||
"credentials": "include" | ||
body: body, | ||
method: 'POST', | ||
mode: 'cors', | ||
credentials: 'include', | ||
}); | ||
// TODO: What does the error format look like? | ||
if (!response.ok) { | ||
throw new Error("Error in response :" + await response.text()); | ||
throw new Error(`ERROR: ${response.status} - ${response.statusText}`); | ||
} | ||
@@ -35,2 +37,2 @@ const result = await response.json(); | ||
} | ||
} | ||
} |
@@ -1,5 +0,4 @@ | ||
export interface FusionMessage { | ||
eventTypeId: string, | ||
variablesJson: any, | ||
eventTypeId: string; | ||
variablesJson: any; | ||
specificWallets?: ReadonlyArray< | ||
@@ -9,19 +8,20 @@ Readonly<{ | ||
// NOTE: Blockchain duplicated here because there would be a circular reference otherwise | ||
walletBlockchain: | 'SOLANA' | ||
| 'ETHEREUM' | ||
| 'AVALANCHE' | ||
| 'APTOS' | ||
| 'ACALA' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'BINANCE' | ||
| 'NEAR' | ||
| 'OPTIMISM' | ||
| 'INJECTIVE' | ||
| 'OSMOSIS' | ||
| 'NIBIRU' | ||
| 'SUI' | ||
| 'ZKSYNC'; | ||
walletBlockchain: | ||
| 'SOLANA' | ||
| 'ETHEREUM' | ||
| 'AVALANCHE' | ||
| 'APTOS' | ||
| 'ACALA' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'BINANCE' | ||
| 'NEAR' | ||
| 'OPTIMISM' | ||
| 'INJECTIVE' | ||
| 'OSMOSIS' | ||
| 'NIBIRU' | ||
| 'SUI' | ||
| 'ZKSYNC'; | ||
}> | ||
>, | ||
} | ||
>; | ||
} |
export interface PublishFusionMessageResponse { | ||
indexToResultIdMap: Record<string, string> | ||
} | ||
indexToResultIdMap: Record<string, string>; | ||
} |
{ | ||
"name": "@notifi-network/notifi-dataplane", | ||
"version": "0.90.1", | ||
"version": "0.90.2", | ||
"description": "The Dataplane API for Notifi", | ||
@@ -34,3 +34,3 @@ "main": "./dist/index.js", | ||
"homepage": "https://github.com/notifi-network/notifi-sdk-ts#readme", | ||
"gitHead": "52b730a1209af38c60ac5208871397ce859de9df" | ||
"gitHead": "565f9b0cdcd4eb40512b8116253a2fa9fe22a9ff" | ||
} |
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
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
7686
11
175