This is an automated email from the ASF dual-hosted git repository. ocket8888 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficcontrol-trafficops-types.git
commit 323a39dae10e542c44551ff588147cc3f2b82ee3 Author: ocket8888 <[email protected]> AuthorDate: Sat Apr 23 01:44:48 2022 -0600 Add compiled library and type declarations --- dist/about.d.ts | 12 +++ dist/about.js | 1 + dist/acme.d.ts | 6 ++ dist/acme.js | 1 + dist/alert.d.ts | 11 +++ dist/alert.js | 3 + dist/cache.group.d.ts | 66 +++++++++++++ dist/cache.group.js | 10 ++ dist/cdn.d.ts | 13 +++ dist/cdn.js | 1 + dist/delivery.service.d.ts | 222 ++++++++++++++++++++++++++++++++++++++++++++ dist/delivery.service.js | 50 ++++++++++ dist/division.d.ts | 21 +++++ dist/division.js | 1 + dist/index.d.ts | 39 ++++++++ dist/index.js | 29 ++++++ dist/invalidation.d.ts | 19 ++++ dist/invalidation.js | 1 + dist/iso.d.ts | 25 +++++ dist/iso.js | 1 + dist/login.d.ts | 21 +++++ dist/login.js | 1 + dist/logs.d.ts | 12 +++ dist/logs.js | 8 ++ dist/parameter.d.ts | 16 ++++ dist/parameter.js | 1 + dist/physical.location.d.ts | 29 ++++++ dist/physical.location.js | 1 + dist/plugin.d.ts | 5 + dist/plugin.js | 1 + dist/profile.d.ts | 46 +++++++++ dist/profile.js | 1 + dist/server.d.ts | 65 +++++++++++++ dist/server.js | 74 +++++++++++++++ dist/stats.d.ts | 34 +++++++ dist/stats.js | 1 + dist/status.d.ts | 11 +++ dist/status.js | 1 + dist/type.d.ts | 13 +++ dist/type.js | 1 + dist/user.d.ts | 126 +++++++++++++++++++++++++ dist/user.js | 1 + dist/vault.d.ts | 7 ++ dist/vault.js | 1 + 44 files changed, 1009 insertions(+) diff --git a/dist/about.d.ts b/dist/about.d.ts new file mode 100644 index 0000000..411ae82 --- /dev/null +++ b/dist/about.d.ts @@ -0,0 +1,12 @@ +export interface About { + commitHash?: string; + commits?: string; + goVersion?: string; + name?: string; + release: string; + RPMVersion?: string; + Version?: string; +} +export interface SystemInfo { + [parameter: string]: string; +} diff --git a/dist/about.js b/dist/about.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/about.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/acme.d.ts b/dist/acme.d.ts new file mode 100644 index 0000000..e768ddb --- /dev/null +++ b/dist/acme.d.ts @@ -0,0 +1,6 @@ +export interface ACMEAccount { + email: string; + privateKey: string; + provider: string; + uri: string; +} diff --git a/dist/acme.js b/dist/acme.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/acme.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/alert.d.ts b/dist/alert.d.ts new file mode 100644 index 0000000..a43808e --- /dev/null +++ b/dist/alert.d.ts @@ -0,0 +1,11 @@ +export declare const enum AlertLevel { + ERROR = "error", + INFO = "info", + SUCCESS = "success", + WARNING = "warning" +} +export interface Alert { + level: AlertLevel; + text: string; +} +export declare function errors(as: Array<Alert>): Array<string>; diff --git a/dist/alert.js b/dist/alert.js new file mode 100644 index 0000000..ab80f21 --- /dev/null +++ b/dist/alert.js @@ -0,0 +1,3 @@ +export function errors(as) { + return as.filter(a => a.level === "error").map(a => a.text); +} diff --git a/dist/cache.group.d.ts b/dist/cache.group.d.ts new file mode 100644 index 0000000..aa3e779 --- /dev/null +++ b/dist/cache.group.d.ts @@ -0,0 +1,66 @@ +export interface ResponseASN { + asn: number; + cachegroup: string; + cachegroupId: number; + readonly id: number; + lastUpdated: Date; +} +export interface RequestASN { + asn: number; + cachegroupId: number; +} +export declare type ASN = RequestASN | ResponseASN; +export declare const enum LocalizationMethod { + CZ = "CZ", + DEEP_CZ = "DEEP_CZ", + GEO = "GEO" +} +export declare function localizationMethodToString(l: LocalizationMethod): string; +export interface RequestCacheGroup { + fallbacks?: Array<string> | null; + fallbackToClosest?: boolean | null; + latitude?: number | null; + localizationMethods?: Array<LocalizationMethod> | null; + longitude?: number | null; + name: string; + parentCacheGroupId?: number | null; + secondaryParentId?: number | null; + shortName: string; + typeId: number; +} +interface ResponseCacheGroupBase { + fallbacks: Array<string>; + fallbackToClosest: boolean; + readonly id: number; + lastUpdated: Date; + latitude: number | null; + localizationMethods: Array<LocalizationMethod>; + longitude: number | null; + name: string; + shortName: string; + typeId: number; + typeName: string; +} +interface ResponseCacheGroupWithParent extends ResponseCacheGroupBase { + parentCacheGroupId: number; + parentCacheGroupName: string; +} +interface ResponseCacheGroupWithoutParent extends ResponseCacheGroupBase { + parentCacheGroupId: null; + parentCacheGroupName: null; +} +interface ResponseCacheGroupWithSecondaryParent extends ResponseCacheGroupBase { + secondaryParentId: number; + secondaryParentName: string; +} +interface ResponseCacheGroupWithoutSecondaryParent extends ResponseCacheGroupBase { + secondaryParentId: null; + secondaryParentName: null; +} +declare type ResponseCacheGroupWithParentButNotSecondary = ResponseCacheGroupWithParent & ResponseCacheGroupWithoutSecondaryParent; +declare type ResponseCacheGroupWithParentAndSecondary = ResponseCacheGroupWithParent & ResponseCacheGroupWithSecondaryParent; +declare type ResponseCacheGroupWithSecondaryButNotParent = ResponseCacheGroupWithoutParent & ResponseCacheGroupWithSecondaryParent; +declare type ResponseCacheGroupWithoutParentOrSecondary = ResponseCacheGroupWithoutParent & ResponseCacheGroupWithoutSecondaryParent; +export declare type ResponseCacheGroup = ResponseCacheGroupWithParentButNotSecondary | ResponseCacheGroupWithParentAndSecondary | ResponseCacheGroupWithSecondaryButNotParent | ResponseCacheGroupWithoutParentOrSecondary; +export declare type CacheGroup = RequestCacheGroup | ResponseCacheGroup; +export {}; diff --git a/dist/cache.group.js b/dist/cache.group.js new file mode 100644 index 0000000..326ed49 --- /dev/null +++ b/dist/cache.group.js @@ -0,0 +1,10 @@ +export function localizationMethodToString(l) { + switch (l) { + case "CZ": + return "Coverage Zone File"; + case "DEEP_CZ": + return "Deep Coverage Zone File"; + case "GEO": + return "Geo-IP Database"; + } +} diff --git a/dist/cdn.d.ts b/dist/cdn.d.ts new file mode 100644 index 0000000..0320cdc --- /dev/null +++ b/dist/cdn.d.ts @@ -0,0 +1,13 @@ +export interface RequestCDN { + dnssecEnabled: boolean; + domainName: string; + name: string; +} +export interface ResponseCDN { + dnssecEnabled: boolean; + domainName: string; + readonly id: number; + lastUpdated: Date; + name: string; +} +export declare type CDN = RequestCDN | ResponseCDN; diff --git a/dist/cdn.js b/dist/cdn.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/cdn.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/delivery.service.d.ts b/dist/delivery.service.d.ts new file mode 100644 index 0000000..b2f8b22 --- /dev/null +++ b/dist/delivery.service.d.ts @@ -0,0 +1,222 @@ +export declare const enum GeoLimit { + NONE = 0, + CZF_ONLY = 1, + CZF_AND_COUNTRY_CODES = 2 +} +export declare const enum GeoProvider { + MAX_MIND = 0, + NEUSTAR = 1 +} +export interface DeliveryServiceMatch { + pattern: string; + setNumber: number; + type: string; +} +export declare const enum Protocol { + HTTP = 0, + HTTPS = 1, + HTTP_AND_HTTPS = 2, + HTTP_TO_HTTPS = 3 +} +export declare function protocolToString(p: Protocol): string; +export declare const enum QStringHandling { + USE = 0, + IGNORE = 1, + DROP = 2 +} +export declare function qStringHandlingToString(q: QStringHandling): string; +export declare const enum RangeRequestHandling { + NONE = 0, + BACKGROUND_FETCH = 1, + CACHE_RANGE_REQUESTS = 2 +} +export declare function rangeRequestHandlingToString(r: RangeRequestHandling): string; +interface RequestDeliveryServiceBase { + active: boolean; + anonymousBlockingEnabled?: number | null; + cacheurl: string | null; + ccrDnsTtl?: number | null; + cdnId: number; + checkPath?: string | null; + consistentHashQueryParams?: Array<string> | null; + consistentHashRegex?: string | null; + deepCachingType?: "ALWAYS" | "NEVER" | null; + displayName: string; + dnsBypassCname?: string | null; + dnsBypassIp?: string | null; + dnsBypassIp6?: string | null; + dnsBypassTtl?: string | null; + dscp: number; + ecsEnabled?: boolean | null; + edgeHeaderRewrite?: string | null; + firstHeaderRewrite?: string | null; + fqPacingRate?: number | null; + geoLimit: GeoLimit; + geoLimitCountries?: string | null; + geoLimitRedirectUrl?: string | null; + geoProvider: GeoProvider; + globalMaxMbps?: number | null; + globalMaxTps?: number | null; + httpBypassFqdn: string | null; + infoUrl: string | null; + initialDispersion?: number | null; + innerHeaderRewrite?: string | null; + ipv6RoutingEnabled?: boolean | null; + lastHeaderRewrite?: string | null; + logsEnabled: boolean; + longDesc?: string | null; + longDesc1?: string | null; + longDesc2?: string | null; + maxDnsAnswers?: number | null; + maxOriginConnections?: number | null; + maxRequestHeaderBytes?: number | null; + midHeaderRewrite?: string | null; + missLat?: number | null; + missLong?: number | null; + multiSiteOrigin?: boolean | null; + orgServerFqdn?: string | null; + originShield?: string | null; + profileId?: number | null; + protocol?: Protocol | null; + qstringIgnore?: QStringHandling | null; + rangeRequestHandling?: RangeRequestHandling | null; + rangeSliceBlockSize?: null | number; + regexRemap?: string | null; + regionalGeoBlocking: boolean; + remapText: string | null; + routingName?: string | null; + serviceCategory?: string | null; + signed?: boolean | null; + signingAlgorithm?: "url_sig" | "uri_signing" | null; + sslKeyVersion?: number | null; + tenantId: number; + topology?: string | null; + trRequestHeaders?: string | null; + trResponseHeaders?: string | null; + typeId: number; + xmlId: string; +} +export interface RequestHTTPDeliveryService extends RequestDeliveryServiceBase { + initialDispersion: number; + ipv6RoutingEnabled: boolean; + missLat: number; + missLong: number; + multiSiteOrigin: boolean; + orgServerFqdn: string; + protocol: Protocol; + qstringIgnore: QStringHandling; + rangeRequestHandling: RangeRequestHandling; +} +export interface RequestDNSDeliveryService extends RequestDeliveryServiceBase { + ipv6RoutingEnabled: boolean; + missLat: number; + missLong: number; + multiSiteOrigin: boolean; + orgServerFqdn: string; + protocol: Protocol; + qstringIgnore: QStringHandling; + rangeRequestHandling: RangeRequestHandling; +} +export declare type RequestSteeringDeliveryService = RequestDeliveryServiceBase; +export declare type RequestAnyMapDeliveryService = RequestDeliveryServiceBase; +export declare type RequestDeliveryService = RequestHTTPDeliveryService | RequestDNSDeliveryService | RequestSteeringDeliveryService | RequestAnyMapDeliveryService; +interface ResponseDeliveryServiceBase { + active: boolean; + anonymousBlockingEnabled: boolean; + cacheurl: string | null; + ccrDnsTtl: number | null; + cdnId: number; + cdnName: string | null; + checkPath: string | null; + consistentHashQueryParams: null | [string, ...Array<string>]; + consistentHashRegex: string | null; + deepCachingType: "ALWAYS" | "NEVER"; + displayName: string; + dnsBypassCname: string | null; + dnsBypassIp: string | null; + dnsBypassIp6: string | null; + dnsBypassTtl: number | null; + dscp: number; + ecsEnabled: boolean; + edgeHeaderRewrite: string | null; + readonly exampleURLs: readonly string[]; + firstHeaderRewrite: string | null; + fqPacingRate: number; + geoLimit: GeoLimit; + geoLimitCountries: string | null; + geoLimitRedirectURL: string | null; + geoProvider: GeoProvider; + globalMaxMbps: number | null; + globalMaxTps: number | null; + httpBypassFqdn: string | null; + readonly id: number; + infoUrl: string | null; + initialDispersion: number; + innerHeaderRewrite: string | null; + ipv6RoutingEnabled: boolean; + lastHeaderRewrite: string | null; + lastUpdated: Date; + logsEnabled: boolean; + longDesc: string | null; + longDesc1?: string; + longDesc2?: string; + matchList: Array<DeliveryServiceMatch>; + maxDnsAnswers: number | null; + maxOriginConnections: number; + maxRequestHeaderBytes: number; + midHeaderRewrite: string | null; + missLat: number; + missLong: number; + multiSiteOrigin: boolean; + originShield: string | null; + orgServerFqdn: string; + protocol: Protocol; + qstringIgnore: QStringHandling; + rangeRequestHandling: RangeRequestHandling; + rangeSliceBlockSize: null | number; + regexRemap: string | null; + regionalGeoBlocking: boolean; + remapText: string | null; + routingName: string; + serviceCategory: string | null; + signed: boolean; + signingAlgorithm: "url_sig" | "uri_signing"; + sslKeyVersion: number | null; + tenant: string; + tenantId: number; + topology: string | null; + trResponseHeaders: string | null; + trRequestHeaders: string | null; + type: string; + typeId: number; + xmlId: string; +} +interface ResponseDeliveryServiceWithProfile extends ResponseDeliveryServiceBase { + profileDescription: string; + profileId: number; + profileName: string; +} +interface ResponseDeliveryServiceWithoutProfile extends ResponseDeliveryServiceBase { + profileDescription: null; + profileId: null; + profileName: null; +} +export declare type ResponseDeliveryService = ResponseDeliveryServiceWithProfile | ResponseDeliveryServiceWithoutProfile; +export declare type DeliveryService = RequestDeliveryService | ResponseDeliveryService; +export declare function bypassable(ds: DeliveryService): boolean; +export interface DSCapacity { + availablePercent: number; + maintenancePercent: number; + unavailablePercent: number; + utilizedPercent: number; +} +export interface DSHealth { + cachegroups: Array<{ + name: string; + offline: number; + online: number; + }>; + totalOnline: number; + totalOffline: number; +} +export {}; diff --git a/dist/delivery.service.js b/dist/delivery.service.js new file mode 100644 index 0000000..78d2190 --- /dev/null +++ b/dist/delivery.service.js @@ -0,0 +1,50 @@ +export function protocolToString(p) { + switch (p) { + case 0: + return "Serve only unsecured HTTP requests"; + case 1: + return "Serve only secured HTTPS requests"; + case 2: + return "Serve both unsecured HTTP requests and secured HTTPS requests"; + case 3: + return "Serve secured HTTPS requests normally, but redirect unsecured HTTP requests to use HTTPS"; + } +} +export function qStringHandlingToString(q) { + switch (q) { + case 0: + return "Use the query parameter string when deciding if a URL is cached, and pass it in upstream requests to the" + + " Mid-tier/origin"; + case 1: + return "Do not use the query parameter string when deciding if a URL is cached, but do pass it in upstream requests to the" + + " Mid-tier/origin"; + case 2: + return "Immediately strip URLs of their query parameter strings before checking cached objects or making upstream requests"; + } +} +export function rangeRequestHandlingToString(r) { + switch (r) { + case 0: + return "Do not cache Range requests"; + case 1: + return "Use the background_fetch plugin to serve Range requests while quietly caching the entire object"; + case 2: + return "Use the cache_range_requests plugin to directly cache object ranges"; + } +} +export function bypassable(ds) { + if (!Object.prototype.hasOwnProperty.call(ds, "type")) { + return false; + } + switch (ds.type) { + case "HTTP": + case "HTTP_LIVE": + case "HTTP_LIVE_NATNL": + case "DNS": + case "DNS_LIVE": + case "DNS_LIVE_NATNL": + return true; + default: + return false; + } +} diff --git a/dist/division.d.ts b/dist/division.d.ts new file mode 100644 index 0000000..4a41ac2 --- /dev/null +++ b/dist/division.d.ts @@ -0,0 +1,21 @@ +export interface RequestDivision { + name: string; +} +export interface ResponseDivision { + readonly id: number; + lastUpdated: Date; + name: string; +} +export declare type Division = RequestDivision | ResponseDivision; +export interface RequestRegion { + division: number; + name: string; +} +export interface ResponseRegion { + division: number; + divisionName: string; + readonly id: number; + lastUpdated: Date; + name: string; +} +export declare type Region = RequestRegion | ResponseRegion; diff --git a/dist/division.js b/dist/division.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/division.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..cd7b655 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,39 @@ +export * from "./about"; +export * from "./acme"; +export * from "./alert"; +export * from "./cache.group"; +export * from "./cdn"; +export * from "./delivery.service"; +export * from "./division"; +export * from "./invalidation"; +export * from "./iso"; +export * from "./login"; +export * from "./logs"; +export * from "./parameter"; +export * from "./physical.location"; +export * from "./plugin"; +export * from "./profile"; +export * from "./server"; +export * from "./stats"; +export * from "./status"; +export * from "./type"; +export * from "./user"; +export * from "./vault"; +import type { Alert } from "./alert"; +interface VersionType { + readonly major: number; + readonly minor: number; + toString(): string; + readonly unstable: boolean; +} +export declare const VERSION: VersionType; +export interface APIResponse<T> { + alerts?: Array<Alert>; + response: T; + summary?: { + count: number; + }; +} +export interface PingResponse { + ping: "pong"; +} diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..a5f9262 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,29 @@ +export * from "./about"; +export * from "./acme"; +export * from "./alert"; +export * from "./cache.group"; +export * from "./cdn"; +export * from "./delivery.service"; +export * from "./division"; +export * from "./invalidation"; +export * from "./iso"; +export * from "./login"; +export * from "./logs"; +export * from "./parameter"; +export * from "./physical.location"; +export * from "./plugin"; +export * from "./profile"; +export * from "./server"; +export * from "./stats"; +export * from "./status"; +export * from "./type"; +export * from "./user"; +export * from "./vault"; +export const VERSION = { + major: 3, + minor: 1, + toString() { + return `${this.major}.${this.minor}`; + }, + unstable: false +}; diff --git a/dist/invalidation.d.ts b/dist/invalidation.d.ts new file mode 100644 index 0000000..f2610c0 --- /dev/null +++ b/dist/invalidation.d.ts @@ -0,0 +1,19 @@ +export declare const enum JobType { + PURGE = "PURGE" +} +export interface ResponseInvalidationJob { + assetURL: string; + createdBy: string; + deliveryService: string; + readonly id: number; + keyword: JobType; + parameters: string; + startTime: Date; +} +export interface RequestInvalidationJob { + deliveryService: number | string; + startTime: Date | string; + regex: string; + ttl: number | string; +} +export declare type InvalidationJob = RequestInvalidationJob | ResponseInvalidationJob; diff --git a/dist/invalidation.js b/dist/invalidation.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/invalidation.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/iso.d.ts b/dist/iso.d.ts new file mode 100644 index 0000000..53d8c0b --- /dev/null +++ b/dist/iso.d.ts @@ -0,0 +1,25 @@ +interface ISOFields { + disk: string; + domainName: string; + hostName: string; + interfaceMtu: number; + interfaceName?: string | null; + ip6Address?: string | null; + ip6Gateway?: string | null; + osVersionsDir: string; + rootPass: string; +} +interface ISORequestDHCP extends ISOFields { + dhcp: "no"; + ipAddress: string; + ipGateway: string; + ipNetmask: string; +} +interface ISORequestNonDHCP extends ISOFields { + dhcp: "yes"; +} +export declare type ISORequest = ISORequestDHCP | ISORequestNonDHCP; +export interface OSVersions { + [osversion: string]: string; +} +export {}; diff --git a/dist/iso.js b/dist/iso.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/iso.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/login.d.ts b/dist/login.d.ts new file mode 100644 index 0000000..4e738a4 --- /dev/null +++ b/dist/login.d.ts @@ -0,0 +1,21 @@ +export interface LoginRequest { + p: string; + u: string; +} +export interface OAuthLoginRequest { + authCodeTokenUrl: string; + code: string; + clientId: string; + redirectUri: string; +} +export interface TokenLoginRequest { + t: string; +} +export interface ResetPasswordRequest { + email: `${string}@${string}.${string}`; +} +export interface RegistrationRequest { + email: `${string}@${string}.${string}`; + role: number; + tenantId: number; +} diff --git a/dist/login.js b/dist/login.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/login.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/logs.d.ts b/dist/logs.d.ts new file mode 100644 index 0000000..dbe04bf --- /dev/null +++ b/dist/logs.d.ts @@ -0,0 +1,12 @@ +export interface Log { + readonly id: number; + lastUpdated: Date; + level: "APICHANGE"; + message: string; + readonly ticketNum: number | null; + user: string; +} +export declare function logEntryToString(log: Log): string; +export interface NewLogCount { + newLogcount: number; +} diff --git a/dist/logs.js b/dist/logs.js new file mode 100644 index 0000000..413bfd6 --- /dev/null +++ b/dist/logs.js @@ -0,0 +1,8 @@ +export function logEntryToString(log) { + const { id, lastUpdated, level, message, ticketNum, user } = log; + let ret = `#${id} ${lastUpdated.toISOString()}: ${user} via ${level}`; + if (ticketNum !== null) { + ret += ` (From Ticket #${ticketNum})`; + } + return `${ret}: ${message}`; +} diff --git a/dist/parameter.d.ts b/dist/parameter.d.ts new file mode 100644 index 0000000..7db0d29 --- /dev/null +++ b/dist/parameter.d.ts @@ -0,0 +1,16 @@ +export interface RequestParameter { + configFile: string; + name: string; + secure: boolean; + value: string; +} +export interface ResponseParameter { + configFile: string; + readonly id: number; + lastUpdated: Date; + name: string; + profiles: Array<string>; + secure: boolean; + value: string; +} +export declare type Parameter = RequestParameter | ResponseParameter; diff --git a/dist/parameter.js b/dist/parameter.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/parameter.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/physical.location.d.ts b/dist/physical.location.d.ts new file mode 100644 index 0000000..99b324f --- /dev/null +++ b/dist/physical.location.d.ts @@ -0,0 +1,29 @@ +export interface ResponsePhysicalLocation { + address: string; + city: string; + comments: string | null; + email: string | null; + id: number; + lastUpdated: Date; + name: string; + phone: string | null; + poc: string | null; + region: string | null; + regionId: number; + shortName: string; + state: string; + zip: string; +} +export interface RequestPhysicalLocation { + address: string; + city: string; + comments?: string | null; + email?: string | null; + name: string; + phone?: string | null; + poc?: string | null; + regionId: number; + state: string; + zip: string; +} +export declare type PhysicalLocation = ResponsePhysicalLocation | RequestPhysicalLocation; diff --git a/dist/physical.location.js b/dist/physical.location.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/physical.location.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/plugin.d.ts b/dist/plugin.d.ts new file mode 100644 index 0000000..50ecd0c --- /dev/null +++ b/dist/plugin.d.ts @@ -0,0 +1,5 @@ +export interface TOPlugin { + readonly description: string; + readonly name: string; + readonly version: string; +} diff --git a/dist/plugin.js b/dist/plugin.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/plugin.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/profile.d.ts b/dist/profile.d.ts new file mode 100644 index 0000000..dc870cb --- /dev/null +++ b/dist/profile.d.ts @@ -0,0 +1,46 @@ +export declare const enum ProfileType { + ATS_PROFILE = "ATS_PROFILE", + TR_PROFILE = "TR_PROFILE", + TM_PROFILE = "TM_PROFILE", + TS_PROFILE = "TS_PROFILE", + TP_PROFILE = "TP_PROFILE", + INFLUXDB_PROFILE = "INFLUXDB_PROFILE", + RIAK_PROFILE = "RIAK_PROFILE", + SPLUNK_PROFILE = "SPLUNK_PROFILE", + DS_PROFILE = "DS_PROFILE", + ORG_PROFILE = "ORG_PROFILE", + KAFKA_PROFILE = "KAFKA_PROFILE", + LOGSTASH_PROFILE = "LOGSTASH_PROFILE", + ES_PROFILE = "ES_PROFILE", + UNK_PROFILE = "UNK_PROFILE", + GROVE_PROFILE = "GROVE_PROFILE" +} +interface ResponseProfileParameter { + configFile: string; + id: number; + lastUpdated: null; + name: string; + profiles: null; + secure: boolean; + value: string; +} +export interface ResponseProfile { + cdn: number; + cdnName: string | null; + description: string; + id: number; + lastUpdated: Date; + name: string; + params?: [ResponseProfileParameter, ...ResponseProfileParameter[]]; + routingDisabled: boolean; + type: ProfileType; +} +export interface RequestProfile { + cdn: number; + description: string; + name: string; + routingDisabled: boolean; + type: ProfileType; +} +export declare type Profile = RequestProfile | ResponseProfile; +export {}; diff --git a/dist/profile.js b/dist/profile.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/profile.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/server.d.ts b/dist/server.d.ts new file mode 100644 index 0000000..da31c46 --- /dev/null +++ b/dist/server.d.ts @@ -0,0 +1,65 @@ +export interface IPAddress { + address: string; + gateway: string | null; + serviceAddress: boolean; +} +export interface Interface { + ipAddresses: Array<IPAddress>; + maxBandwidth: number | null; + monitor: boolean; + mtu: number | null; + name: string; +} +export declare function serviceAddresses(inf: Interface | Array<IPAddress>, exhaustive?: boolean): [ipv4Address: IPAddress | null, ipv6Address: IPAddress | null]; +export interface ResponseServer { + cachegroup: string; + cachegroupId: number; + cdnId: number; + cdnName: string; + domainName: string; + guid: number | null; + hostName: string; + httpsPort: number | null; + readonly id: number; + iloIpAddress: string | null; + iloIpGateway: string | null; + iloIpNetmask: string | null; + iloPassword: string | null; + iloUsername: string | null; + interfaces: Array<Interface>; + lastUpdated: Date; + mgmtIpAddress: string | null; + mgmtIpGateway: string | null; + mgmtIpNetmask: string | null; + offlineReason: string | null; + physLocation: string; + physLocationId: number; + profile: string; + profileDesc: string; + profileId: number; + revalPending: boolean; + rack: string | null; + routerHostName: string | null; + routerPortName: string | null; + status: string; + statusId: number; + statusLastUpdated: Date | null; + tcpPort: number | null; + type: string; + typeId: number; + updPending: boolean; + readonly xmppId: string; + xmppPasswd?: string | null; +} +export interface Servercheck { + adminState: string; + cacheGroup: string; + checks?: Record<string, number>; + hostName: string; + id: number; + profile: string; + revalPending: boolean; + type: string; + updPending: boolean; +} +export declare function checkMap(srv: Servercheck): Map<string, number | boolean>; diff --git a/dist/server.js b/dist/server.js new file mode 100644 index 0000000..8811d63 --- /dev/null +++ b/dist/server.js @@ -0,0 +1,74 @@ +function exhaustiveServiceAddresses(ips) { + let ipv4 = null; + let ipv6 = null; + for (const ip of ips) { + if (ip.serviceAddress) { + if (ip.address.includes(":")) { + if (ipv6 !== null) { + throw new Error(`found two IPv6 service addresses: '${ipv6.address}' and '${ip.address}'`); + } + ipv6 = ip; + } + else if (ipv4 !== null) { + throw new Error(`found two IPv4 service addresses: '${ipv4.address}' and '${ip.address}'`); + } + else { + ipv4 = ip; + } + } + } + return [ipv4, ipv6]; +} +function inexhaustiveServiceAddresses(ips) { + let ipv4 = null; + let ipv6 = null; + for (const ip of ips) { + if (ip.serviceAddress) { + if (ip.address.includes(":")) { + if (ipv6 !== null) { + throw new Error(`found two IPv6 service addresses: '${ipv6.address}' and '${ip.address}'`); + } + ipv6 = ip; + } + else if (ipv4 !== null) { + throw new Error(`found two IPv4 service addresses: '${ipv4.address}' and '${ip.address}'`); + } + else { + ipv4 = ip; + } + } + if (ipv4 !== null && ipv6 !== null) { + break; + } + } + return [ipv4, ipv6]; +} +export function serviceAddresses(inf, exhaustive = false) { + const arr = inf instanceof Array ? inf : inf.ipAddresses; + if (exhaustive) { + return exhaustiveServiceAddresses(arr); + } + return inexhaustiveServiceAddresses(arr); +} +export function checkMap(srv) { + const ret = new Map(); + if (!srv.checks) { + return ret; + } + for (const [key, value] of Object.entries(srv.checks)) { + switch (key) { + case "ILO": + case "10G": + case "FQDN": + case "DSCP": + case "10G6": + case "MTU": + ret.set(key, value === 1); + break; + default: + ret.set(key, value); + break; + } + } + return ret; +} diff --git a/dist/stats.d.ts b/dist/stats.d.ts new file mode 100644 index 0000000..42b2223 --- /dev/null +++ b/dist/stats.d.ts @@ -0,0 +1,34 @@ +export interface CacheStatsSeries { + columns: ["time", "sum_count"]; + count: number; + name: `${"bandwidth" | "connections" | "maxkbps"}.cdn.1min`; + values: Array<[Date, number | null]>; +} +export interface CacheStatsSummary { + average: number; + count: number; + fifthPercentile: number; + max: number; + min: number; + ninetyEightPercentile: number; + ninetyFifthPercentile: number; +} +export interface CacheStats { + series?: CacheStatsSeries; + summary?: CacheStatsSummary; +} +export interface CurrentStats { + currentStats: [ + ...Array<{ + bandwidth: number | null; + capacity: number | null; + cdn: string; + connections: number | null; + }>, + { + bandwidth: number | null; + cdn: "total"; + connections: number | null; + } + ]; +} diff --git a/dist/stats.js b/dist/stats.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/stats.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/status.d.ts b/dist/status.d.ts new file mode 100644 index 0000000..2670e75 --- /dev/null +++ b/dist/status.d.ts @@ -0,0 +1,11 @@ +export interface ResponseStatus { + description: string | null; + id: number; + lastUpdated: Date; + name: string; +} +export interface RequestStatus { + description?: string | null; + name: string; +} +export declare type Status = ResponseStatus | RequestStatus; diff --git a/dist/status.js b/dist/status.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/status.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/type.d.ts b/dist/type.d.ts new file mode 100644 index 0000000..55d3866 --- /dev/null +++ b/dist/type.d.ts @@ -0,0 +1,13 @@ +export interface TypeFromResponse { + description: string; + id: number; + lastUpdated: Date; + name: string; + useInTable: string; +} +export interface RequestType { + description: string; + name: string; + useInTable: string; +} +export declare type Type = TypeFromResponse | RequestType; diff --git a/dist/type.js b/dist/type.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/type.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/user.d.ts b/dist/user.d.ts new file mode 100644 index 0000000..3bddeba --- /dev/null +++ b/dist/user.d.ts @@ -0,0 +1,126 @@ +export interface PostRequestUser { + addressLine1?: string | null; + addressLine2?: string | null; + city?: string | null; + company?: string | null; + confirmLocalPasswd: string; + country?: string | null; + email: `${string}@${string}.${string}`; + fullName: string; + gid?: number | null; + localPasswd: string; + newUser?: boolean | null; + phoneNumber?: string | null; + postalCode?: string | null; + publicSshKey?: string | null; + role: number; + stateOrProvince?: string | null; + tenantId?: never; + tenantID: number; + uid?: number | null; + username: string; +} +interface PutRequestNotChangingPasswordUser { + addressLine1?: string | null; + addressLine2?: string | null; + city?: string | null; + company?: string | null; + country?: string | null; + email: `${string}@${string}.${string}`; + fullName: string; + gid?: number | null; + newUser?: boolean | null; + phoneNumber?: string | null; + postalCode?: string | null; + publicSshKey?: string | null; + role: number; + stateOrProvince?: string | null; + tenantId?: never; + tenantID: number; + uid?: number | null; + username: string; +} +export declare type PutRequestUser = PostRequestUser | PutRequestNotChangingPasswordUser; +interface ResponseUser { + addressLine1: string | null; + addressLine2: string | null; + city: string | null; + company: string | null; + country: string | null; + email: `${string}@${string}.${string}`; + fullName: string; + gid: number | null; + id: number; + lastUpdated: Date; + newUser: boolean | null; + phoneNumber: string | null; + postalCode: string | null; + publicSshKey: string | null; + registrationSent?: null | Date; + role: number; + stateOrProvince: null; + tenant: string; + tenantID?: never; + tenantId: number; + uid: number | null; + username: string; +} +export interface PutOrPostResponseUser extends ResponseUser { + confirmLocalPasswd?: string; + rolename?: never; + roleName: string; +} +export interface GetResponseUser extends ResponseUser { + confirmLocalPasswd?: never; + rolename: string; + roleName?: never; +} +export declare type User = PutRequestUser | PostRequestUser | PutOrPostResponseUser | GetResponseUser; +export interface ResponseCurrentUser { + addressLine1: string | null; + addressLine2: string | null; + city: string | null; + company: string | null; + country: string | null; + email: `${string}@${string}.${string}`; + fullName: string; + gid: number | null; + id: number; + lastUpdated: Date; + localUser: boolean; + newUser: boolean; + phoneNumber: string | null; + postalCode: string | null; + publicSshKey: string | null; + role: number; + rolename?: never; + roleName: string; + stateOrProvince: string | null; + tenant: string; + tenantId: number; + uid: number | null; + username: string; +} +export interface RequestCurrentUser { + addressLine1?: string | null; + addressLine2?: string | null; + city?: string | null; + company?: string | null; + country?: string | null; + email?: string | null; + fullName?: string | null; + gid?: string | null; + localUser?: boolean | null; + newUser?: boolean | null; + phoneNumber?: string | null; + postalCode?: string | null; + publicSshKey?: string | null; + role?: number | null; + stateOrProvince?: string | null; + tenantId?: number | null; + tenantID?: never; + uid?: string | null; + username?: never; +} +export declare type CurrentUser = ResponseCurrentUser | RequestCurrentUser; +export {}; diff --git a/dist/user.js b/dist/user.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/user.js @@ -0,0 +1 @@ +export {}; diff --git a/dist/vault.d.ts b/dist/vault.d.ts new file mode 100644 index 0000000..cc3fca2 --- /dev/null +++ b/dist/vault.d.ts @@ -0,0 +1,7 @@ +export interface VaultPing { + status: string; + server: string; +} +export interface BucketValues { + [bucket: string]: unknown; +} diff --git a/dist/vault.js b/dist/vault.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/vault.js @@ -0,0 +1 @@ +export {};
