@fonoster/sipnet 0.6.1-alpha.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 (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/acls/buildService.d.ts +30 -0
  4. package/dist/acls/buildService.js +45 -0
  5. package/dist/acls/client.d.ts +49 -0
  6. package/dist/acls/client.js +2 -0
  7. package/dist/acls/index.d.ts +1 -0
  8. package/dist/acls/index.js +23 -0
  9. package/dist/acls/operations.d.ts +21 -0
  10. package/dist/acls/operations.js +29 -0
  11. package/dist/acls/types.d.ts +14 -0
  12. package/dist/acls/types.js +2 -0
  13. package/dist/agents/buildService.d.ts +30 -0
  14. package/dist/agents/buildService.js +45 -0
  15. package/dist/agents/client.d.ts +62 -0
  16. package/dist/agents/client.js +8 -0
  17. package/dist/agents/index.d.ts +1 -0
  18. package/dist/agents/index.js +23 -0
  19. package/dist/agents/operations.d.ts +21 -0
  20. package/dist/agents/operations.js +29 -0
  21. package/dist/agents/types.d.ts +14 -0
  22. package/dist/agents/types.js +2 -0
  23. package/dist/constants.d.ts +3 -0
  24. package/dist/constants.js +26 -0
  25. package/dist/credentials/buildService.d.ts +30 -0
  26. package/dist/credentials/buildService.js +45 -0
  27. package/dist/credentials/client.d.ts +49 -0
  28. package/dist/credentials/client.js +2 -0
  29. package/dist/credentials/index.d.ts +1 -0
  30. package/dist/credentials/index.js +23 -0
  31. package/dist/credentials/operations.d.ts +21 -0
  32. package/dist/credentials/operations.js +29 -0
  33. package/dist/credentials/types.d.ts +14 -0
  34. package/dist/credentials/types.js +2 -0
  35. package/dist/domains/buildService.d.ts +30 -0
  36. package/dist/domains/buildService.js +45 -0
  37. package/dist/domains/client.d.ts +57 -0
  38. package/dist/domains/client.js +2 -0
  39. package/dist/domains/index.d.ts +1 -0
  40. package/dist/domains/index.js +23 -0
  41. package/dist/domains/operations.d.ts +21 -0
  42. package/dist/domains/operations.js +29 -0
  43. package/dist/domains/types.d.ts +14 -0
  44. package/dist/domains/types.js +2 -0
  45. package/dist/index.d.ts +7 -0
  46. package/dist/index.js +41 -0
  47. package/dist/numbers/buildService.d.ts +31 -0
  48. package/dist/numbers/buildService.js +29 -0
  49. package/dist/numbers/client.d.ts +67 -0
  50. package/dist/numbers/client.js +2 -0
  51. package/dist/numbers/convertToRoutrNumber.d.ts +18 -0
  52. package/dist/numbers/convertToRoutrNumber.js +26 -0
  53. package/dist/numbers/createNumber.d.ts +7 -0
  54. package/dist/numbers/createNumber.js +54 -0
  55. package/dist/numbers/index.d.ts +1 -0
  56. package/dist/numbers/index.js +23 -0
  57. package/dist/numbers/operations.d.ts +15 -0
  58. package/dist/numbers/operations.js +19 -0
  59. package/dist/numbers/types.d.ts +29 -0
  60. package/dist/numbers/types.js +2 -0
  61. package/dist/numbers/updateNumber.d.ts +7 -0
  62. package/dist/numbers/updateNumber.js +51 -0
  63. package/dist/numbers/validation.d.ts +39 -0
  64. package/dist/numbers/validation.js +51 -0
  65. package/dist/resources/createResource.d.ts +5 -0
  66. package/dist/resources/createResource.js +51 -0
  67. package/dist/resources/deleteResource.d.ts +4 -0
  68. package/dist/resources/deleteResource.js +42 -0
  69. package/dist/resources/getResource.d.ts +4 -0
  70. package/dist/resources/getResource.js +41 -0
  71. package/dist/resources/listResources.d.ts +9 -0
  72. package/dist/resources/listResources.js +51 -0
  73. package/dist/resources/updateResource.d.ts +4 -0
  74. package/dist/resources/updateResource.js +46 -0
  75. package/dist/trunks/buildService.d.ts +30 -0
  76. package/dist/trunks/buildService.js +45 -0
  77. package/dist/trunks/client.d.ts +76 -0
  78. package/dist/trunks/client.js +11 -0
  79. package/dist/trunks/index.d.ts +1 -0
  80. package/dist/trunks/index.js +23 -0
  81. package/dist/trunks/operations.d.ts +21 -0
  82. package/dist/trunks/operations.js +29 -0
  83. package/dist/trunks/types.d.ts +14 -0
  84. package/dist/trunks/types.js +2 -0
  85. package/dist/types.d.ts +5 -0
  86. package/dist/types.js +2 -0
  87. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Fonoster Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ <a href="https://gitpod.io/#https://github.com/fonoster/fonoster"> <img src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod" alt="Contribute with Gitpod" />
2
+
3
+ This module is part of the [Fonoster](https://fonoster.com) project. By itself, it does not do much. It is intended to be used as a dependency for other modules. For more information about the project, please visit [https://github.com/fonoster/fonoster](https://github.com/fonoster/fonoster).
@@ -0,0 +1,30 @@
1
+ import { ClientOptions } from "../types";
2
+ declare function buildService(clientOptions: ClientOptions): {
3
+ definition: {
4
+ serviceName: string;
5
+ pckg: string;
6
+ version: string;
7
+ proto: string;
8
+ };
9
+ handlers: {
10
+ createAcl: (call: {
11
+ request: import("./types").CreateAclRequest;
12
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Acl) => void) => Promise<void>;
13
+ updateAcl: (call: {
14
+ request: import("./client").UpdateAclRequest;
15
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Acl) => void) => Promise<void>;
16
+ getAcl: (call: {
17
+ request: import("./client").GetAclRequest;
18
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Acl) => void) => Promise<void>;
19
+ listAcls: (call: {
20
+ request: import("./client").ListAclsRequest;
21
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: {
22
+ nextPageToken?: string;
23
+ items: import("./types").Acl[];
24
+ }) => void) => Promise<void>;
25
+ deleteAcl: (call: {
26
+ request: import("./client").DeleteAclRequest;
27
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Acl) => void) => Promise<void>;
28
+ };
29
+ };
30
+ export { buildService };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildService = void 0;
7
+ /*
8
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
9
+ * http://github.com/fonoster/fonoster
10
+ *
11
+ * This file is part of Fonoster
12
+ *
13
+ * Licensed under the MIT License (the "License");
14
+ * you may not use this file except in compliance with
15
+ * the License. You may obtain a copy of the License at
16
+ *
17
+ * https://opensource.org/licenses/MIT
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ */
25
+ const sdk_1 = __importDefault(require("@routr/sdk"));
26
+ const operations_1 = require("./operations");
27
+ function buildService(clientOptions) {
28
+ const client = new sdk_1.default.ACL(clientOptions);
29
+ return {
30
+ definition: {
31
+ serviceName: "Acls",
32
+ pckg: "acls",
33
+ version: "v1beta2",
34
+ proto: "acls.proto"
35
+ },
36
+ handlers: {
37
+ createAcl: (0, operations_1.createAcl)(client),
38
+ updateAcl: (0, operations_1.updateAcl)(client),
39
+ getAcl: (0, operations_1.getAcl)(client),
40
+ listAcls: (0, operations_1.listAcls)(client),
41
+ deleteAcl: (0, operations_1.deleteAcl)(client)
42
+ }
43
+ };
44
+ }
45
+ exports.buildService = buildService;
@@ -0,0 +1,49 @@
1
+ import { JsonObject } from "@prisma/client/runtime/library";
2
+ type Acl = {
3
+ ref: string;
4
+ name: string;
5
+ allow: string[];
6
+ deny: string[];
7
+ extended?: JsonObject;
8
+ createdAt?: number;
9
+ updatedAt?: number;
10
+ };
11
+ type CreateAclRequest = {
12
+ name: string;
13
+ allow: string[];
14
+ deny: string[];
15
+ extended: {
16
+ accessKeyId: string;
17
+ };
18
+ };
19
+ type UpdateAclRequest = {
20
+ ref: string;
21
+ } & Omit<Partial<CreateAclRequest>, "extended">;
22
+ type CreateAclResponse = {
23
+ ref: string;
24
+ };
25
+ type UpdateAclResponse = {
26
+ ref: string;
27
+ };
28
+ type GetAclRequest = {
29
+ ref: string;
30
+ };
31
+ type DeleteAclRequest = {
32
+ ref: string;
33
+ };
34
+ type ListAclsRequest = {
35
+ pageSize: number;
36
+ pageToken: string;
37
+ };
38
+ type ListAclsResponse = {
39
+ items: Acl[];
40
+ nextPageToken: string;
41
+ };
42
+ type AclsApi = {
43
+ createACL(request: CreateAclRequest): Promise<CreateAclResponse>;
44
+ updateACL(request: UpdateAclRequest): Promise<UpdateAclResponse>;
45
+ getACL(ref: string): Promise<Acl>;
46
+ deleteACL(ref: string): Promise<void>;
47
+ listACLs(request: ListAclsRequest): Promise<ListAclsResponse>;
48
+ };
49
+ export { Acl, CreateAclRequest, UpdateAclRequest, CreateAclResponse, UpdateAclResponse, GetAclRequest, DeleteAclRequest, ListAclsRequest, ListAclsResponse, AclsApi };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { buildService as buildAclsService } from "./buildService";
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAclsService = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var buildService_1 = require("./buildService");
23
+ Object.defineProperty(exports, "buildAclsService", { enumerable: true, get: function () { return buildService_1.buildService; } });
@@ -0,0 +1,21 @@
1
+ import { AclsApi, GetAclRequest } from "./client";
2
+ import { Acl, CreateAclRequest } from "./types";
3
+ declare function createAcl(acls: AclsApi): (call: {
4
+ request: CreateAclRequest;
5
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Acl) => void) => Promise<void>;
6
+ declare function updateAcl(acls: AclsApi): (call: {
7
+ request: import("./client").UpdateAclRequest;
8
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Acl) => void) => Promise<void>;
9
+ declare function getAcl(acls: AclsApi): (call: {
10
+ request: GetAclRequest;
11
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Acl) => void) => Promise<void>;
12
+ declare function listAcls(acls: AclsApi): (call: {
13
+ request: import("./client").ListAclsRequest;
14
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: {
15
+ nextPageToken?: string;
16
+ items: Acl[];
17
+ }) => void) => Promise<void>;
18
+ declare function deleteAcl(acls: AclsApi): (call: {
19
+ request: import("./client").DeleteAclRequest;
20
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Acl) => void) => Promise<void>;
21
+ export { createAcl, updateAcl, getAcl, listAcls, deleteAcl };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteAcl = exports.listAcls = exports.getAcl = exports.updateAcl = exports.createAcl = void 0;
4
+ const createResource_1 = require("../resources/createResource");
5
+ const deleteResource_1 = require("../resources/deleteResource");
6
+ const getResource_1 = require("../resources/getResource");
7
+ const listResources_1 = require("../resources/listResources");
8
+ const updateResource_1 = require("../resources/updateResource");
9
+ const RESOURCE = "ACL";
10
+ function createAcl(acls) {
11
+ return (0, createResource_1.createResource)(acls, RESOURCE);
12
+ }
13
+ exports.createAcl = createAcl;
14
+ function updateAcl(acls) {
15
+ return (0, updateResource_1.updateResource)(acls, RESOURCE);
16
+ }
17
+ exports.updateAcl = updateAcl;
18
+ function getAcl(acls) {
19
+ return (0, getResource_1.getResource)(acls, RESOURCE);
20
+ }
21
+ exports.getAcl = getAcl;
22
+ function listAcls(acls) {
23
+ return (0, listResources_1.listResources)(acls, RESOURCE);
24
+ }
25
+ exports.listAcls = listAcls;
26
+ function deleteAcl(acls) {
27
+ return (0, deleteResource_1.deleteResource)(acls, RESOURCE);
28
+ }
29
+ exports.deleteAcl = deleteAcl;
@@ -0,0 +1,14 @@
1
+ import * as RTypes from "./client";
2
+ type Acl = Omit<RTypes.Acl, "extended">;
3
+ type CreateAclRequest = Omit<RTypes.CreateAclRequest, "extended">;
4
+ type CreateAclResponse = RTypes.CreateAclResponse;
5
+ type UpdateAclRequest = RTypes.UpdateAclRequest;
6
+ type UpdateAclResponse = RTypes.UpdateAclResponse;
7
+ type GetAclRequest = RTypes.GetAclRequest;
8
+ type ListAclsRequest = RTypes.ListAclsRequest;
9
+ type ListAclsResponse = RTypes.ListAclsResponse;
10
+ type DeleteAclRequest = RTypes.DeleteAclRequest;
11
+ type DeleteAclResponse = {
12
+ ref: string;
13
+ };
14
+ export type { Acl, CreateAclRequest, CreateAclResponse, UpdateAclRequest, UpdateAclResponse, GetAclRequest, ListAclsRequest, ListAclsResponse, DeleteAclRequest, DeleteAclResponse };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,30 @@
1
+ import { ClientOptions } from "../types";
2
+ declare function buildService(clientOptions: ClientOptions): {
3
+ definition: {
4
+ serviceName: string;
5
+ pckg: string;
6
+ version: string;
7
+ proto: string;
8
+ };
9
+ handlers: {
10
+ createAgent: (call: {
11
+ request: import("./types").CreateAgentRequest;
12
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Agent) => void) => Promise<void>;
13
+ updateAgent: (call: {
14
+ request: import("./client").UpdateAgentRequest;
15
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Agent) => void) => Promise<void>;
16
+ getAgent: (call: {
17
+ request: import("./client").GetAgentRequest;
18
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Agent) => void) => Promise<void>;
19
+ listAgents: (call: {
20
+ request: import("./client").ListAgentsRequest;
21
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: {
22
+ nextPageToken?: string;
23
+ items: import("./types").Agent[];
24
+ }) => void) => Promise<void>;
25
+ deleteAgent: (call: {
26
+ request: import("./client").DeleteAgentRequest;
27
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Agent) => void) => Promise<void>;
28
+ };
29
+ };
30
+ export { buildService };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildService = void 0;
7
+ /*
8
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
9
+ * http://github.com/fonoster/fonoster
10
+ *
11
+ * This file is part of Fonoster
12
+ *
13
+ * Licensed under the MIT License (the "License");
14
+ * you may not use this file except in compliance with
15
+ * the License. You may obtain a copy of the License at
16
+ *
17
+ * https://opensource.org/licenses/MIT
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ */
25
+ const sdk_1 = __importDefault(require("@routr/sdk"));
26
+ const operations_1 = require("./operations");
27
+ function buildService(clientOptions) {
28
+ const client = new sdk_1.default.Agents(clientOptions);
29
+ return {
30
+ definition: {
31
+ serviceName: "Agents",
32
+ pckg: "agents",
33
+ version: "v1beta2",
34
+ proto: "agents.proto"
35
+ },
36
+ handlers: {
37
+ createAgent: (0, operations_1.createAgent)(client),
38
+ updateAgent: (0, operations_1.updateAgent)(client),
39
+ getAgent: (0, operations_1.getAgent)(client),
40
+ listAgents: (0, operations_1.listAgents)(client),
41
+ deleteAgent: (0, operations_1.deleteAgent)(client)
42
+ }
43
+ };
44
+ }
45
+ exports.buildService = buildService;
@@ -0,0 +1,62 @@
1
+ import { JsonObject } from "@prisma/client/runtime/library";
2
+ import { Domain } from "../domains/types";
3
+ declare enum Privacy {
4
+ PRIVATE = "ID",
5
+ NONE = "NONE"
6
+ }
7
+ type Agent = {
8
+ ref: string;
9
+ name: string;
10
+ username: string;
11
+ privacy: Privacy;
12
+ enabled: boolean;
13
+ maxContacts?: number;
14
+ expires?: number;
15
+ domain?: Domain;
16
+ extended?: JsonObject;
17
+ createdAt?: number;
18
+ updatedAt?: number;
19
+ };
20
+ type CreateAgentRequest = {
21
+ name: string;
22
+ username: string;
23
+ privacy: Privacy;
24
+ enabled: boolean;
25
+ maxContacts: number;
26
+ expires?: number;
27
+ domainRef: string;
28
+ extended: {
29
+ accessKeyId: string;
30
+ };
31
+ };
32
+ type UpdateAgentRequest = {
33
+ ref: string;
34
+ } & Omit<Partial<CreateAgentRequest>, "username" | "extended">;
35
+ type CreateAgentResponse = {
36
+ ref: string;
37
+ };
38
+ type UpdateAgentResponse = {
39
+ ref: string;
40
+ };
41
+ type GetAgentRequest = {
42
+ ref: string;
43
+ };
44
+ type DeleteAgentRequest = {
45
+ ref: string;
46
+ };
47
+ type ListAgentsRequest = {
48
+ pageSize: number;
49
+ pageToken: string;
50
+ };
51
+ type ListAgentsResponse = {
52
+ items: Agent[];
53
+ nextPageToken: string;
54
+ };
55
+ type AgentsApi = {
56
+ createAgent(request: CreateAgentRequest): Promise<CreateAgentResponse>;
57
+ updateAgent(request: UpdateAgentRequest): Promise<UpdateAgentResponse>;
58
+ getAgent(ref: string): Promise<Agent>;
59
+ deleteAgent(ref: string): Promise<void>;
60
+ listAgents(request: ListAgentsRequest): Promise<ListAgentsResponse>;
61
+ };
62
+ export { Agent, CreateAgentRequest, UpdateAgentRequest, CreateAgentResponse, UpdateAgentResponse, GetAgentRequest, DeleteAgentRequest, ListAgentsRequest, ListAgentsResponse, AgentsApi, Privacy };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Privacy = void 0;
4
+ var Privacy;
5
+ (function (Privacy) {
6
+ Privacy["PRIVATE"] = "ID";
7
+ Privacy["NONE"] = "NONE";
8
+ })(Privacy || (exports.Privacy = Privacy = {}));
@@ -0,0 +1 @@
1
+ export { buildService as buildAgentsService } from "./buildService";
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAgentsService = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var buildService_1 = require("./buildService");
23
+ Object.defineProperty(exports, "buildAgentsService", { enumerable: true, get: function () { return buildService_1.buildService; } });
@@ -0,0 +1,21 @@
1
+ import { AgentsApi, GetAgentRequest } from "./client";
2
+ import { Agent, CreateAgentRequest } from "./types";
3
+ declare function createAgent(agents: AgentsApi): (call: {
4
+ request: CreateAgentRequest;
5
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Agent) => void) => Promise<void>;
6
+ declare function updateAgent(agents: AgentsApi): (call: {
7
+ request: import("./client").UpdateAgentRequest;
8
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Agent) => void) => Promise<void>;
9
+ declare function getAgent(agents: AgentsApi): (call: {
10
+ request: GetAgentRequest;
11
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Agent) => void) => Promise<void>;
12
+ declare function listAgents(agents: AgentsApi): (call: {
13
+ request: import("./client").ListAgentsRequest;
14
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: {
15
+ nextPageToken?: string;
16
+ items: Agent[];
17
+ }) => void) => Promise<void>;
18
+ declare function deleteAgent(agents: AgentsApi): (call: {
19
+ request: import("./client").DeleteAgentRequest;
20
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: Agent) => void) => Promise<void>;
21
+ export { createAgent, updateAgent, getAgent, listAgents, deleteAgent };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteAgent = exports.listAgents = exports.getAgent = exports.updateAgent = exports.createAgent = void 0;
4
+ const createResource_1 = require("../resources/createResource");
5
+ const deleteResource_1 = require("../resources/deleteResource");
6
+ const getResource_1 = require("../resources/getResource");
7
+ const listResources_1 = require("../resources/listResources");
8
+ const updateResource_1 = require("../resources/updateResource");
9
+ const RESOURCE = "Agent";
10
+ function createAgent(agents) {
11
+ return (0, createResource_1.createResource)(agents, RESOURCE);
12
+ }
13
+ exports.createAgent = createAgent;
14
+ function updateAgent(agents) {
15
+ return (0, updateResource_1.updateResource)(agents, RESOURCE);
16
+ }
17
+ exports.updateAgent = updateAgent;
18
+ function getAgent(agents) {
19
+ return (0, getResource_1.getResource)(agents, RESOURCE);
20
+ }
21
+ exports.getAgent = getAgent;
22
+ function listAgents(agents) {
23
+ return (0, listResources_1.listResources)(agents, RESOURCE);
24
+ }
25
+ exports.listAgents = listAgents;
26
+ function deleteAgent(agents) {
27
+ return (0, deleteResource_1.deleteResource)(agents, RESOURCE);
28
+ }
29
+ exports.deleteAgent = deleteAgent;
@@ -0,0 +1,14 @@
1
+ import * as RTypes from "./client";
2
+ type Agent = Omit<RTypes.Agent, "extended">;
3
+ type CreateAgentRequest = Omit<RTypes.CreateAgentRequest, "extended">;
4
+ type CreateAgentResponse = RTypes.CreateAgentResponse;
5
+ type UpdateAgentRequest = RTypes.UpdateAgentRequest;
6
+ type UpdateAgentResponse = RTypes.UpdateAgentResponse;
7
+ type GetAgentRequest = RTypes.GetAgentRequest;
8
+ type ListAgentsRequest = RTypes.ListAgentsRequest;
9
+ type ListAgentsResponse = RTypes.ListAgentsResponse;
10
+ type DeleteAgentRequest = RTypes.DeleteAgentRequest;
11
+ type DeleteAgentResponse = {
12
+ ref: string;
13
+ };
14
+ export type { Agent, CreateAgentRequest, CreateAgentResponse, UpdateAgentRequest, UpdateAgentResponse, GetAgentRequest, ListAgentsRequest, ListAgentsResponse, DeleteAgentRequest, DeleteAgentResponse };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ declare const APP_REF_HEADER = "x-app-ref";
2
+ declare const ROUTR_DEFAULT_PEER_AOR = "sip:voice@default";
3
+ export { APP_REF_HEADER, ROUTR_DEFAULT_PEER_AOR };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ROUTR_DEFAULT_PEER_AOR = exports.APP_REF_HEADER = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const APP_REF_HEADER = "x-app-ref";
23
+ exports.APP_REF_HEADER = APP_REF_HEADER;
24
+ // TODO: Fix duplicated constant (exist in the apiserver)
25
+ const ROUTR_DEFAULT_PEER_AOR = "sip:voice@default";
26
+ exports.ROUTR_DEFAULT_PEER_AOR = ROUTR_DEFAULT_PEER_AOR;
@@ -0,0 +1,30 @@
1
+ import { ClientOptions } from "../types";
2
+ declare function buildService(clientOptions: ClientOptions): {
3
+ definition: {
4
+ serviceName: string;
5
+ pckg: string;
6
+ version: string;
7
+ proto: string;
8
+ };
9
+ handlers: {
10
+ createCredentials: (call: {
11
+ request: import("./types").CreateCredentialsRequest;
12
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Credentials) => void) => Promise<void>;
13
+ updateCredentials: (call: {
14
+ request: import("./client").UpdateCredentialsRequest;
15
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Credentials) => void) => Promise<void>;
16
+ getCredentials: (call: {
17
+ request: import("./client").GetCredentialsRequest;
18
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Credentials) => void) => Promise<void>;
19
+ listCredentials: (call: {
20
+ request: import("./client").ListCredentialsRequest;
21
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: {
22
+ nextPageToken?: string;
23
+ items: import("./types").Credentials[];
24
+ }) => void) => Promise<void>;
25
+ deleteCredentials: (call: {
26
+ request: import("./client").DeleteCredentialsRequest;
27
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: import("./types").Credentials) => void) => Promise<void>;
28
+ };
29
+ };
30
+ export { buildService };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildService = void 0;
7
+ /*
8
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
9
+ * http://github.com/fonoster/fonoster
10
+ *
11
+ * This file is part of Fonoster
12
+ *
13
+ * Licensed under the MIT License (the "License");
14
+ * you may not use this file except in compliance with
15
+ * the License. You may obtain a copy of the License at
16
+ *
17
+ * https://opensource.org/licenses/MIT
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ */
25
+ const sdk_1 = __importDefault(require("@routr/sdk"));
26
+ const operations_1 = require("./operations");
27
+ function buildService(clientOptions) {
28
+ const client = new sdk_1.default.Credentials(clientOptions);
29
+ return {
30
+ definition: {
31
+ serviceName: "CredentialsService",
32
+ pckg: "credentials",
33
+ version: "v1beta2",
34
+ proto: "credentials.proto"
35
+ },
36
+ handlers: {
37
+ createCredentials: (0, operations_1.createCredentials)(client),
38
+ updateCredentials: (0, operations_1.updateCredentials)(client),
39
+ getCredentials: (0, operations_1.getCredentials)(client),
40
+ listCredentials: (0, operations_1.listCredentials)(client),
41
+ deleteCredentials: (0, operations_1.deleteCredentials)(client)
42
+ }
43
+ };
44
+ }
45
+ exports.buildService = buildService;