1 | export declare module Http {
|
2 | const enum Verb {
|
3 | GET = 0,
|
4 | HEAD = 1,
|
5 | POST = 2,
|
6 | PUT = 3,
|
7 | DELETE = 4,
|
8 | TRACE = 5,
|
9 | OPTIONS = 6,
|
10 | CONNECT = 7,
|
11 | PATCH = 8
|
12 | }
|
13 | interface Response {
|
14 | statusCode: number;
|
15 | body?: string;
|
16 | }
|
17 | interface Requester {
|
18 | request(verb: Verb, url: string, callback: Callback<Response>): void;
|
19 | request(verb: Verb, url: string, requestBody: string, callback: Callback<Response>): void;
|
20 | }
|
21 | }
|
22 | export interface Package {
|
23 | deploymentKey: string;
|
24 | description: string;
|
25 | label: string;
|
26 | appVersion: string;
|
27 | isMandatory: boolean;
|
28 | packageHash: string;
|
29 | packageSize: number;
|
30 | }
|
31 | export interface RemotePackage extends Package {
|
32 | downloadUrl: string;
|
33 | }
|
34 | export interface NativeUpdateNotification {
|
35 | updateAppVersion: boolean;
|
36 | appVersion: string;
|
37 | }
|
38 | export interface LocalPackage extends Package {
|
39 | localPath: string;
|
40 | }
|
41 | export interface Callback<T> {
|
42 | (error: Error, parameter: T): void;
|
43 | }
|
44 | export interface Configuration {
|
45 | appVersion: string;
|
46 | clientUniqueId: string;
|
47 | deploymentKey: string;
|
48 | serverUrl: string;
|
49 | ignoreAppVersion?: boolean;
|
50 | }
|
51 | export declare class AcquisitionStatus {
|
52 | static DeploymentSucceeded: string;
|
53 | static DeploymentFailed: string;
|
54 | }
|
55 | export declare class AcquisitionManager {
|
56 | private _appVersion;
|
57 | private _clientUniqueId;
|
58 | private _deploymentKey;
|
59 | private _httpRequester;
|
60 | private _ignoreAppVersion;
|
61 | private _serverUrl;
|
62 | private _publicPrefixUrl;
|
63 | constructor(httpRequester: Http.Requester, configuration: Configuration);
|
64 | queryUpdateWithCurrentPackage(currentPackage: Package, callback?: Callback<RemotePackage | NativeUpdateNotification>): void;
|
65 | reportStatusDeploy(deployedPackage?: Package, status?: string, previousLabelOrAppVersion?: string, previousDeploymentKey?: string, callback?: Callback<void>): void;
|
66 | reportStatusDownload(downloadedPackage: Package, callback?: Callback<void>): void;
|
67 | }
|