@indiciaosint/sdk 2.0.1 → 2.0.2
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 +69 -0
- package/dist/BaseClient.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<h3>
|
|
2
|
+
<img src="https://indicia.app/branding/wordmark.png" alt="indicia wordmark" width="300">
|
|
3
|
+
<br />
|
|
4
|
+
</h3>
|
|
5
|
+
|
|
6
|
+
# @indiciaosint/sdk
|
|
7
|
+
|
|
8
|
+
Typed TypeScript client for the [Indicia API](https://api.indicia.app/openapi).
|
|
9
|
+
|
|
10
|
+
Create a key in the [dashboard](https://indicia.app/dashboard/account), or send an OAuth 2.1 access token as `Authorization: Bearer`.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm i @indiciaosint/sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Indicia } from "@indiciaosint/sdk";
|
|
18
|
+
|
|
19
|
+
const client = new Indicia({
|
|
20
|
+
apiKey: process.env.INDICIA_API_KEY,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const me = await client.users.getInfo();
|
|
24
|
+
const github = await client.socials.searchGithub({ query: "octocat" });
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`INDICIA_API_KEY` is read automatically if you omit `apiKey`.
|
|
28
|
+
|
|
29
|
+
## Auth
|
|
30
|
+
|
|
31
|
+
| | |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| API key | `new Indicia({ apiKey })` or `INDICIA_API_KEY` (`x-api-key`) |
|
|
34
|
+
| OAuth | `new Indicia({ auth: async () => ({ headers: { Authorization: `Bearer ${token}` } }) })` |
|
|
35
|
+
|
|
36
|
+
OAuth tokens must be issued with `resource=https://api.indicia.app`. Device and authorization-code flows are documented at [indicia.app/device](https://indicia.app/device) and [the authorization server metadata](https://indicia.app/.well-known/oauth-authorization-server).
|
|
37
|
+
|
|
38
|
+
## Client
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
client.users
|
|
42
|
+
client.pricing
|
|
43
|
+
client.activity
|
|
44
|
+
client.intelligence
|
|
45
|
+
client.socials
|
|
46
|
+
client.infrastructure
|
|
47
|
+
client.unified
|
|
48
|
+
client.tools
|
|
49
|
+
client.organizations
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
GitHub, username, and face searches stream over SSE — iterate the returned stream with `for await`.
|
|
53
|
+
|
|
54
|
+
## Errors
|
|
55
|
+
|
|
56
|
+
Failed HTTP responses throw `IndiciaError` (`statusCode`, `body`). Timeouts throw `IndiciaTimeoutError`.
|
|
57
|
+
|
|
58
|
+
## Generate
|
|
59
|
+
|
|
60
|
+
This repository holds the Fern config. GitHub Actions pulls
|
|
61
|
+
`https://api.indicia.app/openapi` and publishes `@indiciaosint/sdk` to npm.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
fern check
|
|
65
|
+
fern generate --group ts-sdk --force --version <semver>
|
|
66
|
+
python3 fern/scripts/pack-sdk.py sdks/typescript <semver>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Issues against the generated client: open a GitHub issue. Do not PR generated output.
|
package/dist/BaseClient.js
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@indiciaosint/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "2.0.
|
|
10
|
-
"User-Agent": "@indiciaosint/sdk/2.0.
|
|
9
|
+
"X-Fern-SDK-Version": "2.0.2",
|
|
10
|
+
"User-Agent": "@indiciaosint/sdk/2.0.2",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options?.headers);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.2";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indiciaosint/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Developer-friendly TypeScript SDK for the Indicia API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "tsc"
|