@maxim_mazurok/gapi.client.integrations-v2 0.0.0 → 0.0.20260927
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 +1644 -1
- package/package.json +16 -3
- package/readme.md +91 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.integrations-v2",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.20260927",
|
|
4
|
+
"description": "TypeScript typings for Application Integration API v2",
|
|
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": {
|
|
11
|
+
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
13
|
+
"url": "https://maxim.mazurok.com"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery-v1": "*"
|
|
19
|
+
}
|
|
7
20
|
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# TypeScript typings for Application Integration API v2
|
|
2
|
+
|
|
3
|
+
For detailed description please check [documentation](https://cloud.google.com/application-integration).
|
|
4
|
+
|
|
5
|
+
## Installing
|
|
6
|
+
|
|
7
|
+
Install typings for Application Integration API:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @types/gapi.client.integrations-v2 --save-dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## TypeScript 6.0+
|
|
14
|
+
|
|
15
|
+
TypeScript 6.0 changed `types` to default to `[]`. You must now explicitly list type packages in `tsconfig.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"compilerOptions": {
|
|
20
|
+
"types": [
|
|
21
|
+
"gapi",
|
|
22
|
+
"gapi.auth2",
|
|
23
|
+
"gapi.client",
|
|
24
|
+
"gapi.client.integrations-v2"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
You need to initialize Google API client in your code:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
gapi.load('client', () => {
|
|
36
|
+
// now we can use gapi.client
|
|
37
|
+
// ...
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then load api client wrapper:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
gapi.client.load(
|
|
45
|
+
'https://integrations.googleapis.com/$discovery/rest?version=v2',
|
|
46
|
+
() => {
|
|
47
|
+
// now we can use:
|
|
48
|
+
// gapi.client.integrations
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
55
|
+
gapi.client.load('integrations', 'v2', () => {
|
|
56
|
+
// now we can use:
|
|
57
|
+
// gapi.client.integrations
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// declare client_id registered in Google Developers Console
|
|
65
|
+
var client_id = '',
|
|
66
|
+
scope = [
|
|
67
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
68
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
69
|
+
],
|
|
70
|
+
immediate = true;
|
|
71
|
+
// ...
|
|
72
|
+
|
|
73
|
+
gapi.auth.authorize(
|
|
74
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
75
|
+
authResult => {
|
|
76
|
+
if (authResult && !authResult.error) {
|
|
77
|
+
/* handle successful authorization */
|
|
78
|
+
} else {
|
|
79
|
+
/* handle authorization error */
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
After that you can use Application Integration API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.integrations-v2#Provenance:~:text=none-,Provenance,-Built%20and%20signed)
|
package/README.md
DELETED