@cloud-cli/px 4.1.4 → 4.1.5

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.
@@ -2,7 +2,7 @@ import { ProxyServer } from '@cloud-cli/proxy';
2
2
  import type { DomainAndTarget, DomainName, Proxy, WithOptionalProps } from './types.js';
3
3
  export declare class ProxyManager {
4
4
  server: ProxyServer;
5
- addProxy(proxy: WithOptionalProps<Proxy>): Promise<Proxy>;
5
+ addProxy(properties: WithOptionalProps<Proxy>): Promise<Proxy>;
6
6
  updateProxy(options: WithOptionalProps<Proxy>): Promise<Proxy>;
7
7
  removeProxy(options: WithOptionalProps<DomainAndTarget>): Promise<boolean>;
8
8
  getDomainList(): Promise<string[]>;
@@ -52,19 +52,19 @@ export class ProxyManager {
52
52
  constructor() {
53
53
  this.server = px;
54
54
  }
55
- async addProxy(proxy) {
56
- readDomain(proxy);
57
- if (!proxy.domain) {
55
+ async addProxy(properties) {
56
+ readDomain(properties);
57
+ if (!properties.domain) {
58
58
  throw domainNotSpecifiedError;
59
59
  }
60
- if (!proxy.target && !proxy.redirectUrl) {
60
+ if (!properties.target && !properties.redirectUrl) {
61
61
  throw targetNotSpecifiedError;
62
62
  }
63
- const entry = { ...emptyProxy };
64
- applyProperties(entry, proxy);
65
- set(proxy.domain, entry);
63
+ const proxy = { ...emptyProxy, domain: properties.domain };
64
+ applyProperties(proxy, properties);
65
+ set(properties.domain, proxy);
66
66
  await this.reload();
67
- return entry;
67
+ return proxy;
68
68
  }
69
69
  async updateProxy(options) {
70
70
  readDomain(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/px",
3
- "version": "4.1.4",
3
+ "version": "4.1.5",
4
4
  "description": "Reverse Proxy",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",