@maxim_mazurok/gapi.client.prod_tt_sasportal-v1alpha1 0.0.20220811
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 +3985 -0
- package/package.json +20 -0
- package/readme.md +121 -0
- package/tests.ts +2181 -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.prod_tt_sasportal-v1alpha1",
|
|
3
|
+
"version": "0.0.20220811",
|
|
4
|
+
"description": "TypeScript typings for SAS Portal API (Testing) v1alpha1",
|
|
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,121 @@
|
|
|
1
|
+
# TypeScript typings for SAS Portal API (Testing) v1alpha1
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/spectrum-access-system/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for SAS Portal API (Testing):
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.prod_tt_sasportal-v1alpha1 --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://prod-tt-sasportal.googleapis.com/$discovery/rest?version=v1alpha1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.prod_tt_sasportal
|
|
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('prod_tt_sasportal', 'v1alpha1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.prod_tt_sasportal
|
|
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
|
+
// Read, create, update, and delete your SAS Portal data.
|
|
49
|
+
'https://www.googleapis.com/auth/sasportal',
|
|
50
|
+
|
|
51
|
+
// See your primary Google Account email address
|
|
52
|
+
'https://www.googleapis.com/auth/userinfo.email',
|
|
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 SAS Portal API (Testing) resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Returns a requested customer.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.prod_tt_sasportal.customers.get({ name: "name", });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Returns a list of requested customers.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.prod_tt_sasportal.customers.list({ });
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Updates an existing customer.
|
|
84
|
+
*/
|
|
85
|
+
await gapi.client.prod_tt_sasportal.customers.patch({ name: "name", });
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
Returns a requested deployment.
|
|
89
|
+
*/
|
|
90
|
+
await gapi.client.prod_tt_sasportal.deployments.get({ name: "name", });
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Generates a secret to be used with the ValidateInstaller.
|
|
94
|
+
*/
|
|
95
|
+
await gapi.client.prod_tt_sasportal.installer.generateSecret({ });
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
Validates the identity of a Certified Professional Installer (CPI).
|
|
99
|
+
*/
|
|
100
|
+
await gapi.client.prod_tt_sasportal.installer.validate({ });
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
Returns a requested node.
|
|
104
|
+
*/
|
|
105
|
+
await gapi.client.prod_tt_sasportal.nodes.get({ name: "name", });
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
|
109
|
+
*/
|
|
110
|
+
await gapi.client.prod_tt_sasportal.policies.get({ });
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
Sets the access control policy on the specified resource. Replaces any existing policy.
|
|
114
|
+
*/
|
|
115
|
+
await gapi.client.prod_tt_sasportal.policies.set({ });
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
Returns permissions that a caller has on the specified resource.
|
|
119
|
+
*/
|
|
120
|
+
await gapi.client.prod_tt_sasportal.policies.test({ });
|
|
121
|
+
```
|