Skip to content

Commit cdf342e

Browse files
committed
build: fix docs generation after tsdoc 2.8 upgrade + updates
1 parent 3fa4bd6 commit cdf342e

File tree

12 files changed

+234
-237
lines changed

12 files changed

+234
-237
lines changed

devbox.lock

Lines changed: 101 additions & 100 deletions
Large diffs are not rendered by default.

docs/docs/reference/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Decrypt a PDF attachment and store it to a Google Drive location.<br />NOTE: PDF
5151
| `conflictStrategy` | `ConflictStrategy` | The strategy to be used in case a file already exists at the desired location. See [Enum Type `ConflictStrategy`](enum-types.mdx#conflictstrategy) for valid values. |
5252
| `description` | `string` | The description to be attached to the Google Drive file.<br />Supports [placeholder](placeholder.mdx) substitution. |
5353
| `location` | `string` | The location (path + filename) of the Google Drive file.<br />For shared folders or Team Drives prepend the location with the folder ID like `{id:<folderId>}/...`.<br />Supports [placeholder](placeholder.mdx) substitution. |
54-
| `password` | `string` | The password to be used PDF decryption. |
54+
| `password` | `string` | The password to be used for PDF decryption. |
5555
| `toMimeType` | `string` | Convert to a Google file type using one of the <a href="https://developers.google.com/drive/api/guides/mime-types?hl=en">supported mime-types by Google Drive</a>, like:<br />* `application/vnd.google-apps.document`: Google Docs<br />* `application/vnd.google-apps.presentation`: Google Slides<br />* `application/vnd.google-apps.spreadsheet`: Google Sheets |
5656

5757
## Global Actions

docs/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 8 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/update-docs-extract-actions.jq

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,8 @@
11
include "update-docs-extract-common";
22

3-
{
4-
Project: 1, # 0x1
5-
Module: 2, # 0x2
6-
Namespace: 4, # 0x4
7-
Enum: 8, # 0x8
8-
EnumMember: 16, # 0x10
9-
Variable: 32, # 0x20
10-
Function: 64, # 0x40
11-
Class: 128, # 0x80
12-
Interface: 256, # 0x100
13-
Constructor: 512, # 0x200
14-
Property: 1024, # 0x400
15-
Method: 2048, # 0x800
16-
CallSignature: 4096, # 0x1000
17-
IndexSignature: 8192, # 0x2000
18-
ConstructorSignature: 16384, # 0x4000
19-
Parameter: 32768, # 0x8000
20-
TypeLiteral: 65536, # 0x10000
21-
TypeParameter: 131072, # 0x20000
22-
Accessor: 262144, # 0x40000
23-
GetSignature: 524288, # 0x80000
24-
SetSignature: 1048576, # 0x100000
25-
TypeAlias: 2097152, # 0x200000
26-
Reference: 4194304, # 0x400000
27-
} as $kinds
28-
29-
| {
30-
GlobalActions: "global",
31-
MessageActions: "message",
32-
ThreadActions: "thread",
33-
AttachmentActions: "attachment"
34-
} as $typeMap
35-
36-
| [
37-
..
38-
| select(type=="object" and .id)
39-
| del(.symbolIdMap,.sources,.groups)
40-
] as $list
3+
getKinds as $kinds
4+
| getTypeMap as $typeMap
5+
| getDeclarations as $list
416

427
# Iterate over action classes:
438
| [
@@ -46,7 +11,7 @@ include "update-docs-extract-common";
4611
| .key as $className
4712
| .value as $prefix
4813
| $list[]
49-
| select(.kind==$kinds["Class"] and .name==$className)
14+
| select(.kind==$kinds["Class"] and .variant=="declaration" and .name==$className)
5015
| .id as $id
5116

5217
# Get methods, args, properties, types
@@ -64,7 +29,7 @@ include "update-docs-extract-common";
6429
args: [
6530
.parameters[]
6631
| select(.name=="args")
67-
| propertiesFromType($list;$kinds)
32+
| propertiesFromType($list)
6833
]
6934
| sort_by(.name)
7035
}
Lines changed: 90 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
1+
def getTypeMap: (
2+
{
3+
GlobalActions: "global",
4+
MessageActions: "message",
5+
ThreadActions: "thread",
6+
AttachmentActions: "attachment"
7+
}
8+
);
9+
10+
def getKinds: (
11+
{
12+
Project: 1, # 0x1
13+
Module: 2, # 0x2
14+
Namespace: 4, # 0x4
15+
Enum: 8, # 0x8
16+
EnumMember: 16, # 0x10
17+
Variable: 32, # 0x20
18+
Function: 64, # 0x40
19+
Class: 128, # 0x80
20+
Interface: 256, # 0x100
21+
Constructor: 512, # 0x200
22+
Property: 1024, # 0x400
23+
Method: 2048, # 0x800
24+
CallSignature: 4096, # 0x1000
25+
IndexSignature: 8192, # 0x2000
26+
ConstructorSignature: 16384, # 0x4000
27+
Parameter: 32768, # 0x8000
28+
TypeLiteral: 65536, # 0x10000
29+
TypeParameter: 131072, # 0x20000
30+
Accessor: 262144, # 0x40000
31+
GetSignature: 524288, # 0x80000
32+
SetSignature: 1048576, # 0x100000
33+
TypeAlias: 2097152, # 0x200000
34+
Reference: 4194304, # 0x400000
35+
}
36+
);
37+
38+
def getDeclarations: (
39+
[
40+
..
41+
| select(type=="object" and .kind>4 and .variant=="declaration" and .id)
42+
| del(.symbolIdMap,.sources,.groups)
43+
]
44+
| sort_by(.id)
45+
);
46+
47+
def commentSummaryToDescription: (
48+
(.comment?.summary // [])
49+
| map(.text)
50+
| join("")
51+
);
52+
153
def extractDescription: (
254
{
3-
description: ([.comment?.summary?[]?.text]|join("")),
55+
description: commentSummaryToDescription,
456
deprecated: ([.comment?.blockTags?[]?|select(.tag=="@deprecated")]|length>0),
557
deprecationInfo: ([.comment?.blockTags?[]?|select(.tag=="@deprecated")|.content?[]?.text]|join("")),
658
}
@@ -12,46 +64,47 @@ def flattenTypes: (
1264
| walk(if type=="object" and .children then (.|del(.children)) else . end)
1365
);
1466

15-
def resolveType($list): (
67+
def resolveType($declarations): (
1668
. as $type
17-
| $list
69+
| $declarations
1870
| [
1971
.[] | select(.id == $type.target)
2072
] | first
2173
);
2274

23-
def resolveTypes($list): (
75+
def resolveTypes($declarations): (
2476
walk(
2577
if type=="object" then
2678
if has("target") and (.target|type)=="number" then
27-
. * resolveType($list)
79+
. * resolveType($declarations)
2880
| del(.target)
29-
elif has("type") and .type=="intersection" and has("types") then
81+
elif has("type") and (.type=="intersection" or .type=="union") and has("types") then
3082
.types = [
3183
.types[]
32-
| resolveTypes($list)
84+
| resolveTypes($declarations)
3385
]
3486
else
35-
map_values(resolveTypes($list))
87+
map_values(resolveTypes($declarations))
3688
end
3789
else
3890
.
3991
end
92+
| del(.sources?)
4093
)
4194
);
4295

43-
def typeRefName($list;$kinds): (
96+
def typeRefName($declarations): (
4497
. as $type
4598
# | if type == "string" then
4699
# .
47100
| if type == "object" then
48101
if $type.type == "intrinsic"
49102
or $type.variant == "declaration"
50-
or $type.kind==$kinds.Enum then
103+
or $type.kind==getKinds.Enum then
51104
{name:$type.name}
52105
elif $type.type == "array" then
53106
$type.elementType
54-
| typeRefName($list;$kinds)
107+
| typeRefName($declarations)
55108
| {
56109
name: (.name + "[]"),
57110
ref: .name,
@@ -65,28 +118,29 @@ def typeRefName($list;$kinds): (
65118
| .name = .name + "<" + ([$type.typeArguments[].name] | join(",")) + ">"
66119
end
67120
elif $type.type == "reflection" then
68-
debug("typeRefName: reflection \(.)")
69121
[
70122
$type.declaration.children[]
71-
| .name + ": " + (.type|typeRefName($list;$kinds).name)
123+
| .name + ": " + (.type|typeRefName($declarations).name)
72124
]
73125
| join(", ")
74126
| "{" + . + "}"
75127
| {name: .}
76128
elif $type.type == "union" and ($type|has("types")) then
77129
[
78130
$type.types[]
79-
| typeRefName($list;$kinds).name
131+
| typeRefName($declarations).name
80132
] | join(" | ")
81133
| {name: .}
82134
elif $type.type == "intersection" and ($type|has("types")) then
83135
[
84136
$type.types[]
85-
| typeRefName($list;$kinds).name
137+
| typeRefName($declarations).name
86138
] | join(" & ")
87139
| {name:.}
88140
elif ($type.type|type)=="object" and $type.type.name then
89141
{name:$type.type.name}
142+
elif .name then
143+
.
90144
else
91145
error("typeRefName: unexpected else object: \(.)")
92146
end
@@ -95,31 +149,34 @@ def typeRefName($list;$kinds): (
95149
ref: (.ref // .name),
96150
}
97151
else
98-
error("typeRefName: unexpected else type: \($type)")
152+
# error("typeRefName: unexpected else type: \($type)")
153+
{name:$type}
99154
end
100155
);
101156

102-
def extractPropertiesFromType($list;$kinds): (
103-
if type=="object" then
104-
if .declaration?.children then
105-
.declaration?.children?[]?
106-
| select(.kind==$kinds["Property"])
107-
elif .type=="intersection" then
108-
.types[]
109-
| extractPropertiesFromType($list;$kinds)
110-
elif (.type|type)=="object" then
111-
.type
112-
| extractPropertiesFromType($list;$kinds)
113-
end
157+
def extractPropTypes($declarations): (
158+
resolveTypes($declarations)
159+
| if .declaration?.children then
160+
.declaration?.children?[]?
161+
| select(.kind==getKinds["Property"])
162+
elif (.type|type)=="object" then
163+
.type
164+
| extractPropTypes($declarations)
165+
elif .type=="intersection" or .type=="union" then
166+
.types[]
167+
| extractPropTypes($declarations)
168+
elif .type=="reference" and .variant=="declaration" and .children then
169+
.children[]
170+
else
171+
error("extractPropTypes: unexpected else object: \(.)")
114172
end
115173
);
116174

117-
def propertiesFromType($list;$kinds): (
118-
resolveTypes($list)
119-
| extractPropertiesFromType($list;$kinds)
175+
def propertiesFromType($declarations): (
176+
extractPropTypes($declarations)
120177
| {
121178
name,
122-
type: (.type | typeRefName($list;$kinds)),
123-
description: ([.comment?.summary?[]?.text]|join("")),
179+
type: (.type | typeRefName($declarations)),
180+
description: commentSummaryToDescription,
124181
}
125182
);

scripts/update-docs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function extractAllDocs() {
1818
local jsonfile="${1}"
1919
npx typedoc \
2020
--json "${jsonfile}" \
21+
--sort alphabetical \
2122
--readme none \
2223
--exclude 'src/**/generated/**/*.ts' \
2324
'src/lib/**/*.ts'

src/lib/adapter/GDriveAdapter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,7 @@ export class GDriveAdapter extends BaseAdapter {
295295
/**
296296
* Creates a new file in Google Drive
297297
* @param location - The location of the file including the filename
298-
* @param content - The content of the file as a string representation
299-
* @param mimeType - The mime-type of the file
300-
* @param description - The description of the file
298+
* @param fileData - The content of the file
301299
* @param conflictStrategy - The conflict strategy in case a file already exists at the file location (skip, replace)
302300
*/
303301
public createFile(

src/lib/adapter/GmailAdapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class GmailAdapter extends BaseAdapter {
120120
/**
121121
* Generate HTML code for one message of a thread.
122122
* @param thread - The thread to be represented as HTML
123-
* @param skipHeader - Whether to skip the header in the generated HTML
123+
* @param options - The options for generating the HTML code
124124
*/
125125
public threadAsHtml(
126126
thread: GoogleAppsScript.Gmail.GmailThread,

src/lib/config/ActionConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export type StoreActionBaseArgs = {
8282

8383
export type StoreDecryptedPdfActionArgs = StoreActionBaseArgs & {
8484
/**
85-
* The password to be used PDF decryption.
85+
* The password to be used for PDF decryption.
8686
*/
8787
password: string
8888
}

0 commit comments

Comments
 (0)