1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit AbilityKit
19 */
20
21/**
22 * Indicates the profile file information of a bundle.
23 *
24 * @typedef AppProvisionInfo
25 * @syscap SystemCapability.BundleManager.BundleFramework.Core
26 * @systemapi
27 * @since 10
28 */
29export interface AppProvisionInfo {
30  /**
31   * Indicates the version code of the profile file.
32   *
33   * @type { number }
34   * @syscap SystemCapability.BundleManager.BundleFramework.Core
35   * @systemapi
36   * @since 10
37   */
38  readonly versionCode: number;
39
40  /**
41   * Indicates the version name of the profile file.
42   *
43   * @type { string }
44   * @syscap SystemCapability.BundleManager.BundleFramework.Core
45   * @systemapi
46   * @since 10
47   */
48  readonly versionName: string;
49
50  /**
51   * Indicates the uuid of the profile file.
52   *
53   * @type { string }
54   * @syscap SystemCapability.BundleManager.BundleFramework.Core
55   * @systemapi
56   * @since 10
57   */
58  readonly uuid: string;
59
60  /**
61   * Indicates the type of the profile file.
62   *
63   * @type { string }
64   * @syscap SystemCapability.BundleManager.BundleFramework.Core
65   * @systemapi
66   * @since 10
67   */
68  readonly type: string;
69
70  /**
71   * Indicates the app distribution type of the profile file.
72   *
73   * @type { string }
74   * @syscap SystemCapability.BundleManager.BundleFramework.Core
75   * @systemapi
76   * @since 10
77   */
78  readonly appDistributionType: string;
79
80  /**
81   * Indicates the validity of the profile file.
82   *
83   * @type { Validity }
84   * @syscap SystemCapability.BundleManager.BundleFramework.Core
85   * @systemapi
86   * @since 10
87   */
88  readonly validity: Validity;
89
90  /**
91   * Indicates the developer id of the profile file.
92   *
93   * @type { string }
94   * @syscap SystemCapability.BundleManager.BundleFramework.Core
95   * @systemapi
96   * @since 10
97   */
98  readonly developerId: string;
99
100  /**
101   * Indicates the distribution or development certificate of the profile file.
102   *
103   * @type { string }
104   * @syscap SystemCapability.BundleManager.BundleFramework.Core
105   * @systemapi
106   * @since 10
107   */
108  readonly certificate: string;
109
110  /**
111   * Indicates the apl of the profile file.
112   *
113   * @type { string }
114   * @syscap SystemCapability.BundleManager.BundleFramework.Core
115   * @systemapi
116   * @since 10
117   */
118  readonly apl: string;
119
120  /**
121   * Indicates the issuer of the profile file.
122   *
123   * @type { string }
124   * @syscap SystemCapability.BundleManager.BundleFramework.Core
125   * @systemapi
126   * @since 10
127   */
128  readonly issuer: string;
129
130  /**
131   * Globally unique identifier of an application, which is allocated by the cloud.
132   * AppIdentifier does not change along the application lifecycle, including version updates, certificate changes,
133   * public and private key changes, and application transfer.
134   *
135   * @type { string }
136   * @readonly
137   * @syscap SystemCapability.BundleManager.BundleFramework.Core
138   * @systemapi
139   * @since 11
140   */
141  readonly appIdentifier: string;
142
143  /**
144   * Indicates the organization information of the profile file.
145   *
146   * @type { string }
147   * @readonly
148   * @syscap SystemCapability.BundleManager.BundleFramework.Core
149   * @systemapi
150   * @since 12
151   */
152  readonly organization: string;
153}
154
155/**
156 * The validity of the profile file.
157 *
158 * @typedef Validity
159 * @syscap SystemCapability.BundleManager.BundleFramework.Core
160 * @systemapi
161 * @since 10
162 */
163export interface Validity {
164  /**
165   * Indicates the earliest validity of the profile file.
166   *
167   * @type { number }
168   * @syscap SystemCapability.BundleManager.BundleFramework.Core
169   * @systemapi
170   * @since 10
171   */
172  readonly notBefore: number;
173
174  /**
175   * Indicates the latest validity of the profile file.
176   *
177   * @type { number }
178   * @syscap SystemCapability.BundleManager.BundleFramework.Core
179   * @systemapi
180   * @since 10
181   */
182  readonly notAfter: number;
183}
184