@limrun/api 0.58.1 → 0.60.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/destination-tunnel-dialer.d.mts +7 -0
  3. package/destination-tunnel-dialer.d.mts.map +1 -1
  4. package/destination-tunnel-dialer.d.ts +7 -0
  5. package/destination-tunnel-dialer.d.ts.map +1 -1
  6. package/destination-tunnel-dialer.js +15 -4
  7. package/destination-tunnel-dialer.js.map +1 -1
  8. package/destination-tunnel-dialer.mjs +13 -3
  9. package/destination-tunnel-dialer.mjs.map +1 -1
  10. package/destination-tunnel.d.mts +4 -0
  11. package/destination-tunnel.d.mts.map +1 -1
  12. package/destination-tunnel.d.ts +4 -0
  13. package/destination-tunnel.d.ts.map +1 -1
  14. package/destination-tunnel.js +2 -0
  15. package/destination-tunnel.js.map +1 -1
  16. package/destination-tunnel.mjs +2 -0
  17. package/destination-tunnel.mjs.map +1 -1
  18. package/index.d.mts +1 -0
  19. package/index.d.mts.map +1 -1
  20. package/index.d.ts +1 -0
  21. package/index.d.ts.map +1 -1
  22. package/index.js +4 -2
  23. package/index.js.map +1 -1
  24. package/index.mjs +1 -0
  25. package/index.mjs.map +1 -1
  26. package/internal/destination-tunnel-management.d.mts +2 -0
  27. package/internal/destination-tunnel-management.d.mts.map +1 -1
  28. package/internal/destination-tunnel-management.d.ts +2 -0
  29. package/internal/destination-tunnel-management.d.ts.map +1 -1
  30. package/internal/destination-tunnel-management.js +5 -0
  31. package/internal/destination-tunnel-management.js.map +1 -1
  32. package/internal/destination-tunnel-management.mjs +6 -1
  33. package/internal/destination-tunnel-management.mjs.map +1 -1
  34. package/internal/destination-tunnel-url.d.mts +2 -0
  35. package/internal/destination-tunnel-url.d.mts.map +1 -1
  36. package/internal/destination-tunnel-url.d.ts +2 -0
  37. package/internal/destination-tunnel-url.d.ts.map +1 -1
  38. package/internal/destination-tunnel-url.js +9 -2
  39. package/internal/destination-tunnel-url.js.map +1 -1
  40. package/internal/destination-tunnel-url.mjs +8 -2
  41. package/internal/destination-tunnel-url.mjs.map +1 -1
  42. package/ios-client.d.mts +58 -7
  43. package/ios-client.d.mts.map +1 -1
  44. package/ios-client.d.ts +58 -7
  45. package/ios-client.d.ts.map +1 -1
  46. package/ios-client.js +58 -30
  47. package/ios-client.js.map +1 -1
  48. package/ios-client.mjs +58 -30
  49. package/ios-client.mjs.map +1 -1
  50. package/ios-launch-environment.d.mts +3 -0
  51. package/ios-launch-environment.d.mts.map +1 -0
  52. package/ios-launch-environment.d.ts +3 -0
  53. package/ios-launch-environment.d.ts.map +1 -0
  54. package/ios-launch-environment.js +14 -0
  55. package/ios-launch-environment.js.map +1 -0
  56. package/ios-launch-environment.mjs +11 -0
  57. package/ios-launch-environment.mjs.map +1 -0
  58. package/package.json +22 -2
  59. package/resources/android-instances.d.mts +12 -0
  60. package/resources/android-instances.d.mts.map +1 -1
  61. package/resources/android-instances.d.ts +12 -0
  62. package/resources/android-instances.d.ts.map +1 -1
  63. package/resources/ios-instances.d.mts +12 -0
  64. package/resources/ios-instances.d.mts.map +1 -1
  65. package/resources/ios-instances.d.ts +12 -0
  66. package/resources/ios-instances.d.ts.map +1 -1
  67. package/src/destination-tunnel-dialer.ts +18 -3
  68. package/src/destination-tunnel.ts +6 -0
  69. package/src/index.ts +6 -0
  70. package/src/internal/destination-tunnel-management.ts +15 -1
  71. package/src/internal/destination-tunnel-url.ts +15 -2
  72. package/src/ios-client.ts +137 -43
  73. package/src/ios-launch-environment.ts +11 -0
  74. package/src/resources/android-instances.ts +14 -0
  75. package/src/resources/ios-instances.ts +14 -0
  76. package/src/tunnel-connector.ts +677 -0
  77. package/src/tunnel.ts +8 -6
  78. package/src/version.ts +1 -1
  79. package/tunnel-connector.d.mts +77 -0
  80. package/tunnel-connector.d.mts.map +1 -0
  81. package/tunnel-connector.d.ts +77 -0
  82. package/tunnel-connector.d.ts.map +1 -0
  83. package/tunnel-connector.js +561 -0
  84. package/tunnel-connector.js.map +1 -0
  85. package/tunnel-connector.mjs +557 -0
  86. package/tunnel-connector.mjs.map +1 -0
  87. package/tunnel.d.mts +2 -0
  88. package/tunnel.d.mts.map +1 -1
  89. package/tunnel.d.ts +2 -0
  90. package/tunnel.d.ts.map +1 -1
  91. package/tunnel.js +8 -6
  92. package/tunnel.js.map +1 -1
  93. package/tunnel.mjs +7 -6
  94. package/tunnel.mjs.map +1 -1
  95. package/version.d.mts +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.58.1'; // x-release-please-version
1
+ export const VERSION = '0.60.0'; // x-release-please-version
@@ -0,0 +1,77 @@
1
+ import { type DestinationTunnelInspectionConfig, type DestinationTunnelSelectors } from "./destination-tunnel.mjs";
2
+ import { type LogLevel } from "./tunnel.mjs";
3
+ export interface TunnelConnectorOptions {
4
+ apiKey: string;
5
+ /** Limrun API base URL, such as https://api.limrun.com. */
6
+ baseURL: string;
7
+ organizationId: string;
8
+ /** The name instances set in `spec.tunnel` to attach to this connector. */
9
+ name: string;
10
+ selectors: DestinationTunnelSelectors;
11
+ /** Inspection for every instance tunnel. Defaults to enabled without bodies. */
12
+ inspection?: Partial<DestinationTunnelInspectionConfig>;
13
+ /** Take the name over from the connector that holds it now. */
14
+ replace?: boolean;
15
+ /** Identifies this connector to the platform. Defaults to the OS hostname. */
16
+ hostname?: string;
17
+ /** Reported to the platform. Defaults to the SDK version. */
18
+ clientVersion?: string;
19
+ /** Log level of the per-instance tunnels. Defaults to 'warn'. */
20
+ logLevel?: LogLevel;
21
+ onEvent?: (event: TunnelConnectorEvent) => void;
22
+ }
23
+ export type TunnelConnectorEvent =
24
+ /** This connector holds the name; emitted once per session and control connection. */
25
+ {
26
+ type: 'active';
27
+ sessionId: string;
28
+ }
29
+ /** Another connector holds the name; emitted once per holder. */
30
+ | {
31
+ type: 'standby';
32
+ holder: {
33
+ hostname: string;
34
+ since?: string;
35
+ };
36
+ } | {
37
+ type: 'attached';
38
+ instanceId: string;
39
+ tunnelId: string;
40
+ }
41
+ /** The connector gave up on the instance. */
42
+ | {
43
+ type: 'attachFailed';
44
+ instanceId: string;
45
+ code: string;
46
+ message: string;
47
+ } | {
48
+ type: 'detached';
49
+ instanceId: string;
50
+ reason: string;
51
+ } | {
52
+ type: 'notice';
53
+ code: string;
54
+ message: string;
55
+ instanceId?: string;
56
+ }
57
+ /** The control channel, or the tunnel of `instanceId`, retries after `delayMs`. */
58
+ | {
59
+ type: 'reconnecting';
60
+ instanceId?: string;
61
+ delayMs: number;
62
+ reason: string;
63
+ };
64
+ export interface TunnelConnector {
65
+ /** Resolves after close() and rejects with the terminal error that ended the connector. */
66
+ closed: Promise<void>;
67
+ /** Releases the name at once, closes every instance tunnel, and resolves when done. */
68
+ close: () => Promise<void>;
69
+ }
70
+ /**
71
+ * Serve a persistent tunnel: hold the name through one control WebSocket to
72
+ * the Limrun API and open a destination tunnel to every instance created
73
+ * with `spec.tunnel` set to it. Instance tunnels stay up while the control
74
+ * channel reconnects, so an API outage never becomes a tunnel outage.
75
+ */
76
+ export declare function runTunnel(options: TunnelConnectorOptions): TunnelConnector;
77
+ //# sourceMappingURL=tunnel-connector.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel-connector.d.mts","sourceRoot":"","sources":["src/tunnel-connector.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAChC,iCAA6B;AAC9B,OAAO,EAAiB,KAAK,QAAQ,EAAE,qBAAiB;AAoBxD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,0BAA0B,CAAC;IAC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C;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnF,MAAM,WAAW,eAAe;IAC9B,2FAA2F;IAC3F,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,uFAAuF;IACvF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAyCD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAyd1E"}
@@ -0,0 +1,77 @@
1
+ import { type DestinationTunnelInspectionConfig, type DestinationTunnelSelectors } from "./destination-tunnel.js";
2
+ import { type LogLevel } from "./tunnel.js";
3
+ export interface TunnelConnectorOptions {
4
+ apiKey: string;
5
+ /** Limrun API base URL, such as https://api.limrun.com. */
6
+ baseURL: string;
7
+ organizationId: string;
8
+ /** The name instances set in `spec.tunnel` to attach to this connector. */
9
+ name: string;
10
+ selectors: DestinationTunnelSelectors;
11
+ /** Inspection for every instance tunnel. Defaults to enabled without bodies. */
12
+ inspection?: Partial<DestinationTunnelInspectionConfig>;
13
+ /** Take the name over from the connector that holds it now. */
14
+ replace?: boolean;
15
+ /** Identifies this connector to the platform. Defaults to the OS hostname. */
16
+ hostname?: string;
17
+ /** Reported to the platform. Defaults to the SDK version. */
18
+ clientVersion?: string;
19
+ /** Log level of the per-instance tunnels. Defaults to 'warn'. */
20
+ logLevel?: LogLevel;
21
+ onEvent?: (event: TunnelConnectorEvent) => void;
22
+ }
23
+ export type TunnelConnectorEvent =
24
+ /** This connector holds the name; emitted once per session and control connection. */
25
+ {
26
+ type: 'active';
27
+ sessionId: string;
28
+ }
29
+ /** Another connector holds the name; emitted once per holder. */
30
+ | {
31
+ type: 'standby';
32
+ holder: {
33
+ hostname: string;
34
+ since?: string;
35
+ };
36
+ } | {
37
+ type: 'attached';
38
+ instanceId: string;
39
+ tunnelId: string;
40
+ }
41
+ /** The connector gave up on the instance. */
42
+ | {
43
+ type: 'attachFailed';
44
+ instanceId: string;
45
+ code: string;
46
+ message: string;
47
+ } | {
48
+ type: 'detached';
49
+ instanceId: string;
50
+ reason: string;
51
+ } | {
52
+ type: 'notice';
53
+ code: string;
54
+ message: string;
55
+ instanceId?: string;
56
+ }
57
+ /** The control channel, or the tunnel of `instanceId`, retries after `delayMs`. */
58
+ | {
59
+ type: 'reconnecting';
60
+ instanceId?: string;
61
+ delayMs: number;
62
+ reason: string;
63
+ };
64
+ export interface TunnelConnector {
65
+ /** Resolves after close() and rejects with the terminal error that ended the connector. */
66
+ closed: Promise<void>;
67
+ /** Releases the name at once, closes every instance tunnel, and resolves when done. */
68
+ close: () => Promise<void>;
69
+ }
70
+ /**
71
+ * Serve a persistent tunnel: hold the name through one control WebSocket to
72
+ * the Limrun API and open a destination tunnel to every instance created
73
+ * with `spec.tunnel` set to it. Instance tunnels stay up while the control
74
+ * channel reconnects, so an API outage never becomes a tunnel outage.
75
+ */
76
+ export declare function runTunnel(options: TunnelConnectorOptions): TunnelConnector;
77
+ //# sourceMappingURL=tunnel-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel-connector.d.ts","sourceRoot":"","sources":["src/tunnel-connector.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAChC,gCAA6B;AAC9B,OAAO,EAAiB,KAAK,QAAQ,EAAE,oBAAiB;AAoBxD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,0BAA0B,CAAC;IACtC,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC,iCAAiC,CAAC,CAAC;IACxD,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,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