UNPKG

@snap/camera-kit

Version:
147 lines 6.28 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export declare const protobufPackage = "com.snap.camerakit.v3"; /** GetRemoteApiSpecsRequest */ export interface GetRemoteApiSpecsRequest { } /** GetRemoteApiSpecsResponse */ export interface GetRemoteApiSpecsResponse { /** Remote API specifications that are defined for a CameraKit partners */ remoteApiSpecs: RemoteApiSpec[]; } /** * Defines a remote service with a list of endpoints and a single security configuration. * Original full specification data can be found in lenses/remote_api/remote_api_spec.proto. */ export interface RemoteApiSpec { /** ID of the API spec */ id: string; /** Hostname or hostname and port in format of host:port */ host: string; /** List of HTTP endpoints allowed by this API spec */ endpoints: RemoteEndpoint[]; /** Defines if secured connection (HTTPS) must be forced */ tlsRequired: boolean; /** Specifies caller's max request size in bytes for any of defined endpoints (optional value) */ maxRequestSizeBytes: number; /** Specifies caller's max response size in bytes for any of defined endpoints (optional value) */ maxResponseSizeBytes: number; /** Specifies caller's max response time in millis for any of defined endpoints (optional value) */ maxResponseTimeMillis: number; } /** Defines a remote API HTTP endpoint */ export interface RemoteEndpoint { /** URL path of the endpoint; could be fixed or parameterized */ path: string; /** HTTP methods allowed for requests to this endpoint */ methods: RemoteEndpoint_HttpRequestMethod[]; /** Parameters allowed for requests to this endpoint; required if path is parameterized */ parameters: RemoteParameter[]; /** ID used by clients to refer to this endpoint */ refId: string; } /** Possible HTTP request method on an endpoint */ export declare enum RemoteEndpoint_HttpRequestMethod { /** METHOD_UNSET - Undefined method */ METHOD_UNSET = 0, /** GET - HTTP GET */ GET = 1, /** POST - HTTP POST */ POST = 2, /** PUT - HTTP PUT */ PUT = 3, /** DELETE - HTTP DELETE */ DELETE = 4, /** PATCH - HTTP PATCH */ PATCH = 5, UNRECOGNIZED = -1 } /** Defines how a parameter is injected into an HTTP request */ export interface RemoteParameter { /** Unique name of the parameter */ name: string; /** Location of the parameter */ location: RemoteParameter_ParameterLocation; /** Is parameter optional */ optional: boolean; /** * (optional) Name of the parameter that will be used to construct the request (in query/headers/path). * `name` is used by clients to fill in the parameters in the request, whereas * `external_name` is what is used in the outgoing API request by the proxy. * If empty, `external_name` is assumed to be the same as `name`. */ externalName: string; /** * Default value if the parameter is not set. Useful for "standard" headers like content-type * and other similar cases. If a default value is provided, the parameter will be sent with every request. * Required for constant parameters. */ defaultValue: string; /** * Constant parameters have the same predefined value for all requests and * are always set by the proxy. Not allowed to be overridden by the caller. */ constant: boolean; } /** Possible location of a parameter */ export declare enum RemoteParameter_ParameterLocation { /** LOCATION_UNSET - Undefined location */ LOCATION_UNSET = 0, /** QUERY - Parameters that appear in the URL query */ QUERY = 1, /** HEADER - Parameters that appear in the HTTP request header */ HEADER = 2, /** PATH - Parameters that appear in the URL path (for parameterized path only) */ PATH = 3, UNRECOGNIZED = -1 } export declare const GetRemoteApiSpecsRequest: MessageFns<GetRemoteApiSpecsRequest>; export declare const GetRemoteApiSpecsResponse: MessageFns<GetRemoteApiSpecsResponse>; export declare const RemoteApiSpec: MessageFns<RemoteApiSpec>; export declare const RemoteEndpoint: MessageFns<RemoteEndpoint>; export declare const RemoteParameter: MessageFns<RemoteParameter>; /** The service handle Remote API specifications for CameraKit */ export type RemoteApiSpecsDefinition = typeof RemoteApiSpecsDefinition; export declare const RemoteApiSpecsDefinition: { readonly name: "RemoteApiSpecs"; readonly fullName: "com.snap.camerakit.v3.RemoteApiSpecs"; readonly methods: { /** * GetRemoteApiSpecs provides lens Remote API specifications for CameraKit partners based on Snap Kit App ID. * https://docs.google.com/document/d/1UBFybr3eI7nEWiUzm_rAumKefaGW6ecpYp5zOCRIYRA/edit */ readonly getRemoteApiSpecs: { readonly name: "GetRemoteApiSpecs"; readonly requestType: MessageFns<GetRemoteApiSpecsRequest>; readonly requestStream: false; readonly responseType: MessageFns<GetRemoteApiSpecsResponse>; readonly responseStream: false; readonly options: { readonly idempotencyLevel: "NO_SIDE_EFFECTS"; }; }; }; }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends { $case: string; } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>; } & { $case: T["$case"]; } : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]>; } : Partial<T>; type KeysOfUnion<T> = T extends T ? keyof T : never; export type Exact<P, I extends P> = P extends Builtin ? P : P & { [K in keyof P]: Exact<P[K], I[K]>; } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never; }; export interface MessageFns<T> { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; create<I extends Exact<DeepPartial<T>, I>>(base?: I): T; fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T; } export {}; //# sourceMappingURL=remote_api_spec.d.ts.map