@aetherpush/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/script/cli.d.ts +2 -0
- package/bin/script/cli.js +0 -0
- package/bin/script/command-executor.d.ts +20 -0
- package/bin/script/command-parser.d.ts +3 -0
- package/bin/script/commands/debug.d.ts +2 -0
- package/bin/script/errors.d.ts +5 -0
- package/bin/script/hash-utils.d.ts +16 -0
- package/bin/script/index.d.ts +2 -0
- package/bin/script/management-sdk.d.ts +58 -0
- package/bin/script/react-native-utils.d.ts +6 -0
- package/bin/script/sign.d.ts +1 -0
- package/bin/script/types/cli.d.ts +187 -0
- package/bin/script/types/index.d.ts +1 -0
- package/bin/script/types/rest-definitions.d.ts +112 -0
- package/bin/script/utils/file-utils.d.ts +6 -0
- package/package.json +4 -8
- package/bin/script/acquisition-sdk.js +0 -178
- package/bin/script/acquisition-sdk.js.map +0 -1
- package/bin/script/types.js +0 -4
- package/bin/script/types.js.map +0 -1
package/bin/script/cli.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import AccountManager = require("./management-sdk");
|
|
2
|
+
import * as cli from "../script/types/cli";
|
|
3
|
+
import { UpdateMetrics } from "../script/types";
|
|
4
|
+
export interface UpdateMetricsWithTotalActive extends UpdateMetrics {
|
|
5
|
+
totalActive: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PackageWithMetrics {
|
|
8
|
+
metrics?: UpdateMetricsWithTotalActive;
|
|
9
|
+
}
|
|
10
|
+
export declare const log: (message: string | any) => void;
|
|
11
|
+
export declare let sdk: AccountManager;
|
|
12
|
+
export declare const spawn: any;
|
|
13
|
+
export declare const execSync: any;
|
|
14
|
+
export declare const confirm: (message?: string) => Promise<boolean>;
|
|
15
|
+
export declare const createEmptyTempReleaseFolder: (folderPath: string) => Promise<void>;
|
|
16
|
+
export declare const deploymentList: (command: cli.IDeploymentListCommand, showPackage?: boolean) => Promise<void>;
|
|
17
|
+
export declare function execute(command: cli.ICommand): Promise<void>;
|
|
18
|
+
export declare const release: (command: cli.IReleaseCommand) => Promise<void>;
|
|
19
|
+
export declare const releaseReact: (command: cli.IReleaseReactCommand) => Promise<void>;
|
|
20
|
+
export declare const runReactNativeBundleCommand: (bundleName: string, development: boolean, entryFile: string, outputFolder: string, platform: string, sourcemapOutput: string) => Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as stream from "stream";
|
|
2
|
+
export declare function generatePackageHashFromDirectory(directoryPath: string, basePath: string): Promise<string>;
|
|
3
|
+
export declare function generatePackageManifestFromZip(filePath: string): Promise<PackageManifest>;
|
|
4
|
+
export declare function generatePackageManifestFromDirectory(directoryPath: string, basePath: string): Promise<PackageManifest>;
|
|
5
|
+
export declare function hashFile(filePath: string): Promise<string>;
|
|
6
|
+
export declare function hashStream(readStream: stream.Readable): Promise<string>;
|
|
7
|
+
export declare class PackageManifest {
|
|
8
|
+
private _map;
|
|
9
|
+
constructor(map?: Map<string, string>);
|
|
10
|
+
toMap(): Map<string, string>;
|
|
11
|
+
computePackageHash(): Promise<string>;
|
|
12
|
+
serialize(): string;
|
|
13
|
+
static deserialize(serializedContents: string): PackageManifest;
|
|
14
|
+
static normalizePath(filePath: string): string;
|
|
15
|
+
static isIgnored(relativeFilePath: string): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AccessKey, AccessKeyWithSecret, Account, ApiKey, ApiKeyCreationRequest, ApiKeyRevokeResult, ApiKeyUpdateRequest, ApiKeyWithSecret, App, CollaboratorMap, CustomHeaders, Deployment, DeploymentMetrics, Package, PackageInfo, Session } from "./types";
|
|
2
|
+
import { AetherError } from "./errors";
|
|
3
|
+
declare class AccountManager {
|
|
4
|
+
static AppPermission: {
|
|
5
|
+
OWNER: string;
|
|
6
|
+
COLLABORATOR: string;
|
|
7
|
+
};
|
|
8
|
+
static AetherError: typeof AetherError;
|
|
9
|
+
private _accessKey;
|
|
10
|
+
private _serverUrl;
|
|
11
|
+
private _customHeaders?;
|
|
12
|
+
constructor(accessKey: string, customHeaders?: CustomHeaders, serverUrl?: string);
|
|
13
|
+
get accessKey(): string;
|
|
14
|
+
isAuthenticated(throwIfUnauthorized?: boolean): Promise<boolean>;
|
|
15
|
+
addAccessKey(friendlyName: string, ttl?: number): Promise<AccessKeyWithSecret>;
|
|
16
|
+
getAccessKey(name: string): Promise<AccessKey>;
|
|
17
|
+
getAccessKeys(): Promise<AccessKey[]>;
|
|
18
|
+
getSessions(): Promise<Session[]>;
|
|
19
|
+
patchAccessKey(oldName: string, newName?: string, ttl?: number): Promise<AccessKey>;
|
|
20
|
+
removeAccessKey(name: string): Promise<void>;
|
|
21
|
+
removeSessions(createdBy: string): Promise<void>;
|
|
22
|
+
getAccountInfo(): Promise<Account>;
|
|
23
|
+
getApps(): Promise<App[]>;
|
|
24
|
+
getApp(appName: string): Promise<App>;
|
|
25
|
+
addApp(appName: string, manuallyProvisionDeployments?: boolean): Promise<App>;
|
|
26
|
+
removeApp(appName: string): Promise<void>;
|
|
27
|
+
renameApp(oldAppName: string, newAppName: string): Promise<void>;
|
|
28
|
+
transferApp(appName: string, email: string): Promise<void>;
|
|
29
|
+
getCollaborators(appName: string): Promise<CollaboratorMap>;
|
|
30
|
+
addCollaborator(appName: string, email: string): Promise<void>;
|
|
31
|
+
removeCollaborator(appName: string, email: string): Promise<void>;
|
|
32
|
+
addDeployment(appName: string, deploymentName: string, deploymentKey?: string): Promise<Deployment>;
|
|
33
|
+
clearDeploymentHistory(appName: string, deploymentName: string): Promise<void>;
|
|
34
|
+
getDeployments(appName: string): Promise<Deployment[]>;
|
|
35
|
+
getDeployment(appName: string, deploymentName: string): Promise<Deployment>;
|
|
36
|
+
renameDeployment(appName: string, oldDeploymentName: string, newDeploymentName: string): Promise<void>;
|
|
37
|
+
removeDeployment(appName: string, deploymentName: string): Promise<void>;
|
|
38
|
+
getDeploymentMetrics(appName: string, deploymentName: string): Promise<DeploymentMetrics>;
|
|
39
|
+
getDeploymentHistory(appName: string, deploymentName: string): Promise<Package[]>;
|
|
40
|
+
release(appName: string, deploymentName: string, filePath: string, targetBinaryVersion: string, updateMetadata: PackageInfo): Promise<Package>;
|
|
41
|
+
patchRelease(appName: string, deploymentName: string, label: string, updateMetadata: PackageInfo): Promise<void>;
|
|
42
|
+
promote(appName: string, sourceDeploymentName: string, destinationDeploymentName: string, updateMetadata?: PackageInfo): Promise<Package>;
|
|
43
|
+
rollback(appName: string, deploymentName: string, targetRelease?: string): Promise<Package>;
|
|
44
|
+
getApiKeys(includeRevoked?: boolean): Promise<ApiKey[]>;
|
|
45
|
+
addApiKey(request: ApiKeyCreationRequest): Promise<ApiKeyWithSecret>;
|
|
46
|
+
patchApiKey(id: string, updates: ApiKeyUpdateRequest): Promise<ApiKey>;
|
|
47
|
+
revokeApiKey(id: string): Promise<ApiKeyRevokeResult>;
|
|
48
|
+
private buildHeaders;
|
|
49
|
+
private requestRaw;
|
|
50
|
+
private request;
|
|
51
|
+
private parseResponse;
|
|
52
|
+
private headersToObject;
|
|
53
|
+
private networkError;
|
|
54
|
+
private packageFileFromPath;
|
|
55
|
+
private walkDirectory;
|
|
56
|
+
private generateRandomFilename;
|
|
57
|
+
}
|
|
58
|
+
export = AccountManager;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isValidVersion(version: string): boolean;
|
|
2
|
+
export declare function runHermesEmitBinaryCommand(bundleName: string, outputFolder: string, sourcemapOutput: string, extraHermesFlags: string[], gradleFile: string): Promise<void>;
|
|
3
|
+
export declare function getAndroidHermesEnabled(gradleFile: string): Promise<boolean>;
|
|
4
|
+
export declare function getiOSHermesEnabled(podFile: string): boolean;
|
|
5
|
+
export declare function directoryExistsSync(dirname: string): boolean;
|
|
6
|
+
export declare function getReactNativeVersion(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function sign(privateKeyPath: string, updateContentsPath: string): Promise<void>;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import AccountManager = require("../management-sdk");
|
|
2
|
+
export declare enum CommandType {
|
|
3
|
+
accessKeyAdd = 0,
|
|
4
|
+
accessKeyPatch = 1,
|
|
5
|
+
accessKeyList = 2,
|
|
6
|
+
accessKeyRemove = 3,
|
|
7
|
+
appAdd = 4,
|
|
8
|
+
appList = 5,
|
|
9
|
+
appRemove = 6,
|
|
10
|
+
appRename = 7,
|
|
11
|
+
appTransfer = 8,
|
|
12
|
+
collaboratorAdd = 9,
|
|
13
|
+
collaboratorList = 10,
|
|
14
|
+
collaboratorRemove = 11,
|
|
15
|
+
debug = 12,
|
|
16
|
+
deploymentAdd = 13,
|
|
17
|
+
deploymentHistory = 14,
|
|
18
|
+
deploymentHistoryClear = 15,
|
|
19
|
+
deploymentList = 16,
|
|
20
|
+
deploymentMetrics = 17,
|
|
21
|
+
deploymentRemove = 18,
|
|
22
|
+
deploymentRename = 19,
|
|
23
|
+
login = 20,
|
|
24
|
+
logout = 21,
|
|
25
|
+
patch = 22,
|
|
26
|
+
promote = 23,
|
|
27
|
+
register = 24,
|
|
28
|
+
release = 25,
|
|
29
|
+
releaseReact = 26,
|
|
30
|
+
rollback = 27,
|
|
31
|
+
sessionList = 28,
|
|
32
|
+
sessionRemove = 29,
|
|
33
|
+
whoami = 30
|
|
34
|
+
}
|
|
35
|
+
export interface ICommand {
|
|
36
|
+
type: CommandType;
|
|
37
|
+
}
|
|
38
|
+
export interface IAccessKeyAddCommand extends ICommand {
|
|
39
|
+
name: string;
|
|
40
|
+
ttl?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface IAccessKeyPatchCommand extends ICommand {
|
|
43
|
+
newName?: string;
|
|
44
|
+
oldName: string;
|
|
45
|
+
ttl?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface IAccessKeyListCommand extends ICommand {
|
|
48
|
+
format: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IAccessKeyRemoveCommand extends ICommand {
|
|
51
|
+
accessKey: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IAppAddCommand extends ICommand {
|
|
54
|
+
appName: string;
|
|
55
|
+
os: string;
|
|
56
|
+
platform: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IAppListCommand extends ICommand {
|
|
59
|
+
format: string;
|
|
60
|
+
}
|
|
61
|
+
export interface IAppRemoveCommand extends ICommand {
|
|
62
|
+
appName: string;
|
|
63
|
+
}
|
|
64
|
+
export interface IAppRenameCommand extends ICommand {
|
|
65
|
+
currentAppName: string;
|
|
66
|
+
newAppName: string;
|
|
67
|
+
}
|
|
68
|
+
export interface IAppTransferCommand extends ICommand {
|
|
69
|
+
appName: string;
|
|
70
|
+
email: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ICollaboratorAddCommand extends ICommand {
|
|
73
|
+
appName: string;
|
|
74
|
+
email: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ICollaboratorListCommand extends ICommand {
|
|
77
|
+
appName: string;
|
|
78
|
+
format: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ICollaboratorRemoveCommand extends ICommand {
|
|
81
|
+
appName: string;
|
|
82
|
+
email: string;
|
|
83
|
+
}
|
|
84
|
+
export interface IDebugCommand extends ICommand {
|
|
85
|
+
platform: string;
|
|
86
|
+
}
|
|
87
|
+
export interface IDeploymentAddCommand extends ICommand {
|
|
88
|
+
appName: string;
|
|
89
|
+
deploymentName: string;
|
|
90
|
+
key?: string;
|
|
91
|
+
default: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface IDeploymentHistoryClearCommand extends ICommand {
|
|
94
|
+
appName: string;
|
|
95
|
+
deploymentName: string;
|
|
96
|
+
}
|
|
97
|
+
export interface IDeploymentHistoryCommand extends ICommand {
|
|
98
|
+
appName: string;
|
|
99
|
+
deploymentName: string;
|
|
100
|
+
format: string;
|
|
101
|
+
displayAuthor: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface IDeploymentListCommand extends ICommand {
|
|
104
|
+
appName: string;
|
|
105
|
+
format: string;
|
|
106
|
+
displayKeys: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface IDeploymentRemoveCommand extends ICommand {
|
|
109
|
+
appName: string;
|
|
110
|
+
deploymentName: string;
|
|
111
|
+
}
|
|
112
|
+
export interface IDeploymentRenameCommand extends ICommand {
|
|
113
|
+
appName: string;
|
|
114
|
+
currentDeploymentName: string;
|
|
115
|
+
newDeploymentName: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ILoginCommand extends ICommand {
|
|
118
|
+
serverUrl?: string;
|
|
119
|
+
accessKey: string;
|
|
120
|
+
}
|
|
121
|
+
export interface IPackageInfo {
|
|
122
|
+
description?: string;
|
|
123
|
+
label?: string;
|
|
124
|
+
disabled?: boolean;
|
|
125
|
+
mandatory?: boolean;
|
|
126
|
+
rollout?: number;
|
|
127
|
+
}
|
|
128
|
+
export interface IPatchCommand extends ICommand, IPackageInfo {
|
|
129
|
+
appName: string;
|
|
130
|
+
appStoreVersion?: string;
|
|
131
|
+
deploymentName: string;
|
|
132
|
+
label: string;
|
|
133
|
+
}
|
|
134
|
+
export interface IPromoteCommand extends ICommand, IPackageInfo {
|
|
135
|
+
appName: string;
|
|
136
|
+
appStoreVersion?: string;
|
|
137
|
+
sourceDeploymentName: string;
|
|
138
|
+
destDeploymentName: string;
|
|
139
|
+
noDuplicateReleaseError?: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface IRegisterCommand extends ICommand {
|
|
142
|
+
serverUrl?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface IReleaseBaseCommand extends ICommand, IPackageInfo {
|
|
145
|
+
appName: string;
|
|
146
|
+
appStoreVersion: string;
|
|
147
|
+
deploymentName: string;
|
|
148
|
+
noDuplicateReleaseError?: boolean;
|
|
149
|
+
privateKeyPath?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface IReleaseCommand extends IReleaseBaseCommand {
|
|
152
|
+
package: string;
|
|
153
|
+
}
|
|
154
|
+
export interface IReleaseReactCommand extends IReleaseBaseCommand {
|
|
155
|
+
bundleName?: string;
|
|
156
|
+
development?: boolean;
|
|
157
|
+
entryFile?: string;
|
|
158
|
+
gradleFile?: string;
|
|
159
|
+
platform: string;
|
|
160
|
+
plistFile?: string;
|
|
161
|
+
plistFilePrefix?: string;
|
|
162
|
+
sourcemapOutput?: string;
|
|
163
|
+
outputDir?: string;
|
|
164
|
+
config?: string;
|
|
165
|
+
useHermes?: boolean;
|
|
166
|
+
extraHermesFlags?: string[];
|
|
167
|
+
podFile?: string;
|
|
168
|
+
xcodeProjectFile?: string;
|
|
169
|
+
xcodeTargetName?: string;
|
|
170
|
+
buildConfigurationName?: string;
|
|
171
|
+
}
|
|
172
|
+
export interface IRollbackCommand extends ICommand {
|
|
173
|
+
appName: string;
|
|
174
|
+
deploymentName: string;
|
|
175
|
+
targetRelease: string;
|
|
176
|
+
}
|
|
177
|
+
export interface ISessionListCommand extends ICommand {
|
|
178
|
+
format: string;
|
|
179
|
+
}
|
|
180
|
+
export interface ISessionRemoveCommand extends ICommand {
|
|
181
|
+
machineName: string;
|
|
182
|
+
}
|
|
183
|
+
export type ReleaseHook = (currentCommand: IReleaseCommand, originalCommand: IReleaseCommand, sdk: AccountManager) => Promise<IReleaseCommand | void>;
|
|
184
|
+
export interface ReleaseFile {
|
|
185
|
+
sourceLocation: string;
|
|
186
|
+
targetLocation: string;
|
|
187
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./rest-definitions";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export interface CustomHeaders {
|
|
2
|
+
[headerName: string]: string;
|
|
3
|
+
}
|
|
4
|
+
export interface Account {
|
|
5
|
+
email: string;
|
|
6
|
+
name: string;
|
|
7
|
+
linkedProviders: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface AccessKey {
|
|
10
|
+
friendlyName: string;
|
|
11
|
+
createdBy?: string;
|
|
12
|
+
createdTime?: number;
|
|
13
|
+
expires: number;
|
|
14
|
+
isSession?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface AccessKeyWithSecret extends AccessKey {
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AccessKeyRequest {
|
|
20
|
+
friendlyName?: string;
|
|
21
|
+
ttl?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface Session {
|
|
24
|
+
loggedInTime: number;
|
|
25
|
+
createdBy: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CollaboratorProperties {
|
|
28
|
+
permission: "Owner" | "Collaborator";
|
|
29
|
+
isCurrentAccount?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface CollaboratorMap {
|
|
32
|
+
[email: string]: CollaboratorProperties;
|
|
33
|
+
}
|
|
34
|
+
export interface App {
|
|
35
|
+
name: string;
|
|
36
|
+
collaborators?: CollaboratorMap;
|
|
37
|
+
deployments?: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface AppCreationRequest {
|
|
40
|
+
name: string;
|
|
41
|
+
manuallyProvisionDeployments?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface Deployment {
|
|
44
|
+
name: string;
|
|
45
|
+
key?: string;
|
|
46
|
+
package?: Package;
|
|
47
|
+
}
|
|
48
|
+
export interface BlobInfo {
|
|
49
|
+
size: number;
|
|
50
|
+
url: string;
|
|
51
|
+
}
|
|
52
|
+
export interface PackageHashToBlobInfoMap {
|
|
53
|
+
[packageHash: string]: BlobInfo;
|
|
54
|
+
}
|
|
55
|
+
export interface PackageInfo {
|
|
56
|
+
appVersion?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
isDisabled?: boolean;
|
|
59
|
+
isMandatory?: boolean;
|
|
60
|
+
label?: string;
|
|
61
|
+
packageHash?: string;
|
|
62
|
+
rollout?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface Package extends PackageInfo {
|
|
65
|
+
blobUrl: string;
|
|
66
|
+
diffPackageMap?: PackageHashToBlobInfoMap;
|
|
67
|
+
manifestBlobUrl?: string;
|
|
68
|
+
originalDeployment?: string;
|
|
69
|
+
originalLabel?: string;
|
|
70
|
+
releasedBy?: string;
|
|
71
|
+
releaseMethod?: "Upload" | "Promote" | "Rollback";
|
|
72
|
+
size: number;
|
|
73
|
+
uploadTime: number;
|
|
74
|
+
}
|
|
75
|
+
export interface UpdateMetrics {
|
|
76
|
+
active: number;
|
|
77
|
+
downloaded?: number;
|
|
78
|
+
failed?: number;
|
|
79
|
+
installed?: number;
|
|
80
|
+
}
|
|
81
|
+
export interface DeploymentMetrics {
|
|
82
|
+
[packageLabelOrAppVersion: string]: UpdateMetrics;
|
|
83
|
+
}
|
|
84
|
+
export type ApiKeyScope = "deploy" | "apps" | "keys" | "read";
|
|
85
|
+
export interface ApiKey {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
key_prefix: string;
|
|
89
|
+
scopes: ApiKeyScope[];
|
|
90
|
+
expires_at: string | null;
|
|
91
|
+
revoked_at: string | null;
|
|
92
|
+
last_used_at: string | null;
|
|
93
|
+
created_at: string;
|
|
94
|
+
updated_at: string;
|
|
95
|
+
}
|
|
96
|
+
export interface ApiKeyWithSecret extends ApiKey {
|
|
97
|
+
key: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ApiKeyCreationRequest {
|
|
100
|
+
name: string;
|
|
101
|
+
scopes: ApiKeyScope[];
|
|
102
|
+
expires_at?: string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface ApiKeyUpdateRequest {
|
|
105
|
+
name?: string;
|
|
106
|
+
scopes?: ApiKeyScope[];
|
|
107
|
+
expires_at?: string | null;
|
|
108
|
+
}
|
|
109
|
+
export interface ApiKeyRevokeResult {
|
|
110
|
+
id: string;
|
|
111
|
+
revoked_at: string;
|
|
112
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isBinaryOrZip(path: string): boolean;
|
|
2
|
+
export declare function isDirectory(path: string): boolean;
|
|
3
|
+
export declare function fileExists(file: string): boolean;
|
|
4
|
+
export declare function copyFileToTmpDir(filePath: string): string;
|
|
5
|
+
export declare function fileDoesNotExistOrIsDirectory(path: string): boolean;
|
|
6
|
+
export declare function normalizePath(filePath: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aetherpush/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Command-line interface for Aether — over-the-air updates for React Native apps.",
|
|
5
5
|
"main": "./bin/script/index.js",
|
|
6
6
|
"types": "./bin/script/index.d.ts",
|
|
@@ -66,16 +66,12 @@
|
|
|
66
66
|
"semver": "^7.5.3",
|
|
67
67
|
"simctl": "^3.0.0",
|
|
68
68
|
"temp": "^0.9.4",
|
|
69
|
-
"which": "^
|
|
69
|
+
"which": "^7.0.0",
|
|
70
70
|
"wordwrap": "1.0.0",
|
|
71
|
-
"xcode": "^0.
|
|
71
|
+
"xcode": "^3.0.1",
|
|
72
72
|
"xml2js": "^0.6.0",
|
|
73
73
|
"yargs": "^17.7.2",
|
|
74
|
-
"yazl": "^
|
|
75
|
-
},
|
|
76
|
-
"overrides": {
|
|
77
|
-
"lodash": "^4.17.21",
|
|
78
|
-
"xmldom": "npm:@xmldom/xmldom@^0.8.10"
|
|
74
|
+
"yazl": "^3.3.1"
|
|
79
75
|
},
|
|
80
76
|
"devDependencies": {
|
|
81
77
|
"@types/jest": "^30.0.0",
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Aether. All rights reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AcquisitionManager = exports.AcquisitionStatus = void 0;
|
|
5
|
-
class AcquisitionStatus {
|
|
6
|
-
static DeploymentSucceeded = "DeploymentSucceeded";
|
|
7
|
-
static DeploymentFailed = "DeploymentFailed";
|
|
8
|
-
}
|
|
9
|
-
exports.AcquisitionStatus = AcquisitionStatus;
|
|
10
|
-
class AcquisitionManager {
|
|
11
|
-
_appVersion;
|
|
12
|
-
_clientUniqueId;
|
|
13
|
-
_deploymentKey;
|
|
14
|
-
_httpRequester;
|
|
15
|
-
_ignoreAppVersion;
|
|
16
|
-
_serverUrl;
|
|
17
|
-
constructor(httpRequester, configuration) {
|
|
18
|
-
this._httpRequester = httpRequester;
|
|
19
|
-
this._serverUrl = configuration.serverUrl;
|
|
20
|
-
if (this._serverUrl.slice(-1) !== "/") {
|
|
21
|
-
this._serverUrl += "/";
|
|
22
|
-
}
|
|
23
|
-
this._appVersion = configuration.appVersion;
|
|
24
|
-
this._clientUniqueId = configuration.clientUniqueId;
|
|
25
|
-
this._deploymentKey = configuration.deploymentKey;
|
|
26
|
-
this._ignoreAppVersion = configuration.ignoreAppVersion;
|
|
27
|
-
}
|
|
28
|
-
queryUpdateWithCurrentPackage(currentPackage, callback) {
|
|
29
|
-
if (!currentPackage || !currentPackage.appVersion) {
|
|
30
|
-
throw new Error("Calling common acquisition SDK with incorrect package"); // Unexpected; indicates error in our implementation
|
|
31
|
-
}
|
|
32
|
-
const updateRequest = {
|
|
33
|
-
deploymentKey: this._deploymentKey,
|
|
34
|
-
appVersion: currentPackage.appVersion,
|
|
35
|
-
packageHash: currentPackage.packageHash,
|
|
36
|
-
isCompanion: this._ignoreAppVersion,
|
|
37
|
-
label: currentPackage.label,
|
|
38
|
-
clientUniqueId: this._clientUniqueId,
|
|
39
|
-
};
|
|
40
|
-
const requestUrl = this._serverUrl + "updateCheck?" + queryStringify(updateRequest);
|
|
41
|
-
this._httpRequester.request(0 /* Http.Verb.GET */, requestUrl, (error, response) => {
|
|
42
|
-
if (error) {
|
|
43
|
-
callback(error, /*remotePackage=*/ null);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (response.statusCode !== 200) {
|
|
47
|
-
callback(new Error(response.statusCode + ": " + response.body), /*remotePackage=*/ null);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
let updateInfo;
|
|
51
|
-
try {
|
|
52
|
-
const responseObject = JSON.parse(response.body);
|
|
53
|
-
updateInfo = responseObject.updateInfo;
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
callback(error, /*remotePackage=*/ null);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (!updateInfo) {
|
|
60
|
-
callback(error, /*remotePackage=*/ null);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
else if (updateInfo.updateAppVersion) {
|
|
64
|
-
callback(/*error=*/ null, {
|
|
65
|
-
updateAppVersion: true,
|
|
66
|
-
appVersion: updateInfo.appVersion,
|
|
67
|
-
});
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
else if (!updateInfo.isAvailable) {
|
|
71
|
-
callback(/*error=*/ null, /*remotePackage=*/ null);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const remotePackage = {
|
|
75
|
-
deploymentKey: this._deploymentKey,
|
|
76
|
-
description: updateInfo.description,
|
|
77
|
-
label: updateInfo.label,
|
|
78
|
-
appVersion: updateInfo.appVersion,
|
|
79
|
-
isMandatory: updateInfo.isMandatory,
|
|
80
|
-
packageHash: updateInfo.packageHash,
|
|
81
|
-
packageSize: updateInfo.packageSize,
|
|
82
|
-
downloadUrl: updateInfo.downloadURL,
|
|
83
|
-
};
|
|
84
|
-
callback(/*error=*/ null, remotePackage);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
reportStatusDeploy(deployedPackage, status, previousLabelOrAppVersion, previousDeploymentKey, callback) {
|
|
88
|
-
const url = this._serverUrl + "reportStatus/deploy";
|
|
89
|
-
const body = {
|
|
90
|
-
appVersion: this._appVersion,
|
|
91
|
-
deploymentKey: this._deploymentKey,
|
|
92
|
-
};
|
|
93
|
-
if (this._clientUniqueId) {
|
|
94
|
-
body.clientUniqueId = this._clientUniqueId;
|
|
95
|
-
}
|
|
96
|
-
if (deployedPackage) {
|
|
97
|
-
body.label = deployedPackage.label;
|
|
98
|
-
body.appVersion = deployedPackage.appVersion;
|
|
99
|
-
switch (status) {
|
|
100
|
-
case AcquisitionStatus.DeploymentSucceeded:
|
|
101
|
-
case AcquisitionStatus.DeploymentFailed:
|
|
102
|
-
body.status = status;
|
|
103
|
-
break;
|
|
104
|
-
default:
|
|
105
|
-
if (callback) {
|
|
106
|
-
if (!status) {
|
|
107
|
-
callback(new Error("Missing status argument."), /*not used*/ null);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
callback(new Error('Unrecognized status "' + status + '".'), /*not used*/ null);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (previousLabelOrAppVersion) {
|
|
117
|
-
body.previousLabelOrAppVersion = previousLabelOrAppVersion;
|
|
118
|
-
}
|
|
119
|
-
if (previousDeploymentKey) {
|
|
120
|
-
body.previousDeploymentKey = previousDeploymentKey;
|
|
121
|
-
}
|
|
122
|
-
callback = typeof arguments[arguments.length - 1] === "function" && arguments[arguments.length - 1];
|
|
123
|
-
this._httpRequester.request(2 /* Http.Verb.POST */, url, JSON.stringify(body), (error, response) => {
|
|
124
|
-
if (callback) {
|
|
125
|
-
if (error) {
|
|
126
|
-
callback(error, /*not used*/ null);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (response.statusCode !== 200) {
|
|
130
|
-
callback(new Error(response.statusCode + ": " + response.body), /*not used*/ null);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
callback(/*error*/ null, /*not used*/ null);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
reportStatusDownload(downloadedPackage, callback) {
|
|
138
|
-
const url = this._serverUrl + "reportStatus/download";
|
|
139
|
-
const body = {
|
|
140
|
-
clientUniqueId: this._clientUniqueId,
|
|
141
|
-
deploymentKey: this._deploymentKey,
|
|
142
|
-
label: downloadedPackage.label,
|
|
143
|
-
};
|
|
144
|
-
this._httpRequester.request(2 /* Http.Verb.POST */, url, JSON.stringify(body), (error, response) => {
|
|
145
|
-
if (callback) {
|
|
146
|
-
if (error) {
|
|
147
|
-
callback(error, /*not used*/ null);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (response.statusCode !== 200) {
|
|
151
|
-
callback(new Error(response.statusCode + ": " + response.body), /*not used*/ null);
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
callback(/*error*/ null, /*not used*/ null);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.AcquisitionManager = AcquisitionManager;
|
|
160
|
-
function queryStringify(object) {
|
|
161
|
-
let queryString = "";
|
|
162
|
-
let isFirst = true;
|
|
163
|
-
for (const property in object) {
|
|
164
|
-
if (object.hasOwnProperty(property)) {
|
|
165
|
-
const value = object[property];
|
|
166
|
-
if (!isFirst) {
|
|
167
|
-
queryString += "&";
|
|
168
|
-
}
|
|
169
|
-
queryString += encodeURIComponent(property) + "=";
|
|
170
|
-
if (value !== null && typeof value !== "undefined") {
|
|
171
|
-
queryString += encodeURIComponent(value);
|
|
172
|
-
}
|
|
173
|
-
isFirst = false;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return queryString;
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=acquisition-sdk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acquisition-sdk.js","sourceRoot":"","sources":["../../script/acquisition-sdk.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;AAiE7C,MAAa,iBAAiB;IACrB,MAAM,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IACnD,MAAM,CAAC,gBAAgB,GAAG,kBAAkB,CAAC;;AAFtD,8CAGC;AAED,MAAa,kBAAkB;IACrB,WAAW,CAAS;IACpB,eAAe,CAAS;IACxB,cAAc,CAAS;IACvB,cAAc,CAAiB;IAC/B,iBAAiB,CAAU;IAC3B,UAAU,CAAS;IAE3B,YAAY,aAA6B,EAAE,a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,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;oBAC/B,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;oBACnF,OAAO;iBACR;gBAED,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;aAC7C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlLD,gDAkLC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAI,OAAO,GAAY,IAAI,CAAC;IAE5B,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE;QAC7B,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YACnC,MAAM,KAAK,GAAiB,MAAO,CAAC,QAAQ,CAAC,CAAC;YAC9C,IAAI,CAAC,OAAO,EAAE;gBACZ,WAAW,IAAI,GAAG,CAAC;aACpB;YAED,WAAW,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;YAClD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;gBAClD,WAAW,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;aAC1C;YAED,OAAO,GAAG,KAAK,CAAC;SACjB;KACF;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/bin/script/types.js
DELETED
package/bin/script/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../script/types.ts"],"names":[],"mappings":";AAAA,6CAA6C"}
|