@independo/capacitor-inderun 1.0.0 → 1.0.1-dev.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.
|
@@ -16,6 +16,19 @@ struct OpenAIProviderBootstrapOptions: Codable {
|
|
|
16
16
|
let auth: String?
|
|
17
17
|
let authContextRef: String?
|
|
18
18
|
let timeoutMs: Int?
|
|
19
|
+
|
|
20
|
+
// The property keeps Swift's `URL` capitalisation to match OpenAIProviderOptions,
|
|
21
|
+
// but the wire key is whatever `ConfigureOptions` in src/definitions.ts sends --
|
|
22
|
+
// `endpointUrl`, which is also what IndeRunSerializer.kt reads on Android. Without
|
|
23
|
+
// this mapping the field silently decodes as nil and the provider falls back to the
|
|
24
|
+
// default endpoint.
|
|
25
|
+
enum CodingKeys: String, CodingKey {
|
|
26
|
+
case model
|
|
27
|
+
case endpointURL = "endpointUrl"
|
|
28
|
+
case auth
|
|
29
|
+
case authContextRef
|
|
30
|
+
case timeoutMs
|
|
31
|
+
}
|
|
19
32
|
}
|
|
20
33
|
|
|
21
34
|
struct CapacitorRunOptions: Codable {
|
|
@@ -11,7 +11,7 @@ final class IndeRunCapacitorBridgeTests: XCTestCase {
|
|
|
11
11
|
let json: [String: Any] = [
|
|
12
12
|
"openAI": [
|
|
13
13
|
"model": "gpt-5.2",
|
|
14
|
-
"
|
|
14
|
+
"endpointUrl": "/api/inderun/openai-responses",
|
|
15
15
|
"auth": "none",
|
|
16
16
|
"authContextRef": "openai/main",
|
|
17
17
|
"timeoutMs": 30_000
|
|
@@ -28,6 +28,36 @@ final class IndeRunCapacitorBridgeTests: XCTestCase {
|
|
|
28
28
|
XCTAssertNil(options.allowDirectOpenAIEndpoint)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// Regression: the wire key is `endpointUrl` (what src/definitions.ts and
|
|
32
|
+
// IndeRunSerializer.kt both use). iOS previously decoded `endpointURL`, so a
|
|
33
|
+
// TypeScript-supplied endpoint was dropped and the provider silently fell back to
|
|
34
|
+
// the default OpenAI Responses endpoint.
|
|
35
|
+
func testDecodesEndpointUrlUsingTheTypeScriptWireKey() throws {
|
|
36
|
+
let json: [String: Any] = [
|
|
37
|
+
"openAI": [
|
|
38
|
+
"model": "gpt-5.2",
|
|
39
|
+
"endpointUrl": "https://proxy.example/api/openai-responses"
|
|
40
|
+
]
|
|
41
|
+
]
|
|
42
|
+
let data = try JSONSerialization.data(withJSONObject: json)
|
|
43
|
+
let options = try JSONDecoder().decode(CapacitorRunOptions.self, from: data)
|
|
44
|
+
|
|
45
|
+
XCTAssertEqual(options.openAI?.endpointURL, "https://proxy.example/api/openai-responses")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
func testIgnoresTheLegacySwiftCasedEndpointKey() throws {
|
|
49
|
+
let json: [String: Any] = [
|
|
50
|
+
"openAI": [
|
|
51
|
+
"model": "gpt-5.2",
|
|
52
|
+
"endpointURL": "https://proxy.example/api/openai-responses"
|
|
53
|
+
]
|
|
54
|
+
]
|
|
55
|
+
let data = try JSONSerialization.data(withJSONObject: json)
|
|
56
|
+
let options = try JSONDecoder().decode(CapacitorRunOptions.self, from: data)
|
|
57
|
+
|
|
58
|
+
XCTAssertNil(options.openAI?.endpointURL)
|
|
59
|
+
}
|
|
60
|
+
|
|
31
61
|
func testDecodesConfigureOptionsWithAllOptionalFieldsAbsent() throws {
|
|
32
62
|
let data = try JSONSerialization.data(withJSONObject: [String: Any]())
|
|
33
63
|
let options = try JSONDecoder().decode(CapacitorRunOptions.self, from: data)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@independo/capacitor-inderun",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-dev.1",
|
|
4
4
|
"description": "Thin Capacitor bridge for IndeRun across web, iOS, and Android.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/independo-gmbh/capacitor-inderun#readme",
|