Full Code of mwinteringham/restful-booker for AI

main 00461155995c cached
113 files
521.0 KB
161.4k tokens
121 symbols
1 requests
Download .txt
Showing preview only (555K chars total). Download the full file or copy to clipboard to get everything.
Repository: mwinteringham/restful-booker
Branch: main
Commit: 00461155995c
Files: 113
Total size: 521.0 KB

Directory structure:
gitextract__blxwpvx/

├── .dockerignore
├── .github/
│   └── workflows/
│       ├── main.yml
│       └── test.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── Procfile
├── README.md
├── app.js
├── app.json
├── bin/
│   └── www
├── docker-compose.yml
├── helpers/
│   ├── bookingcreator.js
│   ├── parser.js
│   ├── validationrules.js
│   └── validator.js
├── models/
│   └── booking.js
├── package.json
├── public/
│   ├── apidoc/
│   │   ├── api_data.js
│   │   ├── api_data.json
│   │   ├── api_project.js
│   │   ├── api_project.json
│   │   ├── css/
│   │   │   └── style.css
│   │   ├── index.html
│   │   ├── locales/
│   │   │   ├── ca.js
│   │   │   ├── cs.js
│   │   │   ├── de.js
│   │   │   ├── es.js
│   │   │   ├── fr.js
│   │   │   ├── it.js
│   │   │   ├── locale.js
│   │   │   ├── nl.js
│   │   │   ├── pl.js
│   │   │   ├── pt_br.js
│   │   │   ├── ro.js
│   │   │   ├── ru.js
│   │   │   ├── tr.js
│   │   │   ├── vi.js
│   │   │   ├── zh.js
│   │   │   └── zh_cn.js
│   │   ├── main.js
│   │   ├── utils/
│   │   │   ├── handlebars_helper.js
│   │   │   ├── send_sample_request.js
│   │   │   └── send_sample_request_utils.js
│   │   └── vendor/
│   │       ├── path-to-regexp/
│   │       │   ├── LICENSE
│   │       │   └── index.js
│   │       ├── polyfill.js
│   │       ├── prettify/
│   │       │   ├── lang-Splus.js
│   │       │   ├── lang-aea.js
│   │       │   ├── lang-agc.js
│   │       │   ├── lang-apollo.js
│   │       │   ├── lang-basic.js
│   │       │   ├── lang-cbm.js
│   │       │   ├── lang-cl.js
│   │       │   ├── lang-clj.js
│   │       │   ├── lang-css.js
│   │       │   ├── lang-dart.js
│   │       │   ├── lang-el.js
│   │       │   ├── lang-erl.js
│   │       │   ├── lang-erlang.js
│   │       │   ├── lang-fs.js
│   │       │   ├── lang-go.js
│   │       │   ├── lang-hs.js
│   │       │   ├── lang-lasso.js
│   │       │   ├── lang-lassoscript.js
│   │       │   ├── lang-latex.js
│   │       │   ├── lang-lgt.js
│   │       │   ├── lang-lisp.js
│   │       │   ├── lang-ll.js
│   │       │   ├── lang-llvm.js
│   │       │   ├── lang-logtalk.js
│   │       │   ├── lang-ls.js
│   │       │   ├── lang-lsp.js
│   │       │   ├── lang-lua.js
│   │       │   ├── lang-matlab.js
│   │       │   ├── lang-ml.js
│   │       │   ├── lang-mumps.js
│   │       │   ├── lang-n.js
│   │       │   ├── lang-nemerle.js
│   │       │   ├── lang-pascal.js
│   │       │   ├── lang-proto.js
│   │       │   ├── lang-r.js
│   │       │   ├── lang-rd.js
│   │       │   ├── lang-rkt.js
│   │       │   ├── lang-rust.js
│   │       │   ├── lang-s.js
│   │       │   ├── lang-scala.js
│   │       │   ├── lang-scm.js
│   │       │   ├── lang-sql.js
│   │       │   ├── lang-ss.js
│   │       │   ├── lang-swift.js
│   │       │   ├── lang-tcl.js
│   │       │   ├── lang-tex.js
│   │       │   ├── lang-vb.js
│   │       │   ├── lang-vbs.js
│   │       │   ├── lang-vhd.js
│   │       │   ├── lang-vhdl.js
│   │       │   ├── lang-wiki.js
│   │       │   ├── lang-xq.js
│   │       │   ├── lang-xquery.js
│   │       │   ├── lang-yaml.js
│   │       │   ├── lang-yml.js
│   │       │   ├── prettify.css
│   │       │   ├── prettify.js
│   │       │   └── run_prettify.js
│   │       ├── prettify.css
│   │       ├── prism.css
│   │       ├── prism.js
│   │       └── webfontloader.js
│   └── index.html
├── routes/
│   ├── apidoc.json
│   └── index.js
└── tests/
    └── spec.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
node-modules/
.git/
.gitignore

================================================
FILE: .github/workflows/main.yml
================================================
name: Deploy

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Heroku CLI # <- IMPORTANT!!! Make sure the cli is installed before using the action
        run: |
          curl https://cli-assets.heroku.com/install.sh | sh 
      - uses: akhileshns/heroku-deploy@v3.14.15 # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} #Must be unique in Heroku
          heroku_email: ${{ secrets.HEROKU_EMAIL }}

================================================
FILE: .github/workflows/test.yml
================================================
name: UnitTests

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [22.x]

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm i
      - run: npm run test

================================================
FILE: .gitignore
================================================
**/node_modules
**/.DS_Store
.vscode/
npm-debug.log
.idea

================================================
FILE: Dockerfile
================================================
FROM node:22

# Copy restful-booker across
RUN mkdir /restful-booker

WORKDIR /restful-booker

COPY ./ ./

RUN npm install

CMD npm start


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: Procfile
================================================
web: npm start


================================================
FILE: README.md
================================================
# restful-booker
A simple Node booking form for testing RESTful web services.

# Requirements
- Docker 17.09.0
- Docker Compose 1.16.1

# Installation
1. Ensure mongo is up and running by executing ```mongod``` in your terminal
2. Clone the repo
3. Navigate into the restful-booker root folder
4. Run ```npm install```
5. Run ```npm start```
 
Or you can run this via Docker:
1. Clone the repo
2. Navigate into the restful-booker root folder
3. Run ```docker-compose build```
4. Run ```docker-compose up```
5. APIs are exposed on http://localhost:3001

# API
API details can be found on the [publically deployed version of Restful-Booker](https://restful-booker.herokuapp.com/).


================================================
FILE: app.js
================================================
const express = require('express');
const path = require('path');
const logger = require('morgan');
const cookieParser = require('cookie-parser');
const xmlparser = require('express-xml-bodyparser');

const routes = require('./routes/index');

const app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(xmlparser({trim: false, explicitArray: false}));

app.use('/', routes);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  const err = new Error('Not Found');
  err.status = 404;
  next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
  app.use(function(err, req, res, next) {
    console.log(err);
    res.sendStatus(err.status || 500);
  });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
  res.sendStatus(err.status || 500);
});


module.exports = app;


================================================
FILE: app.json
================================================
{
  "name": "restful-booker",
  "description": "An API for practising your testing skills against",
  "image": "mwinteringham/restful-booker"
}


================================================
FILE: bin/www
================================================
#!/usr/bin/env node

/**
 * Module dependencies.
 */
const app = require('../app');
const debug = require('debug')('restful-booker-v2:server');
const http = require('http');

/**
 * Get port from environment and store in Express.
 */
const port = normalizePort(process.env.PORT || '3001');
app.set('port', port);

/**
 * Create HTTP server.
 */
const server = http.createServer(app);

/**
 * Listen on provided port, on all network interfaces.
 */

server.listen(port);
server.on('error', onError);
server.on('listening', onListening);

/**
 * Normalize a port into a number, string, or false.
 */

function normalizePort(val) {
  const port = parseInt(val, 10);

  if (isNaN(port)) {
    // named pipe
    return val;
  }

  if (port >= 0) {
    // port number
    return port;
  }

  return false;
}

/**
 * Event listener for HTTP server "error" event.
 */

function onError(error) {
  if (error.syscall !== 'listen') {
    throw error;
  }

  const bind = typeof port === 'string'
      ? 'Pipe ' + port
      : 'Port ' + port;

  // handle specific listen errors with friendly messages
  switch (error.code) {
    case 'EACCES':
      console.error(bind + ' requires elevated privileges');
      process.exit(1);
      break;
    case 'EADDRINUSE':
      console.error(bind + ' is already in use');
      process.exit(1);
      break;
    default:
      throw error;
  }
}

/**
 * Event listener for HTTP server "listening" event.
 */

function onListening() {
  const addr = server.address();
  const bind = typeof addr === 'string'
      ? 'pipe ' + addr
      : 'port ' + addr.port;
  debug('Listening on ' + bind);
}


================================================
FILE: docker-compose.yml
================================================
version: '2'
services:
  restful-booker:
    build: ./
    ports:
      - "3001:3001"


================================================
FILE: helpers/bookingcreator.js
================================================
date = require('date-and-time');

const randomiseDate = function (start, end) {
  return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
};

const randomiseNumber = function (from, to) {
  return Math.floor(Math.random() * (to - from + 1) + from);
};

const randomiseFirstName = function () {
  const name = ["Mark", "Mary", "Sally", "Jim", "Eric", "Susan"];

  return name[randomiseNumber(0, name.length - 1)];
};

const randomiseLastName = function () {
  const surname = ["Jones", "Wilson", "Jackson", "Brown", "Smith", "Ericsson"];

  return surname[randomiseNumber(0, surname.length - 1)];
};

const randomiseBool = function () {
  const bool = [true, false];

  return bool[randomiseNumber(0, bool.length - 1)];
};

exports.createBooking = function(){
  const checkInDate = randomiseDate(new Date(2015, 1, 1), new Date());
  const latestDate = new Date();
  latestDate.setDate(latestDate.getDate() + 3)

  const booking = {
    firstname: randomiseFirstName(),
    lastname: randomiseLastName(),
    totalprice: randomiseNumber(100, 1000),
    depositpaid: randomiseBool(),
    bookingdates: {
      checkin: date.format(new Date(checkInDate.setHours(15, 0, 0, 0)), 'YYYY-MM-DD'),
      checkout: date.format(new Date(randomiseDate(checkInDate, latestDate).setHours(12, 0, 0, 0)), 'YYYY-MM-DD')
    }
  };

  if(randomiseBool()){
    booking.additionalneeds = "Breakfast";
  }

  return booking;
}

================================================
FILE: helpers/parser.js
================================================
const js2xmlparser = require("js2xmlparser"),
    formurlencoded = require('form-urlencoded').default,
    date = require('date-and-time');

exports.bookingids = function(req, rawBooking){
  const payload = [];

  rawBooking.forEach(function(b){
    const tmpBooking = {
      bookingid: b.bookingid,
    };

    payload.push(tmpBooking);
  });

  return payload;
}

exports.booking = function(accept, rawBooking){
  try {
    const booking = {
      'firstname': rawBooking.firstname,
      'lastname': rawBooking.lastname,
      'totalprice': parseInt(rawBooking.totalprice),
      'depositpaid': Boolean(rawBooking.depositpaid),
      'bookingdates': {
        'checkin': date.format(new Date(rawBooking.bookingdates.checkin), 'YYYY-MM-DD'),
        'checkout': date.format(new Date(rawBooking.bookingdates.checkout), 'YYYY-MM-DD'),
      }
    };

    if(typeof(rawBooking.additionalneeds) !== 'undefined'){
      booking.additionalneeds = rawBooking.additionalneeds;
    }

    switch(accept){
      case 'application/xml':
        return js2xmlparser.parse('booking', booking);
      case 'application/json':
        return booking;
      case 'application/x-www-form-urlencoded':
        return formurlencoded(booking);
      case '*/*':
        return booking;
      default:
        return null;
    }
  } catch(err) {
    return err.message;
  }
}

exports.bookingWithId = function(req, rawBooking){
  try {
    const booking = {
      'firstname': rawBooking.firstname,
      'lastname': rawBooking.lastname,
      'totalprice': parseInt(rawBooking.totalprice),
      'depositpaid': Boolean(rawBooking.depositpaid),
      'bookingdates': {
        'checkin': date.format(new Date(rawBooking.bookingdates.checkin), 'YYYY-MM-DD'),
        'checkout': date.format(new Date(rawBooking.bookingdates.checkout), 'YYYY-MM-DD'),
      }
    };

    if(typeof(rawBooking.additionalneeds) !== 'undefined'){
      booking.additionalneeds = rawBooking.additionalneeds;
    }

    const payload = {
      "bookingid": rawBooking.bookingid,
      "booking": booking
    };

    switch(req.headers.accept){
      case 'application/xml':
        return js2xmlparser.parse('created-booking', payload);
      case 'application/json':
        return payload;
      case 'application/x-www-form-urlencoded':
        return formurlencoded(payload);
      case '*/*':
        return payload;
      default:
        return null;
    }
  } catch(err) {
    return err.message;
  }
}


================================================
FILE: helpers/validationrules.js
================================================
exports.returnRuleSet = function(){
  const constraints = {
    firstname: {presence: true},
    lastname: {presence: true},
    totalprice: {presence: true},
    depositpaid: {presence: true},
    'bookingdates.checkin': {presence: true},
    'bookingdates.checkout': {presence: true},
  };

  return constraints
}


================================================
FILE: helpers/validator.js
================================================
const rules = require('../helpers/validationrules'),
    validate = require('validate.js');

exports.scrubAndValidate = function(payload, callback){
  if(payload.firstname){
      payload.firstname = payload.firstname.trim();
  }

  if(payload.lastname){
      payload.lastname = payload.lastname.trim();
  }

  callback(payload, validate(payload, rules.returnRuleSet()))
};


================================================
FILE: models/booking.js
================================================
const loki = require('lokijs');

let counter = 0;
const db = new loki('booking.db');
const booking = db.addCollection('bookings');

exports.getIDs = function(query, callback) {
  try {
    // Convert nedb-style query to LokiJS query
    const results = booking.find(query);
    callback(null, results);
  } catch (err) {
    callback(err);
  }
};

exports.get = function(id, callback) {
  try {
    const result = booking.findOne({ bookingid: parseInt(id) });
    callback(null, result);
  } catch (err) {
    callback(err, null);
  }
};

exports.create = function(payload, callback) {
  try {
    counter++;
    payload.bookingid = counter;
    booking.insert(payload);
    callback(null, payload);
  } catch (err) {
    callback(err);
  }
};

exports.update = function(id, updatedBooking, callback) {
  try {
    const doc = booking.findOne({ bookingid: parseInt(id) });
    if (!doc) {
      return callback(new Error(`Booking ${id} not found`));
    }
    Object.assign(doc, updatedBooking);
    booking.update(doc);
    callback(null);
  } catch (err) {
    callback(err);
  }
};

exports.delete = function(id, callback) {
  try {
    const doc = booking.findOne({ bookingid: parseInt(id) });
    if (!doc) {
      return callback(new Error(`Booking ${id} not found`));
    }
    booking.remove(doc);
    callback(null);
  } catch (err) {
    callback(err);
  }
};

exports.deleteAll = function(callback) {
  try {
    counter = 0;
    booking.clear();
    callback(null);
  } catch (err) {
    callback(err);
  }
};

================================================
FILE: package.json
================================================
{
  "name": "restful-booker",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "cross-env SEED=true node ./bin/www",
    "test": "mocha -R spec tests/spec.js",
    "build_docs": "apidoc -i ./routes/ -o public/apidoc/"
  },
  "dependencies": {
    "body-parser": "2.2.2",
    "cookie-parser": "1.4.7",
    "cross-env": "10.1.0",
    "date-and-time": "4.3.1",
    "debug": "4.4.3",
    "express": "5.2.1",
    "express-xml-bodyparser": "0.4.1",
    "form-urlencoded": "6.1.6",
    "js2xmlparser": "5.0.0",
    "lokijs": "^1.5.12",
    "morgan": "1.10.1",
    "pug": "3.0.4",
    "uuid": "13.0.0",
    "validate.js": "0.13.1",
    "xml2js": "0.6.2"
  },
  "devDependencies": {
    "chai": "6.2.2",
    "mocha": "11.7.5",
    "supertest": "7.2.2"
  }
}


================================================
FILE: public/apidoc/api_data.js
================================================
define({ "api": [
  {
    "type": "post",
    "url": "auth",
    "title": "CreateToken",
    "name": "CreateToken",
    "group": "Auth",
    "version": "1.0.0",
    "description": "<p>Creates a new auth token to use for access to the PUT and DELETE /booking</p>",
    "parameter": {
      "fields": {
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "username",
            "defaultValue": "admin",
            "description": "<p>Username for authentication</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "password",
            "defaultValue": "password123",
            "description": "<p>Password for authentication</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/auth \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"username\" : \"admin\",\n    \"password\" : \"password123\"\n}'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "token",
            "description": "<p>Token to use in future requests</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"token\": \"abc123\"\n}",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Auth"
  },
  {
    "type": "post",
    "url": "booking",
    "title": "CreateBooking",
    "name": "CreateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Creates a new booking in the API</p>",
    "parameter": {
      "fields": {
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"firstname\" : \"Jim\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: text/xml' \\\n  -d '<booking>\n    <firstname>Jim</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'firstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2018-01-02'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "bookingid",
            "description": "<p>ID for newly created booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "booking",
            "description": "<p>Object that contains</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "booking.totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "booking.depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "booking.bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "booking.bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "booking.bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"bookingid\": 1,\n    \"booking\": {\n        \"firstname\": \"Jim\",\n        \"lastname\": \"Brown\",\n        \"totalprice\": 111,\n        \"depositpaid\": true,\n        \"bookingdates\": {\n            \"checkin\": \"2018-01-01\",\n            \"checkout\": \"2019-01-01\"\n        },\n        \"additionalneeds\": \"Breakfast\"\n    }\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<?xml version='1.0'?>\n<created-booking>\n    <bookingid>1</bookingid>\n    <booking>\n        <firstname>Jim</firstname>\n        <lastname>Brown</lastname>\n        <totalprice>111</totalprice>\n        <depositpaid>true</depositpaid>\n        <bookingdates>\n            <checkin>2018-01-01</checkin>\n            <checkout>2019-01-01</checkout>\n        </bookingdates>\n        <additionalneeds>Breakfast</additionalneeds>\n    </booking>\n</created-booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nbookingid=1&booking%5Bfirstname%5D=Jim&booking%5Blastname%5D=Brown&booking%5Btotalprice%5D=111&booking%5Bdepositpaid%5D=true&booking%5Bbookingdates%5D%5Bcheckin%5D=2018-01-01&booking%5Bbookingdates%5D%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "delete",
    "url": "booking/1",
    "title": "DeleteBooking",
    "name": "DeleteBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Deletes a booking from the API. Requires an authorization token to be set in the header or a Basic auth header.</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the DELETE endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the DELETE endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (Cookie):",
        "content": "curl -X DELETE \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Cookie: token=abc123'",
        "type": "json"
      },
      {
        "title": "Example 2 (Basic auth):",
        "content": "curl -X DELETE \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM='",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "OK",
            "description": "<p>Default HTTP 201 response</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 201 Created",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "booking/:id",
    "title": "GetBooking",
    "name": "GetBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Returns a specific booking based upon the booking id provided</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "String",
            "optional": false,
            "field": "id",
            "description": "<p>The id of the booking you would like to retrieve</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (Get booking):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking/1",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\": \"Sally\",\n    \"lastname\": \"Brown\",\n    \"totalprice\": 111,\n    \"depositpaid\": true,\n    \"bookingdates\": {\n        \"checkin\": \"2013-02-23\",\n        \"checkout\": \"2014-10-23\"\n    },\n    \"additionalneeds\": \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>Sally</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n        <checkin>2013-02-23</checkin>\n        <checkout>2014-10-23</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "booking",
    "title": "GetBookingIds",
    "name": "GetBookings",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Returns the ids of all the bookings that exist within the API. Can take optional query strings to search and return a subset of booking ids.</p>",
    "parameter": {
      "fields": {
        "Parameter": [
          {
            "group": "Parameter",
            "type": "String",
            "optional": true,
            "field": "firstname",
            "description": "<p>Return bookings with a specific firstname</p>"
          },
          {
            "group": "Parameter",
            "type": "String",
            "optional": true,
            "field": "lastname",
            "description": "<p>Return bookings with a specific lastname</p>"
          },
          {
            "group": "Parameter",
            "type": "date",
            "optional": true,
            "field": "checkin",
            "description": "<p>Return bookings that have a checkin date greater than or equal to the set checkin date. Format must be CCYY-MM-DD</p>"
          },
          {
            "group": "Parameter",
            "type": "date",
            "optional": true,
            "field": "checkout",
            "description": "<p>Return bookings that have a checkout date greater than or equal to the set checkout date. Format must be CCYY-MM-DD</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (All IDs):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking",
        "type": "json"
      },
      {
        "title": "Example 2 (Filter by name):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking?firstname=sally&lastname=brown",
        "type": "json"
      },
      {
        "title": "Example 3 (Filter by checkin/checkout date):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking?checkin=2014-03-13&checkout=2014-05-21",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "object[]",
            "optional": false,
            "field": "object",
            "description": "<p>Array of objects that contain unique booking IDs</p>"
          },
          {
            "group": "Success 200",
            "type": "number",
            "optional": false,
            "field": "object.bookingid",
            "description": "<p>ID of a specific booking that matches search criteria</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 200 OK\n\n[\n  {\n    \"bookingid\": 1\n  },\n  {\n    \"bookingid\": 2\n  },\n  {\n    \"bookingid\": 3\n  },\n  {\n    \"bookingid\": 4\n  }\n]",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "patch",
    "url": "booking/:id",
    "title": "PartialUpdateBooking",
    "name": "PartialUpdateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Updates a current booking with a partial payload</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ],
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": true,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": true,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": true,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": true,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the PUT endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the PUT endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json' \\\n  -H 'Cookie: token=abc123' \\\n  -d '{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: text/xml' \\\n  -H 'Accept: application/xml' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d '<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -H 'Accept: application/x-www-form-urlencoded' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d 'firstname=Jim&lastname=Brown'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "put",
    "url": "booking/:id",
    "title": "UpdateBooking",
    "name": "UpdateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Updates a current booking</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ],
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the PUT endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the PUT endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json' \\\n  -H 'Cookie: token=abc123' \\\n  -d '{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: text/xml' \\\n  -H 'Accept: application/xml' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d '<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -H 'Accept: application/x-www-form-urlencoded' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d 'firstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2018-01-02'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "ping",
    "title": "HealthCheck",
    "name": "Ping",
    "group": "Ping",
    "version": "1.0.0",
    "description": "<p>A simple health check endpoint to confirm whether the API is up and running.</p>",
    "examples": [
      {
        "title": "Ping server:",
        "content": "curl -i https://restful-booker.herokuapp.com/ping",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "OK",
            "description": "<p>Default HTTP 201 response</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 201 Created",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Ping"
  }
] });


================================================
FILE: public/apidoc/api_data.json
================================================
[
  {
    "type": "post",
    "url": "auth",
    "title": "CreateToken",
    "name": "CreateToken",
    "group": "Auth",
    "version": "1.0.0",
    "description": "<p>Creates a new auth token to use for access to the PUT and DELETE /booking</p>",
    "parameter": {
      "fields": {
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "username",
            "defaultValue": "admin",
            "description": "<p>Username for authentication</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "password",
            "defaultValue": "password123",
            "description": "<p>Password for authentication</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/auth \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"username\" : \"admin\",\n    \"password\" : \"password123\"\n}'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "token",
            "description": "<p>Token to use in future requests</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"token\": \"abc123\"\n}",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Auth"
  },
  {
    "type": "post",
    "url": "booking",
    "title": "CreateBooking",
    "name": "CreateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Creates a new booking in the API</p>",
    "parameter": {
      "fields": {
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"firstname\" : \"Jim\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: text/xml' \\\n  -d '<booking>\n    <firstname>Jim</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X POST \\\n  https://restful-booker.herokuapp.com/booking \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'firstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2018-01-02'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "bookingid",
            "description": "<p>ID for newly created booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "booking",
            "description": "<p>Object that contains</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "booking.totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "booking.depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "booking.bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "booking.bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "booking.bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "booking.additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"bookingid\": 1,\n    \"booking\": {\n        \"firstname\": \"Jim\",\n        \"lastname\": \"Brown\",\n        \"totalprice\": 111,\n        \"depositpaid\": true,\n        \"bookingdates\": {\n            \"checkin\": \"2018-01-01\",\n            \"checkout\": \"2019-01-01\"\n        },\n        \"additionalneeds\": \"Breakfast\"\n    }\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<?xml version='1.0'?>\n<created-booking>\n    <bookingid>1</bookingid>\n    <booking>\n        <firstname>Jim</firstname>\n        <lastname>Brown</lastname>\n        <totalprice>111</totalprice>\n        <depositpaid>true</depositpaid>\n        <bookingdates>\n            <checkin>2018-01-01</checkin>\n            <checkout>2019-01-01</checkout>\n        </bookingdates>\n        <additionalneeds>Breakfast</additionalneeds>\n    </booking>\n</created-booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nbookingid=1&booking%5Bfirstname%5D=Jim&booking%5Blastname%5D=Brown&booking%5Btotalprice%5D=111&booking%5Bdepositpaid%5D=true&booking%5Bbookingdates%5D%5Bcheckin%5D=2018-01-01&booking%5Bbookingdates%5D%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "delete",
    "url": "booking/1",
    "title": "DeleteBooking",
    "name": "DeleteBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Deletes a booking from the API. Requires an authorization token to be set in the header or a Basic auth header.</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the DELETE endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the DELETE endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (Cookie):",
        "content": "curl -X DELETE \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Cookie: token=abc123'",
        "type": "json"
      },
      {
        "title": "Example 2 (Basic auth):",
        "content": "curl -X DELETE \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM='",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "OK",
            "description": "<p>Default HTTP 201 response</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 201 Created",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "booking/:id",
    "title": "GetBooking",
    "name": "GetBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Returns a specific booking based upon the booking id provided</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "String",
            "optional": false,
            "field": "id",
            "description": "<p>The id of the booking you would like to retrieve</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (Get booking):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking/1",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\": \"Sally\",\n    \"lastname\": \"Brown\",\n    \"totalprice\": 111,\n    \"depositpaid\": true,\n    \"bookingdates\": {\n        \"checkin\": \"2013-02-23\",\n        \"checkout\": \"2014-10-23\"\n    },\n    \"additionalneeds\": \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>Sally</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n        <checkin>2013-02-23</checkin>\n        <checkout>2014-10-23</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "booking",
    "title": "GetBookingIds",
    "name": "GetBookings",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Returns the ids of all the bookings that exist within the API. Can take optional query strings to search and return a subset of booking ids.</p>",
    "parameter": {
      "fields": {
        "Parameter": [
          {
            "group": "Parameter",
            "type": "String",
            "optional": true,
            "field": "firstname",
            "description": "<p>Return bookings with a specific firstname</p>"
          },
          {
            "group": "Parameter",
            "type": "String",
            "optional": true,
            "field": "lastname",
            "description": "<p>Return bookings with a specific lastname</p>"
          },
          {
            "group": "Parameter",
            "type": "date",
            "optional": true,
            "field": "checkin",
            "description": "<p>Return bookings that have a checkin date greater than or equal to the set checkin date. Format must be CCYY-MM-DD</p>"
          },
          {
            "group": "Parameter",
            "type": "date",
            "optional": true,
            "field": "checkout",
            "description": "<p>Return bookings that have a checkout date greater than or equal to the set checkout date. Format must be CCYY-MM-DD</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "Example 1 (All IDs):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking",
        "type": "json"
      },
      {
        "title": "Example 2 (Filter by name):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking?firstname=sally&lastname=brown",
        "type": "json"
      },
      {
        "title": "Example 3 (Filter by checkin/checkout date):",
        "content": "curl -i https://restful-booker.herokuapp.com/booking?checkin=2014-03-13&checkout=2014-05-21",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "object[]",
            "optional": false,
            "field": "object",
            "description": "<p>Array of objects that contain unique booking IDs</p>"
          },
          {
            "group": "Success 200",
            "type": "number",
            "optional": false,
            "field": "object.bookingid",
            "description": "<p>ID of a specific booking that matches search criteria</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 200 OK\n\n[\n  {\n    \"bookingid\": 1\n  },\n  {\n    \"bookingid\": 2\n  },\n  {\n    \"bookingid\": 3\n  },\n  {\n    \"bookingid\": 4\n  }\n]",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "patch",
    "url": "booking/:id",
    "title": "PartialUpdateBooking",
    "name": "PartialUpdateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Updates a current booking with a partial payload</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ],
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": true,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": true,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": true,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": true,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": true,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the PUT endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the PUT endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json' \\\n  -H 'Cookie: token=abc123' \\\n  -d '{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: text/xml' \\\n  -H 'Accept: application/xml' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d '<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -H 'Accept: application/x-www-form-urlencoded' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d 'firstname=Jim&lastname=Brown'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "put",
    "url": "booking/:id",
    "title": "UpdateBooking",
    "name": "UpdateBooking",
    "group": "Booking",
    "version": "1.0.0",
    "description": "<p>Updates a current booking</p>",
    "parameter": {
      "fields": {
        "Url Parameter": [
          {
            "group": "Url Parameter",
            "type": "Number",
            "optional": false,
            "field": "id",
            "description": "<p>ID for the booking you want to update</p>"
          }
        ],
        "Request body": [
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Request body",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Request body",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Request body",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      }
    },
    "header": {
      "fields": {
        "Header": [
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Content-Type",
            "defaultValue": "application/json",
            "description": "<p>Sets the format of payload you are sending. Can be application/json or text/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": false,
            "field": "Accept",
            "defaultValue": "application/json",
            "description": "<p>Sets what format the response body is returned in. Can be application/json or application/xml</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Cookie",
            "defaultValue": "token=&lt;token_value&gt;",
            "description": "<p>Sets an authorization token to access the PUT endpoint, can be used as an alternative to the Authorization</p>"
          },
          {
            "group": "Header",
            "type": "string",
            "optional": true,
            "field": "Authorization",
            "defaultValue": "Basic",
            "description": "<p>YWRtaW46cGFzc3dvcmQxMjM=]   Basic authorization header to access the PUT endpoint, can be used as an alternative to the Cookie header</p>"
          }
        ]
      }
    },
    "examples": [
      {
        "title": "JSON example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json' \\\n  -H 'Cookie: token=abc123' \\\n  -d '{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}'",
        "type": "json"
      },
      {
        "title": "XML example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: text/xml' \\\n  -H 'Accept: application/xml' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d '<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n  </booking>'",
        "type": "json"
      },
      {
        "title": "URLencoded example usage:",
        "content": "curl -X PUT \\\n  https://restful-booker.herokuapp.com/booking/1 \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -H 'Accept: application/x-www-form-urlencoded' \\\n  -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=' \\\n  -d 'firstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2018-01-02'",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "firstname",
            "description": "<p>Firstname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "lastname",
            "description": "<p>Lastname for the guest who made the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Number",
            "optional": false,
            "field": "totalprice",
            "description": "<p>The total price for the booking</p>"
          },
          {
            "group": "Success 200",
            "type": "Boolean",
            "optional": false,
            "field": "depositpaid",
            "description": "<p>Whether the deposit has been paid or not</p>"
          },
          {
            "group": "Success 200",
            "type": "Object",
            "optional": false,
            "field": "bookingdates",
            "description": "<p>Sub-object that contains the checkin and checkout dates</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkin",
            "description": "<p>Date the guest is checking in</p>"
          },
          {
            "group": "Success 200",
            "type": "Date",
            "optional": false,
            "field": "bookingdates.checkout",
            "description": "<p>Date the guest is checking out</p>"
          },
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "additionalneeds",
            "description": "<p>Any other needs the guest has</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "JSON Response:",
          "content": "HTTP/1.1 200 OK\n\n{\n    \"firstname\" : \"James\",\n    \"lastname\" : \"Brown\",\n    \"totalprice\" : 111,\n    \"depositpaid\" : true,\n    \"bookingdates\" : {\n        \"checkin\" : \"2018-01-01\",\n        \"checkout\" : \"2019-01-01\"\n    },\n    \"additionalneeds\" : \"Breakfast\"\n}",
          "type": "json"
        },
        {
          "title": "XML Response:",
          "content": "HTTP/1.1 200 OK\n\n<booking>\n    <firstname>James</firstname>\n    <lastname>Brown</lastname>\n    <totalprice>111</totalprice>\n    <depositpaid>true</depositpaid>\n    <bookingdates>\n      <checkin>2018-01-01</checkin>\n      <checkout>2019-01-01</checkout>\n    </bookingdates>\n    <additionalneeds>Breakfast</additionalneeds>\n</booking>",
          "type": "xml"
        },
        {
          "title": "URL Response:",
          "content": "HTTP/1.1 200 OK\n\nfirstname=Jim&lastname=Brown&totalprice=111&depositpaid=true&bookingdates%5Bcheckin%5D=2018-01-01&bookingdates%5Bcheckout%5D=2019-01-01",
          "type": "url"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Booking"
  },
  {
    "type": "get",
    "url": "ping",
    "title": "HealthCheck",
    "name": "Ping",
    "group": "Ping",
    "version": "1.0.0",
    "description": "<p>A simple health check endpoint to confirm whether the API is up and running.</p>",
    "examples": [
      {
        "title": "Ping server:",
        "content": "curl -i https://restful-booker.herokuapp.com/ping",
        "type": "json"
      }
    ],
    "success": {
      "fields": {
        "Success 200": [
          {
            "group": "Success 200",
            "type": "String",
            "optional": false,
            "field": "OK",
            "description": "<p>Default HTTP 201 response</p>"
          }
        ]
      },
      "examples": [
        {
          "title": "Response:",
          "content": "HTTP/1.1 201 Created",
          "type": "json"
        }
      ]
    },
    "filename": "routes/index.js",
    "groupTitle": "Ping"
  }
]


================================================
FILE: public/apidoc/api_project.js
================================================
define({
  "name": "restful-booker",
  "version": "1.0.0",
  "description": "API documentation for the playground API restful-booker. <a href='/' style='font-size: 24px'>Click here to go back to Home</a>",
  "title": "Restful-booker",
  "url": "https://restful-booker.herokuapp.com/",
  "order": [
    "GetBookings",
    "GetBooking",
    "CreateBooking",
    "UpdateBooking",
    "PartialUpdateBooking",
    "DeleteBooking"
  ],
  "sampleUrl": false,
  "defaultVersion": "0.0.0",
  "apidoc": "0.3.0",
  "generator": {
    "name": "apidoc",
    "time": "2025-06-11T20:24:26.733Z",
    "url": "https://apidocjs.com",
    "version": "0.25.0"
  }
});


================================================
FILE: public/apidoc/api_project.json
================================================
{
  "name": "restful-booker",
  "version": "1.0.0",
  "description": "API documentation for the playground API restful-booker. <a href='/' style='font-size: 24px'>Click here to go back to Home</a>",
  "title": "Restful-booker",
  "url": "https://restful-booker.herokuapp.com/",
  "order": [
    "GetBookings",
    "GetBooking",
    "CreateBooking",
    "UpdateBooking",
    "PartialUpdateBooking",
    "DeleteBooking"
  ],
  "sampleUrl": false,
  "defaultVersion": "0.0.0",
  "apidoc": "0.3.0",
  "generator": {
    "name": "apidoc",
    "time": "2025-06-11T20:24:26.733Z",
    "url": "https://apidocjs.com",
    "version": "0.25.0"
  }
}


================================================
FILE: public/apidoc/css/style.css
================================================
/* ------------------------------------------------------------------------------------------
 * Content
 * ------------------------------------------------------------------------------------------ */
body {
  max-width: 1280px;
}

body, p, a, div, th, td {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 400;
  font-size: 16px;
}

@media (min-width: 1200px) {
  body.container-fluid {
    padding-right: 0px;
    padding-left: 0px;
    margin-right: 0px;
    margin-left: 0px;
  }
}

td.code {
  font-size: 14px;
  font-family: "Source Code Pro", monospace;
  font-style: normal;
  font-weight: 400;
}

#content {
  padding-top: 16px;
  z-Index: -1;
  margin-left: 270px;
}

p {
  color: #808080;
}

h1 {
  font-family: "Source Sans Pro Semibold", sans-serif;
  font-weight: normal;
  font-size: 44px;
  line-height: 50px;
  margin: 0 0 10px 0;
  padding: 0;
}

h2 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: normal;
  font-size: 24px;
  line-height: 40px;
  margin: 0 0 20px 0;
  padding: 0;
}

section {
  border-top: 1px solid #ebebeb;
  padding: 30px 0;
}

section h1 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  padding-bottom: 14px;
  margin: 0 0 20px 0;
  padding: 0;
}

article {
  padding: 14px 0 30px 0;
}

article h1 {
  font-family: "Source Sans Pro Bold", sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 26px;
}

article h2 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  margin: 0 0 10px 0;
}

article h3 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 18px;
  margin: 0 0 10px 0;
}

article h4 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 16px;
  margin: 0 0 8px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 20px 0;
}

th {
  background-color: #f5f5f5;
  text-align: left;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 700;
  padding: 4px 8px;
  border: #e0e0e0 1px solid;
}

td {
  vertical-align: top;
  padding: 10px 8px 0 8px;
  border: #e0e0e0 1px solid;
}

#generator .content {
  color: #b0b0b0;
  border-top: 1px solid #ebebeb;
  padding: 10px 0;
}

.label-optional {
  float: right;
  background-color: grey;
  margin-top: 4px;
}

.open-left {
  right: 0;
  left: auto;
}

/* ------------------------------------------------------------------------------------------
 * apidoc - intro
 * ------------------------------------------------------------------------------------------ */

#apidoc .apidoc {
  border-top: 1px solid #ebebeb;
  padding: 30px 0;
}

#apidoc h1 {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  padding-bottom: 14px;
  margin: 0 0 20px 0;
  padding: 0;
}

#apidoc h2 {
  font-family: "Source Sans Pro Bold", sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 26px;
  padding-top: 14px;
}

/* ------------------------------------------------------------------------------------------
 * Request type
 * ------------------------------------------------------------------------------------------ */
.type {
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 600;
  font-size: 15px;
  display: inline-block;
  margin: 0 0 5px 0;
  padding: 4px 5px;
  border-radius: 6px;
  text-transform: uppercase;
  background-color: #3387CC;
  color: #ffffff;
}

.type__get {
  background-color: green;
}

.type__put {
  background-color: #e5c500;
}

.type__post {
  background-color: #4070ec;
}

.type__delete {
  background-color: #ed0039;
}

/* ------------------------------------------------------------------------------------------
 * Sidenav
 * ------------------------------------------------------------------------------------------ */
.sidenav {
  width: 228px;
  margin: 0;
  padding: 0 20px 20px 20px;
  position: fixed;
  top: 50px;
  left: 0;
  bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #f5f5f5;
  z-index: 10;
}

.sidenav > li > a {
  display: block;
  width: 192px;
  margin: 0;
  padding: 2px 11px;
  border: 0;
  border-left: transparent 4px solid;
  border-right: transparent 4px solid;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 400;
  font-size: 14px;
}

.sidenav > li.nav-header {
  margin-top: 8px;
  margin-bottom: 8px;
}

.sidenav > li.nav-header > a {
  padding: 5px 15px;
  border: 1px solid #e5e5e5;
  width: 190px;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 700;
  font-size: 16px;
  background-color: #ffffff;
}

.sidenav > li.active > a {
    position: relative;
    z-index: 2;
    background-color: #0088cc;
    color: #ffffff;
}

.sidenav > li.has-modifications a {
  border-right: #60d060 4px solid;
}

.sidenav > li.is-new a {
  border-left: #e5e5e5 4px solid;
}

/* ------------------------------------------------------------------------------------------
 * Side nav search
 * ------------------------------------------------------------------------------------------ */
.sidenav-search {
  width: 228px;
  left: 0px;
  position: fixed;
  padding: 16px 20px 10px 20px;
  background-color: #F5F5F5;
  z-index: 11;
}

.sidenav-search .search {
  height: 26px;
}

.search-reset {
  position: absolute;
  display: block;
  cursor: pointer;
  width: 20px;
  height: 20px;
  text-align: center;
  right: 28px;
  top: 17px;
  background-color: #fff;
}

/* ------------------------------------------------------------------------------------------
 * Compare
 * ------------------------------------------------------------------------------------------ */

ins {
  background: #60d060;
  text-decoration: none;
  color: #000000;
}

del {
  background: #f05050;
  color: #000000;
}

.label-ins {
  background-color: #60d060;
}

.label-del {
  background-color: #f05050;
  text-decoration: line-through;
}

pre.ins {
  background-color: #60d060;
}

pre.del {
  background-color: #f05050;
  text-decoration: line-through;
}

table.ins th,
table.ins td {
  background-color: #60d060;
}

table.del th,
table.del td {
  background-color: #f05050;
  text-decoration: line-through;
}

tr.ins td {
  background-color: #60d060;
}

tr.del td {
  background-color: #f05050;
  text-decoration: line-through;
}

/* ------------------------------------------------------------------------------------------
 * Spinner
 * ------------------------------------------------------------------------------------------ */

#loader {
  position: absolute;
  width: 100%;
}

#loader p {
  padding-top: 80px;
  margin-left: -4px;
}

.spinner {
  margin: 200px auto;
  width: 60px;
  height: 60px;
  position: relative;
}

.container1 > div, .container2 > div, .container3 > div {
  width: 14px;
  height: 14px;
  background-color: #0088cc;

  border-radius: 100%;
  position: absolute;
  -webkit-animation: bouncedelay 1.2s infinite ease-in-out;
  animation: bouncedelay 1.2s infinite ease-in-out;
  /* Prevent first frame from flickering when animation starts */
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

.spinner .spinner-container {
  position: absolute;
  width: 100%;
  height: 100%;
}

.container2 {
  -webkit-transform: rotateZ(45deg);
  transform: rotateZ(45deg);
}

.container3 {
  -webkit-transform: rotateZ(90deg);
  transform: rotateZ(90deg);
}

.circle1 { top: 0; left: 0; }
.circle2 { top: 0; right: 0; }
.circle3 { right: 0; bottom: 0; }
.circle4 { left: 0; bottom: 0; }

.container2 .circle1 {
  -webkit-animation-delay: -1.1s;
  animation-delay: -1.1s;
}

.container3 .circle1 {
  -webkit-animation-delay: -1.0s;
  animation-delay: -1.0s;
}

.container1 .circle2 {
  -webkit-animation-delay: -0.9s;
  animation-delay: -0.9s;
}

.container2 .circle2 {
  -webkit-animation-delay: -0.8s;
  animation-delay: -0.8s;
}

.container3 .circle2 {
  -webkit-animation-delay: -0.7s;
  animation-delay: -0.7s;
}

.container1 .circle3 {
  -webkit-animation-delay: -0.6s;
  animation-delay: -0.6s;
}

.container2 .circle3 {
  -webkit-animation-delay: -0.5s;
  animation-delay: -0.5s;
}

.container3 .circle3 {
  -webkit-animation-delay: -0.4s;
  animation-delay: -0.4s;
}

.container1 .circle4 {
  -webkit-animation-delay: -0.3s;
  animation-delay: -0.3s;
}

.container2 .circle4 {
  -webkit-animation-delay: -0.2s;
  animation-delay: -0.2s;
}

.container3 .circle4 {
  -webkit-animation-delay: -0.1s;
  animation-delay: -0.1s;
}

@-webkit-keyframes bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0.0) }
  40% { -webkit-transform: scale(1.0) }
}

@keyframes bouncedelay {
  0%, 80%, 100% {
    transform: scale(0.0);
    -webkit-transform: scale(0.0);
  } 40% {
    transform: scale(1.0);
    -webkit-transform: scale(1.0);
  }
}

/* ------------------------------------------------------------------------------------------
 * Tabs
 * ------------------------------------------------------------------------------------------ */
ul.nav-tabs {
  margin: 0;
}

p.deprecated span{
  color: #ff0000;
  font-weight: bold;
  text-decoration: underline;
}

/* ------------------------------------------------------------------------------------------
 * Print
 * ------------------------------------------------------------------------------------------ */

@media print {

  #sidenav,
  #version,
  #versions,
  section .version,
  section .versions {
    display: none;
  }

  #content {
    margin-left: 0;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  a:after {
    content: " [" attr(href) "] ";
  }

  p {
    color: #000000
  }

  pre {
    background-color: #ffffff;
    color: #000000;
    padding: 10px;
    border: #808080 1px solid;
    border-radius: 6px;
    position: relative;
    margin: 10px 0 20px 0;
  }

} /* /@media print */


================================================
FILE: public/apidoc/index.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>Loading...</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
  <link href="vendor/prism.css" rel="stylesheet" />
  <link href="css/style.css" rel="stylesheet" media="screen, print">
  <link href="img/favicon.ico" rel="icon" type="image/x-icon">
  <script src="vendor/polyfill.js"></script>
</head>
<body class="container-fluid">

<script id="template-sidenav" type="text/x-handlebars-template">
<nav id="scrollingNav">
  <div class="sidenav-search">
    <input class="form-control search" type="text" placeholder="{{__ "Filter..."}}">
    <span class="search-reset">x</span>
  </div>
  <ul class="sidenav nav nav-list list">
  {{#each nav}}
    {{#if title}}
      {{#if isHeader}}
        {{#if isFixed}}
          <li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}" data-name="show-api-{{group}}" class="show-api api-{{group}}-init">{{underscoreToSpace title}}</a></li>
        {{else}}
          <li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}" data-group="show-api-{{group}}" class="show-group api-{{group}}-init">{{underscoreToSpace title}}</a></li>
        {{/if}}
      {{else}}
        <li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
          <a href="#api-{{group}}-{{name}}" title="{{url}}" data-group="show-api-{{group}}" data-name="show-api-{{group}}-{{name}}" class="nav-list-item show-api api-{{group}}-{{name}}-init">{{title}}<div class="nav-list-url-item hide">{{url}}</div></a>
        </li>
      {{/if}}
    {{/if}}
  {{/each}}
  </ul>
</nav>
</script>

<script id="template-project" type="text/x-handlebars-template">
  <div class="pull-left">
    <h1>{{name}}</h1>
    {{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
  </div>
  <div class="pull-right">
    {{#if template.withCompare}}
    <div class="btn-group">
      <button id="version" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown">
        <strong>{{version}}</strong>&nbsp;<span class="caret"></span>
      </button>
      <ul id="versions" class="dropdown-menu open-left">
        <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
        <li class="divider"></li>
        <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
      {{#each versions}}
        <li class="version"><a href="#">{{this}}</a></li>
      {{/each}}
      </ul>
    </div>
    {{else}}
    <div id="version" class="well well-sm">
      <strong>{{version}}</strong>
    </div>
    {{/if}}
  </div>
  <div class="clearfix"></div>
</script>

<script id="template-header" type="text/x-handlebars-template">
  {{#if content}}
    <div id="api-_" class="show-api-article show-api-_-article">{{{content}}}</div>
  {{/if}}
</script>

<script id="template-footer" type="text/x-handlebars-template">
  {{#if content}}
    <div id="api-_footer" class="show-api-article show-api-_-article">{{{content}}}</div>
  {{/if}}
</script>

<script id="template-generator" type="text/x-handlebars-template">
  {{#if template.withGenerator}}
    {{#if generator}}
      <div class="content">
        {{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
      </div>
    {{/if}}
  {{/if}}
</script>

<script id="template-sections" type="text/x-handlebars-template">
  <section id="api-{{group}}" class="show-api-group show-api-{{group}}-group {{#if aloneDisplay}} hide{{/if}}">
    <h1>{{underscoreToSpace title}}</h1>
    {{#if description}}
      <p>{{{nl2br description}}}</p>
    {{/if}}
    {{#each articles}}
      <div id="api-{{group}}-{{name}}" class="show-api-article show-api-{{group}}-article show-api-{{group}}-{{name}}-article {{#if aloneDisplay}} hide{{/if}}">
        {{{article}}}
      </div>
    {{/each}}
  </section>
</script>

<script id="template-article" type="text/x-handlebars-template">
  <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
    <div class="pull-left">
      <h1>{{underscoreToSpace article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
    </div>
    {{#if template.withCompare}}
    <div class="pull-right">
      <div class="btn-group">
        <button class="version btn btn-default dropdown-toggle" data-toggle="dropdown">
          <strong>{{article.version}}</strong>&nbsp;<span class="caret"></span>
        </button>
        <ul class="versions dropdown-menu open-left">
          <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
        {{#each versions}}
          <li class="version"><a href="#">{{this}}</a></li>
        {{/each}}
        </ul>
      </div>
    </div>
    {{/if}}
    <div class="clearfix"></div>

    {{#if article.author}}<h4 class="muted">Authored by: {{article.author}}</h4>{{/if}}

    {{#if article.deprecated}}
      <p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
        {{{markdown article.deprecated.content}}}
      </p>
    {{/if}}

    {{#if article.description}}
      <p>{{{nl2br article.description}}}</p>
    {{/if}}
    <span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
    <pre data-type="{{toLowerCase article.type}}"><code class="language-http">{{article.url}}</code></pre>

    {{#if article.permission}}
      <p>
        {{__ "Permission:"}}
        {{#each article.permission}}
          {{name}}
          {{#if title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
              <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{/if}}
        {{/each}}
      </p>
    {{/if}}

    {{!-- CODE EXAMPLES IN TABS --}}
    {{#if_gt article.examples.length compare=0}}
      <ul class="nav nav-tabs nav-tabs-examples">
        {{#each article.examples}}
          <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
            <a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
          </li>
        {{/each}}
      </ul>

      <div class="tab-content">
      {{#each article.examples}}
        <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}">
          <pre data-type="{{type}}"><code class="language-{{type}}">{{content}}</code></pre>
        </div>
      {{/each}}
      </div>
    {{/if_gt}}

    {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
    {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
    {{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
    {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}

    {{subTemplate "article-sample-request" article=article id=id}}
  </article>
</script>

<script id="template-article-param-block" type="text/x-handlebars-template">
  {{#if params}}
    {{#each params.fields}}
      <h2>{{__ @key}}</h2>
      <table>
        <thead>
          <tr>
          <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
          </tr>
        </thead>
        <tbody>
        {{#each this}}
          <tr>
            <td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
            {{#if ../../_hasType}}
              <td>
                {{{type}}}
              </td>
            {{/if}}
            <td>
            {{{nl2br description}}}
            {{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
            {{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
            {{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
              {{#each allowedValues}}
                <code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
              {{/each}}
              </p>
            {{/if}}
            </td>
          </tr>
        {{/each}}
        </tbody>
      </table>
    {{/each}}
    {{#if_gt params.examples.length compare=0}}
      <ul class="nav nav-tabs nav-tabs-examples">
      {{#each params.examples}}
        <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
          <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
        </li>
      {{/each}}
      </ul>

      <div class="tab-content">
      {{#each params.examples}}
        <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
        <pre data-type="{{type}}"><code class="language-{{type}}">{{reformat content type}}</code></pre>
        </div>
      {{/each}}
      </div>
    {{/if_gt}}
  {{/if}}
</script>

<script id="template-article-sample-request" type="text/x-handlebars-template">
    {{#if article.sampleRequest}}
      <h2>{{__ "Send a Sample Request"}}</h2>
      <form class="form-horizontal">
        <fieldset>
            <div class="form-group">
              <label class="col-md-3 control-label" for="{{../id}}-sample-request-url"></label>
              <div class="input-group">
                <input id="{{../id}}-sample-request-url" type="text" class="form-control sample-request-url" value="{{article.sampleRequest.0.url}}" />
                <span class="input-group-addon">{{__ "url"}}</span>
              </div>
            </div>

      {{#if article.header}}
        {{#if article.header.fields}}
          <h3>{{__ "Headers"}}</h3>
          {{#each article.header.fields}}
            <h4><input type="checkbox" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" checked />{{__ @key}}</h4>
            <div class="{{../id}}-sample-request-header-fields">
              {{#each this}}
              <div class="form-group">
                <label class="col-md-3 control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
                <div class="input-group">
                  <input type="text" placeholder="{{field}}" value="{{defaultValue}}" id="sample-request-header-field-{{field}}" class="form-control sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
                  <span class="input-group-addon">{{{type}}}</span>
                </div>
              </div>
              {{/each}}
            </div>
          {{/each}}
        {{/if}}
      {{/if}}

      {{#if article.parameter}}
        {{#if article.parameter.fields}}
          <h3>{{__ "Parameters"}}</h3>
          {{#each article.parameter.fields}}
            <h4><input type="checkbox" data-sample-request-param-group-id="sample-request-param-{{@index}}"  name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" checked/>{{__ @key}}
              <select   name="{{../id}}-sample-header-content-type" class="{{../id}}-sample-request-param-select sample-header-content-type sample-header-content-type-switch">
                <option value="undefined"  selected>ajax-auto</option>
                <option value="body-json" >body/json</option>
                <option value="body-form-data" >body/form-data</option>
              </select>
            </h4>
            <div class="{{../id}}-sample-request-param-body {{../id}}-sample-header-content-type-body hide">
              <div class="form-group">
                <div class="input-group">
                  <textarea id="sample-request-body-json" class="form-control sample-request-body" data-sample-request-body-group="sample-request-param-{{@./index}}" rows="6" style="OVERFLOW: visible" {{#if optional}}data-sample-request-param-optional="true"{{/if}}></textarea>
                  <div class="input-group-addon">json</div>
                </div>
              </div>
            </div>
            <div class="{{../id}}-sample-request-param-fields {{../id}}-sample-header-content-type-fields">
              {{#each this}}
              <div class="form-group">
                <label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
                <div class="input-group">
                  <input id="sample-request-param-field-{{field}}" type="{{setInputType type}}" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
                  <div class="input-group-addon">{{{type}}}</div>
                </div>
              </div>
              {{/each}}
            </div>
          {{/each}}
        {{/if}}
      {{/if}}

          <div class="form-group">
            <div class="controls pull-right">
              <button class="btn btn-primary sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
            </div>
          </div>
          <div class="form-group sample-request-response" style="display: none;">
            <h3>
              {{__ "Response"}}
              <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
            </h3>
            <pre data-type="json"><code class="language-json sample-request-response-json"></code></pre>
          </div>
        </fieldset>
      </form>
    {{/if}}
</script>

<script id="template-compare-article" type="text/x-handlebars-template">
  <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
    <div class="pull-left">
      <h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
    </div>

    <div class="pull-right">
      <div class="btn-group">
        <button class="btn btn-success" disabled>
          <strong>{{article.version}}</strong> {{__ "compared to"}}
        </button>
        <button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
          <strong>{{compare.version}}</strong>&nbsp;<span class="caret"></span>
        </button>
        <ul class="versions dropdown-menu open-left">
          <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
          <li class="divider"></li>
        {{#each versions}}
          <li class="version"><a href="#">{{this}}</a></li>
        {{/each}}
        </ul>
      </div>
    </div>
    <div class="clearfix"></div>

    {{#if article.description}}
      <p>{{{showDiff article.description compare.description "nl2br"}}}</p>
    {{else}}
      {{#if compare.description}}
      <p>{{{showDiff "" compare.description "nl2br"}}}</p>
      {{/if}}
    {{/if}}

    <pre data-type="{{toLowerCase article.type}}"><code class="language-html">{{{showDiff article.url compare.url}}}</code></pre>

    {{subTemplate "article-compare-permission" article=article compare=compare}}

    <ul class="nav nav-tabs nav-tabs-examples">
    {{#each_compare_title article.examples compare.examples}}
      {{#if typeSame}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
        </li>
      {{/if}}

      {{#if typeIns}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
        </li>
      {{/if}}

      {{#if typeDel}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
        </li>
      {{/if}}
    {{/each_compare_title}}
    </ul>

    <div class="tab-content">
    {{#each_compare_title article.examples compare.examples}}

      {{#if typeSame}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{source.type}}"><code class="language-{{source.type}}">{{{showDiff source.content compare.content}}}</code></pre>
        </div>
      {{/if}}

      {{#if typeIns}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{source.type}}"><code class="language-{{source.type}}">{{{source.content}}}</code></pre>
        </div>
      {{/if}}

      {{#if typeDel}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{compare.type}}"><code class="language-{{source.type}}">{{{compare.content}}}</code></pre>
        </div>
      {{/if}}

    {{/each_compare_title}}
    </div>

    {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
    {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
    {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}

    {{subTemplate "article-sample-request" article=article id=id}}

  </article>
</script>

<script id="template-article-compare-permission" type="text/x-handlebars-template">
  <p>
  {{__ "Permission:"}}
  {{#each_compare_list_field article.permission compare.permission field="name"}}
    {{#if source}}
      {{#if typeSame}}
        {{source.name}}
        {{#if source.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}

      {{#if typeIns}}
        <ins>{{source.name}}</ins>
        {{#if source.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}

      {{#if typeDel}}
        <del>{{source.name}}</del>
        {{#if source.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}
    {{else}}
      {{#if typeSame}}
        {{compare.name}}
        {{#if compare.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}

      {{#if typeIns}}
        <ins>{{compare.name}}</ins>
        {{#if compare.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}

      {{#if typeDel}}
        <del>{{compare.name}}</del>
        {{#if compare.title}}
          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
          </button>
          {{#unless _last}}, {{/unless}}
        {{/if}}
      {{/if}}
    {{/if}}
  {{/each_compare_list_field}}
  </p>
</script>

<script id="template-article-compare-param-block" type="text/x-handlebars-template">
  {{#if source}}
    {{#each_compare_keys source.fields compare.fields}}
      {{#if typeSame}}
        <h2>{{__ source.key}}</h2>
        <table>
        <thead>
          <tr>
            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
          </tr>
        </thead>
        {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
        </table>
      {{/if}}

      {{#if typeIns}}
        <h2><ins>{{__ source.key}}</ins></h2>
        <table class="ins">
        <thead>
          <tr>
            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
          </tr>
        </thead>
        {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
        </table>
      {{/if}}

      {{#if typeDel}}
        <h2><del>{{__ compare.key}}</del></h2>
        <table class="del">
        <thead>
          <tr>
            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
          </tr>
        </thead>
        {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
        </table>
      {{/if}}
    {{/each_compare_keys}}

    {{#if source.examples}}
    <ul class="nav nav-tabs nav-tabs-examples">
    {{#each_compare_title source.examples compare.examples}}
      {{#if typeSame}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
        </li>
      {{/if}}

      {{#if typeIns}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
        </li>
      {{/if}}

      {{#if typeDel}}
        <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
          <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
        </li>
      {{/if}}
    {{/each_compare_title}}
    </ul>

    <div class="tab-content">
    {{#each_compare_title source.examples compare.examples}}

      {{#if typeSame}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{source.type}}"><code class="language-{{source.type}}">{{{showDiff source.content compare.content}}}</code></pre>
        </div>
      {{/if}}

      {{#if typeIns}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{source.type}}"><code class="language-{{source.type}}">{{{source.content}}}</code></pre>
        </div>
      {{/if}}

      {{#if typeDel}}
        <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
          <pre data-type="{{compare.type}}"><code class="language-{{source.type}}">{{{compare.content}}}</code></pre>
        </div>
      {{/if}}
    {{/each_compare_title}}
    </div>
    {{/if}}
  {{/if}}
</script>

<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
  <tbody>
    {{#each_compare_field source compare}}
      {{#if typeSame}}
        <tr>
          <td class="code">
            {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
            {{#if source.optional}}
              {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
              {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
              {{/if}}
            {{else}}
              {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
            {{/if}}
          </td>

        {{#if source.type}}
          {{#if compare.type}}
          <td>{{{showDiff source.type compare.type}}}</td>
          {{else}}
          <td>{{{source.type}}}</td>
          {{/if}}
        {{else}}
          {{#if compare.type}}
          <td>{{{compare.type}}}</td>
          {{else}}
            {{#if ../../../../_hasType}}<td></td>{{/if}}
          {{/if}}
        {{/if}}
          <td>
            {{{showDiff source.description compare.description "nl2br"}}}
            {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
          </td>
        </tr>
      {{/if}}

      {{#if typeIns}}
        <tr class="ins">
          <td class="code">
            {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
            {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
          </td>

        {{#if source.type}}
          <td>{{{source.type}}}</td>
        {{else}}
          {{{typRowTd}}}
        {{/if}}

          <td>
            {{{nl2br source.description}}}
            {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
          </td>
        </tr>
      {{/if}}

      {{#if typeDel}}
        <tr class="del">
          <td class="code">
            {{{splitFill compare.field "." "&nbsp;&nbsp;"}}}
            {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
          </td>

        {{#if compare.type}}
          <td>{{{compare.type}}}</td>
        {{else}}
          {{{typRowTd}}}
        {{/if}}

          <td>
            {{{nl2br compare.description}}}
            {{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
          </td>
        </tr>
      {{/if}}

    {{/each_compare_field}}
  </tbody>
</script>

<div class="container-fluid">
  <div class="row">
    <div id="sidenav" class="span2"></div>
    <div id="content">
      <div id="project"></div>
      <div id="header"></div>
      <div id="sections"></div>
      <div id="footer"></div>
      <div id="generator"></div>
    </div>
  </div>
</div>

<div id="loader">
  <div class="spinner">
    <div class="spinner-container container1">
      <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
    </div>
    <div class="spinner-container container2">
      <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
    </div>
    <div class="spinner-container container3">
      <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
    </div>
    <p>Loading...</p>
  </div>
</div>

<script data-main="main.js" src="vendor/require.min.js"></script>
</body>
</html>


================================================
FILE: public/apidoc/locales/ca.js
================================================
define({
    ca: {
        'Allowed values:'             : 'Valors permesos:',
        'Compare all with predecessor': 'Comparar tot amb versió anterior',
        'compare changes to:'         : 'comparar canvis amb:',
        'compared to'                 : 'comparat amb',
        'Default value:'              : 'Valor per defecte:',
        'Description'                 : 'Descripció',
        'Field'                       : 'Camp',
        'General'                     : 'General',
        'Generated with'              : 'Generat amb',
        'Name'                        : 'Nom',
        'No response values.'         : 'Sense valors en la resposta.',
        'optional'                    : 'opcional',
        'Parameter'                   : 'Paràmetre',
        'Permission:'                 : 'Permisos:',
        'Response'                    : 'Resposta',
        'Send'                        : 'Enviar',
        'Send a Sample Request'       : 'Enviar una petició d\'exemple',
        'show up to version:'         : 'mostrar versió:',
        'Size range:'                 : 'Tamany de rang:',
        'Type'                        : 'Tipus',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/cs.js
================================================
define({
    cs: {
        'Allowed values:'             : 'Povolené hodnoty:',
        'Compare all with predecessor': 'Porovnat vše s předchozími verzemi',
        'compare changes to:'         : 'porovnat změny s:',
        'compared to'                 : 'porovnat s',
        'Default value:'              : 'Výchozí hodnota:',
        'Description'                 : 'Popis',
        'Field'                       : 'Pole',
        'General'                     : 'Obecné',
        'Generated with'              : 'Vygenerováno pomocí',
        'Name'                        : 'Název',
        'No response values.'         : 'Nebyly vráceny žádné hodnoty.',
        'optional'                    : 'volitelné',
        'Parameter'                   : 'Parametr',
        'Permission:'                 : 'Oprávnění:',
        'Response'                    : 'Odpověď',
        'Send'                        : 'Odeslat',
        'Send a Sample Request'       : 'Odeslat ukázkový požadavek',
        'show up to version:'         : 'zobrazit po verzi:',
        'Size range:'                 : 'Rozsah velikosti:',
        'Type'                        : 'Typ',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/de.js
================================================
define({
    de: {
        'Allowed values:'             : 'Erlaubte Werte:',
        'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
        'compare changes to:'         : 'vergleiche Änderungen mit:',
        'compared to'                 : 'verglichen mit',
        'Default value:'              : 'Standardwert:',
        'Description'                 : 'Beschreibung',
        'Field'                       : 'Feld',
        'General'                     : 'Allgemein',
        'Generated with'              : 'Erstellt mit',
        'Name'                        : 'Name',
        'No response values.'         : 'Keine Rückgabewerte.',
        'optional'                    : 'optional',
        'Parameter'                   : 'Parameter',
        'Permission:'                 : 'Berechtigung:',
        'Response'                    : 'Antwort',
        'Send'                        : 'Senden',
        'Send a Sample Request'       : 'Eine Beispielanfrage senden',
        'show up to version:'         : 'zeige bis zur Version:',
        'Size range:'                 : 'Größenbereich:',
        'Type'                        : 'Typ',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/es.js
================================================
define({
    es: {
        'Allowed values:'             : 'Valores permitidos:',
        'Compare all with predecessor': 'Comparar todo con versión anterior',
        'compare changes to:'         : 'comparar cambios con:',
        'compared to'                 : 'comparado con',
        'Default value:'              : 'Valor por defecto:',
        'Description'                 : 'Descripción',
        'Field'                       : 'Campo',
        'General'                     : 'General',
        'Generated with'              : 'Generado con',
        'Name'                        : 'Nombre',
        'No response values.'         : 'Sin valores en la respuesta.',
        'optional'                    : 'opcional',
        'Parameter'                   : 'Parámetro',
        'Permission:'                 : 'Permisos:',
        'Response'                    : 'Respuesta',
        'Send'                        : 'Enviar',
        'Send a Sample Request'       : 'Enviar una petición de ejemplo',
        'show up to version:'         : 'mostrar a versión:',
        'Size range:'                 : 'Tamaño de rango:',
        'Type'                        : 'Tipo',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/fr.js
================================================
define({
    fr: {
        'Allowed values:'             : 'Valeurs autorisées :',
        'Compare all with predecessor': 'Tout comparer avec ...',
        'compare changes to:'         : 'comparer les changements à :',
        'compared to'                 : 'comparer à',
        'Default value:'              : 'Valeur par défaut :',
        'Description'                 : 'Description',
        'Field'                       : 'Champ',
        'General'                     : 'Général',
        'Generated with'              : 'Généré avec',
        'Name'                        : 'Nom',
        'No response values.'         : 'Aucune valeur de réponse.',
        'optional'                    : 'optionnel',
        'Parameter'                   : 'Paramètre',
        'Permission:'                 : 'Permission :',
        'Response'                    : 'Réponse',
        'Send'                        : 'Envoyer',
        'Send a Sample Request'       : 'Envoyer une requête représentative',
        'show up to version:'         : 'Montrer à partir de la version :',
        'Size range:'                 : 'Ordre de grandeur :',
        'Type'                        : 'Type',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/it.js
================================================
define({
    it: {
        'Allowed values:'             : 'Valori permessi:',
        'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
        'compare changes to:'         : 'confronta modifiche con:',
        'compared to'                 : 'confrontato con',
        'Default value:'              : 'Valore predefinito:',
        'Description'                 : 'Descrizione',
        'Field'                       : 'Campo',
        'General'                     : 'Generale',
        'Generated with'              : 'Creato con',
        'Name'                        : 'Nome',
        'No response values.'         : 'Nessun valore di risposta.',
        'optional'                    : 'opzionale',
        'Parameter'                   : 'Parametro',
        'Permission:'                 : 'Permessi:',
        'Response'                    : 'Risposta',
        'Send'                        : 'Invia',
        'Send a Sample Request'       : 'Invia una richiesta di esempio',
        'show up to version:'         : 'mostra alla versione:',
        'Size range:'                 : 'Intervallo dimensione:',
        'Type'                        : 'Tipo',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/locale.js
================================================
define([
    './locales/ca.js',
    './locales/cs.js',
    './locales/de.js',
    './locales/es.js',
    './locales/fr.js',
    './locales/it.js',
    './locales/nl.js',
    './locales/pl.js',
    './locales/pt_br.js',
    './locales/ro.js',
    './locales/ru.js',
    './locales/tr.js',
    './locales/vi.js',
    './locales/zh.js',
    './locales/zh_cn.js'
], function() {
    var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
    var language = langId.substr(0, 2);
    var locales = {};

    for (index in arguments) {
        for (property in arguments[index])
            locales[property] = arguments[index][property];
    }
    if ( ! locales['en'])
        locales['en'] = {};

    if ( ! locales[langId] && ! locales[language])
        language = 'en';

    var locale = (locales[langId] ? locales[langId] : locales[language]);

    function __(text) {
        var index = locale[text];
        if (index === undefined)
            return text;
        return index;
    };

    function setLanguage(language) {
        locale = locales[language];
    }

    return {
        __         : __,
        locales    : locales,
        locale     : locale,
        setLanguage: setLanguage
    };
});


================================================
FILE: public/apidoc/locales/nl.js
================================================
define({
    nl: {
        'Allowed values:'             : 'Toegestane waarden:',
        'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
        'compare changes to:'         : 'vergelijk veranderingen met:',
        'compared to'                 : 'vergelijk met',
        'Default value:'              : 'Standaard waarde:',
        'Description'                 : 'Omschrijving',
        'Field'                       : 'Veld',
        'General'                     : 'Algemeen',
        'Generated with'              : 'Gegenereerd met',
        'Name'                        : 'Naam',
        'No response values.'         : 'Geen response waardes.',
        'optional'                    : 'optioneel',
        'Parameter'                   : 'Parameter',
        'Permission:'                 : 'Permissie:',
        'Response'                    : 'Antwoorden',
        'Send'                        : 'Sturen',
        'Send a Sample Request'       : 'Stuur een sample aanvragen',
        'show up to version:'         : 'toon tot en met versie:',
        'Size range:'                 : 'Maatbereik:',
        'Type'                        : 'Type',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/pl.js
================================================
define({
    pl: {
        'Allowed values:'             : 'Dozwolone wartości:',
        'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
        'compare changes to:'         : 'porównaj zmiany do:',
        'compared to'                 : 'porównaj do:',
        'Default value:'              : 'Wartość domyślna:',
        'Description'                 : 'Opis',
        'Field'                       : 'Pole',
        'General'                     : 'Generalnie',
        'Generated with'              : 'Wygenerowano z',
        'Name'                        : 'Nazwa',
        'No response values.'         : 'Brak odpowiedzi.',
        'optional'                    : 'opcjonalny',
        'Parameter'                   : 'Parametr',
        'Permission:'                 : 'Uprawnienia:',
        'Response'                    : 'Odpowiedź',
        'Send'                        : 'Wyślij',
        'Send a Sample Request'       : 'Wyślij przykładowe żądanie',
        'show up to version:'         : 'pokaż do wersji:',
        'Size range:'                 : 'Zakres rozmiaru:',
        'Type'                        : 'Typ',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/pt_br.js
================================================
define({
    'pt_br': {
        'Allowed values:'             : 'Valores permitidos:',
        'Compare all with predecessor': 'Compare todos com antecessores',
        'compare changes to:'         : 'comparar alterações com:',
        'compared to'                 : 'comparado com',
        'Default value:'              : 'Valor padrão:',
        'Description'                 : 'Descrição',
        'Field'                       : 'Campo',
        'General'                     : 'Geral',
        'Generated with'              : 'Gerado com',
        'Name'                        : 'Nome',
        'No response values.'         : 'Sem valores de resposta.',
        'optional'                    : 'opcional',
        'Parameter'                   : 'Parâmetro',
        'Permission:'                 : 'Permissão:',
        'Response'                    : 'Resposta',
        'Send'                        : 'Enviar',
        'Send a Sample Request'       : 'Enviar um Exemplo de Pedido',
        'show up to version:'         : 'aparecer para a versão:',
        'Size range:'                 : 'Faixa de tamanho:',
        'Type'                        : 'Tipo',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/ro.js
================================================
define({
    ro: {
        'Allowed values:'             : 'Valori permise:',
        'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
        'compare changes to:'         : 'compară cu versiunea:',
        'compared to'                 : 'comparat cu',
        'Default value:'              : 'Valoare implicită:',
        'Description'                 : 'Descriere',
        'Field'                       : 'Câmp',
        'General'                     : 'General',
        'Generated with'              : 'Generat cu',
        'Name'                        : 'Nume',
        'No response values.'         : 'Nici o valoare returnată.',
        'optional'                    : 'opțional',
        'Parameter'                   : 'Parametru',
        'Permission:'                 : 'Permisiune:',
        'Response'                    : 'Răspuns',
        'Send'                        : 'Trimite',
        'Send a Sample Request'       : 'Trimite o cerere de probă',
        'show up to version:'         : 'arată până la versiunea:',
        'Size range:'                 : 'Interval permis:',
        'Type'                        : 'Tip',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/ru.js
================================================
define({
    ru: {
        'Allowed values:'             : 'Допустимые значения:',
        'Compare all with predecessor': 'Сравнить с предыдущей версией',
        'compare changes to:'         : 'сравнить с:',
        'compared to'                 : 'в сравнении с',
        'Default value:'              : 'По умолчанию:',
        'Description'                 : 'Описание',
        'Field'                       : 'Название',
        'General'                     : 'Общая информация',
        'Generated with'              : 'Сгенерировано с помощью',
        'Name'                        : 'Название',
        'No response values.'         : 'Нет значений для ответа.',
        'optional'                    : 'необязательный',
        'Parameter'                   : 'Параметр',
        'Permission:'                 : 'Разрешено:',
        'Response'                    : 'Ответ',
        'Send'                        : 'Отправить',
        'Send a Sample Request'       : 'Отправить тестовый запрос',
        'show up to version:'         : 'показать версию:',
        'Size range:'                 : 'Ограничения:',
        'Type'                        : 'Тип',
        'url'                         : 'URL'
    }
});


================================================
FILE: public/apidoc/locales/tr.js
================================================
define({
    tr: {
        'Allowed values:'             : 'İzin verilen değerler:',
        'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
        'compare changes to:'         : 'değişiklikleri karşılaştır:',
        'compared to'                 : 'karşılaştır',
        'Default value:'              : 'Varsayılan değer:',
        'Description'                 : 'Açıklama',
        'Field'                       : 'Alan',
        'General'                     : 'Genel',
        'Generated with'              : 'Oluşturan',
        'Name'                        : 'İsim',
        'No response values.'         : 'Dönüş verisi yok.',
        'optional'                    : 'opsiyonel',
        'Parameter'                   : 'Parametre',
        'Permission:'                 : 'İzin:',
        'Response'                    : 'Dönüş',
        'Send'                        : 'Gönder',
        'Send a Sample Request'       : 'Örnek istek gönder',
        'show up to version:'         : 'bu versiyona kadar göster:',
        'Size range:'                 : 'Boyut aralığı:',
        'Type'                        : 'Tip',
        'url'                         : 'url'
    }
});


================================================
FILE: public/apidoc/locales/vi.js
================================================
define({
    vi: {
        'Allowed values:'             : 'Giá trị chấp nhận:',
        'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
        'compare changes to:'         : 'so sánh sự thay đổi với:',
        'compared to'                 : 'so sánh với',
        'Default value:'              : 'Giá trị mặc định:',
        'Description'                 : 'Chú thích',
        'Field'                       : 'Trường dữ liệu',
        'General'                     : 'Tổng quan',
        'Generated with'              : 'Được tạo bởi',
        'Name'                        : 'Tên',
        'No response values.'         : 'Không có kết quả trả về.',
        'optional'                    : 'Tùy chọn',
        'Parameter'                   : 'Tham số',
        'Permission:'                 : 'Quyền hạn:',
        'Response'                    : 'Kết quả',
        'Send'                        : 'Gửi',
        'Send a Sample Request'       : 'Gửi một yêu cầu mẫu',
        'show up to version:'         : 'hiển thị phiên bản:',
        'Size range:'                 : 'Kích cỡ:',
        'Type'                        : 'Kiểu',
        'url'                         : 'liên kết'
    }
});


================================================
FILE: public/apidoc/locales/zh.js
================================================
define({
    zh: {
        'Allowed values​​:'             : '允許值:',
        'Compare all with predecessor': '預先比較所有',
        'compare changes to:'         : '比較變更:',
        'compared to'                 : '對比',
        'Default value:'              : '預設值:',
        'Description'                 : '描述',
        'Field'                       : '欄位',
        'General'                     : '概括',
        'Generated with'              : '生成工具',
        'Name'                        : '名稱',
        'No response values​​.'         : '無對應資料.',
        'optional'                    : '選填',
        'Parameter'                   : '參數',
        'Permission:'                 : '權限:',
        'Response'                    : '回應',
        'Send'                        : '發送',
        'Send a Sample Request'       : '發送試用需求',
        'show up to version:'         : '顯示到版本:',
        'Size range:'                 : '區間:',
        'Type'                        : '類型',
        'url'                         : '網址'
    }
});


================================================
FILE: public/apidoc/locales/zh_cn.js
================================================
define({
    'zh_cn': {
        'Allowed values:'             : '允许值:',
        'Compare all with predecessor': '与所有较早的比较',
        'compare changes to:'         : '将当前版本与指定版本比较:',
        'compared to'                 : '相比于',
        'Default value:'              : '默认值:',
        'Description'                 : '描述',
        'Field'                       : '字段',
        'General'                     : '概要',
        'Generated with'              : '基于',
        'Name'                        : '名称',
        'No response values.'         : '无返回值.',
        'optional'                    : '可选',
        'Parameter'                   : '参数',
        'Parameters'                  : '参数',
        'Headers'                     : '头部参数',
        'Permission:'                 : '权限:',
        'Response'                    : '返回',
        'Send'                        : '发送',
        'Send a Sample Request'       : '发送示例请求',
        'show up to version:'         : '显示到指定版本:',
        'Size range:'                 : '取值范围:',
        'Type'                        : '类型',
        'url'                         : '网址'
    }
});


================================================
FILE: public/apidoc/main.js
================================================
require.config({
    paths: {
        bootstrap: './vendor/bootstrap.min',
        diffMatchPatch: './vendor/diff_match_patch.min',
        handlebars: './vendor/handlebars.min',
        handlebarsExtended: './utils/handlebars_helper',
        jquery: './vendor/jquery.min',
        locales: './locales/locale',
        lodash: './vendor/lodash.custom.min',
        pathToRegexp: './vendor/path-to-regexp/index',
        prismjs: './vendor/prism',
        semver: './vendor/semver.min',
        utilsSampleRequest: './utils/send_sample_request',
        webfontloader: './vendor/webfontloader',
        list: './vendor/list.min',
        apiData: './api_data',
        apiProject: './api_project',
    },
    shim: {
        bootstrap: {
            deps: ['jquery']
        },
        diffMatchPatch: {
            exports: 'diff_match_patch'
        },
        handlebars: {
            exports: 'Handlebars'
        },
        handlebarsExtended: {
            deps: ['jquery', 'handlebars'],
            exports: 'Handlebars'
        },
        prismjs: {
            exports: 'Prism'
        },
    },
    urlArgs: 'v=' + (new Date()).getTime(),
    waitSeconds: 150
});

require([
    'jquery',
    'lodash',
    'locales',
    'handlebarsExtended',
    'apiProject',
    'apiData',
    'prismjs',
    'utilsSampleRequest',
    'semver',
    'webfontloader',
    'bootstrap',
    'pathToRegexp',
    'list'
], function($, _, locale, Handlebars, apiProject, apiData, Prism, sampleRequest, semver, WebFont) {

    // Load google web fonts.
    WebFont.load({
        active: function() {
            // Only init after fonts are loaded.
            init($, _, locale, Handlebars, apiProject, apiData, Prism, sampleRequest, semver);
        },
        inactive: function() {
            // Run init, even if loading fonts fails
            init($, _, locale, Handlebars, apiProject, apiData, Prism, sampleRequest, semver);
        },
        google: {
            families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7']
        }
    });
});

function init($, _, locale, Handlebars, apiProject, apiData, Prism, sampleRequest, semver) {
    var api = apiData.api;

    //
    // Templates
    //
    var templateHeader         = Handlebars.compile( $('#template-header').html() );
    var templateFooter         = Handlebars.compile( $('#template-footer').html() );
    var templateArticle        = Handlebars.compile( $('#template-article').html() );
    var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() );
    var templateGenerator      = Handlebars.compile( $('#template-generator').html() );
    var templateProject        = Handlebars.compile( $('#template-project').html() );
    var templateSections       = Handlebars.compile( $('#template-sections').html() );
    var templateSidenav        = Handlebars.compile( $('#template-sidenav').html() );

    //
    // apiProject defaults
    //
    if ( ! apiProject.template)
        apiProject.template = {};

    if (apiProject.template.withCompare == null)
        apiProject.template.withCompare = true;

    if (apiProject.template.withGenerator == null)
        apiProject.template.withGenerator = true;

    if (apiProject.template.forceLanguage)
        locale.setLanguage(apiProject.template.forceLanguage);

    if (apiProject.template.aloneDisplay == null)
        apiProject.template.aloneDisplay = false;

    // Setup jQuery Ajax
    $.ajaxSetup(apiProject.template.jQueryAjaxSetup);

    //
    // Data transform
    //
    // grouped by group
    var apiByGroup = _.groupBy(api, function(entry) {
        return entry.group;
    });

    // grouped by group and name
    var apiByGroupAndName = {};
    $.each(apiByGroup, function(index, entries) {
        apiByGroupAndName[index] = _.groupBy(entries, function(entry) {
            return entry.name;
        });
    });

    //
    // sort api within a group by title ASC and custom order
    //
    var newList = [];
    var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0
    $.each (apiByGroupAndName, function(index, groupEntries) {
        // get titles from the first entry of group[].name[] (name has versioning)
        var titles = [];
        $.each (groupEntries, function(titleName, entries) {
            var title = entries[0].title;
            if(title !== undefined) {
                title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; });
                titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting
            }
        });
        // sort by name ASC
        titles.sort();

        // custom order
        if (apiProject.order)
            titles = sortByOrder(titles, apiProject.order, '#~#');

        // add single elements to the new list
        titles.forEach(function(name) {
            var values = name.split('#~#');
            var key = values[1];
            groupEntries[key].forEach(function(entry) {
                newList.push(entry);
            });
        });
    });
    // api overwrite with ordered list
    api = newList;

    //
    // Group- and Versionlists
    //
    var apiGroups = {};
    var apiGroupTitles = {};
    var apiVersions = {};
    apiVersions[apiProject.version] = 1;

    $.each(api, function(index, entry) {
        apiGroups[entry.group] = 1;
        apiGroupTitles[entry.group] = entry.groupTitle || entry.group;
        apiVersions[entry.version] = 1;
    });

    // sort groups
    apiGroups = Object.keys(apiGroups);
    apiGroups.sort();

    // custom order
    if (apiProject.order)
        apiGroups = sortByOrder(apiGroups, apiProject.order);

    // sort versions DESC
    apiVersions = Object.keys(apiVersions);
    apiVersions.sort(semver.compare);
    apiVersions.reverse();

    //
    // create Navigationlist
    //
    var nav = [];
    apiGroups.forEach(function(group) {
        // Mainmenu entry
        nav.push({
            group: group,
            isHeader: true,
            title: apiGroupTitles[group]
        });

        // Submenu
        var oldName = '';
        api.forEach(function(entry) {
            if (entry.group === group) {
                if (oldName !== entry.name) {
                    nav.push({
                        title: entry.title,
                        group: group,
                        name: entry.name,
                        type: entry.type,
                        version: entry.version,
                        url: entry.url
                    });
                } else {
                    nav.push({
                        title: entry.title,
                        group: group,
                        hidden: true,
                        name: entry.name,
                        type: entry.type,
                        version: entry.version,
                        url: entry.url
                    });
                }
                oldName = entry.name;
            }
        });
    });

    /**
     * Add navigation items by analyzing the HTML content and searching for h1 and h2 tags
     * @param nav Object the navigation array
     * @param content string the compiled HTML content
     * @param index where to insert items
     * @return boolean true if any good-looking (i.e. with a group identifier) <h1> tag was found
     */
    function add_nav(nav, content, index) {
        var found_level1 = false;
        if ( ! content) {
          return found_level1;
        }
        var topics = content.match(/<h(1|2).*?>(.+?)<\/h(1|2)>/gi);
        if ( topics ) {
          topics.forEach(function(entry) {
              var level = entry.substring(2,3);
              var title = entry.replace(/<.+?>/g, '');    // Remove all HTML tags for the title
              var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/);    // Find the group and name in the id property
              var group = (entry_tags ? entry_tags[1] : null);
              var name = (entry_tags ? entry_tags[2] : null);
              if (level==1 && title && group)  {
                  nav.splice(index, 0, {
                      group: group,
                      isHeader: true,
                      title: title,
                      isFixed: true
                  });
                  index++;
                  found_level1 = true;
              }
              if (level==2 && title && group && name)    {
                  nav.splice(index, 0, {
                      group: group,
                      name: name,
                      isHeader: false,
                      title: title,
                      isFixed: false,
                      version: '1.0'
                  });
                  index++;
              }
          });
        }
        return found_level1;
    }

    // Mainmenu Header entry
    if (apiProject.header) {
        var found_level1 = add_nav(nav, apiProject.header.content, 0); // Add level 1 and 2 titles
        if (!found_level1) {    // If no Level 1 tags were found, make a title
            nav.unshift({
                group: '_',
                isHeader: true,
                title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title,
                isFixed: true
            });
        }
    }

    // Mainmenu Footer entry
    if (apiProject.footer) {
        var last_nav_index = nav.length;
        var found_level1 = add_nav(nav, apiProject.footer.content, nav.length); // Add level 1 and 2 titles
        if (!found_level1 && apiProject.footer.title != null) {    // If no Level 1 tags were found, make a title
            nav.splice(last_nav_index, 0, {
                group: '_footer',
                isHeader: true,
                title: apiProject.footer.title,
                isFixed: true
            });
        }
    }

    // render pagetitle
    var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version;
    $(document).attr('title', title);

    // remove loader
    $('#loader').remove();

    // render sidenav
    var fields = {
        nav: nav
    };
    $('#sidenav').append( templateSidenav(fields) );

    // render Generator
    $('#generator').append( templateGenerator(apiProject) );

    // render Project
    _.extend(apiProject, { versions: apiVersions});
    $('#project').append( templateProject(apiProject) );

    // render apiDoc, header/footer documentation
    if (apiProject.header)
        $('#header').append( templateHeader(apiProject.header) );

    if (apiProject.footer)
        $('#footer').append( templateFooter(apiProject.footer) );

    //
    // Render Sections and Articles
    //
    var articleVersions = {};
    var content = '';
    apiGroups.forEach(function(groupEntry) {
        var articles = [];
        var oldName = '';
        var fields = {};
        var title = groupEntry;
        var description = '';
        articleVersions[groupEntry] = {};

        // render all articles of a group
        api.forEach(function(entry) {
            if(groupEntry === entry.group) {
                if (oldName !== entry.name) {
                    // determine versions
                    api.forEach(function(versionEntry) {
                        if (groupEntry === versionEntry.group && entry.name === versionEntry.name) {
                            if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) {
                                articleVersions[entry.group][entry.name] = [];
                            }
                            articleVersions[entry.group][entry.name].push(versionEntry.version);
                        }
                    });
                    fields = {
                        article: entry,
                        versions: articleVersions[entry.group][entry.name]
                    };
                } else {
                    fields = {
                        article: entry,
                        hidden: true,
                        versions: articleVersions[entry.group][entry.name]
                    };
                }

                // add prefix URL for endpoint unless it's already absolute
                if (apiProject.url) {
                    if (fields.article.url.substr(0, 4).toLowerCase() !== 'http') {
                        fields.article.url = apiProject.url + fields.article.url;
                    }
                }

                addArticleSettings(fields, entry);

                if (entry.groupTitle)
                    title = entry.groupTitle;

                // TODO: make groupDescription compareable with older versions (not important for the moment)
                if (entry.groupDescription)
                    description = entry.groupDescription;

                articles.push({
                    article: templateArticle(fields),
                    group: entry.group,
                    name: entry.name,
                    aloneDisplay: apiProject.template.aloneDisplay
                });
                oldName = entry.name;
            }
        });

        // render Section with Articles
        var fields = {
            group: groupEntry,
            title: title,
            description: description,
            articles: articles,
            aloneDisplay: apiProject.template.aloneDisplay
        };
        content += templateSections(fields);
    });
    $('#sections').
Download .txt
gitextract__blxwpvx/

├── .dockerignore
├── .github/
│   └── workflows/
│       ├── main.yml
│       └── test.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── Procfile
├── README.md
├── app.js
├── app.json
├── bin/
│   └── www
├── docker-compose.yml
├── helpers/
│   ├── bookingcreator.js
│   ├── parser.js
│   ├── validationrules.js
│   └── validator.js
├── models/
│   └── booking.js
├── package.json
├── public/
│   ├── apidoc/
│   │   ├── api_data.js
│   │   ├── api_data.json
│   │   ├── api_project.js
│   │   ├── api_project.json
│   │   ├── css/
│   │   │   └── style.css
│   │   ├── index.html
│   │   ├── locales/
│   │   │   ├── ca.js
│   │   │   ├── cs.js
│   │   │   ├── de.js
│   │   │   ├── es.js
│   │   │   ├── fr.js
│   │   │   ├── it.js
│   │   │   ├── locale.js
│   │   │   ├── nl.js
│   │   │   ├── pl.js
│   │   │   ├── pt_br.js
│   │   │   ├── ro.js
│   │   │   ├── ru.js
│   │   │   ├── tr.js
│   │   │   ├── vi.js
│   │   │   ├── zh.js
│   │   │   └── zh_cn.js
│   │   ├── main.js
│   │   ├── utils/
│   │   │   ├── handlebars_helper.js
│   │   │   ├── send_sample_request.js
│   │   │   └── send_sample_request_utils.js
│   │   └── vendor/
│   │       ├── path-to-regexp/
│   │       │   ├── LICENSE
│   │       │   └── index.js
│   │       ├── polyfill.js
│   │       ├── prettify/
│   │       │   ├── lang-Splus.js
│   │       │   ├── lang-aea.js
│   │       │   ├── lang-agc.js
│   │       │   ├── lang-apollo.js
│   │       │   ├── lang-basic.js
│   │       │   ├── lang-cbm.js
│   │       │   ├── lang-cl.js
│   │       │   ├── lang-clj.js
│   │       │   ├── lang-css.js
│   │       │   ├── lang-dart.js
│   │       │   ├── lang-el.js
│   │       │   ├── lang-erl.js
│   │       │   ├── lang-erlang.js
│   │       │   ├── lang-fs.js
│   │       │   ├── lang-go.js
│   │       │   ├── lang-hs.js
│   │       │   ├── lang-lasso.js
│   │       │   ├── lang-lassoscript.js
│   │       │   ├── lang-latex.js
│   │       │   ├── lang-lgt.js
│   │       │   ├── lang-lisp.js
│   │       │   ├── lang-ll.js
│   │       │   ├── lang-llvm.js
│   │       │   ├── lang-logtalk.js
│   │       │   ├── lang-ls.js
│   │       │   ├── lang-lsp.js
│   │       │   ├── lang-lua.js
│   │       │   ├── lang-matlab.js
│   │       │   ├── lang-ml.js
│   │       │   ├── lang-mumps.js
│   │       │   ├── lang-n.js
│   │       │   ├── lang-nemerle.js
│   │       │   ├── lang-pascal.js
│   │       │   ├── lang-proto.js
│   │       │   ├── lang-r.js
│   │       │   ├── lang-rd.js
│   │       │   ├── lang-rkt.js
│   │       │   ├── lang-rust.js
│   │       │   ├── lang-s.js
│   │       │   ├── lang-scala.js
│   │       │   ├── lang-scm.js
│   │       │   ├── lang-sql.js
│   │       │   ├── lang-ss.js
│   │       │   ├── lang-swift.js
│   │       │   ├── lang-tcl.js
│   │       │   ├── lang-tex.js
│   │       │   ├── lang-vb.js
│   │       │   ├── lang-vbs.js
│   │       │   ├── lang-vhd.js
│   │       │   ├── lang-vhdl.js
│   │       │   ├── lang-wiki.js
│   │       │   ├── lang-xq.js
│   │       │   ├── lang-xquery.js
│   │       │   ├── lang-yaml.js
│   │       │   ├── lang-yml.js
│   │       │   ├── prettify.css
│   │       │   ├── prettify.js
│   │       │   └── run_prettify.js
│   │       ├── prettify.css
│   │       ├── prism.css
│   │       ├── prism.js
│   │       └── webfontloader.js
│   └── index.html
├── routes/
│   ├── apidoc.json
│   └── index.js
└── tests/
    └── spec.js
Download .txt
SYMBOL INDEX (121 symbols across 10 files)

FILE: public/apidoc/locales/locale.js
  function __ (line 34) | function __(text) {
  function setLanguage (line 41) | function setLanguage(language) {

FILE: public/apidoc/main.js
  function init (line 73) | function init($, _, locale, Handlebars, apiProject, apiData, Prism, samp...

FILE: public/apidoc/utils/handlebars_helper.js
  function _handlebarsNewlineToBreak (line 157) | function _handlebarsNewlineToBreak(text) {
  function _handlebarsEachCompared (line 269) | function _handlebarsEachCompared(fieldname, source, compare, options)
  function stripHtml (line 368) | function stripHtml(html){

FILE: public/apidoc/utils/send_sample_request.js
  function sendSampleRequest (line 31) | function sendSampleRequest(group, name, version, type)
  function clearSampleRequest (line 201) | function clearSampleRequest(group, name, version)
  function refreshScrollSpy (line 221) | function refreshScrollSpy()
  function escapeHtml (line 228) | function escapeHtml(str) {
  function isJson (line 238) | function isJson(str) {
  function encodeSearchParams (line 256) | function encodeSearchParams(obj) {

FILE: public/apidoc/utils/send_sample_request_utils.js
  function handleNestedFields (line 10) | function handleNestedFields(object, key, params, paramType) {
  function handleNestedFieldsForAllParams (line 26) | function handleNestedFieldsForAllParams(param, paramType) {
  function handleArraysAndObjectFields (line 34) | function handleArraysAndObjectFields(param, paramType) {
  function tryParsingAsType (line 46) | function tryParsingAsType(object, path, type) {
  function handleNestedAndParsingFields (line 68) | function handleNestedAndParsingFields(param, paramType) {
  function tryParsingWithTypes (line 74) | function tryParsingWithTypes(param, paramType) {
  function convertPathParams (line 83) | function convertPathParams(url) {
  function setLogger (line 87) | function setLogger(logger) {

FILE: public/apidoc/vendor/path-to-regexp/index.js
  function escapeGroup (line 35) | function escapeGroup (group) {
  function attachKeys (line 46) | function attachKeys (re, keys) {
  function flags (line 57) | function flags (options) {
  function regexpToRegexp (line 68) | function regexpToRegexp (path, keys) {
  function arrayToRegexp (line 94) | function arrayToRegexp (path, keys, options) {
  function replacePath (line 112) | function replacePath (path, keys) {
  function pathToRegexp (line 164) | function pathToRegexp (path, keys, options) {

FILE: public/apidoc/vendor/prettify/prettify.js
  function T (line 18) | function T(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var...
  function U (line 22) | function U(a,d){function f(a){var c=a.nodeType;if(1==c){if(!b.test(a.cla...
  function J (line 23) | function J(a,d,f,b,v){f&&(a={h:a,l:1,j:null,m:null,a:f,c:null,i:d,g:null...
  function V (line 23) | function V(a){for(var d=void 0,f=a.firstChild;f;f=f.nextSibling)var b=f....
  function G (line 23) | function G(a,d){function f(a){for(var l=a.i,m=a.h,c=[l,"pln"],p=0,w=a.a....
  function y (line 25) | function y(a){var d=[],f=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\...
  function L (line 29) | function L(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!A.test(a.clas...
  function t (line 31) | function t(a,d){for(var f=d.length;0<=--f;){var b=d[f];I.hasOwnProperty(...
  function K (line 31) | function K(a,d){a&&I.hasOwnProperty(a)||(a=/^\s*</.test(d)?
  function M (line 32) | function M(a){var d=a.j;try{var f=U(a.h,a.l),b=f.a;a.a=b;a.c=f.c;a.i=0;K...
  function f (line 43) | function f(){for(var b=E.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity...

FILE: public/apidoc/vendor/prettify/run_prettify.js
  function ba (line 31) | function ba(g){function k(){try{M.doScroll("left")}catch(g){t.setTimeout...
  function U (line 32) | function U(){V&&ba(function(){var g=N.length;ca(g?function(){for(var k=0...
  function k (line 34) | function k(q){if(q!==z){var t=A.createElement("link");t.rel="stylesheet"...
  function k (line 35) | function k(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var...
  function q (line 39) | function q(a,d){function f(a){var c=a.nodeType;if(1==c){if(!b.test(a.cla...
  function t (line 40) | function t(a,d,f,b,g){f&&(a={h:a,l:1,j:null,m:null,a:f,c:null,i:d,g:null...
  function A (line 40) | function A(a){for(var d=void 0,f=a.firstChild;f;f=f.nextSibling)var b=f....
  function C (line 41) | function C(a,d){function f(a){for(var m=a.i,k=a.h,c=[m,"pln"],r=0,W=a.a....
  function x (line 42) | function x(a){var d=[],f=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\...
  function B (line 46) | function B(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!k.test(a.clas...
  function p (line 48) | function p(a,d){for(var f=d.length;0<=--f;){var b=d[f];X.hasOwnProperty(...
  function F (line 48) | function F(a,d){a&&X.hasOwnProperty(a)||(a=/^\s*</.test(d)?
  function H (line 49) | function H(a){var d=a.j;try{var f=q(a.h,a.l),b=f.a;a.a=b;a.c=f.c;a.i=0;F...
  function f (line 60) | function f(){for(var b=R.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity...

FILE: public/apidoc/vendor/prism.js
  function o (line 3) | function o(e){l.highlightedCode=e,M.hooks.run("before-insert",l),l.eleme...
  function W (line 3) | function W(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=...
  function i (line 3) | function i(){var e={value:null,prev:null,next:null},n={value:null,prev:e...
  function I (line 3) | function I(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a...
  function z (line 3) | function z(e,n,t){for(var r=n.next,a=0;a<t&&r!==e.tail;a++)r=r.next;(n.n...
  function t (line 3) | function t(){M.manual||M.highlightAll()}
  function a (line 8) | function a(e,s){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+...
  function t (line 8) | function t(e,n,s){return RegExp(a(e,n),s||"")}
  function e (line 8) | function e(e,n){for(var s=0;s<n;s++)e=e.replace(/<<self>>/g,function(){r...
  function l (line 8) | function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}
  function U (line 8) | function U(e,n){return{interpolation:{pattern:t("((?:^|[^{])(?:\\{\\{)*)...

FILE: public/apidoc/vendor/webfontloader.js
  function aa (line 2) | function aa(a,b,d){return a.call.apply(a.bind,arguments)}
  function ba (line 2) | function ba(a,b,d){if(!a)throw Error();if(2<arguments.length){var c=Arra...
  function p (line 2) | function p(a,b,d){p=Function.prototype.bind&&-1!=Function.prototype.bind...
  function ca (line 2) | function ca(a,b){this.a=a;this.m=b||a;this.c=this.m.document}
  function t (line 2) | function t(a,b,d,c){b=a.c.createElement(b);if(d)for(var e in d)d.hasOwnP...
  function u (line 2) | function u(a,b,d){a=a.c.getElementsByTagName(b)[0];a||(a=document.docume...
  function v (line 2) | function v(a){a.parentNode&&a.parentNode.removeChild(a)}
  function w (line 3) | function w(a,b,d){b=b||[];d=d||[];for(var c=a.className.split(/\s+/),e=0...
  function y (line 3) | function y(a,b){for(var d=a.className.split(/\s+/),c=0,e=d.length;c<e;c+...
  function z (line 4) | function z(a){if("string"===typeof a.f)return a.f;var b=a.m.location.pro...
  function ea (line 4) | function ea(a){return a.m.location.hostname||a.a.location.hostname}
  function A (line 5) | function A(a,b,d){function c(){k&&e&&f&&(k(g),k=null)}b=t(a,"link",{rel:...
  function B (line 6) | function B(a,b,d,c){var e=a.c.getElementsByTagName("head")[0];if(e){var ...
  function C (line 6) | function C(){this.a=0;this.c=null}
  function D (line 6) | function D(a){a.a++;return function(){a.a--;E(a)}}
  function F (line 6) | function F(a,b){a.c=b;E(a)}
  function E (line 6) | function E(a){0==a.a&&a.c&&(a.c(),a.c=null)}
  function G (line 6) | function G(a){this.a=a||"-"}
  function H (line 6) | function H(a,b){this.c=a;this.f=4;this.a="n";var d=(b||"n4").match(/^([n...
  function fa (line 6) | function fa(a){return I(a)+" "+(a.f+"00")+" 300px "+J(a.c)}
  function J (line 6) | function J(a){var b=[];a=a.split(/,\s*/);for(var d=0;d<a.length;d++){var...
  function K (line 6) | function K(a){return a.a+a.f}
  function I (line 6) | function I(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic...
  function ga (line 7) | function ga(a){var b=4,d="n",c=null;a&&((c=a.match(/(normal|oblique|ital...
  function ha (line 7) | function ha(a,b){this.c=a;this.f=a.m.document.documentElement;this.h=b;t...
  function ia (line 7) | function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);L(a,"loading")}
  function M (line 7) | function M(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),d=[],c=[a.a.c("w...
  function L (line 7) | function L(a,b,d){if(a.j&&a.h[b])if(d)a.h[b](d.c,K(d));else a.h[b]()}
  function ja (line 7) | function ja(){this.c={}}
  function ka (line 7) | function ka(a,b,d){var c=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a...
  function N (line 7) | function N(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":...
  function O (line 7) | function O(a){u(a.c,"body",a.a)}
  function P (line 7) | function P(a){return"display:block;position:absolute;top:-9999px;left:-9...
  function Q (line 7) | function Q(a,b,d,c,e,f){this.g=a;this.j=b;this.a=c;this.c=d;this.f=e||3E...
  function k (line 7) | function k(){q()-d>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1...
  function R (line 7) | function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||...
  function U (line 8) | function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.ex...
  function ma (line 9) | function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&...
  function la (line 9) | function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f....
  function na (line 9) | function na(a){setTimeout(p(function(){la(this)},a),50)}
  function V (line 9) | function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j...
  function W (line 9) | function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}
  function oa (line 10) | function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active...
  function pa (line 10) | function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}
  function ra (line 11) | function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){...
  function qa (line 12) | function qa(a,b,d){var c=[],e=d.timeout;ia(b);var c=ka(a.a,d,a.c),f=new ...
  function sa (line 12) | function sa(a,b){this.c=a;this.a=b}
  function ta (line 12) | function ta(a,b,d){var c=z(a.c);a=(a.a.api||"fast.fonts.net/jsapi").repl...
  function b (line 13) | function b(){if(e["__mti_fntLst"+d]){var c=e["__mti_fntLst"+d](),g=[],k;...
  function ua (line 13) | function ua(a,b){this.c=a;this.a=b}
  function va (line 13) | function va(a,b,d){a?this.c=a:this.c=b+wa;this.a=[];this.f=[];this.g=d||""}
  function xa (line 13) | function xa(a,b){for(var d=b.length,c=0;c<d;c++){var e=b[c].split(":");3...
  function ya (line 14) | function ya(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=...
  function za (line 14) | function za(a){this.f=a;this.a=[];this.c={}}
  function Ea (line 16) | function Ea(a){for(var b=a.f.length,d=0;d<b;d++){var c=a.f[d].split(":")...
  function Fa (line 17) | function Fa(a,b){this.c=a;this.a=b}
  function Ha (line 17) | function Ha(a,b){this.c=a;this.a=b}
  function Ia (line 17) | function Ia(a,b){this.c=a;this.f=b;this.a=[]}
Condensed preview — 113 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (569K chars).
[
  {
    "path": ".dockerignore",
    "chars": 30,
    "preview": "node-modules/\n.git/\n.gitignore"
  },
  {
    "path": ".github/workflows/main.yml",
    "chars": 639,
    "preview": "name: Deploy\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\njobs:\n  build:\n    runs"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 374,
    "preview": "name: UnitTests\n\non: [push]\n\njobs:\n  build:\n\n    runs-on: ubuntu-latest\n\n    strategy:\n      matrix:\n        node-versio"
  },
  {
    "path": ".gitignore",
    "chars": 57,
    "preview": "**/node_modules\n**/.DS_Store\n.vscode/\nnpm-debug.log\n.idea"
  },
  {
    "path": "Dockerfile",
    "chars": 138,
    "preview": "FROM node:22\n\n# Copy restful-booker across\nRUN mkdir /restful-booker\n\nWORKDIR /restful-booker\n\nCOPY ./ ./\n\nRUN npm insta"
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "Procfile",
    "chars": 15,
    "preview": "web: npm start\n"
  },
  {
    "path": "README.md",
    "chars": 679,
    "preview": "# restful-booker\nA simple Node booking form for testing RESTful web services.\n\n# Requirements\n- Docker 17.09.0\n- Docker "
  },
  {
    "path": "app.js",
    "chars": 1073,
    "preview": "const express = require('express');\nconst path = require('path');\nconst logger = require('morgan');\nconst cookieParser ="
  },
  {
    "path": "app.json",
    "chars": 144,
    "preview": "{\n  \"name\": \"restful-booker\",\n  \"description\": \"An API for practising your testing skills against\",\n  \"image\": \"mwinteri"
  },
  {
    "path": "bin/www",
    "chars": 1626,
    "preview": "#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\nconst app = require('../app');\nconst debug = require('debug')('rest"
  },
  {
    "path": "docker-compose.yml",
    "chars": 86,
    "preview": "version: '2'\nservices:\n  restful-booker:\n    build: ./\n    ports:\n      - \"3001:3001\"\n"
  },
  {
    "path": "helpers/bookingcreator.js",
    "chars": 1434,
    "preview": "date = require('date-and-time');\n\nconst randomiseDate = function (start, end) {\n  return new Date(start.getTime() + Math"
  },
  {
    "path": "helpers/parser.js",
    "chars": 2469,
    "preview": "const js2xmlparser = require(\"js2xmlparser\"),\n    formurlencoded = require('form-urlencoded').default,\n    date = requir"
  },
  {
    "path": "helpers/validationrules.js",
    "chars": 316,
    "preview": "exports.returnRuleSet = function(){\n  const constraints = {\n    firstname: {presence: true},\n    lastname: {presence: tr"
  },
  {
    "path": "helpers/validator.js",
    "chars": 375,
    "preview": "const rules = require('../helpers/validationrules'),\n    validate = require('validate.js');\n\nexports.scrubAndValidate = "
  },
  {
    "path": "models/booking.js",
    "chars": 1521,
    "preview": "const loki = require('lokijs');\n\nlet counter = 0;\nconst db = new loki('booking.db');\nconst booking = db.addCollection('b"
  },
  {
    "path": "package.json",
    "chars": 769,
    "preview": "{\n  \"name\": \"restful-booker\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"cross-env SEED=true "
  },
  {
    "path": "public/apidoc/api_data.js",
    "chars": 37309,
    "preview": "define({ \"api\": [\n  {\n    \"type\": \"post\",\n    \"url\": \"auth\",\n    \"title\": \"CreateToken\",\n    \"name\": \"CreateToken\",\n    "
  },
  {
    "path": "public/apidoc/api_data.json",
    "chars": 37289,
    "preview": "[\n  {\n    \"type\": \"post\",\n    \"url\": \"auth\",\n    \"title\": \"CreateToken\",\n    \"name\": \"CreateToken\",\n    \"group\": \"Auth\","
  },
  {
    "path": "public/apidoc/api_project.js",
    "chars": 648,
    "preview": "define({\n  \"name\": \"restful-booker\",\n  \"version\": \"1.0.0\",\n  \"description\": \"API documentation for the playground API re"
  },
  {
    "path": "public/apidoc/api_project.json",
    "chars": 639,
    "preview": "{\n  \"name\": \"restful-booker\",\n  \"version\": \"1.0.0\",\n  \"description\": \"API documentation for the playground API restful-b"
  },
  {
    "path": "public/apidoc/css/style.css",
    "chars": 9821,
    "preview": "/* ------------------------------------------------------------------------------------------\n * Content\n * ------------"
  },
  {
    "path": "public/apidoc/index.html",
    "chars": 29292,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n  <title>Loading...</title>\n  <m"
  },
  {
    "path": "public/apidoc/locales/ca.js",
    "chars": 1220,
    "preview": "define({\n    ca: {\n        'Allowed values:'             : 'Valors permesos:',\n        'Compare all with predecessor': '"
  },
  {
    "path": "public/apidoc/locales/cs.js",
    "chars": 1222,
    "preview": "define({\n    cs: {\n        'Allowed values:'             : 'Povolené hodnoty:',\n        'Compare all with predecessor': "
  },
  {
    "path": "public/apidoc/locales/de.js",
    "chars": 1229,
    "preview": "define({\n    de: {\n        'Allowed values:'             : 'Erlaubte Werte:',\n        'Compare all with predecessor': 'V"
  },
  {
    "path": "public/apidoc/locales/es.js",
    "chars": 1238,
    "preview": "define({\n    es: {\n        'Allowed values:'             : 'Valores permitidos:',\n        'Compare all with predecessor'"
  },
  {
    "path": "public/apidoc/locales/fr.js",
    "chars": 1249,
    "preview": "define({\n    fr: {\n        'Allowed values:'             : 'Valeurs autorisées :',\n        'Compare all with predecessor"
  },
  {
    "path": "public/apidoc/locales/it.js",
    "chars": 1249,
    "preview": "define({\n    it: {\n        'Allowed values:'             : 'Valori permessi:',\n        'Compare all with predecessor': '"
  },
  {
    "path": "public/apidoc/locales/locale.js",
    "chars": 1249,
    "preview": "define([\n    './locales/ca.js',\n    './locales/cs.js',\n    './locales/de.js',\n    './locales/es.js',\n    './locales/fr.j"
  },
  {
    "path": "public/apidoc/locales/nl.js",
    "chars": 1241,
    "preview": "define({\n    nl: {\n        'Allowed values:'             : 'Toegestane waarden:',\n        'Compare all with predecessor'"
  },
  {
    "path": "public/apidoc/locales/pl.js",
    "chars": 1212,
    "preview": "define({\n    pl: {\n        'Allowed values:'             : 'Dozwolone wartości:',\n        'Compare all with predecessor'"
  },
  {
    "path": "public/apidoc/locales/pt_br.js",
    "chars": 1228,
    "preview": "define({\n    'pt_br': {\n        'Allowed values:'             : 'Valores permitidos:',\n        'Compare all with predece"
  },
  {
    "path": "public/apidoc/locales/ro.js",
    "chars": 1226,
    "preview": "define({\n    ro: {\n        'Allowed values:'             : 'Valori permise:',\n        'Compare all with predecessor': 'C"
  },
  {
    "path": "public/apidoc/locales/ru.js",
    "chars": 1230,
    "preview": "define({\n    ru: {\n        'Allowed values:'             : 'Допустимые значения:',\n        'Compare all with predecessor"
  },
  {
    "path": "public/apidoc/locales/tr.js",
    "chars": 1206,
    "preview": "define({\n    tr: {\n        'Allowed values:'             : 'İzin verilen değerler:',\n        'Compare all with predecess"
  },
  {
    "path": "public/apidoc/locales/vi.js",
    "chars": 1220,
    "preview": "define({\n    vi: {\n        'Allowed values:'             : 'Giá trị chấp nhận:',\n        'Compare all with predecessor':"
  },
  {
    "path": "public/apidoc/locales/zh.js",
    "chars": 1025,
    "preview": "define({\n    zh: {\n        'Allowed values​​:'             : '允許值:',\n        'Compare all with predecessor': '預先比較所有',\n "
  },
  {
    "path": "public/apidoc/locales/zh_cn.js",
    "chars": 1132,
    "preview": "define({\n    'zh_cn': {\n        'Allowed values:'             : '允许值:',\n        'Compare all with predecessor': '与所有较早的比"
  },
  {
    "path": "public/apidoc/main.js",
    "chars": 32795,
    "preview": "require.config({\n    paths: {\n        bootstrap: './vendor/bootstrap.min',\n        diffMatchPatch: './vendor/diff_match_"
  },
  {
    "path": "public/apidoc/utils/handlebars_helper.js",
    "chars": 10752,
    "preview": "define([\n    'locales',\n    'handlebars',\n    'diffMatchPatch'\n], function(locale, Handlebars, DiffMatchPatch) {\n\n    /*"
  },
  {
    "path": "public/apidoc/utils/send_sample_request.js",
    "chars": 10211,
    "preview": "define([\n    'jquery',\n    'lodash',\n    './utils/send_sample_request_utils'\n], function($, _, utils) {\n\n    var initDyn"
  },
  {
    "path": "public/apidoc/utils/send_sample_request_utils.js",
    "chars": 3356,
    "preview": "//this block is used to make this module works with Node (CommonJS module format)\nif (typeof define !== 'function') {\n  "
  },
  {
    "path": "public/apidoc/vendor/path-to-regexp/LICENSE",
    "chars": 1103,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Blake Embrey (hello@blakeembrey.com)\n\nPermission is hereby granted, free of ch"
  },
  {
    "path": "public/apidoc/vendor/path-to-regexp/index.js",
    "chars": 5147,
    "preview": "var isArray = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/*"
  },
  {
    "path": "public/apidoc/vendor/polyfill.js",
    "chars": 2900,
    "preview": "// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys\nif (!Object.keys) {"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-Splus.js",
    "chars": 1351,
    "preview": "/*\n\n Copyright (C) 2012 Jeffrey B. Arnold\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-aea.js",
    "chars": 1594,
    "preview": "/*\n\n Copyright (C) 2009 Onno Hommes.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-agc.js",
    "chars": 1594,
    "preview": "/*\n\n Copyright (C) 2009 Onno Hommes.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-apollo.js",
    "chars": 1594,
    "preview": "/*\n\n Copyright (C) 2009 Onno Hommes.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-basic.js",
    "chars": 1106,
    "preview": "/*\n\n Copyright (C) 2013 Peter Kofler\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-cbm.js",
    "chars": 1106,
    "preview": "/*\n\n Copyright (C) 2013 Peter Kofler\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-cl.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-clj.js",
    "chars": 1467,
    "preview": "/*\n Copyright (C) 2011 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use th"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-css.js",
    "chars": 1507,
    "preview": "/*\n\n Copyright (C) 2009 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-dart.js",
    "chars": 1607,
    "preview": "/*\n\n Copyright (C) 2013 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-el.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-erl.js",
    "chars": 1190,
    "preview": "/*\n\n Copyright (C) 2013 Andrew Allen\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-erlang.js",
    "chars": 1190,
    "preview": "/*\n\n Copyright (C) 2013 Andrew Allen\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-fs.js",
    "chars": 1693,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-go.js",
    "chars": 867,
    "preview": "/*\n\n Copyright (C) 2010 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-hs.js",
    "chars": 1199,
    "preview": "/*\n\n Copyright (C) 2009 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lasso.js",
    "chars": 2723,
    "preview": "/*\n\n Copyright (C) 2013 Eric Knibbe\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lassoscript.js",
    "chars": 2723,
    "preview": "/*\n\n Copyright (C) 2013 Eric Knibbe\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-latex.js",
    "chars": 858,
    "preview": "/*\n\n Copyright (C) 2011 Martin S.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use thi"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lgt.js",
    "chars": 1410,
    "preview": "/*\n\n Copyright (C) 2014 Paulo Moura\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lisp.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-ll.js",
    "chars": 954,
    "preview": "/*\n\n Copyright (C) 2013 Nikhil Dabas\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-llvm.js",
    "chars": 954,
    "preview": "/*\n\n Copyright (C) 2013 Nikhil Dabas\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-logtalk.js",
    "chars": 1410,
    "preview": "/*\n\n Copyright (C) 2014 Paulo Moura\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-ls.js",
    "chars": 2723,
    "preview": "/*\n\n Copyright (C) 2013 Eric Knibbe\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lsp.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-lua.js",
    "chars": 1144,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-matlab.js",
    "chars": 21063,
    "preview": "/*\n\n Copyright (c) 2013 by Amro <amroamroamro@gmail.com>\n\n Permission is hereby granted, free of charge, to any person o"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-ml.js",
    "chars": 1693,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-mumps.js",
    "chars": 1482,
    "preview": "/*\n\n Copyright (C) 2011 Kitware Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-n.js",
    "chars": 2050,
    "preview": "/*\n\n Copyright (C) 2011 Zimin A.V.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use th"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-nemerle.js",
    "chars": 2050,
    "preview": "/*\n\n Copyright (C) 2011 Zimin A.V.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use th"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-pascal.js",
    "chars": 1314,
    "preview": "/*\n\n Copyright (C) 2013 Peter Kofler\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-proto.js",
    "chars": 874,
    "preview": "/*\n\n Copyright (C) 2006 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-r.js",
    "chars": 1351,
    "preview": "/*\n\n Copyright (C) 2012 Jeffrey B. Arnold\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-rd.js",
    "chars": 845,
    "preview": "/*\n\n Copyright (C) 2012 Jeffrey Arnold\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not us"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-rkt.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-rust.js",
    "chars": 2234,
    "preview": "/*\n\n Copyright (C) 2015 Chris Morgan\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-s.js",
    "chars": 1351,
    "preview": "/*\n\n Copyright (C) 2012 Jeffrey B. Arnold\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-scala.js",
    "chars": 1536,
    "preview": "/*\n\n Copyright (C) 2010 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-scm.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-sql.js",
    "chars": 2386,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-ss.js",
    "chars": 1382,
    "preview": "/*\n\n Copyright (C) 2008 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-swift.js",
    "chars": 2034,
    "preview": "/*\n\n Copyright (C) 2015 Google Inc.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use th"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-tcl.js",
    "chars": 1243,
    "preview": "/*\n\n Copyright (C) 2012 Pyrios\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this f"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-tex.js",
    "chars": 858,
    "preview": "/*\n\n Copyright (C) 2011 Martin S.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use thi"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-vb.js",
    "chars": 2404,
    "preview": "/*\n\n Copyright (C) 2009 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-vbs.js",
    "chars": 2404,
    "preview": "/*\n\n Copyright (C) 2009 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-vhd.js",
    "chars": 2035,
    "preview": "/*\n\n Copyright (C) 2010 benoit@ryder.fr\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not u"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-vhdl.js",
    "chars": 2035,
    "preview": "/*\n\n Copyright (C) 2010 benoit@ryder.fr\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not u"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-wiki.js",
    "chars": 1139,
    "preview": "/*\n\n Copyright (C) 2009 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use t"
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-xq.js",
    "chars": 23851,
    "preview": "/*\n\n Copyright (C) 2011 Patrick Wied\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-xquery.js",
    "chars": 23851,
    "preview": "/*\n\n Copyright (C) 2011 Patrick Wied\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-yaml.js",
    "chars": 1015,
    "preview": "/*\n\n Copyright (C) 2015 ribrdb @ code.google.com\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you "
  },
  {
    "path": "public/apidoc/vendor/prettify/lang-yml.js",
    "chars": 1015,
    "preview": "/*\n\n Copyright (C) 2015 ribrdb @ code.google.com\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you "
  },
  {
    "path": "public/apidoc/vendor/prettify/prettify.css",
    "chars": 675,
    "preview": ".pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,"
  },
  {
    "path": "public/apidoc/vendor/prettify/prettify.js",
    "chars": 15261,
    "preview": "!function(){/*\n\n Copyright (C) 2006 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you m"
  },
  {
    "path": "public/apidoc/vendor/prettify/run_prettify.js",
    "chars": 18037,
    "preview": "!function(){/*\n\n Copyright (C) 2013 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you m"
  },
  {
    "path": "public/apidoc/vendor/prettify.css",
    "chars": 1956,
    "preview": "/* Pretty printing styles. Used with prettify.js. */\n/* Vim sunburst theme by David Leibovic */\n\npre .str, code .str { c"
  },
  {
    "path": "public/apidoc/vendor/prism.css",
    "chars": 1957,
    "preview": "/* PrismJS 1.21.0\nhttps://prismjs.com/download.html#themes=prism-tomorrow&languages=clike+javascript+bash+c+csharp+cpp+c"
  },
  {
    "path": "public/apidoc/vendor/prism.js",
    "chars": 42163,
    "preview": "/* PrismJS 1.21.0\nhttps://prismjs.com/download.html#themes=prism-tomorrow&languages=clike+javascript+bash+c+csharp+cpp+c"
  },
  {
    "path": "public/apidoc/vendor/webfontloader.js",
    "chars": 12492,
    "preview": "/* Web Font Loader v1.6.24 - (c) Adobe Systems, Google. License: Apache 2.0 */\n(function(){function aa(a,b,d){return a.c"
  },
  {
    "path": "public/index.html",
    "chars": 4455,
    "preview": "<html>\n  <head>\n    <title>Welcome to Restful-Booker</title>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" conten"
  },
  {
    "path": "routes/apidoc.json",
    "chars": 438,
    "preview": "{\n    \"name\": \"restful-booker\",\n    \"description\": \"API documentation for the playground API restful-booker. <a href='/'"
  },
  {
    "path": "routes/index.js",
    "chars": 24187,
    "preview": "const express = require('express');\nconst router = express.Router(),\n    parse = require('../helpers/parser'),\n    crypt"
  },
  {
    "path": "tests/spec.js",
    "chars": 16617,
    "preview": "const request = require('supertest'),\n    expect = require('chai').expect,\n    should = require('chai').should(),\n    js"
  }
]

About this extraction

This page contains the full source code of the mwinteringham/restful-booker GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 113 files (521.0 KB), approximately 161.4k tokens, and a symbol index with 121 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!