Skip to content

Commit d1284d4

Browse files
author
Mateusz Wiezik
committed
working sphinx html build
1 parent e84e239 commit d1284d4

7 files changed

Lines changed: 1020 additions & 1945 deletions

File tree

docs/api_reference.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
API Reference
3+
=============
4+
5+
Overview
6+
--------
7+
Athena NodeJS SDK provides real-time image classification for CSAM detection using gRPC. It supports session-based deployments, multi-affiliate collaboration, and a wide range of image formats and error handling features.
8+
9+
Main Classes
10+
------------
11+
12+
- **ClassifierSdk**: Main entry point for interacting with the Athena service. Handles authentication, deployment management, and image classification.
13+
- **ClassifierServiceClient**: Low-level gRPC client for direct service calls.
14+
- **ClassifyImageOptions**: Options for sending image classification requests.
15+
- **Deployment**: Represents a deployment session.
16+
- **ClassifyRequest** / **ClassifyResponse**: Request and response types for image classification.
17+
- **ClassificationInput** / **ClassificationOutput** / **ClassificationError** / **Classification**: Types for input, output, and error handling.
18+
19+
Usage Example
20+
-------------
21+
22+
.. code-block:: javascript
23+
24+
import { ClassifierSdk } from 'athena-nodejs-sdk';
25+
26+
const sdk = new ClassifierSdk({
27+
deploymentId: 'your-deployment-id',
28+
affiliate: 'your-affiliate',
29+
authentication: {
30+
issuerUrl: 'https://issuer.example.com',
31+
clientId: 'your-client-id',
32+
clientSecret: 'your-client-secret',
33+
scope: 'manage:classify'
34+
}
35+
});
36+
37+
await sdk.open();
38+
const deployments = await sdk.listDeployments();
39+
// Send image for classification
40+
await sdk.sendClassifyRequest({
41+
imageStream: fs.createReadStream('image.jpg'),
42+
format: 'JPEG',
43+
});
44+
45+
sdk.on('data', (response) => {
46+
console.log('Classification result:', response);
47+
});
48+
49+
sdk.on('error', (err) => {
50+
console.error('Error:', err);
51+
});
52+
53+
sdk.on('close', () => {
54+
console.log('Connection closed');
55+
});
56+
57+
API Classes
58+
-----------
59+
60+
.. js:autoclass:: ClassifierSdk
61+
:members:
62+
63+
.. js:autoclass:: ClassifierServiceClient
64+
:members:
65+
66+
.. js:autointerface:: ClassifyImageOptions
67+
:members:
68+
69+
.. js:autointerface:: ListDeploymentsResponse
70+
:members:
71+
72+
.. js:autointerface:: Deployment
73+
:members:
74+
75+
.. js:autointerface:: ClassifyResponse
76+
:members:
77+
78+
.. js:autointerface:: ClassifyRequest
79+
:members:
80+
81+
.. js:autointerface:: ClassificationOutput
82+
:members:
83+
84+
.. js:autointerface:: ClassificationInput
85+
:members:
86+
87+
.. js:autointerface:: ClassificationError
88+
:members:
89+
90+
.. js:autointerface:: Classification
91+
:members:

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
"**/.pytest_cache/**",
6161
"**/.mypy_cache/**",
6262
"**/.ruff_cache/**",
63+
# Exclude files with duplicate documented objects
64+
"../src/athena/google/protobuf/empty.ts",
65+
"../src/athena/athena.ts",
66+
6367
]
6468

6569
# The theme to use for HTML and HTML Help pages

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ documentation for details.
1515
:maxdepth: 2
1616
:caption: Contents:
1717

18+
api_reference
19+

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "NodeJS SDK documentation for Athena CSAM Detection API"
55
authors = [{ name = "Crisp", email = "support@crispthinking.com" }]
66
readme = "README.md"
77
license = { text = "MIT" }
8-
requires-python = ">=3.8"
8+
requires-python = ">=3.10"
99
classifiers = [
1010
"Development Status :: 5 - Production/Stable",
1111
"Intended Audience :: Developers",
@@ -25,15 +25,16 @@ dependencies = [
2525
"sphinx>=7.0.0",
2626
"sphinx-rtd-theme>=1.3.0",
2727
"myst-parser>=2.0.0",
28-
2928
# Extensions for enhanced documentation
3029
"sphinx-autobuild>=2021.3.14",
3130
"sphinxcontrib-spelling>=8.0.0",
32-
31+
# Sphinx JS extension
32+
"sphinx-js>=4.1.0",
3333
# Protocol buffer support
3434
"protobuf>=4.0.0",
3535
"grpcio>=1.50.0",
3636
"grpcio-tools>=1.50.0",
37+
"furo>=2025.7.19",
3738
]
3839

3940
[project.optional-dependencies]

src/main.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,20 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEmitter<Class
265265
}
266266
}
267267

268-
export * from './athena/athena';
269-
export * from './athena/athena.grpc-client';
268+
export {
269+
ListDeploymentsResponse,
270+
Deployment,
271+
ClassifyRequest,
272+
ClassificationInput,
273+
ClassifyResponse,
274+
ClassificationOutput,
275+
Classification,
276+
ClassificationError,
277+
ImageHash,
278+
ErrorCode,
279+
RequestEncoding,
280+
ImageFormat,
281+
HashType
282+
} from './athena/athena';
283+
export { ClassifierServiceClient, IClassifierServiceClient } from './athena/athena.grpc-client';
270284
export * from './hashing';

typedoc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"excludeExternals": true,
33
"exclude": [
4-
"src/athena/google/*"
4+
"src/athena/google/*",
5+
"src/athena/athena.ts",
6+
"src/athena/google/protobuf/empty.ts"
57
]
68
}

0 commit comments

Comments
 (0)