@latchway/react-native 0.0.0-bootstrap.0 → 1.0.0
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/CHANGELOG.md +97 -0
- package/LatchwayReactNative.podspec +33 -0
- package/NOTICE +7 -0
- package/README.md +286 -3
- package/SECURITY.md +69 -0
- package/android/build.gradle.kts +62 -0
- package/android/consumer-rules.pro +2 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +9 -0
- package/android/gradle.properties +4 -0
- package/android/gradlew +251 -0
- package/android/gradlew.bat +94 -0
- package/android/settings.gradle.kts +33 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/dev/latchway/reactnative/LatchwayReactNativePackage.kt +25 -0
- package/android/src/main/java/dev/latchway/reactnative/NativeLatchwayModule.kt +964 -0
- package/android/src/test/java/dev/latchway/reactnative/NativeLatchwayModuleTest.kt +521 -0
- package/contract.lock +7 -0
- package/docs/architecture.md +145 -0
- package/docs/conformance.md +68 -0
- package/docs/native-installation.md +172 -0
- package/docs/physical-device-evidence.md +559 -0
- package/docs/releasing.md +360 -0
- package/docs/security.md +55 -0
- package/ios/LatchwayNativeBridge.swift +1551 -0
- package/ios/RCTNativeLatchway.h +9 -0
- package/ios/RCTNativeLatchway.mm +175 -0
- package/lib/client.d.ts +29 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +939 -0
- package/lib/client.js.map +1 -0
- package/lib/component-client.d.ts +15 -0
- package/lib/component-client.d.ts.map +1 -0
- package/lib/component-client.js +141 -0
- package/lib/component-client.js.map +1 -0
- package/lib/config.d.ts +25 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +261 -0
- package/lib/config.js.map +1 -0
- package/lib/coordinator.d.ts +19 -0
- package/lib/coordinator.d.ts.map +1 -0
- package/lib/coordinator.js +167 -0
- package/lib/coordinator.js.map +1 -0
- package/lib/errors.d.ts +5 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +201 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -0
- package/lib/native/NativeLatchway.d.ts +25 -0
- package/lib/native/NativeLatchway.d.ts.map +1 -0
- package/lib/native/NativeLatchway.js +3 -0
- package/lib/native/NativeLatchway.js.map +1 -0
- package/lib/native/bridge.d.ts +5 -0
- package/lib/native/bridge.d.ts.map +1 -0
- package/lib/native/bridge.js +17 -0
- package/lib/native/bridge.js.map +1 -0
- package/lib/native-output.d.ts +3 -0
- package/lib/native-output.d.ts.map +1 -0
- package/lib/native-output.js +43 -0
- package/lib/native-output.js.map +1 -0
- package/lib/request-id.d.ts +2 -0
- package/lib/request-id.d.ts.map +1 -0
- package/lib/request-id.js +5 -0
- package/lib/request-id.js.map +1 -0
- package/lib/testing.d.ts +7 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +9 -0
- package/lib/testing.js.map +1 -0
- package/lib/types.d.ts +200 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/version.d.ts +8 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +8 -0
- package/lib/version.js.map +1 -0
- package/package.json +130 -6
- package/react-native.config.cjs +7 -0
- package/release-compatibility.json +64 -0
- package/src/client.ts +1022 -0
- package/src/component-client.ts +158 -0
- package/src/config.ts +368 -0
- package/src/coordinator.ts +195 -0
- package/src/errors.ts +225 -0
- package/src/index.ts +53 -0
- package/src/native/NativeLatchway.ts +75 -0
- package/src/native/bridge.ts +23 -0
- package/src/native-output.ts +43 -0
- package/src/request-id.ts +5 -0
- package/src/testing.ts +11 -0
- package/src/types.ts +241 -0
- package/src/version.ts +7 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { LatchwayError } from "@latchway/client";
|
|
2
|
+
export type ReactNativePlatform = "react_native_ios" | "react_native_android";
|
|
3
|
+
export interface IdentityTokenProvider {
|
|
4
|
+
getIdentityToken(): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export type GetIdentityToken = () => Promise<string>;
|
|
7
|
+
export type AppleSoftwareKeyFallbackPolicy = "disallow" | "allow";
|
|
8
|
+
export type AndroidKeyPolicy = "hardware_backed_required" | "strongbox_preferred" | "software_allowed";
|
|
9
|
+
export interface AppleSecurityOptions {
|
|
10
|
+
/** Fully resolved private app-ID Keychain group; required on iOS and first in the signed root app. */
|
|
11
|
+
rootKeychainAccessGroup: string;
|
|
12
|
+
/** Every explicit extension-shared group, scanned at exact root coordinates but never mutated. */
|
|
13
|
+
legacySharedKeychainAccessGroups?: readonly string[];
|
|
14
|
+
/** App Attest is enabled by default. Disabling it fails closed unless the server accepts another provider. */
|
|
15
|
+
appAttestEnabled?: boolean;
|
|
16
|
+
/** A non-secret namespace for caller-managed App Attest accepted-key state. */
|
|
17
|
+
storageNamespace?: string;
|
|
18
|
+
softwareKeyFallbackPolicy?: AppleSoftwareKeyFallbackPolicy;
|
|
19
|
+
}
|
|
20
|
+
export interface AndroidSecurityOptions {
|
|
21
|
+
/** Google Cloud project number used by Play Integrity standard requests. */
|
|
22
|
+
playIntegrityCloudProjectNumber?: string;
|
|
23
|
+
keyPolicy?: AndroidKeyPolicy;
|
|
24
|
+
}
|
|
25
|
+
export type LatchwayFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
26
|
+
/** @deprecated Use `LatchwayFetch`; JavaScript fetch injection is no longer a client option. */
|
|
27
|
+
export type FetchImplementation = LatchwayFetch;
|
|
28
|
+
export interface LatchwayOptions {
|
|
29
|
+
baseURL: string;
|
|
30
|
+
applicationID: string;
|
|
31
|
+
environment: string;
|
|
32
|
+
/** Supplied transiently to native operations; native consumes it only when session work needs identity. */
|
|
33
|
+
getIdentityToken?: GetIdentityToken;
|
|
34
|
+
identityTokenProvider?: IdentityTokenProvider;
|
|
35
|
+
identityProvider?: string;
|
|
36
|
+
appVersion?: string;
|
|
37
|
+
apple?: AppleSecurityOptions;
|
|
38
|
+
android?: AndroidSecurityOptions;
|
|
39
|
+
/** Limited to loopback HTTP origins for local conformance. */
|
|
40
|
+
allowInsecureLoopback?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface LatchwayFetchInit extends RequestInit {
|
|
43
|
+
latchwayFeature?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface QuotaLimit {
|
|
46
|
+
metric: string;
|
|
47
|
+
maximum?: number;
|
|
48
|
+
used?: number;
|
|
49
|
+
reserved?: number;
|
|
50
|
+
remaining?: number;
|
|
51
|
+
resets_at?: string;
|
|
52
|
+
hard: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface QuotaSnapshot {
|
|
55
|
+
feature: string;
|
|
56
|
+
observed_at: string;
|
|
57
|
+
limits: QuotaLimit[];
|
|
58
|
+
}
|
|
59
|
+
export interface ReactNativeDiagnostics {
|
|
60
|
+
sdkVersion: string;
|
|
61
|
+
nativeSDKVersion: string;
|
|
62
|
+
contractVersion: "1.0.0";
|
|
63
|
+
protocolVersion: 2;
|
|
64
|
+
platform: ReactNativePlatform;
|
|
65
|
+
keyStorage: string;
|
|
66
|
+
attestation: {
|
|
67
|
+
support: "supported" | "unsupported" | "unknown";
|
|
68
|
+
/** Provider bound to the currently accepted native session grant. */
|
|
69
|
+
provider?: string;
|
|
70
|
+
/** Trust level bound to the currently accepted native session grant. */
|
|
71
|
+
trustLevel?: string;
|
|
72
|
+
lastOperation?: string;
|
|
73
|
+
};
|
|
74
|
+
session: {
|
|
75
|
+
state: "absent" | "establishing" | "active" | "refreshing" | "expired" | "revoked" | "failed";
|
|
76
|
+
expiresAt?: string;
|
|
77
|
+
refreshAvailable?: boolean;
|
|
78
|
+
};
|
|
79
|
+
installation: {
|
|
80
|
+
id?: string;
|
|
81
|
+
status?: string;
|
|
82
|
+
};
|
|
83
|
+
server: {
|
|
84
|
+
version?: string;
|
|
85
|
+
lastRequestID?: string;
|
|
86
|
+
};
|
|
87
|
+
lastErrorCode?: string;
|
|
88
|
+
}
|
|
89
|
+
/** Native iOS execution boundaries that can hold delegated component sessions. */
|
|
90
|
+
export type ReactNativeIOSComponentKind = "widget" | "share_extension" | "app_intent_extension" | "notification_service_extension" | "action_extension" | "sso_extension";
|
|
91
|
+
/**
|
|
92
|
+
* Public, non-secret descriptor used by the containing application to prepare
|
|
93
|
+
* and retire one independently keyed native iOS component.
|
|
94
|
+
*/
|
|
95
|
+
export interface ReactNativeIOSComponent {
|
|
96
|
+
definitionID: string;
|
|
97
|
+
kind: ReactNativeIOSComponentKind;
|
|
98
|
+
keychainAccessGroup: string;
|
|
99
|
+
requestedFeatures: readonly string[];
|
|
100
|
+
}
|
|
101
|
+
/** iOS component kinds retained for delegated-session protocol compatibility. */
|
|
102
|
+
export type ReactNativeDirectAttestationComponentKind = "action_extension" | "sso_extension";
|
|
103
|
+
/**
|
|
104
|
+
* Public, non-secret descriptor for one independently keyed iOS component.
|
|
105
|
+
*
|
|
106
|
+
* `keychainAccessGroup` must be the fully resolved access group present in the
|
|
107
|
+
* signed entitlements of both the containing application and the component.
|
|
108
|
+
*/
|
|
109
|
+
export interface ReactNativeDirectAttestationComponent {
|
|
110
|
+
definitionID: string;
|
|
111
|
+
kind: ReactNativeDirectAttestationComponentKind;
|
|
112
|
+
keychainAccessGroup: string;
|
|
113
|
+
requestedFeatures: readonly string[];
|
|
114
|
+
}
|
|
115
|
+
export interface ReactNativeComponentAppleOptions {
|
|
116
|
+
/** The containing application's fully resolved private root Keychain group. */
|
|
117
|
+
rootKeychainAccessGroup: string;
|
|
118
|
+
/** Shared groups scanned for legacy root state; must include this component's exact group. */
|
|
119
|
+
legacySharedKeychainAccessGroups: readonly string[];
|
|
120
|
+
/** A non-secret namespace retained for component state compatibility. */
|
|
121
|
+
storageNamespace?: string;
|
|
122
|
+
softwareKeyFallbackPolicy?: AppleSoftwareKeyFallbackPolicy;
|
|
123
|
+
}
|
|
124
|
+
/** Configuration for JavaScript executing inside the signed iOS extension bundle. */
|
|
125
|
+
export interface LatchwayComponentOptions {
|
|
126
|
+
baseURL: string;
|
|
127
|
+
applicationID: string;
|
|
128
|
+
environment: string;
|
|
129
|
+
component: ReactNativeDirectAttestationComponent;
|
|
130
|
+
appVersion?: string;
|
|
131
|
+
apple: ReactNativeComponentAppleOptions;
|
|
132
|
+
/** Limited to loopback HTTP origins for local conformance. */
|
|
133
|
+
allowInsecureLoopback?: boolean;
|
|
134
|
+
}
|
|
135
|
+
export type ReactNativeComponentTrustSource = "direct_attested" | "delegated_from_attested_root" | "delegated_identity_only" | "delegated_direct_attested" | "identity_only" | "web_risk_verified" | "debug";
|
|
136
|
+
/** Redacted native state for one independently keyed component. */
|
|
137
|
+
export interface ReactNativeComponentDiagnostics {
|
|
138
|
+
familyID?: string;
|
|
139
|
+
componentID?: string;
|
|
140
|
+
definitionID: string;
|
|
141
|
+
keychainAccessGroup: string;
|
|
142
|
+
keyAvailable: boolean;
|
|
143
|
+
keyStorage: string;
|
|
144
|
+
grantAvailable: boolean;
|
|
145
|
+
sessionAvailable: boolean;
|
|
146
|
+
trustSource?: ReactNativeComponentTrustSource;
|
|
147
|
+
trustExpiresAt?: string;
|
|
148
|
+
containingAppActionRequired: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* A component-scoped client for React Native JavaScript executing inside an
|
|
152
|
+
* iOS extension process. It has no root identity or containing-app API.
|
|
153
|
+
*/
|
|
154
|
+
export interface LatchwayComponentClient {
|
|
155
|
+
readonly ready: Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Retained for API compatibility. iOS application extensions cannot call
|
|
158
|
+
* the platform App Attest key-generation API, so this fails closed with
|
|
159
|
+
* `attestation_unsupported`; use independently keyed delegated sessions.
|
|
160
|
+
*/
|
|
161
|
+
establishDirectAttestation(): Promise<void>;
|
|
162
|
+
diagnostics(): Promise<ReactNativeComponentDiagnostics>;
|
|
163
|
+
dispose(): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
export interface LatchwayClient {
|
|
166
|
+
/** Canonical gateway origin for framework clients that require an explicit base URL. */
|
|
167
|
+
readonly gatewayURL: string;
|
|
168
|
+
/** Resolves after the native runtime proves contract compatibility. */
|
|
169
|
+
readonly ready: Promise<void>;
|
|
170
|
+
fetch(input: RequestInfo | URL, init?: LatchwayFetchInit): Promise<Response>;
|
|
171
|
+
/** Returns a WHATWG fetch-shaped function permanently bound to one Latchway feature. */
|
|
172
|
+
fetchFor(feature: string): LatchwayFetch;
|
|
173
|
+
quota(feature: string): Promise<QuotaSnapshot>;
|
|
174
|
+
diagnostics(): Promise<ReactNativeDiagnostics>;
|
|
175
|
+
/** Explicitly rotates the native session credentials for this installation. */
|
|
176
|
+
refresh(): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Creates or restores independent native iOS component keys and delegated
|
|
179
|
+
* provisioning grants. Descriptor fields are public; credentials remain native.
|
|
180
|
+
*/
|
|
181
|
+
prepareComponents(components: readonly ReactNativeIOSComponent[]): Promise<ReactNativeComponentDiagnostics[]>;
|
|
182
|
+
/** Replaces one component key and its delegated provisioning grant. */
|
|
183
|
+
replaceComponent(component: ReactNativeIOSComponent): Promise<ReactNativeComponentDiagnostics>;
|
|
184
|
+
/** Reads redacted local state for one descriptor without using root identity. */
|
|
185
|
+
componentDiagnostics(component: ReactNativeIOSComponent): Promise<ReactNativeComponentDiagnostics>;
|
|
186
|
+
/** Revokes and erases one native iOS component without affecting its siblings. */
|
|
187
|
+
revokeComponent(component: ReactNativeIOSComponent): Promise<void>;
|
|
188
|
+
/** Revokes this installation while leaving independently provisioned family components addressable. */
|
|
189
|
+
revokeCurrentInstallation(): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* Revokes the complete Installation Family and retires the root plus every
|
|
192
|
+
* native-registered component, including registrations from earlier app
|
|
193
|
+
* launches. `retiring` remains available for pre-registry legacy state.
|
|
194
|
+
*/
|
|
195
|
+
revokeCurrentInstallationFamily(retiring?: readonly ReactNativeIOSComponent[]): Promise<void>;
|
|
196
|
+
/** Releases this JavaScript instance. Secure installation state remains until revocation. */
|
|
197
|
+
dispose(): Promise<void>;
|
|
198
|
+
}
|
|
199
|
+
export type { LatchwayError };
|
|
200
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACrC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,MAAM,8BAA8B,GAAG,UAAU,GAAG,OAAO,CAAC;AAElE,MAAM,MAAM,gBAAgB,GACxB,0BAA0B,GAC1B,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,sGAAsG;IACtG,uBAAuB,EAAE,MAAM,CAAC;IAChC,kGAAkG;IAClG,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrD,8GAA8G;IAC9G,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,8BAA8B,CAAC;CAC5D;AAED,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KA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6F;IAC7F,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/lib/version.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0";
|
|
2
|
+
export declare const CONTRACT_VERSION = "1.0.0";
|
|
3
|
+
export declare const PROTOCOL_VERSION = 2;
|
|
4
|
+
export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly [1, 2];
|
|
5
|
+
export declare const SDK_KIND = "react-native";
|
|
6
|
+
export declare const REACT_NATIVE_FRAMEWORK_ID = "react-native-fetch";
|
|
7
|
+
export declare const REACT_NATIVE_FRAMEWORK_VERSION = "0.82.0";
|
|
8
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,2BAA2B,iBAAgD,CAAC;AACzF,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAC9D,eAAO,MAAM,8BAA8B,WAAW,CAAC"}
|
package/lib/version.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const SDK_VERSION = "1.0.0";
|
|
2
|
+
export const CONTRACT_VERSION = "1.0.0";
|
|
3
|
+
export const PROTOCOL_VERSION = 2;
|
|
4
|
+
export const SUPPORTED_PROTOCOL_VERSIONS = Object.freeze([1, PROTOCOL_VERSION]);
|
|
5
|
+
export const SDK_KIND = "react-native";
|
|
6
|
+
export const REACT_NATIVE_FRAMEWORK_ID = "react-native-fetch";
|
|
7
|
+
export const REACT_NATIVE_FRAMEWORK_VERSION = "0.82.0";
|
|
8
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AACnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAU,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,143 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latchway/react-native",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Hardware-backed React Native client for the Latchway AI gateway",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./lib/index.js",
|
|
8
|
+
"module": "./lib/index.js",
|
|
9
|
+
"types": "./lib/index.d.ts",
|
|
10
|
+
"react-native": "./src/index.ts",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=24.19.0",
|
|
14
|
+
"pnpm": "10.15.0"
|
|
15
|
+
},
|
|
6
16
|
"files": [
|
|
17
|
+
"android/src",
|
|
18
|
+
"android/build.gradle.kts",
|
|
19
|
+
"android/consumer-rules.pro",
|
|
20
|
+
"android/gradle.properties",
|
|
21
|
+
"android/gradle/wrapper/gradle-wrapper.jar",
|
|
22
|
+
"android/gradle/wrapper/gradle-wrapper.properties",
|
|
23
|
+
"android/gradlew",
|
|
24
|
+
"android/gradlew.bat",
|
|
25
|
+
"android/settings.gradle.kts",
|
|
26
|
+
"docs",
|
|
27
|
+
"ios",
|
|
28
|
+
"lib",
|
|
29
|
+
"src",
|
|
30
|
+
"CHANGELOG.md",
|
|
7
31
|
"LICENSE",
|
|
8
|
-
"
|
|
32
|
+
"NOTICE",
|
|
33
|
+
"README.md",
|
|
34
|
+
"SECURITY.md",
|
|
35
|
+
"LatchwayReactNative.podspec",
|
|
36
|
+
"contract.lock",
|
|
37
|
+
"release-compatibility.json",
|
|
38
|
+
"react-native.config.cjs"
|
|
9
39
|
],
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./lib/index.d.ts",
|
|
43
|
+
"react-native": "./src/index.ts",
|
|
44
|
+
"import": "./lib/index.js",
|
|
45
|
+
"default": "./lib/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./testing": {
|
|
48
|
+
"types": "./lib/testing.d.ts",
|
|
49
|
+
"import": "./lib/testing.js",
|
|
50
|
+
"default": "./lib/testing.js"
|
|
51
|
+
},
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@latchway/client": "1.0.0",
|
|
56
|
+
"web-streams-polyfill": "4.3.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"react": "19.1.x",
|
|
60
|
+
"react-native": "0.82.x"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@ai-sdk/anthropic": "4.0.46",
|
|
64
|
+
"@ai-sdk/openai": "4.0.52",
|
|
65
|
+
"@eslint/js": "10.0.1",
|
|
66
|
+
"@langchain/core": "1.2.9",
|
|
67
|
+
"@langchain/openai": "1.5.10",
|
|
68
|
+
"@react-native/codegen": "0.82.0",
|
|
69
|
+
"@react-native/gradle-plugin": "0.82.0",
|
|
70
|
+
"@types/node": "24.13.3",
|
|
71
|
+
"@types/react": "19.2.18",
|
|
72
|
+
"ai": "7.0.85",
|
|
73
|
+
"eslint": "10.9.1",
|
|
74
|
+
"globals": "17.11.0",
|
|
75
|
+
"openai": "7.8.0",
|
|
76
|
+
"react": "19.1.1",
|
|
77
|
+
"react-native": "0.82.0",
|
|
78
|
+
"typescript": "6.0.3",
|
|
79
|
+
"typescript-eslint": "8.68.0",
|
|
80
|
+
"vitest": "4.1.11",
|
|
81
|
+
"zod": "4.5.4"
|
|
82
|
+
},
|
|
83
|
+
"codegenConfig": {
|
|
84
|
+
"name": "LatchwayReactNativeSpec",
|
|
85
|
+
"type": "modules",
|
|
86
|
+
"jsSrcsDir": "src/native",
|
|
87
|
+
"android": {
|
|
88
|
+
"javaPackageName": "dev.latchway.reactnative"
|
|
89
|
+
},
|
|
90
|
+
"ios": {
|
|
91
|
+
"modules": {
|
|
92
|
+
"NativeLatchway": {
|
|
93
|
+
"className": "RCTNativeLatchway",
|
|
94
|
+
"unstableRequiresMainQueueSetup": false
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
10
99
|
"repository": {
|
|
11
100
|
"type": "git",
|
|
12
101
|
"url": "git+https://github.com/Latchway/latchway-react-native-sdk.git"
|
|
13
102
|
},
|
|
103
|
+
"bugs": {
|
|
104
|
+
"url": "https://github.com/Latchway/latchway-react-native-sdk/issues"
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://github.com/Latchway/latchway-react-native-sdk#readme",
|
|
14
107
|
"publishConfig": {
|
|
15
108
|
"access": "public",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
109
|
+
"provenance": true,
|
|
110
|
+
"registry": "https://registry.npmjs.org/"
|
|
111
|
+
},
|
|
112
|
+
"keywords": [
|
|
113
|
+
"attestation",
|
|
114
|
+
"dpop",
|
|
115
|
+
"react-native",
|
|
116
|
+
"turbomodule"
|
|
117
|
+
],
|
|
118
|
+
"scripts": {
|
|
119
|
+
"build": "node scripts/clean.mjs && tsc -p tsconfig.build.json",
|
|
120
|
+
"check": "pnpm verify:contracts && pnpm verify:compatibility && pnpm lint && pnpm typecheck && pnpm test && pnpm codegen:check && pnpm build && pnpm example:check && pnpm example:bundle:check && pnpm native:boundary",
|
|
121
|
+
"codegen:check": "node scripts/verify-codegen.mjs",
|
|
122
|
+
"docs:bundle": "python3 scripts/build_docs_bundle.py",
|
|
123
|
+
"example:check": "tsc -p tsconfig.example.json --noEmit",
|
|
124
|
+
"example:bundle:check": "node scripts/verify-example-bundles.mjs",
|
|
125
|
+
"lint": "eslint . --max-warnings=0",
|
|
126
|
+
"ios:spec": "pod ipc spec LatchwayReactNative.podspec >/dev/null",
|
|
127
|
+
"native:android:conformance": "android/gradlew -p android testDebugUnitTest --tests '*NativeLatchwayModuleTest*' --no-daemon",
|
|
128
|
+
"native:boundary": "node scripts/verify-native-boundary.mjs",
|
|
129
|
+
"native:ios:conformance": "swift test --filter LatchwayNativeBridgeConformanceTests",
|
|
130
|
+
"pack:check": "node scripts/verify-pack.mjs",
|
|
131
|
+
"release:preflight": "node scripts/release-preflight.mjs",
|
|
132
|
+
"release:publish": "node scripts/publish-or-verify.mjs",
|
|
133
|
+
"security:dependencies": "bash scripts/scan-dependencies.sh \"$(git rev-parse HEAD)\"",
|
|
134
|
+
"consumer:check": "node scripts/verify-consumer.mjs",
|
|
135
|
+
"test": "vitest run && node --test scripts/test-npm-release-evidence.mjs scripts/test-android-release-evidence.mjs scripts/test-ci-lock-output.mjs scripts/test-package-archive.mjs && python3 -m unittest scripts/test_build_docs_bundle.py scripts/test_maintainer_release.py scripts/test_public_core_release.py && python3 scripts/test-dependency-vulnerability-scan.py",
|
|
136
|
+
"test:watch": "vitest",
|
|
137
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
138
|
+
"verify:bundle": "node scripts/verify-contract-bundle.mjs",
|
|
139
|
+
"verify:compatibility": "node scripts/verify-compatibility.mjs",
|
|
140
|
+
"verify:contracts": "node scripts/verify-contract.mjs",
|
|
141
|
+
"verify:reproducible": "node scripts/verify-reproducible.mjs"
|
|
18
142
|
}
|
|
19
|
-
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"schema_version": 1,
|
|
4
|
+
"contract": {
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"wire_protocol": 2,
|
|
7
|
+
"repository": "https://github.com/Latchway/latchway.git",
|
|
8
|
+
"core_commit": "d260e3d7485e9e1487b5e03922b79c7089d94ce2",
|
|
9
|
+
"bundle_sha256": "4866aec1ff70e78d70f07847448161c2b59970fe102d95393b051444536d29a4",
|
|
10
|
+
"fixtures": {
|
|
11
|
+
"attestation-binding-v1.json": "aaadef1172dffc3e600029e03259ff636a969cd4f925544fdccfb2c704b03659",
|
|
12
|
+
"component-attestation-binding-v2.json": "8411308998cdffccf286892b94a6c759cbcf63b92e4727144d3a755dcd7c13d4",
|
|
13
|
+
"dpop-v1.json": "b639e22dcd1c1a18e1292a044d96ec043c3be1e0271aacd6904bca39253bc5d4",
|
|
14
|
+
"installation-family-v2.json": "7ea657c5ca1de6d0ab1507b6187a1a6920fcf7486a6c6da178727df0efc5257d",
|
|
15
|
+
"protocol-version.json": "4a6cf9f271bc9e83648eacf05f250f8fab24fc215d292a5a721148578f7372b1"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"react_native": {
|
|
19
|
+
"package": "@latchway/react-native",
|
|
20
|
+
"version": "1.0.0",
|
|
21
|
+
"baseline": "0.82.0",
|
|
22
|
+
"cli": "20.0.0",
|
|
23
|
+
"react": "19.1.1",
|
|
24
|
+
"react_peer": "19.1.x",
|
|
25
|
+
"new_architecture": true,
|
|
26
|
+
"node_linker": "hoisted",
|
|
27
|
+
"firebase": {
|
|
28
|
+
"react_native": "25.1.0",
|
|
29
|
+
"apple_sdk": "12.15.0",
|
|
30
|
+
"android_bom": "34.15.0"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"javascript": {
|
|
34
|
+
"package": "@latchway/client",
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"repository": "https://github.com/Latchway/latchway-js.git",
|
|
37
|
+
"source_commit": "6705a35478c99a7fb70c53e467fec6d0c3141ea0"
|
|
38
|
+
},
|
|
39
|
+
"ios": {
|
|
40
|
+
"pod": "Latchway/AppAttest",
|
|
41
|
+
"version": "1.0.0",
|
|
42
|
+
"repository": "https://github.com/Latchway/latchway-ios-sdk.git",
|
|
43
|
+
"source_commit": "b5104113158fda509e244631eb4939acf45157a3",
|
|
44
|
+
"minimum_platform": "15.0"
|
|
45
|
+
},
|
|
46
|
+
"android": {
|
|
47
|
+
"group": "dev.latchway",
|
|
48
|
+
"artifacts": [
|
|
49
|
+
"latchway-okhttp",
|
|
50
|
+
"latchway-play-integrity"
|
|
51
|
+
],
|
|
52
|
+
"version": "1.0.0",
|
|
53
|
+
"repository": "https://github.com/Latchway/latchway-android.git",
|
|
54
|
+
"source_commit": "1081ac5337ad8ec9eb9ce587bc432bec588cc1c6",
|
|
55
|
+
"minimum_sdk": 24,
|
|
56
|
+
"compile_sdk": 37,
|
|
57
|
+
"sdk_platform_version": "37.0",
|
|
58
|
+
"build_tools_version": "36.0.0",
|
|
59
|
+
"ndk_version": "27.1.12297006",
|
|
60
|
+
"publisher_android_gradle_plugin": "9.3.2",
|
|
61
|
+
"consumer_android_gradle_plugin": "8.12.0",
|
|
62
|
+
"kotlin": "2.3.21"
|
|
63
|
+
}
|
|
64
|
+
}
|