# What we expect the Insomnia example collection to import as
profiles:
  env_3b607180e18c41228387930058c9ca43:
    name: Local
    data:
      base_field: base
      host: http://localhost:3000
      greeting: hello!
  env_4fb19173966e42898a0a77f45af591c9:
    name: Remote
    data:
      base_field: base
      host: https://httpbin.org
      greeting: howdy

requests:
  fld_46131b927d9f4fbaa2fd01d946827da3:
    name: Chains
    requests:
      req_daa3b8fc531b444aa2bd48ec82522393:
        name: Chain Header / Trigger Never
        method: GET
        url: https://httpbin.org/get
        authentication:
          type: bearer
          token: "{{ response_header('req_a345faa530a7453e83ee967d18555712', 'content-type') }}"
      req_0c0bd2eb342c4d7a8408b2ad8033d3a9:
        name: Chain Body / Trigger No History
        method: GET
        url: https://httpbin.org/get
        authentication:
          type: bearer
          token: "{{ response('req_a345faa530a7453e83ee967d18555712', trigger='no_history') }}"
      req_fdeac2a5d6f74468bf0d7c5418a8bfb4:
        name: Chain Body Part / Trigger Expire
        method: GET
        url: https://httpbin.org/get
        authentication:
          type: bearer
          token:
            "{{ response('req_a345faa530a7453e83ee967d18555712', trigger='60s') \
            | jsonpath('$.data') }}"
      req_2810d3a0eedc437ca02f6094a3406d2c:
        name: Chain URL / Trigger Always
        method: GET
        url: https://httpbin.org/get
        authentication:
          type: bearer
          # There's no function to get a response URL in Slumber
          token: "{% response 'url', 'req_a345faa530a7453e83ee967d18555712', 'b64::JC5kYXRh::46b', 'always', 60 %}"

  fld_9a7332db608943b093c929a82c81df50:
    name: My Folder
    requests:
      fld_8077c48f5a89436bbe4b3a53c06471f5:
        name: Inner Folder
        requests:
          req_2ec3dc9ff6774ac78248777e75984831:
            name: Bearer Auth
            method: GET
            url: https://httpbin.org/get
            body: null
            authentication:
              type: bearer
              token: my-token
            query: {}
            headers: {}

          req_b08ee35904784b5f9af598f9b7fd7ca0:
            name: Digest Auth (Unsupported)
            method: GET
            url: https://httpbin.org/get
            body: null
            authentication: null
            query: {}
            headers: {}

          req_284e0d90f0d647b483f863af5ee79c23:
            name: Basic Auth
            method: GET
            url: https://httpbin.org/get
            body: null
            authentication:
              type: basic
              username: user
              password: pass
            query: {}
            headers: {}

          req_814a5e9b63a7482da1d8261311bc6c84:
            name: No Auth
            method: GET
            url: https://httpbin.org/get
            body: null
            authentication: null
            query: {}
            headers: {}

      req_583c296a600247d6b0c28a0afcefdb89:
        name: With Text Body
        method: POST
        url: https://httpbin.org/post
        authentication: null
        query: {}
        headers:
          content-type: text/plain
        body: "hello!"

      req_1419670d20eb4964956df954e1eb7c4b:
        name: With JSON Body
        method: POST
        url: https://httpbin.org/post
        authentication: null
        query: {}
        headers:
          # This is redundant with the body type, but it's more effort than
          # it's worth to remove it
          content-type: application/json
        body:
          type: json
          data: { "message": "hello!" }

      req_a01b6de924274654bda0835e2a073bd0:
        name: With Multipart Body
        method: POST
        url: https://httpbin.org/post
        authentication: null
        query: {}
        headers:
          # This is redundant with the body type, but it's more effort than
          # it's worth to remove it
          content-type: multipart/form-data
        body:
          type: form_multipart
          data:
            username: user
            image: "{{ file('./public/slumber.png') }}"

  req_a345faa530a7453e83ee967d18555712:
    name: Login
    method: POST
    url: https://httpbin.org/anything/login
    body:
      type: form_urlencoded
      data:
        username: user
        password: pass
    authentication: null
    query: {}
    headers:
      content-type: "application/x-www-form-urlencoded"
