-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bc3301
commit c00498c
Showing
12 changed files
with
603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/api/src/client/types/app/bsky/subscription/getActiveSubscriptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { HeadersMap, XRPCError } from '@atproto/xrpc' | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { lexicons } from '../../../../lexicons' | ||
import { CID } from 'multiformats/cid' | ||
|
||
export interface QueryParams {} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
subscriptions: Subscription[] | ||
[k: string]: unknown | ||
} | ||
|
||
export interface CallOptions { | ||
signal?: AbortSignal | ||
headers?: HeadersMap | ||
} | ||
|
||
export interface Response { | ||
success: boolean | ||
headers: HeadersMap | ||
data: OutputSchema | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
return e | ||
} | ||
|
||
export interface Subscription { | ||
status: string | ||
renewalStatus: string | ||
group: string | ||
platform: string | ||
offering: string | ||
periodEndsAt: string | ||
periodStartsAt: string | ||
purchasedAt: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isSubscription(v: unknown): v is Subscription { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'app.bsky.subscription.getActiveSubscriptions#subscription' | ||
) | ||
} | ||
|
||
export function validateSubscription(v: unknown): ValidationResult { | ||
return lexicons.validate( | ||
'app.bsky.subscription.getActiveSubscriptions#subscription', | ||
v, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
packages/bsky/src/lexicon/types/app/bsky/subscription/getActiveSubscriptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import express from 'express' | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { lexicons } from '../../../../lexicons' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { CID } from 'multiformats/cid' | ||
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' | ||
|
||
export interface QueryParams {} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
subscriptions: Subscription[] | ||
[k: string]: unknown | ||
} | ||
|
||
export type HandlerInput = undefined | ||
|
||
export interface HandlerSuccess { | ||
encoding: 'application/json' | ||
body: OutputSchema | ||
headers?: { [key: string]: string } | ||
} | ||
|
||
export interface HandlerError { | ||
status: number | ||
message?: string | ||
} | ||
|
||
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough | ||
export type HandlerReqCtx<HA extends HandlerAuth = never> = { | ||
auth: HA | ||
params: QueryParams | ||
input: HandlerInput | ||
req: express.Request | ||
res: express.Response | ||
} | ||
export type Handler<HA extends HandlerAuth = never> = ( | ||
ctx: HandlerReqCtx<HA>, | ||
) => Promise<HandlerOutput> | HandlerOutput | ||
|
||
export interface Subscription { | ||
status: string | ||
renewalStatus: string | ||
group: string | ||
platform: string | ||
offering: string | ||
periodEndsAt: string | ||
periodStartsAt: string | ||
purchasedAt: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isSubscription(v: unknown): v is Subscription { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'app.bsky.subscription.getActiveSubscriptions#subscription' | ||
) | ||
} | ||
|
||
export function validateSubscription(v: unknown): ValidationResult { | ||
return lexicons.validate( | ||
'app.bsky.subscription.getActiveSubscriptions#subscription', | ||
v, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.