@wokuapp/sdk 0.7.0 → 0.8.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.
- package/README.md +89 -1
- package/dist/index.cjs +114 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +647 -6
- package/dist/index.d.ts +647 -6
- package/dist/index.js +113 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var FollowUps = class {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
// package.json
|
|
39
|
-
var version = "0.
|
|
39
|
+
var version = "0.8.0";
|
|
40
40
|
|
|
41
41
|
// src/core/errors.ts
|
|
42
42
|
var WokuError = class extends Error {
|
|
@@ -1661,12 +1661,15 @@ var Folders = class {
|
|
|
1661
1661
|
{ ...opts, query: { ...params, ...opts?.query } }
|
|
1662
1662
|
);
|
|
1663
1663
|
}
|
|
1664
|
-
/**
|
|
1665
|
-
|
|
1664
|
+
/**
|
|
1665
|
+
* CSV text with one row per response of every tool of the folder subtree,
|
|
1666
|
+
* or only those of a period (`from` inclusive, `to` exclusive, ISO 8601).
|
|
1667
|
+
*/
|
|
1668
|
+
csv(id, params, opts) {
|
|
1666
1669
|
return this.client.request(
|
|
1667
1670
|
"get",
|
|
1668
1671
|
`/v1/folders/${encodeURIComponent(id)}/csv`,
|
|
1669
|
-
opts
|
|
1672
|
+
{ ...opts, query: { ...params, ...opts?.query } }
|
|
1670
1673
|
);
|
|
1671
1674
|
}
|
|
1672
1675
|
/**
|
|
@@ -1810,6 +1813,109 @@ var JourneyFolders = class {
|
|
|
1810
1813
|
}
|
|
1811
1814
|
};
|
|
1812
1815
|
|
|
1816
|
+
// src/resources/report-subscriptions.ts
|
|
1817
|
+
var ReportSubscriptions = class {
|
|
1818
|
+
constructor(client) {
|
|
1819
|
+
this.client = client;
|
|
1820
|
+
}
|
|
1821
|
+
/** Every scheduled report, or those of one folder or tool. */
|
|
1822
|
+
list(params, opts) {
|
|
1823
|
+
return this.client.request(
|
|
1824
|
+
"get",
|
|
1825
|
+
"/v1/report-subscriptions",
|
|
1826
|
+
{ ...opts, query: { ...params, ...opts?.query } }
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1829
|
+
create(body, opts) {
|
|
1830
|
+
return this.client.request(
|
|
1831
|
+
"post",
|
|
1832
|
+
"/v1/report-subscriptions",
|
|
1833
|
+
{ ...opts, body }
|
|
1834
|
+
);
|
|
1835
|
+
}
|
|
1836
|
+
/** Edit, pause or resume a recurring scheduled report. */
|
|
1837
|
+
update(id, body, opts) {
|
|
1838
|
+
return this.client.request(
|
|
1839
|
+
"patch",
|
|
1840
|
+
`/v1/report-subscriptions/${encodeURIComponent(id)}`,
|
|
1841
|
+
{ ...opts, body }
|
|
1842
|
+
);
|
|
1843
|
+
}
|
|
1844
|
+
delete(id, opts) {
|
|
1845
|
+
return this.client.request(
|
|
1846
|
+
"delete",
|
|
1847
|
+
`/v1/report-subscriptions/${encodeURIComponent(id)}`,
|
|
1848
|
+
opts
|
|
1849
|
+
);
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Send it now: the last complete period of a recurring report (its
|
|
1853
|
+
* schedule stays) or the period of a one-off (which then closes).
|
|
1854
|
+
*/
|
|
1855
|
+
send(id, opts) {
|
|
1856
|
+
return this.client.request(
|
|
1857
|
+
"post",
|
|
1858
|
+
`/v1/report-subscriptions/${encodeURIComponent(id)}/send`,
|
|
1859
|
+
opts
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1864
|
+
// src/resources/folder-participants.ts
|
|
1865
|
+
var FolderParticipants = class {
|
|
1866
|
+
constructor(client) {
|
|
1867
|
+
this.client = client;
|
|
1868
|
+
}
|
|
1869
|
+
/** The list and, per tool of the folder subtree, who answered. */
|
|
1870
|
+
get(folderId, opts) {
|
|
1871
|
+
return this.client.request(
|
|
1872
|
+
"get",
|
|
1873
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants`,
|
|
1874
|
+
opts
|
|
1875
|
+
);
|
|
1876
|
+
}
|
|
1877
|
+
/** Replace the whole list. */
|
|
1878
|
+
replace(folderId, text, opts) {
|
|
1879
|
+
return this.client.request(
|
|
1880
|
+
"put",
|
|
1881
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants`,
|
|
1882
|
+
{ ...opts, body: { text } }
|
|
1883
|
+
);
|
|
1884
|
+
}
|
|
1885
|
+
/** Add people; the ones already on the list are skipped. */
|
|
1886
|
+
add(folderId, text, opts) {
|
|
1887
|
+
return this.client.request(
|
|
1888
|
+
"post",
|
|
1889
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants`,
|
|
1890
|
+
{ ...opts, body: { text } }
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
/** Remove one person (the `id` from `get`). */
|
|
1894
|
+
remove(folderId, participantId, opts) {
|
|
1895
|
+
return this.client.request(
|
|
1896
|
+
"delete",
|
|
1897
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants/${encodeURIComponent(participantId)}`,
|
|
1898
|
+
opts
|
|
1899
|
+
);
|
|
1900
|
+
}
|
|
1901
|
+
/** Delete the whole list. Responses are never touched. */
|
|
1902
|
+
clear(folderId, opts) {
|
|
1903
|
+
return this.client.request(
|
|
1904
|
+
"delete",
|
|
1905
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants`,
|
|
1906
|
+
opts
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
/** Send a tool again to the people of the list who have not answered it. */
|
|
1910
|
+
resendToMissing(folderId, body, opts) {
|
|
1911
|
+
return this.client.request(
|
|
1912
|
+
"post",
|
|
1913
|
+
`/v1/folders/${encodeURIComponent(folderId)}/participants/resend`,
|
|
1914
|
+
{ ...opts, body }
|
|
1915
|
+
);
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1813
1919
|
// src/woku.ts
|
|
1814
1920
|
var Woku = class {
|
|
1815
1921
|
constructor(options) {
|
|
@@ -1836,11 +1942,13 @@ var Woku = class {
|
|
|
1836
1942
|
this.company = new Company(this.client);
|
|
1837
1943
|
this.journeys = new Journeys(this.client);
|
|
1838
1944
|
this.folders = new Folders(this.client);
|
|
1945
|
+
this.folderParticipants = new FolderParticipants(this.client);
|
|
1946
|
+
this.reportSubscriptions = new ReportSubscriptions(this.client);
|
|
1839
1947
|
this.tools = new Tools(this.client);
|
|
1840
1948
|
this.journeyFolders = new JourneyFolders(this.client);
|
|
1841
1949
|
}
|
|
1842
1950
|
};
|
|
1843
1951
|
|
|
1844
|
-
export { AuthenticationError, BadRequestError, ConflictError, Folders, FollowUps, InternalServerError, JourneyFolders, Journeys, Media, NotFoundError, Page, PayloadTooLargeError, PermissionDeniedError, RateLimitError, Tools, ToolsPage, UnprocessableEntityError, Woku, WokuAPIError, WokuClient, WokuConnectionError, WokuError, WokuTimeoutError };
|
|
1952
|
+
export { AuthenticationError, BadRequestError, ConflictError, FolderParticipants, Folders, FollowUps, InternalServerError, JourneyFolders, Journeys, Media, NotFoundError, Page, PayloadTooLargeError, PermissionDeniedError, RateLimitError, ReportSubscriptions, Tools, ToolsPage, UnprocessableEntityError, Woku, WokuAPIError, WokuClient, WokuConnectionError, WokuError, WokuTimeoutError };
|
|
1845
1953
|
//# sourceMappingURL=index.js.map
|
|
1846
1954
|
//# sourceMappingURL=index.js.map
|