Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KoBoToolbox node & trigger - N8N-2838 #2765

Merged
merged 32 commits into from
Mar 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a4db868
First version
Yann-J Dec 1, 2021
c91be30
Added hooks
Yann-J Dec 1, 2021
63c805d
Added Credentials test
Yann-J Dec 1, 2021
46823c6
Add support for downloading attachments
Yann-J Dec 2, 2021
05ba5b6
Slight restructure of downloaded binaries
Yann-J Dec 2, 2021
57ec535
Added Trigger node
Yann-J Dec 3, 2021
6053291
Some linting
Yann-J Dec 3, 2021
9ef4f2b
Reverting package-lock changes
Yann-J Dec 3, 2021
f658941
Minor GeoJSON parsing fixes
Yann-J Dec 3, 2021
f55fb62
KoboToolbox: improve GeoJSON format
Yann-J Dec 5, 2021
6ebc527
Kobo: Support for get/set validation status
Yann-J Dec 5, 2021
146fee8
Remove some logs
Yann-J Dec 5, 2021
b32153d
Merge branch 'master' into kobotoolbox
Yann-J Dec 7, 2021
a87c9d2
[kobo] Fix default attachment options
Yann-J Dec 9, 2021
be9dbc6
Proper debug logging
Yann-J Dec 13, 2021
2469c9c
Support for hook log status filter
Yann-J Dec 14, 2021
a623e90
Kobo: Review fixes
Yann-J Jan 18, 2022
f5f265f
[kobo]: Add Get All Forms + lookup Form ID
Yann-J Jan 21, 2022
7917f7e
[kobo] Lookup Form ID in Trigger node
Yann-J Jan 21, 2022
17a8e12
[kobo] Update branded spelling
Yann-J Jan 25, 2022
575f733
[kobo] Support pagination
Yann-J Feb 3, 2022
06bfac6
:zap: fix linting issue
RicardoE105 Feb 6, 2022
48f8f6e
🔀 Merge branch 'master' into "feature/kobotoolbox"
RicardoE105 Feb 6, 2022
e17b82f
:zap: Improvements to #2510
RicardoE105 Feb 7, 2022
5300601
🔀 Merge branch 'master' into 'feature/kobotoolbox'
RicardoE105 Mar 9, 2022
4943698
:zap: Download files using n8n helper
RicardoE105 Mar 9, 2022
142916b
:zap: Improvements
RicardoE105 Mar 18, 2022
809a575
🔀 Merge 'master' into 'feature/kobotoolbox'
RicardoE105 Mar 18, 2022
da77417
:zap: Improvements
RicardoE105 Mar 18, 2022
58833bd
:twisted_rightwards_arrows: Merge branch 'master' into feature/koboto…
janober Mar 19, 2022
201bdb7
:bug: Fix filenames
janober Mar 19, 2022
d3c756f
:zap: Fix some issues
janober Mar 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
416 changes: 204 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
ICredentialType,
NodePropertyTypes,
} from 'n8n-workflow';

export class KoBoToolboxApi implements ICredentialType {
name = 'koBoToolboxApi';
displayName = 'KoBoToolbox API Token';
// See https://support.kobotoolbox.org/api.html
documentationUrl = 'koBoToolbox';
properties = [
{
displayName: 'API root URL',
name: 'URL',
type: 'string' as NodePropertyTypes,
default: 'https://kf.kobotoolbox.org/',
},
{
displayName: 'API Token',
name: 'token',
type: 'string' as NodePropertyTypes,
default: '',
hint: 'You can get your API token at https://[api-root]/token/?format=json (for a logged in user)',
},
];
}
202 changes: 202 additions & 0 deletions packages/nodes-base/nodes/KoBoToolbox/FormDescription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
import {
INodeProperties,
} from 'n8n-workflow';

export const formOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'form',
],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get a form',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all forms',
},
],
default: 'get',
},
];

export const formFields: INodeProperties[] = [

/* -------------------------------------------------------------------------- */
/* form:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Form ID',
name: 'formId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'get',
],
},
},
description: 'Form ID (e.g. aSAvYreNzVEkrWg5Gdcvg)',
},
/* -------------------------------------------------------------------------- */
/* form:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
required: true,
default: false,
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'getAll',
],
},
},
description: 'Whether to return all results',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
required: false,
typeOptions: {
maxValue: 3000,
},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
default: 1000,
description: 'The number of results to return',
},
{
displayName: 'Options',
name: 'options',
placeholder: 'Add Option',
type: 'collection',
default: {},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Sort',
name: 'sort',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: '',
placeholder: 'Add Sort',
options: [
{
displayName: 'Sort',
name: 'value',
values: [
{
displayName: 'Descending',
name: 'descending',
type: 'boolean',
default: true,
description: 'Sort by descending order',
},
{
displayName: 'Order By',
name: 'ordering',
type: 'options',
required: false,
default: 'date_modified',
options: [
{
name: 'Asset Type',
value: 'asset_type',
},
{
name: 'Date Modified',
value: 'date_modified',
},
{
name: 'Name',
value: 'name',
},
{
name: 'Owner Username',
value: 'owner__username',
},
{
name: 'Subscribers Count',
value: 'subscribers_count',
},
],
description: 'Field to order by',
},
],
},
],
},
],
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Filter',
name: 'filter',
type: 'string',
default: 'asset_type:survey',
required: false,
description: 'A text search query based on form data - e.g. "owner__username:meg AND name__icontains:quixotic" - see <a href="https://github.com/kobotoolbox/kpi#searching" target="_blank">docs</a> for more details',
},
],
},
];
Loading