@maxim_mazurok/gapi.client.cloudidentity-v1 0.0.20220808
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 +2570 -0
- package/package.json +20 -0
- package/readme.md +167 -0
- package/tests.ts +506 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.cloudidentity-v1",
|
|
3
|
+
"version": "0.0.20220808",
|
|
4
|
+
"description": "TypeScript typings for Cloud Identity 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,167 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Identity API v1
|
|
2
|
+
|
|
3
|
+
API for provisioning and managing identity resources.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/identity/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud Identity API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.cloudidentity-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://cloudidentity.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.cloudidentity
|
|
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('cloudidentity', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.cloudidentity
|
|
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
|
+
// Private Service: https://www.googleapis.com/auth/cloud-identity
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-identity',
|
|
50
|
+
|
|
51
|
+
// Private Service: https://www.googleapis.com/auth/cloud-identity.devices
|
|
52
|
+
'https://www.googleapis.com/auth/cloud-identity.devices',
|
|
53
|
+
|
|
54
|
+
// See your device details
|
|
55
|
+
'https://www.googleapis.com/auth/cloud-identity.devices.lookup',
|
|
56
|
+
|
|
57
|
+
// Private Service: https://www.googleapis.com/auth/cloud-identity.devices.readonly
|
|
58
|
+
'https://www.googleapis.com/auth/cloud-identity.devices.readonly',
|
|
59
|
+
|
|
60
|
+
// See, change, create, and delete any of the Cloud Identity Groups that you can access, including the members of each group
|
|
61
|
+
'https://www.googleapis.com/auth/cloud-identity.groups',
|
|
62
|
+
|
|
63
|
+
// See any Cloud Identity Groups that you can access, including group members and their emails
|
|
64
|
+
'https://www.googleapis.com/auth/cloud-identity.groups.readonly',
|
|
65
|
+
|
|
66
|
+
// See, send, or cancel any Cloud Identity UserInvitations to join your organization to users
|
|
67
|
+
'https://www.googleapis.com/auth/cloud-identity.userinvitations',
|
|
68
|
+
|
|
69
|
+
// See, send, or cancel any Cloud Identity UserInvitations to join your organization to users
|
|
70
|
+
'https://www.googleapis.com/auth/cloud-identity.userinvitations.readonly',
|
|
71
|
+
|
|
72
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
73
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
74
|
+
],
|
|
75
|
+
immediate = true;
|
|
76
|
+
// ...
|
|
77
|
+
|
|
78
|
+
gapi.auth.authorize(
|
|
79
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
80
|
+
authResult => {
|
|
81
|
+
if (authResult && !authResult.error) {
|
|
82
|
+
/* handle successful authorization */
|
|
83
|
+
} else {
|
|
84
|
+
/* handle authorization error */
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
After that you can use Cloud Identity API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
Cancels an unfinished device wipe. This operation can be used to cancel device wipe in the gap between the wipe operation returning success and the device being wiped. This operation is possible when the device is in a "pending wipe" state. The device enters the "pending wipe" state when a wipe device command is issued, but has not yet been sent to the device. The cancel wipe will fail if the wipe command has already been issued to the device.
|
|
95
|
+
*/
|
|
96
|
+
await gapi.client.cloudidentity.devices.cancelWipe({ name: "name", });
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
Creates a device. Only company-owned device may be created. **Note**: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium
|
|
100
|
+
*/
|
|
101
|
+
await gapi.client.cloudidentity.devices.create({ });
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
Deletes the specified device.
|
|
105
|
+
*/
|
|
106
|
+
await gapi.client.cloudidentity.devices.delete({ name: "name", });
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
Retrieves the specified device.
|
|
110
|
+
*/
|
|
111
|
+
await gapi.client.cloudidentity.devices.get({ name: "name", });
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
Lists/Searches devices.
|
|
115
|
+
*/
|
|
116
|
+
await gapi.client.cloudidentity.devices.list({ });
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
Wipes all data on the specified device.
|
|
120
|
+
*/
|
|
121
|
+
await gapi.client.cloudidentity.devices.wipe({ name: "name", });
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
Creates a Group.
|
|
125
|
+
*/
|
|
126
|
+
await gapi.client.cloudidentity.groups.create({ });
|
|
127
|
+
|
|
128
|
+
/*
|
|
129
|
+
Deletes a `Group`.
|
|
130
|
+
*/
|
|
131
|
+
await gapi.client.cloudidentity.groups.delete({ name: "name", });
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
Retrieves a `Group`.
|
|
135
|
+
*/
|
|
136
|
+
await gapi.client.cloudidentity.groups.get({ name: "name", });
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
Get Security Settings
|
|
140
|
+
*/
|
|
141
|
+
await gapi.client.cloudidentity.groups.getSecuritySettings({ name: "name", });
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
Lists the `Group` resources under a customer or namespace.
|
|
145
|
+
*/
|
|
146
|
+
await gapi.client.cloudidentity.groups.list({ });
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Group` by its `EntityKey`.
|
|
150
|
+
*/
|
|
151
|
+
await gapi.client.cloudidentity.groups.lookup({ });
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
Updates a `Group`.
|
|
155
|
+
*/
|
|
156
|
+
await gapi.client.cloudidentity.groups.patch({ name: "name", });
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
Searches for `Group` resources matching a specified query.
|
|
160
|
+
*/
|
|
161
|
+
await gapi.client.cloudidentity.groups.search({ });
|
|
162
|
+
|
|
163
|
+
/*
|
|
164
|
+
Update Security Settings
|
|
165
|
+
*/
|
|
166
|
+
await gapi.client.cloudidentity.groups.updateSecuritySettings({ name: "name", });
|
|
167
|
+
```
|