@atproto/api
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -40,2 +40,3 @@ import { Client as XrpcClient, ServiceClient as XrpcServiceClient } from '@atproto/xrpc'; | ||
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'; | ||
import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'; | ||
import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions'; | ||
@@ -115,2 +116,3 @@ import * as AppBskyActorProfile from './types/app/bsky/actor/profile'; | ||
export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'; | ||
export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'; | ||
export * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions'; | ||
@@ -290,2 +292,3 @@ export * as AppBskyActorProfile from './types/app/bsky/actor/profile'; | ||
getProfile(params?: AppBskyActorGetProfile.QueryParams, opts?: AppBskyActorGetProfile.CallOptions): Promise<AppBskyActorGetProfile.Response>; | ||
getProfiles(params?: AppBskyActorGetProfiles.QueryParams, opts?: AppBskyActorGetProfiles.CallOptions): Promise<AppBskyActorGetProfiles.Response>; | ||
getSuggestions(params?: AppBskyActorGetSuggestions.QueryParams, opts?: AppBskyActorGetSuggestions.CallOptions): Promise<AppBskyActorGetSuggestions.Response>; | ||
@@ -292,0 +295,0 @@ search(params?: AppBskyActorSearch.QueryParams, opts?: AppBskyActorSearch.CallOptions): Promise<AppBskyActorSearch.Response>; |
import { ValidationResult } from '@atproto/lexicon'; | ||
import * as AppBskySystemDeclRef from '../system/declRef'; | ||
export interface Record { | ||
@@ -19,1 +20,25 @@ displayName: string; | ||
export declare function validateRecord(v: unknown): ValidationResult; | ||
export interface View { | ||
did: string; | ||
declaration: AppBskySystemDeclRef.Main; | ||
handle: string; | ||
creator: string; | ||
displayName?: string; | ||
description?: string; | ||
avatar?: string; | ||
banner?: string; | ||
followersCount: number; | ||
followsCount: number; | ||
postsCount: number; | ||
myState?: MyState; | ||
[k: string]: unknown; | ||
} | ||
export declare function isView(v: unknown): v is View; | ||
export declare function validateView(v: unknown): ValidationResult; | ||
export interface MyState { | ||
follow?: string; | ||
muted?: boolean; | ||
[k: string]: unknown; | ||
} | ||
export declare function isMyState(v: unknown): v is MyState; | ||
export declare function validateMyState(v: unknown): ValidationResult; |
import { Headers } from '@atproto/xrpc'; | ||
export interface QueryParams { | ||
did: string; | ||
from?: string; | ||
earliest?: string; | ||
latest?: string; | ||
} | ||
@@ -6,0 +7,0 @@ export declare type InputSchema = undefined; |
{ | ||
"name": "@atproto/api", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -57,2 +57,3 @@ /** | ||
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile' | ||
import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles' | ||
import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions' | ||
@@ -141,2 +142,3 @@ import * as AppBskyActorProfile from './types/app/bsky/actor/profile' | ||
export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile' | ||
export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles' | ||
export * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions' | ||
@@ -789,2 +791,13 @@ export * as AppBskyActorProfile from './types/app/bsky/actor/profile' | ||
getProfiles( | ||
params?: AppBskyActorGetProfiles.QueryParams, | ||
opts?: AppBskyActorGetProfiles.CallOptions, | ||
): Promise<AppBskyActorGetProfiles.Response> { | ||
return this._service.xrpc | ||
.call('app.bsky.actor.getProfiles', params, undefined, opts) | ||
.catch((e) => { | ||
throw AppBskyActorGetProfiles.toKnownErr(e) | ||
}) | ||
} | ||
getSuggestions( | ||
@@ -791,0 +804,0 @@ params?: AppBskyActorGetSuggestions.QueryParams, |
@@ -7,2 +7,3 @@ /** | ||
import { lexicons } from '../../../../lexicons' | ||
import * as AppBskySystemDeclRef from '../system/declRef' | ||
@@ -29,1 +30,45 @@ export interface Record { | ||
} | ||
export interface View { | ||
did: string | ||
declaration: AppBskySystemDeclRef.Main | ||
handle: string | ||
creator: string | ||
displayName?: string | ||
description?: string | ||
avatar?: string | ||
banner?: string | ||
followersCount: number | ||
followsCount: number | ||
postsCount: number | ||
myState?: MyState | ||
[k: string]: unknown | ||
} | ||
export function isView(v: unknown): v is View { | ||
return ( | ||
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.profile#view' | ||
) | ||
} | ||
export function validateView(v: unknown): ValidationResult { | ||
return lexicons.validate('app.bsky.actor.profile#view', v) | ||
} | ||
export interface MyState { | ||
follow?: string | ||
muted?: boolean | ||
[k: string]: unknown | ||
} | ||
export function isMyState(v: unknown): v is MyState { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'app.bsky.actor.profile#myState' | ||
) | ||
} | ||
export function validateMyState(v: unknown): ValidationResult { | ||
return lexicons.validate('app.bsky.actor.profile#myState', v) | ||
} |
@@ -12,4 +12,6 @@ /** | ||
did: string | ||
/** A past commit CID. */ | ||
from?: string | ||
/** The earliest commit in the commit range (not inclusive) */ | ||
earliest?: string | ||
/** The latest commit you in the commit range (inclusive */ | ||
latest?: string | ||
} | ||
@@ -16,0 +18,0 @@ |
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
1465073
201
27213