Skip to content

Commit

Permalink
?details=true always when fetching forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Pollock committed Aug 18, 2018
1 parent 3c7058c commit 4a11c6f
Show file tree
Hide file tree
Showing 9 changed files with 2,766 additions and 1,117 deletions.
320 changes: 184 additions & 136 deletions .idea/workspace.xml

Large diffs are not rendered by default.

1,189 changes: 1,006 additions & 183 deletions docs/ast/source/index.js.json

Large diffs are not rendered by default.

2,333 changes: 1,549 additions & 784 deletions docs/ast/source/wpClientFactory.js.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion docs/file/src/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,22 @@
import {WpClient} from "./WpClient";
import {FormsClient} from "./FormsClient";
import {EntriesClient} from "./EntriesClient";
import {ProClient} from "./ProClient";
import {GeneralSettingClient} from "./GeneralSettingClient";

/**
* Export factory and all clients
* @type {{wpClientFactory: wpClientFactory, PrivacySettingsClient: PrivacySettingsClient, ProLocalSettingClient: ProLocalSettingClient, WpClient: WpClient, FormsClient: FormsClient, EntriesClient: EntriesClient, ProClient: ProClient, GeneralSettingClient: GeneralSettingClient}}
*/
module.exports = {
wpClientFactory,
PrivacySettingsClient,
ProLocalSettingClient,
WpClient,
FormsClient,
EntriesClient
EntriesClient,
ProClient,
GeneralSettingClient
};</code></pre>

</div>
Expand Down
4 changes: 4 additions & 0 deletions docs/file/src/wpClientFactory.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import {PrivacySettingsClient} from &apos;./PrivacySettingsClient&apos;;
import {EntriesClient} from &quot;./EntriesClient&quot;;
import {GeneralSettingClient} from &quot;./GeneralSettingClient&quot;;
import {ProLocalSettingClient} from &quot;./ProLocalSettingClient&quot;;

/**
* Create a WordPress API client
Expand All @@ -72,6 +73,9 @@
case &apos;settings&apos; :
client = new GeneralSettingClient(wpApiUrl);
break;
case &apos;proLocal&apos; :
client = new ProLocalSettingClient(wpApiUrl);
break;
default:
client = new WpClient(wpApiUrl);
break;
Expand Down
4 changes: 2 additions & 2 deletions docs/function/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ <h3 data-ice="anchor" id="static-function-wpClientFactory">
<span class="right-info">


<span data-ice="source"><span><a href="file/src/wpClientFactory.js.html#lineNumber14">source</a></span></span>
<span data-ice="source"><span><a href="file/src/wpClientFactory.js.html#lineNumber15">source</a></span></span>
</span>
</h3>

<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import {wpClientFactory} from &apos;<span><a href="file/src/wpClientFactory.js.html#lineNumber14">@caldera-labs/api-client/src/wpClientFactory.js</a></span>&apos;</code></pre></div>
<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import {wpClientFactory} from &apos;<span><a href="file/src/wpClientFactory.js.html#lineNumber15">@caldera-labs/api-client/src/wpClientFactory.js</a></span>&apos;</code></pre></div>


<div data-ice="description"><p>Create a WordPress API client</p>
Expand Down
8 changes: 4 additions & 4 deletions docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@
"__docId__": 89,
"kind": "file",
"name": "src/index.js",
"content": "/*eslint no-undef: \"error\"*/\n/*eslint-env node*/\nimport {wpClientFactory} from \"./wpClientFactory\";\nimport {ProLocalSettingClient} from \"./ProLocalSettingClient\";\nimport {PrivacySettingsClient} from \"./PrivacySettingsClient\";\nimport {WpClient} from \"./WpClient\";\nimport {FormsClient} from \"./FormsClient\";\nimport {EntriesClient} from \"./EntriesClient\";\n\nmodule.exports = {\n\twpClientFactory,\n\tPrivacySettingsClient,\n\tProLocalSettingClient,\n\tWpClient,\n\tFormsClient,\n\tEntriesClient\n};",
"content": "/*eslint no-undef: \"error\"*/\n/*eslint-env node*/\nimport {wpClientFactory} from \"./wpClientFactory\";\nimport {ProLocalSettingClient} from \"./ProLocalSettingClient\";\nimport {PrivacySettingsClient} from \"./PrivacySettingsClient\";\nimport {WpClient} from \"./WpClient\";\nimport {FormsClient} from \"./FormsClient\";\nimport {EntriesClient} from \"./EntriesClient\";\nimport {ProClient} from \"./ProClient\";\nimport {GeneralSettingClient} from \"./GeneralSettingClient\";\n\n/**\n * Export factory and all clients\n * @type {{wpClientFactory: wpClientFactory, PrivacySettingsClient: PrivacySettingsClient, ProLocalSettingClient: ProLocalSettingClient, WpClient: WpClient, FormsClient: FormsClient, EntriesClient: EntriesClient, ProClient: ProClient, GeneralSettingClient: GeneralSettingClient}}\n */\nmodule.exports = {\n\twpClientFactory,\n\tPrivacySettingsClient,\n\tProLocalSettingClient,\n\tWpClient,\n\tFormsClient,\n\tEntriesClient,\n\tProClient,\n\tGeneralSettingClient\n};",
"static": true,
"longname": "/Users/josh/caldera-js/api-client/src/index.js",
"access": "public",
Expand All @@ -1854,7 +1854,7 @@
"__docId__": 90,
"kind": "file",
"name": "src/wpClientFactory.js",
"content": "//@flow\nimport {WpClient} from './WpClient';\nimport {FormsClient} from './FormsClient';\nimport {PrivacySettingsClient} from './PrivacySettingsClient';\nimport {EntriesClient} from \"./EntriesClient\";\nimport {GeneralSettingClient} from \"./GeneralSettingClient\";\n\n/**\n * Create a WordPress API client\n * @param {String} wpApiUrl Root URL for the WordPress REST API of site\n * @param {String} wpApiNonce The REST API nonce\n * @param {String} type Optional. Type of client forms|privacy|generic Default is generic\n * @returns {FormsClient|PrivacySettingsClient|WpClient|EntriesClient|GeneralSettingClient}\n */\nexport function wpClientFactory(wpApiUrl: string, wpApiNonce: string, type: string = 'generic' ): WpClient {\n\tlet client = new WpClient(wpApiUrl);\n\tswitch (type) {\n\t\tcase 'forms':\n\t\t\tclient = new FormsClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'privacy' :\n\t\t\tclient = new PrivacySettingsClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'entries':\n\t\tcase 'entry':\n\t\t\tclient = new EntriesClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'settings' :\n\t\t\tclient = new GeneralSettingClient(wpApiUrl);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tclient = new WpClient(wpApiUrl);\n\t\t\tbreak;\n\n\t}\n\tclient.setNonce(wpApiNonce);\n\treturn client;\n}",
"content": "//@flow\nimport {WpClient} from './WpClient';\nimport {FormsClient} from './FormsClient';\nimport {PrivacySettingsClient} from './PrivacySettingsClient';\nimport {EntriesClient} from \"./EntriesClient\";\nimport {GeneralSettingClient} from \"./GeneralSettingClient\";\nimport {ProLocalSettingClient} from \"./ProLocalSettingClient\";\n\n/**\n * Create a WordPress API client\n * @param {String} wpApiUrl Root URL for the WordPress REST API of site\n * @param {String} wpApiNonce The REST API nonce\n * @param {String} type Optional. Type of client forms|privacy|generic Default is generic\n * @returns {FormsClient|PrivacySettingsClient|WpClient|EntriesClient|GeneralSettingClient}\n */\nexport function wpClientFactory(wpApiUrl: string, wpApiNonce: string, type: string = 'generic' ): WpClient {\n\tlet client = new WpClient(wpApiUrl);\n\tswitch (type) {\n\t\tcase 'forms':\n\t\t\tclient = new FormsClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'privacy' :\n\t\t\tclient = new PrivacySettingsClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'entries':\n\t\tcase 'entry':\n\t\t\tclient = new EntriesClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'settings' :\n\t\t\tclient = new GeneralSettingClient(wpApiUrl);\n\t\t\tbreak;\n\t\tcase 'proLocal' :\n\t\t\tclient = new ProLocalSettingClient(wpApiUrl);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tclient = new WpClient(wpApiUrl);\n\t\t\tbreak;\n\n\t}\n\tclient.setNonce(wpApiNonce);\n\treturn client;\n}",
"static": true,
"longname": "/Users/josh/caldera-js/api-client/src/wpClientFactory.js",
"access": "public",
Expand All @@ -1875,7 +1875,7 @@
"importPath": "@caldera-labs/api-client/src/wpClientFactory.js",
"importStyle": "{wpClientFactory}",
"description": "Create a WordPress API client",
"lineNumber": 14,
"lineNumber": 15,
"unknown": [
{
"tagName": "@returns",
Expand Down Expand Up @@ -1937,7 +1937,7 @@
},
{
"kind": "packageJSON",
"content": "{\n \"name\": \"@caldera-labs/api-client\",\n \"version\": \"0.4.0\",\n \"description\": \"API client for Caldera Forms and Caldera Forms Pro\",\n \"main\": \"./dist/index.js\",\n \"scripts\": {\n \"build\": \"npm run build:pre && npm run build:compile && npm run build:post\",\n \"build:pre\": \"npm run test:once\",\n \"build:compile\": \"./node_modules/.bin/babel -d dist src/\",\n \"build:post\": \"npm run compress && npm run document\",\n \"compress\": \" uglifyjs-folder dist -c -m --source-map -o dist/index.min.js\",\n \"test\": \"jest --watch\",\n \"test:once\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"coveralls\": \"cat ./coverage/lcov.info | node node_modules/.bin/coveralls\",\n \"prepublish\": \"npm run build\",\n \"document\": \"./node_modules/.bin/esdoc\",\n \"lint\": \"eslint src/**, __tests__/**\",\n \"lint:watch\": \"esw src/**, __tests__/** --fix --watch\",\n \"lint:fix\": \"eslint src/**, __tests__/** --fix \",\n \"flow:watch\": \"flow-watch\",\n \"flow\": \"flow \",\n \"release\": \"npm run release:patch\",\n \"release:minor\": \"npm version minor -m \\\"version %s\\\" && npm publish\",\n \"release:patch\": \"npm version patch -m \\\"version %s\\\" && npm publish\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/calderawp/caldera-api-client.git\"\n },\n \"keywords\": [\n \"es6\",\n \"boilerplate\",\n \"npm\",\n \"module\",\n \"npm-module\"\n ],\n \"author\": \"Josh Pollock <Josh@calderawp.com>\",\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",
"content": "{\n \"name\": \"@caldera-labs/api-client\",\n \"version\": \"0.4.1\",\n \"description\": \"API client for Caldera Forms and Caldera Forms Pro\",\n \"main\": \"./dist/index.js\",\n \"scripts\": {\n \"build\": \"npm run build:pre && npm run build:compile && npm run build:post\",\n \"build:pre\": \"npm run test:once\",\n \"build:compile\": \"./node_modules/.bin/babel -d dist src/\",\n \"build:post\": \"npm run compress && npm run document\",\n \"compress\": \" uglifyjs-folder dist -c -m --source-map -o dist/index.min.js\",\n \"test\": \"jest --watch\",\n \"test:once\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"coveralls\": \"cat ./coverage/lcov.info | node node_modules/.bin/coveralls\",\n \"prepublish\": \"npm run build\",\n \"document\": \"./node_modules/.bin/esdoc\",\n \"lint\": \"eslint src/**, __tests__/**\",\n \"lint:watch\": \"esw src/**, __tests__/** --fix --watch\",\n \"lint:fix\": \"eslint src/**, __tests__/** --fix \",\n \"flow:watch\": \"flow-watch\",\n \"flow\": \"flow \",\n \"release\": \"npm run release:patch\",\n \"release:minor\": \"npm version minor -m \\\"version %s\\\" && npm publish\",\n \"release:patch\": \"npm version patch -m \\\"version %s\\\" && npm publish\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/calderawp/caldera-api-client.git\"\n },\n \"keywords\": [\n \"es6\",\n \"boilerplate\",\n \"npm\",\n \"module\",\n \"npm-module\"\n ],\n \"author\": \"Josh Pollock <Josh@calderawp.com>\",\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,
Expand Down
12 changes: 6 additions & 6 deletions docs/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@
<td data-ice="filePath"><span><a href="file/src/index.js.html">src/index.js</a></span></td>
<td data-ice="identifier" class="identifiers">-</td>
<td class="coverage"><span data-ice="coverage">-</span></td>
<td style="display: none;" data-ice="size">481 byte</td>
<td style="display: none;" data-ice="lines">16</td>
<td style="display: none;" data-ice="updated">2018-07-02 12:51:36 (UTC)</td>
<td style="display: none;" data-ice="size">938 byte</td>
<td style="display: none;" data-ice="lines">24</td>
<td style="display: none;" data-ice="updated">2018-08-04 18:30:01 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/wpClientFactory.js.html">src/wpClientFactory.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="function/index.html#static-function-wpClientFactory">wpClientFactory</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">1/1</span></td>
<td style="display: none;" data-ice="size">1182 byte</td>
<td style="display: none;" data-ice="lines">37</td>
<td style="display: none;" data-ice="updated">2018-08-04 18:03:59 (UTC)</td>
<td style="display: none;" data-ice="size">1324 byte</td>
<td style="display: none;" data-ice="lines">41</td>
<td style="display: none;" data-ice="updated">2018-08-04 18:28:12 (UTC)</td>
</tr>
</tbody>
</table>
Expand Down
3 changes: 2 additions & 1 deletion src/FormsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class FormsClient extends WpClient {
getForms(page: number = 1): Promise<any> {
return this.reqGet({
page:page,
_wpnonce:this.nonce
_wpnonce:this.nonce,
details:true,
},this.getFormsEndpoint());
}

Expand Down

0 comments on commit 4a11c6f

Please sign in to comment.