@ansight/capacitor 1.4.0-preview.5 → 1.5.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.
@@ -7,6 +7,7 @@ public final class AnsightCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
7
7
  public let identifier = "AnsightCapacitorPlugin"
8
8
  public let jsName = "Ansight"
9
9
  public let pluginMethods: [CAPPluginMethod] = [
10
+ CAPPluginMethod(name: "purchaseCommand", returnType: CAPPluginReturnPromise),
10
11
  CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
11
12
  CAPPluginMethod(name: "initializeAndActivate", returnType: CAPPluginReturnPromise),
12
13
  CAPPluginMethod(name: "activate", returnType: CAPPluginReturnPromise),
@@ -398,6 +399,15 @@ public final class AnsightCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
398
399
  call.resolve(snapshotDictionary())
399
400
  }
400
401
 
402
+ @objc func purchaseCommand(_ call: CAPPluginCall) {
403
+ guard let json = call.getString("json") else { call.reject("Missing purchase command."); return }
404
+ Task {
405
+ do { call.resolve(["json": try await PurchaseDiagnostics.shared.commandAsync(json)]) }
406
+ catch PurchaseDiagnosticsError.environmentNotAllowed { call.reject("Purchase interop is restricted to simulators and emulators.", PurchaseDiagnosticsError.environmentErrorCode) }
407
+ catch { call.reject("Purchase command failed.", "purchases_command_failed", error) }
408
+ }
409
+ }
410
+
401
411
  @objc func snapshot(_ call: CAPPluginCall) {
402
412
  call.resolve(snapshotDictionary())
403
413
  }
@@ -724,7 +734,7 @@ public final class AnsightCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
724
734
  } else if let crash = raw as? NSDictionary {
725
735
  options.crashCapture = AnsightCrashCaptureOptions(
726
736
  enabled: boolValue(crash, "enabled", defaultValue: true),
727
- studioHandoffEnabled: boolValue(crash, "studioHandoffEnabled", defaultValue: true),
737
+ hostHandoffEnabled: boolValue(crash, "hostHandoffEnabled", defaultValue: true),
728
738
  offlineCaptureAttachmentEnabled: boolValue(crash, "offlineCaptureAttachmentEnabled", defaultValue: true),
729
739
  maximumPendingReports: intValue(crash, "maximumPendingReports", defaultValue: 8),
730
740
  retentionDays: intValue(crash, "retentionDays", defaultValue: 7),
@@ -793,6 +803,7 @@ public final class AnsightCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
793
803
  let defaultEnabled = boolValue(dictionary, "useNativeAllInOneDefaults", defaultValue: false)
794
804
  return AnsightRemoteToolOptions(
795
805
  visualTree: toolSuiteEnabled(remoteTools?["visualTree"], defaultValue: defaultEnabled),
806
+ clipboard: boolValue(remoteTools, "clipboard", defaultValue: true),
796
807
  database: AnsightDatabaseToolsOptions(
797
808
  additionalRoots: rootDictionaries((remoteTools?["database"] as? NSDictionary)?["additionalRoots"]).map {
798
809
  AnsightDatabaseRoot(alias: stringValue($0, "alias") ?? "", path: stringValue($0, "path") ?? "")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansight/capacitor",
3
- "version": "1.4.0-preview.5",
4
- "description": "Capacitor bridge for the Ansight mobile observability and remote inspection SDK.",
3
+ "version": "1.5.0",
4
+ "description": "Capacitor bridge for Ansight: runtime evidence from your app for coding agents. Screenshots, DOM and native trees, logs, network, and app state.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",