Skip to content

Commit

Permalink
Deno SDK v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
anudit committed Jun 16, 2022
1 parent b8d4a40 commit 4377a89
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/sdk-deno/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Start Support for `convo.omnid`
- `convo.omnid.computeTrustScore` coming soon.
- Improvements.

## 0.1.0

Expand Down
8 changes: 1 addition & 7 deletions packages/sdk-deno/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
BundlephobiaResp,
Dictionary,
ErrorType,
LogConfigType,
Expand All @@ -19,16 +18,11 @@ import { fetcher } from './utils.ts';

logConfig = async (): Promise<LogConfigType> => {
const pingResult: Dictionary<any> = await this.pingNode();
const versionInfo: BundlephobiaResp = await fetch(
'https://bundlephobia.com/api/size?package=@theconvospace/sdk@latest&record=true'
).then((r) => {
return r.json() as Promise<BundlephobiaResp>;
});
return {
node: this.node,
apikey: this.apikey,
currentVersion: this.version,
latestVersion: versionInfo['version'],
platform: 'deno',
pingResult: pingResult,
};
};
Expand Down
9 changes: 9 additions & 0 deletions packages/sdk-deno/mod_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ Deno.test("test comments.query", async () => {
assertEquals(comments.length, 10);

});

Deno.test("test base.logConfig", async () => {

const convo = new Convo('CSCpPwHnkB3niBJiUjy92YGP6xVkVZbWfK8xriDO');
const config = await convo.logConfig();
assertEquals(config.platform, 'deno');
assertEquals(config.pingResult?.success, true);

});
2 changes: 1 addition & 1 deletion packages/sdk-deno/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Dictionary<T> {
node: string;
apikey: string;
pingResult: any | ErrorType;
latestVersion: string;
platform: string;
currentVersion: string;
}

Expand Down

2 comments on commit 4377a89

@vercel
Copy link

@vercel vercel bot commented on 4377a89 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

convosdk-examples-nextjs – ./examples/nextjs

convosdk-examples-nextjs-git-main-anudit.vercel.app
convosdk-examples-nextjs-anudit.vercel.app
convosdk-examples-nextjs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4377a89 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

convosdk-examples-browser – ./examples/browser

convosdk-examples-browser.vercel.app
convosdk-examples-browser-git-main-anudit.vercel.app
convosdk-examples-browser-anudit.vercel.app

Please sign in to comment.