/**
 * KoBoToolbox Node - Version 1
 * Discriminator: resource=submission, operation=getAll
 */


interface Credentials {
  koBoToolboxApi: CredentialReference;
}

/** Get many forms */
export type KoBoToolboxV1SubmissionGetAllParams = {
  resource: 'submission';
  operation: 'getAll';
/**
 * Form ID (e.g. aSAvYreNzVEkrWg5Gdcvg). Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
 */
    formId?: string | Expression<string>;
/**
 * Whether to return all results or only up to a given limit
 * @default false
 */
    returnAll?: boolean | Expression<boolean>;
/**
 * Max number of results to return
 * @displayOptions.show { returnAll: [false] }
 * @default 100
 */
    limit?: number | Expression<number>;
/**
 * Filter
 * @default none
 */
    filterType?: 'none' | 'json' | Expression<string>;
/**
 * Filters (JSON)
 * @displayOptions.show { filterType: ["json"] }
 */
    filterJson?: string | Expression<string> | PlaceholderValue;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Whether to download submitted attachments
     * @default false
     */
    download?: boolean | Expression<boolean>;
    /** Attachments Naming Scheme
     * @displayOptions.show { download: [true] }
     * @default sequence
     */
    binaryNamingScheme?: 'sequence' | 'question' | Expression<string>;
    /** Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0"
     * @displayOptions.show { download: [true], binaryNamingScheme: ["sequence"] }
     * @default attachment_
     */
    dataPropertyAttachmentsPrefixName?: string | Expression<string> | PlaceholderValue;
    /** Comma-separated list of fields to retrieve (e.g. _submission_time,_submitted_by). If left blank, all fields are retrieved.
     */
    fields?: string | Expression<string> | PlaceholderValue;
    /** Attachment size to retrieve, if multiple versions are available
     * @displayOptions.show { download: [true] }
     * @default download_url
     */
    version?: 'download_url' | 'download_small_url' | 'download_medium_url' | 'download_large_url' | Expression<string>;
    /** Comma-separated list of wildcard-style selectors for fields that should be treated as multiselect fields, i.e. parsed as arrays.
     * @default select_*
     */
    selectMask?: string | Expression<string> | PlaceholderValue;
    /** Comma-separated list of wildcard-style selectors for fields that should be treated as numbers
     * @default n_*, f_*
     */
    numberMask?: string | Expression<string> | PlaceholderValue;
    /** Whether to apply some reformatting to the submission data, such as parsing GeoJSON coordinates
     * @default false
     */
    reformat?: boolean | Expression<boolean>;
    /** Sort predicates, in MongoDB JSON format (e.g. {"_submission_time":1})
     */
    sort?: IDataObject | string | Expression<string>;
  };
};

export type KoBoToolboxV1SubmissionGetAllOutput = {
  __version__?: string;
  _attachments?: Array<{
    download_large_url?: string;
    download_medium_url?: string;
    download_small_url?: string;
    download_url?: string;
    filename?: string;
    id?: number;
    instance?: number;
    mimetype?: string;
    question_xpath?: string;
    xform?: number;
  }>;
  _id?: number;
  _status?: string;
  _submission_time?: string;
  _uuid?: string;
  _validation_status?: {
    by_whom?: string;
    color?: string;
    label?: string;
    timestamp?: number;
    uid?: string;
  };
  _xform_id_string?: string;
  description?: string;
  deviceid?: string;
  end?: string;
  'formhub/uuid'?: string;
  gps_note?: string;
  infra_categ?: string;
  infra_subtype?: string;
  location?: string;
  'meta/instanceID'?: string;
  personal_QR_code?: string;
  pic1?: string;
  pic2?: string;
  q2nd_pic?: string;
  start?: string;
  today?: string;
  username?: string;
};

export type KoBoToolboxV1SubmissionGetAllNode = {
  type: 'n8n-nodes-base.koBoToolbox';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<KoBoToolboxV1SubmissionGetAllParams>;
  output?: Items<KoBoToolboxV1SubmissionGetAllOutput>;
};