summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/client.js
blob: 5a53dace6a23afb628284bc06082c4ba292721ca (plain)
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
/**
 * Created by Pete Hare on 2/7/17.
 */
import { makeMetatype } from "@jet/environment/util/metatype";
import { Size } from "../../api/models/base";
import * as serverData from "../json-parsing/server-data";
import { Wrapper } from "./wrapper";
// region API
/**
 * Client identifier for the App Store.
 */
export const appStoreIdentifier = "com.apple.AppStore" /* ClientIdentifier.AppStore */;
/**
 * Client identifier for the Bridge (Watch) store.
 */
export const watchIdentifier = "com.apple.AppStore.BridgeStoreExtension" /* ClientIdentifier.AppStore_BridgeStoreExtension */;
/**
 * Client identifier for the iMessages store.
 */
export const messagesIdentifier = "com.apple.MobileSMS" /* ClientIdentifier.MobileSMS */;
/**
 * Client identifier for the arcade app.
 */
export const arcadeIdentifier = "com.apple.Arcade" /* ClientIdentifier.Arcade */;
/**
 * Client identifier indicating ATV.
 */
export const tvIdentifier = "com.apple.TVAppStore" /* ClientIdentifier.TVAppStore */;
/**
 * Client identifier for the Arcade launch repair SubscribePageExtension (iOS).
 */
export const productPageExtensionIdentifier = "com.apple.AppStore.ProductPageExtension" /* ClientIdentifier.AppStore_ProductPageExtension */;
/**
 * Client identifier for the Arcade launch repair SubscribePageExtension (iOS).
 */
export const subscribePageExtensionIdentifier = "com.apple.AppStore.SubscribePageExtension" /* ClientIdentifier.AppStore_SubscribePageExtension */;
export class ClientWrapper extends Wrapper {
    get buildType() {
        return this.implementation.buildType;
    }
    // This is only supported in Luckier client builds from AppStoreJet 11.1.7 & GamesUI 2.1.5 onwards. Any previous
    // clients will return undefined.
    get buildVersion() {
        return this.implementation.buildVersion;
    }
    get deviceType() {
        return this.implementation.deviceType;
    }
    get guid() {
        return this.implementation.guid;
    }
    get isActivityAvailable() {
        return this.implementation.isActivityAvailable;
    }
    get isElectrocardiogramInstallationAllowed() {
        return this.implementation.isElectrocardiogramInstallationAllowed;
    }
    get isScandiumInstallationAllowed() {
        return this.implementation.isScandiumInstallationAllowed;
    }
    get isSidepackingEnabled() {
        return this.implementation.isSidepackingEnabled;
    }
    get isTinkerWatch() {
        return this.implementation.isTinkerWatch;
    }
    get screenCornerRadius() {
        return this.implementation.screenCornerRadius;
    }
    get screenSize() {
        return Size.fromNativeSize(this.implementation.screenSize);
    }
    get storefrontIdentifier() {
        return this.implementation.storefrontIdentifier;
    }
    get supportsHEIF() {
        return this.implementation.supportsHEIF;
    }
    get thinnedApplicationVariantIdentifier() {
        return this.implementation.thinnedApplicationVariantIdentifier;
    }
    get isMandrakeSupported() {
        return this.implementation.isMandrakeSupported;
    }
    get isCharonSupported() {
        return this.implementation.isCharonSupported;
    }
    get isIconArtworkCapable() {
        return this.implementation.isIconArtworkCapable;
    }
    get maxAppContentRating() {
        return this.implementation.maxAppContentRating;
    }
    get hostBundleId() {
        return this.implementation.hostBundleId;
    }
    isPairedSystemVersionAtLeast(version) {
        var _a, _b, _c;
        return (_c = (_b = (_a = this.implementation).isPairedSystemVersionAtLeast) === null || _b === void 0 ? void 0 : _b.call(_a, version)) !== null && _c !== void 0 ? _c : false;
    }
    deletableSystemAppCanBeInstalledOnWatchWithBundleID(bundleId) {
        return this.implementation.deletableSystemAppCanBeInstalledOnWatchWithBundleID(bundleId);
    }
    deviceHasCapabilities(capabilities) {
        return this.implementation.deviceHasCapabilities(capabilities);
    }
    deviceHasCapabilitiesIncludingCompatibilityCheckIsVisionOSCompatibleIOSApp(capabilities, supportsVisionOSCompatibleIOSBinary) {
        if (this.isPad && capabilities.includes("healthkit")) {
            // Workaround for: rdar://116905381 (J517/21C16: Unable to download AC Wellness even though App Store page says its compatible with my iPad)
            return false;
        }
        return this.implementation.deviceHasCapabilitiesIncludingCompatibilityCheckIsVisionOSCompatibleIOSApp(capabilities, supportsVisionOSCompatibleIOSBinary);
    }
    isActivePairedWatchSystemVersionAtLeastMajorVersionMinorVersionPatchVersion(majorVersion, minorVersion, patchVersion) {
        return this.implementation.isActivePairedWatchSystemVersionAtLeastMajorVersionMinorVersionPatchVersion(majorVersion, minorVersion, patchVersion);
    }
    canDevicePerformAppActionWithAppCapabilities(appAction, appCapabilities) {
        return this.implementation.canDevicePerformAppActionWithAppCapabilities(appAction, appCapabilities);
    }
    isAutomaticDownloadingEnabled() {
        return this.implementation.isAutomaticDownloadingEnabled();
    }
    isAuthorizedForUserNotifications() {
        return this.implementation.isAuthorizedForUserNotifications();
    }
    /**
     * Check whether the active paired device's OS is below a given version.
     */
    isActivePairedWatchSystemVersionBelow(version) {
        // We want to use isActivePairedWatchSystemVersionAtLeastMajorVersionMinorVersionPatchVersion
        // rather than isPairedSystemVersionAtLeast here, as the latter is only available from YukonB onwards
        const versionComponents = version.split(".");
        const majorVersion = serverData.asNumber(versionComponents[0]) || 0;
        const minorVersion = serverData.asNumber(versionComponents[1]) || 0;
        const patchVersion = serverData.asNumber(versionComponents[2]) || 0;
        return !this.implementation.isActivePairedWatchSystemVersionAtLeastMajorVersionMinorVersionPatchVersion(majorVersion, minorVersion, patchVersion);
    }
    /** Returns `true` for phone-factor iOS devices. */
    get isPhone() {
        return this.deviceType === "phone";
    }
    /** Returns `true` for pad-factor iOS devices. */
    get isPad() {
        return this.deviceType === "pad";
    }
    /**
     * Returns `true` for iOS devices.
     *
     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isiOS() {
        return this.isPhone || this.isPad;
    }
    /**
     * Returns `true` for Mac devices

     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isMac() {
        return this.deviceType === "mac";
    }
    /**
     * Returns `true` for TV devices.

     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isTV() {
        return this.deviceType === "tv";
    }
    /**
     * Returns `true` for Watch devices.

     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isWatch() {
        return this.deviceType === "watch";
    }
    /**
     * Returns `true` for Vision devices.
     *
     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isVision() {
        return this.deviceType === "vision";
    }
    /**
     * Returns `true` for the Web
     *
     * Note: this property might be replaced with a build-time macro in "production"
     */
    get isWeb() {
        return this.deviceType === "web";
    }
    get isCompanionVisionApp() {
        return this.hostBundleId === "com.apple.visionproapp";
    }
    /** Returns the list of remote identifiers to download any purchases to. */
    get remoteDownloadIdentifiers() {
        return this.implementation.remoteDownloadIdentifiers;
    }
}
ClientWrapper.type = makeMetatype("app-store:client-wrapper");
// endregion
//# sourceMappingURL=client.js.map