Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

# Runs on PRs and pushes to the default branch. We use `pull_request` (never
# `pull_request_target`), so secrets are NOT exposed to pull requests from forks.
on:
pull_request:
push:
branches: [main, master]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: '3.0'
- name: Install dependencies
working-directory: client
run: dart pub get
- name: Run model tests
working-directory: client
run: dart test
- name: Install SSO test dependencies
working-directory: sso_tests
run: dart pub get
- name: Run SSO unit + integration tests
working-directory: sso_tests
run: dart test
env:
FASTCOMMENTS_API_KEY: ${{ secrets.FASTCOMMENTS_API_KEY }}
FASTCOMMENTS_TENANT_ID: ${{ secrets.FASTCOMMENTS_TENANT_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ client/.dart_tool/
client/.packages
client/pubspec.lock
node_modules/
openapi-generator-cli.jar
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ dependencies:
crypto: ^3.0.0
```

The client exposes three API classes:

- `DefaultApi` — API-key-authenticated methods for server-side use.
- `PublicApi` — public methods that need no API key, safe for browser and
mobile clients.
- `ModerationApi` — methods that back the moderator dashboard: comment
moderation (list, count, search, logs, export), moderation actions
(remove/restore, flag, set review/spam/approval status, votes, reopen/close
thread), bans (ban from comment, undo, pre-ban summaries, ban status and
preferences, banned-user counts), and badges & trust (award/remove badge,
manual badges, get/set trust factor, user internal profile). Every
`ModerationApi` method takes an `sso` parameter for SSO-authenticated
moderators.

```dart
import 'package:fastcomments_dart/api.dart';

Expand All @@ -49,6 +63,20 @@ final comments = await api.getCommentsPublic(
);
```

```dart
import 'package:fastcomments_dart/api.dart';

final publicApi = PublicApi(ApiClient(basePath: 'https://fastcomments.com'));
final feedPosts = await publicApi.getFeedPostsPublic('YOUR_TENANT_ID');
```

```dart
import 'package:fastcomments_dart/api.dart';

final moderation = ModerationApi(ApiClient(basePath: 'https://fastcomments.com'));
final result = await moderation.getApiComments(sso: 'SSO_TOKEN');
```

## SSO

```dart
Expand Down
Loading
Loading