@atproto/api
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -14,2 +14,3 @@ import { Client as XrpcClient, ServiceClient as XrpcServiceClient } from '@atproto/xrpc'; | ||
import * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction'; | ||
import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail'; | ||
import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle'; | ||
@@ -29,2 +30,3 @@ import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle'; | ||
import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'; | ||
import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword'; | ||
import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'; | ||
@@ -38,2 +40,3 @@ import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes'; | ||
import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'; | ||
import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords'; | ||
import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'; | ||
@@ -43,2 +46,3 @@ import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete'; | ||
import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword'; | ||
import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword'; | ||
import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob'; | ||
@@ -92,2 +96,3 @@ import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks'; | ||
export * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction'; | ||
export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail'; | ||
export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle'; | ||
@@ -111,2 +116,3 @@ export * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle'; | ||
export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'; | ||
export * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword'; | ||
export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'; | ||
@@ -121,2 +127,3 @@ export * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes'; | ||
export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'; | ||
export * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords'; | ||
export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'; | ||
@@ -126,2 +133,3 @@ export * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete'; | ||
export * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword'; | ||
export * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword'; | ||
export * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob'; | ||
@@ -177,2 +185,6 @@ export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks'; | ||
DefsReasonSpam: string; | ||
DefsReasonViolation: string; | ||
DefsReasonMisleading: string; | ||
DefsReasonSexual: string; | ||
DefsReasonRude: string; | ||
DefsReasonOther: string; | ||
@@ -224,2 +236,3 @@ }; | ||
takeModerationAction(data?: ComAtprotoAdminTakeModerationAction.InputSchema, opts?: ComAtprotoAdminTakeModerationAction.CallOptions): Promise<ComAtprotoAdminTakeModerationAction.Response>; | ||
updateAccountEmail(data?: ComAtprotoAdminUpdateAccountEmail.InputSchema, opts?: ComAtprotoAdminUpdateAccountEmail.CallOptions): Promise<ComAtprotoAdminUpdateAccountEmail.Response>; | ||
updateAccountHandle(data?: ComAtprotoAdminUpdateAccountHandle.InputSchema, opts?: ComAtprotoAdminUpdateAccountHandle.CallOptions): Promise<ComAtprotoAdminUpdateAccountHandle.Response>; | ||
@@ -259,2 +272,3 @@ } | ||
createAccount(data?: ComAtprotoServerCreateAccount.InputSchema, opts?: ComAtprotoServerCreateAccount.CallOptions): Promise<ComAtprotoServerCreateAccount.Response>; | ||
createAppPassword(data?: ComAtprotoServerCreateAppPassword.InputSchema, opts?: ComAtprotoServerCreateAppPassword.CallOptions): Promise<ComAtprotoServerCreateAppPassword.Response>; | ||
createInviteCode(data?: ComAtprotoServerCreateInviteCode.InputSchema, opts?: ComAtprotoServerCreateInviteCode.CallOptions): Promise<ComAtprotoServerCreateInviteCode.Response>; | ||
@@ -268,2 +282,3 @@ createInviteCodes(data?: ComAtprotoServerCreateInviteCodes.InputSchema, opts?: ComAtprotoServerCreateInviteCodes.CallOptions): Promise<ComAtprotoServerCreateInviteCodes.Response>; | ||
getSession(params?: ComAtprotoServerGetSession.QueryParams, opts?: ComAtprotoServerGetSession.CallOptions): Promise<ComAtprotoServerGetSession.Response>; | ||
listAppPasswords(params?: ComAtprotoServerListAppPasswords.QueryParams, opts?: ComAtprotoServerListAppPasswords.CallOptions): Promise<ComAtprotoServerListAppPasswords.Response>; | ||
refreshSession(data?: ComAtprotoServerRefreshSession.InputSchema, opts?: ComAtprotoServerRefreshSession.CallOptions): Promise<ComAtprotoServerRefreshSession.Response>; | ||
@@ -273,2 +288,3 @@ requestAccountDelete(data?: ComAtprotoServerRequestAccountDelete.InputSchema, opts?: ComAtprotoServerRequestAccountDelete.CallOptions): Promise<ComAtprotoServerRequestAccountDelete.Response>; | ||
resetPassword(data?: ComAtprotoServerResetPassword.InputSchema, opts?: ComAtprotoServerResetPassword.CallOptions): Promise<ComAtprotoServerResetPassword.Response>; | ||
revokeAppPassword(data?: ComAtprotoServerRevokeAppPassword.InputSchema, opts?: ComAtprotoServerRevokeAppPassword.CallOptions): Promise<ComAtprotoServerRevokeAppPassword.Response>; | ||
} | ||
@@ -275,0 +291,0 @@ export declare class SyncNS { |
import { Headers } from '@atproto/xrpc'; | ||
export interface QueryParams { | ||
seenAt?: string; | ||
} | ||
@@ -4,0 +5,0 @@ export declare type InputSchema = undefined; |
@@ -8,2 +8,3 @@ import { Headers } from '@atproto/xrpc'; | ||
cursor?: string; | ||
seenAt?: string; | ||
} | ||
@@ -10,0 +11,0 @@ export declare type InputSchema = undefined; |
@@ -5,2 +5,3 @@ import { ValidationResult } from '@atproto/lexicon'; | ||
import * as ComAtprotoServerDefs from '../server/defs'; | ||
import * as ComAtprotoLabelDefs from '../label/defs'; | ||
export interface ActionView { | ||
@@ -112,2 +113,3 @@ id: number; | ||
moderation: ModerationDetail; | ||
labels?: ComAtprotoLabelDefs.Label[]; | ||
invitedBy?: ComAtprotoServerDefs.InviteCode; | ||
@@ -142,2 +144,3 @@ invites?: ComAtprotoServerDefs.InviteCode[]; | ||
blobs: BlobView[]; | ||
labels?: ComAtprotoLabelDefs.Label[]; | ||
indexedAt: string; | ||
@@ -144,0 +147,0 @@ moderation: ModerationDetail; |
@@ -1,3 +0,7 @@ | ||
export declare type ReasonType = 'com.atproto.moderation.defs#reasonSpam' | 'com.atproto.moderation.defs#reasonOther' | (string & {}); | ||
export declare type ReasonType = 'com.atproto.moderation.defs#reasonSpam' | 'com.atproto.moderation.defs#reasonViolation' | 'com.atproto.moderation.defs#reasonMisleading' | 'com.atproto.moderation.defs#reasonSexual' | 'com.atproto.moderation.defs#reasonRude' | 'com.atproto.moderation.defs#reasonOther' | (string & {}); | ||
export declare const REASONSPAM = "com.atproto.moderation.defs#reasonSpam"; | ||
export declare const REASONVIOLATION = "com.atproto.moderation.defs#reasonViolation"; | ||
export declare const REASONMISLEADING = "com.atproto.moderation.defs#reasonMisleading"; | ||
export declare const REASONSEXUAL = "com.atproto.moderation.defs#reasonSexual"; | ||
export declare const REASONRUDE = "com.atproto.moderation.defs#reasonRude"; | ||
export declare const REASONOTHER = "com.atproto.moderation.defs#reasonOther"; |
import { Headers } from '@atproto/xrpc'; | ||
import { ValidationResult } from '@atproto/lexicon'; | ||
export interface QueryParams { | ||
@@ -7,7 +8,7 @@ } | ||
useCount: number; | ||
forAccount?: string; | ||
forAccounts?: string[]; | ||
[k: string]: unknown; | ||
} | ||
export interface OutputSchema { | ||
codes: string[]; | ||
codes: AccountCodes[]; | ||
[k: string]: unknown; | ||
@@ -26,1 +27,8 @@ } | ||
export declare function toKnownErr(e: any): any; | ||
export interface AccountCodes { | ||
account: string; | ||
codes: string[]; | ||
[k: string]: unknown; | ||
} | ||
export declare function isAccountCodes(v: unknown): v is AccountCodes; | ||
export declare function validateAccountCodes(v: unknown): ValidationResult; |
{ | ||
"name": "@atproto/api", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -36,3 +36,3 @@ # ATP API | ||
service: 'https://example.com', | ||
persistSession: (evt: AtpSessionEvent, sess?: AtpSessionData) { | ||
persistSession: (evt: AtpSessionEvent, sess?: AtpSessionData) => { | ||
// store the session-data for reuse | ||
@@ -182,9 +182,9 @@ } | ||
) | ||
const res2 = await agent.com.atproto.repo.listRecords({user: alice.did, collection: 'app.bsky.feed.post'}) | ||
const res2 = await agent.com.atproto.repo.listRecords({repo: alice.did, collection: 'app.bsky.feed.post'}) | ||
const res3 = await agent.app.bsky.feed.post.create({did: alice.did}, { | ||
const res3 = await agent.app.bsky.feed.post.create({repo: alice.did}, { | ||
text: 'Hello, world!', | ||
createdAt: (new Date()).toISOString() | ||
}) | ||
const res4 = await agent.app.bsky.feed.post.list({did: alice.did}) | ||
const res4 = await agent.app.bsky.feed.post.list({repo: alice.did}) | ||
``` | ||
@@ -191,0 +191,0 @@ |
@@ -23,2 +23,3 @@ /** | ||
import * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction' | ||
import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' | ||
import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' | ||
@@ -42,2 +43,3 @@ import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle' | ||
import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' | ||
import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' | ||
import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode' | ||
@@ -52,2 +54,3 @@ import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes' | ||
import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession' | ||
import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords' | ||
import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession' | ||
@@ -57,2 +60,3 @@ import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete' | ||
import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword' | ||
import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword' | ||
import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' | ||
@@ -115,2 +119,3 @@ import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' | ||
export * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction' | ||
export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' | ||
export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' | ||
@@ -134,2 +139,3 @@ export * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle' | ||
export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' | ||
export * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' | ||
export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode' | ||
@@ -144,2 +150,3 @@ export * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes' | ||
export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession' | ||
export * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords' | ||
export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession' | ||
@@ -149,2 +156,3 @@ export * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete' | ||
export * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword' | ||
export * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword' | ||
export * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' | ||
@@ -201,2 +209,6 @@ export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' | ||
DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', | ||
DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', | ||
DefsReasonMisleading: 'com.atproto.moderation.defs#reasonMisleading', | ||
DefsReasonSexual: 'com.atproto.moderation.defs#reasonSexual', | ||
DefsReasonRude: 'com.atproto.moderation.defs#reasonRude', | ||
DefsReasonOther: 'com.atproto.moderation.defs#reasonOther', | ||
@@ -406,2 +418,13 @@ } | ||
updateAccountEmail( | ||
data?: ComAtprotoAdminUpdateAccountEmail.InputSchema, | ||
opts?: ComAtprotoAdminUpdateAccountEmail.CallOptions, | ||
): Promise<ComAtprotoAdminUpdateAccountEmail.Response> { | ||
return this._service.xrpc | ||
.call('com.atproto.admin.updateAccountEmail', opts?.qp, data, opts) | ||
.catch((e) => { | ||
throw ComAtprotoAdminUpdateAccountEmail.toKnownErr(e) | ||
}) | ||
} | ||
updateAccountHandle( | ||
@@ -601,2 +624,13 @@ data?: ComAtprotoAdminUpdateAccountHandle.InputSchema, | ||
createAppPassword( | ||
data?: ComAtprotoServerCreateAppPassword.InputSchema, | ||
opts?: ComAtprotoServerCreateAppPassword.CallOptions, | ||
): Promise<ComAtprotoServerCreateAppPassword.Response> { | ||
return this._service.xrpc | ||
.call('com.atproto.server.createAppPassword', opts?.qp, data, opts) | ||
.catch((e) => { | ||
throw ComAtprotoServerCreateAppPassword.toKnownErr(e) | ||
}) | ||
} | ||
createInviteCode( | ||
@@ -690,2 +724,13 @@ data?: ComAtprotoServerCreateInviteCode.InputSchema, | ||
listAppPasswords( | ||
params?: ComAtprotoServerListAppPasswords.QueryParams, | ||
opts?: ComAtprotoServerListAppPasswords.CallOptions, | ||
): Promise<ComAtprotoServerListAppPasswords.Response> { | ||
return this._service.xrpc | ||
.call('com.atproto.server.listAppPasswords', params, undefined, opts) | ||
.catch((e) => { | ||
throw ComAtprotoServerListAppPasswords.toKnownErr(e) | ||
}) | ||
} | ||
refreshSession( | ||
@@ -734,2 +779,13 @@ data?: ComAtprotoServerRefreshSession.InputSchema, | ||
} | ||
revokeAppPassword( | ||
data?: ComAtprotoServerRevokeAppPassword.InputSchema, | ||
opts?: ComAtprotoServerRevokeAppPassword.CallOptions, | ||
): Promise<ComAtprotoServerRevokeAppPassword.Response> { | ||
return this._service.xrpc | ||
.call('com.atproto.server.revokeAppPassword', opts?.qp, data, opts) | ||
.catch((e) => { | ||
throw ComAtprotoServerRevokeAppPassword.toKnownErr(e) | ||
}) | ||
} | ||
} | ||
@@ -736,0 +792,0 @@ |
@@ -10,3 +10,5 @@ /** | ||
export interface QueryParams {} | ||
export interface QueryParams { | ||
seenAt?: string | ||
} | ||
@@ -13,0 +15,0 @@ export type InputSchema = undefined |
@@ -15,2 +15,3 @@ /** | ||
cursor?: string | ||
seenAt?: string | ||
} | ||
@@ -17,0 +18,0 @@ |
@@ -11,2 +11,3 @@ /** | ||
import * as ComAtprotoServerDefs from '../server/defs' | ||
import * as ComAtprotoLabelDefs from '../label/defs' | ||
@@ -199,2 +200,3 @@ export interface ActionView { | ||
moderation: ModerationDetail | ||
labels?: ComAtprotoLabelDefs.Label[] | ||
invitedBy?: ComAtprotoServerDefs.InviteCode | ||
@@ -262,2 +264,3 @@ invites?: ComAtprotoServerDefs.InviteCode[] | ||
blobs: BlobView[] | ||
labels?: ComAtprotoLabelDefs.Label[] | ||
indexedAt: string | ||
@@ -264,0 +267,0 @@ moderation: ModerationDetail |
@@ -11,8 +11,20 @@ /** | ||
| 'com.atproto.moderation.defs#reasonSpam' | ||
| 'com.atproto.moderation.defs#reasonViolation' | ||
| 'com.atproto.moderation.defs#reasonMisleading' | ||
| 'com.atproto.moderation.defs#reasonSexual' | ||
| 'com.atproto.moderation.defs#reasonRude' | ||
| 'com.atproto.moderation.defs#reasonOther' | ||
| (string & {}) | ||
/** Moderation report reason: Spam. */ | ||
/** Spam: frequent unwanted promotion, replies, mentions */ | ||
export const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam' | ||
/** Moderation report reason: Other. */ | ||
/** Direct violation of server rules, laws, terms of service */ | ||
export const REASONVIOLATION = 'com.atproto.moderation.defs#reasonViolation' | ||
/** Misleading identity, affiliation, or content */ | ||
export const REASONMISLEADING = 'com.atproto.moderation.defs#reasonMisleading' | ||
/** Unwanted or mis-labeled sexual content */ | ||
export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual' | ||
/** Rude, harassing, explicit, or otherwise unwelcoming behavior */ | ||
export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude' | ||
/** Other: reports not falling under another report category */ | ||
export const REASONOTHER = 'com.atproto.moderation.defs#reasonOther' |
@@ -15,3 +15,3 @@ /** | ||
useCount: number | ||
forAccount?: string | ||
forAccounts?: string[] | ||
[k: string]: unknown | ||
@@ -21,3 +21,3 @@ } | ||
export interface OutputSchema { | ||
codes: string[] | ||
codes: AccountCodes[] | ||
[k: string]: unknown | ||
@@ -43,1 +43,22 @@ } | ||
} | ||
export interface AccountCodes { | ||
account: string | ||
codes: string[] | ||
[k: string]: unknown | ||
} | ||
export function isAccountCodes(v: unknown): v is AccountCodes { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'com.atproto.server.createInviteCodes#accountCodes' | ||
) | ||
} | ||
export function validateAccountCodes(v: unknown): ValidationResult { | ||
return lexicons.validate( | ||
'com.atproto.server.createInviteCodes#accountCodes', | ||
v, | ||
) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2013948
282
38569