{
  "operations": [
    {
      "name": "create",
      "params": [
        "resource",
        "data",
        "callback"
      ],
      "docs": {
        "description": "Create some resource in msgraph",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "create(\"applications\", {\"displayName\": \"My App\"})"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "The type of entity that will be created",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "resource"
          },
          {
            "title": "param",
            "description": "The data to create the new resource",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "data"
          },
          {
            "title": "param",
            "description": "An optional callback function",
            "type": {
              "type": "NameExpression",
              "name": "function"
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "get",
      "params": [
        "path",
        "query",
        "callback"
      ],
      "docs": {
        "description": "Make a GET request to msgraph resource",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "get('sites/root/lists')"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Path to resource",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "path"
          },
          {
            "title": "param",
            "description": "Query, Headers and Authentication parameters",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "query"
          },
          {
            "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": "getDrive",
      "params": [
        "specifier",
        "name",
        "callback"
      ],
      "docs": {
        "description": "Get a Drive or SharePoint document library. The drive metadata will be written\nto state.drives, where it can be used by other adaptor functions.\nPass { id } to get a drive by id or { id, owner } to get default drive for\nsome parent resource, like a group",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "getDrive({ id: \"YXzpkoLwR06bxC8tNdg71m\" })",
            "caption": "Get a drive by ID"
          },
          {
            "title": "example",
            "description": "getDrive({ id: \"openfn.sharepoint.com\", owner: \"sites\" })",
            "caption": "Get the default drive for a site"
          },
          {
            "title": "param",
            "description": "{Object} - A definition of the drive to retrieve\n   - id {string} - The ID of the resource or owner.\n   - owner {string} - The type of drive owner (e.g. sites, groups).",
            "type": null,
            "name": "specifier"
          },
          {
            "title": "param",
            "description": "The local name of the drive used to write to state.drives, ie, state.drives[name]",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "name"
          },
          {
            "title": "param",
            "description": "(Optional) Callback function",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "function"
              }
            },
            "name": "callback",
            "default": "s"
          },
          {
            "title": "return",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "getFolder",
      "params": [
        "pathOrId",
        "options",
        "callback"
      ],
      "docs": {
        "description": "Get the contents or metadata of a folder.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "getFolder('01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3')",
            "caption": "Get a folder by ID"
          },
          {
            "title": "example",
            "description": "getFolder(\"01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3\",{ driveName: \"mydrive\"})",
            "caption": "Get a folder for a named drive by id"
          },
          {
            "title": "param",
            "description": "A path to a folder or folder id",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "pathOrId"
          },
          {
            "title": "param",
            "description": "(Optional) Query parameters",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "options"
          },
          {
            "title": "param",
            "description": "(Optional) Callback function",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "function"
              }
            },
            "name": "callback",
            "default": "s"
          },
          {
            "title": "return",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "getFile",
      "params": [
        "pathOrId",
        "options",
        "callback"
      ],
      "docs": {
        "description": "Get file metadata or file content.",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "getFile('01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW')",
            "caption": "Get a file by ID"
          },
          {
            "title": "example",
            "description": "getFile(\"01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW\",{ driveName: \"mydrive\"})",
            "caption": "Get a file for a named drive by id"
          },
          {
            "title": "param",
            "description": "A path to a file or file id",
            "type": {
              "type": "NameExpression",
              "name": "string"
            },
            "name": "pathOrId"
          },
          {
            "title": "param",
            "description": "(Optional) Query parameters",
            "type": {
              "type": "NameExpression",
              "name": "object"
            },
            "name": "options"
          },
          {
            "title": "param",
            "description": "(Optional) Callback function",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "function"
              }
            },
            "name": "callback",
            "default": "s"
          },
          {
            "title": "return",
            "description": null,
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "name": "uploadFile",
      "params": [
        "resource",
        "data",
        "callback"
      ],
      "docs": {
        "description": "Upload a file to a drive",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "example",
            "description": "uploadFile(\n  state => ({\n    driveId: state.driveId,\n    folderId: state.folderId,\n    fileName: `Tracker.xlsx`,\n  }),\n  state => state.buffer\n);",
            "caption": "Upload Excel file to a drive using `driveId` and `parantItemId`"
          },
          {
            "title": "example",
            "description": "uploadFile(\n  state => ({\n    siteId: state.siteId,\n    folderId: state.folderId,\n    fileName: `Report.xlsx`,\n  }),\n  state => state.buffer\n);",
            "caption": "Upload Excel file to a SharePoint drive using `siteId` and `parantItemId`"
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "Resource Object",
            "type": {
              "type": "NameExpression",
              "name": "Object"
            },
            "name": "resource"
          },
          {
            "title": "param",
            "description": "Drive Id",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "String"
              }
            },
            "name": "resource.driveId"
          },
          {
            "title": "param",
            "description": "Site Id",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "String"
              }
            },
            "name": "resource.driveId"
          },
          {
            "title": "param",
            "description": "Parent folder id",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "String"
              }
            },
            "name": "resource.folderId"
          },
          {
            "title": "param",
            "description": "Resource content-type",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "String"
              }
            },
            "name": "resource.contentType"
          },
          {
            "title": "param",
            "description": "Specify conflict behavior if file with the same name exists. Can be \"rename | fail | replace\"",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "String"
              }
            },
            "name": "resource.onConflict"
          },
          {
            "title": "param",
            "description": "A buffer containing the file.",
            "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": false
    }
  ],
  "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": "parseCsv",
      "params": [
        "csvData",
        "parsingOptions",
        "callback"
      ],
      "docs": {
        "description": "Takes a CSV file string or stream and parsing options as input, and returns a promise that\nresolves to the parsed CSV data as an array of objects.\nOptions for `parsingOptions` include:\n- `delimiter` {string/Buffer/[string/Buffer]} - Defines the character(s) used to delineate the fields inside a record. Default: `','`\n- `quote` {string/Buffer/[string/Buffer]} - Defines the characters used to surround a field. Default: `'\"'`\n- `escape` {Buffer/string/null/boolean} - Set the escape character as one character/byte only. Default: `\"`\n- `columns` {boolean / array / function} - Generates record in the form of object literals. Default: `true`\n- `bom` {boolean} - Strips the {@link https://en.wikipedia.org/wiki/Byte_order_mark byte order mark (BOM)} from the input string or buffer. Default: `true`\n- `trim` {boolean} - Ignore whitespace characters immediately around the `delimiter`. Default: `true`\n- `ltrim` {boolean} - Ignore whitespace characters from the left side of a CSV field. Default: `true`\n- `rtrim` {boolean} - Ignore whitespace characters from the right side of a CSV field. Default: `true`\n- `chunkSize` {number} - The size of each chunk of CSV data. Default: `Infinity`\n- `skip_empty_lines` {boolean} - Ignore empty lines in the CSV file. Default: `true`",
        "tags": [
          {
            "title": "public",
            "description": null,
            "type": null
          },
          {
            "title": "function",
            "description": null,
            "name": null
          },
          {
            "title": "param",
            "description": "A CSV string or a readable stream",
            "type": {
              "type": "UnionType",
              "elements": [
                {
                  "type": "NameExpression",
                  "name": "String"
                },
                {
                  "type": "NameExpression",
                  "name": "Stream"
                }
              ]
            },
            "name": "csvData"
          },
          {
            "title": "param",
            "description": "Optional. Parsing options for converting CSV to JSON.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "Object"
              }
            },
            "name": "parsingOptions"
          },
          {
            "title": "param",
            "description": "(Optional) callback function. If used it will be called state and an array of rows.",
            "type": {
              "type": "OptionalType",
              "expression": {
                "type": "NameExpression",
                "name": "function"
              }
            },
            "name": "callback"
          },
          {
            "title": "returns",
            "description": "The function returns a Promise that resolves to the result of parsing a CSV `stringOrStream`.",
            "type": {
              "type": "NameExpression",
              "name": "Operation"
            }
          }
        ]
      },
      "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
    }
  ]
}