@maxim_mazurok/gapi.client.vault-v1 0.0.20220728

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.vault-v1",
3
+ "version": "0.0.20220728",
4
+ "description": "TypeScript typings for Google Vault 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,146 @@
1
+ # TypeScript typings for Google Vault API v1
2
+
3
+ Retention and eDiscovery for Google Workspace. To work with Vault resources, the account must have the [required Vault privileges](https://support.google.com/vault/answer/2799699) and access to the matter. To access a matter, the account must have created the matter, have the matter shared with them, or have the **View All Matters** privilege. For example, to download an export, an account needs the **Manage Exports** privilege and the matter shared with them.
4
+ For detailed description please check [documentation](https://developers.google.com/vault).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Google Vault API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.vault-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://vault.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.vault
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('vault', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.vault
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
+ // Manage your eDiscovery data
49
+ 'https://www.googleapis.com/auth/ediscovery',
50
+
51
+ // View your eDiscovery data
52
+ 'https://www.googleapis.com/auth/ediscovery.readonly',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ { client_id: client_id, scope: scope, immediate: immediate },
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ });
66
+ ```
67
+
68
+ After that you can use Google Vault API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ /*
73
+ Adds an account as a matter collaborator.
74
+ */
75
+ await gapi.client.vault.matters.addPermissions({ matterId: "matterId", });
76
+
77
+ /*
78
+ Closes the specified matter. Returns the matter with updated state.
79
+ */
80
+ await gapi.client.vault.matters.close({ matterId: "matterId", });
81
+
82
+ /*
83
+ Counts the accounts processed by the specified query.
84
+ */
85
+ await gapi.client.vault.matters.count({ matterId: "matterId", });
86
+
87
+ /*
88
+ Creates a matter with the given name and description. The initial state is open, and the owner is the method caller. Returns the created matter with default view.
89
+ */
90
+ await gapi.client.vault.matters.create({ });
91
+
92
+ /*
93
+ Deletes the specified matter. Returns the matter with updated state.
94
+ */
95
+ await gapi.client.vault.matters.delete({ matterId: "matterId", });
96
+
97
+ /*
98
+ Gets the specified matter.
99
+ */
100
+ await gapi.client.vault.matters.get({ matterId: "matterId", });
101
+
102
+ /*
103
+ Lists matters the requestor has access to.
104
+ */
105
+ await gapi.client.vault.matters.list({ });
106
+
107
+ /*
108
+ Removes an account as a matter collaborator.
109
+ */
110
+ await gapi.client.vault.matters.removePermissions({ matterId: "matterId", });
111
+
112
+ /*
113
+ Reopens the specified matter. Returns the matter with updated state.
114
+ */
115
+ await gapi.client.vault.matters.reopen({ matterId: "matterId", });
116
+
117
+ /*
118
+ Undeletes the specified matter. Returns the matter with updated state.
119
+ */
120
+ await gapi.client.vault.matters.undelete({ matterId: "matterId", });
121
+
122
+ /*
123
+ Updates the specified matter. This updates only the name and description of the matter, identified by matter ID. Changes to any other fields are ignored. Returns the default view of the matter.
124
+ */
125
+ await gapi.client.vault.matters.update({ matterId: "matterId", });
126
+
127
+ /*
128
+ Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
129
+ */
130
+ await gapi.client.vault.operations.cancel({ name: "name", });
131
+
132
+ /*
133
+ Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
134
+ */
135
+ await gapi.client.vault.operations.delete({ name: "name", });
136
+
137
+ /*
138
+ Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
139
+ */
140
+ await gapi.client.vault.operations.get({ name: "name", });
141
+
142
+ /*
143
+ Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
144
+ */
145
+ await gapi.client.vault.operations.list({ name: "name", });
146
+ ```