plenna_utilities 1.4.1 → 1.5.0
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.
|
@@ -16,6 +16,10 @@ interface deleteDocumentResponse {
|
|
|
16
16
|
}
|
|
17
17
|
export interface ISchemaRequest extends docs_v1.Schema$Request {
|
|
18
18
|
}
|
|
19
|
+
export interface IInsertText extends docs_v1.Schema$InsertTextRequest {
|
|
20
|
+
}
|
|
21
|
+
export interface ITextStyles extends docs_v1.Schema$UpdateTextStyleRequest {
|
|
22
|
+
}
|
|
19
23
|
export interface ICredentials extends JWTInput {
|
|
20
24
|
}
|
|
21
25
|
export declare class PlennaGoogleService {
|
|
@@ -25,6 +29,7 @@ export declare class PlennaGoogleService {
|
|
|
25
29
|
getDocument(documentId: string): Promise<docs_v1.Schema$Document | undefined>;
|
|
26
30
|
cloneDocument(documentId: string, folderId: string): Promise<cloneDocumentResponse>;
|
|
27
31
|
buildPayload(template?: Array<Partial<IPlennaGoogleBase>>): ISchemaRequest[];
|
|
32
|
+
addTextToRequest(text: IInsertText, style: ITextStyles): ISchemaRequest[];
|
|
28
33
|
updateDocument(id: string, requests?: ISchemaRequest[]): Promise<updateDocumentResponse>;
|
|
29
34
|
exportDocumentAsUrl(fileId: string): Promise<string | undefined>;
|
|
30
35
|
exportDocumentAsFile(fileId: string): Promise<ArrayBuffer | undefined>;
|
package/dist/src/google/index.js
CHANGED
|
@@ -51,6 +51,16 @@ class PlennaGoogleService {
|
|
|
51
51
|
buildPayload(template = []) {
|
|
52
52
|
return (0, requestBuilder_1.payloadBuilder)(template);
|
|
53
53
|
}
|
|
54
|
+
addTextToRequest(text, style) {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
insertText: text
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
updateTextStyle: style
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
}
|
|
54
64
|
async updateDocument(id, requests = []) {
|
|
55
65
|
const authClient = this.authorization();
|
|
56
66
|
const client = new docs_1.docs_v1.Docs({ auth: authClient });
|