\",\n \"license\": \"GPL-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/calderawp/caldera-api-client/issues\"\n },\n \"homepage\": \"https://calderalabs.org/caldera-api-client/\",\n \"dependencies\": {},\n \"devDependencies\": {\n \"babel-eslint\": \"^8.2.3\",\n \"babel-preset-flow\": \"^6.23.0\",\n \"eslint\": \"^4.19.1\",\n \"eslint-config-airbnb\": \"^16.1.0\",\n \"eslint-plugin-flowtype\": \"^2.49.3\",\n \"eslint-plugin-import\": \"^2.12.0\",\n \"eslint-plugin-jsx-a11y\": \"^6.0.3\",\n \"eslint-plugin-react\": \"^7.9.1\",\n \"eslint-watch\": \"^3.1.5\",\n \"flow-bin\": \"^0.74.0\",\n \"flow-watch\": \"^1.1.3\",\n \"jest-fetch-mock\": \"^1.6.3\",\n \"locutus\": \"^2.0.9\",\n \"uglify-js\": \"^3.4.0\",\n \"uglifyjs-folder\": \"^1.5.1\",\n \"babel-cli\": \"^6.26.0\",\n \"babel-jest\": \"^20.0.3\",\n \"babel-preset-es2015\": \"^6.24.1\",\n \"babel-preset-stage-2\": \"^6.24.1\",\n \"coveralls\": \"^2.13.3\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-flow-plugin\": \"^1.0.0\",\n \"esdoc-jsx-plugin\": \"^1.0.0\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"eslint-plugin-jest\": \"^21.17.0\",\n \"jest-cli\": \"^23.2\",\n \"istanbul\": \"^0.4.5\",\n \"istanbul-api\": \"1.2.2\",\n \"istanbul-reports\": \"1.1.4\"\n },\n \"standard\": {\n \"plugins\": [\n \"flowtype\"\n ],\n \"parser\": \"babel-eslint\"\n },\n \"jest\": {\n \"collectCoverageFrom\": [\n \"src/**/*.js\"\n ],\n \"coverageThreshold\": {\n \"global\": {\n \"statements\": 85,\n \"branches\": 75,\n \"functions\": 85,\n \"lines\": 85\n }\n },\n \"automock\": false,\n \"setupFiles\": [\n \"./setupJest.js\"\n ]\n }\n}\n",
"longname": "/Users/josh/caldera-js/api-client/package.json",
"name": "package.json",
"static": true,
diff --git a/docs/source.html b/docs/source.html
index 628cfb1..1cf16eb 100644
--- a/docs/source.html
+++ b/docs/source.html
@@ -68,9 +68,9 @@
src/EntriesClient.js |
EntriesClient |
100 %5/5 |
- 1432 byte |
- 57 |
- 2018-07-02 12:51:36 (UTC) |
+ 1437 byte |
+ 60 |
+ 2018-08-04 21:31:04 (UTC) |
src/GeneralSettingClient.js |
diff --git a/package.json b/package.json
index c75a7b4..a132f0a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@caldera-labs/api-client",
- "version": "0.4.1",
+ "version": "0.5.0",
"description": "API client for Caldera Forms and Caldera Forms Pro",
"main": "./dist/index.js",
"scripts": {
diff --git a/src/EntriesClient.js b/src/EntriesClient.js
index fac128d..8972e8b 100644
--- a/src/EntriesClient.js
+++ b/src/EntriesClient.js
@@ -33,6 +33,39 @@ export class EntriesClient extends WpClient {
}, this.getEntryEndpoint(formId, entryId));
}
+ /**
+ * Delete a single entry of a form
+ *
+ * @param {String} formId ID of form to get entries for.
+ * @param {String} entryId ID of entry to find.
+ * @return {Promise}
+ */
+ deleteEntry( formId: string, entryId: number ): Promise {
+ return this.reqDelete(this.getEntryEndpoint( formId, entryId ) );
+ }
+
+ /**
+ * Delete all entries of a form
+ *
+ * @param {String} formId ID of form to get entries for.
+ * @return {Promise}
+ */
+ deleteEntries( formId: string ): Promise {
+ return this.reqDelete(this.getEntriesEndpoint( formId ) );
+ }
+
+ /**
+ * Resent a single entry of a form
+ *
+ * @param {String} formId ID of form to get entries for.
+ * @param {String} entryId ID of entry to find.
+ * @return {Promise}
+ */
+ resendEntry( formId: string, entryId: number ): Promise {
+ return this.reqPost(this.getEntryEndpoint( formId, entryId ) );
+ }
+
+
/**
* The endpoint URI for a collection of entries for one form.
@@ -54,5 +87,16 @@ export class EntriesClient extends WpClient {
return `${this.getEntriesEndpoint(formId)}/${entryId}`;
}
+ /**
+ * The resend endpoint URI for single entries
+ *
+ * @param {String} formId ID of form to get entries for.
+ * @param {String} entryId ID of entry to find.
+ * @return {string}
+ */
+ getEntryResendEndpoint(formId: string, entryId: number): string {
+ return `${this.getEntriesEndpoint(formId)}/${entryId}/resend`;
+ }
+
}
\ No newline at end of file