react-native-intune 0.1.0-alpha.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/LICENSE +27 -0
- package/NOTICE +49 -0
- package/README.md +164 -0
- package/RNIntune.podspec +69 -0
- package/android/build.gradle +152 -0
- package/android/consumer-rules.pro +28 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneAuth.kt +330 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneAuthCallback.kt +195 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneConfig.kt +63 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneEventQueue.kt +50 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneModule.kt +752 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneMsalConfig.kt +78 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneNotifications.kt +187 -0
- package/android/src/main/java/com/reactnativeintune/RNIntunePackage.kt +33 -0
- package/android/src/main/java/com/reactnativeintune/RNIntunePolicy.kt +108 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneReset.kt +85 -0
- package/android/src/main/java/com/reactnativeintune/RNIntuneResetJournal.kt +140 -0
- package/app.plugin.js +10 -0
- package/ios/RNIntune.h +20 -0
- package/ios/RNIntune.mm +467 -0
- package/ios/RNIntuneAuth.h +121 -0
- package/ios/RNIntuneAuth.m +390 -0
- package/ios/RNIntuneCore.h +150 -0
- package/ios/RNIntuneCore.m +535 -0
- package/ios/RNIntuneDelegates.h +70 -0
- package/ios/RNIntuneDelegates.m +268 -0
- package/ios/RNIntunePendingRequests.h +57 -0
- package/ios/RNIntunePendingRequests.m +230 -0
- package/ios/RNIntunePlistGuard.h +37 -0
- package/ios/RNIntunePlistGuard.m +147 -0
- package/ios/RNIntunePolicy.h +25 -0
- package/ios/RNIntunePolicy.m +112 -0
- package/ios/RNIntuneReset.h +34 -0
- package/ios/RNIntuneReset.m +93 -0
- package/ios/RNIntuneResetJournal.h +69 -0
- package/ios/RNIntuneResetJournal.m +106 -0
- package/lib/module/NativeIntune.js +20 -0
- package/lib/module/NativeIntune.js.map +1 -0
- package/lib/module/api/auth.js +66 -0
- package/lib/module/api/auth.js.map +1 -0
- package/lib/module/api/enrollment.js +104 -0
- package/lib/module/api/enrollment.js.map +1 -0
- package/lib/module/api/events.js +50 -0
- package/lib/module/api/events.js.map +1 -0
- package/lib/module/api/lifecycle.js +73 -0
- package/lib/module/api/lifecycle.js.map +1 -0
- package/lib/module/api/policy.js +23 -0
- package/lib/module/api/policy.js.map +1 -0
- package/lib/module/api/tokenProvider.js +80 -0
- package/lib/module/api/tokenProvider.js.map +1 -0
- package/lib/module/index.js +82 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/decode.js +153 -0
- package/lib/module/internal/decode.js.map +1 -0
- package/lib/module/internal/emitter.js +15 -0
- package/lib/module/internal/emitter.js.map +1 -0
- package/lib/module/internal/errors.js +32 -0
- package/lib/module/internal/errors.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +143 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeIntune.d.ts +120 -0
- package/lib/typescript/src/NativeIntune.d.ts.map +1 -0
- package/lib/typescript/src/api/auth.d.ts +37 -0
- package/lib/typescript/src/api/auth.d.ts.map +1 -0
- package/lib/typescript/src/api/enrollment.d.ts +54 -0
- package/lib/typescript/src/api/enrollment.d.ts.map +1 -0
- package/lib/typescript/src/api/events.d.ts +24 -0
- package/lib/typescript/src/api/events.d.ts.map +1 -0
- package/lib/typescript/src/api/lifecycle.d.ts +33 -0
- package/lib/typescript/src/api/lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/api/policy.d.ts +14 -0
- package/lib/typescript/src/api/policy.d.ts.map +1 -0
- package/lib/typescript/src/api/tokenProvider.d.ts +18 -0
- package/lib/typescript/src/api/tokenProvider.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +67 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/internal/decode.d.ts +48 -0
- package/lib/typescript/src/internal/decode.d.ts.map +1 -0
- package/lib/typescript/src/internal/emitter.d.ts +11 -0
- package/lib/typescript/src/internal/emitter.d.ts.map +1 -0
- package/lib/typescript/src/internal/errors.d.ts +22 -0
- package/lib/typescript/src/internal/errors.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +317 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +204 -0
- package/plugin/transforms.js +153 -0
- package/plugin/withIntune.js +320 -0
- package/scripts/cli.mjs +72 -0
- package/scripts/doctor.mjs +232 -0
- package/scripts/fetch-sdks.mjs +456 -0
- package/scripts/lib/checks.mjs +720 -0
- package/scripts/lib/project.mjs +196 -0
- package/scripts/setup.mjs +233 -0
- package/sdk-lock.json +27 -0
- package/sdk-versions.json +70 -0
- package/src/NativeIntune.ts +130 -0
- package/src/api/auth.ts +73 -0
- package/src/api/enrollment.ts +112 -0
- package/src/api/events.ts +87 -0
- package/src/api/lifecycle.ts +75 -0
- package/src/api/policy.ts +22 -0
- package/src/api/tokenProvider.ts +80 -0
- package/src/index.ts +127 -0
- package/src/internal/decode.ts +191 -0
- package/src/internal/emitter.ts +14 -0
- package/src/internal/errors.ts +43 -0
- package/src/types.ts +381 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning what the bridge hands us into the public types.
|
|
3
|
+
*
|
|
4
|
+
* Everything crossing the bridge is `Object` because Codegen accepts nothing richer, so
|
|
5
|
+
* this is where it becomes typed. Two rules hold throughout:
|
|
6
|
+
*
|
|
7
|
+
* - **A value we do not recognise never throws.** An SDK update that adds a status
|
|
8
|
+
* must not crash a shipped app, so unknown strings fall back rather than raise.
|
|
9
|
+
* - **A missing field gets a deliberate default**, chosen per field. For policy that
|
|
10
|
+
* means permissive, not `false`: reporting `false` would hide functionality nothing
|
|
11
|
+
* is restricting.
|
|
12
|
+
*/
|
|
13
|
+
import { EnrollmentStatus, ResetStage, type AuthAccount, type AuthResult, type BrokerStatus, type EnrollmentResult, type IntuneState, type PolicySnapshot, type ResetReason, type RestartReason } from '../types.js';
|
|
14
|
+
export declare function str(value: unknown, fallback?: string): string;
|
|
15
|
+
export declare function nullableStr(value: unknown): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Accepts `0` and `1` as well as real booleans.
|
|
18
|
+
*
|
|
19
|
+
* Not laziness — defence against a genuine bridge nuance. In C, `a || b` has type `int`,
|
|
20
|
+
* so `@(someBool || otherBool)` on the native side boxes an NSNumber holding an integer
|
|
21
|
+
* and arrives here as the number `1`, not `true`. A strict check turns that into the
|
|
22
|
+
* `fallback`, which is how `brokerAvailable` came back `false` on a device that had a
|
|
23
|
+
* broker installed — a wrong answer, silently, in a public API field.
|
|
24
|
+
*
|
|
25
|
+
* The native side was fixed, but this stays: a wrong boolean is worse than a tolerant
|
|
26
|
+
* decoder, and nothing distinguishes "native sent 1" from "native sent true" in a way a
|
|
27
|
+
* consumer should care about. Anything that is neither still takes the fallback.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Narrows a restart reason, falling back to `unknown` rather than passing a raw string
|
|
31
|
+
* through. A reason a future SDK adds must not break a shipped app — the app still has a
|
|
32
|
+
* restart to perform either way.
|
|
33
|
+
*/
|
|
34
|
+
export declare function toRestartReason(value: unknown): RestartReason;
|
|
35
|
+
export declare function bool(value: unknown, fallback?: boolean): boolean;
|
|
36
|
+
export declare function strArray(value: unknown): string[];
|
|
37
|
+
export declare function strRecord(value: unknown): Record<string, string>;
|
|
38
|
+
export declare function toEnrollmentStatus(value: unknown): EnrollmentStatus;
|
|
39
|
+
/** Null rather than a guess: an unrecognised reason is not worth acting on. */
|
|
40
|
+
export declare function toResetReason(value: unknown): ResetReason | null;
|
|
41
|
+
export declare function toResetStage(value: unknown): ResetStage | null;
|
|
42
|
+
export declare function toEnrollmentResult(raw: object): EnrollmentResult;
|
|
43
|
+
export declare function toIntuneState(raw: object): IntuneState;
|
|
44
|
+
export declare function toPolicySnapshot(raw: object): PolicySnapshot;
|
|
45
|
+
export declare function toBrokerStatus(raw: object): BrokerStatus;
|
|
46
|
+
export declare function toAuthResult(raw: object): AuthResult;
|
|
47
|
+
export declare function toAuthAccount(raw: object): AuthAccount;
|
|
48
|
+
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../../src/internal/decode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,aAAU,CAAC;AAIlB,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM,CAEzD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;;;;;;;;GAYG;AACH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAE7D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAQ9D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAIjD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOhE;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAInE;AAcD,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAIhE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAI9D;AAID,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAShE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAWtD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAW5D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CASxD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAWpD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAOtD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one emitter instance, constructed at import time.
|
|
3
|
+
*
|
|
4
|
+
* Import time and not on first use, deliberately: a service-initiated wipe can arrive
|
|
5
|
+
* before the app has called anything at all, and native queues events until JS
|
|
6
|
+
* subscribes. An emitter created lazily would miss the very events that matter most
|
|
7
|
+
* (SPEC §4.4).
|
|
8
|
+
*/
|
|
9
|
+
import { NativeEventEmitter } from 'react-native';
|
|
10
|
+
export declare const emitter: NativeEventEmitter<Readonly<Record<string, readonly Object[]>>>;
|
|
11
|
+
//# sourceMappingURL=emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../../src/internal/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlD,eAAO,MAAM,OAAO,iEAAuC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rejections. Every one carries a stable code from SPEC §13.6 — never a raw platform
|
|
3
|
+
* error, because a code is something a consumer can branch on and a platform message is
|
|
4
|
+
* not.
|
|
5
|
+
*/
|
|
6
|
+
import type { IntuneErrorCode } from '../types.js';
|
|
7
|
+
export declare class IntuneError extends Error {
|
|
8
|
+
readonly code: IntuneErrorCode;
|
|
9
|
+
readonly nativeCode?: string;
|
|
10
|
+
readonly nativeMessage?: string;
|
|
11
|
+
constructor(code: IntuneErrorCode, message: string, native?: {
|
|
12
|
+
nativeCode?: string;
|
|
13
|
+
nativeMessage?: string;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The UPN-based SDK APIs are deprecated, so the module identifies accounts by object ID
|
|
18
|
+
* only (SPEC §13.2). Catching a UPN here gives a named error at the call site instead of
|
|
19
|
+
* an opaque SDK failure minutes later, in a tenant you cannot reach.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertAccountId(accountId: string): void;
|
|
22
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/internal/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAU,CAAC;AAEhD,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;gBAG9B,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;CAQ3D;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQvD"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types and enums. Hand-written, unlike `NativeIntune.ts` which Codegen reads.
|
|
3
|
+
*
|
|
4
|
+
* The split exists because Codegen accepts only `boolean | number | string | Object |
|
|
5
|
+
* Array | Promise | void` and no literal unions, so the bridge spec has to stay loose.
|
|
6
|
+
* Everything strict lives here and in `index.ts`. Nothing in the public API is `any`.
|
|
7
|
+
*
|
|
8
|
+
* This file is the semver contract described in SPEC §13. Adding to it is a minor;
|
|
9
|
+
* changing or removing anything is a major. `PolicySnapshot.raw` is explicitly excluded.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Normalized enrollment outcome. The two platforms report different enums — iOS 28
|
|
13
|
+
* codes, Android 10 — and both are mapped onto this set natively. See SPEC §4.1 for the
|
|
14
|
+
* full table; `EnrollmentResult.nativeCode` always carries the raw platform constant.
|
|
15
|
+
*
|
|
16
|
+
* The blocking distinction in SPEC §8 is load-bearing and easy to get backwards:
|
|
17
|
+
* `NotLicensed` and `NotTargeted` must NOT block the user, `Failed` must.
|
|
18
|
+
*/
|
|
19
|
+
export declare enum EnrollmentStatus {
|
|
20
|
+
Succeeded = "succeeded",
|
|
21
|
+
/** Tenant is MAM-enabled but the user has no Intune licence. Must NOT block. */
|
|
22
|
+
NotLicensed = "notLicensed",
|
|
23
|
+
/** Licensed, but no App Protection Policy targets the user. Must NOT block. */
|
|
24
|
+
NotTargeted = "notTargeted",
|
|
25
|
+
/** Licensed and targeted, but enrollment failed. This one DOES block. */
|
|
26
|
+
Failed = "failed",
|
|
27
|
+
/** Android reports this itself; on iOS it is our own state while the delegate is pending. */
|
|
28
|
+
Pending = "pending",
|
|
29
|
+
AuthorizationNeeded = "authorizationNeeded",
|
|
30
|
+
/** Android only. iOS uses Authenticator as a broker and has no equivalent code. */
|
|
31
|
+
CompanyPortalRequired = "companyPortalRequired",
|
|
32
|
+
WrongUser = "wrongUser",
|
|
33
|
+
Unenrolled = "unenrolled",
|
|
34
|
+
UnenrollmentFailed = "unenrollmentFailed",
|
|
35
|
+
/**
|
|
36
|
+
* Any native value the mapping does not cover. Unknown values map here rather than
|
|
37
|
+
* throwing, so an SDK update that adds a status cannot crash a shipped app.
|
|
38
|
+
*/
|
|
39
|
+
Unknown = "unknown"
|
|
40
|
+
}
|
|
41
|
+
/** Journal stage of an unfinished reset. See SPEC §7. */
|
|
42
|
+
export declare enum ResetStage {
|
|
43
|
+
Unregistering = "unregistering",
|
|
44
|
+
CleaningAuth = "cleaningAuth",
|
|
45
|
+
CleaningLocal = "cleaningLocal"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* iOS `MaxFileProtectionLevel`. The default makes protected files unreadable roughly ten
|
|
49
|
+
* seconds after the device locks, which breaks local databases; an app with lock-screen
|
|
50
|
+
* UI wants `CompleteUntilFirstUserAuthentication`. See SPEC §5.2.
|
|
51
|
+
*/
|
|
52
|
+
export declare enum FileProtectionLevel {
|
|
53
|
+
Complete = "complete",
|
|
54
|
+
CompleteUnlessOpen = "completeUnlessOpen",
|
|
55
|
+
CompleteUntilFirstUserAuthentication = "completeUntilFirstUserAuthentication",
|
|
56
|
+
None = "none"
|
|
57
|
+
}
|
|
58
|
+
/** Why a reset was started. Recorded in the journal and surfaced in `getDiagnostics`. */
|
|
59
|
+
export type ResetReason = 'logout' | 'tenant_changed' | 'intune_disabled' | 'remote_wipe' | 'account_switch' | 'support_reset' | 'resume';
|
|
60
|
+
/**
|
|
61
|
+
* Who owns MSAL. `builtin` is the module (SPEC §3.1) and the default. `external` is for
|
|
62
|
+
* apps that already have their own MSAL and supply MAM tokens via `setTokenProvider`;
|
|
63
|
+
* it is a supported mode, not a documentation fallback.
|
|
64
|
+
*/
|
|
65
|
+
export type AuthMode = 'builtin' | 'external';
|
|
66
|
+
export type IntuneConfig = {
|
|
67
|
+
/** Entra application (client) ID, GUID. */
|
|
68
|
+
clientId: string;
|
|
69
|
+
/** Entra directory (tenant) ID, GUID. */
|
|
70
|
+
tenantId: string;
|
|
71
|
+
/** e.g. `https://login.microsoftonline.com/<tenantId>` */
|
|
72
|
+
authority: string;
|
|
73
|
+
/** Must match the platform format — see the README. */
|
|
74
|
+
redirectUri: string;
|
|
75
|
+
/** Default `'builtin'`. */
|
|
76
|
+
authMode?: AuthMode;
|
|
77
|
+
/** Default `false`. */
|
|
78
|
+
verboseLogging?: boolean;
|
|
79
|
+
/** iOS only. Default `false`. See SPEC §5.2 and open question O-C. */
|
|
80
|
+
restartHandledByApp?: boolean;
|
|
81
|
+
/** iOS only. Default `Complete`, which is the SDK's own default. */
|
|
82
|
+
maxFileProtectionLevel?: FileProtectionLevel;
|
|
83
|
+
/** Android only. Default `__DEV__`. Throws on integration bugs, so never ship it on. */
|
|
84
|
+
strictMode?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* iOS only. MSAL's keychain access group. Leave unset unless the app already uses a
|
|
87
|
+
* custom one: the module sets `ADALCacheKeychainGroupOverride` from this same value in
|
|
88
|
+
* the same code path, so the two can never disagree (SPEC §5.1.2).
|
|
89
|
+
*/
|
|
90
|
+
keychainGroupOverride?: string;
|
|
91
|
+
/** Default `true`, matching the SDK. Set `false` to opt out of Microsoft telemetry. */
|
|
92
|
+
telemetryEnabled?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Colours for the screens the SDK draws itself — the PIN prompt, the blur overlay, the
|
|
95
|
+
* policy and diagnostics screens. Anything left unset keeps Microsoft's default.
|
|
96
|
+
*
|
|
97
|
+
* These are the SDK's own UI, not yours: it renders them over your app and you cannot
|
|
98
|
+
* restyle them any other way (SPEC §15 P4).
|
|
99
|
+
*/
|
|
100
|
+
branding?: Branding;
|
|
101
|
+
};
|
|
102
|
+
/** Hex strings, e.g. `#1B5E20`. */
|
|
103
|
+
export type Branding = {
|
|
104
|
+
background?: string;
|
|
105
|
+
foreground?: string;
|
|
106
|
+
accent?: string;
|
|
107
|
+
secondaryBackground?: string;
|
|
108
|
+
secondaryForeground?: string;
|
|
109
|
+
};
|
|
110
|
+
export type SignInPrompt = 'selectAccount' | 'login' | 'consent' | 'whenRequired';
|
|
111
|
+
export type SignInParams = {
|
|
112
|
+
/** Scopes for your own API. The MAM service scopes are added internally. */
|
|
113
|
+
scopes?: string[];
|
|
114
|
+
/** Pre-fill the account, e.g. from an email field. */
|
|
115
|
+
loginHint?: string;
|
|
116
|
+
prompt?: SignInPrompt;
|
|
117
|
+
};
|
|
118
|
+
export type AcquireTokenParams = {
|
|
119
|
+
scopes: string[];
|
|
120
|
+
accountId?: string;
|
|
121
|
+
};
|
|
122
|
+
export type AuthResult = {
|
|
123
|
+
/** Entra object ID. This is what `enroll` takes — never the UPN. */
|
|
124
|
+
accountId: string;
|
|
125
|
+
tenantId: string;
|
|
126
|
+
/** UPN. Display only; never log or persist it (SPEC §16, CLAUDE.md rule 3). */
|
|
127
|
+
username: string;
|
|
128
|
+
/** For the scopes you asked for. Never the MAM service token. */
|
|
129
|
+
accessToken: string;
|
|
130
|
+
idToken: string | null;
|
|
131
|
+
/** Unix seconds. */
|
|
132
|
+
expiresOn: number;
|
|
133
|
+
scopes: string[];
|
|
134
|
+
};
|
|
135
|
+
export type AuthAccount = {
|
|
136
|
+
accountId: string;
|
|
137
|
+
tenantId: string;
|
|
138
|
+
username: string;
|
|
139
|
+
};
|
|
140
|
+
export type EnrollParams = {
|
|
141
|
+
/** Entra object ID. Never a UPN — that is what `upn` below is for. */
|
|
142
|
+
accountId: string;
|
|
143
|
+
/**
|
|
144
|
+
* **Android, `authMode: 'external'` only.** `registerAccountForMAM` takes the UPN as
|
|
145
|
+
* well as the object ID and will not accept null for it, and in `external` mode the
|
|
146
|
+
* module has no MSAL cache to resolve one from.
|
|
147
|
+
*
|
|
148
|
+
* Leave it unset in `builtin` mode — the module reads it from its own MSAL account.
|
|
149
|
+
* iOS never needs it: `registerAndEnrollAccountId:` takes the object ID alone and the
|
|
150
|
+
* SDK resolves the UPN itself. See SPEC §6.3.
|
|
151
|
+
*/
|
|
152
|
+
upn?: string;
|
|
153
|
+
};
|
|
154
|
+
export type EnrollInteractiveParams = {
|
|
155
|
+
/**
|
|
156
|
+
* The account's UPN. Leave unset to let the SDK ask for it — it shows its own sign-in
|
|
157
|
+
* screen either way.
|
|
158
|
+
*/
|
|
159
|
+
upn?: string;
|
|
160
|
+
};
|
|
161
|
+
export type SignOutParams = {
|
|
162
|
+
accountId: string;
|
|
163
|
+
/** Also runs the full reset sequence. On Android the process may terminate. */
|
|
164
|
+
wipeIntune: boolean;
|
|
165
|
+
};
|
|
166
|
+
export type BrokerStatus = {
|
|
167
|
+
/** Any usable broker is present. */
|
|
168
|
+
brokerAvailable: boolean;
|
|
169
|
+
companyPortalInstalled: boolean;
|
|
170
|
+
/** iOS only; always `false` on Android. */
|
|
171
|
+
authenticatorInstalled: boolean;
|
|
172
|
+
/** `true` on Android — enrollment is impossible without a broker. */
|
|
173
|
+
required: boolean;
|
|
174
|
+
};
|
|
175
|
+
export type EnrollmentResult = {
|
|
176
|
+
status: EnrollmentStatus;
|
|
177
|
+
accountId: string | null;
|
|
178
|
+
/** Raw platform constant *name*, e.g. `LicensedNotTargeted`. For support bundles. */
|
|
179
|
+
nativeCode: string;
|
|
180
|
+
/** SDK debug string. Safe to log — contains no token. */
|
|
181
|
+
nativeMessage: string;
|
|
182
|
+
restartRequired: boolean;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* The reconciliation primitive, and the intended way to drive this module. Read it at
|
|
186
|
+
* launch, compare against what your backend says the state should be, act on the
|
|
187
|
+
* difference. Do not drive enrollment from lifecycle hooks: the process can die
|
|
188
|
+
* mid-operation and only a state comparison recovers from that. See SPEC §13.2.
|
|
189
|
+
*/
|
|
190
|
+
export type IntuneState = {
|
|
191
|
+
configured: boolean;
|
|
192
|
+
configuredTenantId: string | null;
|
|
193
|
+
registeredAccountIds: string[];
|
|
194
|
+
enrolledAccountId: string | null;
|
|
195
|
+
/** `null` means no account is registered. */
|
|
196
|
+
status: EnrollmentStatus | null;
|
|
197
|
+
/** Non-null means a reset is unfinished and must be resumed (SPEC §7). */
|
|
198
|
+
pendingReset: ResetStage | null;
|
|
199
|
+
/**
|
|
200
|
+
* Why that unfinished reset started, from the journal.
|
|
201
|
+
*
|
|
202
|
+
* Pass it back as `reset({ reason })` when resuming, so the reset handler sees what
|
|
203
|
+
* actually happened rather than `'resume'`. It is the difference between telling a user
|
|
204
|
+
* their administrator revoked access and telling them nothing — and on the path that
|
|
205
|
+
* matters most, a service-initiated wipe, the process dies before the handler ever runs
|
|
206
|
+
* in the original call, so the resume is the only place it can be said.
|
|
207
|
+
*/
|
|
208
|
+
pendingResetReason: ResetReason | null;
|
|
209
|
+
};
|
|
210
|
+
export type ResetParams = {
|
|
211
|
+
wipe: boolean;
|
|
212
|
+
reason: ResetReason;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Only what an app needs to adapt its own UI — hiding an export button, disabling a
|
|
216
|
+
* share sheet. **PIN prompts, screenshot blocking and encryption are enforced inside the
|
|
217
|
+
* SDK and never surface here.** Do not try to implement enforcement from these booleans.
|
|
218
|
+
*
|
|
219
|
+
* Deliberately short: every field is a support obligation.
|
|
220
|
+
*
|
|
221
|
+
* There is no clipboard field, and there cannot be one. Neither platform exposes a
|
|
222
|
+
* clipboard policy getter — the restriction is enforced inside the SDK and is not
|
|
223
|
+
* queryable — so `canSaveToPersonal` and `canOpenFromUnmanaged` serve the same
|
|
224
|
+
* "adapt your UI" purpose using values both platforms can actually answer (SPEC §4.3).
|
|
225
|
+
*
|
|
226
|
+
* When no policy applies, every field is permissive rather than `false`: reporting
|
|
227
|
+
* `false` would hide functionality that nothing is restricting.
|
|
228
|
+
*/
|
|
229
|
+
export type PolicySnapshot = {
|
|
230
|
+
isManaged: boolean;
|
|
231
|
+
/** Save into the app's own storage. */
|
|
232
|
+
canSaveToLocal: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Save out to a personal, unmanaged destination. Gate an export or "save a copy"
|
|
235
|
+
* control on this.
|
|
236
|
+
*/
|
|
237
|
+
canSaveToPersonal: boolean;
|
|
238
|
+
/** Bring data in from an unmanaged location. Gate an import control on this. */
|
|
239
|
+
canOpenFromUnmanaged: boolean;
|
|
240
|
+
screenshotAllowed: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Everything else the SDK reports. **Excluded from semver** — unstable, debug only.
|
|
243
|
+
* Anything you come to depend on must be promoted to a typed field first.
|
|
244
|
+
*/
|
|
245
|
+
raw: Record<string, string>;
|
|
246
|
+
};
|
|
247
|
+
/** Opaque key/value for support bundles. Contains no tokens and no UPNs. */
|
|
248
|
+
export type Diagnostics = Record<string, string>;
|
|
249
|
+
/** Payload of a native-initiated MAM service token request. See SPEC §13.4. */
|
|
250
|
+
export type TokenRequest = {
|
|
251
|
+
resourceId: string;
|
|
252
|
+
tenantId: string;
|
|
253
|
+
authority: string;
|
|
254
|
+
accountId: string;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Return the access token, or `null` to signal "cannot get a token right now". Runs on a
|
|
258
|
+
* background thread's behalf, and the SDK may ask with no JS call in flight.
|
|
259
|
+
*/
|
|
260
|
+
export type TokenProvider = (request: TokenRequest) => Promise<string | null> | string | null;
|
|
261
|
+
export type ResetHandlerContext = {
|
|
262
|
+
reason: ResetReason;
|
|
263
|
+
accountId: string | null;
|
|
264
|
+
};
|
|
265
|
+
/** Clear the app's own local data. If it throws, the journal stays open and retries. */
|
|
266
|
+
export type ResetHandler = (context: ResetHandlerContext) => Promise<void> | void;
|
|
267
|
+
export type WipeRequest = {
|
|
268
|
+
accountId: string | null;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Why the SDK wants the app restarted.
|
|
272
|
+
*
|
|
273
|
+
* One value today, because that is the only case the SDK reports: policy arrived for the
|
|
274
|
+
* first time. Typed as a union rather than `string` so a consumer can switch on it, with
|
|
275
|
+
* `unknown` for a value a future SDK adds — an unrecognised reason must not break a
|
|
276
|
+
* shipped app, and a restart is still a restart.
|
|
277
|
+
*/
|
|
278
|
+
export type RestartReason = 'policyAppliedFirstTime' | 'unknown';
|
|
279
|
+
export type RestartRequest = {
|
|
280
|
+
reason: RestartReason;
|
|
281
|
+
};
|
|
282
|
+
/** Event names and their payloads, used to type the emitter in `index.ts`. */
|
|
283
|
+
export type IntuneEvents = {
|
|
284
|
+
enrollmentResult: EnrollmentResult;
|
|
285
|
+
policyChanged: PolicySnapshot;
|
|
286
|
+
unenrollmentResult: EnrollmentResult;
|
|
287
|
+
wipeRequested: WipeRequest;
|
|
288
|
+
restartRequired: RestartRequest;
|
|
289
|
+
tokenRequest: TokenRequest & {
|
|
290
|
+
requestId: string;
|
|
291
|
+
};
|
|
292
|
+
brokerStatusChanged: BrokerStatus;
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Stable rejection codes. A non-success enrollment *status* is data and resolves; these
|
|
296
|
+
* mean the caller did something wrong or the environment is broken. See SPEC §13.6.
|
|
297
|
+
*
|
|
298
|
+
* `E_NATIVE` appearing in logs is a signal to extend the native mapping table, not an
|
|
299
|
+
* acceptable steady state.
|
|
300
|
+
*/
|
|
301
|
+
export type IntuneErrorCode = 'E_NOT_CONFIGURED' | 'E_RESET_REQUIRED' | 'E_SDK_UNAVAILABLE' | 'E_BROKER_MISSING' | 'E_INVALID_ACCOUNT_ID' | 'E_TOKEN_PROVIDER_FAILED' | 'E_TOKEN_PROVIDER_MISSING' | 'E_EXTERNAL_AUTH_MODE' | 'E_INTERACTION_REQUIRED' | 'E_NO_ACTIVITY' | 'E_USER_CANCELLED' | 'E_RESET_IN_PROGRESS' | 'E_ALREADY_ENROLLED' | 'E_NOT_NEEDED'
|
|
302
|
+
/**
|
|
303
|
+
* `configure()` disagrees with the host app's Info.plist. iOS only. Raised for a
|
|
304
|
+
* hardcoded `ADAL*` identity key next to a runtime override (the known cause of
|
|
305
|
+
* enrollment failing with `AuthRequired`), or for a `keychainGroupOverride` /
|
|
306
|
+
* `maxFileProtectionLevel` that the plist does not match — neither of those two has a
|
|
307
|
+
* runtime setter, so the module can only refuse to let them disagree.
|
|
308
|
+
*/
|
|
309
|
+
| 'E_PLIST_CONFLICT'
|
|
310
|
+
/**
|
|
311
|
+
* Android only. `MAMEnrollmentManager.registerAccountForMAM` requires the account's
|
|
312
|
+
* UPN as well as its object ID, and nothing can supply it until the module's own MSAL
|
|
313
|
+
* sign-in lands (SPEC §3, spike S-3). iOS is unaffected —
|
|
314
|
+
* `registerAndEnrollAccountId:` takes the object ID alone.
|
|
315
|
+
*/
|
|
316
|
+
| 'E_UPN_REQUIRED' | 'E_NATIVE';
|
|
317
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;GAOG;AACH,oBAAY,gBAAgB;IAC1B,SAAS,cAAc;IACvB,gFAAgF;IAChF,WAAW,gBAAgB;IAC3B,+EAA+E;IAC/E,WAAW,gBAAgB;IAC3B,yEAAyE;IACzE,MAAM,WAAW;IACjB,6FAA6F;IAC7F,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;IAC3C,mFAAmF;IACnF,qBAAqB,0BAA0B;IAC/C,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,kBAAkB,uBAAuB;IACzC;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED,yDAAyD;AACzD,oBAAY,UAAU;IACpB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;CAChC;AAED;;;;GAIG;AACH,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,oCAAoC,yCAAyC;IAC7E,IAAI,SAAS;CACd;AAED,yFAAyF;AACzF,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,QAAQ,CAAC;AAEb;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAA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AAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-intune",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Microsoft Intune app protection policies (MAM) for React Native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"react-native-intune-source": "./src/index.ts",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"lib",
|
|
19
|
+
"android",
|
|
20
|
+
"ios",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"app.plugin.js",
|
|
23
|
+
"plugin",
|
|
24
|
+
"scripts",
|
|
25
|
+
"sdk-versions.json",
|
|
26
|
+
"sdk-lock.json",
|
|
27
|
+
"!vendor",
|
|
28
|
+
"!ios/build",
|
|
29
|
+
"!ios/generated",
|
|
30
|
+
"!android/build",
|
|
31
|
+
"!android/generated",
|
|
32
|
+
"!android/gradle",
|
|
33
|
+
"!android/gradlew",
|
|
34
|
+
"!android/gradlew.bat",
|
|
35
|
+
"!android/local.properties",
|
|
36
|
+
"!**/__tests__",
|
|
37
|
+
"!**/__fixtures__",
|
|
38
|
+
"!**/__mocks__",
|
|
39
|
+
"!**/.*",
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"NOTICE",
|
|
42
|
+
"!website"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"fetch-sdks": "node scripts/fetch-sdks.mjs",
|
|
46
|
+
"postinstall": "node scripts/fetch-sdks.mjs --soft --quiet",
|
|
47
|
+
"example": "yarn workspace react-native-intune-example",
|
|
48
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
49
|
+
"prepare": "bob build",
|
|
50
|
+
"typecheck": "yarn workspace react-native-intune-example ensure-tenant && tsc",
|
|
51
|
+
"test": "jest",
|
|
52
|
+
"release": "release-it --only-version",
|
|
53
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\""
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"react-native",
|
|
57
|
+
"ios",
|
|
58
|
+
"android"
|
|
59
|
+
],
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/bayazetyan/react-native-intune.git"
|
|
63
|
+
},
|
|
64
|
+
"author": "Artashes Bayazetyan <bayazetyan@gmail.com> (https://github.com/bayazetyan/react-native-intune)",
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/bayazetyan/react-native-intune/issues"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://github.com/bayazetyan/react-native-intune#readme",
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"registry": "https://registry.npmjs.org/"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
75
|
+
"@eslint/compat": "^2.1.0",
|
|
76
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
77
|
+
"@eslint/js": "^10.0.1",
|
|
78
|
+
"@jest/globals": "^29.7.0",
|
|
79
|
+
"@react-native/babel-preset": "0.85.0",
|
|
80
|
+
"@react-native/eslint-config": "0.85.0",
|
|
81
|
+
"@react-native/jest-preset": "0.85.0",
|
|
82
|
+
"@release-it/conventional-changelog": "^11.0.1",
|
|
83
|
+
"@types/react": "^19.2.0",
|
|
84
|
+
"commitlint": "^21.0.2",
|
|
85
|
+
"del-cli": "^7.0.0",
|
|
86
|
+
"eslint": "^9.39.4",
|
|
87
|
+
"eslint-config-prettier": "^10.1.8",
|
|
88
|
+
"eslint-plugin-ft-flow": "^3.0.11",
|
|
89
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
90
|
+
"jest": "^29.7.0",
|
|
91
|
+
"lefthook": "^2.1.9",
|
|
92
|
+
"prettier": "^3.8.3",
|
|
93
|
+
"react": "19.2.3",
|
|
94
|
+
"react-native": "0.85.0",
|
|
95
|
+
"react-native-builder-bob": "^0.43.0",
|
|
96
|
+
"release-it": "^20.2.0",
|
|
97
|
+
"turbo": "^2.9.16",
|
|
98
|
+
"typescript": "^6.0.3"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@expo/config-plugins": ">=7",
|
|
102
|
+
"react": "*",
|
|
103
|
+
"react-native": "*"
|
|
104
|
+
},
|
|
105
|
+
"workspaces": [
|
|
106
|
+
"example",
|
|
107
|
+
"website"
|
|
108
|
+
],
|
|
109
|
+
"packageManager": "yarn@4.11.0",
|
|
110
|
+
"react-native-builder-bob": {
|
|
111
|
+
"source": "src",
|
|
112
|
+
"output": "lib",
|
|
113
|
+
"targets": [
|
|
114
|
+
[
|
|
115
|
+
"module",
|
|
116
|
+
{
|
|
117
|
+
"esm": true
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
"typescript",
|
|
122
|
+
{
|
|
123
|
+
"project": "tsconfig.build.json"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"codegenConfig": {
|
|
129
|
+
"name": "RNIntuneSpec",
|
|
130
|
+
"type": "modules",
|
|
131
|
+
"jsSrcsDir": "src",
|
|
132
|
+
"android": {
|
|
133
|
+
"javaPackageName": "com.reactnativeintune"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"jest": {
|
|
137
|
+
"preset": "@react-native/jest-preset",
|
|
138
|
+
"testEnvironmentOptions": {
|
|
139
|
+
"customExportConditions": [
|
|
140
|
+
"require",
|
|
141
|
+
"react-native",
|
|
142
|
+
"<%- project.sourceCondition -%>"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"modulePathIgnorePatterns": [
|
|
146
|
+
"<rootDir>/example/node_modules",
|
|
147
|
+
"<rootDir>/lib/"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"commitlint": {
|
|
151
|
+
"extends": [
|
|
152
|
+
"@commitlint/config-conventional"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"release-it": {
|
|
156
|
+
"git": {
|
|
157
|
+
"commitMessage": "chore: release ${version}",
|
|
158
|
+
"tagName": "v${version}"
|
|
159
|
+
},
|
|
160
|
+
"npm": {
|
|
161
|
+
"publish": false
|
|
162
|
+
},
|
|
163
|
+
"github": {
|
|
164
|
+
"release": true
|
|
165
|
+
},
|
|
166
|
+
"plugins": {
|
|
167
|
+
"@release-it/conventional-changelog": {
|
|
168
|
+
"preset": {
|
|
169
|
+
"name": "angular"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"_comment": "npm.publish is false on purpose: release-it prepares the release — version, changelog, commit, tag, GitHub release — and .github/workflows/publish.yml does the publishing when the tag lands. A release should not be able to come from a laptop with whatever happened to be in its working tree."
|
|
174
|
+
},
|
|
175
|
+
"prettier": {
|
|
176
|
+
"quoteProps": "consistent",
|
|
177
|
+
"singleQuote": true,
|
|
178
|
+
"tabWidth": 2,
|
|
179
|
+
"trailingComma": "es5",
|
|
180
|
+
"useTabs": false
|
|
181
|
+
},
|
|
182
|
+
"create-react-native-library": {
|
|
183
|
+
"type": "turbo-module",
|
|
184
|
+
"languages": "kotlin-objc",
|
|
185
|
+
"tools": [
|
|
186
|
+
"jest",
|
|
187
|
+
"lefthook",
|
|
188
|
+
"release-it",
|
|
189
|
+
"eslint"
|
|
190
|
+
],
|
|
191
|
+
"version": "0.63.0"
|
|
192
|
+
},
|
|
193
|
+
"bin": {
|
|
194
|
+
"react-native-intune": "scripts/cli.mjs"
|
|
195
|
+
},
|
|
196
|
+
"engines": {
|
|
197
|
+
"node": ">=18"
|
|
198
|
+
},
|
|
199
|
+
"peerDependenciesMeta": {
|
|
200
|
+
"@expo/config-plugins": {
|
|
201
|
+
"optional": true
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|