3.1.1 • Published 4 months ago
@atcute/ozone v3.1.1
@atcute/ozone
Ozone (tools.ozone.*) schema definitions
usage
import { is, type $type } from '@atcute/lexicons';
import { ToolsOzoneModerationDefs } from '@atcute/ozone';
type LabelEvent = $type.enforce<ToolsOzoneModerationDefs.ModEventLabel>;
const evt: LabelEvent = {
$type: 'tools.ozone.moderation.defs#modEventLabel',
createLabelVals: ['awesome'],
negateLabelVals: [],
};
is(ToolsOzoneModerationDefs.modEventLabelSchema, evt);
// -> true
with @atcute/client
pick either one of these 3 options to register the ambient declarations
// tsconfig.json
{
"compilerOptions": {
"types": ["@atcute/ozone"],
},
}
// env.d.ts
/// <reference types="@atcute/ozone" />
// index.ts
import type {} from '@atcute/ozone';
now all the XRPC operations should be visible in the client
import { Client, simpleFetchHandler } from '@atcute/client';
const client = new Client({
handler: simpleFetchHandler({ service: 'https://mod.example.com' }),
});
const response = await client.post('tools.ozone.moderation.emitEvent', {
input: {
createdBy: 'did:plc:ia76kvnndjutgedggx2ibrem',
subject: {
$type: 'com.atproto.repo.strongRef',
uri: 'at://did:plc:ia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3l6uo5yecnsu7',
cid: 'bafyreibluyqpqno2ixrhdkztquyarpug7k6t4en6ug7g3sw6fonzzmakbq',
},
event: {
$type: 'tools.ozone.moderation.defs#modEventLabel',
createLabelVals: ['awesome'],
negateLabelVals: [],
},
},
});
// ...
3.0.3
4 months ago
3.1.1
4 months ago
3.0.2
5 months ago
3.1.0
4 months ago
3.0.1
5 months ago
1.0.9
9 months ago
1.0.8
10 months ago
1.0.7
11 months ago
3.0.0
5 months ago
1.0.6
11 months ago
2.0.3
5 months ago
2.0.2
6 months ago
1.0.11
8 months ago
1.0.10
8 months ago
2.0.0
6 months ago
1.0.12
7 months ago
1.0.5
12 months ago
1.0.4
1 year ago