This repository was archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcloud-build-service.d.ts
295 lines (255 loc) · 7.71 KB
/
cloud-build-service.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/**
* Describes the result of a cloud build operation.
*/
interface IBuildResultData extends IServerResultData {
/**
* Path to the downloaded result of the build operation - .apk, .ipa...
*/
outputFilePath: string;
/**
* Data required for generation of a QR code from the build result.
*/
qrData: IQrData;
}
/**
* Describes build step.
*/
interface IBuildStep extends ICloudOperationId {
/**
* The name of the step - prepare, upload, build or download.
*/
step: string;
/**
* The progress of the step in percents. The value will be between 0 and 100.
*/
progress: number;
}
interface IBuildError extends Error, ICloudOperationId { }
interface ICloudOperationId {
/**
* The ID of the cloud operation.
*/
cloudOperationId: string;
}
interface IBuildLog extends ICloudOperationId {
data: string;
pipe: string;
}
/**
* Describes the data used for generating QR code from cloud build result.
*/
interface IQrData {
/**
* The original URL (to S3), where built package is located.
*/
originalUrl: string;
/**
* Base64 encoded data used for generating QR code image.
*/
imageData: string;
}
/**
* Describes arguments that may be passed to the build action.
*/
interface ICloudBuildData {
/**
* Describes the current project - project dir, application identifier, name and nativescript data.
*/
projectSettings: INSCloudProjectSettings;
/**
* The mobile platform for which the application should be built: Android or iOS.
*/
platform: string;
/**
* The build configuration - Debug or Release.
*/
buildConfiguration: string;
/**
* Android specific information for the build.
*/
androidBuildData?: IAndroidBuildData;
/**
* iOSBuildData iOS specific information for the build.
*/
iOSBuildData?: IIOSBuildData;
}
/**
* Describes options used for controlling cloud build infrastructure.
*/
interface ISharedCloud {
/**
* If true will perform cloud operation on the shared cloud instead of the private one.
*/
sharedCloud: boolean;
}
/**
* Defines operations for building a project in the cloud.
*/
interface ICloudBuildService extends ICloudService {
/**
* Builds the specified application in the cloud and returns information about the whole build process.
* @param {INSCloudProjectSettings} projectSettings Describes the current project - project dir, application identifier, name and nativescript data.
* @param {string} platform The mobile platform for which the application should be built: Android or iOS.
* @param {string} buildConfiguration The build configuration - Debug or Release.
* @param {string} accountId the account which will be charged for the build.
* @param {IAndroidBuildData} androidBuildData Android specific information for the build.
* @param {IIOSBuildData} iOSBuildData iOS specific information for the build.
* @returns {Promise<IBuildResultData>} Information about the build process. It is returned only on successful build. In case the build fails, the Promise is rejected with the server information.
*/
build(projectSettings: INSCloudProjectSettings,
platform: string,
buildConfiguration: string,
accountId: string,
androidBuildData?: IAndroidBuildData,
iOSBuildData?: IIOSBuildData,
buildOptions?: IBuildOptions): Promise<IBuildResultData>;
/**
* Validates the build properties for specified platform (Android or iOS).
* The result promise is rejected with the error found. In case everything is correct, the promise is resolved.
* @param {string} platform The mobile platform for which the application should be built: Android or iOS.
* @param {string} buildConfiguration The build configuration - Debug or Release.
* @param {string} projectId Application identifier of the project.
* @param {IAndroidBuildData} androidBuildData Android specific information for the build.
* @param {IIOSBuildData} iOSBuildData iOS specific information for the build.
* @returns {Promise<void>}
*/
validateBuildProperties(platform: string,
buildConfiguration: string,
projectId: string,
androidBuildData?: IAndroidBuildData,
iOSBuildData?: IIOSBuildData): Promise<void>;
}
/**
* Defines properties passed to prepareBuildRequest method.
*/
interface IPrepareBuildRequestInfo extends ICloudOperationId, IAccountId {
/**
* Settings used to control the build workflow.
*/
projectSettings: INSCloudProjectSettings;
/**
* Platform for which to build.
*/
platform: string;
/**
* Build configuration - debug or release.
*/
buildConfiguration: string;
/**
* Credentials for building using git.
*/
buildCredentials: IBuildCredentialResponse;
/**
* Files to upload prior to build.
*/
filesToUpload: IAmazonStorageEntryData[];
/**
* Additional flags that can be passed to CLI in the cloud (e.g. `--env.uglify` or `--bundle`)
*/
additionalCliFlags: string[];
}
/**
* Describes information about the project's name.
*/
interface IProjectNameComposition {
/**
* The project's name
*/
projectName: string;
}
/**
* Options that can be used to construct itms-services plist.
*/
interface IItmsPlistOptions extends IProjectNameComposition {
/**
* The path to the mobileprovision file on the file system.
*/
pathToProvision?: string;
/**
* The url pointing the .ipa file which is to be installed on the device by itms-services.
*/
url: string;
/**
* The aforementioned .ipa file's application identifier
*/
projectId: string;
}
interface IBundle {
bundle: boolean;
}
/**
* Describes the project settings required for different operations.
*/
interface INSCloudProjectSettings extends IEnvOptions, IBundle, ISharedCloud, IProjectNameComposition, IWorkflowRequestData, IHasUseHotModuleReloadOption {
/**
* The directory where the project is located. This should be the path to the directory where application's package.json is located.
*/
projectDir: string;
/**
* Application identifier.
*/
projectId: string;
/**
* The value of `nativescript` key from project's package.json.
*/
nativescriptData: any;
/**
* Whether to clean & build. By default incremental build without clean is performed.
*/
clean: boolean;
/**
* The name of the template that is to be used when creating a new virtual machine in the private cloud.
*/
flavorId?: string;
}
/**
* Describes specific data required for Android Builds.
*/
interface IAndroidBuildData {
/**
* Path to certificate (.p12 or .keystore), used for code signing the application. Required and used only for release builds.
*/
pathToCertificate: string;
/**
* Password of the specified certificate. Required and used only for release builds.
*/
certificatePassword: string;
/**
* Android App Bundle (--aab) option.
*/
aab?: boolean;
}
/**
* Describes specific data required for iOS Builds.
*/
interface IIOSBuildData extends IBuildForDevice {
/**
* Path to mobile provision that will be used for current build operation.
*/
pathToProvision: string;
/**
* Path to certificate (.p12), used for code signing the application.
*/
pathToCertificate: string;
/**
* Password of the specified certificate.
*/
certificatePassword: string;
/**
* @optional Device identifier that will be used for validation.
* In order to deploy the built application to this device, the identifier should be included in the mobile provision.
* In case you pass the deviceIdentifier and it is not included in the specified provision, the operation will fail.
*/
deviceIdentifier?: string;
}
/**
* Here only for backwards compatibility. Deleting this will require a major version change as it is used in NativeScript Sidekick.
*/
interface ICloudBuildOutputDirectoryOptions extends IOutputDirectoryOptions {
}
interface ICloudOperationOutputOptions extends IOutputDirectoryOptions {
extension?: string;
}
interface IBuildOptions {
shouldPrepare: boolean;
}