@maxim_mazurok/gapi.client.iam-v1 0.0.20231026 → 0.0.20231207
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/index.d.ts +4374 -6895
- package/package.json +6 -6
- package/readme.md +23 -20
- package/tests.ts +0 -895
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.iam-v1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231207",
|
|
4
4
|
"description": "TypeScript typings for Identity and Access Management (IAM) API v1",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"author": {
|
|
7
|
-
"email": "maxim@mazurok.com",
|
|
8
11
|
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
9
13
|
"url": "https://maxim.mazurok.com"
|
|
10
14
|
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
-
},
|
|
15
15
|
"types": "index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/gapi.client": "*",
|
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TypeScript typings for Identity and Access Management (IAM) API v1
|
|
2
2
|
|
|
3
|
-
Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.
|
|
3
|
+
Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.
|
|
4
4
|
For detailed description please check [documentation](https://cloud.google.com/iam/).
|
|
5
5
|
|
|
6
6
|
## Installing
|
|
@@ -25,10 +25,13 @@ gapi.load('client', () => {
|
|
|
25
25
|
Then load api client wrapper:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
gapi.client.load(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://iam.googleapis.com/$discovery/rest?version=v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.iam
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,54 +48,54 @@ Don't forget to authenticate your client before sending any request to resources
|
|
|
45
48
|
// declare client_id registered in Google Developers Console
|
|
46
49
|
var client_id = '',
|
|
47
50
|
scope = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
52
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
52
55
|
// ...
|
|
53
56
|
|
|
54
57
|
gapi.auth.authorize(
|
|
55
|
-
{
|
|
58
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
56
59
|
authResult => {
|
|
57
60
|
if (authResult && !authResult.error) {
|
|
58
|
-
|
|
61
|
+
/* handle successful authorization */
|
|
59
62
|
} else {
|
|
60
|
-
|
|
63
|
+
/* handle authorization error */
|
|
61
64
|
}
|
|
62
|
-
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
After that you can use Identity and Access Management (IAM) API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
70
|
|
|
67
71
|
```typescript
|
|
68
|
-
|
|
69
72
|
/*
|
|
70
73
|
Lints, or validates, an IAM policy. Currently checks the google.iam.v1.Binding.condition field, which contains a condition expression for a role binding. Successful calls to this method always return an HTTP `200 OK` status code, even if the linter detects an issue in the IAM policy.
|
|
71
74
|
*/
|
|
72
|
-
await gapi.client.iam.iamPolicies.lintPolicy({
|
|
75
|
+
await gapi.client.iam.iamPolicies.lintPolicy({});
|
|
73
76
|
|
|
74
77
|
/*
|
|
75
78
|
Returns a list of services that allow you to opt into audit logs that are not generated by default. To learn more about audit logs, see the [Logging documentation](https://cloud.google.com/logging/docs/audit).
|
|
76
79
|
*/
|
|
77
|
-
await gapi.client.iam.iamPolicies.queryAuditableServices({
|
|
80
|
+
await gapi.client.iam.iamPolicies.queryAuditableServices({});
|
|
78
81
|
|
|
79
82
|
/*
|
|
80
83
|
Lists every permission that you can test on a resource. A permission is testable if you can check whether a principal has that permission on the resource.
|
|
81
84
|
*/
|
|
82
|
-
await gapi.client.iam.permissions.queryTestablePermissions({
|
|
85
|
+
await gapi.client.iam.permissions.queryTestablePermissions({});
|
|
83
86
|
|
|
84
87
|
/*
|
|
85
88
|
Gets the definition of a Role.
|
|
86
89
|
*/
|
|
87
|
-
await gapi.client.iam.roles.get({
|
|
90
|
+
await gapi.client.iam.roles.get({name: 'name'});
|
|
88
91
|
|
|
89
92
|
/*
|
|
90
93
|
Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.
|
|
91
94
|
*/
|
|
92
|
-
await gapi.client.iam.roles.list({
|
|
95
|
+
await gapi.client.iam.roles.list({});
|
|
93
96
|
|
|
94
97
|
/*
|
|
95
98
|
Lists roles that can be granted on a Google Cloud resource. A role is grantable if the IAM policy for the resource can contain bindings to the role.
|
|
96
99
|
*/
|
|
97
|
-
await gapi.client.iam.roles.queryGrantableRoles({
|
|
100
|
+
await gapi.client.iam.roles.queryGrantableRoles({});
|
|
98
101
|
```
|