-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3869551
commit 0c5ad43
Showing
6 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 19 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-5e4d2c73f9b73c1a0b50bd28842d3af5ed35f8a52e1b5cd39b94f4ac8083bfcc.yml | ||
configured_endpoints: 20 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-63c446028fc6e2ac5a16a0517c126a07fa4e97a5ab23853fb88750ccebaa991f.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import { APIResource } from '../resource'; | ||
import * as Core from '../core'; | ||
|
||
export class Scan extends APIResource {} | ||
export class Scan extends APIResource { | ||
/** | ||
* Report whether the end-user accepted the Blockaid classification on the entity | ||
* being scanned. | ||
*/ | ||
status(body: ScanStatusParams, options?: Core.RequestOptions): Core.APIPromise<unknown> { | ||
return this._client.post('/v0/scan/status/', { body, ...options }); | ||
} | ||
} | ||
|
||
export type ScanStatusResponse = unknown; | ||
|
||
export interface ScanStatusParams { | ||
/** | ||
* The x-request-id header returned from the previous Blockaid api request | ||
*/ | ||
request_id: string; | ||
|
||
/** | ||
* An enumeration. | ||
*/ | ||
status: 'accepted' | 'rejected'; | ||
} | ||
|
||
export declare namespace Scan { | ||
export { type ScanStatusResponse as ScanStatusResponse, type ScanStatusParams as ScanStatusParams }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import Blockaid from '@blockaid/client'; | ||
import { Response } from 'node-fetch'; | ||
|
||
const client = new Blockaid({ | ||
apiKey: 'My API Key', | ||
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', | ||
}); | ||
|
||
describe('resource scan', () => { | ||
test('status: only required params', async () => { | ||
const responsePromise = client.scan.status({ | ||
request_id: '7f959417-76c1-4c4d-89e8-5fdedab76a8d', | ||
status: 'accepted', | ||
}); | ||
const rawResponse = await responsePromise.asResponse(); | ||
expect(rawResponse).toBeInstanceOf(Response); | ||
const response = await responsePromise; | ||
expect(response).not.toBeInstanceOf(Response); | ||
const dataAndResponse = await responsePromise.withResponse(); | ||
expect(dataAndResponse.data).toBe(response); | ||
expect(dataAndResponse.response).toBe(rawResponse); | ||
}); | ||
|
||
test('status: required and optional params', async () => { | ||
const response = await client.scan.status({ | ||
request_id: '7f959417-76c1-4c4d-89e8-5fdedab76a8d', | ||
status: 'accepted', | ||
}); | ||
}); | ||
}); |