{
  "operations": [
    {
      "name": "getTask",
      "params": [
        "taskGid",
        "params",
        "callback"
      ],
      "docs": {
        "description": "Get a single task of a given project.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "getTask(\"1206933955023739\", {\n  opt_fields: \"name,notes,assignee\",\n});",
            "caption": "Get a task"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Globally unique identifier for the task",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "taskGid"
          },
          {
            "title": "param",
            "description": "Query params to include.",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "The fields to return.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "params.opt_fields"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "name": "getTasks",
      "params": [
        "projectGid",
        "params",
        "callback"
      ],
      "docs": {
        "description": "Get the list of tasks for a given project.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "getTasks(\"1206933955023739\", {\n  opt_fields: \"name,notes,assignee\",\n});",
            "caption": "Get all tasks"
          },
          {
            "title": "example",
            "description": "getTasks(\"1206933955023739\", {\n  opt_fields: \"name,notes,assignee\",\n  limit: 100,\n});",
            "caption": "Limit the number of tasks returned"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Globally unique identifier for the project",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "projectGid"
          },
          {
            "title": "param",
            "description": "Query params to include.",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "The maximum number of tasks to return.",
            "type": {
              "type": "NameExpression",
              "name": "number"
            },
            "name": "params.limit"
          },
          {
            "title": "param",
            "description": "The fields to return.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "params.opt_fields"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "name": "updateTask",
      "params": [
        "taskGid",
        "data",
        "callback"
      ],
      "docs": {
        "description": "Update a specific task.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "updateTask(\"1206933955023739\", {\n  name: \"test\",\n  approval_status: \"pending\",\n  assignee: \"12345\",\n});",
            "caption": "Update a task"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Globally unique identifier for the task",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "taskGid"
          },
          {
            "title": "param",
            "description": "Body data to update the task with",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "data"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "createTask",
      "params": [
        "params",
        "callback"
      ],
      "docs": {
        "description": "Create a task.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "createTask({\n  name: \"test\",\n  approval_status: \"pending\",\n  assignee: \"12345\",\n  projects: [\"1206933955023739\"],\n});"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Body parameters",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "upsertTask",
      "params": [
        "projectGid",
        "params",
        "callback"
      ],
      "docs": {
        "description": "Update or create a task.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "upsertTask(\"1201382240880\", {\n  externalId: \"name\",\n  data: {\n    name: \"test\",\n    approval_status: \"pending\",\n    projects: [\"1201382240880\"],\n    assignee: \"12345\",\n  },\n});",
            "caption": "Upsert a task"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Globally unique identifier for the project",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "projectGid"
          },
          {
            "title": "param",
            "description": "an object with an externalId and some task data.",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "The external id field name",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "params.externalId"
          },
          {
            "title": "param",
            "description": "The data to upsert.",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "params.data"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "name": "searchTask",
      "params": [
        "task",
        "query",
        "options"
      ],
      "docs": {
        "description": "Search for tasks in a workspace by task name.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "searchTask(\"Test Search Task\", {\n  sort_by: \"modified_at\"\n});",
            "caption": "Search for a task by name"
          },
          {
            "title": "example",
            "description": "searchTask(\"\", {\n  \"custom_fields.12345.value\": $.data.custom_field_value,\n});",
            "caption": "Search for a task by custom field only"
          },
          {
            "title": "example",
            "description": "searchTask(\"Test Search Task\", {\n  \"custom_fields.12345.is_set\": true,\n});",
            "caption": "Search for a task by name and custom field"
          },
          {
            "title": "example",
            "description": "searchTask(\"Test Search Task\", {\n  resource_subtype: \"milestone\",\n});",
            "caption": "Search for a milestone by name"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "The text or name of the task to search for.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "task"
          },
          {
            "title": "param",
            "description": "Query params. See {@link https://developers.asana.com/reference/searchtasksforworkspace Docs} for a list of valid parameters.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "object"
              }
            },
            "name": "query"
          },
          {
            "title": "param",
            "description": "The resource subtype to search for. Must be either `\"default_task\"` or `\"milestone\"`. Defaults to `\"default_task\"`.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "string"
              }
            },
            "name": "query.resource_subtype",
            "default": "default_task"
          },
          {
            "title": "param",
            "description": "(Optional) options argument.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "object"
              }
            },
            "name": "options"
          },
          {
            "title": "param",
            "description": "The workspace to search in. Defaults to the workspace specified in the configuration.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "string"
              }
            },
            "name": "options.workspaceGid"
          },
          {
            "title": "returns",
            "description": "An operation that, when executed, returns the search results in state.data.",
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "name": "createTaskStory",
      "params": [
        "taskGid",
        "params",
        "callback"
      ],
      "docs": {
        "description": "Create a story to a specific task.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "createTaskStory(\"1206933955023739\", {\n  text: \"This is a comment\",\n});",
            "caption": "Create a plain text comment"
          },
          {
            "title": "example",
            "description": "createTaskStory(\"1206933955023739\", {\n  html_text: \"<body>This is a comment</body>\",\n});",
            "caption": "Create a HTML formatted text comment"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Globally unique identifier for the task",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "taskGid"
          },
          {
            "title": "param",
            "description": "Story parameters",
            "type": {
              "type": "NameExpression",
              "name": "StoryOptions"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "(Optional) callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "request",
      "params": [
        "path",
        "params",
        "callback"
      ],
      "docs": {
        "description": "Make a HTTP request against the Asana API.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "Get a task by id\nrequest(\"/tasks/1234\");"
          },
          {
            "title": "example",
            "description": "Query for tasks in a given project\nrequest(\"/tasks\", {\n  query: { project: \"abc\" },\n});"
          },
          {
            "title": "example",
            "description": "Create a new task\nrequest(\"/tasks\", {\n  method: \"POST\",\n  body: { data: { name: \"do the thing\", completed: false } },\n});"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Path to resource (excluding api/version)",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "path"
          },
          {
            "title": "param",
            "description": "(Optional) Query, body and method parameters",
            "type": {
              "type": "NameExpression",
              "name": "RequestOptions"
            },
            "name": "params"
          },
          {
            "title": "param",
            "description": "(Optional) Callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    }
  ],
  "exports": [],
  "common": [
    {
      "name": "fn",
      "params": [
        "func"
      ],
      "docs": {
        "description": "Creates a custom step (or operation) for more flexible job writing.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "fn(state => {\n  // do some things to state\n  return state;\n});"
          },
          {
            "title": "param",
            "description": "is the function",
            "type": {
              "type": "NameExpression",
              "name": "Function"
            },
            "name": "func"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "fnIf",
      "params": [
        "condition",
        "operation"
      ],
      "docs": {
        "description": "Execute a function only when the condition returns true",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
          },
          {
            "title": "param",
            "description": "The condition that returns true",
            "type": {
              "type": "NameExpression",
              "name": "Boolean"
            },
            "name": "condition"
          },
          {
            "title": "param",
            "description": "The operation needed to be executed.",
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            },
            "name": "operation"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "sourceValue",
      "params": [
        "path"
      ],
      "docs": {
        "description": "Picks out a single value from source data.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "sourceValue('$.key')"
          },
          {
            "title": "param",
            "description": "JSONPath referencing a point in `state`.",
            "type": {
              "type": "NameExpression",
              "name": "String"
            },
            "name": "path"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "dataPath",
      "params": [
        "path"
      ],
      "docs": {
        "description": "Ensures a path points at the data.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "dataPath('key')"
          },
          {
            "title": "param",
            "description": "JSONPath referencing a point in `data`.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "path"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "string"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "dataValue",
      "params": [
        "path"
      ],
      "docs": {
        "description": "Picks out a single value from the source data object—usually `state.data`.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "dataValue('key')"
          },
          {
            "title": "param",
            "description": "JSONPath referencing a point in `data`.",
            "type": {
              "type": "NameExpression",
              "name": "String"
            },
            "name": "path"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "lastReferenceValue",
      "params": [
        "path"
      ],
      "docs": {
        "description": "Picks out the last reference value from source data.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "lastReferenceValue('key')"
          },
          {
            "title": "param",
            "description": "JSONPath referencing a point in `references`.",
            "type": {
              "type": "NameExpression",
              "name": "String"
            },
            "name": "path"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "each",
      "params": [
        "dataSource",
        "operation"
      ],
      "docs": {
        "description": "Iterates over an array of items and invokes an operation upon each one, where the state\nobject is _scoped_ so that state.data is the item under iteration.\nThe rest of the state object is untouched and can be referenced as usual.\nYou can pass an array directly, or use lazy state or a JSONPath string to\nreference a slice of state.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "each(\n  $.data,\n  // Inside the callback operation, `$.data` is scoped to the item under iteration\n  insert(\"patient\", {\n    patient_name: $.data.properties.case_name,\n    patient_id: $.data.case_id,\n  })\n);",
            "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
          },
          {
            "title": "example",
            "description": "each(\n  $.data,\n  insert(\"patient\", (state) => ({\n    patient_id: state.data.case_id,\n    ...state.data\n  }))\n);",
            "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
          },
          {
            "title": "example",
            "description": "each(\n  \"$.data[*]\",\n  insert(\"patient\", (state) => ({\n    patient_name: state.data.properties.case_name,\n    patient_id: state.data.case_id,\n  }))\n);",
            "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
          },
          {
            "title": "param",
            "description": "JSONPath referencing a point in `state`.",
            "type": {
              "type": "NameExpression",
              "name": "DataSource"
            },
            "name": "dataSource"
          },
          {
            "title": "param",
            "description": "The operation needed to be repeated.",
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            },
            "name": "operation"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "combine",
      "params": [
        "operations"
      ],
      "docs": {
        "description": "Combines two operations into one",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "combine(\n  create('foo'),\n  delete('bar')\n)"
          },
          {
            "title": "param",
            "description": "Operations to be performed.",
            "type": {
              "type": "NameExpression",
              "name": "Operations"
            },
            "name": "operations"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "field",
      "params": [
        "key",
        "value"
      ],
      "docs": {
        "description": "Returns a key, value pair in an array.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "field('destination_field_name__c', 'value')"
          },
          {
            "title": "param",
            "description": "Name of the field",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "key"
          },
          {
            "title": "param",
            "description": "The value itself or a sourceable operation.",
            "type": {
              "type": "NameExpression",
              "name": "Value"
            },
            "name": "value"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Field"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "fields",
      "params": [
        "fields"
      ],
      "docs": {
        "description": "Zips key value pairs into an object.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "fields(list_of_fields)"
          },
          {
            "title": "param",
            "description": "a list of fields",
            "type": {
              "type": "NameExpression",
              "name": "Fields"
            },
            "name": "fields"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Object"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "merge",
      "params": [
        "dataSource",
        "fields"
      ],
      "docs": {
        "description": "Merges fields into each item in an array.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "merge(\n  \"$.books[*]\",\n  fields(\n    field( \"publisher\", sourceValue(\"$.publisher\") )\n  )\n)"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "param",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "DataSource"
            },
            "name": "dataSource"
          },
          {
            "title": "param",
            "description": "Group of fields to merge in.",
            "type": {
              "type": "NameExpression",
              "name": "Object"
            },
            "name": "fields"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "DataSource"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "cursor",
      "params": [
        "value",
        "options"
      ],
      "docs": {
        "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones\nare not yet supported.\nYou can provide a formatter to customise the final cursor value, which is useful for normalising\ndifferent inputs. The custom formatter runs after natural language date conversion.\nSee the usage guide at {@link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "cursor($.cursor, { defaultValue: 'today' })",
            "caption": "Use a cursor from state if present, or else use the default value"
          },
          {
            "title": "example",
            "description": "cursor(22)",
            "caption": "Use a pagination cursor"
          },
          {
            "title": "param",
            "description": "the cursor value. Usually an ISO date, natural language date, or page number",
            "type": {
              "type": "NameExpression",
              "name": "any"
            },
            "name": "value"
          },
          {
            "title": "param",
            "description": "options to control the cursor.",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "options"
          },
          {
            "title": "param",
            "description": "set the cursor key. Will persist through the whole run.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "options.key"
          },
          {
            "title": "param",
            "description": "the value to use if value is falsy",
            "type": {
              "type": "NameExpression",
              "name": "any"
            },
            "name": "options.defaultValue"
          },
          {
            "title": "param",
            "description": "custom formatter for the final cursor value",
            "type": {
              "type": "NameExpression",
              "name": "Function"
            },
            "name": "options.format"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "name": "log",
      "params": [
        "args"
      ],
      "docs": {
        "description": "Outputs a message, like calling `console.log`. Use this at the top level of your job code, but not inside callbacks.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "log('Patient List::', $.patients);",
            "caption": "Log values from state"
          },
          {
            "title": "example",
            "description": "fn((state) => {\n  console.log(state.data);\n  return state;\n})",
            "caption": "Use console.log inside a callback or fn block"
          },
          {
            "title": "param",
            "description": "A value or message to display in the logs",
            "type": {
              "type": "NameExpression",
              "name": "any"
            },
            "name": "args"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "as",
      "params": [
        "key",
        "operation"
      ],
      "docs": {
        "description": "Run an operation and save the result to a custom key in state instead of overwriting state.data.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "example",
            "description": "as('cceData', collections.get('cce-data-dhis2', { key: `*:*:${$.syncedAt}*` }));",
            "caption": "Fetch cce-data from collections and store them under state.cceData"
          },
          {
            "title": "param",
            "description": "The state key to assign the result of the operation to.",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "key"
          },
          {
            "title": "param",
            "description": " An operation that returns a new state object with a `data` property",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "operation"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    }
  ]
}