@maxim_mazurok/gapi.client.publicca-v1alpha1 0.0.20230404

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 ADDED
@@ -0,0 +1,106 @@
1
+ /* Type definitions for non-npm package Public Certificate Authority API v1alpha1 0.0 */
2
+ // Project: https://cloud.google.com/public-certificate-authority/docs
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://publicca.googleapis.com/$discovery/rest?version=v1alpha1
12
+ // Revision: 20230404
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Public Certificate Authority API v1alpha1 */
18
+ function load(urlOrObject: "https://publicca.googleapis.com/$discovery/rest?version=v1alpha1"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "publicca", version: "v1alpha1"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "publicca", version: "v1alpha1", callback: () => any): void;
23
+
24
+ namespace publicca {
25
+ interface ExternalAccountKey {
26
+ /** Output only. Base64-URL-encoded HS256 key. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created */
27
+ b64MacKey?: string;
28
+ /** Output only. Key ID. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created */
29
+ keyId?: string;
30
+ /** Output only. Resource name. projects/{project}/locations/{location}/externalAccountKeys/{key_id} */
31
+ name?: string;
32
+ }
33
+ interface ExternalAccountKeysResource {
34
+ /** Creates a new ExternalAccountKey bound to the project. */
35
+ create(request: {
36
+ /** V1 error format. */
37
+ "$.xgafv"?: string;
38
+ /** OAuth access token. */
39
+ access_token?: string;
40
+ /** Data format for response. */
41
+ alt?: string;
42
+ /** JSONP */
43
+ callback?: string;
44
+ /** Selector specifying which fields to include in a partial response. */
45
+ fields?: string;
46
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
47
+ key?: string;
48
+ /** OAuth 2.0 token for the current user. */
49
+ oauth_token?: string;
50
+ /**
51
+ * Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the "global" location is
52
+ * supported.
53
+ */
54
+ parent: string;
55
+ /** Returns response with indentations and line breaks. */
56
+ prettyPrint?: boolean;
57
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
58
+ quotaUser?: string;
59
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
60
+ upload_protocol?: string;
61
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
62
+ uploadType?: string;
63
+ /** Request body */
64
+ resource: ExternalAccountKey;
65
+ }): Request<ExternalAccountKey>;
66
+ create(request: {
67
+ /** V1 error format. */
68
+ "$.xgafv"?: string;
69
+ /** OAuth access token. */
70
+ access_token?: string;
71
+ /** Data format for response. */
72
+ alt?: string;
73
+ /** JSONP */
74
+ callback?: string;
75
+ /** Selector specifying which fields to include in a partial response. */
76
+ fields?: string;
77
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
78
+ key?: string;
79
+ /** OAuth 2.0 token for the current user. */
80
+ oauth_token?: string;
81
+ /**
82
+ * Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the "global" location is
83
+ * supported.
84
+ */
85
+ parent: string;
86
+ /** Returns response with indentations and line breaks. */
87
+ prettyPrint?: boolean;
88
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
89
+ quotaUser?: string;
90
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
91
+ upload_protocol?: string;
92
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
93
+ uploadType?: string;
94
+ },
95
+ body: ExternalAccountKey): Request<ExternalAccountKey>;
96
+ }
97
+ interface LocationsResource {
98
+ externalAccountKeys: ExternalAccountKeysResource;
99
+ }
100
+ interface ProjectsResource {
101
+ locations: LocationsResource;
102
+ }
103
+
104
+ const projects: ProjectsResource;
105
+ }
106
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.publicca-v1alpha1",
3
+ "version": "0.0.20230404",
4
+ "description": "TypeScript typings for Public Certificate Authority API 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,68 @@
1
+ # TypeScript typings for Public Certificate Authority API v1alpha1
2
+
3
+ The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority.
4
+ For detailed description please check [documentation](https://cloud.google.com/public-certificate-authority/docs).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Public Certificate Authority API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.publicca-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://publicca.googleapis.com/$discovery/rest?version=v1alpha1', () => {
29
+ // now we can use:
30
+ // gapi.client.publicca
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('publicca', 'v1alpha1', () => {
37
+ // now we can use:
38
+ // gapi.client.publicca
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
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+ ],
51
+ immediate = true;
52
+ // ...
53
+
54
+ gapi.auth.authorize(
55
+ { client_id: client_id, scope: scope, immediate: immediate },
56
+ authResult => {
57
+ if (authResult && !authResult.error) {
58
+ /* handle successful authorization */
59
+ } else {
60
+ /* handle authorization error */
61
+ }
62
+ });
63
+ ```
64
+
65
+ After that you can use Public Certificate Authority API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,41 @@
1
+ /* This is stub file for gapi.client.publicca-v1alpha1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20230404
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://publicca.googleapis.com/$discovery/rest?version=v1alpha1');
12
+ /** now we can use gapi.client.publicca */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
+ 'https://www.googleapis.com/auth/cloud-platform',
20
+ ];
21
+ const immediate = false;
22
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
+ if (authResult && !authResult.error) {
24
+ /** handle successful authorization */
25
+ run();
26
+ } else {
27
+ /** handle authorization error */
28
+ }
29
+ });
30
+
31
+ async function run() {
32
+ /** Creates a new ExternalAccountKey bound to the project. */
33
+ await gapi.client.publicca.projects.locations.externalAccountKeys.create({
34
+ parent: "Test string",
35
+ }, {
36
+ b64MacKey: "Test string",
37
+ keyId: "Test string",
38
+ name: "Test string",
39
+ });
40
+ }
41
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }