@googleapis/docs 3.4.0 → 5.0.1
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/CHANGELOG.md +43 -0
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/v1.d.ts +227 -7
- package/build/v1.js.map +1 -1
- package/index.ts +0 -1
- package/package.json +2 -2
- package/v1.ts +237 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/docs-v5.0.0...docs-v5.0.1) (2025-07-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **docs:** update the API ([b5198a1](https://github.com/googleapis/google-api-nodejs-client/commit/b5198a13e94322dd7f8c5285a5aede3d294ccb86))
|
|
9
|
+
|
|
10
|
+
## [5.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/docs-v4.0.1...docs-v5.0.0) (2025-06-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* upgrade to node 18
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **docs:** update the API ([249c295](https://github.com/googleapis/google-api-nodejs-client/commit/249c295485076999dbae18dbf311fd3558d4f234))
|
|
20
|
+
* upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
|
|
26
|
+
* **docs:** update the API ([d9d0f70](https://github.com/googleapis/google-api-nodejs-client/commit/d9d0f7059982883ffd9223411a52d199538591c6))
|
|
27
|
+
|
|
28
|
+
## [4.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/docs-v4.0.0...docs-v4.0.1) (2025-06-04)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
|
|
34
|
+
|
|
35
|
+
## [4.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/docs-v3.4.0...docs-v4.0.0) (2025-05-29)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### ⚠ BREAKING CHANGES
|
|
39
|
+
|
|
40
|
+
* upgrade to node 18
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
|
|
45
|
+
|
|
3
46
|
## [3.4.0](https://github.com/googleapis/google-api-nodejs-client/compare/docs-v3.3.4...docs-v3.4.0) (2025-05-05)
|
|
4
47
|
|
|
5
48
|
|
package/build/index.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare function docs(options: docs_v1.Options): docs_v1.Docs;
|
|
|
9
9
|
declare const auth: AuthPlus;
|
|
10
10
|
export { auth };
|
|
11
11
|
export { docs_v1 };
|
|
12
|
-
export { AuthPlus, GlobalOptions, APIRequestContext, GoogleConfigurable, StreamMethodOptions,
|
|
12
|
+
export { AuthPlus, GlobalOptions, APIRequestContext, GoogleConfigurable, StreamMethodOptions, MethodOptions, BodyResponseCallback, } from 'googleapis-common';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,kCAAkC;AAElC,yDAAuE;AACvE,6BAA6B;AAiBrB,wFAjBA,YAAO,OAiBA;AAfF,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,YAAO,CAAC,IAAI;CACjB,CAAC;AAIF,SAAgB,IAAI,CAElB,gBAAwC;IAExC,OAAO,IAAA,0BAAM,EAAI,MAAM,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC;AALD,oBAKC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAEZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,kCAAkC;AAElC,yDAAuE;AACvE,6BAA6B;AAiBrB,wFAjBA,YAAO,OAiBA;AAfF,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,YAAO,CAAC,IAAI;CACjB,CAAC;AAIF,SAAgB,IAAI,CAElB,gBAAwC;IAExC,OAAO,IAAA,0BAAM,EAAI,MAAM,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC;AALD,oBAKC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAEZ,uDAQ2B;AAPzB,6GAAA,QAAQ,OAAA"}
|
package/build/v1.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient,
|
|
2
|
+
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
export declare namespace docs_v1 {
|
|
5
5
|
export interface Options extends GlobalOptions {
|
|
@@ -3479,42 +3479,262 @@ export declare namespace docs_v1 {
|
|
|
3479
3479
|
constructor(context: APIRequestContext);
|
|
3480
3480
|
/**
|
|
3481
3481
|
* Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.
|
|
3482
|
+
* @example
|
|
3483
|
+
* ```js
|
|
3484
|
+
* // Before running the sample:
|
|
3485
|
+
* // - Enable the API at:
|
|
3486
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3487
|
+
* // - Login into gcloud by running:
|
|
3488
|
+
* // ```sh
|
|
3489
|
+
* // $ gcloud auth application-default login
|
|
3490
|
+
* // ```
|
|
3491
|
+
* // - Install the npm module by running:
|
|
3492
|
+
* // ```sh
|
|
3493
|
+
* // $ npm install googleapis
|
|
3494
|
+
* // ```
|
|
3495
|
+
*
|
|
3496
|
+
* const {google} = require('googleapis');
|
|
3497
|
+
* const docs = google.docs('v1');
|
|
3498
|
+
*
|
|
3499
|
+
* async function main() {
|
|
3500
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3501
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3502
|
+
* scopes: [
|
|
3503
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3504
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3505
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3506
|
+
* ],
|
|
3507
|
+
* });
|
|
3508
|
+
*
|
|
3509
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3510
|
+
* const authClient = await auth.getClient();
|
|
3511
|
+
* google.options({auth: authClient});
|
|
3512
|
+
*
|
|
3513
|
+
* // Do the magic
|
|
3514
|
+
* const res = await docs.documents.batchUpdate({
|
|
3515
|
+
* // The ID of the document to update.
|
|
3516
|
+
* documentId: 'placeholder-value',
|
|
3517
|
+
*
|
|
3518
|
+
* // Request body metadata
|
|
3519
|
+
* requestBody: {
|
|
3520
|
+
* // request body parameters
|
|
3521
|
+
* // {
|
|
3522
|
+
* // "requests": [],
|
|
3523
|
+
* // "writeControl": {}
|
|
3524
|
+
* // }
|
|
3525
|
+
* },
|
|
3526
|
+
* });
|
|
3527
|
+
* console.log(res.data);
|
|
3528
|
+
*
|
|
3529
|
+
* // Example response
|
|
3530
|
+
* // {
|
|
3531
|
+
* // "documentId": "my_documentId",
|
|
3532
|
+
* // "replies": [],
|
|
3533
|
+
* // "writeControl": {}
|
|
3534
|
+
* // }
|
|
3535
|
+
* }
|
|
3536
|
+
*
|
|
3537
|
+
* main().catch(e => {
|
|
3538
|
+
* console.error(e);
|
|
3539
|
+
* throw e;
|
|
3540
|
+
* });
|
|
3541
|
+
*
|
|
3542
|
+
* ```
|
|
3482
3543
|
*
|
|
3483
3544
|
* @param params - Parameters for request
|
|
3484
3545
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
3485
3546
|
* @param callback - Optional callback that handles the response.
|
|
3486
3547
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
3487
3548
|
*/
|
|
3488
|
-
batchUpdate(params: Params$Resource$Documents$Batchupdate, options: StreamMethodOptions):
|
|
3489
|
-
batchUpdate(params?: Params$Resource$Documents$Batchupdate, options?: MethodOptions):
|
|
3549
|
+
batchUpdate(params: Params$Resource$Documents$Batchupdate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3550
|
+
batchUpdate(params?: Params$Resource$Documents$Batchupdate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateDocumentResponse>>;
|
|
3490
3551
|
batchUpdate(params: Params$Resource$Documents$Batchupdate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
3491
3552
|
batchUpdate(params: Params$Resource$Documents$Batchupdate, options: MethodOptions | BodyResponseCallback<Schema$BatchUpdateDocumentResponse>, callback: BodyResponseCallback<Schema$BatchUpdateDocumentResponse>): void;
|
|
3492
3553
|
batchUpdate(params: Params$Resource$Documents$Batchupdate, callback: BodyResponseCallback<Schema$BatchUpdateDocumentResponse>): void;
|
|
3493
3554
|
batchUpdate(callback: BodyResponseCallback<Schema$BatchUpdateDocumentResponse>): void;
|
|
3494
3555
|
/**
|
|
3495
3556
|
* Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.
|
|
3557
|
+
* @example
|
|
3558
|
+
* ```js
|
|
3559
|
+
* // Before running the sample:
|
|
3560
|
+
* // - Enable the API at:
|
|
3561
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3562
|
+
* // - Login into gcloud by running:
|
|
3563
|
+
* // ```sh
|
|
3564
|
+
* // $ gcloud auth application-default login
|
|
3565
|
+
* // ```
|
|
3566
|
+
* // - Install the npm module by running:
|
|
3567
|
+
* // ```sh
|
|
3568
|
+
* // $ npm install googleapis
|
|
3569
|
+
* // ```
|
|
3570
|
+
*
|
|
3571
|
+
* const {google} = require('googleapis');
|
|
3572
|
+
* const docs = google.docs('v1');
|
|
3573
|
+
*
|
|
3574
|
+
* async function main() {
|
|
3575
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3576
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3577
|
+
* scopes: [
|
|
3578
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3579
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3580
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3581
|
+
* ],
|
|
3582
|
+
* });
|
|
3583
|
+
*
|
|
3584
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3585
|
+
* const authClient = await auth.getClient();
|
|
3586
|
+
* google.options({auth: authClient});
|
|
3587
|
+
*
|
|
3588
|
+
* // Do the magic
|
|
3589
|
+
* const res = await docs.documents.create({
|
|
3590
|
+
* // Request body metadata
|
|
3591
|
+
* requestBody: {
|
|
3592
|
+
* // request body parameters
|
|
3593
|
+
* // {
|
|
3594
|
+
* // "body": {},
|
|
3595
|
+
* // "documentId": "my_documentId",
|
|
3596
|
+
* // "documentStyle": {},
|
|
3597
|
+
* // "footers": {},
|
|
3598
|
+
* // "footnotes": {},
|
|
3599
|
+
* // "headers": {},
|
|
3600
|
+
* // "inlineObjects": {},
|
|
3601
|
+
* // "lists": {},
|
|
3602
|
+
* // "namedRanges": {},
|
|
3603
|
+
* // "namedStyles": {},
|
|
3604
|
+
* // "positionedObjects": {},
|
|
3605
|
+
* // "revisionId": "my_revisionId",
|
|
3606
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3607
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3608
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3609
|
+
* // "tabs": [],
|
|
3610
|
+
* // "title": "my_title"
|
|
3611
|
+
* // }
|
|
3612
|
+
* },
|
|
3613
|
+
* });
|
|
3614
|
+
* console.log(res.data);
|
|
3615
|
+
*
|
|
3616
|
+
* // Example response
|
|
3617
|
+
* // {
|
|
3618
|
+
* // "body": {},
|
|
3619
|
+
* // "documentId": "my_documentId",
|
|
3620
|
+
* // "documentStyle": {},
|
|
3621
|
+
* // "footers": {},
|
|
3622
|
+
* // "footnotes": {},
|
|
3623
|
+
* // "headers": {},
|
|
3624
|
+
* // "inlineObjects": {},
|
|
3625
|
+
* // "lists": {},
|
|
3626
|
+
* // "namedRanges": {},
|
|
3627
|
+
* // "namedStyles": {},
|
|
3628
|
+
* // "positionedObjects": {},
|
|
3629
|
+
* // "revisionId": "my_revisionId",
|
|
3630
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3631
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3632
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3633
|
+
* // "tabs": [],
|
|
3634
|
+
* // "title": "my_title"
|
|
3635
|
+
* // }
|
|
3636
|
+
* }
|
|
3637
|
+
*
|
|
3638
|
+
* main().catch(e => {
|
|
3639
|
+
* console.error(e);
|
|
3640
|
+
* throw e;
|
|
3641
|
+
* });
|
|
3642
|
+
*
|
|
3643
|
+
* ```
|
|
3496
3644
|
*
|
|
3497
3645
|
* @param params - Parameters for request
|
|
3498
3646
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
3499
3647
|
* @param callback - Optional callback that handles the response.
|
|
3500
3648
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
3501
3649
|
*/
|
|
3502
|
-
create(params: Params$Resource$Documents$Create, options: StreamMethodOptions):
|
|
3503
|
-
create(params?: Params$Resource$Documents$Create, options?: MethodOptions):
|
|
3650
|
+
create(params: Params$Resource$Documents$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3651
|
+
create(params?: Params$Resource$Documents$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Document>>;
|
|
3504
3652
|
create(params: Params$Resource$Documents$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
3505
3653
|
create(params: Params$Resource$Documents$Create, options: MethodOptions | BodyResponseCallback<Schema$Document>, callback: BodyResponseCallback<Schema$Document>): void;
|
|
3506
3654
|
create(params: Params$Resource$Documents$Create, callback: BodyResponseCallback<Schema$Document>): void;
|
|
3507
3655
|
create(callback: BodyResponseCallback<Schema$Document>): void;
|
|
3508
3656
|
/**
|
|
3509
3657
|
* Gets the latest version of the specified document.
|
|
3658
|
+
* @example
|
|
3659
|
+
* ```js
|
|
3660
|
+
* // Before running the sample:
|
|
3661
|
+
* // - Enable the API at:
|
|
3662
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3663
|
+
* // - Login into gcloud by running:
|
|
3664
|
+
* // ```sh
|
|
3665
|
+
* // $ gcloud auth application-default login
|
|
3666
|
+
* // ```
|
|
3667
|
+
* // - Install the npm module by running:
|
|
3668
|
+
* // ```sh
|
|
3669
|
+
* // $ npm install googleapis
|
|
3670
|
+
* // ```
|
|
3671
|
+
*
|
|
3672
|
+
* const {google} = require('googleapis');
|
|
3673
|
+
* const docs = google.docs('v1');
|
|
3674
|
+
*
|
|
3675
|
+
* async function main() {
|
|
3676
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3677
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3678
|
+
* scopes: [
|
|
3679
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3680
|
+
* 'https://www.googleapis.com/auth/documents.readonly',
|
|
3681
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3682
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3683
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
3684
|
+
* ],
|
|
3685
|
+
* });
|
|
3686
|
+
*
|
|
3687
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3688
|
+
* const authClient = await auth.getClient();
|
|
3689
|
+
* google.options({auth: authClient});
|
|
3690
|
+
*
|
|
3691
|
+
* // Do the magic
|
|
3692
|
+
* const res = await docs.documents.get({
|
|
3693
|
+
* // The ID of the document to retrieve.
|
|
3694
|
+
* documentId: 'placeholder-value',
|
|
3695
|
+
* // Whether to populate the Document.tabs field instead of the text content fields like `body` and `documentStyle` on Document. - When `True`: Document content populates in the Document.tabs field instead of the text content fields in Document. - When `False`: The content of the document's first tab populates the content fields in Document excluding Document.tabs. If a document has only one tab, then that tab is used to populate the document content. Document.tabs will be empty.
|
|
3696
|
+
* includeTabsContent: 'placeholder-value',
|
|
3697
|
+
* // The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, DEFAULT_FOR_CURRENT_ACCESS is used.
|
|
3698
|
+
* suggestionsViewMode: 'placeholder-value',
|
|
3699
|
+
* });
|
|
3700
|
+
* console.log(res.data);
|
|
3701
|
+
*
|
|
3702
|
+
* // Example response
|
|
3703
|
+
* // {
|
|
3704
|
+
* // "body": {},
|
|
3705
|
+
* // "documentId": "my_documentId",
|
|
3706
|
+
* // "documentStyle": {},
|
|
3707
|
+
* // "footers": {},
|
|
3708
|
+
* // "footnotes": {},
|
|
3709
|
+
* // "headers": {},
|
|
3710
|
+
* // "inlineObjects": {},
|
|
3711
|
+
* // "lists": {},
|
|
3712
|
+
* // "namedRanges": {},
|
|
3713
|
+
* // "namedStyles": {},
|
|
3714
|
+
* // "positionedObjects": {},
|
|
3715
|
+
* // "revisionId": "my_revisionId",
|
|
3716
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3717
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3718
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3719
|
+
* // "tabs": [],
|
|
3720
|
+
* // "title": "my_title"
|
|
3721
|
+
* // }
|
|
3722
|
+
* }
|
|
3723
|
+
*
|
|
3724
|
+
* main().catch(e => {
|
|
3725
|
+
* console.error(e);
|
|
3726
|
+
* throw e;
|
|
3727
|
+
* });
|
|
3728
|
+
*
|
|
3729
|
+
* ```
|
|
3510
3730
|
*
|
|
3511
3731
|
* @param params - Parameters for request
|
|
3512
3732
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
3513
3733
|
* @param callback - Optional callback that handles the response.
|
|
3514
3734
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
3515
3735
|
*/
|
|
3516
|
-
get(params: Params$Resource$Documents$Get, options: StreamMethodOptions):
|
|
3517
|
-
get(params?: Params$Resource$Documents$Get, options?: MethodOptions):
|
|
3736
|
+
get(params: Params$Resource$Documents$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3737
|
+
get(params?: Params$Resource$Documents$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Document>>;
|
|
3518
3738
|
get(params: Params$Resource$Documents$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
3519
3739
|
get(params: Params$Resource$Documents$Get, options: MethodOptions | BodyResponseCallback<Schema$Document>, callback: BodyResponseCallback<Schema$Document>): void;
|
|
3520
3740
|
get(params: Params$Resource$Documents$Get, callback: BodyResponseCallback<Schema$Document>): void;
|
package/build/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,OAAO,
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D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ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googleapis/docs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "docs",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"webpack": "webpack"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"googleapis-common": "^
|
|
31
|
+
"googleapis-common": "^8.0.2-rc.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-documenter": "^7.8.10",
|
package/v1.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
Compute,
|
|
24
24
|
UserRefreshClient,
|
|
25
25
|
BaseExternalAccountClient,
|
|
26
|
-
|
|
26
|
+
GaxiosResponseWithHTTP2,
|
|
27
27
|
GoogleConfigurable,
|
|
28
28
|
createAPIRequest,
|
|
29
29
|
MethodOptions,
|
|
@@ -3504,6 +3504,67 @@ export namespace docs_v1 {
|
|
|
3504
3504
|
|
|
3505
3505
|
/**
|
|
3506
3506
|
* Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.
|
|
3507
|
+
* @example
|
|
3508
|
+
* ```js
|
|
3509
|
+
* // Before running the sample:
|
|
3510
|
+
* // - Enable the API at:
|
|
3511
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3512
|
+
* // - Login into gcloud by running:
|
|
3513
|
+
* // ```sh
|
|
3514
|
+
* // $ gcloud auth application-default login
|
|
3515
|
+
* // ```
|
|
3516
|
+
* // - Install the npm module by running:
|
|
3517
|
+
* // ```sh
|
|
3518
|
+
* // $ npm install googleapis
|
|
3519
|
+
* // ```
|
|
3520
|
+
*
|
|
3521
|
+
* const {google} = require('googleapis');
|
|
3522
|
+
* const docs = google.docs('v1');
|
|
3523
|
+
*
|
|
3524
|
+
* async function main() {
|
|
3525
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3526
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3527
|
+
* scopes: [
|
|
3528
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3529
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3530
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3531
|
+
* ],
|
|
3532
|
+
* });
|
|
3533
|
+
*
|
|
3534
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3535
|
+
* const authClient = await auth.getClient();
|
|
3536
|
+
* google.options({auth: authClient});
|
|
3537
|
+
*
|
|
3538
|
+
* // Do the magic
|
|
3539
|
+
* const res = await docs.documents.batchUpdate({
|
|
3540
|
+
* // The ID of the document to update.
|
|
3541
|
+
* documentId: 'placeholder-value',
|
|
3542
|
+
*
|
|
3543
|
+
* // Request body metadata
|
|
3544
|
+
* requestBody: {
|
|
3545
|
+
* // request body parameters
|
|
3546
|
+
* // {
|
|
3547
|
+
* // "requests": [],
|
|
3548
|
+
* // "writeControl": {}
|
|
3549
|
+
* // }
|
|
3550
|
+
* },
|
|
3551
|
+
* });
|
|
3552
|
+
* console.log(res.data);
|
|
3553
|
+
*
|
|
3554
|
+
* // Example response
|
|
3555
|
+
* // {
|
|
3556
|
+
* // "documentId": "my_documentId",
|
|
3557
|
+
* // "replies": [],
|
|
3558
|
+
* // "writeControl": {}
|
|
3559
|
+
* // }
|
|
3560
|
+
* }
|
|
3561
|
+
*
|
|
3562
|
+
* main().catch(e => {
|
|
3563
|
+
* console.error(e);
|
|
3564
|
+
* throw e;
|
|
3565
|
+
* });
|
|
3566
|
+
*
|
|
3567
|
+
* ```
|
|
3507
3568
|
*
|
|
3508
3569
|
* @param params - Parameters for request
|
|
3509
3570
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3513,11 +3574,11 @@ export namespace docs_v1 {
|
|
|
3513
3574
|
batchUpdate(
|
|
3514
3575
|
params: Params$Resource$Documents$Batchupdate,
|
|
3515
3576
|
options: StreamMethodOptions
|
|
3516
|
-
):
|
|
3577
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3517
3578
|
batchUpdate(
|
|
3518
3579
|
params?: Params$Resource$Documents$Batchupdate,
|
|
3519
3580
|
options?: MethodOptions
|
|
3520
|
-
):
|
|
3581
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateDocumentResponse>>;
|
|
3521
3582
|
batchUpdate(
|
|
3522
3583
|
params: Params$Resource$Documents$Batchupdate,
|
|
3523
3584
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -3552,8 +3613,8 @@ export namespace docs_v1 {
|
|
|
3552
3613
|
| BodyResponseCallback<Readable>
|
|
3553
3614
|
):
|
|
3554
3615
|
| void
|
|
3555
|
-
|
|
|
3556
|
-
|
|
|
3616
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateDocumentResponse>>
|
|
3617
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
3557
3618
|
let params = (paramsOrCallback ||
|
|
3558
3619
|
{}) as Params$Resource$Documents$Batchupdate;
|
|
3559
3620
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -3599,6 +3660,93 @@ export namespace docs_v1 {
|
|
|
3599
3660
|
|
|
3600
3661
|
/**
|
|
3601
3662
|
* Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.
|
|
3663
|
+
* @example
|
|
3664
|
+
* ```js
|
|
3665
|
+
* // Before running the sample:
|
|
3666
|
+
* // - Enable the API at:
|
|
3667
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3668
|
+
* // - Login into gcloud by running:
|
|
3669
|
+
* // ```sh
|
|
3670
|
+
* // $ gcloud auth application-default login
|
|
3671
|
+
* // ```
|
|
3672
|
+
* // - Install the npm module by running:
|
|
3673
|
+
* // ```sh
|
|
3674
|
+
* // $ npm install googleapis
|
|
3675
|
+
* // ```
|
|
3676
|
+
*
|
|
3677
|
+
* const {google} = require('googleapis');
|
|
3678
|
+
* const docs = google.docs('v1');
|
|
3679
|
+
*
|
|
3680
|
+
* async function main() {
|
|
3681
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3682
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3683
|
+
* scopes: [
|
|
3684
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3685
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3686
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3687
|
+
* ],
|
|
3688
|
+
* });
|
|
3689
|
+
*
|
|
3690
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3691
|
+
* const authClient = await auth.getClient();
|
|
3692
|
+
* google.options({auth: authClient});
|
|
3693
|
+
*
|
|
3694
|
+
* // Do the magic
|
|
3695
|
+
* const res = await docs.documents.create({
|
|
3696
|
+
* // Request body metadata
|
|
3697
|
+
* requestBody: {
|
|
3698
|
+
* // request body parameters
|
|
3699
|
+
* // {
|
|
3700
|
+
* // "body": {},
|
|
3701
|
+
* // "documentId": "my_documentId",
|
|
3702
|
+
* // "documentStyle": {},
|
|
3703
|
+
* // "footers": {},
|
|
3704
|
+
* // "footnotes": {},
|
|
3705
|
+
* // "headers": {},
|
|
3706
|
+
* // "inlineObjects": {},
|
|
3707
|
+
* // "lists": {},
|
|
3708
|
+
* // "namedRanges": {},
|
|
3709
|
+
* // "namedStyles": {},
|
|
3710
|
+
* // "positionedObjects": {},
|
|
3711
|
+
* // "revisionId": "my_revisionId",
|
|
3712
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3713
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3714
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3715
|
+
* // "tabs": [],
|
|
3716
|
+
* // "title": "my_title"
|
|
3717
|
+
* // }
|
|
3718
|
+
* },
|
|
3719
|
+
* });
|
|
3720
|
+
* console.log(res.data);
|
|
3721
|
+
*
|
|
3722
|
+
* // Example response
|
|
3723
|
+
* // {
|
|
3724
|
+
* // "body": {},
|
|
3725
|
+
* // "documentId": "my_documentId",
|
|
3726
|
+
* // "documentStyle": {},
|
|
3727
|
+
* // "footers": {},
|
|
3728
|
+
* // "footnotes": {},
|
|
3729
|
+
* // "headers": {},
|
|
3730
|
+
* // "inlineObjects": {},
|
|
3731
|
+
* // "lists": {},
|
|
3732
|
+
* // "namedRanges": {},
|
|
3733
|
+
* // "namedStyles": {},
|
|
3734
|
+
* // "positionedObjects": {},
|
|
3735
|
+
* // "revisionId": "my_revisionId",
|
|
3736
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3737
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3738
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3739
|
+
* // "tabs": [],
|
|
3740
|
+
* // "title": "my_title"
|
|
3741
|
+
* // }
|
|
3742
|
+
* }
|
|
3743
|
+
*
|
|
3744
|
+
* main().catch(e => {
|
|
3745
|
+
* console.error(e);
|
|
3746
|
+
* throw e;
|
|
3747
|
+
* });
|
|
3748
|
+
*
|
|
3749
|
+
* ```
|
|
3602
3750
|
*
|
|
3603
3751
|
* @param params - Parameters for request
|
|
3604
3752
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3608,11 +3756,11 @@ export namespace docs_v1 {
|
|
|
3608
3756
|
create(
|
|
3609
3757
|
params: Params$Resource$Documents$Create,
|
|
3610
3758
|
options: StreamMethodOptions
|
|
3611
|
-
):
|
|
3759
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3612
3760
|
create(
|
|
3613
3761
|
params?: Params$Resource$Documents$Create,
|
|
3614
3762
|
options?: MethodOptions
|
|
3615
|
-
):
|
|
3763
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Document>>;
|
|
3616
3764
|
create(
|
|
3617
3765
|
params: Params$Resource$Documents$Create,
|
|
3618
3766
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -3641,7 +3789,10 @@ export namespace docs_v1 {
|
|
|
3641
3789
|
callback?:
|
|
3642
3790
|
| BodyResponseCallback<Schema$Document>
|
|
3643
3791
|
| BodyResponseCallback<Readable>
|
|
3644
|
-
):
|
|
3792
|
+
):
|
|
3793
|
+
| void
|
|
3794
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Document>>
|
|
3795
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
3645
3796
|
let params = (paramsOrCallback || {}) as Params$Resource$Documents$Create;
|
|
3646
3797
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
3647
3798
|
|
|
@@ -3683,6 +3834,78 @@ export namespace docs_v1 {
|
|
|
3683
3834
|
|
|
3684
3835
|
/**
|
|
3685
3836
|
* Gets the latest version of the specified document.
|
|
3837
|
+
* @example
|
|
3838
|
+
* ```js
|
|
3839
|
+
* // Before running the sample:
|
|
3840
|
+
* // - Enable the API at:
|
|
3841
|
+
* // https://console.developers.google.com/apis/api/docs.googleapis.com
|
|
3842
|
+
* // - Login into gcloud by running:
|
|
3843
|
+
* // ```sh
|
|
3844
|
+
* // $ gcloud auth application-default login
|
|
3845
|
+
* // ```
|
|
3846
|
+
* // - Install the npm module by running:
|
|
3847
|
+
* // ```sh
|
|
3848
|
+
* // $ npm install googleapis
|
|
3849
|
+
* // ```
|
|
3850
|
+
*
|
|
3851
|
+
* const {google} = require('googleapis');
|
|
3852
|
+
* const docs = google.docs('v1');
|
|
3853
|
+
*
|
|
3854
|
+
* async function main() {
|
|
3855
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3856
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3857
|
+
* scopes: [
|
|
3858
|
+
* 'https://www.googleapis.com/auth/documents',
|
|
3859
|
+
* 'https://www.googleapis.com/auth/documents.readonly',
|
|
3860
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
3861
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
3862
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
3863
|
+
* ],
|
|
3864
|
+
* });
|
|
3865
|
+
*
|
|
3866
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3867
|
+
* const authClient = await auth.getClient();
|
|
3868
|
+
* google.options({auth: authClient});
|
|
3869
|
+
*
|
|
3870
|
+
* // Do the magic
|
|
3871
|
+
* const res = await docs.documents.get({
|
|
3872
|
+
* // The ID of the document to retrieve.
|
|
3873
|
+
* documentId: 'placeholder-value',
|
|
3874
|
+
* // Whether to populate the Document.tabs field instead of the text content fields like `body` and `documentStyle` on Document. - When `True`: Document content populates in the Document.tabs field instead of the text content fields in Document. - When `False`: The content of the document's first tab populates the content fields in Document excluding Document.tabs. If a document has only one tab, then that tab is used to populate the document content. Document.tabs will be empty.
|
|
3875
|
+
* includeTabsContent: 'placeholder-value',
|
|
3876
|
+
* // The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, DEFAULT_FOR_CURRENT_ACCESS is used.
|
|
3877
|
+
* suggestionsViewMode: 'placeholder-value',
|
|
3878
|
+
* });
|
|
3879
|
+
* console.log(res.data);
|
|
3880
|
+
*
|
|
3881
|
+
* // Example response
|
|
3882
|
+
* // {
|
|
3883
|
+
* // "body": {},
|
|
3884
|
+
* // "documentId": "my_documentId",
|
|
3885
|
+
* // "documentStyle": {},
|
|
3886
|
+
* // "footers": {},
|
|
3887
|
+
* // "footnotes": {},
|
|
3888
|
+
* // "headers": {},
|
|
3889
|
+
* // "inlineObjects": {},
|
|
3890
|
+
* // "lists": {},
|
|
3891
|
+
* // "namedRanges": {},
|
|
3892
|
+
* // "namedStyles": {},
|
|
3893
|
+
* // "positionedObjects": {},
|
|
3894
|
+
* // "revisionId": "my_revisionId",
|
|
3895
|
+
* // "suggestedDocumentStyleChanges": {},
|
|
3896
|
+
* // "suggestedNamedStylesChanges": {},
|
|
3897
|
+
* // "suggestionsViewMode": "my_suggestionsViewMode",
|
|
3898
|
+
* // "tabs": [],
|
|
3899
|
+
* // "title": "my_title"
|
|
3900
|
+
* // }
|
|
3901
|
+
* }
|
|
3902
|
+
*
|
|
3903
|
+
* main().catch(e => {
|
|
3904
|
+
* console.error(e);
|
|
3905
|
+
* throw e;
|
|
3906
|
+
* });
|
|
3907
|
+
*
|
|
3908
|
+
* ```
|
|
3686
3909
|
*
|
|
3687
3910
|
* @param params - Parameters for request
|
|
3688
3911
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3692,11 +3915,11 @@ export namespace docs_v1 {
|
|
|
3692
3915
|
get(
|
|
3693
3916
|
params: Params$Resource$Documents$Get,
|
|
3694
3917
|
options: StreamMethodOptions
|
|
3695
|
-
):
|
|
3918
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3696
3919
|
get(
|
|
3697
3920
|
params?: Params$Resource$Documents$Get,
|
|
3698
3921
|
options?: MethodOptions
|
|
3699
|
-
):
|
|
3922
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Document>>;
|
|
3700
3923
|
get(
|
|
3701
3924
|
params: Params$Resource$Documents$Get,
|
|
3702
3925
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -3725,7 +3948,10 @@ export namespace docs_v1 {
|
|
|
3725
3948
|
callback?:
|
|
3726
3949
|
| BodyResponseCallback<Schema$Document>
|
|
3727
3950
|
| BodyResponseCallback<Readable>
|
|
3728
|
-
):
|
|
3951
|
+
):
|
|
3952
|
+
| void
|
|
3953
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Document>>
|
|
3954
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
3729
3955
|
let params = (paramsOrCallback || {}) as Params$Resource$Documents$Get;
|
|
3730
3956
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
3731
3957
|
|