@maxim_mazurok/gapi.client.secretmanager-v1 0.0.20220729

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.secretmanager-v1",
3
+ "version": "0.0.20220729",
4
+ "description": "TypeScript typings for Secret Manager API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,68 @@
1
+ # TypeScript typings for Secret Manager API v1
2
+
3
+ Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security.
4
+ For detailed description please check [documentation](https://cloud.google.com/secret-manager/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Secret Manager API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.secretmanager-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://secretmanager.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.secretmanager
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('secretmanager', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.secretmanager
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+ ],
51
+ immediate = true;
52
+ // ...
53
+
54
+ gapi.auth.authorize(
55
+ { client_id: client_id, scope: scope, immediate: immediate },
56
+ authResult => {
57
+ if (authResult && !authResult.error) {
58
+ /* handle successful authorization */
59
+ } else {
60
+ /* handle authorization error */
61
+ }
62
+ });
63
+ ```
64
+
65
+ After that you can use Secret Manager API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,241 @@
1
+ /* This is stub file for gapi.client.secretmanager-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220729
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://secretmanager.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.secretmanager */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
+ 'https://www.googleapis.com/auth/cloud-platform',
20
+ ];
21
+ const immediate = false;
22
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
+ if (authResult && !authResult.error) {
24
+ /** handle successful authorization */
25
+ run();
26
+ } else {
27
+ /** handle authorization error */
28
+ }
29
+ });
30
+
31
+ async function run() {
32
+ /** Gets information about a location. */
33
+ await gapi.client.secretmanager.projects.locations.get({
34
+ name: "Test string",
35
+ });
36
+ /** Lists information about the supported locations for this service. */
37
+ await gapi.client.secretmanager.projects.locations.list({
38
+ filter: "Test string",
39
+ name: "Test string",
40
+ pageSize: 42,
41
+ pageToken: "Test string",
42
+ });
43
+ /** Creates a new SecretVersion containing secret data and attaches it to an existing Secret. */
44
+ await gapi.client.secretmanager.projects.secrets.addVersion({
45
+ parent: "Test string",
46
+ }, {
47
+ payload: {
48
+ data: "Test string",
49
+ dataCrc32c: "Test string",
50
+ },
51
+ });
52
+ /** Creates a new Secret containing no SecretVersions. */
53
+ await gapi.client.secretmanager.projects.secrets.create({
54
+ parent: "Test string",
55
+ secretId: "Test string",
56
+ }, {
57
+ createTime: "Test string",
58
+ etag: "Test string",
59
+ expireTime: "Test string",
60
+ labels: {
61
+ A: "Test string"
62
+ },
63
+ name: "Test string",
64
+ replication: {
65
+ automatic: {
66
+ customerManagedEncryption: {
67
+ kmsKeyName: "Test string",
68
+ },
69
+ },
70
+ userManaged: {
71
+ replicas: [
72
+ {
73
+ customerManagedEncryption: {
74
+ kmsKeyName: "Test string",
75
+ },
76
+ location: "Test string",
77
+ }
78
+ ],
79
+ },
80
+ },
81
+ rotation: {
82
+ nextRotationTime: "Test string",
83
+ rotationPeriod: "Test string",
84
+ },
85
+ topics: [
86
+ {
87
+ name: "Test string",
88
+ }
89
+ ],
90
+ ttl: "Test string",
91
+ versionAliases: {
92
+ A: "Test string"
93
+ },
94
+ });
95
+ /** Deletes a Secret. */
96
+ await gapi.client.secretmanager.projects.secrets.delete({
97
+ etag: "Test string",
98
+ name: "Test string",
99
+ });
100
+ /** Gets metadata for a given Secret. */
101
+ await gapi.client.secretmanager.projects.secrets.get({
102
+ name: "Test string",
103
+ });
104
+ /** Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set. */
105
+ await gapi.client.secretmanager.projects.secrets.getIamPolicy({
106
+ "options.requestedPolicyVersion": 42,
107
+ resource: "Test string",
108
+ });
109
+ /** Lists Secrets. */
110
+ await gapi.client.secretmanager.projects.secrets.list({
111
+ filter: "Test string",
112
+ pageSize: 42,
113
+ pageToken: "Test string",
114
+ parent: "Test string",
115
+ });
116
+ /** Updates metadata of an existing Secret. */
117
+ await gapi.client.secretmanager.projects.secrets.patch({
118
+ name: "Test string",
119
+ updateMask: "Test string",
120
+ }, {
121
+ createTime: "Test string",
122
+ etag: "Test string",
123
+ expireTime: "Test string",
124
+ labels: {
125
+ A: "Test string"
126
+ },
127
+ name: "Test string",
128
+ replication: {
129
+ automatic: {
130
+ customerManagedEncryption: {
131
+ kmsKeyName: "Test string",
132
+ },
133
+ },
134
+ userManaged: {
135
+ replicas: [
136
+ {
137
+ customerManagedEncryption: {
138
+ kmsKeyName: "Test string",
139
+ },
140
+ location: "Test string",
141
+ }
142
+ ],
143
+ },
144
+ },
145
+ rotation: {
146
+ nextRotationTime: "Test string",
147
+ rotationPeriod: "Test string",
148
+ },
149
+ topics: [
150
+ {
151
+ name: "Test string",
152
+ }
153
+ ],
154
+ ttl: "Test string",
155
+ versionAliases: {
156
+ A: "Test string"
157
+ },
158
+ });
159
+ /** Sets the access control policy on the specified secret. Replaces any existing policy. Permissions on SecretVersions are enforced according to the policy set on the associated Secret. */
160
+ await gapi.client.secretmanager.projects.secrets.setIamPolicy({
161
+ resource: "Test string",
162
+ }, {
163
+ policy: {
164
+ auditConfigs: [
165
+ {
166
+ auditLogConfigs: [
167
+ {
168
+ exemptedMembers: [
169
+ "Test string"
170
+ ],
171
+ logType: "Test string",
172
+ }
173
+ ],
174
+ service: "Test string",
175
+ }
176
+ ],
177
+ bindings: [
178
+ {
179
+ condition: {
180
+ description: "Test string",
181
+ expression: "Test string",
182
+ location: "Test string",
183
+ title: "Test string",
184
+ },
185
+ members: [
186
+ "Test string"
187
+ ],
188
+ role: "Test string",
189
+ }
190
+ ],
191
+ etag: "Test string",
192
+ version: 42,
193
+ },
194
+ updateMask: "Test string",
195
+ });
196
+ /**
197
+ * Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error. Note: This operation
198
+ * is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
199
+ */
200
+ await gapi.client.secretmanager.projects.secrets.testIamPermissions({
201
+ resource: "Test string",
202
+ }, {
203
+ permissions: [
204
+ "Test string"
205
+ ],
206
+ });
207
+ /** Accesses a SecretVersion. This call returns the secret data. `projects/*‍/secrets/*‍/versions/latest` is an alias to the most recently created SecretVersion. */
208
+ await gapi.client.secretmanager.projects.secrets.versions.access({
209
+ name: "Test string",
210
+ });
211
+ /** Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data. */
212
+ await gapi.client.secretmanager.projects.secrets.versions.destroy({
213
+ name: "Test string",
214
+ }, {
215
+ etag: "Test string",
216
+ });
217
+ /** Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED. */
218
+ await gapi.client.secretmanager.projects.secrets.versions.disable({
219
+ name: "Test string",
220
+ }, {
221
+ etag: "Test string",
222
+ });
223
+ /** Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED. */
224
+ await gapi.client.secretmanager.projects.secrets.versions.enable({
225
+ name: "Test string",
226
+ }, {
227
+ etag: "Test string",
228
+ });
229
+ /** Gets metadata for a SecretVersion. `projects/*‍/secrets/*‍/versions/latest` is an alias to the most recently created SecretVersion. */
230
+ await gapi.client.secretmanager.projects.secrets.versions.get({
231
+ name: "Test string",
232
+ });
233
+ /** Lists SecretVersions. This call does not return secret data. */
234
+ await gapi.client.secretmanager.projects.secrets.versions.list({
235
+ filter: "Test string",
236
+ pageSize: 42,
237
+ pageToken: "Test string",
238
+ parent: "Test string",
239
+ });
240
+ }
241
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }