@routr/ctl 2.0.8-alpha.21
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/LICENSE +21 -0
- package/README.md +973 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +25 -0
- package/bin/run.cmd +3 -0
- package/dist/base.d.ts +8 -0
- package/dist/base.js +42 -0
- package/dist/commands/acl/create.d.ts +6 -0
- package/dist/commands/acl/create.js +122 -0
- package/dist/commands/acl/delete.d.ts +6 -0
- package/dist/commands/acl/delete.js +40 -0
- package/dist/commands/acl/get.d.ts +19 -0
- package/dist/commands/acl/get.js +135 -0
- package/dist/commands/acl/update.d.ts +11 -0
- package/dist/commands/acl/update.js +100 -0
- package/dist/commands/agents/create.d.ts +6 -0
- package/dist/commands/agents/create.js +179 -0
- package/dist/commands/agents/delete.d.ts +6 -0
- package/dist/commands/agents/delete.js +40 -0
- package/dist/commands/agents/get.d.ts +19 -0
- package/dist/commands/agents/get.js +149 -0
- package/dist/commands/agents/update.d.ts +11 -0
- package/dist/commands/agents/update.js +150 -0
- package/dist/commands/credentials/create.d.ts +6 -0
- package/dist/commands/credentials/create.js +122 -0
- package/dist/commands/credentials/delete.d.ts +6 -0
- package/dist/commands/credentials/delete.js +40 -0
- package/dist/commands/credentials/get.d.ts +19 -0
- package/dist/commands/credentials/get.js +130 -0
- package/dist/commands/credentials/update.d.ts +11 -0
- package/dist/commands/credentials/update.js +98 -0
- package/dist/commands/domains/create.d.ts +6 -0
- package/dist/commands/domains/create.js +187 -0
- package/dist/commands/domains/delete.d.ts +6 -0
- package/dist/commands/domains/delete.js +40 -0
- package/dist/commands/domains/get.d.ts +19 -0
- package/dist/commands/domains/get.js +142 -0
- package/dist/commands/domains/update.d.ts +11 -0
- package/dist/commands/domains/update.js +163 -0
- package/dist/commands/numbers/create.d.ts +6 -0
- package/dist/commands/numbers/create.js +171 -0
- package/dist/commands/numbers/delete.d.ts +6 -0
- package/dist/commands/numbers/delete.js +40 -0
- package/dist/commands/numbers/get.d.ts +19 -0
- package/dist/commands/numbers/get.js +147 -0
- package/dist/commands/numbers/update.d.ts +11 -0
- package/dist/commands/numbers/update.js +130 -0
- package/dist/commands/peers/create.d.ts +6 -0
- package/dist/commands/peers/create.js +177 -0
- package/dist/commands/peers/delete.d.ts +6 -0
- package/dist/commands/peers/delete.js +40 -0
- package/dist/commands/peers/get.d.ts +19 -0
- package/dist/commands/peers/get.js +159 -0
- package/dist/commands/peers/update.d.ts +11 -0
- package/dist/commands/peers/update.js +156 -0
- package/dist/commands/trunks/create.d.ts +6 -0
- package/dist/commands/trunks/create.js +231 -0
- package/dist/commands/trunks/delete.d.ts +6 -0
- package/dist/commands/trunks/delete.js +40 -0
- package/dist/commands/trunks/get.d.ts +19 -0
- package/dist/commands/trunks/get.js +145 -0
- package/dist/commands/trunks/update.d.ts +11 -0
- package/dist/commands/trunks/update.js +217 -0
- package/dist/countries.d.ts +4 -0
- package/dist/countries.js +270 -0
- package/dist/delete.d.ts +9 -0
- package/dist/delete.js +46 -0
- package/dist/help.d.ts +6 -0
- package/dist/help.js +84 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -0
- package/dist/utils.d.ts +22 -0
- package/dist/utils.js +97 -0
- package/dist/validators.d.ts +16 -0
- package/dist/validators.js +180 -0
- package/oclif.manifest.json +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
/*
|
|
27
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
28
|
+
* http://github.com/fonoster
|
|
29
|
+
*
|
|
30
|
+
* This file is part of Routr.
|
|
31
|
+
*
|
|
32
|
+
* Licensed under the MIT License (the "License");
|
|
33
|
+
* you may not use this file except in compliance with
|
|
34
|
+
* the License. You may obtain a copy of the License at
|
|
35
|
+
*
|
|
36
|
+
* https://opensource.org/licenses/MIT
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
40
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
+
* See the License for the specific language governing permissions and
|
|
42
|
+
* limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
/* eslint-disable require-jsdoc */
|
|
45
|
+
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
46
|
+
const core_1 = require("@oclif/core");
|
|
47
|
+
const base_1 = require("../../base");
|
|
48
|
+
const utils_1 = require("../../utils");
|
|
49
|
+
const common_1 = require("@routr/common");
|
|
50
|
+
const errors_1 = require("@oclif/core/lib/errors");
|
|
51
|
+
class GetTrunksCommand extends base_1.BaseCommand {
|
|
52
|
+
async run() {
|
|
53
|
+
const { args, flags } = await this.parse(GetTrunksCommand);
|
|
54
|
+
const showTable = (request) => {
|
|
55
|
+
const { showHeader, data, self, flags } = request;
|
|
56
|
+
core_1.CliUx.ux.table(data, {
|
|
57
|
+
ref: {
|
|
58
|
+
minWidth: 7,
|
|
59
|
+
extended: true
|
|
60
|
+
},
|
|
61
|
+
name: {
|
|
62
|
+
minWidth: 7
|
|
63
|
+
},
|
|
64
|
+
inboundUri: {
|
|
65
|
+
header: "Inbound SIP URI"
|
|
66
|
+
},
|
|
67
|
+
accessControlListRef: {
|
|
68
|
+
header: "IP Access Control List",
|
|
69
|
+
get: (row) => { var _a; return ((_a = row.accessControlList) === null || _a === void 0 ? void 0 : _a.name) || "None"; },
|
|
70
|
+
extended: true
|
|
71
|
+
},
|
|
72
|
+
inboundCredentialsRef: {
|
|
73
|
+
header: "Inbound Credentials Name",
|
|
74
|
+
get: (row) => { var _a; return ((_a = row.inboundCredentials) === null || _a === void 0 ? void 0 : _a.name) || "None"; },
|
|
75
|
+
extended: true
|
|
76
|
+
},
|
|
77
|
+
outboundCredentialsRef: {
|
|
78
|
+
header: "Outbound Credentials Name",
|
|
79
|
+
get: (row) => { var _a; return ((_a = row.outboundCredentials) === null || _a === void 0 ? void 0 : _a.name) || "None"; },
|
|
80
|
+
extended: true
|
|
81
|
+
},
|
|
82
|
+
createdAt: {
|
|
83
|
+
header: "Created",
|
|
84
|
+
get: (row) => new Date(row.createdAt * 1000),
|
|
85
|
+
extended: true
|
|
86
|
+
},
|
|
87
|
+
updatedAt: {
|
|
88
|
+
header: "Updated",
|
|
89
|
+
get: (row) => new Date(row.updatedAt * 1000),
|
|
90
|
+
extended: true
|
|
91
|
+
},
|
|
92
|
+
extended: {
|
|
93
|
+
header: "Extended",
|
|
94
|
+
get: (row) => row.extended || {},
|
|
95
|
+
extended: true
|
|
96
|
+
},
|
|
97
|
+
apiVersion: {
|
|
98
|
+
header: "API",
|
|
99
|
+
extended: true
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
"no-header": !showHeader,
|
|
103
|
+
printLine: self.log.bind(self),
|
|
104
|
+
...flags // parsed flags
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
await (0, utils_1.showPaginatedList)({
|
|
108
|
+
showTable,
|
|
109
|
+
args,
|
|
110
|
+
flags,
|
|
111
|
+
kind: common_1.CommonConnect.Kind.TRUNK,
|
|
112
|
+
self: this
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async catch(error) {
|
|
116
|
+
// To be handled globally
|
|
117
|
+
if ("code" in error && error.code === grpc.status.NOT_FOUND) {
|
|
118
|
+
const { args } = await this.parse(GetTrunksCommand);
|
|
119
|
+
throw new errors_1.CLIError("the Trunk you are looking for does not exist: " + args.ref);
|
|
120
|
+
}
|
|
121
|
+
throw new errors_1.CLIError(error.message);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.default = GetTrunksCommand;
|
|
125
|
+
GetTrunksCommand.description = "Shows a list of paginated Trunks or a single Trunk if ref is provided";
|
|
126
|
+
GetTrunksCommand.examples = [
|
|
127
|
+
`<%= config.bin %> <%= command.id %>
|
|
128
|
+
Ref Name Inbound SIP URI
|
|
129
|
+
8cde8ea9-3c58-4dbe-b2cf-23c4413dd4cc Local sip.t01.provider.net
|
|
130
|
+
`
|
|
131
|
+
];
|
|
132
|
+
GetTrunksCommand.flags = {
|
|
133
|
+
size: core_1.Flags.integer({
|
|
134
|
+
char: "s",
|
|
135
|
+
description: "the number of items to return",
|
|
136
|
+
default: 50
|
|
137
|
+
})
|
|
138
|
+
};
|
|
139
|
+
GetTrunksCommand.args = [
|
|
140
|
+
{
|
|
141
|
+
name: "ref",
|
|
142
|
+
required: false,
|
|
143
|
+
description: "optional reference to a Trunk"
|
|
144
|
+
}
|
|
145
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from "../../base";
|
|
2
|
+
export default class UpdateCommand extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
name: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
/*
|
|
7
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
8
|
+
* http://github.com/fonoster
|
|
9
|
+
*
|
|
10
|
+
* This file is part of Routr.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the MIT License (the "License");
|
|
13
|
+
* you may not use this file except in compliance with
|
|
14
|
+
* the License. You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* https://opensource.org/licenses/MIT
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
/* eslint-disable require-jsdoc */
|
|
25
|
+
const core_1 = require("@oclif/core");
|
|
26
|
+
const base_1 = require("../../base");
|
|
27
|
+
const errors_1 = require("@oclif/core/lib/errors");
|
|
28
|
+
const common_1 = require("@routr/common");
|
|
29
|
+
const validators_1 = require("../../validators");
|
|
30
|
+
const sdk_1 = __importDefault(require("@routr/sdk"));
|
|
31
|
+
// NOTE: Newer versions of inquirer have a bug that causes the following error:
|
|
32
|
+
// (node:75345) [ERR_REQUIRE_ESM] Error Plugin: @routr/ctl [ERR_REQUIRE_ESM]: require() of ES Module
|
|
33
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
34
|
+
class UpdateCommand extends base_1.BaseCommand {
|
|
35
|
+
async run() {
|
|
36
|
+
const { args, flags } = await this.parse(UpdateCommand);
|
|
37
|
+
const { endpoint, insecure } = flags;
|
|
38
|
+
const api = new sdk_1.default.Trunks({ endpoint, insecure });
|
|
39
|
+
this.log("This utility will help you update an existing Trunk.");
|
|
40
|
+
this.log("Press ^C at any time to quit.");
|
|
41
|
+
this.warn("Adding Outbound SIP URIs will delete existing ones.");
|
|
42
|
+
const trunkFromDB = await api.getTrunk(args.ref);
|
|
43
|
+
// TODO: Add support for pagination
|
|
44
|
+
const acls = await new sdk_1.default.ACL({ endpoint, insecure }).listACLs({
|
|
45
|
+
pageSize: 25,
|
|
46
|
+
pageToken: ""
|
|
47
|
+
});
|
|
48
|
+
const aclChoices = acls.items.map((acl) => {
|
|
49
|
+
return {
|
|
50
|
+
name: acl.name,
|
|
51
|
+
value: acl.ref
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const credentials = await new sdk_1.default.Credentials({
|
|
55
|
+
endpoint,
|
|
56
|
+
insecure
|
|
57
|
+
}).listCredentials({
|
|
58
|
+
pageSize: 25,
|
|
59
|
+
pageToken: ""
|
|
60
|
+
});
|
|
61
|
+
const credentialsChoice = credentials.items.map((acl) => {
|
|
62
|
+
return {
|
|
63
|
+
name: acl.name,
|
|
64
|
+
value: acl.ref
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const group1 = await inquirer_1.default.prompt([
|
|
68
|
+
{
|
|
69
|
+
name: "name",
|
|
70
|
+
message: "Friendly Name",
|
|
71
|
+
type: "input",
|
|
72
|
+
default: trunkFromDB.name,
|
|
73
|
+
validate: validators_1.nameValidator
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "inboundUri",
|
|
77
|
+
message: "Inbound SIP URI",
|
|
78
|
+
type: "input",
|
|
79
|
+
validate: validators_1.inboundUriValidator,
|
|
80
|
+
default: trunkFromDB.inboundUri
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "accessControlListRef",
|
|
84
|
+
message: "IP Access Control List",
|
|
85
|
+
type: "list",
|
|
86
|
+
default: trunkFromDB.accessControlListRef,
|
|
87
|
+
choices: [{ name: "None", value: undefined }, ...aclChoices]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "inboundCredentialsRef",
|
|
91
|
+
message: "Inbound Credentials",
|
|
92
|
+
type: "list",
|
|
93
|
+
default: trunkFromDB.inboundCredentialsRef,
|
|
94
|
+
choices: [{ name: "None", value: undefined }, ...credentialsChoice]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "outboundCredentialsRef",
|
|
98
|
+
message: "Outbound Credentials",
|
|
99
|
+
type: "list",
|
|
100
|
+
default: trunkFromDB.outboundCredentialsRef,
|
|
101
|
+
choices: [{ name: "None", value: undefined }, ...credentialsChoice]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "addOutboundUri",
|
|
105
|
+
message: "Add an Outbound SIP URI?",
|
|
106
|
+
type: "confirm",
|
|
107
|
+
default: false
|
|
108
|
+
}
|
|
109
|
+
]);
|
|
110
|
+
const group2Questions = [
|
|
111
|
+
{
|
|
112
|
+
name: "host",
|
|
113
|
+
message: "Host",
|
|
114
|
+
type: "input",
|
|
115
|
+
validate: validators_1.hostValidator
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "port",
|
|
119
|
+
message: "Post",
|
|
120
|
+
type: "input",
|
|
121
|
+
default: "5060",
|
|
122
|
+
validate: validators_1.portValidator
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "transport",
|
|
126
|
+
message: "Transport",
|
|
127
|
+
type: "list",
|
|
128
|
+
choices: [common_1.CommonTypes.Transport.UDP, common_1.CommonTypes.Transport.TCP, common_1.CommonTypes.Transport.TLS],
|
|
129
|
+
default: common_1.CommonTypes.Transport.UDP
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "user",
|
|
133
|
+
message: "User Part",
|
|
134
|
+
type: "input",
|
|
135
|
+
validate: validators_1.optionalUsernameValidator
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "priority",
|
|
139
|
+
message: "Priority",
|
|
140
|
+
type: "input",
|
|
141
|
+
default: "10",
|
|
142
|
+
validate: validators_1.priorityValidator
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "weight",
|
|
146
|
+
message: "Weight",
|
|
147
|
+
type: "input",
|
|
148
|
+
default: "10",
|
|
149
|
+
validate: validators_1.weightValidator
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "addOutboundUri",
|
|
153
|
+
message: "Add another Outbound SIP URI?",
|
|
154
|
+
type: "confirm",
|
|
155
|
+
default: false
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
let addOutboundUri = group1.addOutboundUri;
|
|
159
|
+
const uris = [];
|
|
160
|
+
// eslint-disable-next-line no-loops/no-loops
|
|
161
|
+
while (addOutboundUri) {
|
|
162
|
+
const group2 = await inquirer_1.default.prompt(group2Questions);
|
|
163
|
+
if (group2.numberRef) {
|
|
164
|
+
uris.push({
|
|
165
|
+
host: group2.host,
|
|
166
|
+
port: group2.port,
|
|
167
|
+
transport: group2.transport,
|
|
168
|
+
user: group2.user,
|
|
169
|
+
priority: group2.priority,
|
|
170
|
+
weight: group2.weight,
|
|
171
|
+
enabled: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
addOutboundUri = group2.addOutboundUri;
|
|
175
|
+
}
|
|
176
|
+
const group3 = await inquirer_1.default.prompt([
|
|
177
|
+
{
|
|
178
|
+
name: "confirm",
|
|
179
|
+
message: "Ready?",
|
|
180
|
+
type: "confirm"
|
|
181
|
+
}
|
|
182
|
+
]);
|
|
183
|
+
if (!group3.confirm) {
|
|
184
|
+
this.warn("Aborted");
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
try {
|
|
188
|
+
core_1.CliUx.ux.action.start(`Updating Trunk ${group1.name}`);
|
|
189
|
+
const trunk = await api.updateTrunk({
|
|
190
|
+
ref: trunkFromDB.ref,
|
|
191
|
+
...group1,
|
|
192
|
+
uris
|
|
193
|
+
});
|
|
194
|
+
await core_1.CliUx.ux.wait(1000);
|
|
195
|
+
core_1.CliUx.ux.action.stop(trunk.ref);
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
core_1.CliUx.ux.action.stop();
|
|
199
|
+
throw new errors_1.CLIError(e.message);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.default = UpdateCommand;
|
|
205
|
+
UpdateCommand.description = "Updates an existing Trunk";
|
|
206
|
+
UpdateCommand.examples = [
|
|
207
|
+
`<%= config.bin %> <%= command.id %>
|
|
208
|
+
Updating Trunk T01... 80181ca6-d4aa-4575-9375-8f72b07d5555
|
|
209
|
+
`
|
|
210
|
+
];
|
|
211
|
+
UpdateCommand.args = [
|
|
212
|
+
{
|
|
213
|
+
name: "ref",
|
|
214
|
+
required: true,
|
|
215
|
+
description: "reference to an existing Trunk"
|
|
216
|
+
}
|
|
217
|
+
];
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countries = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
6
|
+
* http://github.com/fonoster
|
|
7
|
+
*
|
|
8
|
+
* This file is part of Routr.
|
|
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
|
+
exports.countries = [
|
|
23
|
+
{ name: "Afghanistan", value: "AF" },
|
|
24
|
+
{ name: "Åland Islands", value: "AX" },
|
|
25
|
+
{ name: "Albania", value: "AL" },
|
|
26
|
+
{ name: "Algeria", value: "DZ" },
|
|
27
|
+
{ name: "American Samoa", value: "AS" },
|
|
28
|
+
{ name: "AndorrA", value: "AD" },
|
|
29
|
+
{ name: "Angola", value: "AO" },
|
|
30
|
+
{ name: "Anguilla", value: "AI" },
|
|
31
|
+
{ name: "Antarctica", value: "AQ" },
|
|
32
|
+
{ name: "Antigua and Barbuda", value: "AG" },
|
|
33
|
+
{ name: "Argentina", value: "AR" },
|
|
34
|
+
{ name: "Armenia", value: "AM" },
|
|
35
|
+
{ name: "Aruba", value: "AW" },
|
|
36
|
+
{ name: "Australia", value: "AU" },
|
|
37
|
+
{ name: "Austria", value: "AT" },
|
|
38
|
+
{ name: "Azerbaijan", value: "AZ" },
|
|
39
|
+
{ name: "Bahamas", value: "BS" },
|
|
40
|
+
{ name: "Bahrain", value: "BH" },
|
|
41
|
+
{ name: "Bangladesh", value: "BD" },
|
|
42
|
+
{ name: "Barbados", value: "BB" },
|
|
43
|
+
{ name: "Belarus", value: "BY" },
|
|
44
|
+
{ name: "Belgium", value: "BE" },
|
|
45
|
+
{ name: "Belize", value: "BZ" },
|
|
46
|
+
{ name: "Benin", value: "BJ" },
|
|
47
|
+
{ name: "Bermuda", value: "BM" },
|
|
48
|
+
{ name: "Bhutan", value: "BT" },
|
|
49
|
+
{ name: "Bolivia", value: "BO" },
|
|
50
|
+
{ name: "Bosnia and Herzegovina", value: "BA" },
|
|
51
|
+
{ name: "Botswana", value: "BW" },
|
|
52
|
+
{ name: "Bouvet Island", value: "BV" },
|
|
53
|
+
{ name: "Brazil", value: "BR" },
|
|
54
|
+
{ name: "British Indian Ocean Territory", value: "IO" },
|
|
55
|
+
{ name: "Brunei Darussalam", value: "BN" },
|
|
56
|
+
{ name: "Bulgaria", value: "BG" },
|
|
57
|
+
{ name: "Burkina Faso", value: "BF" },
|
|
58
|
+
{ name: "Burundi", value: "BI" },
|
|
59
|
+
{ name: "Cambodia", value: "KH" },
|
|
60
|
+
{ name: "Cameroon", value: "CM" },
|
|
61
|
+
{ name: "Canada", value: "CA" },
|
|
62
|
+
{ name: "Cape Verde", value: "CV" },
|
|
63
|
+
{ name: "Cayman Islands", value: "KY" },
|
|
64
|
+
{ name: "Central African Republic", value: "CF" },
|
|
65
|
+
{ name: "Chad", value: "TD" },
|
|
66
|
+
{ name: "Chile", value: "CL" },
|
|
67
|
+
{ name: "China", value: "CN" },
|
|
68
|
+
{ name: "Christmas Island", value: "CX" },
|
|
69
|
+
{ name: "Cocos (Keeling) Islands", value: "CC" },
|
|
70
|
+
{ name: "Colombia", value: "CO" },
|
|
71
|
+
{ name: "Comoros", value: "KM" },
|
|
72
|
+
{ name: "Congo", value: "CG" },
|
|
73
|
+
{ name: "Congo, The Democratic Republic of the", value: "CD" },
|
|
74
|
+
{ name: "Cook Islands", value: "CK" },
|
|
75
|
+
{ name: "Costa Rica", value: "CR" },
|
|
76
|
+
{ name: "Cote D'Ivoire", value: "CI" },
|
|
77
|
+
{ name: "Croatia", value: "HR" },
|
|
78
|
+
{ name: "Cuba", value: "CU" },
|
|
79
|
+
{ name: "Cyprus", value: "CY" },
|
|
80
|
+
{ name: "Czech Republic", value: "CZ" },
|
|
81
|
+
{ name: "Denmark", value: "DK" },
|
|
82
|
+
{ name: "Djibouti", value: "DJ" },
|
|
83
|
+
{ name: "Dominica", value: "DM" },
|
|
84
|
+
{ name: "Dominican Republic", value: "DO" },
|
|
85
|
+
{ name: "Ecuador", value: "EC" },
|
|
86
|
+
{ name: "Egypt", value: "EG" },
|
|
87
|
+
{ name: "El Salvador", value: "SV" },
|
|
88
|
+
{ name: "Equatorial Guinea", value: "GQ" },
|
|
89
|
+
{ name: "Eritrea", value: "ER" },
|
|
90
|
+
{ name: "Estonia", value: "EE" },
|
|
91
|
+
{ name: "Ethiopia", value: "ET" },
|
|
92
|
+
{ name: "Falkland Islands (Malvinas)", value: "FK" },
|
|
93
|
+
{ name: "Faroe Islands", value: "FO" },
|
|
94
|
+
{ name: "Fiji", value: "FJ" },
|
|
95
|
+
{ name: "Finland", value: "FI" },
|
|
96
|
+
{ name: "France", value: "FR" },
|
|
97
|
+
{ name: "French Guiana", value: "GF" },
|
|
98
|
+
{ name: "French Polynesia", value: "PF" },
|
|
99
|
+
{ name: "French Southern Territories", value: "TF" },
|
|
100
|
+
{ name: "Gabon", value: "GA" },
|
|
101
|
+
{ name: "Gambia", value: "GM" },
|
|
102
|
+
{ name: "Georgia", value: "GE" },
|
|
103
|
+
{ name: "Germany", value: "DE" },
|
|
104
|
+
{ name: "Ghana", value: "GH" },
|
|
105
|
+
{ name: "Gibraltar", value: "GI" },
|
|
106
|
+
{ name: "Greece", value: "GR" },
|
|
107
|
+
{ name: "Greenland", value: "GL" },
|
|
108
|
+
{ name: "Grenada", value: "GD" },
|
|
109
|
+
{ name: "Guadeloupe", value: "GP" },
|
|
110
|
+
{ name: "Guam", value: "GU" },
|
|
111
|
+
{ name: "Guatemala", value: "GT" },
|
|
112
|
+
{ name: "Guernsey", value: "GG" },
|
|
113
|
+
{ name: "Guinea", value: "GN" },
|
|
114
|
+
{ name: "Guinea-Bissau", value: "GW" },
|
|
115
|
+
{ name: "Guyana", value: "GY" },
|
|
116
|
+
{ name: "Haiti", value: "HT" },
|
|
117
|
+
{ name: "Heard Island and Mcdonald Islands", value: "HM" },
|
|
118
|
+
{ name: "Holy See (Vatican City State)", value: "VA" },
|
|
119
|
+
{ name: "Honduras", value: "HN" },
|
|
120
|
+
{ name: "Hong Kong", value: "HK" },
|
|
121
|
+
{ name: "Hungary", value: "HU" },
|
|
122
|
+
{ name: "Iceland", value: "IS" },
|
|
123
|
+
{ name: "India", value: "IN" },
|
|
124
|
+
{ name: "Indonesia", value: "ID" },
|
|
125
|
+
{ name: "Iran, Islamic Republic Of", value: "IR" },
|
|
126
|
+
{ name: "Iraq", value: "IQ" },
|
|
127
|
+
{ name: "Ireland", value: "IE" },
|
|
128
|
+
{ name: "Isle of Man", value: "IM" },
|
|
129
|
+
{ name: "Israel", value: "IL" },
|
|
130
|
+
{ name: "Italy", value: "IT" },
|
|
131
|
+
{ name: "Jamaica", value: "JM" },
|
|
132
|
+
{ name: "Japan", value: "JP" },
|
|
133
|
+
{ name: "Jersey", value: "JE" },
|
|
134
|
+
{ name: "Jordan", value: "JO" },
|
|
135
|
+
{ name: "Kazakhstan", value: "KZ" },
|
|
136
|
+
{ name: "Kenya", value: "KE" },
|
|
137
|
+
{ name: "Kiribati", value: "KI" },
|
|
138
|
+
{ name: "Korea, Democratic People'S Republic of", value: "KP" },
|
|
139
|
+
{ name: "Korea, Republic of", value: "KR" },
|
|
140
|
+
{ name: "Kuwait", value: "KW" },
|
|
141
|
+
{ name: "Kyrgyzstan", value: "KG" },
|
|
142
|
+
{ name: "Lao People'S Democratic Republic", value: "LA" },
|
|
143
|
+
{ name: "Latvia", value: "LV" },
|
|
144
|
+
{ name: "Lebanon", value: "LB" },
|
|
145
|
+
{ name: "Lesotho", value: "LS" },
|
|
146
|
+
{ name: "Liberia", value: "LR" },
|
|
147
|
+
{ name: "Libyan Arab Jamahiriya", value: "LY" },
|
|
148
|
+
{ name: "Liechtenstein", value: "LI" },
|
|
149
|
+
{ name: "Lithuania", value: "LT" },
|
|
150
|
+
{ name: "Luxembourg", value: "LU" },
|
|
151
|
+
{ name: "Macao", value: "MO" },
|
|
152
|
+
{ name: "Macedonia, The Former Yugoslav Republic of", value: "MK" },
|
|
153
|
+
{ name: "Madagascar", value: "MG" },
|
|
154
|
+
{ name: "Malawi", value: "MW" },
|
|
155
|
+
{ name: "Malaysia", value: "MY" },
|
|
156
|
+
{ name: "Maldives", value: "MV" },
|
|
157
|
+
{ name: "Mali", value: "ML" },
|
|
158
|
+
{ name: "Malta", value: "MT" },
|
|
159
|
+
{ name: "Marshall Islands", value: "MH" },
|
|
160
|
+
{ name: "Martinique", value: "MQ" },
|
|
161
|
+
{ name: "Mauritania", value: "MR" },
|
|
162
|
+
{ name: "Mauritius", value: "MU" },
|
|
163
|
+
{ name: "Mayotte", value: "YT" },
|
|
164
|
+
{ name: "Mexico", value: "MX" },
|
|
165
|
+
{ name: "Micronesia, Federated States of", value: "FM" },
|
|
166
|
+
{ name: "Moldova, Republic of", value: "MD" },
|
|
167
|
+
{ name: "Monaco", value: "MC" },
|
|
168
|
+
{ name: "Mongolia", value: "MN" },
|
|
169
|
+
{ name: "Montenegro", value: "ME" },
|
|
170
|
+
{ name: "Montserrat", value: "MS" },
|
|
171
|
+
{ name: "Morocco", value: "MA" },
|
|
172
|
+
{ name: "Mozambique", value: "MZ" },
|
|
173
|
+
{ name: "Myanmar", value: "MM" },
|
|
174
|
+
{ name: "Namibia", value: "NA" },
|
|
175
|
+
{ name: "Nauru", value: "NR" },
|
|
176
|
+
{ name: "Nepal", value: "NP" },
|
|
177
|
+
{ name: "Netherlands", value: "NL" },
|
|
178
|
+
{ name: "New Caledonia", value: "NC" },
|
|
179
|
+
{ name: "New Zealand", value: "NZ" },
|
|
180
|
+
{ name: "Nicaragua", value: "NI" },
|
|
181
|
+
{ name: "Niger", value: "NE" },
|
|
182
|
+
{ name: "Nigeria", value: "NG" },
|
|
183
|
+
{ name: "Niue", value: "NU" },
|
|
184
|
+
{ name: "Norfolk Island", value: "NF" },
|
|
185
|
+
{ name: "Northern Mariana Islands", value: "MP" },
|
|
186
|
+
{ name: "Norway", value: "NO" },
|
|
187
|
+
{ name: "Oman", value: "OM" },
|
|
188
|
+
{ name: "Pakistan", value: "PK" },
|
|
189
|
+
{ name: "Palau", value: "PW" },
|
|
190
|
+
{ name: "Palestinian Territory", value: "PS" },
|
|
191
|
+
{ name: "Panama", value: "PA" },
|
|
192
|
+
{ name: "Papua New Guinea", value: "PG" },
|
|
193
|
+
{ name: "Paraguay", value: "PY" },
|
|
194
|
+
{ name: "Peru", value: "PE" },
|
|
195
|
+
{ name: "Philippines", value: "PH" },
|
|
196
|
+
{ name: "Pitcairn", value: "PN" },
|
|
197
|
+
{ name: "Poland", value: "PL" },
|
|
198
|
+
{ name: "Portugal", value: "PT" },
|
|
199
|
+
{ name: "Puerto Rico", value: "PR" },
|
|
200
|
+
{ name: "Qatar", value: "QA" },
|
|
201
|
+
{ name: "Réunion", value: "RE" },
|
|
202
|
+
{ name: "Romania", value: "RO" },
|
|
203
|
+
{ name: "Russian Federation", value: "RU" },
|
|
204
|
+
{ name: "Rwanda", value: "RW" },
|
|
205
|
+
{ name: "Saint Barthélemy", value: "BL" },
|
|
206
|
+
{ name: "Saint Helena, Ascension and Tristan da Cunha", value: "SH" },
|
|
207
|
+
{ name: "Saint Kitts and Nevis", value: "KN" },
|
|
208
|
+
{ name: "Saint Lucia", value: "LC" },
|
|
209
|
+
{ name: "Saint Martin (French part)", value: "MF" },
|
|
210
|
+
{ name: "Saint Pierre and Miquelon", value: "PM" },
|
|
211
|
+
{ name: "Saint Vincent and the Grenadines", value: "VC" },
|
|
212
|
+
{ name: "Samoa", value: "WS" },
|
|
213
|
+
{ name: "San Marino", value: "SM" },
|
|
214
|
+
{ name: "Sao Tome and Principe", value: "ST" },
|
|
215
|
+
{ name: "Saudi Arabia", value: "SA" },
|
|
216
|
+
{ name: "Senegal", value: "SN" },
|
|
217
|
+
{ name: "Serbia", value: "RS" },
|
|
218
|
+
{ name: "Seychelles", value: "SC" },
|
|
219
|
+
{ name: "Sierra Leone", value: "SL" },
|
|
220
|
+
{ name: "Singapore", value: "SG" },
|
|
221
|
+
{ name: "Sint Maarten (Dutch part)", value: "SX" },
|
|
222
|
+
{ name: "Slovakia", value: "SK" },
|
|
223
|
+
{ name: "Slovenia", value: "SI" },
|
|
224
|
+
{ name: "Solomon Islands", value: "SB" },
|
|
225
|
+
{ name: "Somalia", value: "SO" },
|
|
226
|
+
{ name: "South Africa", value: "ZA" },
|
|
227
|
+
{ name: "South Georgia and the South Sandwich Islands", value: "GS" },
|
|
228
|
+
{ name: "South Sudan", value: "SS" },
|
|
229
|
+
{ name: "Spain", value: "ES" },
|
|
230
|
+
{ name: "Sri Lanka", value: "LK" },
|
|
231
|
+
{ name: "Sudan", value: "SD" },
|
|
232
|
+
{ name: "Suriname", value: "SR" },
|
|
233
|
+
{ name: "Svalbard and Jan Mayen", value: "SJ" },
|
|
234
|
+
{ name: "Swaziland", value: "SZ" },
|
|
235
|
+
{ name: "Sweden", value: "SE" },
|
|
236
|
+
{ name: "Switzerland", value: "CH" },
|
|
237
|
+
{ name: "Syrian Arab Republic", value: "SY" },
|
|
238
|
+
{ name: "Taiwan, Province of China", value: "TW" },
|
|
239
|
+
{ name: "Tajikistan", value: "TJ" },
|
|
240
|
+
{ name: "Tanzania, United Republic of", value: "TZ" },
|
|
241
|
+
{ name: "Thailand", value: "TH" },
|
|
242
|
+
{ name: "Timor-Leste", value: "TL" },
|
|
243
|
+
{ name: "Togo", value: "TG" },
|
|
244
|
+
{ name: "Tokelau", value: "TK" },
|
|
245
|
+
{ name: "Tonga", value: "TO" },
|
|
246
|
+
{ name: "Trinidad and Tobago", value: "TT" },
|
|
247
|
+
{ name: "Tunisia", value: "TN" },
|
|
248
|
+
{ name: "Turkey", value: "TR" },
|
|
249
|
+
{ name: "Turkmenistan", value: "TM" },
|
|
250
|
+
{ name: "Turks and Caicos Islands", value: "TC" },
|
|
251
|
+
{ name: "Tuvalu", value: "TV" },
|
|
252
|
+
{ name: "Uganda", value: "UG" },
|
|
253
|
+
{ name: "Ukraine", value: "UA" },
|
|
254
|
+
{ name: "United Arab Emirates", value: "AE" },
|
|
255
|
+
{ name: "United Kingdom", value: "GB" },
|
|
256
|
+
{ name: "United States", value: "US" },
|
|
257
|
+
{ name: "United States Minor Outlying Islands", value: "UM" },
|
|
258
|
+
{ name: "Uruguay", value: "UY" },
|
|
259
|
+
{ name: "Uzbekistan", value: "UZ" },
|
|
260
|
+
{ name: "Vanuatu", value: "VU" },
|
|
261
|
+
{ name: "Venezuela, Bolivarian Republic of", value: "VE" },
|
|
262
|
+
{ name: "Viet Nam", value: "VN" },
|
|
263
|
+
{ name: "Virgin Islands, British", value: "VG" },
|
|
264
|
+
{ name: "Virgin Islands, U.S.", value: "VI" },
|
|
265
|
+
{ name: "Wallis and Futuna", value: "WF" },
|
|
266
|
+
{ name: "Western Sahara", value: "EH" },
|
|
267
|
+
{ name: "Yemen", value: "YE" },
|
|
268
|
+
{ name: "Zambia", value: "ZM" },
|
|
269
|
+
{ name: "Zimbabwe", value: "ZW" }
|
|
270
|
+
];
|
package/dist/delete.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from "./base";
|
|
2
|
+
export default abstract class DeleteCommand extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
name: string;
|
|
5
|
+
}[];
|
|
6
|
+
deleteResource(API: any, funcName: string): Promise<void>;
|
|
7
|
+
catch(err: Error): Promise<any>;
|
|
8
|
+
finally(err: Error): Promise<any>;
|
|
9
|
+
}
|