@fonoster/sdk 0.6.2-alpha.0 → 0.6.2

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.
@@ -1,12 +1,152 @@
1
1
  import { BaseApiObject, CreateNumberRequest, INumber, ListNumbersRequest, ListNumbersResponse, UpdateNumberRequest } from "@fonoster/types";
2
2
  import { FonosterClient } from "./client/types";
3
+ /**
4
+ * @classdesc Fonoster Numbers, part of the Fonoster SIP Proxy subsystem,
5
+ * allows you to create, update, retrieve, and delete SIP Number for your deployment.
6
+ * Note that an active Fonoster deployment is required.
7
+ *
8
+ * @example
9
+ *
10
+ * const SDK = require("@fonoster/sdk");
11
+ *
12
+ * async function main(request) {
13
+ * const apiKey = "your-api-key";
14
+ * const accessKeyId = "00000000-0000-0000-0000-000000000000";
15
+ *
16
+ * try {
17
+ * const client = SDK.Client({ accessKeyId });
18
+ * await client.loginWithApiKey(apiKey);
19
+ *
20
+ * const numbers = new SDK.Numbers(client);
21
+ * const response = await numbers.createNumber(request);
22
+ *
23
+ * console.log(response); // successful response
24
+ * } catch (e) {
25
+ * console.error(e); // an error occurred
26
+ * }
27
+ * }
28
+ *
29
+ * const request = {
30
+ * name: "My Number",
31
+ * telUrl: "tel:+17853178070",
32
+ * city: "Asheville",
33
+ * country: "United States",
34
+ * countryIsoCode: "US"
35
+ * };
36
+ *
37
+ * main(request).catch(console.error);
38
+ */
3
39
  declare class Numbers {
4
40
  private client;
41
+ /**
42
+ * Constructs a new Numbers object.
43
+ *
44
+ * @param {FonosterClient} client - Client object with underlying implementations to make requests to Fonoster's API
45
+ * @see AbstractClient
46
+ * @see FonosterClient
47
+ */
5
48
  constructor(client: FonosterClient);
49
+ /**
50
+ * Creates a new Number in the Workspace.
51
+ *
52
+ * @param {CreateNumberRequest} request - The request object that contains the necessary information to create a new Number
53
+ * @param {string} request.name - The name of the Number
54
+ * @param {string} request.telUrl - The telUrl of the Number
55
+ * @param {string} request.city - The city of the Number
56
+ * @param {string} request.country - The country of the Number
57
+ * @param {string} request.countryIsoCode - The countryIsoCode of the Number
58
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Number
59
+ * @example
60
+ *
61
+ * const request = {
62
+ * name: "My Number",
63
+ * telUrl: "tel:+17853178070",
64
+ * city: "Asheville",
65
+ * country: "United States",
66
+ * countryIsoCode: "US"
67
+ * };
68
+ *
69
+ * const numbers = new SDK.Numbers(client); // Existing client object
70
+ *
71
+ * numbers.createNumber(request)
72
+ * .then(console.log) // successful response
73
+ * .catch(console.error); // an error occurred
74
+ */
6
75
  createNumber(request: CreateNumberRequest): Promise<BaseApiObject>;
76
+ /**
77
+ * Retrieves an existing Number in the Workspace.
78
+ *
79
+ * @param {string} ref - The reference of the Number to retrieve
80
+ * @return {Promise<Acl>} - The response object that contains the Number
81
+ * @example
82
+ *
83
+ * const ref = "00000000-0000-0000-0000-000000000000"
84
+ *
85
+ * const numbers = new SDK.Numbers(client); // Existing client object
86
+ *
87
+ * numbers.getNumber(ref)
88
+ * .then(console.log) // successful response
89
+ * .catch(console.error); // an error occurred
90
+ */
7
91
  getNumber(ref: string): Promise<INumber>;
92
+ /**
93
+ * Updates an existing Number in the Workspace.
94
+ *
95
+ * @param {UpdateNumberRequest} request - The request object that contains the necessary information to update an existing Number
96
+ * @param {string} request.ref - The reference of the Number to update
97
+ * @param {string} request.name - The name of the Number
98
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Number
99
+ * @example
100
+ *
101
+ * const request = {
102
+ * ref: "00000000-0000-0000-0000-000000000000",
103
+ * name: "My Number"
104
+ * };
105
+ *
106
+ * const numbers = new SDK.Numbers(client); // Existing client object
107
+ *
108
+ * numbers.updateNumber(request)
109
+ * .then(console.log) // successful response
110
+ * .catch(console.error); // an error occurred
111
+ */
8
112
  updateNumber(request: UpdateNumberRequest): Promise<BaseApiObject>;
113
+ /**
114
+ * Retrieves a list of Numbers from a Workspace.
115
+ *
116
+ * @param {ListNumbersRequest} request - The request object that contains the necessary information to retrieve a list of Numbers
117
+ * @param {number} request.pageSize - The number of Numbers to retrieve
118
+ * @param {string} request.pageToken - The token to retrieve the next page of Numbers
119
+ * @return {Promise<ListNumbersResponse>} - The response object that contains the list of Numbers
120
+ * @example
121
+ *
122
+ * const request = {
123
+ * pageSize: 10,
124
+ * pageToken: "00000000-0000-0000-0000-000000000000"
125
+ * };
126
+ *
127
+ * const numbers = new SDK.Numbers(client); // Existing client object
128
+ *
129
+ * numbers.listNumbers(request)
130
+ * .then(console.log) // successful response
131
+ * .catch(console.error); // an error occurred
132
+ */
9
133
  listNumbers(request: ListNumbersRequest): Promise<ListNumbersResponse>;
134
+ /**
135
+ * Deletes an existing Number from Fonoster.
136
+ * Note that this operation is irreversible.
137
+ *
138
+ * @param {string} ref - The reference of the Number to delete
139
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Number
140
+ * @example
141
+ *
142
+ * const ref = "00000000-0000-0000-0000-000000000000"
143
+ *
144
+ * const numbers = new SDK.Numbers(client); // Existing client object
145
+ *
146
+ * numbers.deleteDomain(ref)
147
+ * .then(console.log) // successful response
148
+ * .catch(console.error); // an error occurred
149
+ */
10
150
  deleteNumber(ref: string): Promise<BaseApiObject>;
11
151
  }
12
152
  export { Numbers };
@@ -3,11 +3,80 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Numbers = void 0;
4
4
  const makeRpcRequest_1 = require("./client/makeRpcRequest");
5
5
  const numbers_pb_1 = require("./generated/node/numbers_pb");
6
+ /**
7
+ * @classdesc Fonoster Numbers, part of the Fonoster SIP Proxy subsystem,
8
+ * allows you to create, update, retrieve, and delete SIP Number for your deployment.
9
+ * Note that an active Fonoster deployment is required.
10
+ *
11
+ * @example
12
+ *
13
+ * const SDK = require("@fonoster/sdk");
14
+ *
15
+ * async function main(request) {
16
+ * const apiKey = "your-api-key";
17
+ * const accessKeyId = "00000000-0000-0000-0000-000000000000";
18
+ *
19
+ * try {
20
+ * const client = SDK.Client({ accessKeyId });
21
+ * await client.loginWithApiKey(apiKey);
22
+ *
23
+ * const numbers = new SDK.Numbers(client);
24
+ * const response = await numbers.createNumber(request);
25
+ *
26
+ * console.log(response); // successful response
27
+ * } catch (e) {
28
+ * console.error(e); // an error occurred
29
+ * }
30
+ * }
31
+ *
32
+ * const request = {
33
+ * name: "My Number",
34
+ * telUrl: "tel:+17853178070",
35
+ * city: "Asheville",
36
+ * country: "United States",
37
+ * countryIsoCode: "US"
38
+ * };
39
+ *
40
+ * main(request).catch(console.error);
41
+ */
6
42
  class Numbers {
7
43
  client;
44
+ /**
45
+ * Constructs a new Numbers object.
46
+ *
47
+ * @param {FonosterClient} client - Client object with underlying implementations to make requests to Fonoster's API
48
+ * @see AbstractClient
49
+ * @see FonosterClient
50
+ */
8
51
  constructor(client) {
9
52
  this.client = client;
10
53
  }
54
+ /**
55
+ * Creates a new Number in the Workspace.
56
+ *
57
+ * @param {CreateNumberRequest} request - The request object that contains the necessary information to create a new Number
58
+ * @param {string} request.name - The name of the Number
59
+ * @param {string} request.telUrl - The telUrl of the Number
60
+ * @param {string} request.city - The city of the Number
61
+ * @param {string} request.country - The country of the Number
62
+ * @param {string} request.countryIsoCode - The countryIsoCode of the Number
63
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Number
64
+ * @example
65
+ *
66
+ * const request = {
67
+ * name: "My Number",
68
+ * telUrl: "tel:+17853178070",
69
+ * city: "Asheville",
70
+ * country: "United States",
71
+ * countryIsoCode: "US"
72
+ * };
73
+ *
74
+ * const numbers = new SDK.Numbers(client); // Existing client object
75
+ *
76
+ * numbers.createNumber(request)
77
+ * .then(console.log) // successful response
78
+ * .catch(console.error); // an error occurred
79
+ */
11
80
  async createNumber(request) {
12
81
  const client = this.client.getNumbersClient();
13
82
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -17,6 +86,21 @@ class Numbers {
17
86
  request
18
87
  });
19
88
  }
89
+ /**
90
+ * Retrieves an existing Number in the Workspace.
91
+ *
92
+ * @param {string} ref - The reference of the Number to retrieve
93
+ * @return {Promise<Acl>} - The response object that contains the Number
94
+ * @example
95
+ *
96
+ * const ref = "00000000-0000-0000-0000-000000000000"
97
+ *
98
+ * const numbers = new SDK.Numbers(client); // Existing client object
99
+ *
100
+ * numbers.getNumber(ref)
101
+ * .then(console.log) // successful response
102
+ * .catch(console.error); // an error occurred
103
+ */
20
104
  async getNumber(ref) {
21
105
  const client = this.client.getNumbersClient();
22
106
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -26,6 +110,26 @@ class Numbers {
26
110
  request: { ref }
27
111
  });
28
112
  }
113
+ /**
114
+ * Updates an existing Number in the Workspace.
115
+ *
116
+ * @param {UpdateNumberRequest} request - The request object that contains the necessary information to update an existing Number
117
+ * @param {string} request.ref - The reference of the Number to update
118
+ * @param {string} request.name - The name of the Number
119
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Number
120
+ * @example
121
+ *
122
+ * const request = {
123
+ * ref: "00000000-0000-0000-0000-000000000000",
124
+ * name: "My Number"
125
+ * };
126
+ *
127
+ * const numbers = new SDK.Numbers(client); // Existing client object
128
+ *
129
+ * numbers.updateNumber(request)
130
+ * .then(console.log) // successful response
131
+ * .catch(console.error); // an error occurred
132
+ */
29
133
  async updateNumber(request) {
30
134
  const client = this.client.getNumbersClient();
31
135
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -35,6 +139,26 @@ class Numbers {
35
139
  request
36
140
  });
37
141
  }
142
+ /**
143
+ * Retrieves a list of Numbers from a Workspace.
144
+ *
145
+ * @param {ListNumbersRequest} request - The request object that contains the necessary information to retrieve a list of Numbers
146
+ * @param {number} request.pageSize - The number of Numbers to retrieve
147
+ * @param {string} request.pageToken - The token to retrieve the next page of Numbers
148
+ * @return {Promise<ListNumbersResponse>} - The response object that contains the list of Numbers
149
+ * @example
150
+ *
151
+ * const request = {
152
+ * pageSize: 10,
153
+ * pageToken: "00000000-0000-0000-0000-000000000000"
154
+ * };
155
+ *
156
+ * const numbers = new SDK.Numbers(client); // Existing client object
157
+ *
158
+ * numbers.listNumbers(request)
159
+ * .then(console.log) // successful response
160
+ * .catch(console.error); // an error occurred
161
+ */
38
162
  async listNumbers(request) {
39
163
  const client = this.client.getNumbersClient();
40
164
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -45,6 +169,22 @@ class Numbers {
45
169
  repeatableObjectMapping: [["itemsList", numbers_pb_1.Number]]
46
170
  });
47
171
  }
172
+ /**
173
+ * Deletes an existing Number from Fonoster.
174
+ * Note that this operation is irreversible.
175
+ *
176
+ * @param {string} ref - The reference of the Number to delete
177
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Number
178
+ * @example
179
+ *
180
+ * const ref = "00000000-0000-0000-0000-000000000000"
181
+ *
182
+ * const numbers = new SDK.Numbers(client); // Existing client object
183
+ *
184
+ * numbers.deleteDomain(ref)
185
+ * .then(console.log) // successful response
186
+ * .catch(console.error); // an error occurred
187
+ */
48
188
  async deleteNumber(ref) {
49
189
  const applicationsClient = this.client.getNumbersClient();
50
190
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -1,12 +1,144 @@
1
1
  import { BaseApiObject, CreateSecretRequest, ListSecretsRequest, ListSecretsResponse, Secret, UpdateSecretRequest } from "@fonoster/types";
2
2
  import { FonosterClient } from "./client/types";
3
+ /**
4
+ * @classdesc Fonoster Secrets, part of the Fonoster Core,
5
+ * allows you to create, update, retrieve, and delete Secrets for your deployment.
6
+ * Note that an active Fonoster deployment is required.
7
+ *
8
+ * @example
9
+ *
10
+ * const SDK = require("@fonoster/sdk");
11
+ *
12
+ * async function main(request) {
13
+ * const apiKey = "your-api-key";
14
+ * const accessKeyId = "00000000-0000-0000-0000-000000000000";
15
+ *
16
+ * try {
17
+ * const client = SDK.Client({ accessKeyId });
18
+ * await client.loginWithApiKey(apiKey);
19
+ *
20
+ * const secrets = new SDK.Secrets(client);
21
+ * const response = await secrets.creteSecret(request);
22
+ *
23
+ * console.log(response); // successful response
24
+ * } catch (e) {
25
+ * console.error(e); // an error occurred
26
+ * }
27
+ * }
28
+ *
29
+ * const request = {
30
+ * name: "FRIENDLY_NAME",
31
+ * secret: "mysecret"
32
+ * };
33
+ *
34
+ * main(request).catch(console.error);
35
+ */
3
36
  declare class Secrets {
4
37
  private client;
38
+ /**
39
+ * Constructs a new Secrets object.
40
+ *
41
+ * @param {FonosterClient} client - Client object with underlying implementations to make requests to Fonoster's API
42
+ * @see AbstractClient
43
+ * @see FonosterClient
44
+ */
5
45
  constructor(client: FonosterClient);
46
+ /**
47
+ * Creates a new Secret in the Workspace.
48
+ *
49
+ * @param {CreateSecretRequest} request - The request object that contains the necessary information to create a new Secret
50
+ * @param {string} request.name - The name of the Secret
51
+ * @param {string} request.secret - The secret of the Secret
52
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Secret
53
+ * @example
54
+ *
55
+ * const request = {
56
+ * name: "FRIENDLY_NAME",
57
+ * secret: "mysecret"
58
+ * };
59
+ *
60
+ * const secrets = new SDK.Secrets(client); // Existing client object
61
+ *
62
+ * secrets.createSecret(request)
63
+ * .then(console.log) // successful response
64
+ * .catch(console.error); // an error occurred
65
+ */
6
66
  createSecret(request: CreateSecretRequest): Promise<BaseApiObject>;
67
+ /**
68
+ * Retrieves an existing Secret in the Workspace.
69
+ *
70
+ * @param {string} ref - The reference of the Secret to retrieve
71
+ * @return {Promise<Acl>} - The response object that contains the Secret
72
+ * @example
73
+ *
74
+ * const ref = "00000000-0000-0000-0000-000000000000"
75
+ *
76
+ * const secrets = new SDK.Secrets(client); // Existing client object
77
+ *
78
+ * secrets.getSecret(ref)
79
+ * .then(console.log) // successful response
80
+ * .catch(console.error); // an error occurred
81
+ */
7
82
  getSecret(ref: string): Promise<Secret>;
83
+ /**
84
+ * Updates an existing Secret in the Workspace.
85
+ *
86
+ * @param {UpdateSecretRequest} request - The request object that contains the necessary information to update an existing Secret
87
+ * @param {string} request.ref - The reference of the Secret to update
88
+ * @param {string} request.name - The name of the Secret
89
+ * @param {string} request.secret - The secret of the Secret
90
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Secret
91
+ * @example
92
+ *
93
+ * const request = {
94
+ * ref: "00000000-0000-0000-0000-000000000000",
95
+ * secret: "mysecret"
96
+ * };
97
+ *
98
+ * const secrets = new SDK.Secrets(client); // Existing client object
99
+ *
100
+ * secrets.updateSecret(request)
101
+ * .then(console.log) // successful response
102
+ * .catch(console.error); // an error occurred
103
+ */
8
104
  updateSecret(request: UpdateSecretRequest): Promise<BaseApiObject>;
105
+ /**
106
+ * Retrieves a list of Secrets from a Workspace.
107
+ *
108
+ * @param {ListSecretsRequest} request - The request object that contains the necessary information to retrieve a list of Secrets
109
+ * @param {number} request.pageSize - The secret of Secrets to retrieve
110
+ * @param {string} request.pageToken - The token to retrieve the next page of Secrets
111
+ * @return {Promise<ListSecretsResponse>} - The response object that contains the list of Secrets
112
+ * @example
113
+ *
114
+ * const request = {
115
+ * pageSize: 10,
116
+ * pageToken: "00000000-0000-0000-0000-000000000000"
117
+ * };
118
+ *
119
+ * const secrets = new SDK.Secrets(client); // Existing client object
120
+ *
121
+ * secrets.listSecrets(request)
122
+ * .then(console.log) // successful response
123
+ * .catch(console.error); // an error occurred
124
+ */
9
125
  listSecrets(request: ListSecretsRequest): Promise<ListSecretsResponse>;
126
+ /**
127
+ * Deletes an existing Secret from Fonoster.
128
+ * Note that this operation is irreversible.
129
+ *
130
+ * @param {string} ref - The reference of the Secret to delete
131
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Secret
132
+ * @example
133
+ *
134
+ * const ref = "00000000-0000-0000-0000-000000000000"
135
+ *
136
+ * const secrets = new SDK.Secrets(client); // Existing client object
137
+ *
138
+ * secrets.deleteSecret(ref)
139
+ * .then(console.log) // successful response
140
+ * .catch(console.error); // an error occurred
141
+ */
10
142
  deleteSecret(ref: string): Promise<BaseApiObject>;
11
143
  }
12
144
  export { Secrets };
@@ -3,11 +3,71 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Secrets = void 0;
4
4
  const makeRpcRequest_1 = require("./client/makeRpcRequest");
5
5
  const secrets_pb_1 = require("./generated/node/secrets_pb");
6
+ /**
7
+ * @classdesc Fonoster Secrets, part of the Fonoster Core,
8
+ * allows you to create, update, retrieve, and delete Secrets for your deployment.
9
+ * Note that an active Fonoster deployment is required.
10
+ *
11
+ * @example
12
+ *
13
+ * const SDK = require("@fonoster/sdk");
14
+ *
15
+ * async function main(request) {
16
+ * const apiKey = "your-api-key";
17
+ * const accessKeyId = "00000000-0000-0000-0000-000000000000";
18
+ *
19
+ * try {
20
+ * const client = SDK.Client({ accessKeyId });
21
+ * await client.loginWithApiKey(apiKey);
22
+ *
23
+ * const secrets = new SDK.Secrets(client);
24
+ * const response = await secrets.creteSecret(request);
25
+ *
26
+ * console.log(response); // successful response
27
+ * } catch (e) {
28
+ * console.error(e); // an error occurred
29
+ * }
30
+ * }
31
+ *
32
+ * const request = {
33
+ * name: "FRIENDLY_NAME",
34
+ * secret: "mysecret"
35
+ * };
36
+ *
37
+ * main(request).catch(console.error);
38
+ */
6
39
  class Secrets {
7
40
  client;
41
+ /**
42
+ * Constructs a new Secrets object.
43
+ *
44
+ * @param {FonosterClient} client - Client object with underlying implementations to make requests to Fonoster's API
45
+ * @see AbstractClient
46
+ * @see FonosterClient
47
+ */
8
48
  constructor(client) {
9
49
  this.client = client;
10
50
  }
51
+ /**
52
+ * Creates a new Secret in the Workspace.
53
+ *
54
+ * @param {CreateSecretRequest} request - The request object that contains the necessary information to create a new Secret
55
+ * @param {string} request.name - The name of the Secret
56
+ * @param {string} request.secret - The secret of the Secret
57
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Secret
58
+ * @example
59
+ *
60
+ * const request = {
61
+ * name: "FRIENDLY_NAME",
62
+ * secret: "mysecret"
63
+ * };
64
+ *
65
+ * const secrets = new SDK.Secrets(client); // Existing client object
66
+ *
67
+ * secrets.createSecret(request)
68
+ * .then(console.log) // successful response
69
+ * .catch(console.error); // an error occurred
70
+ */
11
71
  async createSecret(request) {
12
72
  const client = this.client.getSecretsClient();
13
73
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -17,6 +77,21 @@ class Secrets {
17
77
  request
18
78
  });
19
79
  }
80
+ /**
81
+ * Retrieves an existing Secret in the Workspace.
82
+ *
83
+ * @param {string} ref - The reference of the Secret to retrieve
84
+ * @return {Promise<Acl>} - The response object that contains the Secret
85
+ * @example
86
+ *
87
+ * const ref = "00000000-0000-0000-0000-000000000000"
88
+ *
89
+ * const secrets = new SDK.Secrets(client); // Existing client object
90
+ *
91
+ * secrets.getSecret(ref)
92
+ * .then(console.log) // successful response
93
+ * .catch(console.error); // an error occurred
94
+ */
20
95
  async getSecret(ref) {
21
96
  const client = this.client.getSecretsClient();
22
97
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -26,6 +101,27 @@ class Secrets {
26
101
  request: { ref }
27
102
  });
28
103
  }
104
+ /**
105
+ * Updates an existing Secret in the Workspace.
106
+ *
107
+ * @param {UpdateSecretRequest} request - The request object that contains the necessary information to update an existing Secret
108
+ * @param {string} request.ref - The reference of the Secret to update
109
+ * @param {string} request.name - The name of the Secret
110
+ * @param {string} request.secret - The secret of the Secret
111
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Secret
112
+ * @example
113
+ *
114
+ * const request = {
115
+ * ref: "00000000-0000-0000-0000-000000000000",
116
+ * secret: "mysecret"
117
+ * };
118
+ *
119
+ * const secrets = new SDK.Secrets(client); // Existing client object
120
+ *
121
+ * secrets.updateSecret(request)
122
+ * .then(console.log) // successful response
123
+ * .catch(console.error); // an error occurred
124
+ */
29
125
  async updateSecret(request) {
30
126
  const client = this.client.getSecretsClient();
31
127
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -35,6 +131,26 @@ class Secrets {
35
131
  request
36
132
  });
37
133
  }
134
+ /**
135
+ * Retrieves a list of Secrets from a Workspace.
136
+ *
137
+ * @param {ListSecretsRequest} request - The request object that contains the necessary information to retrieve a list of Secrets
138
+ * @param {number} request.pageSize - The secret of Secrets to retrieve
139
+ * @param {string} request.pageToken - The token to retrieve the next page of Secrets
140
+ * @return {Promise<ListSecretsResponse>} - The response object that contains the list of Secrets
141
+ * @example
142
+ *
143
+ * const request = {
144
+ * pageSize: 10,
145
+ * pageToken: "00000000-0000-0000-0000-000000000000"
146
+ * };
147
+ *
148
+ * const secrets = new SDK.Secrets(client); // Existing client object
149
+ *
150
+ * secrets.listSecrets(request)
151
+ * .then(console.log) // successful response
152
+ * .catch(console.error); // an error occurred
153
+ */
38
154
  async listSecrets(request) {
39
155
  const client = this.client.getSecretsClient();
40
156
  return await (0, makeRpcRequest_1.makeRpcRequest)({
@@ -45,6 +161,22 @@ class Secrets {
45
161
  repeatableObjectMapping: [["itemsList", secrets_pb_1.Secret]]
46
162
  });
47
163
  }
164
+ /**
165
+ * Deletes an existing Secret from Fonoster.
166
+ * Note that this operation is irreversible.
167
+ *
168
+ * @param {string} ref - The reference of the Secret to delete
169
+ * @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Secret
170
+ * @example
171
+ *
172
+ * const ref = "00000000-0000-0000-0000-000000000000"
173
+ *
174
+ * const secrets = new SDK.Secrets(client); // Existing client object
175
+ *
176
+ * secrets.deleteSecret(ref)
177
+ * .then(console.log) // successful response
178
+ * .catch(console.error); // an error occurred
179
+ */
48
180
  async deleteSecret(ref) {
49
181
  const applicationsClient = this.client.getSecretsClient();
50
182
  return await (0, makeRpcRequest_1.makeRpcRequest)({