Skip to content

Commit 8bc31d3

Browse files
Marcus JohnsonMarcus Johnson
authored andcommitted
Move TypeScript client over to GitHub
1 parent 30b7c88 commit 8bc31d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+13716
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/workspace.xml
2+
node_modules

.idea/.name

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

.idea/encodings.xml

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

.idea/inspectionProfiles/Project_Default.xml

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

.idea/inspectionProfiles/profiles_settings.xml

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

.idea/misc.xml

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

.idea/modules.xml

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

.idea/restfulclient-typescript.iml

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

.idea/typescript-settings.xml

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

.idea/vcs.xml

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

dist/DataSet.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export interface DataSetJson {
2+
Data?: string;
3+
Uri?: string;
4+
}
5+
/**
6+
* DataSets to be used by templates; for more information, see
7+
* https://wiki.windward.net/Wiki/03.AutoTag/05.AutoTag_User_Guide/02.Data_Sources/Datasets
8+
* DataSets must be instantiated with either XML data or a URI
9+
* from which to retrieve XML data. If both are specified, the data
10+
* will be used. The XML data can be found in *.rdlx files
11+
*/
12+
export declare class DataSet {
13+
data: Buffer | string;
14+
/**
15+
* @param data Buffer encapsulating a DataSet file (*.rdlx) or a string
16+
* representation of a URI pointing to a DataSet file
17+
*/
18+
constructor(data: Buffer | string);
19+
toJSON(): DataSetJson;
20+
}
21+
export default DataSet;

dist/DataSet.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"use strict";
2+
/**
3+
* DataSets to be used by templates; for more information, see
4+
* https://wiki.windward.net/Wiki/03.AutoTag/05.AutoTag_User_Guide/02.Data_Sources/Datasets
5+
* DataSets must be instantiated with either XML data or a URI
6+
* from which to retrieve XML data. If both are specified, the data
7+
* will be used. The XML data can be found in *.rdlx files
8+
*/
9+
var DataSet = (function () {
10+
/**
11+
* @param data Buffer encapsulating a DataSet file (*.rdlx) or a string
12+
* representation of a URI pointing to a DataSet file
13+
*/
14+
function DataSet(data) {
15+
this.data = data;
16+
}
17+
DataSet.prototype.toJSON = function () {
18+
if (this.data instanceof Buffer) {
19+
return { Data: this.data.toString("base64") };
20+
}
21+
else {
22+
return { Uri: this.data };
23+
}
24+
};
25+
return DataSet;
26+
}());
27+
exports.DataSet = DataSet;
28+
Object.defineProperty(exports, "__esModule", { value: true });
29+
exports.default = DataSet;

dist/Report.d.ts

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import { DataSource } from "./datasource/DataSource";
2+
import { DataSet } from "./DataSet";
3+
/**
4+
* This class contains several methods and parameters used to create
5+
* and send a request to a Windward RESTful engine service, and
6+
* receive and process the response. The RESTful engine service
7+
* supports asynchronous requests. This will be initiated
8+
* automatically if a report output file is not specified upon
9+
* instantiation of a `Report`.
10+
*
11+
* There are several options such as `description`,
12+
* `title`, `timeout`, and `hyphenate`.
13+
* When set, these options will be sent to the RESTful engine service
14+
* with the template. Each of these options is stored as an instance
15+
* variable.
16+
*
17+
* After instantiation a `Report` either through the
18+
* constructor, or through the modules `createReport()`
19+
* method, `process()` must be called in order to begin the
20+
* processing. This is where you would also pass in a list of
21+
* `DataSource` and `DataSet` objects. Alternatively, data sources
22+
* and data sets could be specified by setting the `dataSources` and
23+
* `dataSets` properties on `Report` appropriately.
24+
*
25+
* For asynchronous requests, the output can be retrieved by using
26+
* the `getReport()` method, or discarded using the
27+
* `deleteFromServer()` method. While waiting for the service to
28+
* finish processing the report, the status can be queried with the
29+
* `getStatus()` method.
30+
*/
31+
export declare class Report {
32+
baseUri: string;
33+
template: Buffer | string;
34+
asyncGuid: string;
35+
outputFormat: OutputFormat;
36+
dataSources: DataSource[];
37+
dataSets: DataSet[];
38+
description: string;
39+
title: string;
40+
subject: string;
41+
keywords: string;
42+
locale: string;
43+
timeout: number;
44+
hyphenate: Hyphenation;
45+
trackImports: boolean;
46+
removeUnusedFormats: boolean;
47+
copyMetaData: CopyMetadataOption;
48+
/**
49+
* TODO
50+
* @param baseUri The base URI of your RESTful Engine server
51+
* @param outputFormat Your desired OutputFormat
52+
* @param template TODO
53+
*/
54+
constructor(baseUri: string, outputFormat: OutputFormat, template: Buffer | string);
55+
/**
56+
* Puts together and sends the report request to the server.
57+
* The output is returned as a Node.js Buffer.
58+
*
59+
* Takes arrays of `DataSource` and `DataSet` objects.
60+
* Alternatively, datasources and datasets may be set up by
61+
* adding them to the respectively named properties. If DataSources
62+
* and DataSets are already set on the `Report` object and are also
63+
* passed in to process, the ones passed in to process will be
64+
* appended to the existing list.
65+
*
66+
* @param dataSources An array of `DataSource` objects for this report.
67+
* @param dataSets An array of `DataSet` objects for this report.
68+
*
69+
*/
70+
process(dataSources?: DataSource[], dataSets?: DataSet[]): Promise<Buffer>;
71+
/**
72+
* Asynchronously sends a report request to the server. The output
73+
* can be checked on with `getStatus()` and later retrieved with
74+
* `getReport()`.
75+
*
76+
* Takes arrays of `DataSource` and `DataSet` objects.
77+
* Alternatively, datasources and datasets may be set up by
78+
* adding them to the respectively named properties. If DataSources
79+
* and DataSets are already set on the `Report` object and are also
80+
* passed in to process, the ones passed in to process will be
81+
* appended to the existing list.
82+
*
83+
* @param dataSources An array of `DataSource` objects for this report.
84+
* @param dataSets An array of `DataSet` objects for this report.
85+
*/
86+
processAsync(dataSources?: DataSource[], dataSets?: DataSet[]): void;
87+
private fetchForProcess(async, dataSources?, dataSets?);
88+
/**
89+
* For asynchronous reports, this method queries the service for a
90+
* status on this report. For possible return values, see
91+
* `Status`. This assumes you have already called processAsync().
92+
*/
93+
getStatus(): Promise<Status>;
94+
/**
95+
* For asynchronous reports, retrieves the finished report
96+
* from the server. If the report is not ready, this resolves
97+
* to a `Status` instead.
98+
*/
99+
getReport(): Promise<Buffer | Status>;
100+
/**
101+
* For asynchronous reports, this method sends a DELETE message to
102+
* the service, which will subsequently delete this report from
103+
* the server.
104+
*/
105+
deleteFromServer(): void;
106+
/**
107+
* For asynchronous reports, this method will continually poll the
108+
* server to retrieve the status of this report until it is ready.
109+
* Returns a Promise which will resolve to the Buffer of this
110+
* report's output.
111+
*
112+
* @param numTries Number of times to poll the server before giving
113+
* up. Defaults to 100
114+
* @param poll Number of milliseconds to insert between server hits.
115+
* Defaults to 300
116+
*/
117+
getReportWhenReady(numTries?: number, poll?: number): Promise<Buffer>;
118+
private tryGetReport(numTries, poll, resolve, reject);
119+
/** Returns JSON for this report request */
120+
private getJson(async);
121+
}
122+
/**
123+
* Enum of the different possible output formats
124+
*/
125+
export declare enum OutputFormat {
126+
CSV = 0,
127+
DOCX = 1,
128+
HTML = 2,
129+
PDF = 3,
130+
PPTX = 4,
131+
RTF = 5,
132+
XLSX = 6,
133+
}
134+
/**
135+
* Enum indicating status of a report
136+
*/
137+
export declare enum Status {
138+
Ready = 0,
139+
Working = 1,
140+
Error = 2,
141+
NotFound = 3,
142+
NotSent = 4,
143+
}
144+
/**
145+
* Enum indicating whether to turn hyphenation on or off
146+
*/
147+
export declare enum Hyphenation {
148+
On = 0,
149+
Off = 1,
150+
Template = 2,
151+
}
152+
/**
153+
* Enum indicating whether to copy the document metadata to the report
154+
*/
155+
export declare enum CopyMetadataOption {
156+
IfNoDataSource = 0,
157+
Never = 1,
158+
Always = 2,
159+
}

0 commit comments

Comments
 (0)