/** * #app.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { AppPromoStatus } from "../../../reddit/devvit/ads/v1/ads.js"; import type { AppVersionInfo, ComputePool } from "../app_version/info/app_version_info.js"; import type { FetchDomain } from "../fetch_domain/fetch_domain.js"; import type { FetchDomainRequestInfo } from "../fetch_domain_request/fetch_domain_request.js"; import type { Redditor } from "../reddit/redditor.js"; import type { Categories } from "./categories/categories.js"; import type { AppInfo } from "./info/app_info.js"; import type { ComputeCluster } from "./info/compute_cluster.js"; export declare enum OrderBy { DATE_CREATED = 0, NAME = 1, POPULARITY = 2, UNRECOGNIZED = -1 } /** Used to search for app(s). */ export type AppSearchRequest = { /** * What word(s) are you searching for? (NOTE: This feature is not yet * implemented.) */ searchTerm?: string | undefined; /** * What categor(y|ies) does the app fit into? * * @deprecated */ categories: Categories[]; /** What page of results do you want? Defaults to the first page. */ page?: number | undefined; /** What is the maximum number of items on a page? Defaults to 20. */ pageSize?: number | undefined; /** * What field would you like to order the results by? Defaults to * DATE_CREATED. */ orderBy: OrderBy; /** Would you like your results sorted in ascending order? Defaults to false. */ isAscending?: boolean | undefined; /** Used with categoriesV2 */ categoryIds: number[]; /** Filter to apps owned by this user ID (t2_ format, eg 't2_abc123'). */ ownerId?: string | undefined; }; /** Used to get an app by its slug. */ export type GetAppBySlugRequest = { /** What is the slug of the app? */ slug: string; /** How many versions of the app, at most, should we return? */ limit?: number | undefined; /** How many versions of the app should we skip? (Useful for pagination!) */ offset?: number | undefined; /** Should we hide prerelease versions? */ hidePrereleaseVersions?: boolean | undefined; }; export type GetAllWithOwnerRequest = { /** * Who's the owner in question? (Can be a t2_ ID or a username, with or * without `u/`) */ owner: string; /** Maximum number of apps to return */ take?: number | undefined; /** Number of apps to skip (for pagination) */ skip?: number | undefined; }; /** Used to create a new app. */ export type AppCreationRequest = { /** What is the new app's name? */ name: string; /** What is the description of the app? */ description: string; /** Is the app NSFW? NOTE: Once set, this cannot be reversed! */ isNsfw: boolean; /** * What categor(y|ies) are you looking in? * * @deprecated */ categories: Categories[]; /** * Should we autogenerate a unique suffix for the app account? * * @deprecated */ autogenerateName: boolean; /** What's the captcha verification code? */ captcha: string; /** Used with categoriesV2 */ categoryIds: number[]; }; /** * Used to get the X most popular apps, as determined by number of * installations. */ export type GetPopularAppsRequest = { /** How many apps should we return? */ limit: number; }; /** Contains the filename, size, and hash info for a piece of media. */ export type MediaSignature = { /** * Path to the file. This isn't saved in the system; it's primary use is so * that when we're telling the client later which pieces of media we do and do * not have already, it knows which files we're talking about easily. */ filePath: string; /** Size of the file, in bytes */ size: number; /** sha256 checksum of the file, as a hex string */ hash: string; /** True if the asset is for webviews */ isWebviewAsset: boolean; /** If this is a web view asset, and we're attempting to use direct-to-S3 uploading, the mime type of the asset */ mimeType?: string | undefined; }; /** Does the app already have any media uploaded that matches these signatures? */ export type CheckIfMediaExistsRequest = { id?: string | undefined; slug?: string | undefined; /** The signatures we want to look for */ signatures: MediaSignature[]; }; /** Please upload this piece of media for this app. */ export type UploadNewMediaRequest = { id?: string | undefined; slug?: string | undefined; /** * The size of the media asset, in bytes. This will be validated, and an error * thrown if incorrect. */ size: number; /** * The sha256 hash of the media asset, as a hex string. This will be * validated, and an error thrown if incorrect. */ hash: string; /** The contents of the file. */ contents: string; /** * Make this asset available for webview consumption _instead_ of app UI * consumption. */ webviewAsset?: boolean | undefined; /** The path of the file in the project assets. Necessary for webview assets. */ filePath?: string | undefined; }; /** * Used to update an existing app's information. * If a field is optional, omitting it will leave its value unchanged. */ export type AppUpdateRequest = { /** What is the ID of the app you're trying to update? */ id: string; /** What is the app's new slug? */ slug?: string | undefined; /** What's the app's new name? */ name?: string | undefined; /** What's the app's new description? */ description?: string | undefined; /** Is the app NSFW? NOTE: Once set, this cannot be reversed! */ isNsfw?: boolean | undefined; /** Is the app delisted? (This is only editable by admins.) */ isDelisted?: boolean | undefined; /** * What categor(y|ies) does the app belong in? * * @deprecated */ categories: Categories[]; /** What are the terms and conditions of using this app? */ termsAndConditions?: string | undefined; /** What is the privacy policy this app? */ privacyPolicy?: string | undefined; /** What is the default compute pool that new versions should be assigned? */ defaultPool?: ComputePool | undefined; /** * Is the app allowed to use the webview block and manage webview assets? * Deprecated: Use capabilities instead. * TODO: remove this after 2 releases. sometime in (Q4 2024) * * @deprecated */ isWebviewEnabled?: boolean | undefined; /** * Is the app installation in small subreddits restricted (the actual limit is * specified in the code) */ minSubredditSizeRestrictionEnabled?: boolean | undefined; /** * The promotion status of the app, for ads team use to mark * promoted apps and what level they are promoted. */ promoStatus?: AppPromoStatus | undefined; /** Used with categoriesV2 */ categoryIds: number[]; /** * Is the app archived? (only app owners and admins can archive an app) * This field acts as a "soft delete" or deprecation status for an app: * - hides from search results * - prevents new installs (by anyone but the app owner) */ isArchived?: boolean | undefined; /** What is the default compute cluster for new installations? */ defaultComputeCluster?: ComputeCluster | undefined; /** Whether the app is developed by a trusted developer and should have more permissive auto review thresholds */ isTrusted?: boolean | undefined; }; /** * Contains the basic information about an app, as well as all versions of the * app, and any statistics about the app that we want to include. */ export type FullAppInfo = { app?: AppInfo | undefined; versions: AppVersionInfo[]; fetchDomainRequests: FetchDomainRequestInfo[]; }; /** Represents information about an app and its domain info, including domain requests and allowed domains. */ export type AppWithDomainInfo = { /** The ID of the app, eg '6d0a383a-eb60-44ed-92c5-62b6261177f8' */ appId: string; /** The slug of the app, eg 'wsb-app' */ appSlug: string; /** The name of the app, eg 'WSB App' */ appName: string; /** The account of the app owner, eg 't2_3c4d' */ appOwnerAccount?: Redditor | undefined; /** The list of fetch domain requests for the app. */ domainRequests: FetchDomainRequestInfo[]; /** The list of allowed domains for the app. */ allowedDomains: FetchDomain[]; }; /** Request used to get an app by its slug with its domain info. */ export type GetAppBySlugWithDomainInfoRequest = { /** The slug of app, eg 'pixelary-game' */ appSlug: string; }; /** Request used to get a list of apps with their domain info. */ export type GetAppsWithDomainInfoRequest = { /** How many apps to return in a single page. */ pageSize: number; /** The page number of apps to return. The page number should start at 1. */ pageNumber: number; }; /** Response containing a list of apps with their domain info. */ export type GetAppsWithDomainInfoResponse = { /** The list of apps with their domain info. */ apps: AppWithDomainInfo[]; /** Indicates whether or not there is a next page of apps. */ hasNextPage?: boolean | undefined; }; /** Request used to add many domains to an app's 'allowedDomains' list. */ export type AddDomainsToAppRequest = { /** The ID of the app to add the domains to, eg '6d0a383a-eb60-44ed-92c5-62b6261177f8' */ appId: string; /** The domains to add to the app, eg 'hello-world.com', 'w3schools.org' */ domains: string[]; }; /** Request used to remove a domain from an app's 'allowedDomains' list. */ export type RemoveDomainFromAppRequest = { /** The ID of the app to remove the domain from, eg '6d0a383a-eb60-44ed-92c5-62b6261177f8' */ appId: string; /** The domain to remove from the app, eg 'hello-world.com' */ domain: string; }; /** * Contains the status of a piece of media - whether we've seen it before or * not. */ export type MediaSignatureStatus = { /** Path to the file, as was given in the request object */ filePath: string; /** Is this file new to the app? */ isNew: boolean; /** If the file isn't new, will contain the media ID of the existing asset. */ existingMediaId?: string | undefined; /** If the file is new, a webview asset, and we were given a mime type, this will contain the upload URL to use to upload it. */ uploadUrl?: string | undefined; /** If the file is new, a webview asset, and we were given a mime type, this will contain the headers to send with the upload. */ uploadHeaders: { [key: string]: string; }; }; export type MediaSignatureStatus_UploadHeadersEntry = { key: string; value: string; }; /** A list of the status of each media signature we were asked about. */ export type CheckIfMediaExistsResponse = { /** * The status of each requested media signature - whether we've seen it before * or not. */ statuses: MediaSignatureStatus[]; }; /** The response given when a new piece of media is uploaded. */ export type UploadNewMediaResponse = { /** The ID of the asset as saved in the developer portal. */ assetId: string; /** The ID of the media as given by the media service. */ mediaId: string; }; /** The results of searching for an app */ export type AppSearchResponse = { /** This page's apps; there may be more on other pages */ apps: AppInfo[]; /** How many total results exist for this search */ totalResults: number; /** What page number this is */ pageNumber: number; /** The maximum number of items on each page */ pageSize: number; }; export type AppExistsRequest = { /** Does an app with this slug exist? */ slug?: string | undefined; }; export type AppExistsResponse = { exists: boolean; }; export type AppAccountExistsRequest = { /** The name of the app account (without the leading u/) */ accountName: string; /** * By default, we'll give you suggestions to name your app if the given name is already taken. * Set this to true if you don't need those suggestions. (It'll make the request a little faster.) */ hideSuggestions?: boolean | undefined; }; export type AppAccountExistsResponse = { exists: boolean; suggestions: string[]; }; export type CreateAppAccountRequest = { slug: string; accountName?: string | undefined; captcha: string; }; export type CreateAppAccountResponse = { created: boolean; errors?: string | undefined; }; /** Used to recover partially created apps. */ export type RecoverAppAccountRequest = { /** What is the new app's name? */ name: string; /** What is the slug/identifier of the app? */ slug: string; /** What is the description of the app? */ description: string; /** Is the app NSFW? NOTE: Once set, this cannot be reversed! */ isNsfw: boolean; /** * What categor(y|ies) does the app fit into? * * @deprecated */ categories: Categories[]; /** What is the ID of the owner of the app? */ ownerId: string; /** What is the username of the app account to recover? */ username: string; /** What is the temporary password of the app account to recover? */ password: string; /** Used with categoriesV2 */ categoryIds: number[]; }; export type DisableAppRequest = { /** App UUID */ id: string; }; export type EnableAppRequest = { /** App UUID */ id: string; }; //# sourceMappingURL=app.d.ts.map