@routr/sdk 2.0.8-alpha.20 → 2.0.8-alpha.22

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.
@@ -72,7 +72,6 @@ export declare class Agents extends APIClient {
72
72
  *
73
73
  * @param {UpdateAgentRequest} request - Partial with the fields to update
74
74
  * @param {string} request.name - Name of the Agent
75
- * @param {string} request.username - Username of the Agent
76
75
  * @param {Privacy} request.privacy - Privacy of the Agent (e.g. Privacy.PRIVATE)
77
76
  * @param {string} request.domainRef - Domain reference of the Domain the Agent belongs to
78
77
  * @param {string} request.credentialsRef - Credentials reference of the Credentials for the Agent
@@ -106,7 +106,6 @@ class Agents extends client_1.APIClient {
106
106
  *
107
107
  * @param {UpdateAgentRequest} request - Partial with the fields to update
108
108
  * @param {string} request.name - Name of the Agent
109
- * @param {string} request.username - Username of the Agent
110
109
  * @param {Privacy} request.privacy - Privacy of the Agent (e.g. Privacy.PRIVATE)
111
110
  * @param {string} request.domainRef - Domain reference of the Domain the Agent belongs to
112
111
  * @param {string} request.credentialsRef - Credentials reference of the Credentials for the Agent
@@ -4,7 +4,7 @@ export type CreateAgentRequest = Omit<CC.Agent, CreateBaseOmit | "domain" | "cre
4
4
  export type CreateAgentResponse = CC.Agent;
5
5
  export type UpdateAgentRequest = {
6
6
  ref: string;
7
- } & Partial<CreateAgentRequest>;
7
+ } & Partial<Omit<CreateAgentRequest, "username">>;
8
8
  export type UpdateAgentResponse = CC.Agent;
9
9
  export type ListAgentRequest = CC.ListRequest;
10
10
  export type ListAgentResponse = CC.ListResponse<CC.Agent>;
package/dist/client.js CHANGED
@@ -52,7 +52,7 @@ class APIClient {
52
52
  if (options.username && options.password) {
53
53
  metadata.set("authorization", `Basic ${Buffer.from(`${options.username}:${options.password}`).toString("base64")}`);
54
54
  }
55
- const credentials = process.env.ALLOW_INSECURE === "true"
55
+ const credentials = process.env.ALLOW_INSECURE === "true" || options.insecure === true
56
56
  ? grpc.credentials.createInsecure()
57
57
  : grpc.credentials.createSsl();
58
58
  this.client = common_1.CommonConnect.apiClient({
@@ -72,7 +72,6 @@ export declare class Domains extends APIClient {
72
72
  *
73
73
  * @param {UpdateDomainRequest} request - Partial with the fields to update
74
74
  * @param {string} request.name - Name of the Domain
75
- * @param {string} request.domainUri - The FQDN of the Domain
76
75
  * @param {string} request.accessControlListRef - The reference to the AccessControlList for the Domain
77
76
  * @param {CC.EgressPolicy[]} request.egressPolicies - The list of EgressPolicies for the Domain
78
77
  * @param {string} request.extended - Optional extended attributes
@@ -106,7 +106,6 @@ class Domains extends client_1.APIClient {
106
106
  *
107
107
  * @param {UpdateDomainRequest} request - Partial with the fields to update
108
108
  * @param {string} request.name - Name of the Domain
109
- * @param {string} request.domainUri - The FQDN of the Domain
110
109
  * @param {string} request.accessControlListRef - The reference to the AccessControlList for the Domain
111
110
  * @param {CC.EgressPolicy[]} request.egressPolicies - The list of EgressPolicies for the Domain
112
111
  * @param {string} request.extended - Optional extended attributes
@@ -6,7 +6,7 @@ export type CreateDomainRequest = Omit<CC.Domain, CreateBaseOmit | "accessContro
6
6
  export type CreateDomainResponse = CC.Domain;
7
7
  export type UpdateDomainRequest = {
8
8
  ref: string;
9
- } & Partial<CreateDomainRequest>;
9
+ } & Partial<Omit<CreateDomainRequest, "domainUri">>;
10
10
  export type UpdateDomainResponse = CC.Domain;
11
11
  export type ListDomainRequest = CC.ListRequest;
12
12
  export type ListDomainResponse = CC.ListResponse<CC.Domain>;
@@ -14,6 +14,7 @@ import { CreateNumberRequest, CreateNumberResponse, GetNumberResponse, ListNumbe
14
14
  * const request = {
15
15
  * name: "(415) 555-1212",
16
16
  * telUrl: "teL:+14155551212",
17
+ * trunkRef: "6f941c63-880c-419a-a72a-4a107cbaf5c5",
17
18
  * aorLink: "sip:100@sip.local",
18
19
  * city: "San Francisco",
19
20
  * country: "United States",
@@ -51,7 +52,7 @@ export declare class Numbers extends APIClient {
51
52
  * @param {string} request.country - The country where the number is located
52
53
  * @param {string} request.countryISOCode - The country ISO code where the number is located
53
54
  * @param {{ name: string, value: string}[]} request.extraHeaders - Extra headers to be used
54
- * @param {string} request.trunkRef - The trunk reference to be used
55
+ * @param {string} request.trunkRef - The Trunk reference to be used
55
56
  * @param {string} request.sessionAffinityHeader - Optional session affinity header
56
57
  * @param {string} request.extended - Optional extended attributes
57
58
  * @return {Promise<CreateNumberResponse>} The newly created Number
@@ -61,6 +62,7 @@ export declare class Numbers extends APIClient {
61
62
  * const request = {
62
63
  * name: "(415) 555-1212",
63
64
  * telUrl: "teL:+14155551212",
65
+ * trunkRef: "6f941c63-880c-419a-a72a-4a107cbaf5c5",
64
66
  * aorLink: "sip:100@sip.local",
65
67
  * city: "San Francisco",
66
68
  * country: "United States",
@@ -85,13 +87,9 @@ export declare class Numbers extends APIClient {
85
87
  *
86
88
  * @param {UpdateNumberRequest} request - Partial with the fields to update
87
89
  * @param {string} request.name - Name of the Number
88
- * @param {string} request.telUrl - The number URI to be used (e.g. te:+1234567890)
89
90
  * @param {string} request.aorLink - The AOR link to be used (e.g. sip:1001@sip.local)
90
- * @param {string} request.city - The city where the number is located
91
- * @param {string} request.country - The country where the number is located
92
- * @param {string} request.countryISOCode - The country ISO code where the number is located
93
91
  * @param {{ name: string, value: string}[]} request.extraHeaders - Extra headers to be used
94
- * @param {string} request.trunkRef - The trunk reference to be used
92
+ * @param {string} request.trunkRef - The Trunk reference to be used
95
93
  * @param {string} request.sessionAffinityHeader - Optional session affinity header
96
94
  * @param {string} request.extended - Optional extended attributes
97
95
  * @return {Promise<UpdateNumberResponse>} The updated Number
@@ -42,6 +42,7 @@ const client_1 = require("../client");
42
42
  * const request = {
43
43
  * name: "(415) 555-1212",
44
44
  * telUrl: "teL:+14155551212",
45
+ * trunkRef: "6f941c63-880c-419a-a72a-4a107cbaf5c5",
45
46
  * aorLink: "sip:100@sip.local",
46
47
  * city: "San Francisco",
47
48
  * country: "United States",
@@ -81,7 +82,7 @@ class Numbers extends client_1.APIClient {
81
82
  * @param {string} request.country - The country where the number is located
82
83
  * @param {string} request.countryISOCode - The country ISO code where the number is located
83
84
  * @param {{ name: string, value: string}[]} request.extraHeaders - Extra headers to be used
84
- * @param {string} request.trunkRef - The trunk reference to be used
85
+ * @param {string} request.trunkRef - The Trunk reference to be used
85
86
  * @param {string} request.sessionAffinityHeader - Optional session affinity header
86
87
  * @param {string} request.extended - Optional extended attributes
87
88
  * @return {Promise<CreateNumberResponse>} The newly created Number
@@ -91,6 +92,7 @@ class Numbers extends client_1.APIClient {
91
92
  * const request = {
92
93
  * name: "(415) 555-1212",
93
94
  * telUrl: "teL:+14155551212",
95
+ * trunkRef: "6f941c63-880c-419a-a72a-4a107cbaf5c5",
94
96
  * aorLink: "sip:100@sip.local",
95
97
  * city: "San Francisco",
96
98
  * country: "United States",
@@ -111,7 +113,7 @@ class Numbers extends client_1.APIClient {
111
113
  */
112
114
  createNumber(request) {
113
115
  return __awaiter(this, void 0, void 0, function* () {
114
- return this.client.numbers.create(request);
116
+ return this.client.numbers.create(Object.assign(Object.assign({}, request), { countryIsoCode: request.countryISOCode }));
115
117
  });
116
118
  }
117
119
  /**
@@ -119,13 +121,9 @@ class Numbers extends client_1.APIClient {
119
121
  *
120
122
  * @param {UpdateNumberRequest} request - Partial with the fields to update
121
123
  * @param {string} request.name - Name of the Number
122
- * @param {string} request.telUrl - The number URI to be used (e.g. te:+1234567890)
123
124
  * @param {string} request.aorLink - The AOR link to be used (e.g. sip:1001@sip.local)
124
- * @param {string} request.city - The city where the number is located
125
- * @param {string} request.country - The country where the number is located
126
- * @param {string} request.countryISOCode - The country ISO code where the number is located
127
125
  * @param {{ name: string, value: string}[]} request.extraHeaders - Extra headers to be used
128
- * @param {string} request.trunkRef - The trunk reference to be used
126
+ * @param {string} request.trunkRef - The Trunk reference to be used
129
127
  * @param {string} request.sessionAffinityHeader - Optional session affinity header
130
128
  * @param {string} request.extended - Optional extended attributes
131
129
  * @return {Promise<UpdateNumberResponse>} The updated Number
@@ -1,10 +1,12 @@
1
1
  import { CommonConnect as CC } from "@routr/common";
2
2
  import { CreateBaseOmit } from "../types";
3
- export type CreateNumberRequest = Omit<CC.INumber, CreateBaseOmit | "trunk">;
3
+ export type CreateNumberRequest = Omit<CC.INumber, CreateBaseOmit | "trunk" | "countryIsoCode"> & {
4
+ countryISOCode: string;
5
+ };
4
6
  export type CreateNumberResponse = CC.INumber;
5
7
  export type UpdateNumberRequest = {
6
8
  ref: string;
7
- } & Partial<CreateNumberRequest>;
9
+ } & Partial<Omit<CreateNumberRequest, "telUrl" | "city" | "country" | "countryIsoCode">>;
8
10
  export type UpdateNumberResponse = CC.INumber;
9
11
  export type ListNumberRequest = CC.ListRequest;
10
12
  export type ListNumberResponse = CC.ListResponse<CC.INumber>;
@@ -4,7 +4,7 @@ export type CreatePeerRequest = Omit<CC.Peer, CreateBaseOmit | "accessControlLis
4
4
  export type CreatePeerResponse = CC.Peer;
5
5
  export type UpdatePeerRequest = {
6
6
  ref: string;
7
- } & Partial<CreatePeerRequest>;
7
+ } & Partial<Omit<CreatePeerRequest, "username">>;
8
8
  export type UpdatePeerResponse = CC.Peer;
9
9
  export type ListPeerRequest = CC.ListRequest;
10
10
  export type ListPeerResponse = CC.ListResponse<CC.Peer>;
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export interface ClientOptions {
2
2
  endpoint: string;
3
+ insecure?: boolean;
3
4
  username?: string;
4
5
  password?: string;
5
6
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@routr/sdk",
3
- "version": "2.0.8-alpha.20",
3
+ "version": "2.0.8-alpha.22",
4
4
  "description": "The Routr SDK for Node.js",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
7
7
  "license": "MIT",
8
- "main": "dist/sdk",
9
- "types": "dist/sdk",
8
+ "main": "dist",
9
+ "types": "dist",
10
10
  "directories": {
11
11
  "src": "src",
12
12
  "test": "test"
@@ -26,7 +26,7 @@
26
26
  "@opentelemetry/sdk-trace-base": "^1.0.4",
27
27
  "@opentelemetry/sdk-trace-node": "^1.0.4",
28
28
  "@opentelemetry/semantic-conventions": "^1.0.4",
29
- "@routr/common": "^2.0.8-alpha.20",
29
+ "@routr/common": "^2.0.8-alpha.22",
30
30
  "google-protobuf": "^3.9.2",
31
31
  "pb-util": "^1.0.3"
32
32
  },
@@ -46,5 +46,5 @@
46
46
  "devDependencies": {
47
47
  "@types/google-protobuf": "^3.15.6"
48
48
  },
49
- "gitHead": "a22ee8342d03f5dfe46fddba89ffe3e6d0d5deb6"
49
+ "gitHead": "7c1e14c20e077f817605be62cf61a68904583bb8"
50
50
  }