ironflock 1.5.2 → 1.5.3

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/dist/index.d.ts CHANGED
@@ -305,7 +305,37 @@ export declare class IronFlock {
305
305
  */
306
306
  getSeriesHistory(tablename: string, params: SeriesQueryParams): Promise<unknown>;
307
307
  setDeviceLocation(long: number, lat: number): Promise<unknown>;
308
- getRemoteAccessUrlForPort(port: number): string | null;
308
+ /**
309
+ * Public URL under which a declared port (port-template.yml) is reachable
310
+ * from the internet once its tunnel is active.
311
+ *
312
+ * For `http`/`https` ports, composes the platform's tunnel label
313
+ * `{device_key}-{app_name}-{port}` (`https` ports carry the platform's
314
+ * `secure-` prefix) on the tunnel domain the device agent injects
315
+ * (`TUNNEL_DOMAIN`; the cloud edge, or the operator's appliance domain).
316
+ * On devices that belong to an instance (appliance), the agent injects
317
+ * `INSTANCE_KEY` and the cloud-forwarded route
318
+ * `https://i{instance_key}-{label}.{cloud edge}` is returned instead —
319
+ * reachable while the instance forwards its tunnels to the cloud.
320
+ *
321
+ * For `tcp`/`udp` ports, the URL uses the tunnel-assigned public port,
322
+ * which the platform injects under the port-template's
323
+ * `remote_port_environment` name — pass that name here. On instance
324
+ * devices the internet-facing port arrives as `{name}_CLOUD`; when it is
325
+ * not (yet) present, the instance-local URL built from `{name}` is
326
+ * returned as a fallback.
327
+ *
328
+ * Port values are read live from the agent-maintained files under
329
+ * `/data/env` (falling back to the process environment), so this method
330
+ * returns the CURRENT url: the instance cloud port is allocated shortly
331
+ * after the tunnel first connects and appears here within seconds — call
332
+ * the method again rather than caching its result.
333
+ *
334
+ * Returns null when the identity or required env vars are unavailable,
335
+ * the protocol is unknown, or the label is not a valid DNS label (longer
336
+ * than 63 characters, or a dot in the app name).
337
+ */
338
+ getRemoteAccessUrlForPort(port: number, protocol?: string, remotePortEnvironment?: string): string | null;
309
339
  /**
310
340
  * Create an IronFlock instance by fetching configuration from a server endpoint.
311
341
  * The endpoint should return JSON matching `IronFlockOptions`.