import * as url from 'url'; declare namespace io.apibuilder.common.v0.enums { type MembershipRole = 'member' | 'admin'; } declare namespace io.apibuilder.common.v0.models { interface Audit { readonly 'created_at': string; readonly 'created_by': io.apibuilder.common.v0.models.ReferenceGuid; readonly 'updated_at': string; readonly 'updated_by': io.apibuilder.common.v0.models.ReferenceGuid; } interface Healthcheck { readonly 'status': string; } interface Reference { readonly 'guid': string; readonly 'key': string; } interface ReferenceGuid { readonly 'guid': string; } } declare namespace io.apibuilder.spec.v0.enums { type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; type ParameterLocation = 'Path' | 'Query' | 'Form' | 'Header'; type ResponseCodeOption = 'Default'; } declare namespace io.apibuilder.spec.v0.models { interface Annotation { readonly 'name': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; } interface Apidoc { readonly 'version': string; } interface Application { readonly 'key': string; } interface Attribute { readonly 'name': string; readonly 'value': any/*object*/; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; } interface Body { readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Contact { readonly 'name'?: string; readonly 'url'?: string; readonly 'email'?: string; } interface Deprecation { readonly 'description'?: string; } interface Enum { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'values': io.apibuilder.spec.v0.models.EnumValue[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface EnumValue { readonly 'name': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'value'?: string; } interface Field { readonly 'name': string; readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'default'?: string; readonly 'required': boolean; readonly 'minimum'?: number; readonly 'maximum'?: number; readonly 'example'?: string; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'annotations': string[]; } interface Header { readonly 'name': string; readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'required': boolean; readonly 'default'?: string; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Import { readonly 'uri': string; readonly 'namespace': string; readonly 'organization': io.apibuilder.spec.v0.models.Organization; readonly 'application': io.apibuilder.spec.v0.models.Application; readonly 'version': string; readonly 'enums': string[]; readonly 'interfaces': string[]; readonly 'unions': string[]; readonly 'models': string[]; readonly 'annotations': io.apibuilder.spec.v0.models.Annotation[]; } interface Info { readonly 'license'?: io.apibuilder.spec.v0.models.License; readonly 'contact'?: io.apibuilder.spec.v0.models.Contact; } interface Interface { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields': io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface License { readonly 'name': string; readonly 'url'?: string; } interface Model { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields': io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'interfaces': string[]; } interface Operation { readonly 'method': io.apibuilder.spec.v0.enums.Method; readonly 'path': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'body'?: io.apibuilder.spec.v0.models.Body; readonly 'parameters': io.apibuilder.spec.v0.models.Parameter[]; readonly 'responses': io.apibuilder.spec.v0.models.Response[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Organization { readonly 'key': string; } interface Parameter { readonly 'name': string; readonly 'type': string; readonly 'location': io.apibuilder.spec.v0.enums.ParameterLocation; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'required': boolean; readonly 'default'?: string; readonly 'minimum'?: number; readonly 'maximum'?: number; readonly 'example'?: string; readonly 'attributes'?: io.apibuilder.spec.v0.models.Attribute[]; } interface Resource { readonly 'type': string; readonly 'plural': string; readonly 'path'?: string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'operations': io.apibuilder.spec.v0.models.Operation[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Response { readonly 'code': io.apibuilder.spec.v0.unions.ResponseCode; readonly 'type': string; readonly 'headers'?: io.apibuilder.spec.v0.models.Header[]; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes'?: io.apibuilder.spec.v0.models.Attribute[]; } interface Service { readonly 'apidoc'?: io.apibuilder.spec.v0.models.Apidoc; readonly 'name': string; readonly 'organization': io.apibuilder.spec.v0.models.Organization; readonly 'application': io.apibuilder.spec.v0.models.Application; readonly 'namespace': string; readonly 'version': string; readonly 'base_url'?: string; readonly 'description'?: string; readonly 'info': io.apibuilder.spec.v0.models.Info; readonly 'headers': io.apibuilder.spec.v0.models.Header[]; readonly 'imports': io.apibuilder.spec.v0.models.Import[]; readonly 'enums': io.apibuilder.spec.v0.models.Enum[]; readonly 'interfaces': io.apibuilder.spec.v0.models.Interface[]; readonly 'unions': io.apibuilder.spec.v0.models.Union[]; readonly 'models': io.apibuilder.spec.v0.models.Model[]; readonly 'resources': io.apibuilder.spec.v0.models.Resource[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'annotations': io.apibuilder.spec.v0.models.Annotation[]; } interface Union { readonly 'name': string; readonly 'plural': string; readonly 'discriminator'?: string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'types': io.apibuilder.spec.v0.models.UnionType[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'interfaces': string[]; } interface UnionType { readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields'?: io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'default'?: boolean; readonly 'discriminator_value'?: string; } } declare namespace io.apibuilder.spec.v0.unions { type ResponseCode = ({ discriminator: 'integer', value: number } | { discriminator: 'response_code_option', value: io.apibuilder.spec.v0.enums.ResponseCodeOption }); } declare namespace io.apibuilder.generator.v0.enums { type FileFlag = 'scaffolding'; } declare namespace io.apibuilder.generator.v0.models { interface Attribute { readonly 'name': string; readonly 'value': string; } interface Error { readonly 'code': string; readonly 'message': string; } interface File { readonly 'name': string; readonly 'dir'?: string; readonly 'contents': string; readonly 'flags'?: io.apibuilder.generator.v0.enums.FileFlag[]; } interface Generator { readonly 'key': string; readonly 'name': string; readonly 'language'?: string; readonly 'description'?: string; readonly 'attributes': string[]; } interface Healthcheck { readonly 'status': string; } interface Invocation { readonly 'source': string; readonly 'files': io.apibuilder.generator.v0.models.File[]; } interface InvocationForm { readonly 'service': io.apibuilder.spec.v0.models.Service; readonly 'attributes': io.apibuilder.generator.v0.models.Attribute[]; readonly 'user_agent'?: string; readonly 'imported_services'?: io.apibuilder.spec.v0.models.Service[]; } } declare namespace com.afrosoft.apibuilder.api.v0.enums { type AppSortBy = 'name' | 'created_at' | 'updated_at' | 'visibility'; type OriginalType = 'api_json' | 'avro_idl' | 'service_json' | 'swagger'; type Publication = 'membership_requests.create' | 'memberships.create' | 'applications.create' | 'versions.create'; type SortOrder = 'asc' | 'desc'; type Visibility = 'user' | 'organization' | 'public'; } declare namespace com.afrosoft.apibuilder.api.v0.models { interface Application { readonly 'guid': string; readonly 'organization': io.apibuilder.common.v0.models.Reference; readonly 'name': string; readonly 'key': string; readonly 'visibility': com.afrosoft.apibuilder.api.v0.enums.Visibility; readonly 'description'?: string; readonly 'last_updated_at': string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface ApplicationForm { readonly 'name': string; readonly 'key'?: string; readonly 'description'?: string; readonly 'visibility': com.afrosoft.apibuilder.api.v0.enums.Visibility; } interface ApplicationMetadata { readonly 'guid': string; readonly 'key': string; } interface ApplicationMetadataVersion { readonly 'version': string; } interface ApplicationSummary { readonly 'type': 'application_summary'; readonly 'guid': string; readonly 'organization': io.apibuilder.common.v0.models.Reference; readonly 'key': string; } interface Attribute { readonly 'guid': string; readonly 'name': string; readonly 'description'?: string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface AttributeForm { readonly 'name': string; readonly 'description'?: string; } interface AttributeSummary { readonly 'guid': string; readonly 'name': string; } interface AttributeValue { readonly 'guid': string; readonly 'attribute': com.afrosoft.apibuilder.api.v0.models.AttributeSummary; readonly 'value': string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface AttributeValueForm { readonly 'value': string; } interface Authentication { readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'session': com.afrosoft.apibuilder.api.v0.models.Session; } interface Change { readonly 'guid': string; readonly 'organization': io.apibuilder.common.v0.models.Reference; readonly 'application': io.apibuilder.common.v0.models.Reference; readonly 'from_version': com.afrosoft.apibuilder.api.v0.models.ChangeVersion; readonly 'to_version': com.afrosoft.apibuilder.api.v0.models.ChangeVersion; readonly 'diff': com.afrosoft.apibuilder.api.v0.unions.Diff; readonly 'changed_at': string; readonly 'changed_by': com.afrosoft.apibuilder.api.v0.models.UserSummary; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface ChangeVersion { readonly 'guid': string; readonly 'version': string; } interface CleartextToken { readonly 'token': string; } interface Code { readonly 'generator': com.afrosoft.apibuilder.api.v0.models.GeneratorWithService; readonly 'source': string; readonly 'files': io.apibuilder.generator.v0.models.File[]; } interface CodeForm { readonly 'attributes': io.apibuilder.generator.v0.models.Attribute[]; } interface DiffBreaking { readonly 'type': 'diff_breaking'; readonly 'description': string; } interface DiffNonBreaking { readonly 'type': 'diff_non_breaking'; readonly 'description': string; } interface Domain { readonly 'name': string; } interface EmailVerificationConfirmationForm { readonly 'token': string; } interface Error { readonly 'code': string; readonly 'message': string; } interface GeneratorForm { readonly 'service_guid': string; readonly 'generator': io.apibuilder.generator.v0.models.Generator; } interface GeneratorService { readonly 'guid': string; readonly 'uri': string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface GeneratorServiceForm { readonly 'uri': string; } interface GeneratorWithService { readonly 'service': com.afrosoft.apibuilder.api.v0.models.GeneratorService; readonly 'generator': io.apibuilder.generator.v0.models.Generator; } interface Item { readonly 'guid': string; readonly 'detail': com.afrosoft.apibuilder.api.v0.unions.ItemDetail; readonly 'label': string; readonly 'description'?: string; } interface Membership { readonly 'guid': string; readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'organization': com.afrosoft.apibuilder.api.v0.models.Organization; readonly 'role': string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface MembershipRequest { readonly 'guid': string; readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'organization': com.afrosoft.apibuilder.api.v0.models.Organization; readonly 'role': string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface MoveForm { readonly 'org_key': string; } interface Organization { readonly 'guid': string; readonly 'key': string; readonly 'name': string; readonly 'namespace': string; readonly 'visibility': com.afrosoft.apibuilder.api.v0.enums.Visibility; readonly 'domains': com.afrosoft.apibuilder.api.v0.models.Domain[]; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface OrganizationForm { readonly 'name': string; readonly 'key'?: string; readonly 'namespace': string; readonly 'visibility': com.afrosoft.apibuilder.api.v0.enums.Visibility; readonly 'domains'?: string[]; } interface Original { readonly 'type': com.afrosoft.apibuilder.api.v0.enums.OriginalType; readonly 'data': string; } interface OriginalForm { readonly 'type'?: com.afrosoft.apibuilder.api.v0.enums.OriginalType; readonly 'data': string; } interface PasswordReset { readonly 'token': string; readonly 'password': string; } interface PasswordResetRequest { readonly 'email': string; } interface Session { readonly 'id': string; readonly 'expires_at': string; } interface Subscription { readonly 'guid': string; readonly 'organization': com.afrosoft.apibuilder.api.v0.models.Organization; readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'publication': com.afrosoft.apibuilder.api.v0.enums.Publication; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface SubscriptionForm { readonly 'organization_key': string; readonly 'user_guid': string; readonly 'publication': com.afrosoft.apibuilder.api.v0.enums.Publication; } interface Token { readonly 'guid': string; readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'masked_token': string; readonly 'description'?: string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface TokenForm { readonly 'user_guid': string; readonly 'description'?: string; } interface User { readonly 'guid': string; readonly 'email': string; readonly 'nickname': string; readonly 'name'?: string; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface UserForm { readonly 'email': string; readonly 'password': string; readonly 'nickname'?: string; readonly 'name'?: string; } interface UserSummary { readonly 'guid': string; readonly 'nickname': string; } interface UserUpdateForm { readonly 'email': string; readonly 'nickname': string; readonly 'name'?: string; } interface Validation { readonly 'valid': boolean; readonly 'errors': string[]; } interface Version { readonly 'guid': string; readonly 'organization': io.apibuilder.common.v0.models.Reference; readonly 'application': io.apibuilder.common.v0.models.Reference; readonly 'version': string; readonly 'original'?: com.afrosoft.apibuilder.api.v0.models.Original; readonly 'service': io.apibuilder.spec.v0.models.Service; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface VersionForm { readonly 'original_form': com.afrosoft.apibuilder.api.v0.models.OriginalForm; readonly 'visibility'?: com.afrosoft.apibuilder.api.v0.enums.Visibility; } interface Watch { readonly 'guid': string; readonly 'user': com.afrosoft.apibuilder.api.v0.models.User; readonly 'organization': com.afrosoft.apibuilder.api.v0.models.Organization; readonly 'application': com.afrosoft.apibuilder.api.v0.models.Application; readonly 'audit': io.apibuilder.common.v0.models.Audit; } interface WatchForm { readonly 'user_guid': string; readonly 'organization_key': string; readonly 'application_key': string; } } declare namespace com.afrosoft.apibuilder.api.v0.unions { type Diff = (com.afrosoft.apibuilder.api.v0.models.DiffBreaking | com.afrosoft.apibuilder.api.v0.models.DiffNonBreaking); type ItemDetail = (com.afrosoft.apibuilder.api.v0.models.ApplicationSummary); } export type AppSortBy = com.afrosoft.apibuilder.api.v0.enums.AppSortBy; export type Application = com.afrosoft.apibuilder.api.v0.models.Application; export type ApplicationForm = com.afrosoft.apibuilder.api.v0.models.ApplicationForm; export type ApplicationMetadata = com.afrosoft.apibuilder.api.v0.models.ApplicationMetadata; export type ApplicationMetadataVersion = com.afrosoft.apibuilder.api.v0.models.ApplicationMetadataVersion; export type ApplicationSummary = com.afrosoft.apibuilder.api.v0.models.ApplicationSummary; export type Attribute = com.afrosoft.apibuilder.api.v0.models.Attribute; export type AttributeForm = com.afrosoft.apibuilder.api.v0.models.AttributeForm; export type AttributeSummary = com.afrosoft.apibuilder.api.v0.models.AttributeSummary; export type AttributeValue = com.afrosoft.apibuilder.api.v0.models.AttributeValue; export type AttributeValueForm = com.afrosoft.apibuilder.api.v0.models.AttributeValueForm; export type Authentication = com.afrosoft.apibuilder.api.v0.models.Authentication; export type Change = com.afrosoft.apibuilder.api.v0.models.Change; export type ChangeVersion = com.afrosoft.apibuilder.api.v0.models.ChangeVersion; export type CleartextToken = com.afrosoft.apibuilder.api.v0.models.CleartextToken; export type Code = com.afrosoft.apibuilder.api.v0.models.Code; export type CodeForm = com.afrosoft.apibuilder.api.v0.models.CodeForm; export type Diff = com.afrosoft.apibuilder.api.v0.unions.Diff; export type DiffBreaking = com.afrosoft.apibuilder.api.v0.models.DiffBreaking; export type DiffNonBreaking = com.afrosoft.apibuilder.api.v0.models.DiffNonBreaking; export type Domain = com.afrosoft.apibuilder.api.v0.models.Domain; export type EmailVerificationConfirmationForm = com.afrosoft.apibuilder.api.v0.models.EmailVerificationConfirmationForm; export type Error = com.afrosoft.apibuilder.api.v0.models.Error; export type GeneratorForm = com.afrosoft.apibuilder.api.v0.models.GeneratorForm; export type GeneratorService = com.afrosoft.apibuilder.api.v0.models.GeneratorService; export type GeneratorServiceForm = com.afrosoft.apibuilder.api.v0.models.GeneratorServiceForm; export type GeneratorWithService = com.afrosoft.apibuilder.api.v0.models.GeneratorWithService; export type Item = com.afrosoft.apibuilder.api.v0.models.Item; export type ItemDetail = com.afrosoft.apibuilder.api.v0.unions.ItemDetail; export type Membership = com.afrosoft.apibuilder.api.v0.models.Membership; export type MembershipRequest = com.afrosoft.apibuilder.api.v0.models.MembershipRequest; export type MoveForm = com.afrosoft.apibuilder.api.v0.models.MoveForm; export type Organization = com.afrosoft.apibuilder.api.v0.models.Organization; export type OrganizationForm = com.afrosoft.apibuilder.api.v0.models.OrganizationForm; export type Original = com.afrosoft.apibuilder.api.v0.models.Original; export type OriginalForm = com.afrosoft.apibuilder.api.v0.models.OriginalForm; export type OriginalType = com.afrosoft.apibuilder.api.v0.enums.OriginalType; export type PasswordReset = com.afrosoft.apibuilder.api.v0.models.PasswordReset; export type PasswordResetRequest = com.afrosoft.apibuilder.api.v0.models.PasswordResetRequest; export type Publication = com.afrosoft.apibuilder.api.v0.enums.Publication; export type Session = com.afrosoft.apibuilder.api.v0.models.Session; export type SortOrder = com.afrosoft.apibuilder.api.v0.enums.SortOrder; export type Subscription = com.afrosoft.apibuilder.api.v0.models.Subscription; export type SubscriptionForm = com.afrosoft.apibuilder.api.v0.models.SubscriptionForm; export type Token = com.afrosoft.apibuilder.api.v0.models.Token; export type TokenForm = com.afrosoft.apibuilder.api.v0.models.TokenForm; export type User = com.afrosoft.apibuilder.api.v0.models.User; export type UserForm = com.afrosoft.apibuilder.api.v0.models.UserForm; export type UserSummary = com.afrosoft.apibuilder.api.v0.models.UserSummary; export type UserUpdateForm = com.afrosoft.apibuilder.api.v0.models.UserUpdateForm; export type Validation = com.afrosoft.apibuilder.api.v0.models.Validation; export type Version = com.afrosoft.apibuilder.api.v0.models.Version; export type VersionForm = com.afrosoft.apibuilder.api.v0.models.VersionForm; export type Visibility = com.afrosoft.apibuilder.api.v0.enums.Visibility; export type Watch = com.afrosoft.apibuilder.api.v0.models.Watch; export type WatchForm = com.afrosoft.apibuilder.api.v0.models.WatchForm; export interface $FetchOptions { body?: string; headers?: $HttpHeaders; method?: $HttpMethod; } export type $FetchFunction = (url: string, options?: $FetchOptions) => Promise; export interface $HttpHeaders { [key: string]: string; } export type $HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; export interface $HttpQuery { [key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null; } export interface $HttpRequest { body?: any; url: string; headers: $HttpHeaders; method: $HttpMethod; } export interface $HttpRequestOptions { body?: any; endpoint: string; headers?: $HttpHeaders; method: $HttpMethod; query?: $HttpQuery; } export interface $HttpResponse { body: B; headers: $HttpHeaders; ok: O; request: $HttpRequest; status: S; statusText: string; } export type $HttpContinue = $HttpResponse; export type $HttpSwitchingProtocol = $HttpResponse; export type $HttpProcessing = $HttpResponse; export type $HttpOk = $HttpResponse; export type $HttpCreated = $HttpResponse; export type $HttpAccepted = $HttpResponse; export type $HttpNonAuthoritativeInformation = $HttpResponse; export type $HttpNoContent = $HttpResponse; export type $HttpResetContent = $HttpResponse; export type $HttpPartialContent = $HttpResponse; export type $HttpMultiStatus = $HttpResponse; export type $HttpAlreadyReported = $HttpResponse; export type $HttpImUsed = $HttpResponse; export type $HttpMultipleChoices = $HttpResponse; export type $HttpMovedPermanently = $HttpResponse; export type $HttpFound = $HttpResponse; export type $HttpSeeOther = $HttpResponse; export type $HttpNotModified = $HttpResponse; export type $HttpUseProxy = $HttpResponse; export type $HttpTemporaryRedirect = $HttpResponse; export type $HttpPermanentRedirect = $HttpResponse; export type $HttpBadRequest = $HttpResponse; export type $HttpUnauthorized = $HttpResponse; export type $HttpPaymentRequired = $HttpResponse; export type $HttpForbidden = $HttpResponse; export type $HttpNotFound = $HttpResponse; export type $HttpMethodNotAllowed = $HttpResponse; export type $HttpNotAcceptable = $HttpResponse; export type $HttpProxyAuthenticationRequired = $HttpResponse; export type $HttpRequestTimeout = $HttpResponse; export type $HttpConflict = $HttpResponse; export type $HttpGone = $HttpResponse; export type $HttpLengthRequired = $HttpResponse; export type $HttpPreconditionFailed = $HttpResponse; export type $HttpRequestEntityTooLarge = $HttpResponse; export type $HttpRequestUriTooLong = $HttpResponse; export type $HttpUnsupportedMediaType = $HttpResponse; export type $HttpRequestedRangeNotSatisfiable = $HttpResponse; export type $HttpExpectationFailed = $HttpResponse; export type $HttpMisdirectedRequest = $HttpResponse; export type $HttpUnprocessableEntity = $HttpResponse; export type $HttpLocked = $HttpResponse; export type $HttpFailedDependency = $HttpResponse; export type $HttpUpgradeRequired = $HttpResponse; export type $HttpPreconditionRequired = $HttpResponse; export type $HttpTooManyRequests = $HttpResponse; export type $HttpRequestHeaderFieldsTooLarge = $HttpResponse; export type $HttpNoResponse = $HttpResponse; export type $HttpRetryWith = $HttpResponse; export type $HttpBlockedByWindowsParentalControls = $HttpResponse; export type $HttpUnavailableForLegalReasons = $HttpResponse; export type $HttpClientClosedRequest = $HttpResponse; export type $HttpInternalServerError = $HttpResponse; export type $HttpNotImplemented = $HttpResponse; export type $HttpBadGateway = $HttpResponse; export type $HttpServiceUnavailable = $HttpResponse; export type $HttpGatewayTimeout = $HttpResponse; export type $HttpHttpVersionNotSupported = $HttpResponse; export type $HttpInsufficientStorage = $HttpResponse; export type $HttpLoopDetected = $HttpResponse; export type $HttpBandwidthLimitExceeded = $HttpResponse; export type $HttpNotExtended = $HttpResponse; export type $HttpNetworkAuthenticationRequired = $HttpResponse; export type $HttpNetworkReadTimeoutError = $HttpResponse; export type $HttpNetworkConnectTimeoutError = $HttpResponse; export interface $HttpClientOptions { fetch: $FetchFunction; } export function isResponseEmpty(response: Response): boolean { const contentLength = response.headers.get('Content-Length'); return response.status === 204 || contentLength != null && Number.parseInt(contentLength, 10) === 0; } export function isResponseJson(response: Response): boolean { const contentType = response.headers.get('Content-Type'); return contentType != null && contentType.indexOf('json') >= 0; } export function parseJson(response: Response): Promise { return !isResponseEmpty(response) && isResponseJson(response) ? response.json() : Promise.resolve(); } export function parseHeaders(response: Response): Record { const headers: Record = {}; response.headers.forEach((value, key) => { headers[key.toLowerCase()] = value; }); return headers; } export function stripQuery(query: $HttpQuery = {}): $HttpQuery { const initialValue: $HttpQuery = {}; return Object.keys(query).reduce((previousValue, key) => { const value = query[key]; if (value != null) previousValue[key] = value; return previousValue; }, initialValue); } export class $HttpClient { private options: $HttpClientOptions; constructor(options: $HttpClientOptions) { this.options = options; } public request(options: $HttpRequestOptions): Promise<$HttpResponse> { const finalUrl: string = url.format({ hostname: 'api.apibuilder.io', pathname: options.endpoint, protocol: 'https:', query: stripQuery(options.query), }); const finalHeaders: $HttpHeaders = { accept: 'application/json', 'content-type': 'application/json', ...options.headers, }; const request: $HttpRequest = { body: options.body, headers: finalHeaders, method: options.method, url: finalUrl, }; return this.options.fetch(request.url, { body: JSON.stringify(request.body), headers: request.headers, method: request.method, }).then((response) => { return parseJson(response).then((json) => { return { body: json, headers: parseHeaders(response), ok: response.ok, request, status: response.status, statusText: response.statusText, }; }); }); } } export class $Resource { protected client: $HttpClient; constructor(options: $HttpClientOptions) { this.client = new $HttpClient(options); } } export interface ApplicationsGetMetadataAndVersionsByApplicationKeyParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface ApplicationsGetMetadataAndVersionsAndLatestTxtByApplicationKeyParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; } export interface ApplicationsGetParameters { headers?: $HttpHeaders; /*The organization key for which to search applications*/ orgKey: string; /*The name of an application. Case in-sensitive. Exact match*/ name?: string; /*The guid of an application. Exact match*/ guid?: string; /*The key of an application. Case in-sensitive. Exact match*/ key?: string; /*If true, we return applications that have at least one version. If false, we return applications that have no versions in the system*/ has_version?: boolean; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; sort_by?: com.afrosoft.apibuilder.api.v0.enums.AppSortBy; order?: com.afrosoft.apibuilder.api.v0.enums.SortOrder; } export interface ApplicationsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.ApplicationForm; headers?: $HttpHeaders; orgKey: string; } export interface ApplicationsPutByApplicationKeyParameters { body: com.afrosoft.apibuilder.api.v0.models.ApplicationForm; headers?: $HttpHeaders; orgKey: string; applicationKey: string; } export interface ApplicationsDeleteByApplicationKeyParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; } export interface ApplicationsPostMoveByApplicationKeyParameters { body: com.afrosoft.apibuilder.api.v0.models.MoveForm; headers?: $HttpHeaders; orgKey: string; applicationKey: string; } export interface AttributesGetParameters { headers?: $HttpHeaders; /*Find the watch with this guid.*/ guid?: string; /*Find attributes with this name. Case in-sensitive. Exact match*/ name?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface AttributesGetByNameParameters { headers?: $HttpHeaders; name: string; } export interface AttributesPostParameters { body: com.afrosoft.apibuilder.api.v0.models.AttributeForm; headers?: $HttpHeaders; } export interface AttributesDeleteByNameParameters { headers?: $HttpHeaders; name: string; } export interface AuthenticationsGetSessionByIdParameters { headers?: $HttpHeaders; id: string; } export interface ChangesGetParameters { headers?: $HttpHeaders; /*Filter changes to those made for the organization with this key.*/ org_key?: string; /*Filter changes to those made for the application with this key.*/ application_key?: string; /*Filter changes to those made from this version.*/ from?: string; /*Filter changes to those made to this version.*/ to?: string; /*The type of diff to return.*/ type?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface CodePostFormParameters { body: com.afrosoft.apibuilder.api.v0.models.CodeForm; headers?: $HttpHeaders; orgKey: string; applicationKey: string; version: string; } export interface CodeGetByGeneratorKeyParameters { headers?: $HttpHeaders; /*The organization key for which to generate code*/ orgKey: string; /*The application key for which to generate code*/ applicationKey: string; /*The version of this application. Can be 'latest'*/ version: string; /*The key of the generator to invoke*/ generatorKey: string; } export interface CodePostByGeneratorKeyParameters { body: com.afrosoft.apibuilder.api.v0.models.CodeForm; headers?: $HttpHeaders; /*The organization key for which to generate code*/ orgKey: string; /*The application key for which to generate code*/ applicationKey: string; /*The version of this application. Can be 'latest'*/ version: string; /*The key of the generator to invoke*/ generatorKey: string; } export interface DomainsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.Domain; headers?: $HttpHeaders; orgKey: string; } export interface DomainsDeleteByNameParameters { headers?: $HttpHeaders; orgKey: string; name: string; } export interface EmailVerificationConfirmationFormsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.EmailVerificationConfirmationForm; headers?: $HttpHeaders; } export interface GeneratorServicesGetParameters { headers?: $HttpHeaders; guid?: string; uri?: string; generator_key?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface GeneratorServicesGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface GeneratorServicesPostParameters { body: com.afrosoft.apibuilder.api.v0.models.GeneratorServiceForm; headers?: $HttpHeaders; } export interface GeneratorServicesDeleteByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface GeneratorWithServicesGetParameters { headers?: $HttpHeaders; /*Filter to generator with this guid*/ guid?: string; /*Filter to generator from this service*/ service_guid?: string; /*Filter to generator from this service URI*/ service_uri?: string; /*Filter to generators that use this attribute*/ attribute_name?: string; /*Filter to generator with this key*/ key?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface GeneratorWithServicesGetByKeyParameters { headers?: $HttpHeaders; key: string; } export interface HealthchecksGetHealthcheckParameters { headers?: $HttpHeaders; } export interface HealthchecksGetMigrateParameters { headers?: $HttpHeaders; } export interface ItemsGetParameters { headers?: $HttpHeaders; /*The search query. At the moment, we do case insensitive exact match search.*/ q?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface ItemsGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface MembershipsGetParameters { headers?: $HttpHeaders; org_guid?: string; org_key?: string; user_guid?: string; role?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface MembershipsGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface MembershipsDeleteByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface MembershipRequestsGetParameters { headers?: $HttpHeaders; org_guid?: string; org_key?: string; user_guid?: string; role?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface MembershipRequestsPostParameters { headers?: $HttpHeaders; org_guid: string; user_guid: string; role: string; } export interface MembershipRequestsPostAcceptByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface MembershipRequestsPostDeclineByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface OrganizationsGetParameters { headers?: $HttpHeaders; /*Finds the organization with this guid, if any*/ guid?: string; /*If specified, restricts to organizations that this user is specifically a member of (e.g. will exclude public organizations with which the user does not have a direct membership).*/ user_guid?: string; /*Find organizations with this key. Case in-sensitive. Exact match*/ key?: string; /*Find organizations with this name. Case in-sensitive. Exact match*/ name?: string; /*Find organizations with this namespace. Case in-sensitive. Exact match*/ namespace?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface OrganizationsGetByKeyParameters { headers?: $HttpHeaders; key: string; } export interface OrganizationsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.OrganizationForm; headers?: $HttpHeaders; } export interface OrganizationsPutByKeyParameters { body: com.afrosoft.apibuilder.api.v0.models.OrganizationForm; headers?: $HttpHeaders; key: string; } export interface OrganizationsDeleteByKeyParameters { headers?: $HttpHeaders; key: string; } export interface OrganizationsGetAttributesByKeyParameters { headers?: $HttpHeaders; key: string; /*Find the values for the attribute with this name.*/ name?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface OrganizationsGetAttributesByKeyAndNameParameters { headers?: $HttpHeaders; key: string; name: string; } export interface OrganizationsPutAttributesByKeyAndNameParameters { body: com.afrosoft.apibuilder.api.v0.models.AttributeValueForm; headers?: $HttpHeaders; key: string; name: string; } export interface OrganizationsDeleteAttributesByKeyAndNameParameters { headers?: $HttpHeaders; key: string; name: string; } export interface PasswordResetsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.PasswordReset; headers?: $HttpHeaders; } export interface PasswordResetRequestsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.PasswordResetRequest; headers?: $HttpHeaders; } export interface SubscriptionsGetParameters { headers?: $HttpHeaders; /*Find the subscription with this guid.*/ guid?: string; /*Find subscriptions for this organization.*/ organization_key?: string; /*Find subscriptions for this user.*/ user_guid?: string; /*Find subscriptions for this publication.*/ publication?: com.afrosoft.apibuilder.api.v0.enums.Publication; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface SubscriptionsGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface SubscriptionsPostParameters { body: com.afrosoft.apibuilder.api.v0.models.SubscriptionForm; headers?: $HttpHeaders; } export interface SubscriptionsDeleteByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface TokensGetUsersByUserGuidParameters { headers?: $HttpHeaders; user_guid: string; guid?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface TokensGetCleartextByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface TokensPostParameters { body: com.afrosoft.apibuilder.api.v0.models.TokenForm; headers?: $HttpHeaders; } export interface TokensDeleteByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface UsersGetParameters { headers?: $HttpHeaders; /*Find user with this guid. Exact match*/ guid?: string; /*Find user with this email address. Case in-sensitive. Exact match*/ email?: string; /*Find user with the specified nickname. For users that register via GitHub, this will be their GitHub username. Case in-sensitive. Exact match*/ nickname?: string; /*Find the user with this API token. Exact match*/ token?: string; } export interface UsersGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface UsersPostAuthenticateParameters { headers?: $HttpHeaders; email: string; password: string; } export interface UsersPostAuthenticateGithubParameters { headers?: $HttpHeaders; /*The GitHub assigned oauth token*/ token: string; } export interface UsersPostParameters { body: com.afrosoft.apibuilder.api.v0.models.UserForm; headers?: $HttpHeaders; } export interface UsersPutByGuidParameters { body: com.afrosoft.apibuilder.api.v0.models.UserUpdateForm; headers?: $HttpHeaders; guid: string; } export interface ValidationsPostParameters { body: string; headers?: $HttpHeaders; } export interface VersionsGetByApplicationKeyParameters { headers?: $HttpHeaders; /*The organization key for which to search versions*/ orgKey: string; /*The application key for which to search versions*/ applicationKey: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface VersionsGetByApplicationKeyAndVersionParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; /*The version of tthis application to download, or the keyword latest to get the latest version*/ version: string; } export interface VersionsPostByVersionParameters { body: com.afrosoft.apibuilder.api.v0.models.VersionForm; headers?: $HttpHeaders; orgKey: string; version: string; } export interface VersionsPutByApplicationKeyAndVersionParameters { body: com.afrosoft.apibuilder.api.v0.models.VersionForm; headers?: $HttpHeaders; orgKey: string; applicationKey: string; version: string; } export interface VersionsDeleteByApplicationKeyAndVersionParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; version: string; } export interface VersionsGetExampleByApplicationKeyAndVersionAndTypeNameParameters { headers?: $HttpHeaders; orgKey: string; applicationKey: string; /*The version of this application to download, or the keyword latest to get the latest version*/ version: string; /*The name of the type (e.g. model name) for which you would like to generate a sample json document*/ type_name: string; /*The name of the sub-type for which you would like to generate a sample json document, e.g. a specific type of a union*/ sub_type_name?: string; /*If true, we generate sample data for all optional fields. Otherwise the generated sample will contain only required fields, where applicable*/ optional_fields?: boolean; } export interface WatchesGetParameters { headers?: $HttpHeaders; /*Find the watch with this guid.*/ guid?: string; /*Find attributes for this user.*/ user_guid?: string; /*Find attributes for this organization.*/ organization_key?: string; /*Find attributes for this application.*/ application_key?: string; /*The number of records to return*/ limit?: number; /*Used to paginate. First page of results is 0.*/ offset?: number; } export interface WatchesGetByGuidParameters { headers?: $HttpHeaders; guid: string; } export interface WatchesGetCheckParameters { headers?: $HttpHeaders; /*The user for which we are checking. API returns false if the user guid is not provided*/ user_guid?: string; organization_key: string; application_key: string; } export interface WatchesPostParameters { body: com.afrosoft.apibuilder.api.v0.models.WatchForm; headers?: $HttpHeaders; } export interface WatchesDeleteByGuidParameters { headers?: $HttpHeaders; guid: string; } export type ApplicationsGetMetadataAndVersionsByApplicationKeyResponse = $HttpOk | $HttpUnauthorized | $HttpNotFound; export type ApplicationsGetMetadataAndVersionsAndLatestTxtByApplicationKeyResponse = $HttpOk | $HttpUnauthorized | $HttpNotFound; export type ApplicationsGetResponse = $HttpOk; export type ApplicationsPostResponse = $HttpOk | $HttpConflict; export type ApplicationsPutByApplicationKeyResponse = $HttpOk | $HttpConflict; export type ApplicationsDeleteByApplicationKeyResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type ApplicationsPostMoveByApplicationKeyResponse = $HttpOk | $HttpConflict; export type AttributesGetResponse = $HttpOk; export type AttributesGetByNameResponse = $HttpOk | $HttpNotFound; export type AttributesPostResponse = $HttpCreated | $HttpUnauthorized | $HttpConflict; export type AttributesDeleteByNameResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type AuthenticationsGetSessionByIdResponse = $HttpOk | $HttpNotFound; export type ChangesGetResponse = $HttpOk; export type CodePostFormResponse = $HttpOk | $HttpConflict; export type CodeGetByGeneratorKeyResponse = $HttpOk | $HttpConflict; export type CodePostByGeneratorKeyResponse = $HttpOk | $HttpConflict; export type DomainsPostResponse = $HttpOk | $HttpConflict; export type DomainsDeleteByNameResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type EmailVerificationConfirmationFormsPostResponse = $HttpNoContent | $HttpConflict; export type GeneratorServicesGetResponse = $HttpOk; export type GeneratorServicesGetByGuidResponse = $HttpOk | $HttpNotFound; export type GeneratorServicesPostResponse = $HttpOk | $HttpConflict; export type GeneratorServicesDeleteByGuidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type GeneratorWithServicesGetResponse = $HttpOk; export type GeneratorWithServicesGetByKeyResponse = $HttpOk | $HttpNotFound; export type HealthchecksGetHealthcheckResponse = $HttpOk; export type HealthchecksGetMigrateResponse = $HttpOk>; export type ItemsGetResponse = $HttpOk; export type ItemsGetByGuidResponse = $HttpOk | $HttpNotFound; export type MembershipsGetResponse = $HttpOk; export type MembershipsGetByGuidResponse = $HttpOk | $HttpNotFound; export type MembershipsDeleteByGuidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type MembershipRequestsGetResponse = $HttpOk; export type MembershipRequestsPostResponse = $HttpOk | $HttpConflict; export type MembershipRequestsPostAcceptByGuidResponse = $HttpNoContent | $HttpConflict; export type MembershipRequestsPostDeclineByGuidResponse = $HttpNoContent | $HttpConflict; export type OrganizationsGetResponse = $HttpOk; export type OrganizationsGetByKeyResponse = $HttpOk | $HttpNotFound; export type OrganizationsPostResponse = $HttpOk | $HttpConflict; export type OrganizationsPutByKeyResponse = $HttpOk | $HttpConflict; export type OrganizationsDeleteByKeyResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type OrganizationsGetAttributesByKeyResponse = $HttpOk; export type OrganizationsGetAttributesByKeyAndNameResponse = $HttpOk | $HttpNotFound; export type OrganizationsPutAttributesByKeyAndNameResponse = $HttpOk | $HttpCreated | $HttpNotFound | $HttpConflict; export type OrganizationsDeleteAttributesByKeyAndNameResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type PasswordResetsPostResponse = $HttpOk | $HttpConflict; export type PasswordResetRequestsPostResponse = $HttpNoContent | $HttpConflict; export type SubscriptionsGetResponse = $HttpOk; export type SubscriptionsGetByGuidResponse = $HttpOk | $HttpNotFound; export type SubscriptionsPostResponse = $HttpCreated | $HttpConflict; export type SubscriptionsDeleteByGuidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type TokensGetUsersByUserGuidResponse = $HttpOk; export type TokensGetCleartextByGuidResponse = $HttpOk | $HttpNotFound; export type TokensPostResponse = $HttpCreated | $HttpConflict; export type TokensDeleteByGuidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type UsersGetResponse = $HttpOk; export type UsersGetByGuidResponse = $HttpOk | $HttpNotFound; export type UsersPostAuthenticateResponse = $HttpOk | $HttpConflict; export type UsersPostAuthenticateGithubResponse = $HttpOk | $HttpConflict; export type UsersPostResponse = $HttpOk | $HttpConflict; export type UsersPutByGuidResponse = $HttpOk | $HttpConflict; export type ValidationsPostResponse = $HttpOk; export type VersionsGetByApplicationKeyResponse = $HttpOk; export type VersionsGetByApplicationKeyAndVersionResponse = $HttpOk | $HttpNotFound; export type VersionsPostByVersionResponse = $HttpOk | $HttpConflict; export type VersionsPutByApplicationKeyAndVersionResponse = $HttpOk | $HttpConflict; export type VersionsDeleteByApplicationKeyAndVersionResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type VersionsGetExampleByApplicationKeyAndVersionAndTypeNameResponse = $HttpOk | $HttpNotFound; export type WatchesGetResponse = $HttpOk; export type WatchesGetByGuidResponse = $HttpOk | $HttpNotFound; export type WatchesGetCheckResponse = $HttpOk; export type WatchesPostResponse = $HttpCreated | $HttpConflict; export type WatchesDeleteByGuidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export class ApplicationsResource extends $Resource { /*Returns the versions assocoated with the specified application. The latest version is the first result returned.*/ public getMetadataAndVersionsByApplicationKey(params: ApplicationsGetMetadataAndVersionsByApplicationKeyParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/metadata/${encodeURIComponent(params.applicationKey)}/versions`, headers: params.headers, method: 'GET', query: { limit: params.limit, offset: params.offset, }, }); } /*Returns the latest version number as a string*/ public getMetadataAndVersionsAndLatestTxtByApplicationKey( params: ApplicationsGetMetadataAndVersionsAndLatestTxtByApplicationKeyParameters, ): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/metadata/${encodeURIComponent(params.applicationKey)}/versions/latest.txt`, headers: params.headers, method: 'GET', }); } /*Search all applications. Results are always paginated.*/ public get(params: ApplicationsGetParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}`, headers: params.headers, method: 'GET', query: { guid: params.guid, has_version: params.has_version, key: params.key, limit: params.limit, name: params.name, offset: params.offset, order: params.order, sort_by: params.sort_by, }, }); } /*Create an application.*/ public post(params: ApplicationsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}`, headers: params.headers, method: 'POST', }); } /*Updates an application.*/ public putByApplicationKey(params: ApplicationsPutByApplicationKeyParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}`, headers: params.headers, method: 'PUT', }); } /*Deletes a specific application and its associated versions.*/ public deleteByApplicationKey(params: ApplicationsDeleteByApplicationKeyParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}`, headers: params.headers, method: 'DELETE', }); } /*Moves application to a new organization.*/ public postMoveByApplicationKey(params: ApplicationsPostMoveByApplicationKeyParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/move`, headers: params.headers, method: 'POST', }); } } export class AttributesResource extends $Resource { /*Search all attributes. Results are always paginated.*/ public get(params: AttributesGetParameters): Promise { return this.client.request({ endpoint: '/attributes', headers: params.headers, method: 'GET', query: { guid: params.guid, limit: params.limit, name: params.name, offset: params.offset, }, }); } /*Returns the attribute with this name.*/ public getByName(params: AttributesGetByNameParameters): Promise { return this.client.request({ endpoint: `/attributes/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'GET', }); } /*Create a new attribute.*/ public post(params: AttributesPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/attributes', headers: params.headers, method: 'POST', }); } /*Deletes the attribute with this name. Only the user who created an attribute can delete it.*/ public deleteByName(params: AttributesDeleteByNameParameters): Promise { return this.client.request({ endpoint: `/attributes/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'DELETE', }); } } export class AuthenticationsResource extends $Resource { public getSessionById(params: AuthenticationsGetSessionByIdParameters): Promise { return this.client.request({ endpoint: `/authentications/session/${encodeURIComponent(params.id)}`, headers: params.headers, method: 'GET', }); } } export class ChangesResource extends $Resource { public get(params: ChangesGetParameters): Promise { return this.client.request({ endpoint: '/changes', headers: params.headers, method: 'GET', query: { application_key: params.application_key, from: params.from, limit: params.limit, offset: params.offset, org_key: params.org_key, to: params.to, type: params.type, }, }); } } export class CodeResource extends $Resource { /*Create an invocation form. This is useful primarily for debugging when you want to see exactly what content is being forwarded to the generator*/ public postForm(params: CodePostFormParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}/form`, headers: params.headers, method: 'POST', }); } /*Generate code for a specific version of an application.*/ public getByGeneratorKey(params: CodeGetByGeneratorKeyParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}/${encodeURIComponent(params.generatorKey)}`, headers: params.headers, method: 'GET', }); } /*Generate code for a specific version of an application.*/ public postByGeneratorKey(params: CodePostByGeneratorKeyParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}/${encodeURIComponent(params.generatorKey)}`, headers: params.headers, method: 'POST', }); } } export class DomainsResource extends $Resource { /*Add a domain to this organization*/ public post(params: DomainsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: `/domains/${encodeURIComponent(params.orgKey)}`, headers: params.headers, method: 'POST', }); } /*Remove this domain from this organization*/ public deleteByName(params: DomainsDeleteByNameParameters): Promise { return this.client.request({ endpoint: `/domains/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'DELETE', }); } } export class EmailVerificationConfirmationFormsResource extends $Resource { /*Validate an email address using a token.*/ public post(params: EmailVerificationConfirmationFormsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/email_verification_confirmations', headers: params.headers, method: 'POST', }); } } export class GeneratorServicesResource extends $Resource { /*List all generator services*/ public get(params: GeneratorServicesGetParameters): Promise { return this.client.request({ endpoint: '/generator_services', headers: params.headers, method: 'GET', query: { generator_key: params.generator_key, guid: params.guid, limit: params.limit, offset: params.offset, uri: params.uri, }, }); } public getByGuid(params: GeneratorServicesGetByGuidParameters): Promise { return this.client.request({ endpoint: `/generator_services/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } public post(params: GeneratorServicesPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/generator_services', headers: params.headers, method: 'POST', }); } /*Deletes a generator service.*/ public deleteByGuid(params: GeneratorServicesDeleteByGuidParameters): Promise { return this.client.request({ endpoint: `/generator_services/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'DELETE', }); } } export class GeneratorWithServicesResource extends $Resource { /*List all available generators*/ public get(params: GeneratorWithServicesGetParameters): Promise { return this.client.request({ endpoint: '/generators', headers: params.headers, method: 'GET', query: { attribute_name: params.attribute_name, guid: params.guid, key: params.key, limit: params.limit, offset: params.offset, service_guid: params.service_guid, service_uri: params.service_uri, }, }); } public getByKey(params: GeneratorWithServicesGetByKeyParameters): Promise { return this.client.request({ endpoint: `/generators/${encodeURIComponent(params.key)}`, headers: params.headers, method: 'GET', }); } } export class HealthchecksResource extends $Resource { public getHealthcheck(params: HealthchecksGetHealthcheckParameters = {}): Promise { return this.client.request({ endpoint: '/_internal_/healthcheck', headers: params.headers, method: 'GET', }); } public getMigrate(params: HealthchecksGetMigrateParameters = {}): Promise { return this.client.request({ endpoint: '/_internal_/migrate', headers: params.headers, method: 'GET', }); } } export class ItemsResource extends $Resource { public get(params: ItemsGetParameters): Promise { return this.client.request({ endpoint: '/items', headers: params.headers, method: 'GET', query: { limit: params.limit, offset: params.offset, q: params.q, }, }); } public getByGuid(params: ItemsGetByGuidParameters): Promise { return this.client.request({ endpoint: `/items/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } } export class MembershipsResource extends $Resource { /*Search all memberships. Results are always paginated.*/ public get(params: MembershipsGetParameters): Promise { return this.client.request({ endpoint: '/memberships', headers: params.headers, method: 'GET', query: { limit: params.limit, offset: params.offset, org_guid: params.org_guid, org_key: params.org_key, role: params.role, user_guid: params.user_guid, }, }); } public getByGuid(params: MembershipsGetByGuidParameters): Promise { return this.client.request({ endpoint: `/memberships/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } public deleteByGuid(params: MembershipsDeleteByGuidParameters): Promise { return this.client.request({ endpoint: `/memberships/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'DELETE', }); } } export class MembershipRequestsResource extends $Resource { /*Search all membership requests. Results are always paginated.*/ public get(params: MembershipRequestsGetParameters): Promise { return this.client.request({ endpoint: '/membership_requests', headers: params.headers, method: 'GET', query: { limit: params.limit, offset: params.offset, org_guid: params.org_guid, org_key: params.org_key, role: params.role, user_guid: params.user_guid, }, }); } /*Create a membership request*/ public post(params: MembershipRequestsPostParameters): Promise { return this.client.request({ endpoint: '/membership_requests', headers: params.headers, method: 'POST', }); } /*Accepts this membership request. User will become a member of the specified organization.*/ public postAcceptByGuid(params: MembershipRequestsPostAcceptByGuidParameters): Promise { return this.client.request({ endpoint: `/membership_requests/${encodeURIComponent(params.guid)}/accept`, headers: params.headers, method: 'POST', }); } /*Declines this membership request. User will NOT become a member of the specified organization.*/ public postDeclineByGuid(params: MembershipRequestsPostDeclineByGuidParameters): Promise { return this.client.request({ endpoint: `/membership_requests/${encodeURIComponent(params.guid)}/decline`, headers: params.headers, method: 'POST', }); } } export class OrganizationsResource extends $Resource { /*Search all organizations. Results are always paginated.*/ public get(params: OrganizationsGetParameters): Promise { return this.client.request({ endpoint: '/organizations', headers: params.headers, method: 'GET', query: { guid: params.guid, key: params.key, limit: params.limit, name: params.name, namespace: params.namespace, offset: params.offset, user_guid: params.user_guid, }, }); } /*Returns the organization with this key.*/ public getByKey(params: OrganizationsGetByKeyParameters): Promise { return this.client.request({ endpoint: `/organizations/${encodeURIComponent(params.key)}`, headers: params.headers, method: 'GET', }); } /*Create a new organization.*/ public post(params: OrganizationsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/organizations', headers: params.headers, method: 'POST', }); } /*Update an organization.*/ public putByKey(params: OrganizationsPutByKeyParameters): Promise { return this.client.request({ body: params.body, endpoint: `/organizations/${encodeURIComponent(params.key)}`, headers: params.headers, method: 'PUT', }); } /*Deletes an organization and all of its associated applications.*/ public deleteByKey(params: OrganizationsDeleteByKeyParameters): Promise { return this.client.request({ endpoint: `/organizations/${encodeURIComponent(params.key)}`, headers: params.headers, method: 'DELETE', }); } /*Returns all attribute values for this organization. Results are always paginated.*/ public getAttributesByKey(params: OrganizationsGetAttributesByKeyParameters): Promise { return this.client.request({ endpoint: `/organizations/${encodeURIComponent(params.key)}/attributes`, headers: params.headers, method: 'GET', query: { limit: params.limit, name: params.name, offset: params.offset, }, }); } /*Returns the attribute value with this name.*/ public getAttributesByKeyAndName(params: OrganizationsGetAttributesByKeyAndNameParameters): Promise { return this.client.request({ endpoint: `/organizations/${encodeURIComponent(params.key)}/attributes/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'GET', }); } /*Create or update a new attribute value.*/ public putAttributesByKeyAndName(params: OrganizationsPutAttributesByKeyAndNameParameters): Promise { return this.client.request({ body: params.body, endpoint: `/organizations/${encodeURIComponent(params.key)}/attributes/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'PUT', }); } /*Deletes the attribute value with the specified name. Only the user who created an attribute value can delete it.*/ public deleteAttributesByKeyAndName(params: OrganizationsDeleteAttributesByKeyAndNameParameters): Promise { return this.client.request({ endpoint: `/organizations/${encodeURIComponent(params.key)}/attributes/${encodeURIComponent(params.name)}`, headers: params.headers, method: 'DELETE', }); } } export class PasswordResetsResource extends $Resource { /*Change the password for this token. If the token is invalid, has been used, or otherwise no longer can be applied, errors will be returned as 409s. A 204 represents that the user has successfully changed their password.*/ public post(params: PasswordResetsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/password_resets', headers: params.headers, method: 'POST', }); } } export class PasswordResetRequestsResource extends $Resource { /*Create a new password reset. This will send the user an email with a link to reset their password.*/ public post(params: PasswordResetRequestsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/password_reset_requests', headers: params.headers, method: 'POST', }); } } export class SubscriptionsResource extends $Resource { /*Search subscriptions. Always paginated.*/ public get(params: SubscriptionsGetParameters): Promise { return this.client.request({ endpoint: '/subscriptions', headers: params.headers, method: 'GET', query: { guid: params.guid, limit: params.limit, offset: params.offset, organization_key: params.organization_key, publication: params.publication, user_guid: params.user_guid, }, }); } /*Returns information about a specific subscription.*/ public getByGuid(params: SubscriptionsGetByGuidParameters): Promise { return this.client.request({ endpoint: `/subscriptions/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } /*Create a new subscription.*/ public post(params: SubscriptionsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/subscriptions', headers: params.headers, method: 'POST', }); } public deleteByGuid(params: SubscriptionsDeleteByGuidParameters): Promise { return this.client.request({ endpoint: `/subscriptions/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'DELETE', }); } } export class TokensResource extends $Resource { public getUsersByUserGuid(params: TokensGetUsersByUserGuidParameters): Promise { return this.client.request({ endpoint: `/tokens/users/${encodeURIComponent(params.user_guid)}`, headers: params.headers, method: 'GET', query: { guid: params.guid, limit: params.limit, offset: params.offset, }, }); } /*Used to fetch the clear text token.*/ public getCleartextByGuid(params: TokensGetCleartextByGuidParameters): Promise { return this.client.request({ endpoint: `/tokens/${encodeURIComponent(params.guid)}/cleartext`, headers: params.headers, method: 'GET', }); } /*Create a new API token for this user*/ public post(params: TokensPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/tokens', headers: params.headers, method: 'POST', }); } public deleteByGuid(params: TokensDeleteByGuidParameters): Promise { return this.client.request({ endpoint: `/tokens/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'DELETE', }); } } export class UsersResource extends $Resource { /*Search for a specific user. You must specify at least 1 parameter - either a guid, email or token - and will receive back either 0 or 1 users.*/ public get(params: UsersGetParameters = {}): Promise { return this.client.request({ endpoint: '/users', headers: params.headers, method: 'GET', query: { email: params.email, guid: params.guid, nickname: params.nickname, token: params.token, }, }); } /*Returns information about the user with this guid.*/ public getByGuid(params: UsersGetByGuidParameters): Promise { return this.client.request({ endpoint: `/users/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } /*Used to authenticate a user with an email address and password. Successful authentication returns an instance of the user model. Failed authorizations of any kind are returned as a generic error with code user_authorization_failed.*/ public postAuthenticate(params: UsersPostAuthenticateParameters): Promise { return this.client.request({ endpoint: '/users/authenticate', headers: params.headers, method: 'POST', }); } /*Used to authenticate a user using a github access token. This is equivalent to running the following command to get the user info: curl -H 'Authorization: Bearer code' https://api.github.com/user*/ public postAuthenticateGithub(params: UsersPostAuthenticateGithubParameters): Promise { return this.client.request({ endpoint: '/users/authenticate_github', headers: params.headers, method: 'POST', }); } /*Create a new user.*/ public post(params: UsersPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/users', headers: params.headers, method: 'POST', }); } /*Updates information about the user with the specified guid.*/ public putByGuid(params: UsersPutByGuidParameters): Promise { return this.client.request({ body: params.body, endpoint: `/users/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'PUT', }); } } export class ValidationsResource extends $Resource { public post(params: ValidationsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/validations', headers: params.headers, method: 'POST', }); } } export class VersionsResource extends $Resource { /*Search all versions of this application. Results are always paginated.*/ public getByApplicationKey(params: VersionsGetByApplicationKeyParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}`, headers: params.headers, method: 'GET', query: { limit: params.limit, offset: params.offset, }, }); } /*Retrieve a specific version of an application.*/ public getByApplicationKeyAndVersion(params: VersionsGetByApplicationKeyAndVersionParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}`, headers: params.headers, method: 'GET', }); } /*Create a new version for an application*/ public postByVersion(params: VersionsPostByVersionParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.version)}`, headers: params.headers, method: 'POST', }); } /*Upsert a version of an application*/ public putByApplicationKeyAndVersion(params: VersionsPutByApplicationKeyAndVersionParameters): Promise { return this.client.request({ body: params.body, endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}`, headers: params.headers, method: 'PUT', }); } /*Deletes a specific version.*/ public deleteByApplicationKeyAndVersion(params: VersionsDeleteByApplicationKeyAndVersionParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}`, headers: params.headers, method: 'DELETE', }); } /*Generates an example JSON document of the type with the specified name.*/ public getExampleByApplicationKeyAndVersionAndTypeName(params: VersionsGetExampleByApplicationKeyAndVersionAndTypeNameParameters): Promise { return this.client.request({ endpoint: `/${encodeURIComponent(params.orgKey)}/${encodeURIComponent(params.applicationKey)}/${encodeURIComponent(params.version)}/example/${encodeURIComponent(params.type_name)}`, headers: params.headers, method: 'GET', query: { optional_fields: params.optional_fields, sub_type_name: params.sub_type_name, }, }); } } export class WatchesResource extends $Resource { /*Search attributes. Always paginated.*/ public get(params: WatchesGetParameters): Promise { return this.client.request({ endpoint: '/watches', headers: params.headers, method: 'GET', query: { application_key: params.application_key, guid: params.guid, limit: params.limit, offset: params.offset, organization_key: params.organization_key, user_guid: params.user_guid, }, }); } /*Returns information about a specific watch.*/ public getByGuid(params: WatchesGetByGuidParameters): Promise { return this.client.request({ endpoint: `/watches/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'GET', }); } /*Quick check if a user is watching a specific application.*/ public getCheck(params: WatchesGetCheckParameters): Promise { return this.client.request({ endpoint: '/watches/check', headers: params.headers, method: 'GET', query: { application_key: params.application_key, organization_key: params.organization_key, user_guid: params.user_guid, }, }); } /*Create a new watch.*/ public post(params: WatchesPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/watches', headers: params.headers, method: 'POST', }); } public deleteByGuid(params: WatchesDeleteByGuidParameters): Promise { return this.client.request({ endpoint: `/watches/${encodeURIComponent(params.guid)}`, headers: params.headers, method: 'DELETE', }); } } export interface ClientInstance { applications: ApplicationsResource; attributes: AttributesResource; authentications: AuthenticationsResource; changes: ChangesResource; code: CodeResource; domains: DomainsResource; emailVerificationConfirmationForms: EmailVerificationConfirmationFormsResource; generatorServices: GeneratorServicesResource; generatorWithServices: GeneratorWithServicesResource; healthchecks: HealthchecksResource; items: ItemsResource; memberships: MembershipsResource; membershipRequests: MembershipRequestsResource; organizations: OrganizationsResource; passwordResets: PasswordResetsResource; passwordResetRequests: PasswordResetRequestsResource; subscriptions: SubscriptionsResource; tokens: TokensResource; users: UsersResource; validations: ValidationsResource; versions: VersionsResource; watches: WatchesResource; } export function createClient(options: $HttpClientOptions): ClientInstance { return { applications: new ApplicationsResource(options), attributes: new AttributesResource(options), authentications: new AuthenticationsResource(options), changes: new ChangesResource(options), code: new CodeResource(options), domains: new DomainsResource(options), emailVerificationConfirmationForms: new EmailVerificationConfirmationFormsResource(options), generatorServices: new GeneratorServicesResource(options), generatorWithServices: new GeneratorWithServicesResource(options), healthchecks: new HealthchecksResource(options), items: new ItemsResource(options), memberships: new MembershipsResource(options), membershipRequests: new MembershipRequestsResource(options), organizations: new OrganizationsResource(options), passwordResets: new PasswordResetsResource(options), passwordResetRequests: new PasswordResetRequestsResource(options), subscriptions: new SubscriptionsResource(options), tokens: new TokensResource(options), users: new UsersResource(options), validations: new ValidationsResource(options), versions: new VersionsResource(options), watches: new WatchesResource(options), }; }