├── .eslintrc.js ├── .github └── workflows │ └── release.yml ├── .gitignore ├── COPYING ├── Makefile ├── README.md ├── appinfo ├── info.xml └── routes.php ├── babel.config.js ├── composer.json ├── composer.lock ├── css └── style.css ├── img ├── app-dark.svg └── app.svg ├── lib ├── AppInfo │ └── Application.php ├── Flow │ ├── Operation.php │ └── RegisterFlowOperationsListener.php ├── Listeners │ ├── AbstractListener.php │ ├── CalendarObjectCreatedListener.php │ ├── CalendarObjectDeletedListener.php │ ├── CalendarObjectMovedToTrashListener.php │ ├── CalendarObjectUpdatedListener.php │ ├── LoginFailedListener.php │ ├── PasswordUpdatedListener.php │ ├── ShareCreatedListener.php │ ├── UserChangedListener.php │ ├── UserCreatedListener.php │ ├── UserDeletedListener.php │ ├── UserLiveStatusListener.php │ ├── UserLoggedInListener.php │ └── UserLoggedOutListener.php ├── Settings │ └── Admin.php └── Utils │ ├── DtoExtractor.php │ └── SignedRequest.php ├── package-lock.json ├── package.json ├── phpunit.integration.xml ├── screenshots ├── admin.png ├── flow.png └── webhooks-logo.svg ├── src ├── main.js └── views │ └── Webhooks.vue ├── stylelint.config.js ├── templates └── admin.php ├── tests ├── Integration │ └── AppTest.php └── bootstrap.php └── webpack.js /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | appName: true, 4 | }, 5 | extends: [ 6 | '@nextcloud' 7 | ], 8 | } -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Build and publish app release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | env: 8 | APP_NAME: webhooks 9 | 10 | jobs: 11 | build_and_publish: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | with: 17 | path: ${{ env.APP_NAME }} 18 | - uses: actions/setup-node@v3 19 | with: 20 | node-version: 16 21 | - name: Setup PHP 22 | uses: shivammathur/setup-php@v2 23 | with: 24 | php-version: 7.4 25 | - name: Run build 26 | run: cd ${{ env.APP_NAME }} && make build && make appstore 27 | - name: Upload app tarball to release 28 | uses: svenstaro/upload-release-action@v2 29 | id: attach_to_release 30 | with: 31 | repo_token: ${{ secrets.GITHUB_TOKEN }} 32 | file: ${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}.tar.gz 33 | asset_name: ${{ env.APP_NAME }}.tar.gz 34 | tag: ${{ github.ref }} 35 | overwrite: true 36 | - name: Upload app to Nextcloud appstore 37 | uses: R0Wi/nextcloud-appstore-push-action@v1 38 | with: 39 | app_name: ${{ env.APP_NAME }} 40 | appstore_token: ${{ secrets.APPSTORE_TOKEN }} 41 | download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} 42 | app_private_key: ${{ secrets.APP_PRIVATE_KEY }} 43 | nightly: ${{ github.event.release.prerelease }} 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | js/ 3 | node_modules/ -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This file is licensed under the Affero General Public License version 3 or 2 | # later. See the COPYING file. 3 | # @author Bernhard Posselt 4 | # @copyright Bernhard Posselt 2016 5 | 6 | # Generic Makefile for building and packaging a Nextcloud app which uses npm and 7 | # Composer. 8 | # 9 | # Dependencies: 10 | # * make 11 | # * which 12 | # * curl: used if phpunit and composer are not installed to fetch them from the web 13 | # * tar: for building the archive 14 | # * npm: for building and testing everything JS 15 | # 16 | # If no composer.json is in the app root directory, the Composer step 17 | # will be skipped. The same goes for the package.json which can be located in 18 | # the app root or the js/ directory. 19 | # 20 | # The npm command by launches the npm build script: 21 | # 22 | # npm run build 23 | # 24 | # The npm test command launches the npm test script: 25 | # 26 | # npm run test 27 | # 28 | # The idea behind this is to be completely testing and build tool agnostic. All 29 | # build tools and additional package managers should be installed locally in 30 | # your project, since this won't pollute people's global namespace. 31 | # 32 | # The following npm scripts in your package.json install and update the bower 33 | # and npm dependencies and use gulp as build system (notice how everything is 34 | # run from the node_modules folder): 35 | # 36 | # "scripts": { 37 | # "test": "node node_modules/gulp-cli/bin/gulp.js karma", 38 | # "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update", 39 | # "build": "node node_modules/gulp-cli/bin/gulp.js" 40 | # }, 41 | 42 | app_name=$(notdir $(CURDIR)) 43 | build_tools_directory=$(CURDIR)/build/tools 44 | source_build_directory=$(CURDIR)/build/artifacts/source 45 | source_package_name=$(source_build_directory)/$(app_name) 46 | appstore_build_directory=$(CURDIR)/build/artifacts/appstore 47 | appstore_package_name=$(appstore_build_directory)/$(app_name) 48 | npm=$(shell which npm 2> /dev/null) 49 | composer=$(shell which composer 2> /dev/null) 50 | 51 | all: build 52 | 53 | # Fetches the PHP and JS dependencies and compiles the JS. If no composer.json 54 | # is present, the composer step is skipped, if no package.json or js/package.json 55 | # is present, the npm step is skipped 56 | .PHONY: build 57 | build: 58 | ifneq (,$(wildcard $(CURDIR)/composer.json)) 59 | make composer 60 | endif 61 | ifneq (,$(wildcard $(CURDIR)/package.json)) 62 | make npm 63 | endif 64 | ifneq (,$(wildcard $(CURDIR)/js/package.json)) 65 | make npm 66 | endif 67 | 68 | # Installs and updates the composer dependencies. If composer is not installed 69 | # a copy is fetched from the web 70 | .PHONY: composer 71 | composer: 72 | ifeq (, $(composer)) 73 | @echo "No composer command available, downloading a copy from the web" 74 | mkdir -p $(build_tools_directory) 75 | curl -sS https://getcomposer.org/installer | php 76 | mv composer.phar $(build_tools_directory) 77 | php $(build_tools_directory)/composer.phar install --prefer-dist 78 | else 79 | composer install --prefer-dist 80 | endif 81 | 82 | # Installs npm dependencies 83 | .PHONY: npm 84 | npm: 85 | ifeq (,$(wildcard $(CURDIR)/package.json)) 86 | cd js && $(npm) run build 87 | else 88 | npm install && npm run build 89 | endif 90 | 91 | # Removes the appstore build 92 | .PHONY: clean 93 | clean: 94 | rm -rf ./build 95 | 96 | # Same as clean but also removes dependencies installed by composer, bower and 97 | # npm 98 | .PHONY: distclean 99 | distclean: clean 100 | rm -rf vendor 101 | rm -rf node_modules 102 | rm -rf js/vendor 103 | rm -rf js/node_modules 104 | 105 | # Builds the source and appstore package 106 | .PHONY: dist 107 | dist: 108 | make source 109 | make appstore 110 | 111 | # Builds the source package 112 | .PHONY: source 113 | source: 114 | rm -rf $(source_build_directory) 115 | mkdir -p $(source_build_directory) 116 | tar \ 117 | --exclude-vcs \ 118 | --exclude="../$(app_name)/build" \ 119 | --exclude="../$(app_name)/js/node_modules" \ 120 | --exclude="../$(app_name)/node_modules" \ 121 | --exclude="../$(app_name)/*.log" \ 122 | --exclude="../$(app_name)/js/*.log" \ 123 | -cvzf $(source_package_name).tar.gz ../$(app_name) \ 124 | 125 | # Builds the source package for the app store, ignores php and js tests 126 | .PHONY: appstore 127 | appstore: 128 | rm -rf $(appstore_build_directory) 129 | mkdir -p $(appstore_build_directory) 130 | tar \ 131 | --exclude-vcs \ 132 | --exclude="../$(app_name)/build" \ 133 | --exclude="../$(app_name)/tests" \ 134 | --exclude="../$(app_name)/Makefile" \ 135 | --exclude="../$(app_name)/*.log" \ 136 | --exclude="../$(app_name)/phpunit*xml" \ 137 | --exclude="../$(app_name)/composer.*" \ 138 | --exclude="../$(app_name)/js/node_modules" \ 139 | --exclude="../$(app_name)/js/tests" \ 140 | --exclude="../$(app_name)/js/test" \ 141 | --exclude="../$(app_name)/js/*.log" \ 142 | --exclude="../$(app_name)/js/package.json" \ 143 | --exclude="../$(app_name)/js/bower.json" \ 144 | --exclude="../$(app_name)/js/karma.*" \ 145 | --exclude="../$(app_name)/js/protractor.*" \ 146 | --exclude="../$(app_name)/package.json" \ 147 | --exclude="../$(app_name)/bower.json" \ 148 | --exclude="../$(app_name)/karma.*" \ 149 | --exclude="../$(app_name)/protractor\.*" \ 150 | --exclude="../$(app_name)/.*" \ 151 | --exclude="../$(app_name)/js/.*" \ 152 | --exclude="../$(app_name)/vendor" \ 153 | --exclude="../$(app_name)/src" \ 154 | --exclude="../$(app_name)/screenshots" \ 155 | --exclude="../$(app_name)/node_modules" \ 156 | -cvzf $(appstore_package_name).tar.gz ../$(app_name) \ 157 | 158 | .PHONY: test 159 | test: composer 160 | $(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![Webhooks Logo](screenshots/webhooks-logo.svg) Webhooks for Nextcloud 2 | 3 | This app allows a Nextcloud instance to notify external systems via HTTP POST requests whenever an event of a given type occurs. 4 | 5 | Features: 6 | - Sending webhook notifications to URLs specified on per-event type basis (11 event types supported as of the current version) 7 | - Authenticating outgoing POST requests with SHA256 signatures 8 | - Sending webhook notifications as a Flow action 9 | - Outgoing requests are sent in a fire-and-forget (`exec(curl &)`) manner in order not to block the thread execution 10 | 11 | ## Requirements 12 | 13 | - Nextcloud version 25-26 14 | - Ability to `exec(curl)` from a PHP script 15 | 16 | ## Usage 17 | 18 | This app is published in the [Nextcloud App Store](https://apps.nextcloud.com/apps/webhooks). Alternatively, it can be installed manually by grabbing the release `.tar.gz` archive, unpacking it in the `apps` folder of your Nextcloud instance and activating the app in the Admin UI. 19 | 20 | When active, the App status is reported in Settings > Administration > Security > (scroll down to) Webhooks. 21 | 22 | ![Nextcloud Webhooks admin screen](screenshots/admin.png) 23 | 24 | ### Event-based outgoing Webhooks 25 | 26 | In order to enable webhooks for a given event type, you have to provide the target URL with the config key corresponding the a given event in your [config file](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html). Example (User Logged In Event): 27 | 28 | ```PHP 29 | 'webhooks_user_logged_in_url' => 'https://your-service.tld/hooks/user-logged-in', 30 | ``` 31 | 32 | ### Flow-based outgoing Webhooks 33 | 34 | Aside from listening for specific events, this app also supports sending HTTP POST notifications triggered by a Flow defined by the admin with a specified endpoint URL. 35 | 36 | ![Nextcloud Webhooks Flow integration](screenshots/flow.png) 37 | 38 | With the example Flow listed above being active, when a new a new PDF file is uploaded, name of which matches __report__, a POST request is sent to the specified URL with the following payload: 39 | 40 | ```javascript 41 | { 42 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 43 | eventName: '\\OCP\\Files::postCreate', 44 | node: { 45 | id: 354, 46 | storage: { 47 | mountPoint: '/admin/', 48 | cache: null, 49 | scanner: {}, 50 | watcher: null, 51 | propagator: null, 52 | updater: {} 53 | }, 54 | path: '/admin/files/report-1234.pdf', 55 | internalPath: 'files/report-1234.pdf', 56 | modifiedTime: 1631793637, 57 | size: 1642, 58 | Etag: '6a8a183a68f22455d7a561d8e3d1f6b9', 59 | mimeType: 'application/pdf', 60 | permissions: 27, 61 | isUpdateable: true, 62 | isDeletable: true, 63 | isShareable: true 64 | }, 65 | workflowFile: { 66 | displayText: 'admin created report-1234.pdf', 67 | url: 'http://localhost:8080/index.php/f/354' 68 | } 69 | } 70 | ``` 71 | 72 | Example notification payloads for other Flow event types are listed [here](#flow-events). 73 | 74 | ## Authenticating requests 75 | 76 | If the Nextcloud instance and the service responsible for receiving incoming webhook notifications are to communicate over public internet, it is important to provide a secret key used for signing the notifications in order to protect the receiving service from spoofing attacks. This app allows you to define `webhooks_secret` in your Nextcloud `config.php` like so: 77 | 78 | ```PHP 79 | 'webhooks_secret' => 'yoursecret1234', 80 | ``` 81 | 82 | Once the secret is defined, all outgoing webhook notifications will contain a signature in the `X-Nextcloud-Webhooks` HTTP header. The signature is calculated by performing a SHA256 function on the POST request raw body concatenated with the secret defined earlier. 83 | 84 | Below is a minimal example of a Node.js Express app (with `body-parser`) validating incoming webhook notification signature: 85 | 86 | ```javascript 87 | const express = require("express"); 88 | const app = express(); 89 | const bodyParser = require('body-parser'); 90 | const crypto = require('crypto'); 91 | 92 | app.use(bodyParser.json({ 93 | verify: function(req, res, buf, encoding) { 94 | req.rawBody = buf.toString(); 95 | } 96 | })) 97 | 98 | app.post('/login-failed', (req, res) => { 99 | var hash = crypto.createHash('sha256'); 100 | hash.update(req.rawBody + "yoursecret1234"); 101 | var expected = hash.digest('hex'); 102 | var obtained = req.get('X-Nextcloud-Webhooks'); 103 | 104 | console.log("expected: ", expected); 105 | console.log("obtained: ", obtained); 106 | 107 | if (expected === obtained) { 108 | // request signature is VALID 109 | console.log(req.body); 110 | } else { 111 | // request signature is INVALID 112 | } 113 | 114 | res.status(200); 115 | }) 116 | 117 | app.listen(3000, () => { console.log("Server started.") }) 118 | 119 | ``` 120 | 121 | ## Available events 122 | 123 | ### Calendar Object Created 124 | 125 | Fires whenever a calendar event is created. 126 | 127 | Config name: `webhooks_calendar_object_created_url` 128 | 129 | Notification payload: 130 | ```javascript 131 | { 132 | calendarId: 2, 133 | calendarData: { 134 | id: '2', 135 | uri: 'personal', 136 | principaluri: 'principals/users/admin', 137 | // [...] 138 | '{http://apple.com/ns/ical/}calendar-order': '0', 139 | '{http://apple.com/ns/ical/}calendar-color': '#795AAB', 140 | '{http://nextcloud.com/ns}deleted-at': null, 141 | '{http://nextcloud.com/ns}owner-displayname': 'admin' 142 | }, 143 | shares: [], 144 | objectData: { 145 | id: '1', 146 | uri: '399C189E-CCA6-4F67-AC67-35A9B53B51EB.ics', 147 | lastmodified: '1633198361', 148 | etag: '"58731caeaf6c998ca2dbcf5d83af756a"', 149 | calendarid: '2', 150 | size: 901, 151 | calendardata: 'BEGIN:VCALENDAR\r\n' + 152 | 'VERSION:2.0\r\n' + 153 | 'CALSCALE:GREGORIAN\r\n' + 154 | 'PRODID:-//IDN nextcloud.com//Calendar app 2.2.2//EN\r\n' + 155 | 'BEGIN:VTIMEZONE\r\n' + 156 | // [...] more data in iCal format 157 | 'END:VEVENT\r\n' + 158 | 'END:VCALENDAR\r\n', 159 | component: 'vevent', 160 | classification: 0 161 | }, 162 | eventType: 'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' 163 | } 164 | ``` 165 | 166 | ### Calendar Object Updated 167 | 168 | Fires whenever a calendar event is edited (including meeting participant accepting/declining invitations). 169 | 170 | Config name: `webhooks_calendar_object_updated_url` 171 | 172 | Notification payload: 173 | ```javascript 174 | { 175 | calendarId: 2, 176 | calendarData: { 177 | id: '2', 178 | uri: 'personal', 179 | principaluri: 'principals/users/admin', 180 | // [...] 181 | '{http://apple.com/ns/ical/}calendar-order': '0', 182 | '{http://apple.com/ns/ical/}calendar-color': '#795AAB', 183 | '{http://nextcloud.com/ns}deleted-at': null, 184 | '{http://nextcloud.com/ns}owner-displayname': 'admin' 185 | }, 186 | shares: [], 187 | objectData: { 188 | id: '1', 189 | uri: '399C189E-CCA6-4F67-AC67-35A9B53B51EB.ics', 190 | lastmodified: '1633198361', 191 | etag: '"58731caeaf6c998ca2dbcf5d83af756a"', 192 | calendarid: '2', 193 | size: 901, 194 | calendardata: 'BEGIN:VCALENDAR\r\n' + 195 | 'VERSION:2.0\r\n' + 196 | 'CALSCALE:GREGORIAN\r\n' + 197 | 'PRODID:-//IDN nextcloud.com//Calendar app 2.2.2//EN\r\n' + 198 | 'BEGIN:VTIMEZONE\r\n' + 199 | // [...] more data in iCal format 200 | 'END:VEVENT\r\n' + 201 | 'END:VCALENDAR\r\n', 202 | component: 'vevent', 203 | classification: 0 204 | }, 205 | eventType: 'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' 206 | } 207 | ``` 208 | 209 | ### Calendar Object Moved to Trash 210 | 211 | Fires whenever a calendar event is soft-deleted (moved to trash). 212 | 213 | Config name: `webhooks_calendar_object_moved_to_trash_url` 214 | 215 | Notification payload: 216 | ```javascript 217 | { 218 | calendarId: 30, 219 | calendarData: { 220 | id: '2', 221 | uri: 'personal', 222 | principaluri: 'principals/users/admin', 223 | // [...] 224 | '{http://apple.com/ns/ical/}calendar-order': '0', 225 | '{http://apple.com/ns/ical/}calendar-color': '#795AAB', 226 | '{http://nextcloud.com/ns}deleted-at': null, 227 | '{http://nextcloud.com/ns}owner-displayname': 'admin' 228 | }, 229 | shares: [], 230 | objectData: { 231 | id: '118', 232 | uri: 'E855AF90-4A9B-4223-95E1-1FE700C4BDC0.ics', 233 | lastmodified: '1660572955', 234 | etag: '"79c725344d04a73b9bad1addee500bcf"', 235 | calendarid: '30', 236 | size: 748, 237 | calendardata: 'BEGIN:VCALENDAR\r\n' + 238 | 'CALSCALE:GREGORIAN\r\n' + 239 | 'VERSION:2.0\r\n' + 240 | 'PRODID:-//IDN nextcloud.com//Calendar app 3.3.1//EN\r\n' + 241 | 'BEGIN:VEVENT\r\n' + 242 | // [...] more data in iCal format 243 | 'END:VTIMEZONE\r\n' + 244 | 'END:VCALENDAR', 245 | component: 'vevent', 246 | classification: 0 247 | }, 248 | eventType: 'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' 249 | } 250 | ``` 251 | 252 | ### Calendar Object Deleted 253 | 254 | Fires whenever a calendar event is permanently deleted (i.e. deleted from the trashbin). 255 | 256 | Config name: `webhooks_calendar_object_deleted` 257 | 258 | Notification payload: 259 | ```javascript 260 | { 261 | calendarId: 30, 262 | calendarData: { 263 | id: '30', 264 | uri: 'test', 265 | principaluri: 'principals/users/admin', 266 | // [...] 267 | '{http://apple.com/ns/ical/}calendar-order': 0, 268 | '{http://apple.com/ns/ical/}calendar-color': '#499AA2', 269 | '{http://nextcloud.com/ns}deleted-at': null, 270 | '{http://nextcloud.com/ns}owner-displayname': 'admin' 271 | }, 272 | shares: [], 273 | objectData: { 274 | id: '118', 275 | uri: 'E855AF90-4A9B-4223-95E1-1FE700C4BDC0-deleted.ics', 276 | lastmodified: '1660572955', 277 | etag: '"79c725344d04a73b9bad1addee500bcf"', 278 | calendarid: '30', 279 | size: 748, 280 | calendardata: 'BEGIN:VCALENDAR\r\n' + 281 | 'CALSCALE:GREGORIAN\r\n' + 282 | 'VERSION:2.0\r\n' + 283 | 'PRODID:-//IDN nextcloud.com//Calendar app 3.3.1//EN\r\n' + 284 | 'BEGIN:VEVENT\r\n' + 285 | // [...] more data in iCal format 286 | 'END:VTIMEZONE\r\n' + 287 | 'END:VCALENDAR', 288 | component: 'vevent', 289 | classification: 0 290 | }, 291 | eventType: 'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' 292 | } 293 | ``` 294 | 295 | ### Login Failed 296 | 297 | Fires whenever a login attempt with an existing username fails. 298 | 299 | Config name: `webhooks_login_failed_url` 300 | 301 | Notification payload: 302 | ```javascript 303 | { 304 | userId: 'admin', 305 | eventType: 'OCP\\Authentication\\Events\\LoginFailedEvent' 306 | } 307 | ``` 308 | 309 | ### Password Updated 310 | 311 | Fires whenever user's password is changed. 312 | 313 | Config name: `webhooks_password_updated_url` 314 | 315 | Notification payload: 316 | ```javascript 317 | { 318 | user: { 319 | id: 'jdoe', 320 | displayName: 'John Doe', 321 | lastLogin: 0, 322 | home: '/home/nextcloud/data/jdoe', 323 | emailAddress: 'jdoe@example.com', 324 | cloudId: 'jdoe@yourcloud.tld', 325 | quota: '5 GB' 326 | }, 327 | eventType: 'OCP\\User\\Events\\PasswordUpdatedEvent' 328 | } 329 | ``` 330 | 331 | ### Share Created 332 | 333 | Fires whenever a new share is created. 334 | 335 | Config name: `webhooks_share_created_url` 336 | 337 | Notification payload: 338 | ```javascript 339 | { 340 | id: '1', 341 | fullId: 'ocinternal:1', 342 | nodeId: 7, 343 | nodeType: 'file', 344 | shareType: 3, 345 | sharedWith: null, 346 | sharedWithDisplayName: null, 347 | sharedWithAvatar: null, 348 | permissions: 17, 349 | status: 0, 350 | note: '', 351 | expirationDate: null, 352 | label: '', 353 | sharedBy: 'admin', 354 | shareOwner: 'admin', 355 | token: '7qSPknbEjeHAzgJ', 356 | target: '/welcome.txt', 357 | shareTime: { 358 | date: '2021-06-20 14:23:18.000000', 359 | timeinzone_type: 3, 360 | timezone: 'UTC' 361 | }, 362 | mailSend: true, 363 | hideDownload: false, 364 | eventType: 'OCP\\Share\\Events\\ShareCreatedEvent' 365 | } 366 | ``` 367 | 368 | ### User Changed 369 | 370 | Fires whenever a user account is edited. Includes values before and after edit. 371 | 372 | Config name: `webhooks_user_changed_url` 373 | 374 | Notification payload: 375 | ```javascript 376 | { 377 | user: { 378 | id: 'jdoe', 379 | displayName: 'John Doe', 380 | lastLogin: 0, 381 | home: '/home/nextcloud/data/jdoe', 382 | emailAddress: 'jdoe@example.com', 383 | cloudId: 'jdoe@yourcloud.tld', 384 | quota: '5 GB' 385 | }, 386 | feature: 'quota', 387 | value: '5 GB', 388 | oldValue: 'default', 389 | eventType: 'OCP\\User\\Events\\UserChangedEvent' 390 | } 391 | 392 | ``` 393 | 394 | ### User Created 395 | 396 | Fires whenever a new user is created. 397 | 398 | Config name: `webhooks_user_created_url` 399 | 400 | Notification payload: 401 | ```javascript 402 | { 403 | user: { 404 | id: 'admin', 405 | displayName: 'Jane Doe', 406 | lastLogin: 1624203500, 407 | home: '/home/nextcloud/data/admin', 408 | emailAddress: null, 409 | cloudId: 'admin@yourcloud.tld', 410 | quota: 'none' 411 | }, 412 | loginName: 'admin', 413 | isTokenLogin: false, 414 | eventType: 'OCP\\User\\Events\\UserLoggedInEvent' 415 | } 416 | ``` 417 | 418 | ### User Deleted 419 | 420 | Fires whenever a user account is deleted. 421 | 422 | Config name: `webhooks_user_deleted_url` 423 | 424 | Notification payload: 425 | ```javascript 426 | { 427 | user: { 428 | id: 'jdoe', 429 | displayName: 'John Doe', 430 | lastLogin: 0, 431 | home: '/home/nextcloud/data/jdoe', 432 | emailAddress: null, 433 | cloudId: 'jdoe@yourcloud.tld', 434 | quota: 'none' 435 | }, 436 | eventType: 'OCP\\User\\Events\\UserDeletedEvent' 437 | } 438 | ``` 439 | 440 | ### User Live Status Updated 441 | 442 | Fires whenever user's live status is updated to __online__ (happens when user navigates between apps and doesn't necessarily indicate that the status changed). 443 | 444 | Config name: `webhooks_user_status_url` 445 | 446 | ```javascript 447 | { 448 | user: { 449 | id: 'admin', 450 | displayName: 'Jane Doe', 451 | lastLogin: 1631198561, 452 | home: '/home/nextcloud/data/admin', 453 | emailAddress: null, 454 | cloudId: 'admin@yourcloud.tld', 455 | quota: 'none' 456 | }, 457 | status: 'online', 458 | timestamp: 1633198561, 459 | eventType: 'OCP\\User\\Events\\UserLiveStatusEvent' 460 | } 461 | ``` 462 | 463 | ### User Logged In 464 | 465 | Fires whenever a user logs in successfully. 466 | 467 | Config name: `webhooks_user_logged_in_url` 468 | 469 | Notification payload: 470 | ```javascript 471 | { 472 | user: { 473 | id: 'admin', 474 | displayName: 'Jane Doe', 475 | lastLogin: 1624203500, 476 | home: '/home/nextcloud/data/admin', 477 | emailAddress: null, 478 | cloudId: 'admin@yourcloud.tld', 479 | quota: 'none' 480 | }, 481 | loginName: 'admin', 482 | isTokenLogin: false, 483 | eventType: 'OCP\\User\\Events\\UserLoggedInEvent' 484 | } 485 | ``` 486 | 487 | ### User Logged Out 488 | 489 | Fires whenever a user logs out successfully. 490 | 491 | Config name: `webhooks_user_logged_out_url` 492 | 493 | Notification payload: 494 | ```javascript 495 | { 496 | user: { 497 | id: 'admin', 498 | displayName: 'Jane Doe', 499 | lastLogin: '1624203500', 500 | home: '/home/nextcloud/data/admin', 501 | emailAddress: null, 502 | cloudId: 'admin@yourcloud.tld', 503 | quota: 'none' 504 | }, 505 | eventType: 'OCP\\User\\Events\\UserLoggedOutEvent' 506 | } 507 | ``` 508 | 509 | ## Flow events 510 | 511 | ### File created 512 | 513 | ```javascript 514 | { 515 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 516 | eventName: '\\OCP\\Files::postCreate', 517 | node: { 518 | id: 75, 519 | storage: { 520 | mountPoint: '/admin/', 521 | cache: null, 522 | scanner: {}, 523 | watcher: null, 524 | propagator: null, 525 | updater: {} 526 | }, 527 | path: '/admin/files/test2.pdf', 528 | internalPath: 'files/test2.pdf', 529 | modifiedTime: 1633196032, 530 | size: 1642, 531 | Etag: '97e0c8f490acb83e9b94f9c9e8eeb280', 532 | mimeType: 'application/pdf', 533 | permissions: 27, 534 | isUpdateable: true, 535 | isDeletable: true, 536 | isShareable: true 537 | }, 538 | workflowFile: { 539 | displayText: 'admin created test2.pdf', 540 | url: 'http://localhost:8000/index.php/f/75' 541 | } 542 | } 543 | ``` 544 | 545 | ### File updated 546 | 547 | ```javascript 548 | { 549 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 550 | eventName: '\\OCP\\Files::postWrite', 551 | node: { 552 | id: 128, 553 | storage: { 554 | cache: null, 555 | scanner: {}, 556 | watcher: null, 557 | propagator: null, 558 | updater: {} 559 | }, 560 | path: '/admin/files/test-file.txt', 561 | internalPath: 'files/test-file.txt', 562 | modifiedTime: 1647687121, 563 | size: 9, 564 | Etag: '914a2364bc8786dcb2a3b74889f692f5', 565 | mimeType: 'text/plain', 566 | permissions: 27, 567 | isUpdateable: true, 568 | isDeletable: true, 569 | isShareable: true 570 | }, 571 | workflowFile: { 572 | displayText: 'admin modified test-file.txt', 573 | url: 'http://localhost:8000/index.php/f/128' 574 | } 575 | } 576 | ``` 577 | 578 | ### File renamed 579 | 580 | ```javascript 581 | { 582 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 583 | eventName: '\\OCP\\Files::postRename', 584 | node: { 585 | id: 75, 586 | storage: { 587 | mountPoint: '/admin/', 588 | cache: null, 589 | scanner: {}, 590 | watcher: null, 591 | propagator: null, 592 | updater: {} 593 | }, 594 | path: '/admin/files/test2.pdf', 595 | internalPath: 'files/test2.pdf', 596 | modifiedTime: 1633196032, 597 | size: 1642, 598 | Etag: '97e0c8f490acb83e9b94f9c9e8eeb280', 599 | mimeType: 'application/pdf', 600 | permissions: 27, 601 | isUpdateable: true, 602 | isDeletable: true, 603 | isShareable: true 604 | }, 605 | workflowFile: { 606 | displayText: 'admin renamed test2.pdf', 607 | url: 'http://localhost:8000/index.php/f/75' 608 | } 609 | } 610 | ``` 611 | 612 | ### File copied 613 | 614 | ```javascript 615 | { 616 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 617 | eventName: '\\OCP\\Files::postCopy', 618 | node: { 619 | id: 80, 620 | storage: { 621 | mountPoint: '/admin/', 622 | cache: null, 623 | scanner: {}, 624 | watcher: null, 625 | propagator: null, 626 | updater: {} 627 | }, 628 | path: '/admin/files/test2 (copy).pdf', 629 | internalPath: 'files/test2 (copy).pdf', 630 | modifiedTime: 1647686658, 631 | size: 1642, 632 | Etag: '3ce44278e289299fa8e6a27f05b7f54e', 633 | mimeType: 'application/pdf', 634 | permissions: 27, 635 | isUpdateable: true, 636 | isDeletable: true, 637 | isShareable: true 638 | }, 639 | workflowFile: { 640 | displayText: 'admin copied test2 (copy).pdf', 641 | url: 'http://localhost:8000/index.php/f/80' 642 | } 643 | } 644 | ``` 645 | 646 | ### File deleted 647 | 648 | ```javascript 649 | { 650 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 651 | eventName: '\\OCP\\Files::postDelete', 652 | node: { 653 | id: 75, 654 | storage: { 655 | mountPoint: '/admin/', 656 | cache: null, 657 | scanner: {}, 658 | watcher: null, 659 | propagator: null, 660 | updater: {} 661 | }, 662 | path: '/admin/files/test2.pdf', 663 | internalPath: 'files/test2.pdf', 664 | modifiedTime: 1633196032, 665 | size: 1642, 666 | Etag: '97e0c8f490acb83e9b94f9c9e8eeb280', 667 | mimeType: 'application/pdf', 668 | permissions: 27, 669 | isUpdateable: true, 670 | isDeletable: true, 671 | isShareable: true 672 | }, 673 | workflowFile: { 674 | displayText: 'admin deleted test2.pdf', 675 | url: 'http://localhost:8000/index.php/f/75' 676 | } 677 | } 678 | ``` 679 | 680 | ### Tag assigned 681 | 682 | ```javascript 683 | { 684 | eventType: 'OCA\\WorkflowEngine\\Entity\\File', 685 | eventName: 'OCP\\SystemTag\\ISystemTagObjectMapper::assignTags', 686 | mapperEvent: { 687 | eventName: 'OCP\\SystemTag\\ISystemTagObjectMapper::assignTags', 688 | objectType: 'files', 689 | objectId: '75', 690 | tags: [ '1' ] 691 | }, 692 | workflowFile: { 693 | displayText: 'admin assigned test-tag to test2.pdf', 694 | url: 'http://localhost:8000/index.php/f/75' 695 | } 696 | } 697 | ``` 698 | -------------------------------------------------------------------------------- /appinfo/info.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | webhooks 5 | Webhooks 6 | Integrate your Nextcloud instance with external systems using Webhooks 7 | 11 | 0.4.3 12 | agpl 13 | Paweł Kuffel 14 | 15 | https://github.com/kffl/nextcloud-webhooks#readme 16 | 17 | Webhooks 18 | integration 19 | tools 20 | workflow 21 | https://github.com/kffl/nextcloud-webhooks/issues 22 | https://github.com/kffl/nextcloud-webhooks 23 | https://raw.githubusercontent.com/kffl/nextcloud-webhooks/master/screenshots/admin.png 24 | 25 | 26 | 27 | 28 | 29 | OCA\Webhooks\Settings\Admin 30 | 31 | 32 | -------------------------------------------------------------------------------- /appinfo/routes.php: -------------------------------------------------------------------------------- 1 | 4 | * 5 | * @author Paweł Kuffel 6 | * 7 | * @license GNU AGPL version 3 or any later version 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as 11 | * published by the Free Software Foundation, either version 3 of the 12 | * License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with this program. If not, see . 21 | * 22 | */ 23 | return [ 24 | 'routes' => [] 25 | ]; 26 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | const babelConfig = require('@nextcloud/babel-config') 2 | 3 | module.exports = babelConfig 4 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kffl/webhooks", 3 | "description": "Integrate your Nextcloud instance with external services using HTTP(S) Webhooks", 4 | "type": "project", 5 | "license": "AGPL", 6 | "authors": [ 7 | { 8 | "name": "Paweł Kuffel" 9 | } 10 | ], 11 | "require": {}, 12 | "require-dev": { 13 | "phpunit/phpunit": "^5.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "ca608b173ea82e8804e100ed5dba5eaf", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "doctrine/instantiator", 12 | "version": "1.4.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/doctrine/instantiator.git", 16 | "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", 21 | "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": "^7.1 || ^8.0" 26 | }, 27 | "require-dev": { 28 | "doctrine/coding-standard": "^8.0", 29 | "ext-pdo": "*", 30 | "ext-phar": "*", 31 | "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", 32 | "phpstan/phpstan": "^0.12", 33 | "phpstan/phpstan-phpunit": "^0.12", 34 | "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" 35 | }, 36 | "type": "library", 37 | "autoload": { 38 | "psr-4": { 39 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Marco Pivetta", 49 | "email": "ocramius@gmail.com", 50 | "homepage": "https://ocramius.github.io/" 51 | } 52 | ], 53 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 54 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 55 | "keywords": [ 56 | "constructor", 57 | "instantiate" 58 | ], 59 | "support": { 60 | "issues": "https://github.com/doctrine/instantiator/issues", 61 | "source": "https://github.com/doctrine/instantiator/tree/1.4.0" 62 | }, 63 | "funding": [ 64 | { 65 | "url": "https://www.doctrine-project.org/sponsorship.html", 66 | "type": "custom" 67 | }, 68 | { 69 | "url": "https://www.patreon.com/phpdoctrine", 70 | "type": "patreon" 71 | }, 72 | { 73 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", 74 | "type": "tidelift" 75 | } 76 | ], 77 | "time": "2020-11-10T18:47:58+00:00" 78 | }, 79 | { 80 | "name": "myclabs/deep-copy", 81 | "version": "1.10.2", 82 | "source": { 83 | "type": "git", 84 | "url": "https://github.com/myclabs/DeepCopy.git", 85 | "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" 86 | }, 87 | "dist": { 88 | "type": "zip", 89 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", 90 | "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", 91 | "shasum": "" 92 | }, 93 | "require": { 94 | "php": "^7.1 || ^8.0" 95 | }, 96 | "replace": { 97 | "myclabs/deep-copy": "self.version" 98 | }, 99 | "require-dev": { 100 | "doctrine/collections": "^1.0", 101 | "doctrine/common": "^2.6", 102 | "phpunit/phpunit": "^7.1" 103 | }, 104 | "type": "library", 105 | "autoload": { 106 | "psr-4": { 107 | "DeepCopy\\": "src/DeepCopy/" 108 | }, 109 | "files": [ 110 | "src/DeepCopy/deep_copy.php" 111 | ] 112 | }, 113 | "notification-url": "https://packagist.org/downloads/", 114 | "license": [ 115 | "MIT" 116 | ], 117 | "description": "Create deep copies (clones) of your objects", 118 | "keywords": [ 119 | "clone", 120 | "copy", 121 | "duplicate", 122 | "object", 123 | "object graph" 124 | ], 125 | "support": { 126 | "issues": "https://github.com/myclabs/DeepCopy/issues", 127 | "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" 128 | }, 129 | "funding": [ 130 | { 131 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 132 | "type": "tidelift" 133 | } 134 | ], 135 | "time": "2020-11-13T09:40:50+00:00" 136 | }, 137 | { 138 | "name": "phpdocumentor/reflection-common", 139 | "version": "2.2.0", 140 | "source": { 141 | "type": "git", 142 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 143 | "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" 144 | }, 145 | "dist": { 146 | "type": "zip", 147 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", 148 | "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", 149 | "shasum": "" 150 | }, 151 | "require": { 152 | "php": "^7.2 || ^8.0" 153 | }, 154 | "type": "library", 155 | "extra": { 156 | "branch-alias": { 157 | "dev-2.x": "2.x-dev" 158 | } 159 | }, 160 | "autoload": { 161 | "psr-4": { 162 | "phpDocumentor\\Reflection\\": "src/" 163 | } 164 | }, 165 | "notification-url": "https://packagist.org/downloads/", 166 | "license": [ 167 | "MIT" 168 | ], 169 | "authors": [ 170 | { 171 | "name": "Jaap van Otterdijk", 172 | "email": "opensource@ijaap.nl" 173 | } 174 | ], 175 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 176 | "homepage": "http://www.phpdoc.org", 177 | "keywords": [ 178 | "FQSEN", 179 | "phpDocumentor", 180 | "phpdoc", 181 | "reflection", 182 | "static analysis" 183 | ], 184 | "support": { 185 | "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", 186 | "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" 187 | }, 188 | "time": "2020-06-27T09:03:43+00:00" 189 | }, 190 | { 191 | "name": "phpdocumentor/reflection-docblock", 192 | "version": "5.2.2", 193 | "source": { 194 | "type": "git", 195 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 196 | "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" 197 | }, 198 | "dist": { 199 | "type": "zip", 200 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", 201 | "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", 202 | "shasum": "" 203 | }, 204 | "require": { 205 | "ext-filter": "*", 206 | "php": "^7.2 || ^8.0", 207 | "phpdocumentor/reflection-common": "^2.2", 208 | "phpdocumentor/type-resolver": "^1.3", 209 | "webmozart/assert": "^1.9.1" 210 | }, 211 | "require-dev": { 212 | "mockery/mockery": "~1.3.2" 213 | }, 214 | "type": "library", 215 | "extra": { 216 | "branch-alias": { 217 | "dev-master": "5.x-dev" 218 | } 219 | }, 220 | "autoload": { 221 | "psr-4": { 222 | "phpDocumentor\\Reflection\\": "src" 223 | } 224 | }, 225 | "notification-url": "https://packagist.org/downloads/", 226 | "license": [ 227 | "MIT" 228 | ], 229 | "authors": [ 230 | { 231 | "name": "Mike van Riel", 232 | "email": "me@mikevanriel.com" 233 | }, 234 | { 235 | "name": "Jaap van Otterdijk", 236 | "email": "account@ijaap.nl" 237 | } 238 | ], 239 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 240 | "support": { 241 | "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", 242 | "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" 243 | }, 244 | "time": "2020-09-03T19:13:55+00:00" 245 | }, 246 | { 247 | "name": "phpdocumentor/type-resolver", 248 | "version": "1.4.0", 249 | "source": { 250 | "type": "git", 251 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 252 | "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" 253 | }, 254 | "dist": { 255 | "type": "zip", 256 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", 257 | "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", 258 | "shasum": "" 259 | }, 260 | "require": { 261 | "php": "^7.2 || ^8.0", 262 | "phpdocumentor/reflection-common": "^2.0" 263 | }, 264 | "require-dev": { 265 | "ext-tokenizer": "*" 266 | }, 267 | "type": "library", 268 | "extra": { 269 | "branch-alias": { 270 | "dev-1.x": "1.x-dev" 271 | } 272 | }, 273 | "autoload": { 274 | "psr-4": { 275 | "phpDocumentor\\Reflection\\": "src" 276 | } 277 | }, 278 | "notification-url": "https://packagist.org/downloads/", 279 | "license": [ 280 | "MIT" 281 | ], 282 | "authors": [ 283 | { 284 | "name": "Mike van Riel", 285 | "email": "me@mikevanriel.com" 286 | } 287 | ], 288 | "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", 289 | "support": { 290 | "issues": "https://github.com/phpDocumentor/TypeResolver/issues", 291 | "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" 292 | }, 293 | "time": "2020-09-17T18:55:26+00:00" 294 | }, 295 | { 296 | "name": "phpspec/prophecy", 297 | "version": "v1.10.3", 298 | "source": { 299 | "type": "git", 300 | "url": "https://github.com/phpspec/prophecy.git", 301 | "reference": "451c3cd1418cf640de218914901e51b064abb093" 302 | }, 303 | "dist": { 304 | "type": "zip", 305 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", 306 | "reference": "451c3cd1418cf640de218914901e51b064abb093", 307 | "shasum": "" 308 | }, 309 | "require": { 310 | "doctrine/instantiator": "^1.0.2", 311 | "php": "^5.3|^7.0", 312 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", 313 | "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", 314 | "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" 315 | }, 316 | "require-dev": { 317 | "phpspec/phpspec": "^2.5 || ^3.2", 318 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" 319 | }, 320 | "type": "library", 321 | "extra": { 322 | "branch-alias": { 323 | "dev-master": "1.10.x-dev" 324 | } 325 | }, 326 | "autoload": { 327 | "psr-4": { 328 | "Prophecy\\": "src/Prophecy" 329 | } 330 | }, 331 | "notification-url": "https://packagist.org/downloads/", 332 | "license": [ 333 | "MIT" 334 | ], 335 | "authors": [ 336 | { 337 | "name": "Konstantin Kudryashov", 338 | "email": "ever.zet@gmail.com", 339 | "homepage": "http://everzet.com" 340 | }, 341 | { 342 | "name": "Marcello Duarte", 343 | "email": "marcello.duarte@gmail.com" 344 | } 345 | ], 346 | "description": "Highly opinionated mocking framework for PHP 5.3+", 347 | "homepage": "https://github.com/phpspec/prophecy", 348 | "keywords": [ 349 | "Double", 350 | "Dummy", 351 | "fake", 352 | "mock", 353 | "spy", 354 | "stub" 355 | ], 356 | "support": { 357 | "issues": "https://github.com/phpspec/prophecy/issues", 358 | "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" 359 | }, 360 | "time": "2020-03-05T15:02:03+00:00" 361 | }, 362 | { 363 | "name": "phpunit/php-code-coverage", 364 | "version": "4.0.8", 365 | "source": { 366 | "type": "git", 367 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 368 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" 369 | }, 370 | "dist": { 371 | "type": "zip", 372 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", 373 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", 374 | "shasum": "" 375 | }, 376 | "require": { 377 | "ext-dom": "*", 378 | "ext-xmlwriter": "*", 379 | "php": "^5.6 || ^7.0", 380 | "phpunit/php-file-iterator": "^1.3", 381 | "phpunit/php-text-template": "^1.2", 382 | "phpunit/php-token-stream": "^1.4.2 || ^2.0", 383 | "sebastian/code-unit-reverse-lookup": "^1.0", 384 | "sebastian/environment": "^1.3.2 || ^2.0", 385 | "sebastian/version": "^1.0 || ^2.0" 386 | }, 387 | "require-dev": { 388 | "ext-xdebug": "^2.1.4", 389 | "phpunit/phpunit": "^5.7" 390 | }, 391 | "suggest": { 392 | "ext-xdebug": "^2.5.1" 393 | }, 394 | "type": "library", 395 | "extra": { 396 | "branch-alias": { 397 | "dev-master": "4.0.x-dev" 398 | } 399 | }, 400 | "autoload": { 401 | "classmap": [ 402 | "src/" 403 | ] 404 | }, 405 | "notification-url": "https://packagist.org/downloads/", 406 | "license": [ 407 | "BSD-3-Clause" 408 | ], 409 | "authors": [ 410 | { 411 | "name": "Sebastian Bergmann", 412 | "email": "sb@sebastian-bergmann.de", 413 | "role": "lead" 414 | } 415 | ], 416 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 417 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 418 | "keywords": [ 419 | "coverage", 420 | "testing", 421 | "xunit" 422 | ], 423 | "support": { 424 | "irc": "irc://irc.freenode.net/phpunit", 425 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 426 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/4.0" 427 | }, 428 | "time": "2017-04-02T07:44:40+00:00" 429 | }, 430 | { 431 | "name": "phpunit/php-file-iterator", 432 | "version": "1.4.5", 433 | "source": { 434 | "type": "git", 435 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 436 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" 437 | }, 438 | "dist": { 439 | "type": "zip", 440 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", 441 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", 442 | "shasum": "" 443 | }, 444 | "require": { 445 | "php": ">=5.3.3" 446 | }, 447 | "type": "library", 448 | "extra": { 449 | "branch-alias": { 450 | "dev-master": "1.4.x-dev" 451 | } 452 | }, 453 | "autoload": { 454 | "classmap": [ 455 | "src/" 456 | ] 457 | }, 458 | "notification-url": "https://packagist.org/downloads/", 459 | "license": [ 460 | "BSD-3-Clause" 461 | ], 462 | "authors": [ 463 | { 464 | "name": "Sebastian Bergmann", 465 | "email": "sb@sebastian-bergmann.de", 466 | "role": "lead" 467 | } 468 | ], 469 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 470 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 471 | "keywords": [ 472 | "filesystem", 473 | "iterator" 474 | ], 475 | "support": { 476 | "irc": "irc://irc.freenode.net/phpunit", 477 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 478 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" 479 | }, 480 | "time": "2017-11-27T13:52:08+00:00" 481 | }, 482 | { 483 | "name": "phpunit/php-text-template", 484 | "version": "1.2.1", 485 | "source": { 486 | "type": "git", 487 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 488 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 489 | }, 490 | "dist": { 491 | "type": "zip", 492 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 493 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 494 | "shasum": "" 495 | }, 496 | "require": { 497 | "php": ">=5.3.3" 498 | }, 499 | "type": "library", 500 | "autoload": { 501 | "classmap": [ 502 | "src/" 503 | ] 504 | }, 505 | "notification-url": "https://packagist.org/downloads/", 506 | "license": [ 507 | "BSD-3-Clause" 508 | ], 509 | "authors": [ 510 | { 511 | "name": "Sebastian Bergmann", 512 | "email": "sebastian@phpunit.de", 513 | "role": "lead" 514 | } 515 | ], 516 | "description": "Simple template engine.", 517 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 518 | "keywords": [ 519 | "template" 520 | ], 521 | "support": { 522 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 523 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" 524 | }, 525 | "time": "2015-06-21T13:50:34+00:00" 526 | }, 527 | { 528 | "name": "phpunit/php-timer", 529 | "version": "1.0.9", 530 | "source": { 531 | "type": "git", 532 | "url": "https://github.com/sebastianbergmann/php-timer.git", 533 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 534 | }, 535 | "dist": { 536 | "type": "zip", 537 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 538 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 539 | "shasum": "" 540 | }, 541 | "require": { 542 | "php": "^5.3.3 || ^7.0" 543 | }, 544 | "require-dev": { 545 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 546 | }, 547 | "type": "library", 548 | "extra": { 549 | "branch-alias": { 550 | "dev-master": "1.0-dev" 551 | } 552 | }, 553 | "autoload": { 554 | "classmap": [ 555 | "src/" 556 | ] 557 | }, 558 | "notification-url": "https://packagist.org/downloads/", 559 | "license": [ 560 | "BSD-3-Clause" 561 | ], 562 | "authors": [ 563 | { 564 | "name": "Sebastian Bergmann", 565 | "email": "sb@sebastian-bergmann.de", 566 | "role": "lead" 567 | } 568 | ], 569 | "description": "Utility class for timing", 570 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 571 | "keywords": [ 572 | "timer" 573 | ], 574 | "support": { 575 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 576 | "source": "https://github.com/sebastianbergmann/php-timer/tree/master" 577 | }, 578 | "time": "2017-02-26T11:10:40+00:00" 579 | }, 580 | { 581 | "name": "phpunit/php-token-stream", 582 | "version": "2.0.2", 583 | "source": { 584 | "type": "git", 585 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 586 | "reference": "791198a2c6254db10131eecfe8c06670700904db" 587 | }, 588 | "dist": { 589 | "type": "zip", 590 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", 591 | "reference": "791198a2c6254db10131eecfe8c06670700904db", 592 | "shasum": "" 593 | }, 594 | "require": { 595 | "ext-tokenizer": "*", 596 | "php": "^7.0" 597 | }, 598 | "require-dev": { 599 | "phpunit/phpunit": "^6.2.4" 600 | }, 601 | "type": "library", 602 | "extra": { 603 | "branch-alias": { 604 | "dev-master": "2.0-dev" 605 | } 606 | }, 607 | "autoload": { 608 | "classmap": [ 609 | "src/" 610 | ] 611 | }, 612 | "notification-url": "https://packagist.org/downloads/", 613 | "license": [ 614 | "BSD-3-Clause" 615 | ], 616 | "authors": [ 617 | { 618 | "name": "Sebastian Bergmann", 619 | "email": "sebastian@phpunit.de" 620 | } 621 | ], 622 | "description": "Wrapper around PHP's tokenizer extension.", 623 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 624 | "keywords": [ 625 | "tokenizer" 626 | ], 627 | "support": { 628 | "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", 629 | "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" 630 | }, 631 | "abandoned": true, 632 | "time": "2017-11-27T05:48:46+00:00" 633 | }, 634 | { 635 | "name": "phpunit/phpunit", 636 | "version": "5.7.27", 637 | "source": { 638 | "type": "git", 639 | "url": "https://github.com/sebastianbergmann/phpunit.git", 640 | "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" 641 | }, 642 | "dist": { 643 | "type": "zip", 644 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", 645 | "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", 646 | "shasum": "" 647 | }, 648 | "require": { 649 | "ext-dom": "*", 650 | "ext-json": "*", 651 | "ext-libxml": "*", 652 | "ext-mbstring": "*", 653 | "ext-xml": "*", 654 | "myclabs/deep-copy": "~1.3", 655 | "php": "^5.6 || ^7.0", 656 | "phpspec/prophecy": "^1.6.2", 657 | "phpunit/php-code-coverage": "^4.0.4", 658 | "phpunit/php-file-iterator": "~1.4", 659 | "phpunit/php-text-template": "~1.2", 660 | "phpunit/php-timer": "^1.0.6", 661 | "phpunit/phpunit-mock-objects": "^3.2", 662 | "sebastian/comparator": "^1.2.4", 663 | "sebastian/diff": "^1.4.3", 664 | "sebastian/environment": "^1.3.4 || ^2.0", 665 | "sebastian/exporter": "~2.0", 666 | "sebastian/global-state": "^1.1", 667 | "sebastian/object-enumerator": "~2.0", 668 | "sebastian/resource-operations": "~1.0", 669 | "sebastian/version": "^1.0.6|^2.0.1", 670 | "symfony/yaml": "~2.1|~3.0|~4.0" 671 | }, 672 | "conflict": { 673 | "phpdocumentor/reflection-docblock": "3.0.2" 674 | }, 675 | "require-dev": { 676 | "ext-pdo": "*" 677 | }, 678 | "suggest": { 679 | "ext-xdebug": "*", 680 | "phpunit/php-invoker": "~1.1" 681 | }, 682 | "bin": [ 683 | "phpunit" 684 | ], 685 | "type": "library", 686 | "extra": { 687 | "branch-alias": { 688 | "dev-master": "5.7.x-dev" 689 | } 690 | }, 691 | "autoload": { 692 | "classmap": [ 693 | "src/" 694 | ] 695 | }, 696 | "notification-url": "https://packagist.org/downloads/", 697 | "license": [ 698 | "BSD-3-Clause" 699 | ], 700 | "authors": [ 701 | { 702 | "name": "Sebastian Bergmann", 703 | "email": "sebastian@phpunit.de", 704 | "role": "lead" 705 | } 706 | ], 707 | "description": "The PHP Unit Testing framework.", 708 | "homepage": "https://phpunit.de/", 709 | "keywords": [ 710 | "phpunit", 711 | "testing", 712 | "xunit" 713 | ], 714 | "support": { 715 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 716 | "source": "https://github.com/sebastianbergmann/phpunit/tree/5.7.27" 717 | }, 718 | "time": "2018-02-01T05:50:59+00:00" 719 | }, 720 | { 721 | "name": "phpunit/phpunit-mock-objects", 722 | "version": "3.4.4", 723 | "source": { 724 | "type": "git", 725 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 726 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" 727 | }, 728 | "dist": { 729 | "type": "zip", 730 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", 731 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", 732 | "shasum": "" 733 | }, 734 | "require": { 735 | "doctrine/instantiator": "^1.0.2", 736 | "php": "^5.6 || ^7.0", 737 | "phpunit/php-text-template": "^1.2", 738 | "sebastian/exporter": "^1.2 || ^2.0" 739 | }, 740 | "conflict": { 741 | "phpunit/phpunit": "<5.4.0" 742 | }, 743 | "require-dev": { 744 | "phpunit/phpunit": "^5.4" 745 | }, 746 | "suggest": { 747 | "ext-soap": "*" 748 | }, 749 | "type": "library", 750 | "extra": { 751 | "branch-alias": { 752 | "dev-master": "3.2.x-dev" 753 | } 754 | }, 755 | "autoload": { 756 | "classmap": [ 757 | "src/" 758 | ] 759 | }, 760 | "notification-url": "https://packagist.org/downloads/", 761 | "license": [ 762 | "BSD-3-Clause" 763 | ], 764 | "authors": [ 765 | { 766 | "name": "Sebastian Bergmann", 767 | "email": "sb@sebastian-bergmann.de", 768 | "role": "lead" 769 | } 770 | ], 771 | "description": "Mock Object library for PHPUnit", 772 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 773 | "keywords": [ 774 | "mock", 775 | "xunit" 776 | ], 777 | "support": { 778 | "irc": "irc://irc.freenode.net/phpunit", 779 | "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", 780 | "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/3.4" 781 | }, 782 | "abandoned": true, 783 | "time": "2017-06-30T09:13:00+00:00" 784 | }, 785 | { 786 | "name": "sebastian/code-unit-reverse-lookup", 787 | "version": "1.0.2", 788 | "source": { 789 | "type": "git", 790 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 791 | "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" 792 | }, 793 | "dist": { 794 | "type": "zip", 795 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", 796 | "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", 797 | "shasum": "" 798 | }, 799 | "require": { 800 | "php": ">=5.6" 801 | }, 802 | "require-dev": { 803 | "phpunit/phpunit": "^8.5" 804 | }, 805 | "type": "library", 806 | "extra": { 807 | "branch-alias": { 808 | "dev-master": "1.0.x-dev" 809 | } 810 | }, 811 | "autoload": { 812 | "classmap": [ 813 | "src/" 814 | ] 815 | }, 816 | "notification-url": "https://packagist.org/downloads/", 817 | "license": [ 818 | "BSD-3-Clause" 819 | ], 820 | "authors": [ 821 | { 822 | "name": "Sebastian Bergmann", 823 | "email": "sebastian@phpunit.de" 824 | } 825 | ], 826 | "description": "Looks up which function or method a line of code belongs to", 827 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 828 | "support": { 829 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 830 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" 831 | }, 832 | "funding": [ 833 | { 834 | "url": "https://github.com/sebastianbergmann", 835 | "type": "github" 836 | } 837 | ], 838 | "time": "2020-11-30T08:15:22+00:00" 839 | }, 840 | { 841 | "name": "sebastian/comparator", 842 | "version": "1.2.4", 843 | "source": { 844 | "type": "git", 845 | "url": "https://github.com/sebastianbergmann/comparator.git", 846 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" 847 | }, 848 | "dist": { 849 | "type": "zip", 850 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 851 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 852 | "shasum": "" 853 | }, 854 | "require": { 855 | "php": ">=5.3.3", 856 | "sebastian/diff": "~1.2", 857 | "sebastian/exporter": "~1.2 || ~2.0" 858 | }, 859 | "require-dev": { 860 | "phpunit/phpunit": "~4.4" 861 | }, 862 | "type": "library", 863 | "extra": { 864 | "branch-alias": { 865 | "dev-master": "1.2.x-dev" 866 | } 867 | }, 868 | "autoload": { 869 | "classmap": [ 870 | "src/" 871 | ] 872 | }, 873 | "notification-url": "https://packagist.org/downloads/", 874 | "license": [ 875 | "BSD-3-Clause" 876 | ], 877 | "authors": [ 878 | { 879 | "name": "Jeff Welch", 880 | "email": "whatthejeff@gmail.com" 881 | }, 882 | { 883 | "name": "Volker Dusch", 884 | "email": "github@wallbash.com" 885 | }, 886 | { 887 | "name": "Bernhard Schussek", 888 | "email": "bschussek@2bepublished.at" 889 | }, 890 | { 891 | "name": "Sebastian Bergmann", 892 | "email": "sebastian@phpunit.de" 893 | } 894 | ], 895 | "description": "Provides the functionality to compare PHP values for equality", 896 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 897 | "keywords": [ 898 | "comparator", 899 | "compare", 900 | "equality" 901 | ], 902 | "support": { 903 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 904 | "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" 905 | }, 906 | "time": "2017-01-29T09:50:25+00:00" 907 | }, 908 | { 909 | "name": "sebastian/diff", 910 | "version": "1.4.3", 911 | "source": { 912 | "type": "git", 913 | "url": "https://github.com/sebastianbergmann/diff.git", 914 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" 915 | }, 916 | "dist": { 917 | "type": "zip", 918 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", 919 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", 920 | "shasum": "" 921 | }, 922 | "require": { 923 | "php": "^5.3.3 || ^7.0" 924 | }, 925 | "require-dev": { 926 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 927 | }, 928 | "type": "library", 929 | "extra": { 930 | "branch-alias": { 931 | "dev-master": "1.4-dev" 932 | } 933 | }, 934 | "autoload": { 935 | "classmap": [ 936 | "src/" 937 | ] 938 | }, 939 | "notification-url": "https://packagist.org/downloads/", 940 | "license": [ 941 | "BSD-3-Clause" 942 | ], 943 | "authors": [ 944 | { 945 | "name": "Kore Nordmann", 946 | "email": "mail@kore-nordmann.de" 947 | }, 948 | { 949 | "name": "Sebastian Bergmann", 950 | "email": "sebastian@phpunit.de" 951 | } 952 | ], 953 | "description": "Diff implementation", 954 | "homepage": "https://github.com/sebastianbergmann/diff", 955 | "keywords": [ 956 | "diff" 957 | ], 958 | "support": { 959 | "issues": "https://github.com/sebastianbergmann/diff/issues", 960 | "source": "https://github.com/sebastianbergmann/diff/tree/1.4" 961 | }, 962 | "time": "2017-05-22T07:24:03+00:00" 963 | }, 964 | { 965 | "name": "sebastian/environment", 966 | "version": "2.0.0", 967 | "source": { 968 | "type": "git", 969 | "url": "https://github.com/sebastianbergmann/environment.git", 970 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" 971 | }, 972 | "dist": { 973 | "type": "zip", 974 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 975 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 976 | "shasum": "" 977 | }, 978 | "require": { 979 | "php": "^5.6 || ^7.0" 980 | }, 981 | "require-dev": { 982 | "phpunit/phpunit": "^5.0" 983 | }, 984 | "type": "library", 985 | "extra": { 986 | "branch-alias": { 987 | "dev-master": "2.0.x-dev" 988 | } 989 | }, 990 | "autoload": { 991 | "classmap": [ 992 | "src/" 993 | ] 994 | }, 995 | "notification-url": "https://packagist.org/downloads/", 996 | "license": [ 997 | "BSD-3-Clause" 998 | ], 999 | "authors": [ 1000 | { 1001 | "name": "Sebastian Bergmann", 1002 | "email": "sebastian@phpunit.de" 1003 | } 1004 | ], 1005 | "description": "Provides functionality to handle HHVM/PHP environments", 1006 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1007 | "keywords": [ 1008 | "Xdebug", 1009 | "environment", 1010 | "hhvm" 1011 | ], 1012 | "support": { 1013 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1014 | "source": "https://github.com/sebastianbergmann/environment/tree/master" 1015 | }, 1016 | "time": "2016-11-26T07:53:53+00:00" 1017 | }, 1018 | { 1019 | "name": "sebastian/exporter", 1020 | "version": "2.0.0", 1021 | "source": { 1022 | "type": "git", 1023 | "url": "https://github.com/sebastianbergmann/exporter.git", 1024 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" 1025 | }, 1026 | "dist": { 1027 | "type": "zip", 1028 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 1029 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", 1030 | "shasum": "" 1031 | }, 1032 | "require": { 1033 | "php": ">=5.3.3", 1034 | "sebastian/recursion-context": "~2.0" 1035 | }, 1036 | "require-dev": { 1037 | "ext-mbstring": "*", 1038 | "phpunit/phpunit": "~4.4" 1039 | }, 1040 | "type": "library", 1041 | "extra": { 1042 | "branch-alias": { 1043 | "dev-master": "2.0.x-dev" 1044 | } 1045 | }, 1046 | "autoload": { 1047 | "classmap": [ 1048 | "src/" 1049 | ] 1050 | }, 1051 | "notification-url": "https://packagist.org/downloads/", 1052 | "license": [ 1053 | "BSD-3-Clause" 1054 | ], 1055 | "authors": [ 1056 | { 1057 | "name": "Jeff Welch", 1058 | "email": "whatthejeff@gmail.com" 1059 | }, 1060 | { 1061 | "name": "Volker Dusch", 1062 | "email": "github@wallbash.com" 1063 | }, 1064 | { 1065 | "name": "Bernhard Schussek", 1066 | "email": "bschussek@2bepublished.at" 1067 | }, 1068 | { 1069 | "name": "Sebastian Bergmann", 1070 | "email": "sebastian@phpunit.de" 1071 | }, 1072 | { 1073 | "name": "Adam Harvey", 1074 | "email": "aharvey@php.net" 1075 | } 1076 | ], 1077 | "description": "Provides the functionality to export PHP variables for visualization", 1078 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1079 | "keywords": [ 1080 | "export", 1081 | "exporter" 1082 | ], 1083 | "support": { 1084 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1085 | "source": "https://github.com/sebastianbergmann/exporter/tree/master" 1086 | }, 1087 | "time": "2016-11-19T08:54:04+00:00" 1088 | }, 1089 | { 1090 | "name": "sebastian/global-state", 1091 | "version": "1.1.1", 1092 | "source": { 1093 | "type": "git", 1094 | "url": "https://github.com/sebastianbergmann/global-state.git", 1095 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1096 | }, 1097 | "dist": { 1098 | "type": "zip", 1099 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1100 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1101 | "shasum": "" 1102 | }, 1103 | "require": { 1104 | "php": ">=5.3.3" 1105 | }, 1106 | "require-dev": { 1107 | "phpunit/phpunit": "~4.2" 1108 | }, 1109 | "suggest": { 1110 | "ext-uopz": "*" 1111 | }, 1112 | "type": "library", 1113 | "extra": { 1114 | "branch-alias": { 1115 | "dev-master": "1.0-dev" 1116 | } 1117 | }, 1118 | "autoload": { 1119 | "classmap": [ 1120 | "src/" 1121 | ] 1122 | }, 1123 | "notification-url": "https://packagist.org/downloads/", 1124 | "license": [ 1125 | "BSD-3-Clause" 1126 | ], 1127 | "authors": [ 1128 | { 1129 | "name": "Sebastian Bergmann", 1130 | "email": "sebastian@phpunit.de" 1131 | } 1132 | ], 1133 | "description": "Snapshotting of global state", 1134 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1135 | "keywords": [ 1136 | "global state" 1137 | ], 1138 | "support": { 1139 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1140 | "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" 1141 | }, 1142 | "time": "2015-10-12T03:26:01+00:00" 1143 | }, 1144 | { 1145 | "name": "sebastian/object-enumerator", 1146 | "version": "2.0.1", 1147 | "source": { 1148 | "type": "git", 1149 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1150 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" 1151 | }, 1152 | "dist": { 1153 | "type": "zip", 1154 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", 1155 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", 1156 | "shasum": "" 1157 | }, 1158 | "require": { 1159 | "php": ">=5.6", 1160 | "sebastian/recursion-context": "~2.0" 1161 | }, 1162 | "require-dev": { 1163 | "phpunit/phpunit": "~5" 1164 | }, 1165 | "type": "library", 1166 | "extra": { 1167 | "branch-alias": { 1168 | "dev-master": "2.0.x-dev" 1169 | } 1170 | }, 1171 | "autoload": { 1172 | "classmap": [ 1173 | "src/" 1174 | ] 1175 | }, 1176 | "notification-url": "https://packagist.org/downloads/", 1177 | "license": [ 1178 | "BSD-3-Clause" 1179 | ], 1180 | "authors": [ 1181 | { 1182 | "name": "Sebastian Bergmann", 1183 | "email": "sebastian@phpunit.de" 1184 | } 1185 | ], 1186 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1187 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1188 | "support": { 1189 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1190 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" 1191 | }, 1192 | "time": "2017-02-18T15:18:39+00:00" 1193 | }, 1194 | { 1195 | "name": "sebastian/recursion-context", 1196 | "version": "2.0.0", 1197 | "source": { 1198 | "type": "git", 1199 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1200 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" 1201 | }, 1202 | "dist": { 1203 | "type": "zip", 1204 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1205 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", 1206 | "shasum": "" 1207 | }, 1208 | "require": { 1209 | "php": ">=5.3.3" 1210 | }, 1211 | "require-dev": { 1212 | "phpunit/phpunit": "~4.4" 1213 | }, 1214 | "type": "library", 1215 | "extra": { 1216 | "branch-alias": { 1217 | "dev-master": "2.0.x-dev" 1218 | } 1219 | }, 1220 | "autoload": { 1221 | "classmap": [ 1222 | "src/" 1223 | ] 1224 | }, 1225 | "notification-url": "https://packagist.org/downloads/", 1226 | "license": [ 1227 | "BSD-3-Clause" 1228 | ], 1229 | "authors": [ 1230 | { 1231 | "name": "Jeff Welch", 1232 | "email": "whatthejeff@gmail.com" 1233 | }, 1234 | { 1235 | "name": "Sebastian Bergmann", 1236 | "email": "sebastian@phpunit.de" 1237 | }, 1238 | { 1239 | "name": "Adam Harvey", 1240 | "email": "aharvey@php.net" 1241 | } 1242 | ], 1243 | "description": "Provides functionality to recursively process PHP variables", 1244 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1245 | "support": { 1246 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1247 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" 1248 | }, 1249 | "time": "2016-11-19T07:33:16+00:00" 1250 | }, 1251 | { 1252 | "name": "sebastian/resource-operations", 1253 | "version": "1.0.0", 1254 | "source": { 1255 | "type": "git", 1256 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1257 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1258 | }, 1259 | "dist": { 1260 | "type": "zip", 1261 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1262 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1263 | "shasum": "" 1264 | }, 1265 | "require": { 1266 | "php": ">=5.6.0" 1267 | }, 1268 | "type": "library", 1269 | "extra": { 1270 | "branch-alias": { 1271 | "dev-master": "1.0.x-dev" 1272 | } 1273 | }, 1274 | "autoload": { 1275 | "classmap": [ 1276 | "src/" 1277 | ] 1278 | }, 1279 | "notification-url": "https://packagist.org/downloads/", 1280 | "license": [ 1281 | "BSD-3-Clause" 1282 | ], 1283 | "authors": [ 1284 | { 1285 | "name": "Sebastian Bergmann", 1286 | "email": "sebastian@phpunit.de" 1287 | } 1288 | ], 1289 | "description": "Provides a list of PHP built-in functions that operate on resources", 1290 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1291 | "support": { 1292 | "issues": "https://github.com/sebastianbergmann/resource-operations/issues", 1293 | "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" 1294 | }, 1295 | "abandoned": true, 1296 | "time": "2015-07-28T20:34:47+00:00" 1297 | }, 1298 | { 1299 | "name": "sebastian/version", 1300 | "version": "2.0.1", 1301 | "source": { 1302 | "type": "git", 1303 | "url": "https://github.com/sebastianbergmann/version.git", 1304 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1305 | }, 1306 | "dist": { 1307 | "type": "zip", 1308 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1309 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1310 | "shasum": "" 1311 | }, 1312 | "require": { 1313 | "php": ">=5.6" 1314 | }, 1315 | "type": "library", 1316 | "extra": { 1317 | "branch-alias": { 1318 | "dev-master": "2.0.x-dev" 1319 | } 1320 | }, 1321 | "autoload": { 1322 | "classmap": [ 1323 | "src/" 1324 | ] 1325 | }, 1326 | "notification-url": "https://packagist.org/downloads/", 1327 | "license": [ 1328 | "BSD-3-Clause" 1329 | ], 1330 | "authors": [ 1331 | { 1332 | "name": "Sebastian Bergmann", 1333 | "email": "sebastian@phpunit.de", 1334 | "role": "lead" 1335 | } 1336 | ], 1337 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1338 | "homepage": "https://github.com/sebastianbergmann/version", 1339 | "support": { 1340 | "issues": "https://github.com/sebastianbergmann/version/issues", 1341 | "source": "https://github.com/sebastianbergmann/version/tree/master" 1342 | }, 1343 | "time": "2016-10-03T07:35:21+00:00" 1344 | }, 1345 | { 1346 | "name": "symfony/polyfill-ctype", 1347 | "version": "v1.23.0", 1348 | "source": { 1349 | "type": "git", 1350 | "url": "https://github.com/symfony/polyfill-ctype.git", 1351 | "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" 1352 | }, 1353 | "dist": { 1354 | "type": "zip", 1355 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", 1356 | "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", 1357 | "shasum": "" 1358 | }, 1359 | "require": { 1360 | "php": ">=7.1" 1361 | }, 1362 | "suggest": { 1363 | "ext-ctype": "For best performance" 1364 | }, 1365 | "type": "library", 1366 | "extra": { 1367 | "branch-alias": { 1368 | "dev-main": "1.23-dev" 1369 | }, 1370 | "thanks": { 1371 | "name": "symfony/polyfill", 1372 | "url": "https://github.com/symfony/polyfill" 1373 | } 1374 | }, 1375 | "autoload": { 1376 | "psr-4": { 1377 | "Symfony\\Polyfill\\Ctype\\": "" 1378 | }, 1379 | "files": [ 1380 | "bootstrap.php" 1381 | ] 1382 | }, 1383 | "notification-url": "https://packagist.org/downloads/", 1384 | "license": [ 1385 | "MIT" 1386 | ], 1387 | "authors": [ 1388 | { 1389 | "name": "Gert de Pagter", 1390 | "email": "BackEndTea@gmail.com" 1391 | }, 1392 | { 1393 | "name": "Symfony Community", 1394 | "homepage": "https://symfony.com/contributors" 1395 | } 1396 | ], 1397 | "description": "Symfony polyfill for ctype functions", 1398 | "homepage": "https://symfony.com", 1399 | "keywords": [ 1400 | "compatibility", 1401 | "ctype", 1402 | "polyfill", 1403 | "portable" 1404 | ], 1405 | "support": { 1406 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" 1407 | }, 1408 | "funding": [ 1409 | { 1410 | "url": "https://symfony.com/sponsor", 1411 | "type": "custom" 1412 | }, 1413 | { 1414 | "url": "https://github.com/fabpot", 1415 | "type": "github" 1416 | }, 1417 | { 1418 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1419 | "type": "tidelift" 1420 | } 1421 | ], 1422 | "time": "2021-02-19T12:13:01+00:00" 1423 | }, 1424 | { 1425 | "name": "symfony/yaml", 1426 | "version": "v4.4.25", 1427 | "source": { 1428 | "type": "git", 1429 | "url": "https://github.com/symfony/yaml.git", 1430 | "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc" 1431 | }, 1432 | "dist": { 1433 | "type": "zip", 1434 | "url": "https://api.github.com/repos/symfony/yaml/zipball/81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", 1435 | "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", 1436 | "shasum": "" 1437 | }, 1438 | "require": { 1439 | "php": ">=7.1.3", 1440 | "symfony/polyfill-ctype": "~1.8" 1441 | }, 1442 | "conflict": { 1443 | "symfony/console": "<3.4" 1444 | }, 1445 | "require-dev": { 1446 | "symfony/console": "^3.4|^4.0|^5.0" 1447 | }, 1448 | "suggest": { 1449 | "symfony/console": "For validating YAML files using the lint command" 1450 | }, 1451 | "type": "library", 1452 | "autoload": { 1453 | "psr-4": { 1454 | "Symfony\\Component\\Yaml\\": "" 1455 | }, 1456 | "exclude-from-classmap": [ 1457 | "/Tests/" 1458 | ] 1459 | }, 1460 | "notification-url": "https://packagist.org/downloads/", 1461 | "license": [ 1462 | "MIT" 1463 | ], 1464 | "authors": [ 1465 | { 1466 | "name": "Fabien Potencier", 1467 | "email": "fabien@symfony.com" 1468 | }, 1469 | { 1470 | "name": "Symfony Community", 1471 | "homepage": "https://symfony.com/contributors" 1472 | } 1473 | ], 1474 | "description": "Loads and dumps YAML files", 1475 | "homepage": "https://symfony.com", 1476 | "support": { 1477 | "source": "https://github.com/symfony/yaml/tree/v4.4.25" 1478 | }, 1479 | "funding": [ 1480 | { 1481 | "url": "https://symfony.com/sponsor", 1482 | "type": "custom" 1483 | }, 1484 | { 1485 | "url": "https://github.com/fabpot", 1486 | "type": "github" 1487 | }, 1488 | { 1489 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1490 | "type": "tidelift" 1491 | } 1492 | ], 1493 | "time": "2021-05-26T17:39:37+00:00" 1494 | }, 1495 | { 1496 | "name": "webmozart/assert", 1497 | "version": "1.10.0", 1498 | "source": { 1499 | "type": "git", 1500 | "url": "https://github.com/webmozarts/assert.git", 1501 | "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" 1502 | }, 1503 | "dist": { 1504 | "type": "zip", 1505 | "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", 1506 | "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", 1507 | "shasum": "" 1508 | }, 1509 | "require": { 1510 | "php": "^7.2 || ^8.0", 1511 | "symfony/polyfill-ctype": "^1.8" 1512 | }, 1513 | "conflict": { 1514 | "phpstan/phpstan": "<0.12.20", 1515 | "vimeo/psalm": "<4.6.1 || 4.6.2" 1516 | }, 1517 | "require-dev": { 1518 | "phpunit/phpunit": "^8.5.13" 1519 | }, 1520 | "type": "library", 1521 | "extra": { 1522 | "branch-alias": { 1523 | "dev-master": "1.10-dev" 1524 | } 1525 | }, 1526 | "autoload": { 1527 | "psr-4": { 1528 | "Webmozart\\Assert\\": "src/" 1529 | } 1530 | }, 1531 | "notification-url": "https://packagist.org/downloads/", 1532 | "license": [ 1533 | "MIT" 1534 | ], 1535 | "authors": [ 1536 | { 1537 | "name": "Bernhard Schussek", 1538 | "email": "bschussek@gmail.com" 1539 | } 1540 | ], 1541 | "description": "Assertions to validate method input/output with nice error messages.", 1542 | "keywords": [ 1543 | "assert", 1544 | "check", 1545 | "validate" 1546 | ], 1547 | "support": { 1548 | "issues": "https://github.com/webmozarts/assert/issues", 1549 | "source": "https://github.com/webmozarts/assert/tree/1.10.0" 1550 | }, 1551 | "time": "2021-03-09T10:59:23+00:00" 1552 | } 1553 | ], 1554 | "aliases": [], 1555 | "minimum-stability": "stable", 1556 | "stability-flags": [], 1557 | "prefer-stable": false, 1558 | "prefer-lowest": false, 1559 | "platform": [], 1560 | "platform-dev": [], 1561 | "plugin-api-version": "2.1.0" 1562 | } 1563 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | ol#event-list { 2 | margin-left: 30px; 3 | } 4 | 5 | p#webhooks-hint { 6 | margin-top: 16px; 7 | } -------------------------------------------------------------------------------- /img/app-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /img/app.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/AppInfo/Application.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Paweł Kuffel 9 | * 10 | * @license GNU AGPL version 3 or any later version 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU Affero General Public License as 14 | * published by the Free Software Foundation, either version 3 of the 15 | * License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | * 25 | */ 26 | namespace OCA\Webhooks\AppInfo; 27 | 28 | use OCA\Webhooks\Listeners\CalendarObjectCreatedListener; 29 | use OCA\Webhooks\Listeners\CalendarObjectUpdatedListener; 30 | use OCA\Webhooks\Listeners\CalendarObjectDeletedListener; 31 | use OCA\Webhooks\Listeners\CalendarObjectMovedToTrashListener; 32 | use OCA\Webhooks\Listeners\UserLiveStatusListener; 33 | use OCA\Webhooks\Listeners\LoginFailedListener; 34 | use OCA\Webhooks\Listeners\PasswordUpdatedListener; 35 | use OCA\Webhooks\Listeners\ShareCreatedListener; 36 | use OCA\Webhooks\Listeners\UserChangedListener; 37 | use OCA\Webhooks\Listeners\UserCreatedListener; 38 | use OCA\Webhooks\Listeners\UserDeletedListener; 39 | use OCA\Webhooks\Listeners\UserLoggedInListener; 40 | use OCA\Webhooks\Listeners\UserLoggedOutListener; 41 | 42 | use OCA\DAV\Events\CalendarObjectCreatedEvent; 43 | use OCA\DAV\Events\CalendarObjectDeletedEvent; 44 | use OCA\DAV\Events\CalendarObjectMovedToTrashEvent; 45 | use OCA\DAV\Events\CalendarObjectUpdatedEvent; 46 | use OCA\Webhooks\Flow\RegisterFlowOperationsListener; 47 | use OCP\Authentication\Events\LoginFailedEvent; 48 | use OCP\Share\Events\ShareCreatedEvent; 49 | use OCP\User\Events\UserChangedEvent; 50 | use OCP\User\Events\UserCreatedEvent; 51 | use OCP\User\Events\UserDeletedEvent; 52 | use OCP\User\Events\UserLoggedInEvent; 53 | use OCP\User\Events\UserLoggedOutEvent; 54 | 55 | use OCP\AppFramework\App; 56 | use OCP\AppFramework\Bootstrap\IBootContext; 57 | use OCP\AppFramework\Bootstrap\IBootstrap; 58 | use OCP\AppFramework\Bootstrap\IRegistrationContext; 59 | use OCP\User\Events\PasswordUpdatedEvent; 60 | use OCP\User\Events\UserLiveStatusEvent; 61 | use OCP\WorkflowEngine\Events\RegisterOperationsEvent; 62 | 63 | /** 64 | * Class Application 65 | * 66 | * @package OCA\Webhooks\AppInfo 67 | */ 68 | class Application extends App implements IBootstrap { 69 | 70 | public function __construct() { 71 | parent::__construct('webhooks'); 72 | } 73 | 74 | public function register(IRegistrationContext $context):void { 75 | $context->registerEventListener(CalendarObjectCreatedEvent::class, CalendarObjectCreatedListener::class); 76 | $context->registerEventListener(CalendarObjectUpdatedEvent::class, CalendarObjectUpdatedListener::class); 77 | $context->registerEventListener(CalendarObjectDeletedEvent::class, CalendarObjectDeletedListener::class); 78 | $context->registerEventListener(CalendarObjectMovedToTrashEvent::class, CalendarObjectMovedToTrashListener::class); 79 | $context->registerEventListener(LoginFailedEvent::class, LoginFailedListener::class); 80 | $context->registerEventListener(PasswordUpdatedEvent::class, PasswordUpdatedListener::class); 81 | $context->registerEventListener(ShareCreatedEvent::class, ShareCreatedListener::class); 82 | $context->registerEventListener(UserChangedEvent::class, UserChangedListener::class); 83 | $context->registerEventListener(UserCreatedEvent::class, UserCreatedListener::class); 84 | $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); 85 | $context->registerEventListener(UserLiveStatusEvent::class, UserLiveStatusListener::class); 86 | $context->registerEventListener(UserLoggedInEvent::class, UserLoggedInListener::class); 87 | $context->registerEventListener(UserLoggedOutEvent::class, UserLoggedOutListener::class); 88 | 89 | $context->registerEventListener(RegisterOperationsEvent::class, RegisterFlowOperationsListener::class); 90 | } 91 | 92 | public function boot(IBootContext $context): void {} 93 | 94 | public static function getAllConfigNames() { 95 | return array( 96 | "Calendar Object Created" => CalendarObjectCreatedListener::CONFIG_NAME, 97 | "Calendar Object Updated" => CalendarObjectUpdatedListener::CONFIG_NAME, 98 | "Calendar Object Deleted" => CalendarObjectDeletedListener::CONFIG_NAME, 99 | "Calendar Object Moved to Trash" => CalendarObjectMovedToTrashListener::CONFIG_NAME, 100 | "Login Failed" => LoginFailedListener::CONFIG_NAME, 101 | "Password Updated" => PasswordUpdatedListener::CONFIG_NAME, 102 | "Share Created" => ShareCreatedListener::CONFIG_NAME, 103 | "User Changed" => UserChangedListener::CONFIG_NAME, 104 | "User Created" => UserCreatedListener::CONFIG_NAME, 105 | "User Deleted" => UserDeletedListener::CONFIG_NAME, 106 | "User Live Status" => UserLiveStatusListener::CONFIG_NAME, 107 | "User Logged In" => UserLoggedInListener::CONFIG_NAME, 108 | "User Logged Out" => UserLoggedOutListener::CONFIG_NAME, 109 | ); 110 | } 111 | } -------------------------------------------------------------------------------- /lib/Flow/Operation.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Flow; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCA\Webhooks\Utils\SignedRequest; 28 | use OCA\WorkflowEngine\Entity\File; 29 | use OCP\EventDispatcher\Event; 30 | use OCP\EventDispatcher\GenericEvent; 31 | use OCP\Files\Node; 32 | use OCP\IConfig; 33 | use OCP\IURLGenerator; 34 | use OCP\SystemTag\MapperEvent; 35 | use OCP\WorkflowEngine\IOperation; 36 | use Psr\Log\LoggerInterface; 37 | use OCP\WorkflowEngine\IManager as FlowManager; 38 | use OCP\WorkflowEngine\IRuleMatcher; 39 | use Symfony\Component\EventDispatcher\GenericEvent as LegacyGenericEvent; 40 | use UnexpectedValueException; 41 | 42 | class Operation implements IOperation { 43 | 44 | /** @var IURLGenerator */ 45 | private $urlGenerator; 46 | /** @var LoggerInterface */ 47 | private $logger; 48 | /** @var IConfig */ 49 | private $config; 50 | 51 | public function __construct( 52 | IURLGenerator $urlGenerator, 53 | LoggerInterface $logger, 54 | IConfig $config 55 | ) { 56 | $this->urlGenerator = $urlGenerator; 57 | $this->logger = $logger; 58 | $this->config = $config; 59 | } 60 | 61 | /** 62 | * @inheritDoc 63 | */ 64 | public function getDisplayName(): string { 65 | return 'Outgoing webhook'; 66 | } 67 | 68 | /** 69 | * @inheritDoc 70 | */ 71 | public function getDescription(): string { 72 | return 'Triggers an outgoing HTTP POST Webhook'; 73 | } 74 | 75 | /** 76 | * @inheritDoc 77 | */ 78 | public function getIcon(): string { 79 | return $this->urlGenerator->imagePath('webhooks', 'app.svg'); 80 | } 81 | 82 | /** 83 | * @inheritDoc 84 | */ 85 | public function isAvailableForScope(int $scope): bool { 86 | return $scope === FlowManager::SCOPE_ADMIN; 87 | } 88 | 89 | /** 90 | * @inheritDoc 91 | */ 92 | public function validateOperation(string $name, array $checks, string $operation): void { 93 | // pass 94 | } 95 | 96 | /** 97 | * @inheritDoc 98 | */ 99 | public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void { 100 | $flows = $ruleMatcher->getFlows(false); 101 | foreach ($flows as $flow) { 102 | try { 103 | $entity = $ruleMatcher->getEntity(); 104 | $entityClass = get_class($entity); 105 | $eventDto = array("eventType" => $entityClass, "eventName" => $eventName); 106 | 107 | if ($eventName === '\OCP\Files::postRename' || $eventName === '\OCP\Files::postCopy') { 108 | /** @var Node $node */ 109 | [$oldNode, $node] = $event->getSubject(); 110 | $eventDto['node'] = DtoExtractor::buildNodeDto($node); 111 | } elseif ($event instanceof GenericEvent || $event instanceof LegacyGenericEvent) { 112 | /** @var Node $node */ 113 | $node = $event->getSubject(); 114 | $eventDto['node'] = DtoExtractor::buildNodeDto($node); 115 | } elseif ($event instanceof MapperEvent) { 116 | $eventDto['mapperEvent'] = DtoExtractor::buildMapperEventDto($event); 117 | } 118 | if ($entity instanceof File) { 119 | $eventDto['workflowFile'] = DtoExtractor::buildWorkflowFileDto($entity); 120 | } 121 | 122 | $flowOptions = json_decode($flow['operation'], true); 123 | if (!is_array($flowOptions) || empty($flowOptions)) { 124 | throw new UnexpectedValueException('Cannot decode operation details'); 125 | } 126 | 127 | $url = trim($flowOptions['url'] ?? ''); 128 | 129 | if ($url !== '' && filter_var($url, FILTER_VALIDATE_URL)) { 130 | SignedRequest::sendSignedRequest($eventDto, $this->config->getSystemValue("webhooks_secret"), $url); 131 | } 132 | 133 | } catch (UnexpectedValueException $e) { 134 | continue; 135 | } 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /lib/Flow/RegisterFlowOperationsListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Flow; 25 | 26 | use OCA\Webhooks\Flow\Operation; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\IServerContainer; 30 | use OCP\Util; 31 | use OCP\WorkflowEngine\Events\RegisterOperationsEvent; 32 | 33 | class RegisterFlowOperationsListener implements IEventListener { 34 | 35 | /** @var IServerContainer */ 36 | private $container; 37 | 38 | public function __construct(IServerContainer $container) { 39 | $this->container = $container; 40 | } 41 | 42 | /** 43 | * @inheritDoc 44 | */ 45 | public function handle(Event $event): void { 46 | if (!$event instanceof RegisterOperationsEvent) { 47 | return; 48 | } 49 | $operation = $this->container->get(Operation::class); 50 | $event->registerOperation($operation); 51 | Util::addScript('webhooks', 'webhooks-main'); 52 | } 53 | } -------------------------------------------------------------------------------- /lib/Listeners/AbstractListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\SignedRequest; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use \OCP\IConfig; 30 | 31 | /** 32 | * Class AbstractListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | abstract class AbstractListener implements IEventListener { 37 | 38 | /** @var IConfig */ 39 | protected $config; 40 | protected $endpoint; 41 | protected $secret; 42 | 43 | public const CONFIG_NAME = ""; 44 | 45 | public function __construct(IConfig $config) 46 | { 47 | $this->config = $config; 48 | $this->endpoint = $this->config->getSystemValue(static::CONFIG_NAME); 49 | $this->secret = $this->config->getSystemValue("webhooks_secret"); 50 | } 51 | 52 | public function handle(Event $event): void { 53 | if ($this->endpoint === "") { 54 | return; 55 | } 56 | 57 | $url = parse_url($this->endpoint); 58 | 59 | if ($url['scheme'] !== "https" && $url['scheme'] !== "http") { 60 | return; 61 | } 62 | 63 | $dto = $this->handleIncomingEvent($event); 64 | $dto['eventType'] = get_class($event); 65 | 66 | if (!empty($dto)) { 67 | $this->sendDto($dto); 68 | } 69 | } 70 | 71 | protected function sendDto(array $eventDto): void { 72 | SignedRequest::sendSignedRequest($eventDto, $this->secret, $this->endpoint); 73 | } 74 | 75 | abstract public function handleIncomingEvent(Event $event); 76 | } -------------------------------------------------------------------------------- /lib/Listeners/CalendarObjectCreatedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCA\DAV\Events\CalendarObjectCreatedEvent; 29 | 30 | /** 31 | * Class CalendarObjectCreatedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class CalendarObjectCreatedListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_calendar_object_created_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf CalendarObjectCreatedEvent)) { 41 | return; 42 | } 43 | 44 | return array( 45 | "calendarId" => $event->getCalendarId(), 46 | "calendarData" => $event->getCalendarData(), 47 | "shares" => $event->getShares(), 48 | "objectData" => $event->getObjectData(), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/CalendarObjectDeletedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCA\DAV\Events\CalendarObjectDeletedEvent; 29 | 30 | /** 31 | * Class CalendarObjectUpdatedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class CalendarObjectDeletedListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_calendar_object_deleted_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf CalendarObjectDeletedEvent)) { 41 | return; 42 | } 43 | 44 | return array( 45 | "calendarId" => $event->getCalendarId(), 46 | "calendarData" => $event->getCalendarData(), 47 | "shares" => $event->getShares(), 48 | "objectData" => $event->getObjectData(), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/CalendarObjectMovedToTrashListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCA\DAV\Events\CalendarObjectMovedToTrashEvent; 29 | 30 | /** 31 | * Class CalendarObjectUpdatedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class CalendarObjectMovedToTrashListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_calendar_object_moved_to_trash_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf CalendarObjectMovedToTrashEvent)) { 41 | return; 42 | } 43 | 44 | return array( 45 | "calendarId" => $event->getCalendarId(), 46 | "calendarData" => $event->getCalendarData(), 47 | "shares" => $event->getShares(), 48 | "objectData" => $event->getObjectData(), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/CalendarObjectUpdatedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCA\DAV\Events\CalendarObjectUpdatedEvent; 29 | 30 | /** 31 | * Class CalendarObjectUpdatedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class CalendarObjectUpdatedListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_calendar_object_updated_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf CalendarObjectUpdatedEvent)) { 41 | return; 42 | } 43 | 44 | return array( 45 | "calendarId" => $event->getCalendarId(), 46 | "calendarData" => $event->getCalendarData(), 47 | "shares" => $event->getShares(), 48 | "objectData" => $event->getObjectData(), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/LoginFailedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCP\Authentication\Events\LoginFailedEvent; 29 | 30 | /** 31 | * Class LoginFailedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class LoginFailedListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_login_failed_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf LoginFailedEvent)) { 41 | return; 42 | } 43 | 44 | return array( 45 | "userId" => $event->getUid(), 46 | ); 47 | } 48 | } -------------------------------------------------------------------------------- /lib/Listeners/PasswordUpdatedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\PasswordUpdatedEvent; 30 | 31 | /** 32 | * Class PasswordUpdatedListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class PasswordUpdatedListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_password_updated_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf PasswordUpdatedEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Listeners/ShareCreatedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCP\EventDispatcher\Event; 27 | use OCP\EventDispatcher\IEventListener; 28 | use OCP\Share\Events\ShareCreatedEvent; 29 | 30 | /** 31 | * Class ShareCreatedListener 32 | * 33 | * @package OCA\Webhooks\Listeners 34 | */ 35 | class ShareCreatedListener extends AbstractListener implements IEventListener { 36 | 37 | public const CONFIG_NAME = "webhooks_share_created_url"; 38 | 39 | public function handleIncomingEvent(Event $event) { 40 | if (!($event instanceOf ShareCreatedEvent)) { 41 | return; 42 | } 43 | 44 | $share = $event->getShare(); 45 | 46 | return array( 47 | 'id' => $share->getId(), 48 | 'fullId' => $share->getFullId(), 49 | 'nodeId' => $share->getNodeId(), 50 | 'nodeType' => $share->getNodeType(), 51 | 'shareType' => $share->getShareType(), 52 | 'sharedWith' => $share->getSharedWith(), 53 | 'sharedWithDisplayName' => $share->getSharedWithDisplayName(), 54 | 'sharedWithAvatar' => $share->getSharedWithAvatar(), 55 | 'permissions' => $share->getPermissions(), 56 | 'status' => $share->getStatus(), 57 | 'note' => $share->getNote(), 58 | 'expirationDate' => $share->getExpirationDate(), 59 | 'label' => $share->getLabel(), 60 | 'sharedBy' => $share->getSharedBy(), 61 | 'shareOwner' => $share->getShareOwner(), 62 | 'token' => $share->getToken(), 63 | 'target' => $share->getTarget(), 64 | 'shareTime' => $share->getShareTime(), 65 | 'mailSend' => $share->getMailSend(), 66 | 'hideDownload' => $share->getHideDownload(), 67 | ); 68 | } 69 | } -------------------------------------------------------------------------------- /lib/Listeners/UserChangedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserChangedEvent; 30 | 31 | /** 32 | * Class UserChangedListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserChangedListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_changed_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserChangedEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | "feature" => $event->getFeature(), 50 | "value" => $event->getValue(), 51 | "oldValue" => $event->getOldValue(), 52 | ); 53 | } 54 | } -------------------------------------------------------------------------------- /lib/Listeners/UserCreatedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserCreatedEvent; 30 | 31 | /** 32 | * Class UserCreatedListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserCreatedListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_created_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserCreatedEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/UserDeletedListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserDeletedEvent; 30 | 31 | /** 32 | * Class UserDeletedListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserDeletedListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_deleted_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserDeletedEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Listeners/UserLiveStatusListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserLiveStatusEvent; 30 | 31 | /** 32 | * Class UserLiveStatusListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserLiveStatusListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_status_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserLiveStatusEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | "status" => $event->getStatus(), 50 | "timestamp" => $event->getTimestamp(), 51 | ); 52 | } 53 | } -------------------------------------------------------------------------------- /lib/Listeners/UserLoggedInListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserLoggedInEvent; 30 | 31 | /** 32 | * Class UserLoggedInListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserLoggedInListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_logged_in_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserLoggedInEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | 'loginName' => $event->getLoginName(), 50 | 'isTokenLogin' => $event->isTokenLogin(), 51 | ); 52 | } 53 | } -------------------------------------------------------------------------------- /lib/Listeners/UserLoggedOutListener.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @author Paweł Kuffel 7 | * 8 | * @license GNU AGPL version 3 or any later version 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as 12 | * published by the Free Software Foundation, either version 3 of the 13 | * License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | * 23 | */ 24 | namespace OCA\Webhooks\Listeners; 25 | 26 | use OCA\Webhooks\Utils\DtoExtractor; 27 | use OCP\EventDispatcher\Event; 28 | use OCP\EventDispatcher\IEventListener; 29 | use OCP\User\Events\UserLoggedOutEvent; 30 | 31 | /** 32 | * Class UserLoggedOutListener 33 | * 34 | * @package OCA\Webhooks\Listeners 35 | */ 36 | class UserLoggedOutListener extends AbstractListener implements IEventListener { 37 | 38 | public const CONFIG_NAME = "webhooks_user_logged_out_url"; 39 | 40 | public function handleIncomingEvent(Event $event) { 41 | if (!($event instanceOf UserLoggedOutEvent)) { 42 | return; 43 | } 44 | 45 | $user = $event->getUser(); 46 | 47 | return array( 48 | "user" => DtoExtractor::buildUserDto($user), 49 | ); 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Settings/Admin.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Paweł Kuffel 9 | * 10 | * @license GNU AGPL version 3 or any later version 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU Affero General Public License as 14 | * published by the Free Software Foundation, either version 3 of the 15 | * License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | * 25 | */ 26 | namespace OCA\Webhooks\Settings; 27 | 28 | use OCP\AppFramework\Http\TemplateResponse; 29 | use OCP\IConfig; 30 | use OCP\IInitialStateService; 31 | use OCP\Settings\ISettings; 32 | use OCA\Webhooks\AppInfo\Application; 33 | 34 | class Admin implements ISettings { 35 | 36 | /** @var IConfig */ 37 | private $config; 38 | 39 | public function __construct(IConfig $config) { 40 | $this->config = $config; 41 | } 42 | 43 | public function getForm(): TemplateResponse { 44 | $events = Application::getAllConfigNames(); 45 | $activeEvents = array(); 46 | $inactiveEvents = array(); 47 | 48 | foreach ($events as $eventName => $configName) { 49 | $webhookUrl = $this->config->getSystemValue($configName); 50 | if (empty($webhookUrl)) { 51 | $inactiveEvents[$eventName] = $configName; 52 | } else { 53 | $activeEvents[$eventName] = $webhookUrl; 54 | } 55 | } 56 | 57 | return new TemplateResponse( 58 | 'webhooks', 59 | 'admin', 60 | [ 61 | 'secret' => $this->config->getSystemValue('webhooks_secret'), 62 | 'canCurl' => Admin::testCurl(), 63 | 'activeEvents' => $activeEvents, 64 | 'inactiveEvents' => $inactiveEvents, 65 | ], 66 | '' 67 | ); 68 | } 69 | 70 | public function getSection(): string { 71 | return 'security'; 72 | } 73 | 74 | public function getPriority(): int { 75 | return 200; 76 | } 77 | 78 | public static function testCurl(): bool { 79 | $output = null; 80 | $retCode = null; 81 | exec('curl --help', $output, $retCode); 82 | return ($retCode == 0); 83 | } 84 | } 85 | 86 | -------------------------------------------------------------------------------- /lib/Utils/DtoExtractor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Paweł Kuffel 9 | * 10 | * @license GNU AGPL version 3 or any later version 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU Affero General Public License as 14 | * published by the Free Software Foundation, either version 3 of the 15 | * License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | * 25 | */ 26 | namespace OCA\Webhooks\Utils; 27 | 28 | use OCA\WorkflowEngine\Entity\File; 29 | use OCP\Files\Node; 30 | use OCP\IUser; 31 | use OCP\SystemTag\MapperEvent; 32 | 33 | class DtoExtractor { 34 | 35 | public static function buildUserDto(IUser $user) { 36 | return array( 37 | 'id' => $user->getUID(), 38 | 'displayName' => $user->getDisplayName(), 39 | 'lastLogin' => $user->getLastLogin(), 40 | 'home' => $user->getHome(), 41 | 'emailAddress' => $user->getEMailAddress(), 42 | 'cloudId' => $user->getCloudId(), 43 | 'quota' => $user->getQuota(), 44 | ); 45 | } 46 | 47 | public static function buildWorkflowFileDto(File $file) { 48 | return array( 49 | 'displayText' => $file->getDisplayText(), 50 | 'url' => $file->getUrl(), 51 | ); 52 | } 53 | 54 | public static function buildNodeDto(Node $node) { 55 | return array( 56 | 'id' => $node->getId(), 57 | 'storage' => $node->getStorage(), 58 | 'path' => $node->getPath(), 59 | 'internalPath' => $node->getInternalPath(), 60 | 'modifiedTime' => $node->getMTime(), 61 | 'mimeType' => $node->getMimetype(), 62 | 'size' => $node->getSize(), 63 | 'Etag' => $node->getEtag(), 64 | 'permissions' => $node->getPermissions(), 65 | 'isUpdateable' => $node->isUpdateable(), 66 | 'isDeletable' => $node->isDeletable(), 67 | 'isShareable' => $node->isShareable(), 68 | ); 69 | } 70 | 71 | public static function buildMapperEventDto(MapperEvent $event) { 72 | return array( 73 | 'eventName' => $event->getEvent(), 74 | 'objectType' => $event->getObjectType(), 75 | 'objectId' => $event->getObjectId(), 76 | 'tags' => $event->getTags(), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/Utils/SignedRequest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Paweł Kuffel 9 | * 10 | * @license GNU AGPL version 3 or any later version 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU Affero General Public License as 14 | * published by the Free Software Foundation, either version 3 of the 15 | * License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | * 25 | */ 26 | namespace OCA\Webhooks\Utils; 27 | 28 | class SignedRequest { 29 | 30 | public static function sendSignedRequest(array $eventDto, $secret, $endpoint) { 31 | $eventJSON = json_encode($eventDto); 32 | $bodyHash = hash('sha256', $eventJSON . $secret); 33 | $eventJSONescaped = escapeshellarg($eventJSON); 34 | $endpointEscaped = escapeshellarg($endpoint); 35 | 36 | $curl = "curl $endpointEscaped --header \"X-Nextcloud-Webhooks: $bodyHash\" "; 37 | $curl .= "--header \"Content-Type: application/json\" --request POST "; 38 | $curl .= "--data $eventJSONescaped > /dev/null 2>&1 &"; 39 | 40 | exec($curl); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhooks", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "src/main.js", 6 | "directories": { 7 | "lib": "lib" 8 | }, 9 | "scripts": { 10 | "build": "NODE_ENV=production webpack --progress --config webpack.js", 11 | "dev": "NODE_ENV=development webpack --progress --config webpack.js", 12 | "watch": "NODE_ENV=development webpack --progress --watch --config webpack.js", 13 | "lint": "eslint --ext .js,.vue src", 14 | "lint:fix": "eslint --ext .js,.vue src --fix", 15 | "stylelint": "stylelint **/*.css **/*.scss **/*.vue", 16 | "stylelint:fix": "stylelint **/*.css **/*.scss **/*.vue --fix" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/kffl/nextcloud-webhooks.git" 21 | }, 22 | "author": "", 23 | "license": "AGPL-3.0-or-later", 24 | "bugs": { 25 | "url": "https://github.com/kffl/nextcloud-webhooks/issues" 26 | }, 27 | "homepage": "https://github.com/kffl/nextcloud-webhooks#readme", 28 | "dependencies": { 29 | "vue": "^2.6.11" 30 | }, 31 | "devDependencies": { 32 | "@nextcloud/babel-config": "^1.0.0-beta.1", 33 | "@nextcloud/browserslist-config": "^2.1.0", 34 | "@nextcloud/eslint-config": "^6.0.0", 35 | "@nextcloud/eslint-plugin": "^2.0.0", 36 | "@nextcloud/stylelint-config": "^1.0.0-beta.0", 37 | "@nextcloud/webpack-vue-config": "^4.0.3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /phpunit.integration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ./tests/Integration 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /screenshots/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kffl/nextcloud-webhooks/114fecbb71e45d1150fe80af4464911ba5da7017/screenshots/admin.png -------------------------------------------------------------------------------- /screenshots/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kffl/nextcloud-webhooks/114fecbb71e45d1150fe80af4464911ba5da7017/screenshots/flow.png -------------------------------------------------------------------------------- /screenshots/webhooks-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @copyright Copyright (c) 2021 Paweł Kuffel 3 | * 4 | * @author Paweł Kuffel 5 | * 6 | * @license GNU AGPL version 3 or any later version 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | 23 | import Webhooks from './views/Webhooks' 24 | 25 | window.OCA.WorkflowEngine.registerOperator({ 26 | id: 'OCA\\Webhooks\\Flow\\Operation', 27 | color: '#0082c9', 28 | operation: '', 29 | options: Webhooks, 30 | }) 31 | -------------------------------------------------------------------------------- /src/views/Webhooks.vue: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 45 | 46 | 51 | -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'stylelint-config-recommended-scss', 3 | rules: { 4 | indentation: 'tab', 5 | 'selector-type-no-unknown': null, 6 | 'number-leading-zero': null, 7 | 'rule-empty-line-before': [ 8 | 'always', 9 | { 10 | ignore: ['after-comment', 'inside-block'], 11 | }, 12 | ], 13 | 'declaration-empty-line-before': [ 14 | 'never', 15 | { 16 | ignore: ['after-declaration'], 17 | }, 18 | ], 19 | 'comment-empty-line-before': null, 20 | 'selector-type-case': null, 21 | 'selector-list-comma-newline-after': null, 22 | 'no-descending-specificity': null, 23 | 'string-quotes': 'single', 24 | 'selector-pseudo-element-no-unknown': [ 25 | true, 26 | { 27 | ignorePseudoElements: ['v-deep'], 28 | }, 29 | ], 30 | }, 31 | plugins: ['stylelint-scss'], 32 | } 33 | -------------------------------------------------------------------------------- /templates/admin.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

Webhooks

7 | 8 |
    9 |
  • The Webhooks app is enabled
  • 10 | 11 |
  • The secret used for signing POST requests is defined
  • 12 | 13 |
  • The secret used for signing POST requests is not defined
  • 14 | 15 | 16 |
  • The curl command appears to be working
  • 17 | 18 |
  • curl --help when called via exec() returns a non-0 exit code
  • 19 | 20 |
21 |

Active Events with corresponding Webhook URLs:

22 |
    23 | $eventUrl) : ?> 24 |
  1. :
  2. 25 | 26 |
27 | 28 |

Inactive Events with corresponding config.php names:

29 |
    30 | $configName) : ?> 31 |
  1. :
  2. 32 | 33 |
34 |

You can enable the inactive events by providing their webhook URLs in config.php

35 | 36 |
-------------------------------------------------------------------------------- /tests/Integration/AppTest.php: -------------------------------------------------------------------------------- 1 | container = $app->getContainer(); 22 | } 23 | 24 | public function testAppInstalled() { 25 | $appManager = $this->container->query('OCP\App\IAppManager'); 26 | $this->assertTrue($appManager->isInstalled('webhooks')); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | addValidRoot(OC::$SERVERROOT . '/tests'); 11 | 12 | // Fix for "Autoload path not allowed: .../webhooks/tests/testcase.php" 13 | \OC_App::loadApp('webhooks'); 14 | 15 | if(!class_exists('PHPUnit_Framework_TestCase')) { 16 | require_once('PHPUnit/Autoload.php'); 17 | } 18 | 19 | OC_Hook::clear(); 20 | -------------------------------------------------------------------------------- /webpack.js: -------------------------------------------------------------------------------- 1 | const webpackConfig = require('@nextcloud/webpack-vue-config') 2 | 3 | module.exports = webpackConfig --------------------------------------------------------------------------------