|
5 | 5 | ```typescript
|
6 | 6 | export class Client {
|
7 | 7 | readonly context: ExecutionContext;
|
| 8 | + |
8 | 9 | getValue<T>(name: string): Promise<T | undefined>;
|
9 | 10 | saveValue(name: string, value: any): Promise<void>;
|
10 |
| - getCollection(name: string, destinationPath: string): Promise<void>; |
11 |
| - saveCollection(name: string, directoryPath: string): Promise<void>; |
| 11 | + getDirectory(name: string, destinationPath: string): Promise<void>; |
| 12 | + saveDirectory(name: string, directoryPath: string): Promise<void>; |
| 13 | + getFile(name: string, destinationPath: string): Promise<void>; |
| 14 | + saveFile(name: string, filePath: string): Promise<void>; |
| 15 | + |
12 | 16 | report(report: CodeChecksReport): Promise<void>;
|
13 | 17 | success(report: CodeChecksReportBody): Promise<void>;
|
14 | 18 | failure(report: CodeChecksReportBody): Promise<void>;
|
| 19 | + |
15 | 20 | isPr(): boolean;
|
| 21 | + |
16 | 22 | getArtifactLink(path: string): string;
|
17 | 23 | getPageLink(dirPath: string, filenamePath?: string): string;
|
18 | 24 | }
|
@@ -74,15 +80,25 @@ undefined when no value was saved.
|
74 | 80 |
|
75 | 81 | Save JSON value with a given name for **current** commit.
|
76 | 82 |
|
77 |
| -### getCollection(name: string, destinationPath: string): Promise<void>; |
| 83 | +### getDirectory(name: string, destinationPath: string): Promise<void>; |
78 | 84 |
|
79 |
| -Get collection (directory of files) with a given name for **base** branch and save all of them to |
| 85 | +Get directory (set of files) with a given name for **base** branch and save all of them to |
80 | 86 | destinationPath. `destinationPath` needs to be absolute path (for now).
|
81 | 87 |
|
82 |
| -### saveCollection(name: string, directoryPath: string): Promise<void>; |
| 88 | +### saveDirectory(name: string, directoryPath: string): Promise<void>; |
| 89 | + |
| 90 | +Save a directory (set of files) placed in `directoryPath` for \*current\*\* commit. All files will |
| 91 | +be saved under the common `name`. Nested files will be saved as well. `destinationPath` needs to be |
| 92 | +absolute path (for now). |
| 93 | + |
| 94 | +### getFile(name: string, destinationPath: string): Promise<void>; |
| 95 | + |
| 96 | +Get a single file with a given name for **base** branch and save it locally. |
| 97 | + |
| 98 | +### saveFile(name: string, filePath: string): Promise<void> { |
83 | 99 |
|
84 |
| -Saves collection (directory of files) with a given name places in `directoryPath` for \*current\*\* |
85 |
| -commit. `destinationPath` needs to be absolute path (for now). |
| 100 | +Save a single file placed in `directoryPath` for \*current\*\* commit and use `name` as a name. |
| 101 | +`filePath` needs to be absolute path. |
86 | 102 |
|
87 | 103 | ### report(report: CodeChecksReport): Promise<void>;
|
88 | 104 |
|
@@ -131,4 +147,4 @@ Get link to the page artifact for **current commit**. Difference between `getArt
|
131 | 147 | this link will be pointing to a URL without path component for example:
|
132 | 148 | `https://commitsha--path/artifacts.codechecks.io/filenamePath` This works because `dirPath` and
|
133 | 149 | commit sha is encoded into subdomain part. It's very useful when hosting SPA with custom routing. In
|
134 |
| -future we might support here custom redirects to improve it even more. |
| 150 | +the future we might support here custom redirects to improve it even more. |
0 commit comments