From 742277a6ad4e57b7670a45a60e815efa6e30364b Mon Sep 17 00:00:00 2001 From: rafael Date: Fri, 6 Dec 2024 19:55:13 -0300 Subject: [PATCH] codegen lex and buf --- packages/api/src/client/index.ts | 66 +++ packages/api/src/client/lexicons.ts | 195 +++++++- .../types/app/bsky/purchase/getFeatures.ts | 50 ++ .../app/bsky/purchase/getSubscriptionGroup.ts | 55 +++ .../app/bsky/purchase/getSubscriptions.ts | 57 +++ .../types/app/bsky/purchase/refreshCache.ts | 36 ++ packages/bsky/src/lexicon/index.ts | 58 +++ packages/bsky/src/lexicon/lexicons.ts | 195 +++++++- .../types/app/bsky/purchase/getFeatures.ts | 61 +++ .../app/bsky/purchase/getSubscriptionGroup.ts | 66 +++ .../app/bsky/purchase/getSubscriptions.ts | 68 +++ .../types/app/bsky/purchase/refreshCache.ts | 48 ++ packages/bsky/src/proto/bsky_connect.ts | 13 + packages/bsky/src/proto/bsky_pb.ts | 189 ++++++++ packages/bsky/src/proto/bsync_connect.ts | 35 ++ packages/bsky/src/proto/bsync_pb.ts | 451 +++++++++++++++++- packages/bsync/src/proto/bsync_connect.ts | 35 ++ packages/bsync/src/proto/bsync_pb.ts | 451 +++++++++++++++++- packages/ozone/src/lexicon/index.ts | 58 +++ packages/ozone/src/lexicon/lexicons.ts | 195 +++++++- .../types/app/bsky/purchase/getFeatures.ts | 61 +++ .../app/bsky/purchase/getSubscriptionGroup.ts | 66 +++ .../app/bsky/purchase/getSubscriptions.ts | 68 +++ .../types/app/bsky/purchase/refreshCache.ts | 48 ++ packages/pds/src/lexicon/index.ts | 58 +++ packages/pds/src/lexicon/lexicons.ts | 195 +++++++- .../types/app/bsky/purchase/getFeatures.ts | 61 +++ .../app/bsky/purchase/getSubscriptionGroup.ts | 66 +++ .../app/bsky/purchase/getSubscriptions.ts | 68 +++ .../types/app/bsky/purchase/refreshCache.ts | 48 ++ 30 files changed, 3111 insertions(+), 10 deletions(-) create mode 100644 packages/api/src/client/types/app/bsky/purchase/getFeatures.ts create mode 100644 packages/api/src/client/types/app/bsky/purchase/getSubscriptionGroup.ts create mode 100644 packages/api/src/client/types/app/bsky/purchase/getSubscriptions.ts create mode 100644 packages/api/src/client/types/app/bsky/purchase/refreshCache.ts create mode 100644 packages/bsky/src/lexicon/types/app/bsky/purchase/getFeatures.ts create mode 100644 packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts create mode 100644 packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts create mode 100644 packages/bsky/src/lexicon/types/app/bsky/purchase/refreshCache.ts create mode 100644 packages/ozone/src/lexicon/types/app/bsky/purchase/getFeatures.ts create mode 100644 packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts create mode 100644 packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts create mode 100644 packages/ozone/src/lexicon/types/app/bsky/purchase/refreshCache.ts create mode 100644 packages/pds/src/lexicon/types/app/bsky/purchase/getFeatures.ts create mode 100644 packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts create mode 100644 packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts create mode 100644 packages/pds/src/lexicon/types/app/bsky/purchase/refreshCache.ts diff --git a/packages/api/src/client/index.ts b/packages/api/src/client/index.ts index 9ee329fe593..4f5c24478c1 100644 --- a/packages/api/src/client/index.ts +++ b/packages/api/src/client/index.ts @@ -161,6 +161,10 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +import * as AppBskyPurchaseGetFeatures from './types/app/bsky/purchase/getFeatures' +import * as AppBskyPurchaseGetSubscriptionGroup from './types/app/bsky/purchase/getSubscriptionGroup' +import * as AppBskyPurchaseGetSubscriptions from './types/app/bsky/purchase/getSubscriptions' +import * as AppBskyPurchaseRefreshCache from './types/app/bsky/purchase/refreshCache' import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' @@ -388,6 +392,10 @@ export * as AppBskyNotificationListNotifications from './types/app/bsky/notifica export * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +export * as AppBskyPurchaseGetFeatures from './types/app/bsky/purchase/getFeatures' +export * as AppBskyPurchaseGetSubscriptionGroup from './types/app/bsky/purchase/getSubscriptionGroup' +export * as AppBskyPurchaseGetSubscriptions from './types/app/bsky/purchase/getSubscriptions' +export * as AppBskyPurchaseRefreshCache from './types/app/bsky/purchase/refreshCache' export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' @@ -1486,6 +1494,7 @@ export class AppBskyNS { graph: AppBskyGraphNS labeler: AppBskyLabelerNS notification: AppBskyNotificationNS + purchase: AppBskyPurchaseNS richtext: AppBskyRichtextNS unspecced: AppBskyUnspeccedNS video: AppBskyVideoNS @@ -1498,6 +1507,7 @@ export class AppBskyNS { this.graph = new AppBskyGraphNS(client) this.labeler = new AppBskyLabelerNS(client) this.notification = new AppBskyNotificationNS(client) + this.purchase = new AppBskyPurchaseNS(client) this.richtext = new AppBskyRichtextNS(client) this.unspecced = new AppBskyUnspeccedNS(client) this.video = new AppBskyVideoNS(client) @@ -3026,6 +3036,62 @@ export class AppBskyNotificationNS { } } +export class AppBskyPurchaseNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } + + getFeatures( + params?: AppBskyPurchaseGetFeatures.QueryParams, + opts?: AppBskyPurchaseGetFeatures.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.purchase.getFeatures', + params, + undefined, + opts, + ) + } + + getSubscriptionGroup( + params?: AppBskyPurchaseGetSubscriptionGroup.QueryParams, + opts?: AppBskyPurchaseGetSubscriptionGroup.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.purchase.getSubscriptionGroup', + params, + undefined, + opts, + ) + } + + getSubscriptions( + params?: AppBskyPurchaseGetSubscriptions.QueryParams, + opts?: AppBskyPurchaseGetSubscriptions.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.purchase.getSubscriptions', + params, + undefined, + opts, + ) + } + + refreshCache( + data?: AppBskyPurchaseRefreshCache.InputSchema, + opts?: AppBskyPurchaseRefreshCache.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.purchase.refreshCache', + opts?.qp, + data, + opts, + ) + } +} + export class AppBskyRichtextNS { _client: XrpcClient diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 723586b8f86..04d754d6a9f 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -9133,6 +9133,192 @@ export const schemaDict = { }, }, }, + AppBskyPurchaseGetFeatures: { + lexicon: 1, + id: 'app.bsky.purchase.getFeatures', + defs: { + main: { + type: 'query', + description: + 'Enumerate unlocked paid feature flags for the requesting account. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['features'], + properties: { + features: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getFeatures#features', + }, + }, + }, + }, + }, + features: { + type: 'object', + required: [], + properties: { + customProfileColor: { + type: 'boolean', + description: + 'Indicates to client apps to allow the requesting account to customize the profile color.', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptionGroup: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptionGroup', + defs: { + main: { + type: 'query', + description: + 'Gets a subscription group and its offerings for the target platform. Requires auth.', + parameters: { + type: 'params', + required: ['group', 'platform'], + properties: { + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [], + properties: { + group: { + type: 'string', + }, + offerings: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptionGroup#offering', + }, + }, + }, + }, + }, + }, + offering: { + type: 'object', + required: [], + properties: { + id: { + type: 'string', + }, + platform: { + type: 'string', + }, + product: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptions: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptions', + defs: { + main: { + type: 'query', + description: + 'Enumerate subscriptions for the requesting account, and the email used in the purchase. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subscriptions'], + properties: { + email: { + type: 'string', + }, + subscriptions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptions#subscription', + }, + }, + }, + }, + }, + }, + subscription: { + type: 'object', + required: [], + properties: { + status: { + type: 'string', + }, + renewalStatus: { + type: 'string', + }, + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + offering: { + type: 'string', + }, + periodEndsAt: { + type: 'string', + format: 'datetime', + }, + periodStartsAt: { + type: 'string', + format: 'datetime', + }, + purchasedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + AppBskyPurchaseRefreshCache: { + lexicon: 1, + id: 'app.bsky.purchase.refreshCache', + defs: { + main: { + type: 'procedure', + description: + 'Refresh the purchase cache for the requesting account or for another account if the role authorizes it. Requires auth.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + properties: {}, + }, + }, + }, + }, + }, AppBskyRichtextFacet: { lexicon: 1, id: 'app.bsky.richtext.facet', @@ -13489,8 +13675,9 @@ export const schemaDict = { }, }, }, -} -export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] +} as const satisfies Record + +export const schemas = Object.values(schemaDict) export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { ComAtprotoAdminDefs: 'com.atproto.admin.defs', @@ -13662,6 +13849,10 @@ export const ids = { AppBskyNotificationPutPreferences: 'app.bsky.notification.putPreferences', AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush', AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', + AppBskyPurchaseGetFeatures: 'app.bsky.purchase.getFeatures', + AppBskyPurchaseGetSubscriptionGroup: 'app.bsky.purchase.getSubscriptionGroup', + AppBskyPurchaseGetSubscriptions: 'app.bsky.purchase.getSubscriptions', + AppBskyPurchaseRefreshCache: 'app.bsky.purchase.refreshCache', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig', diff --git a/packages/api/src/client/types/app/bsky/purchase/getFeatures.ts b/packages/api/src/client/types/app/bsky/purchase/getFeatures.ts new file mode 100644 index 00000000000..5d44934b832 --- /dev/null +++ b/packages/api/src/client/types/app/bsky/purchase/getFeatures.ts @@ -0,0 +1,50 @@ +/** + * 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 { + features: Features + [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 Features { + /** Indicates to client apps to allow the requesting account to customize the profile color. */ + customProfileColor?: boolean + [k: string]: unknown +} + +export function isFeatures(v: unknown): v is Features { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getFeatures#features' + ) +} + +export function validateFeatures(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getFeatures#features', v) +} diff --git a/packages/api/src/client/types/app/bsky/purchase/getSubscriptionGroup.ts b/packages/api/src/client/types/app/bsky/purchase/getSubscriptionGroup.ts new file mode 100644 index 00000000000..d8d96558ec5 --- /dev/null +++ b/packages/api/src/client/types/app/bsky/purchase/getSubscriptionGroup.ts @@ -0,0 +1,55 @@ +/** + * 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 { + group: string + platform: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + group?: string + offerings?: Offering[] + [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 Offering { + id?: string + platform?: string + product?: string + [k: string]: unknown +} + +export function isOffering(v: unknown): v is Offering { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getSubscriptionGroup#offering' + ) +} + +export function validateOffering(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptionGroup#offering', v) +} diff --git a/packages/api/src/client/types/app/bsky/purchase/getSubscriptions.ts b/packages/api/src/client/types/app/bsky/purchase/getSubscriptions.ts new file mode 100644 index 00000000000..dc5e72944be --- /dev/null +++ b/packages/api/src/client/types/app/bsky/purchase/getSubscriptions.ts @@ -0,0 +1,57 @@ +/** + * 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 { + email?: string + 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.purchase.getSubscriptions#subscription' + ) +} + +export function validateSubscription(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptions#subscription', v) +} diff --git a/packages/api/src/client/types/app/bsky/purchase/refreshCache.ts b/packages/api/src/client/types/app/bsky/purchase/refreshCache.ts new file mode 100644 index 00000000000..b08e69c7c63 --- /dev/null +++ b/packages/api/src/client/types/app/bsky/purchase/refreshCache.ts @@ -0,0 +1,36 @@ +/** + * 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 interface InputSchema { + did: string + [k: string]: unknown +} + +export interface OutputSchema { + [k: string]: unknown +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap + qp?: QueryParams + encoding?: 'application/json' +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/packages/bsky/src/lexicon/index.ts b/packages/bsky/src/lexicon/index.ts index 7a8a13149ed..f17459e0e1d 100644 --- a/packages/bsky/src/lexicon/index.ts +++ b/packages/bsky/src/lexicon/index.ts @@ -136,6 +136,10 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +import * as AppBskyPurchaseGetFeatures from './types/app/bsky/purchase/getFeatures' +import * as AppBskyPurchaseGetSubscriptionGroup from './types/app/bsky/purchase/getSubscriptionGroup' +import * as AppBskyPurchaseGetSubscriptions from './types/app/bsky/purchase/getSubscriptions' +import * as AppBskyPurchaseRefreshCache from './types/app/bsky/purchase/refreshCache' import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton' @@ -1156,6 +1160,7 @@ export class AppBskyNS { graph: AppBskyGraphNS labeler: AppBskyLabelerNS notification: AppBskyNotificationNS + purchase: AppBskyPurchaseNS richtext: AppBskyRichtextNS unspecced: AppBskyUnspeccedNS video: AppBskyVideoNS @@ -1168,6 +1173,7 @@ export class AppBskyNS { this.graph = new AppBskyGraphNS(server) this.labeler = new AppBskyLabelerNS(server) this.notification = new AppBskyNotificationNS(server) + this.purchase = new AppBskyPurchaseNS(server) this.richtext = new AppBskyRichtextNS(server) this.unspecced = new AppBskyUnspeccedNS(server) this.video = new AppBskyVideoNS(server) @@ -1794,6 +1800,58 @@ export class AppBskyNotificationNS { } } +export class AppBskyPurchaseNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getFeatures( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetFeatures.Handler>, + AppBskyPurchaseGetFeatures.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getFeatures' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptionGroup( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptionGroup.Handler>, + AppBskyPurchaseGetSubscriptionGroup.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptionGroup' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptions( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptions.Handler>, + AppBskyPurchaseGetSubscriptions.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptions' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + refreshCache( + cfg: ConfigOf< + AV, + AppBskyPurchaseRefreshCache.Handler>, + AppBskyPurchaseRefreshCache.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.refreshCache' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + export class AppBskyRichtextNS { _server: Server diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index abfa42121c7..3cc57b9051b 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -9133,6 +9133,192 @@ export const schemaDict = { }, }, }, + AppBskyPurchaseGetFeatures: { + lexicon: 1, + id: 'app.bsky.purchase.getFeatures', + defs: { + main: { + type: 'query', + description: + 'Enumerate unlocked paid feature flags for the requesting account. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['features'], + properties: { + features: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getFeatures#features', + }, + }, + }, + }, + }, + features: { + type: 'object', + required: [], + properties: { + customProfileColor: { + type: 'boolean', + description: + 'Indicates to client apps to allow the requesting account to customize the profile color.', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptionGroup: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptionGroup', + defs: { + main: { + type: 'query', + description: + 'Gets a subscription group and its offerings for the target platform. Requires auth.', + parameters: { + type: 'params', + required: ['group', 'platform'], + properties: { + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [], + properties: { + group: { + type: 'string', + }, + offerings: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptionGroup#offering', + }, + }, + }, + }, + }, + }, + offering: { + type: 'object', + required: [], + properties: { + id: { + type: 'string', + }, + platform: { + type: 'string', + }, + product: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptions: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptions', + defs: { + main: { + type: 'query', + description: + 'Enumerate subscriptions for the requesting account, and the email used in the purchase. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subscriptions'], + properties: { + email: { + type: 'string', + }, + subscriptions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptions#subscription', + }, + }, + }, + }, + }, + }, + subscription: { + type: 'object', + required: [], + properties: { + status: { + type: 'string', + }, + renewalStatus: { + type: 'string', + }, + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + offering: { + type: 'string', + }, + periodEndsAt: { + type: 'string', + format: 'datetime', + }, + periodStartsAt: { + type: 'string', + format: 'datetime', + }, + purchasedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + AppBskyPurchaseRefreshCache: { + lexicon: 1, + id: 'app.bsky.purchase.refreshCache', + defs: { + main: { + type: 'procedure', + description: + 'Refresh the purchase cache for the requesting account or for another account if the role authorizes it. Requires auth.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + properties: {}, + }, + }, + }, + }, + }, AppBskyRichtextFacet: { lexicon: 1, id: 'app.bsky.richtext.facet', @@ -10728,8 +10914,9 @@ export const schemaDict = { }, }, }, -} -export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] +} as const satisfies Record + +export const schemas = Object.values(schemaDict) export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { ComAtprotoAdminDefs: 'com.atproto.admin.defs', @@ -10901,6 +11088,10 @@ export const ids = { AppBskyNotificationPutPreferences: 'app.bsky.notification.putPreferences', AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush', AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', + AppBskyPurchaseGetFeatures: 'app.bsky.purchase.getFeatures', + AppBskyPurchaseGetSubscriptionGroup: 'app.bsky.purchase.getSubscriptionGroup', + AppBskyPurchaseGetSubscriptions: 'app.bsky.purchase.getSubscriptions', + AppBskyPurchaseRefreshCache: 'app.bsky.purchase.refreshCache', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig', diff --git a/packages/bsky/src/lexicon/types/app/bsky/purchase/getFeatures.ts b/packages/bsky/src/lexicon/types/app/bsky/purchase/getFeatures.ts new file mode 100644 index 00000000000..6ef9007fec8 --- /dev/null +++ b/packages/bsky/src/lexicon/types/app/bsky/purchase/getFeatures.ts @@ -0,0 +1,61 @@ +/** + * 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 { + features: Features + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Features { + /** Indicates to client apps to allow the requesting account to customize the profile color. */ + customProfileColor?: boolean + [k: string]: unknown +} + +export function isFeatures(v: unknown): v is Features { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getFeatures#features' + ) +} + +export function validateFeatures(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getFeatures#features', v) +} diff --git a/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts b/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts new file mode 100644 index 00000000000..3ef136e15dc --- /dev/null +++ b/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts @@ -0,0 +1,66 @@ +/** + * 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 { + group: string + platform: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + group?: string + offerings?: Offering[] + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Offering { + id?: string + platform?: string + product?: string + [k: string]: unknown +} + +export function isOffering(v: unknown): v is Offering { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getSubscriptionGroup#offering' + ) +} + +export function validateOffering(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptionGroup#offering', v) +} diff --git a/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts b/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts new file mode 100644 index 00000000000..0c587b4bb99 --- /dev/null +++ b/packages/bsky/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts @@ -0,0 +1,68 @@ +/** + * 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 { + email?: string + 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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | 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.purchase.getSubscriptions#subscription' + ) +} + +export function validateSubscription(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptions#subscription', v) +} diff --git a/packages/bsky/src/lexicon/types/app/bsky/purchase/refreshCache.ts b/packages/bsky/src/lexicon/types/app/bsky/purchase/refreshCache.ts new file mode 100644 index 00000000000..dad0449713c --- /dev/null +++ b/packages/bsky/src/lexicon/types/app/bsky/purchase/refreshCache.ts @@ -0,0 +1,48 @@ +/** + * 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 interface InputSchema { + did: string + [k: string]: unknown +} + +export interface OutputSchema { + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/packages/bsky/src/proto/bsky_connect.ts b/packages/bsky/src/proto/bsky_connect.ts index f26731731f1..f9d5a312a0d 100644 --- a/packages/bsky/src/proto/bsky_connect.ts +++ b/packages/bsky/src/proto/bsky_connect.ts @@ -138,6 +138,8 @@ import { GetPostReplyCountsResponse, GetProfileRecordsRequest, GetProfileRecordsResponse, + GetPurchaseEntitlementsRequest, + GetPurchaseEntitlementsResponse, GetQuotesBySubjectSortedRequest, GetQuotesBySubjectSortedResponse, GetRecordTakedownRequest, @@ -963,6 +965,17 @@ export const Service = { O: GetFollowsFollowingResponse, kind: MethodKind.Unary, }, + /** + * Purchase + * + * @generated from rpc bsky.Service.GetPurchaseEntitlements + */ + getPurchaseEntitlements: { + name: 'GetPurchaseEntitlements', + I: GetPurchaseEntitlementsRequest, + O: GetPurchaseEntitlementsResponse, + kind: MethodKind.Unary, + }, /** * Ping * diff --git a/packages/bsky/src/proto/bsky_pb.ts b/packages/bsky/src/proto/bsky_pb.ts index 74f0f04a604..e018eec21ee 100644 --- a/packages/bsky/src/proto/bsky_pb.ts +++ b/packages/bsky/src/proto/bsky_pb.ts @@ -11246,6 +11246,195 @@ export class GetFollowsFollowingResponse extends Message { + /** + * @generated from field: repeated string entitlements = 1; + */ + entitlements: string[] = [] + + /** + * @generated from field: google.protobuf.Timestamp created_at = 2; + */ + createdAt?: Timestamp + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsky.PurchaseEntitlement' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'entitlements', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { no: 2, name: 'created_at', kind: 'message', T: Timestamp }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PurchaseEntitlement { + return new PurchaseEntitlement().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): PurchaseEntitlement { + return new PurchaseEntitlement().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): PurchaseEntitlement { + return new PurchaseEntitlement().fromJsonString(jsonString, options) + } + + static equals( + a: PurchaseEntitlement | PlainMessage | undefined, + b: PurchaseEntitlement | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PurchaseEntitlement, a, b) + } +} + +/** + * @generated from message bsky.GetPurchaseEntitlementsRequest + */ +export class GetPurchaseEntitlementsRequest extends Message { + /** + * @generated from field: repeated string dids = 1; + */ + dids: string[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsky.GetPurchaseEntitlementsRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'dids', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetPurchaseEntitlementsRequest { + return new GetPurchaseEntitlementsRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetPurchaseEntitlementsRequest { + return new GetPurchaseEntitlementsRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetPurchaseEntitlementsRequest { + return new GetPurchaseEntitlementsRequest().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetPurchaseEntitlementsRequest + | PlainMessage + | undefined, + b: + | GetPurchaseEntitlementsRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetPurchaseEntitlementsRequest, a, b) + } +} + +/** + * @generated from message bsky.GetPurchaseEntitlementsResponse + */ +export class GetPurchaseEntitlementsResponse extends Message { + /** + * @generated from field: repeated bsky.PurchaseEntitlement purchaseEntitlements = 1; + */ + purchaseEntitlements: PurchaseEntitlement[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsky.GetPurchaseEntitlementsResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'purchaseEntitlements', + kind: 'message', + T: PurchaseEntitlement, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetPurchaseEntitlementsResponse { + return new GetPurchaseEntitlementsResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetPurchaseEntitlementsResponse { + return new GetPurchaseEntitlementsResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetPurchaseEntitlementsResponse { + return new GetPurchaseEntitlementsResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetPurchaseEntitlementsResponse + | PlainMessage + | undefined, + b: + | GetPurchaseEntitlementsResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetPurchaseEntitlementsResponse, a, b) + } +} + /** * Ping * diff --git a/packages/bsky/src/proto/bsync_connect.ts b/packages/bsky/src/proto/bsync_connect.ts index 9204f8d3665..6674e0f09da 100644 --- a/packages/bsky/src/proto/bsync_connect.ts +++ b/packages/bsky/src/proto/bsync_connect.ts @@ -8,6 +8,12 @@ import { AddMuteOperationResponse, AddNotifOperationRequest, AddNotifOperationResponse, + AddPurchaseOperationRequest, + AddPurchaseOperationResponse, + GetSubscriptionGroupRequest, + GetSubscriptionGroupResponse, + GetSubscriptionsRequest, + GetSubscriptionsResponse, PingRequest, PingResponse, ScanMuteOperationsRequest, @@ -61,6 +67,35 @@ export const Service = { O: ScanNotifOperationsResponse, kind: MethodKind.Unary, }, + /** + * Purchase + * + * @generated from rpc bsync.Service.AddPurchaseOperation + */ + addPurchaseOperation: { + name: 'AddPurchaseOperation', + I: AddPurchaseOperationRequest, + O: AddPurchaseOperationResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc bsync.Service.GetSubscriptions + */ + getSubscriptions: { + name: 'GetSubscriptions', + I: GetSubscriptionsRequest, + O: GetSubscriptionsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc bsync.Service.GetSubscriptionGroup + */ + getSubscriptionGroup: { + name: 'GetSubscriptionGroup', + I: GetSubscriptionGroupRequest, + O: GetSubscriptionGroupResponse, + kind: MethodKind.Unary, + }, /** * Ping * diff --git a/packages/bsky/src/proto/bsync_pb.ts b/packages/bsky/src/proto/bsync_pb.ts index d38a7a6b6db..d2e0c811d0b 100644 --- a/packages/bsky/src/proto/bsync_pb.ts +++ b/packages/bsky/src/proto/bsync_pb.ts @@ -11,7 +11,7 @@ import type { PartialMessage, PlainMessage, } from '@bufbuild/protobuf' -import { Message, proto3 } from '@bufbuild/protobuf' +import { Message, proto3, Timestamp } from '@bufbuild/protobuf' /** * @generated from message bsync.MuteOperation @@ -689,6 +689,455 @@ export class ScanNotifOperationsResponse extends Message { + /** + * @generated from field: string actor_did = 1; + */ + actorDid = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.AddPurchaseOperationRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | AddPurchaseOperationRequest + | PlainMessage + | undefined, + b: + | AddPurchaseOperationRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(AddPurchaseOperationRequest, a, b) + } +} + +/** + * @generated from message bsync.AddPurchaseOperationResponse + */ +export class AddPurchaseOperationResponse extends Message { + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.AddPurchaseOperationResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | AddPurchaseOperationResponse + | PlainMessage + | undefined, + b: + | AddPurchaseOperationResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(AddPurchaseOperationResponse, a, b) + } +} + +/** + * @generated from message bsync.Subscription + */ +export class Subscription extends Message { + /** + * @generated from field: string status = 1; + */ + status = '' + + /** + * @generated from field: string renewalStatus = 2; + */ + renewalStatus = '' + + /** + * @generated from field: string group = 3; + */ + group = '' + + /** + * @generated from field: string platform = 4; + */ + platform = '' + + /** + * @generated from field: string offering = 5; + */ + offering = '' + + /** + * @generated from field: google.protobuf.Timestamp periodEndsAt = 6; + */ + periodEndsAt?: Timestamp + + /** + * @generated from field: google.protobuf.Timestamp periodStartsAt = 7; + */ + periodStartsAt?: Timestamp + + /** + * @generated from field: google.protobuf.Timestamp purchasedAt = 8; + */ + purchasedAt?: Timestamp + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.Subscription' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'status', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'renewalStatus', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'group', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'platform', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'offering', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'periodEndsAt', kind: 'message', T: Timestamp }, + { no: 7, name: 'periodStartsAt', kind: 'message', T: Timestamp }, + { no: 8, name: 'purchasedAt', kind: 'message', T: Timestamp }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): Subscription { + return new Subscription().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): Subscription { + return new Subscription().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): Subscription { + return new Subscription().fromJsonString(jsonString, options) + } + + static equals( + a: Subscription | PlainMessage | undefined, + b: Subscription | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Subscription, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionsRequest + */ +export class GetSubscriptionsRequest extends Message { + /** + * @generated from field: string actor_did = 1; + */ + actorDid = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionsRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionsRequest { + return new GetSubscriptionsRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionsRequest { + return new GetSubscriptionsRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionsRequest { + return new GetSubscriptionsRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | GetSubscriptionsRequest + | PlainMessage + | undefined, + b: + | GetSubscriptionsRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionsRequest, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionsResponse + */ +export class GetSubscriptionsResponse extends Message { + /** + * @generated from field: string email = 1; + */ + email = '' + + /** + * @generated from field: repeated bsync.Subscription subscriptions = 2; + */ + subscriptions: Subscription[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionsResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'email', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'subscriptions', + kind: 'message', + T: Subscription, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionsResponse { + return new GetSubscriptionsResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionsResponse { + return new GetSubscriptionsResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionsResponse { + return new GetSubscriptionsResponse().fromJsonString(jsonString, options) + } + + static equals( + a: + | GetSubscriptionsResponse + | PlainMessage + | undefined, + b: + | GetSubscriptionsResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionsResponse, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionGroupRequest + */ +export class GetSubscriptionGroupRequest extends Message { + /** + * @generated from field: string group = 1; + */ + group = '' + + /** + * @generated from field: string platform = 2; + */ + platform = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionGroupRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'group', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'platform', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | GetSubscriptionGroupRequest + | PlainMessage + | undefined, + b: + | GetSubscriptionGroupRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionGroupRequest, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionGroupResponse + */ +export class GetSubscriptionGroupResponse extends Message { + /** + * @generated from field: repeated string products = 1; + */ + products: string[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionGroupResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'products', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetSubscriptionGroupResponse + | PlainMessage + | undefined, + b: + | GetSubscriptionGroupResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionGroupResponse, a, b) + } +} + /** * Ping * diff --git a/packages/bsync/src/proto/bsync_connect.ts b/packages/bsync/src/proto/bsync_connect.ts index 9204f8d3665..c2d8caac987 100644 --- a/packages/bsync/src/proto/bsync_connect.ts +++ b/packages/bsync/src/proto/bsync_connect.ts @@ -8,6 +8,12 @@ import { AddMuteOperationResponse, AddNotifOperationRequest, AddNotifOperationResponse, + AddPurchaseOperationRequest, + AddPurchaseOperationResponse, + GetActiveSubscriptionsRequest, + GetActiveSubscriptionsResponse, + GetSubscriptionGroupRequest, + GetSubscriptionGroupResponse, PingRequest, PingResponse, ScanMuteOperationsRequest, @@ -61,6 +67,35 @@ export const Service = { O: ScanNotifOperationsResponse, kind: MethodKind.Unary, }, + /** + * Purchase + * + * @generated from rpc bsync.Service.AddPurchaseOperation + */ + addPurchaseOperation: { + name: 'AddPurchaseOperation', + I: AddPurchaseOperationRequest, + O: AddPurchaseOperationResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc bsync.Service.GetActiveSubscriptions + */ + getActiveSubscriptions: { + name: 'GetActiveSubscriptions', + I: GetActiveSubscriptionsRequest, + O: GetActiveSubscriptionsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc bsync.Service.GetSubscriptionGroup + */ + getSubscriptionGroup: { + name: 'GetSubscriptionGroup', + I: GetSubscriptionGroupRequest, + O: GetSubscriptionGroupResponse, + kind: MethodKind.Unary, + }, /** * Ping * diff --git a/packages/bsync/src/proto/bsync_pb.ts b/packages/bsync/src/proto/bsync_pb.ts index d38a7a6b6db..74c8ed76d75 100644 --- a/packages/bsync/src/proto/bsync_pb.ts +++ b/packages/bsync/src/proto/bsync_pb.ts @@ -11,7 +11,7 @@ import type { PartialMessage, PlainMessage, } from '@bufbuild/protobuf' -import { Message, proto3 } from '@bufbuild/protobuf' +import { Message, proto3, Timestamp } from '@bufbuild/protobuf' /** * @generated from message bsync.MuteOperation @@ -689,6 +689,455 @@ export class ScanNotifOperationsResponse extends Message { + /** + * @generated from field: string actor_did = 1; + */ + actorDid = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.AddPurchaseOperationRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AddPurchaseOperationRequest { + return new AddPurchaseOperationRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | AddPurchaseOperationRequest + | PlainMessage + | undefined, + b: + | AddPurchaseOperationRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(AddPurchaseOperationRequest, a, b) + } +} + +/** + * @generated from message bsync.AddPurchaseOperationResponse + */ +export class AddPurchaseOperationResponse extends Message { + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.AddPurchaseOperationResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AddPurchaseOperationResponse { + return new AddPurchaseOperationResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | AddPurchaseOperationResponse + | PlainMessage + | undefined, + b: + | AddPurchaseOperationResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(AddPurchaseOperationResponse, a, b) + } +} + +/** + * @generated from message bsync.Subscription + */ +export class Subscription extends Message { + /** + * @generated from field: string status = 1; + */ + status = '' + + /** + * @generated from field: string renewalStatus = 2; + */ + renewalStatus = '' + + /** + * @generated from field: string group = 3; + */ + group = '' + + /** + * @generated from field: string platform = 4; + */ + platform = '' + + /** + * @generated from field: string offering = 5; + */ + offering = '' + + /** + * @generated from field: google.protobuf.Timestamp periodEndsAt = 6; + */ + periodEndsAt?: Timestamp + + /** + * @generated from field: google.protobuf.Timestamp periodStartsAt = 7; + */ + periodStartsAt?: Timestamp + + /** + * @generated from field: google.protobuf.Timestamp purchasedAt = 8; + */ + purchasedAt?: Timestamp + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.Subscription' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'status', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'renewalStatus', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'group', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'platform', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'offering', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'periodEndsAt', kind: 'message', T: Timestamp }, + { no: 7, name: 'periodStartsAt', kind: 'message', T: Timestamp }, + { no: 8, name: 'purchasedAt', kind: 'message', T: Timestamp }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): Subscription { + return new Subscription().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): Subscription { + return new Subscription().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): Subscription { + return new Subscription().fromJsonString(jsonString, options) + } + + static equals( + a: Subscription | PlainMessage | undefined, + b: Subscription | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Subscription, a, b) + } +} + +/** + * @generated from message bsync.GetActiveSubscriptionsRequest + */ +export class GetActiveSubscriptionsRequest extends Message { + /** + * @generated from field: string actor_did = 1; + */ + actorDid = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetActiveSubscriptionsRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetActiveSubscriptionsRequest { + return new GetActiveSubscriptionsRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetActiveSubscriptionsRequest { + return new GetActiveSubscriptionsRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetActiveSubscriptionsRequest { + return new GetActiveSubscriptionsRequest().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetActiveSubscriptionsRequest + | PlainMessage + | undefined, + b: + | GetActiveSubscriptionsRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetActiveSubscriptionsRequest, a, b) + } +} + +/** + * @generated from message bsync.GetActiveSubscriptionsResponse + */ +export class GetActiveSubscriptionsResponse extends Message { + /** + * @generated from field: repeated bsync.Subscription subscriptions = 1; + */ + subscriptions: Subscription[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetActiveSubscriptionsResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'subscriptions', + kind: 'message', + T: Subscription, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetActiveSubscriptionsResponse { + return new GetActiveSubscriptionsResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetActiveSubscriptionsResponse { + return new GetActiveSubscriptionsResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetActiveSubscriptionsResponse { + return new GetActiveSubscriptionsResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetActiveSubscriptionsResponse + | PlainMessage + | undefined, + b: + | GetActiveSubscriptionsResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetActiveSubscriptionsResponse, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionGroupRequest + */ +export class GetSubscriptionGroupRequest extends Message { + /** + * @generated from field: string group = 1; + */ + group = '' + + /** + * @generated from field: string platform = 2; + */ + platform = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionGroupRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'group', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'platform', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionGroupRequest { + return new GetSubscriptionGroupRequest().fromJsonString(jsonString, options) + } + + static equals( + a: + | GetSubscriptionGroupRequest + | PlainMessage + | undefined, + b: + | GetSubscriptionGroupRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionGroupRequest, a, b) + } +} + +/** + * @generated from message bsync.GetSubscriptionGroupResponse + */ +export class GetSubscriptionGroupResponse extends Message { + /** + * @generated from field: repeated string products = 1; + */ + products: string[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'bsync.GetSubscriptionGroupResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'products', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetSubscriptionGroupResponse { + return new GetSubscriptionGroupResponse().fromJsonString( + jsonString, + options, + ) + } + + static equals( + a: + | GetSubscriptionGroupResponse + | PlainMessage + | undefined, + b: + | GetSubscriptionGroupResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(GetSubscriptionGroupResponse, a, b) + } +} + /** * Ping * diff --git a/packages/ozone/src/lexicon/index.ts b/packages/ozone/src/lexicon/index.ts index b4c27f52018..bd0a6ac3a20 100644 --- a/packages/ozone/src/lexicon/index.ts +++ b/packages/ozone/src/lexicon/index.ts @@ -136,6 +136,10 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +import * as AppBskyPurchaseGetFeatures from './types/app/bsky/purchase/getFeatures' +import * as AppBskyPurchaseGetSubscriptionGroup from './types/app/bsky/purchase/getSubscriptionGroup' +import * as AppBskyPurchaseGetSubscriptions from './types/app/bsky/purchase/getSubscriptions' +import * as AppBskyPurchaseRefreshCache from './types/app/bsky/purchase/refreshCache' import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton' @@ -1199,6 +1203,7 @@ export class AppBskyNS { graph: AppBskyGraphNS labeler: AppBskyLabelerNS notification: AppBskyNotificationNS + purchase: AppBskyPurchaseNS richtext: AppBskyRichtextNS unspecced: AppBskyUnspeccedNS video: AppBskyVideoNS @@ -1211,6 +1216,7 @@ export class AppBskyNS { this.graph = new AppBskyGraphNS(server) this.labeler = new AppBskyLabelerNS(server) this.notification = new AppBskyNotificationNS(server) + this.purchase = new AppBskyPurchaseNS(server) this.richtext = new AppBskyRichtextNS(server) this.unspecced = new AppBskyUnspeccedNS(server) this.video = new AppBskyVideoNS(server) @@ -1837,6 +1843,58 @@ export class AppBskyNotificationNS { } } +export class AppBskyPurchaseNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getFeatures( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetFeatures.Handler>, + AppBskyPurchaseGetFeatures.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getFeatures' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptionGroup( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptionGroup.Handler>, + AppBskyPurchaseGetSubscriptionGroup.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptionGroup' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptions( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptions.Handler>, + AppBskyPurchaseGetSubscriptions.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptions' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + refreshCache( + cfg: ConfigOf< + AV, + AppBskyPurchaseRefreshCache.Handler>, + AppBskyPurchaseRefreshCache.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.refreshCache' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + export class AppBskyRichtextNS { _server: Server diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index 723586b8f86..04d754d6a9f 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -9133,6 +9133,192 @@ export const schemaDict = { }, }, }, + AppBskyPurchaseGetFeatures: { + lexicon: 1, + id: 'app.bsky.purchase.getFeatures', + defs: { + main: { + type: 'query', + description: + 'Enumerate unlocked paid feature flags for the requesting account. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['features'], + properties: { + features: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getFeatures#features', + }, + }, + }, + }, + }, + features: { + type: 'object', + required: [], + properties: { + customProfileColor: { + type: 'boolean', + description: + 'Indicates to client apps to allow the requesting account to customize the profile color.', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptionGroup: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptionGroup', + defs: { + main: { + type: 'query', + description: + 'Gets a subscription group and its offerings for the target platform. Requires auth.', + parameters: { + type: 'params', + required: ['group', 'platform'], + properties: { + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [], + properties: { + group: { + type: 'string', + }, + offerings: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptionGroup#offering', + }, + }, + }, + }, + }, + }, + offering: { + type: 'object', + required: [], + properties: { + id: { + type: 'string', + }, + platform: { + type: 'string', + }, + product: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptions: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptions', + defs: { + main: { + type: 'query', + description: + 'Enumerate subscriptions for the requesting account, and the email used in the purchase. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subscriptions'], + properties: { + email: { + type: 'string', + }, + subscriptions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptions#subscription', + }, + }, + }, + }, + }, + }, + subscription: { + type: 'object', + required: [], + properties: { + status: { + type: 'string', + }, + renewalStatus: { + type: 'string', + }, + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + offering: { + type: 'string', + }, + periodEndsAt: { + type: 'string', + format: 'datetime', + }, + periodStartsAt: { + type: 'string', + format: 'datetime', + }, + purchasedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + AppBskyPurchaseRefreshCache: { + lexicon: 1, + id: 'app.bsky.purchase.refreshCache', + defs: { + main: { + type: 'procedure', + description: + 'Refresh the purchase cache for the requesting account or for another account if the role authorizes it. Requires auth.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + properties: {}, + }, + }, + }, + }, + }, AppBskyRichtextFacet: { lexicon: 1, id: 'app.bsky.richtext.facet', @@ -13489,8 +13675,9 @@ export const schemaDict = { }, }, }, -} -export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] +} as const satisfies Record + +export const schemas = Object.values(schemaDict) export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { ComAtprotoAdminDefs: 'com.atproto.admin.defs', @@ -13662,6 +13849,10 @@ export const ids = { AppBskyNotificationPutPreferences: 'app.bsky.notification.putPreferences', AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush', AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', + AppBskyPurchaseGetFeatures: 'app.bsky.purchase.getFeatures', + AppBskyPurchaseGetSubscriptionGroup: 'app.bsky.purchase.getSubscriptionGroup', + AppBskyPurchaseGetSubscriptions: 'app.bsky.purchase.getSubscriptions', + AppBskyPurchaseRefreshCache: 'app.bsky.purchase.refreshCache', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig', diff --git a/packages/ozone/src/lexicon/types/app/bsky/purchase/getFeatures.ts b/packages/ozone/src/lexicon/types/app/bsky/purchase/getFeatures.ts new file mode 100644 index 00000000000..6ef9007fec8 --- /dev/null +++ b/packages/ozone/src/lexicon/types/app/bsky/purchase/getFeatures.ts @@ -0,0 +1,61 @@ +/** + * 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 { + features: Features + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Features { + /** Indicates to client apps to allow the requesting account to customize the profile color. */ + customProfileColor?: boolean + [k: string]: unknown +} + +export function isFeatures(v: unknown): v is Features { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getFeatures#features' + ) +} + +export function validateFeatures(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getFeatures#features', v) +} diff --git a/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts b/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts new file mode 100644 index 00000000000..3ef136e15dc --- /dev/null +++ b/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts @@ -0,0 +1,66 @@ +/** + * 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 { + group: string + platform: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + group?: string + offerings?: Offering[] + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Offering { + id?: string + platform?: string + product?: string + [k: string]: unknown +} + +export function isOffering(v: unknown): v is Offering { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getSubscriptionGroup#offering' + ) +} + +export function validateOffering(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptionGroup#offering', v) +} diff --git a/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts b/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts new file mode 100644 index 00000000000..0c587b4bb99 --- /dev/null +++ b/packages/ozone/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts @@ -0,0 +1,68 @@ +/** + * 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 { + email?: string + 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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | 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.purchase.getSubscriptions#subscription' + ) +} + +export function validateSubscription(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptions#subscription', v) +} diff --git a/packages/ozone/src/lexicon/types/app/bsky/purchase/refreshCache.ts b/packages/ozone/src/lexicon/types/app/bsky/purchase/refreshCache.ts new file mode 100644 index 00000000000..dad0449713c --- /dev/null +++ b/packages/ozone/src/lexicon/types/app/bsky/purchase/refreshCache.ts @@ -0,0 +1,48 @@ +/** + * 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 interface InputSchema { + did: string + [k: string]: unknown +} + +export interface OutputSchema { + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/packages/pds/src/lexicon/index.ts b/packages/pds/src/lexicon/index.ts index b4c27f52018..bd0a6ac3a20 100644 --- a/packages/pds/src/lexicon/index.ts +++ b/packages/pds/src/lexicon/index.ts @@ -136,6 +136,10 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +import * as AppBskyPurchaseGetFeatures from './types/app/bsky/purchase/getFeatures' +import * as AppBskyPurchaseGetSubscriptionGroup from './types/app/bsky/purchase/getSubscriptionGroup' +import * as AppBskyPurchaseGetSubscriptions from './types/app/bsky/purchase/getSubscriptions' +import * as AppBskyPurchaseRefreshCache from './types/app/bsky/purchase/refreshCache' import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton' @@ -1199,6 +1203,7 @@ export class AppBskyNS { graph: AppBskyGraphNS labeler: AppBskyLabelerNS notification: AppBskyNotificationNS + purchase: AppBskyPurchaseNS richtext: AppBskyRichtextNS unspecced: AppBskyUnspeccedNS video: AppBskyVideoNS @@ -1211,6 +1216,7 @@ export class AppBskyNS { this.graph = new AppBskyGraphNS(server) this.labeler = new AppBskyLabelerNS(server) this.notification = new AppBskyNotificationNS(server) + this.purchase = new AppBskyPurchaseNS(server) this.richtext = new AppBskyRichtextNS(server) this.unspecced = new AppBskyUnspeccedNS(server) this.video = new AppBskyVideoNS(server) @@ -1837,6 +1843,58 @@ export class AppBskyNotificationNS { } } +export class AppBskyPurchaseNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getFeatures( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetFeatures.Handler>, + AppBskyPurchaseGetFeatures.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getFeatures' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptionGroup( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptionGroup.Handler>, + AppBskyPurchaseGetSubscriptionGroup.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptionGroup' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSubscriptions( + cfg: ConfigOf< + AV, + AppBskyPurchaseGetSubscriptions.Handler>, + AppBskyPurchaseGetSubscriptions.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.getSubscriptions' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + refreshCache( + cfg: ConfigOf< + AV, + AppBskyPurchaseRefreshCache.Handler>, + AppBskyPurchaseRefreshCache.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.purchase.refreshCache' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + export class AppBskyRichtextNS { _server: Server diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 723586b8f86..04d754d6a9f 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -9133,6 +9133,192 @@ export const schemaDict = { }, }, }, + AppBskyPurchaseGetFeatures: { + lexicon: 1, + id: 'app.bsky.purchase.getFeatures', + defs: { + main: { + type: 'query', + description: + 'Enumerate unlocked paid feature flags for the requesting account. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['features'], + properties: { + features: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getFeatures#features', + }, + }, + }, + }, + }, + features: { + type: 'object', + required: [], + properties: { + customProfileColor: { + type: 'boolean', + description: + 'Indicates to client apps to allow the requesting account to customize the profile color.', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptionGroup: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptionGroup', + defs: { + main: { + type: 'query', + description: + 'Gets a subscription group and its offerings for the target platform. Requires auth.', + parameters: { + type: 'params', + required: ['group', 'platform'], + properties: { + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [], + properties: { + group: { + type: 'string', + }, + offerings: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptionGroup#offering', + }, + }, + }, + }, + }, + }, + offering: { + type: 'object', + required: [], + properties: { + id: { + type: 'string', + }, + platform: { + type: 'string', + }, + product: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyPurchaseGetSubscriptions: { + lexicon: 1, + id: 'app.bsky.purchase.getSubscriptions', + defs: { + main: { + type: 'query', + description: + 'Enumerate subscriptions for the requesting account, and the email used in the purchase. Requires auth.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subscriptions'], + properties: { + email: { + type: 'string', + }, + subscriptions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.purchase.getSubscriptions#subscription', + }, + }, + }, + }, + }, + }, + subscription: { + type: 'object', + required: [], + properties: { + status: { + type: 'string', + }, + renewalStatus: { + type: 'string', + }, + group: { + type: 'string', + }, + platform: { + type: 'string', + }, + offering: { + type: 'string', + }, + periodEndsAt: { + type: 'string', + format: 'datetime', + }, + periodStartsAt: { + type: 'string', + format: 'datetime', + }, + purchasedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + AppBskyPurchaseRefreshCache: { + lexicon: 1, + id: 'app.bsky.purchase.refreshCache', + defs: { + main: { + type: 'procedure', + description: + 'Refresh the purchase cache for the requesting account or for another account if the role authorizes it. Requires auth.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + properties: {}, + }, + }, + }, + }, + }, AppBskyRichtextFacet: { lexicon: 1, id: 'app.bsky.richtext.facet', @@ -13489,8 +13675,9 @@ export const schemaDict = { }, }, }, -} -export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] +} as const satisfies Record + +export const schemas = Object.values(schemaDict) export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { ComAtprotoAdminDefs: 'com.atproto.admin.defs', @@ -13662,6 +13849,10 @@ export const ids = { AppBskyNotificationPutPreferences: 'app.bsky.notification.putPreferences', AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush', AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', + AppBskyPurchaseGetFeatures: 'app.bsky.purchase.getFeatures', + AppBskyPurchaseGetSubscriptionGroup: 'app.bsky.purchase.getSubscriptionGroup', + AppBskyPurchaseGetSubscriptions: 'app.bsky.purchase.getSubscriptions', + AppBskyPurchaseRefreshCache: 'app.bsky.purchase.refreshCache', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig', diff --git a/packages/pds/src/lexicon/types/app/bsky/purchase/getFeatures.ts b/packages/pds/src/lexicon/types/app/bsky/purchase/getFeatures.ts new file mode 100644 index 00000000000..6ef9007fec8 --- /dev/null +++ b/packages/pds/src/lexicon/types/app/bsky/purchase/getFeatures.ts @@ -0,0 +1,61 @@ +/** + * 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 { + features: Features + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Features { + /** Indicates to client apps to allow the requesting account to customize the profile color. */ + customProfileColor?: boolean + [k: string]: unknown +} + +export function isFeatures(v: unknown): v is Features { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getFeatures#features' + ) +} + +export function validateFeatures(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getFeatures#features', v) +} diff --git a/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts b/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts new file mode 100644 index 00000000000..3ef136e15dc --- /dev/null +++ b/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptionGroup.ts @@ -0,0 +1,66 @@ +/** + * 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 { + group: string + platform: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + group?: string + offerings?: Offering[] + [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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput + +export interface Offering { + id?: string + platform?: string + product?: string + [k: string]: unknown +} + +export function isOffering(v: unknown): v is Offering { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.purchase.getSubscriptionGroup#offering' + ) +} + +export function validateOffering(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptionGroup#offering', v) +} diff --git a/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts b/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts new file mode 100644 index 00000000000..0c587b4bb99 --- /dev/null +++ b/packages/pds/src/lexicon/types/app/bsky/purchase/getSubscriptions.ts @@ -0,0 +1,68 @@ +/** + * 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 { + email?: string + 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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | 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.purchase.getSubscriptions#subscription' + ) +} + +export function validateSubscription(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.purchase.getSubscriptions#subscription', v) +} diff --git a/packages/pds/src/lexicon/types/app/bsky/purchase/refreshCache.ts b/packages/pds/src/lexicon/types/app/bsky/purchase/refreshCache.ts new file mode 100644 index 00000000000..dad0449713c --- /dev/null +++ b/packages/pds/src/lexicon/types/app/bsky/purchase/refreshCache.ts @@ -0,0 +1,48 @@ +/** + * 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 interface InputSchema { + did: string + [k: string]: unknown +} + +export interface OutputSchema { + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +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 = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput