diff --git a/.scribe/.filehashes b/.scribe/.filehashes new file mode 100644 index 0000000..1ceccc7 --- /dev/null +++ b/.scribe/.filehashes @@ -0,0 +1,4 @@ +# GENERATED. YOU SHOULDN'T MODIFY OR DELETE THIS FILE. +# Scribe uses this file to know when you change something manually in your docs. +.scribe/intro.md=f43b1064d43b23d8a29c230577de6852 +.scribe/auth.md=9bee2b1ef8a238b2e58613fa636d5f39 \ No newline at end of file diff --git a/.scribe/auth.md b/.scribe/auth.md new file mode 100644 index 0000000..8290362 --- /dev/null +++ b/.scribe/auth.md @@ -0,0 +1,3 @@ +# Authenticating requests + +This API is not authenticated. diff --git a/.scribe/endpoints.cache/00.yaml b/.scribe/endpoints.cache/00.yaml new file mode 100644 index 0000000..bc20bfd --- /dev/null +++ b/.scribe/endpoints.cache/00.yaml @@ -0,0 +1,44 @@ +## Autogenerated by Scribe. DO NOT MODIFY. + +name: Endpoints +description: '' +endpoints: + - + httpMethods: + - GET + uri: api/artists/search + metadata: + groupName: Endpoints + groupDescription: '' + subgroup: '' + subgroupDescription: '' + title: '' + description: '' + authenticated: false + custom: [] + headers: + Content-Type: application/json + Accept: application/json + urlParameters: [] + cleanUrlParameters: [] + queryParameters: [] + cleanQueryParameters: [] + bodyParameters: [] + cleanBodyParameters: [] + fileParameters: [] + responses: + - + status: 200 + content: '[{"id":10984,"name":"&TEAM"},{"id":2,"name":"=LOVE(\u7b49\u611b)"},{"id":3,"name":"\u2252JOY"},{"id":4,"name":"100%\u6a02\u5718"},{"id":5,"name":"1088"},{"id":6,"name":"10CC"},{"id":7,"name":"10CM"},{"id":8,"name":"183CLUB"},{"id":9,"name":"187INC"},{"id":10,"name":"19"}]' + headers: + cache-control: 'no-cache, private' + content-type: application/json + access-control-allow-origin: '*' + description: null + custom: [] + responseFields: [] + auth: [] + controller: null + method: null + route: null + custom: [] diff --git a/.scribe/endpoints/00.yaml b/.scribe/endpoints/00.yaml new file mode 100644 index 0000000..597c400 --- /dev/null +++ b/.scribe/endpoints/00.yaml @@ -0,0 +1,42 @@ +name: Endpoints +description: '' +endpoints: + - + httpMethods: + - GET + uri: api/artists/search + metadata: + groupName: Endpoints + groupDescription: '' + subgroup: '' + subgroupDescription: '' + title: '' + description: '' + authenticated: false + custom: [] + headers: + Content-Type: application/json + Accept: application/json + urlParameters: [] + cleanUrlParameters: [] + queryParameters: [] + cleanQueryParameters: [] + bodyParameters: [] + cleanBodyParameters: [] + fileParameters: [] + responses: + - + status: 200 + content: '[{"id":10984,"name":"&TEAM"},{"id":2,"name":"=LOVE(\u7b49\u611b)"},{"id":3,"name":"\u2252JOY"},{"id":4,"name":"100%\u6a02\u5718"},{"id":5,"name":"1088"},{"id":6,"name":"10CC"},{"id":7,"name":"10CM"},{"id":8,"name":"183CLUB"},{"id":9,"name":"187INC"},{"id":10,"name":"19"}]' + headers: + cache-control: 'no-cache, private' + content-type: application/json + access-control-allow-origin: '*' + description: null + custom: [] + responseFields: [] + auth: [] + controller: null + method: null + route: null + custom: [] diff --git a/.scribe/endpoints/custom.0.yaml b/.scribe/endpoints/custom.0.yaml new file mode 100644 index 0000000..4b02352 --- /dev/null +++ b/.scribe/endpoints/custom.0.yaml @@ -0,0 +1,53 @@ +# To include an endpoint that isn't a part of your Laravel app (or belongs to a vendor package), +# you can define it in a custom.*.yaml file, like this one. +# Each custom file should contain an array of endpoints. Here's an example: +# See https://scribe.knuckles.wtf/laravel/documenting/custom-endpoints#extra-sorting-groups-in-custom-endpoint-files for more options + +#- httpMethods: +# - POST +# uri: api/doSomething/{param} +# metadata: +# groupName: The group the endpoint belongs to. Can be a new group or an existing group. +# groupDescription: A description for the group. You don't need to set this for every endpoint; once is enough. +# subgroup: You can add a subgroup, too. +# title: Do something +# description: 'This endpoint allows you to do something.' +# authenticated: false +# headers: +# Content-Type: application/json +# Accept: application/json +# urlParameters: +# param: +# name: param +# description: A URL param for no reason. +# required: true +# example: 2 +# type: integer +# queryParameters: +# speed: +# name: speed +# description: How fast the thing should be done. Can be `slow` or `fast`. +# required: false +# example: fast +# type: string +# bodyParameters: +# something: +# name: something +# description: The things we should do. +# required: true +# example: +# - string 1 +# - string 2 +# type: 'string[]' +# responses: +# - status: 200 +# description: 'When the thing was done smoothly.' +# content: # Your response content can be an object, an array, a string or empty. +# { +# "hey": "ho ho ho" +# } +# responseFields: +# hey: +# name: hey +# description: Who knows? +# type: string # This is optional diff --git a/.scribe/intro.md b/.scribe/intro.md new file mode 100644 index 0000000..9a79631 --- /dev/null +++ b/.scribe/intro.md @@ -0,0 +1,13 @@ +# Introduction + + + + + + This documentation aims to provide all the information you need to work with our API. + + + diff --git a/app/Models/User.php b/app/Models/User.php index 584a10e..37d4594 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -9,11 +9,12 @@ use Illuminate\Notifications\Notifiable; use Spatie\Permission\Traits\HasRoles; use App\Traits\LogsModelActivity; use Spatie\Activitylog\Traits\CausesActivity; +use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { /** @use HasFactory<\Database\Factories\UserFactory> */ - use HasFactory, Notifiable, HasRoles, LogsModelActivity,CausesActivity; + use HasApiTokens, HasFactory, Notifiable, HasRoles, LogsModelActivity,CausesActivity; /** * The attributes that are mass assignable. diff --git a/composer.json b/composer.json index 5a85aa9..3474e48 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,9 @@ "license": "MIT", "require": { "php": "^8.2", + "knuckleswtf/scribe": "^5.2", "laravel/framework": "^12.0", + "laravel/sanctum": "^4.0", "laravel/tinker": "^2.10.1", "livewire/livewire": "^3.4", "livewire/volt": "^1.7.0", diff --git a/composer.lock b/composer.lock index 8f10ccb..bb04c3a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "54bbfde233e690f726d54157b29f12a3", + "content-hash": "1b06e66c526c3957bd79808dd74b86e8", "packages": [ { "name": "brick/math", @@ -670,6 +670,56 @@ ], "time": "2025-03-06T22:45:56+00:00" }, + { + "name": "erusev/parsedown", + "version": "1.7.4", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "support": { + "issues": "https://github.com/erusev/parsedown/issues", + "source": "https://github.com/erusev/parsedown/tree/1.7.x" + }, + "time": "2019-12-30T22:54:17+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.18.0", @@ -731,6 +781,140 @@ }, "time": "2024-11-01T03:51:45+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.24.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" + }, + "time": "2024-11-21T13:46:39+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.0" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-03-15T12:00:00+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.3.0", @@ -1276,17 +1460,111 @@ "time": "2025-02-03T10:55:03+00:00" }, { - "name": "laravel/framework", - "version": "v12.12.0", + "name": "knuckleswtf/scribe", + "version": "5.2.1", "source": { "type": "git", - "url": "https://github.com/laravel/framework.git", - "reference": "8f6cd73696068c28f30f5964556ec9d14e5d90d7" + "url": "https://github.com/knuckleswtf/scribe.git", + "reference": "7d1866bfccc96559b753466afdc1f70ed6c6125e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/8f6cd73696068c28f30f5964556ec9d14e5d90d7", - "reference": "8f6cd73696068c28f30f5964556ec9d14e5d90d7", + "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/7d1866bfccc96559b753466afdc1f70ed6c6125e", + "reference": "7d1866bfccc96559b753466afdc1f70ed6c6125e", + "shasum": "" + }, + "require": { + "erusev/parsedown": "1.7.4", + "ext-fileinfo": "*", + "ext-json": "*", + "ext-pdo": "*", + "fakerphp/faker": "^1.23.1", + "laravel/framework": "^9.0|^10.0|^11.0|^12.0", + "league/flysystem": "^3.0", + "mpociot/reflection-docblock": "^1.0.1", + "nikic/php-parser": "^5.0", + "nunomaduro/collision": "^6.0|^7.0|^8.0", + "php": ">=8.1", + "ramsey/uuid": "^4.2.2", + "shalvah/clara": "^3.1.0", + "shalvah/upgrader": ">=0.6.0", + "spatie/data-transfer-object": "^2.6|^3.0", + "symfony/var-exporter": "^6.0|^7.0", + "symfony/yaml": "^6.0|^7.0" + }, + "replace": { + "mpociot/laravel-apidoc-generator": "*" + }, + "require-dev": { + "dms/phpunit-arraysubset-asserts": "^v0.5.0", + "laravel/legacy-factories": "^1.3.0", + "league/fractal": "^0.20", + "nikic/fast-route": "^1.3", + "orchestra/testbench": "^7.0|^8.0|^v9.10.0|^10.0", + "pestphp/pest": "^1.21|^2.0|^3.0", + "phpstan/phpstan": "^2.1.5", + "phpunit/phpunit": "^9.0|^10.0|^11.0", + "spatie/ray": "^1.41", + "symfony/css-selector": "^6.0|^7.0", + "symfony/dom-crawler": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Knuckles\\Scribe\\ScribeServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Config/helpers.php" + ], + "psr-4": { + "Knuckles\\Camel\\": "camel/", + "Knuckles\\Scribe\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Shalvah" + } + ], + "description": "Generate API documentation for humans from your Laravel codebase.✍", + "homepage": "http://github.com/knuckleswtf/scribe", + "keywords": [ + "api", + "documentation", + "laravel" + ], + "support": { + "issues": "https://github.com/knuckleswtf/scribe/issues", + "source": "https://github.com/knuckleswtf/scribe/tree/5.2.1" + }, + "funding": [ + { + "url": "https://patreon.com/shalvah", + "type": "patreon" + } + ], + "time": "2025-05-01T01:14:54+00:00" + }, + { + "name": "laravel/framework", + "version": "v12.14.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "84b142958d1638a7e89de94ce75c2821c601d3d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/84b142958d1638a7e89de94ce75c2821c601d3d7", + "reference": "84b142958d1638a7e89de94ce75c2821c601d3d7", "shasum": "" }, "require": { @@ -1307,7 +1585,7 @@ "guzzlehttp/uri-template": "^1.0", "laravel/prompts": "^0.3.0", "laravel/serializable-closure": "^1.3|^2.0", - "league/commonmark": "^2.6", + "league/commonmark": "^2.7", "league/flysystem": "^3.25.1", "league/flysystem-local": "^3.25.1", "league/uri": "^7.5.1", @@ -1399,7 +1677,7 @@ "php-http/discovery": "^1.15", "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1", - "predis/predis": "^2.3", + "predis/predis": "^2.3|^3.0", "resend/resend-php": "^0.10.0", "symfony/cache": "^7.2.0", "symfony/http-client": "^7.2.0", @@ -1431,7 +1709,7 @@ "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).", - "predis/predis": "Required to use the predis connector (^2.3).", + "predis/predis": "Required to use the predis connector (^2.3|^3.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).", @@ -1488,7 +1766,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-05-01T16:13:12+00:00" + "time": "2025-05-13T17:50:51+00:00" }, { "name": "laravel/prompts", @@ -1549,6 +1827,70 @@ }, "time": "2025-02-11T13:34:40+00:00" }, + { + "name": "laravel/sanctum", + "version": "v4.1.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/sanctum.git", + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^11.0|^12.0", + "illuminate/contracts": "^11.0|^12.0", + "illuminate/database": "^11.0|^12.0", + "illuminate/support": "^11.0|^12.0", + "php": "^8.2", + "symfony/console": "^7.0" + }, + "require-dev": { + "mockery/mockery": "^1.6", + "orchestra/testbench": "^9.0|^10.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sanctum\\SanctumServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sanctum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", + "keywords": [ + "auth", + "laravel", + "sanctum" + ], + "support": { + "issues": "https://github.com/laravel/sanctum/issues", + "source": "https://github.com/laravel/sanctum" + }, + "time": "2025-04-23T13:03:38+00:00" + }, { "name": "laravel/serializable-closure", "version": "v2.0.4", @@ -1678,16 +2020,16 @@ }, { "name": "league/commonmark", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94" + "reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/06c3b0bf2540338094575612f4a1778d0d2d5e94", - "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/6fbb36d44824ed4091adbcf4c7d4a3923cdb3405", + "reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405", "shasum": "" }, "require": { @@ -1724,7 +2066,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.7-dev" + "dev-main": "2.8-dev" } }, "autoload": { @@ -1781,7 +2123,7 @@ "type": "tidelift" } ], - "time": "2025-04-18T21:09:27+00:00" + "time": "2025-05-05T12:20:28+00:00" }, { "name": "league/config", @@ -2744,6 +3086,59 @@ ], "time": "2025-03-24T10:02:05+00:00" }, + { + "name": "mpociot/reflection-docblock", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/mpociot/reflection-docblock.git", + "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpociot/reflection-docblock/zipball/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587", + "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mpociot": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "issues": "https://github.com/mpociot/reflection-docblock/issues", + "source": "https://github.com/mpociot/reflection-docblock/tree/master" + }, + "time": "2016-06-20T20:53:12+00:00" + }, { "name": "nesbot/carbon", "version": "3.9.1", @@ -3057,32 +3452,131 @@ "time": "2024-12-30T11:07:19+00:00" }, { - "name": "nunomaduro/termwind", - "version": "v2.3.0", + "name": "nunomaduro/collision", + "version": "v8.8.0", "source": { "type": "git", - "url": "https://github.com/nunomaduro/termwind.git", - "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda" + "url": "https://github.com/nunomaduro/collision.git", + "reference": "4cf9f3b47afff38b139fb79ce54fc71799022ce8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/52915afe6a1044e8b9cee1bcff836fb63acf9cda", - "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/4cf9f3b47afff38b139fb79ce54fc71799022ce8", + "reference": "4cf9f3b47afff38b139fb79ce54fc71799022ce8", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.18.0", + "nunomaduro/termwind": "^2.3.0", + "php": "^8.2.0", + "symfony/console": "^7.2.5" + }, + "conflict": { + "laravel/framework": "<11.44.2 || >=13.0.0", + "phpunit/phpunit": "<11.5.15 || >=13.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.8.3", + "larastan/larastan": "^3.2", + "laravel/framework": "^11.44.2 || ^12.6", + "laravel/pint": "^1.21.2", + "laravel/sail": "^1.41.0", + "laravel/sanctum": "^4.0.8", + "laravel/tinker": "^2.10.1", + "orchestra/testbench-core": "^9.12.0 || ^10.1", + "pestphp/pest": "^3.8.0", + "sebastian/environment": "^7.2.0 || ^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-04-03T14:33:09+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "dfa08f390e509967a15c22493dc0bac5733d9123" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/dfa08f390e509967a15c22493dc0bac5733d9123", + "reference": "dfa08f390e509967a15c22493dc0bac5733d9123", "shasum": "" }, "require": { "ext-mbstring": "*", "php": "^8.2", - "symfony/console": "^7.1.8" + "symfony/console": "^7.2.6" }, "require-dev": { - "illuminate/console": "^11.33.2", - "laravel/pint": "^1.18.2", + "illuminate/console": "^11.44.7", + "laravel/pint": "^1.22.0", "mockery/mockery": "^1.6.12", - "pestphp/pest": "^2.36.0", - "phpstan/phpstan": "^1.12.11", - "phpstan/phpstan-strict-rules": "^1.6.1", - "symfony/var-dumper": "^7.1.8", + "pestphp/pest": "^2.36.0 || ^3.8.2", + "phpstan/phpstan": "^1.12.25", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.2.6", "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", @@ -3125,7 +3619,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v2.3.0" + "source": "https://github.com/nunomaduro/termwind/tree/v2.3.1" }, "funding": [ { @@ -3141,7 +3635,7 @@ "type": "github" } ], - "time": "2024-11-21T10:39:51+00:00" + "time": "2025-05-08T08:14:37+00:00" }, { "name": "openspout/openspout", @@ -4346,6 +4840,175 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "shalvah/clara", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/shalvah/clara.git", + "reference": "cdbb5737cbdd101756d97dd2279a979a1af7710b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shalvah/clara/zipball/cdbb5737cbdd101756d97dd2279a979a1af7710b", + "reference": "cdbb5737cbdd101756d97dd2279a979a1af7710b", + "shasum": "" + }, + "require": { + "php": ">=7.4", + "symfony/console": "^4.0|^5.0|^6.0|^7.0" + }, + "require-dev": { + "eloquent/phony-phpunit": "^7.0", + "phpunit/phpunit": "^9.1" + }, + "type": "library", + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Shalvah\\Clara\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "🔊 Simple, pretty, testable console output for CLI apps.", + "keywords": [ + "cli", + "log", + "logging" + ], + "support": { + "issues": "https://github.com/shalvah/clara/issues", + "source": "https://github.com/shalvah/clara/tree/3.2.0" + }, + "time": "2024-02-27T20:30:59+00:00" + }, + { + "name": "shalvah/upgrader", + "version": "0.6.0", + "source": { + "type": "git", + "url": "https://github.com/shalvah/upgrader.git", + "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shalvah/upgrader/zipball/d95ed17fe9f5e1ee7d47ad835595f1af080a867f", + "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f", + "shasum": "" + }, + "require": { + "illuminate/support": ">=8.0", + "nikic/php-parser": "^5.0", + "php": ">=8.0" + }, + "require-dev": { + "dms/phpunit-arraysubset-asserts": "^0.2.0", + "pestphp/pest": "^1.21", + "phpstan/phpstan": "^1.0", + "spatie/ray": "^1.33" + }, + "type": "library", + "autoload": { + "psr-4": { + "Shalvah\\Upgrader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Shalvah", + "email": "hello@shalvah.me" + } + ], + "description": "Create automatic upgrades for your package.", + "homepage": "http://github.com/shalvah/upgrader", + "keywords": [ + "upgrade" + ], + "support": { + "issues": "https://github.com/shalvah/upgrader/issues", + "source": "https://github.com/shalvah/upgrader/tree/0.6.0" + }, + "funding": [ + { + "url": "https://patreon.com/shalvah", + "type": "patreon" + } + ], + "time": "2024-02-20T11:51:46+00:00" + }, + { + "name": "spatie/data-transfer-object", + "version": "3.9.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/data-transfer-object.git", + "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8", + "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "illuminate/collections": "^8.36", + "jetbrains/phpstorm-attributes": "^1.0", + "larapack/dd": "^1.1", + "phpunit/phpunit": "^9.5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\DataTransferObject\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Roose", + "email": "brent@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Data transfer objects with batteries included", + "homepage": "https://github.com/spatie/data-transfer-object", + "keywords": [ + "data-transfer-object", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/data-transfer-object/issues", + "source": "https://github.com/spatie/data-transfer-object/tree/3.9.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "abandoned": "spatie/laravel-data", + "time": "2022-09-16T13:34:38+00:00" + }, { "name": "spatie/laravel-activitylog", "version": "4.10.1", @@ -4500,16 +5163,16 @@ }, { "name": "spatie/laravel-permission", - "version": "6.17.0", + "version": "6.18.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-permission.git", - "reference": "02ada8f638b643713fa2fb543384738e27346ddb" + "reference": "3c05f04d12275dfbe462c8b4aae3290e586c2dde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/02ada8f638b643713fa2fb543384738e27346ddb", - "reference": "02ada8f638b643713fa2fb543384738e27346ddb", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/3c05f04d12275dfbe462c8b4aae3290e586c2dde", + "reference": "3c05f04d12275dfbe462c8b4aae3290e586c2dde", "shasum": "" }, "require": { @@ -4571,7 +5234,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-permission/issues", - "source": "https://github.com/spatie/laravel-permission/tree/6.17.0" + "source": "https://github.com/spatie/laravel-permission/tree/6.18.0" }, "funding": [ { @@ -4579,7 +5242,7 @@ "type": "github" } ], - "time": "2025-04-08T15:06:14+00:00" + "time": "2025-05-14T03:32:23+00:00" }, { "name": "symfony/clock", @@ -6810,6 +7473,154 @@ ], "time": "2025-04-09T08:14:01+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v7.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "422b8de94c738830a1e071f59ad14d67417d7007" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/422b8de94c738830a1e071f59ad14d67417d7007", + "reference": "422b8de94c738830a1e071f59ad14d67417d7007", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v7.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-05-02T08:36:00+00:00" + }, + { + "name": "symfony/yaml", + "version": "v7.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0feafffb843860624ddfd13478f481f4c3cd8b23", + "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v7.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-04-04T10:10:11+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.3.0", @@ -7276,140 +8087,6 @@ } ], "packages-dev": [ - { - "name": "fakerphp/faker", - "version": "v1.24.1", - "source": { - "type": "git", - "url": "https://github.com/FakerPHP/Faker.git", - "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", - "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "conflict": { - "fzaninotto/faker": "*" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "doctrine/persistence": "^1.3 || ^2.0", - "ext-intl": "*", - "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^5.4.16" - }, - "suggest": { - "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", - "ext-curl": "Required by Faker\\Provider\\Image to download images.", - "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", - "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", - "ext-mbstring": "Required for multibyte Unicode string functionality." - }, - "type": "library", - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" - }, - "time": "2024-11-21T13:46:39+00:00" - }, - { - "name": "filp/whoops", - "version": "2.18.0", - "source": { - "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^4.0 || ^5.0" - }, - "suggest": { - "symfony/var-dumper": "Pretty print complex values better with var-dumper available", - "whoops/soap": "Formats errors as SOAP responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Whoops\\": "src/Whoops/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" - } - ], - "description": "php error handling for cool kids", - "homepage": "https://filp.github.io/whoops/", - "keywords": [ - "error", - "exception", - "handling", - "library", - "throwable", - "whoops" - ], - "support": { - "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.0" - }, - "funding": [ - { - "url": "https://github.com/denis-sokolov", - "type": "github" - } - ], - "time": "2025-03-15T12:00:00+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.1.1", @@ -7602,16 +8279,16 @@ }, { "name": "laravel/pint", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36" + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", + "url": "https://api.github.com/repos/laravel/pint/zipball/941d1927c5ca420c22710e98420287169c7bcaf7", + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7", "shasum": "" }, "require": { @@ -7623,11 +8300,11 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.75.0", - "illuminate/view": "^11.44.2", - "larastan/larastan": "^3.3.1", + "illuminate/view": "^11.44.7", + "larastan/larastan": "^3.4.0", "laravel-zero/framework": "^11.36.1", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^2.3", + "nunomaduro/termwind": "^2.3.1", "pestphp/pest": "^2.36.0" }, "bin": [ @@ -7664,20 +8341,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-04-08T22:11:45+00:00" + "time": "2025-05-08T08:38:12+00:00" }, { "name": "laravel/sail", - "version": "v1.42.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "2edaaf77f3c07a4099965bb3d7dfee16e801c0f6" + "reference": "71a509b14b2621ce58574274a74290f933c687f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/2edaaf77f3c07a4099965bb3d7dfee16e801c0f6", - "reference": "2edaaf77f3c07a4099965bb3d7dfee16e801c0f6", + "url": "https://api.github.com/repos/laravel/sail/zipball/71a509b14b2621ce58574274a74290f933c687f7", + "reference": "71a509b14b2621ce58574274a74290f933c687f7", "shasum": "" }, "require": { @@ -7727,7 +8404,7 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2025-04-29T14:26:46+00:00" + "time": "2025-05-13T13:34:34+00:00" }, { "name": "mockery/mockery", @@ -7872,105 +8549,6 @@ ], "time": "2025-04-29T12:36:36+00:00" }, - { - "name": "nunomaduro/collision", - "version": "v8.8.0", - "source": { - "type": "git", - "url": "https://github.com/nunomaduro/collision.git", - "reference": "4cf9f3b47afff38b139fb79ce54fc71799022ce8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/4cf9f3b47afff38b139fb79ce54fc71799022ce8", - "reference": "4cf9f3b47afff38b139fb79ce54fc71799022ce8", - "shasum": "" - }, - "require": { - "filp/whoops": "^2.18.0", - "nunomaduro/termwind": "^2.3.0", - "php": "^8.2.0", - "symfony/console": "^7.2.5" - }, - "conflict": { - "laravel/framework": "<11.44.2 || >=13.0.0", - "phpunit/phpunit": "<11.5.15 || >=13.0.0" - }, - "require-dev": { - "brianium/paratest": "^7.8.3", - "larastan/larastan": "^3.2", - "laravel/framework": "^11.44.2 || ^12.6", - "laravel/pint": "^1.21.2", - "laravel/sail": "^1.41.0", - "laravel/sanctum": "^4.0.8", - "laravel/tinker": "^2.10.1", - "orchestra/testbench-core": "^9.12.0 || ^10.1", - "pestphp/pest": "^3.8.0", - "sebastian/environment": "^7.2.0 || ^8.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" - ] - }, - "branch-alias": { - "dev-8.x": "8.x-dev" - } - }, - "autoload": { - "files": [ - "./src/Adapters/Phpunit/Autoload.php" - ], - "psr-4": { - "NunoMaduro\\Collision\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Cli error handling for console/command-line PHP applications.", - "keywords": [ - "artisan", - "cli", - "command-line", - "console", - "dev", - "error", - "handling", - "laravel", - "laravel-zero", - "php", - "symfony" - ], - "support": { - "issues": "https://github.com/nunomaduro/collision/issues", - "source": "https://github.com/nunomaduro/collision" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" - } - ], - "time": "2025-04-03T14:33:09+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.4", @@ -8414,16 +8992,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.19", + "version": "11.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5" + "reference": "e6bdea63ecb7a8287d2cdab25bdde3126e0cfe6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", - "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e6bdea63ecb7a8287d2cdab25bdde3126e0cfe6f", + "reference": "e6bdea63ecb7a8287d2cdab25bdde3126e0cfe6f", "shasum": "" }, "require": { @@ -8495,7 +9073,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.20" }, "funding": [ { @@ -8519,7 +9097,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T06:56:52+00:00" + "time": "2025-05-11T06:39:52+00:00" }, { "name": "sebastian/cli-parser", @@ -9499,78 +10077,6 @@ ], "time": "2024-10-20T05:08:20+00:00" }, - { - "name": "symfony/yaml", - "version": "v7.2.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0feafffb843860624ddfd13478f481f4c3cd8b23", - "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<6.4" - }, - "require-dev": { - "symfony/console": "^6.4|^7.0" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v7.2.6" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-04-04T10:10:11+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/config/sanctum.php b/config/sanctum.php new file mode 100644 index 0000000..44527d6 --- /dev/null +++ b/config/sanctum.php @@ -0,0 +1,84 @@ + explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( + '%s%s', + 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', + Sanctum::currentApplicationUrlWithPort(), + // Sanctum::currentRequestHost(), + ))), + + /* + |-------------------------------------------------------------------------- + | Sanctum Guards + |-------------------------------------------------------------------------- + | + | This array contains the authentication guards that will be checked when + | Sanctum is trying to authenticate a request. If none of these guards + | are able to authenticate the request, Sanctum will use the bearer + | token that's present on an incoming request for authentication. + | + */ + + 'guard' => ['web'], + + /* + |-------------------------------------------------------------------------- + | Expiration Minutes + |-------------------------------------------------------------------------- + | + | This value controls the number of minutes until an issued token will be + | considered expired. This will override any values set in the token's + | "expires_at" attribute, but first-party sessions are not affected. + | + */ + + 'expiration' => null, + + /* + |-------------------------------------------------------------------------- + | Token Prefix + |-------------------------------------------------------------------------- + | + | Sanctum can prefix new tokens in order to take advantage of numerous + | security scanning initiatives maintained by open source platforms + | that notify developers if they commit tokens into repositories. + | + | See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning + | + */ + + 'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''), + + /* + |-------------------------------------------------------------------------- + | Sanctum Middleware + |-------------------------------------------------------------------------- + | + | When authenticating your first-party SPA with Sanctum you may need to + | customize some of the middleware Sanctum uses while processing the + | request. You may change the middleware listed below as required. + | + */ + + 'middleware' => [ + 'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class, + 'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class, + 'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class, + ], + +]; diff --git a/config/scribe.php b/config/scribe.php new file mode 100644 index 0000000..b7d517c --- /dev/null +++ b/config/scribe.php @@ -0,0 +1,252 @@ + for the generated documentation. + 'title' => config('app.name').' API Documentation', + + // A short description of your API. Will be included in the docs webpage, Postman collection and OpenAPI spec. + 'description' => '', + + // The base URL displayed in the docs. + // If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL. + 'base_url' => config("app.url"), + + // Routes to include in the docs + 'routes' => [ + [ + 'match' => [ + // Match only routes whose paths match this pattern (use * as a wildcard to match any characters). Example: 'users/*'. + 'prefixes' => ['api/*'], + + // Match only routes whose domains match this pattern (use * as a wildcard to match any characters). Example: 'api.*'. + 'domains' => ['*'], + ], + + // Include these routes even if they did not match the rules above. + 'include' => [ + // 'users.index', 'POST /new', '/auth/*' + ], + + // Exclude these routes even if they matched the rules above. + 'exclude' => [ + // 'GET /health', 'admin.*' + ], + ], + ], + + // The type of documentation output to generate. + // - "static" will generate a static HTMl page in the /public/docs folder, + // - "laravel" will generate the documentation as a Blade view, so you can add routing and authentication. + // - "external_static" and "external_laravel" do the same as above, but pass the OpenAPI spec as a URL to an external UI template + 'type' => 'laravel', + + // See https://scribe.knuckles.wtf/laravel/reference/config#theme for supported options + 'theme' => 'default', + + 'static' => [ + // HTML documentation, assets and Postman collection will be generated to this folder. + // Source Markdown will still be in resources/docs. + 'output_path' => 'public/docs', + ], + + 'laravel' => [ + // Whether to automatically create a docs route for you to view your generated docs. You can still set up routing manually. + 'add_routes' => true, + + // URL path to use for the docs endpoint (if `add_routes` is true). + // By default, `/docs` opens the HTML page, `/docs.postman` opens the Postman collection, and `/docs.openapi` the OpenAPI spec. + 'docs_url' => '/docs', + + // Directory within `public` in which to store CSS and JS assets. + // By default, assets are stored in `public/vendor/scribe`. + // If set, assets will be stored in `public/{{assets_directory}}` + 'assets_directory' => null, + + // Middleware to attach to the docs endpoint (if `add_routes` is true). + 'middleware' => [], + ], + + 'external' => [ + 'html_attributes' => [] + ], + + 'try_it_out' => [ + // Add a Try It Out button to your endpoints so consumers can test endpoints right from their browser. + // Don't forget to enable CORS headers for your endpoints. + 'enabled' => true, + + // The base URL to use in the API tester. Leave as null to be the same as the displayed URL (`scribe.base_url`). + 'base_url' => null, + + // [Laravel Sanctum] Fetch a CSRF token before each request, and add it as an X-XSRF-TOKEN header. + 'use_csrf' => false, + + // The URL to fetch the CSRF token from (if `use_csrf` is true). + 'csrf_url' => '/sanctum/csrf-cookie', + ], + + // How is your API authenticated? This information will be used in the displayed docs, generated examples and response calls. + 'auth' => [ + // Set this to true if ANY endpoints in your API use authentication. + 'enabled' => false, + + // Set this to true if your API should be authenticated by default. If so, you must also set `enabled` (above) to true. + // You can then use @unauthenticated or @authenticated on individual endpoints to change their status from the default. + 'default' => false, + + // Where is the auth value meant to be sent in a request? + 'in' => AuthIn::BEARER->value, + + // The name of the auth parameter (e.g. token, key, apiKey) or header (e.g. Authorization, Api-Key). + 'name' => 'key', + + // The value of the parameter to be used by Scribe to authenticate response calls. + // This will NOT be included in the generated documentation. If empty, Scribe will use a random value. + 'use_value' => env('SCRIBE_AUTH_KEY'), + + // Placeholder your users will see for the auth parameter in the example requests. + // Set this to null if you want Scribe to use a random value as placeholder instead. + 'placeholder' => '{YOUR_AUTH_KEY}', + + // Any extra authentication-related info for your users. Markdown and HTML are supported. + 'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking Generate API token.', + ], + + // Text to place in the "Introduction" section, right after the `description`. Markdown and HTML are supported. + 'intro_text' => <<As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). + You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile). + INTRO, + + // Example requests for each endpoint will be shown in each of these languages. + // Supported options are: bash, javascript, php, python + // To add a language of your own, see https://scribe.knuckles.wtf/laravel/advanced/example-requests + // Note: does not work for `external` docs types + 'example_languages' => [ + 'bash', + 'javascript', + ], + + // Generate a Postman collection (v2.1.0) in addition to HTML docs. + // For 'static' docs, the collection will be generated to public/docs/collection.json. + // For 'laravel' docs, it will be generated to storage/app/scribe/collection.json. + // Setting `laravel.add_routes` to true (above) will also add a route for the collection. + 'postman' => [ + 'enabled' => true, + + 'overrides' => [ + // 'info.version' => '2.0.0', + ], + ], + + // Generate an OpenAPI spec (v3.0.1) in addition to docs webpage. + // For 'static' docs, the collection will be generated to public/docs/openapi.yaml. + // For 'laravel' docs, it will be generated to storage/app/scribe/openapi.yaml. + // Setting `laravel.add_routes` to true (above) will also add a route for the spec. + 'openapi' => [ + 'enabled' => true, + + 'overrides' => [ + // 'info.version' => '2.0.0', + ], + + // Additional generators to use when generating the OpenAPI spec. + // Should extend `Knuckles\Scribe\Writing\OpenApiSpecGenerators\OpenApiGenerator`. + 'generators' => [], + ], + + 'groups' => [ + // Endpoints which don't have a @group will be placed in this default group. + 'default' => 'Endpoints', + + // By default, Scribe will sort groups alphabetically, and endpoints in the order their routes are defined. + // You can override this by listing the groups, subgroups and endpoints here in the order you want them. + // See https://scribe.knuckles.wtf/blog/laravel-v4#easier-sorting and https://scribe.knuckles.wtf/laravel/reference/config#order for details + // Note: does not work for `external` docs types + 'order' => [], + ], + + // Custom logo path. This will be used as the value of the src attribute for the tag, + // so make sure it points to an accessible URL or path. Set to false to not use a logo. + // For example, if your logo is in public/img: + // - 'logo' => '../img/logo.png' // for `static` type (output folder is public/docs) + // - 'logo' => 'img/logo.png' // for `laravel` type + 'logo' => false, + + // Customize the "Last updated" value displayed in the docs by specifying tokens and formats. + // Examples: + // - {date:F j Y} => March 28, 2022 + // - {git:short} => Short hash of the last Git commit + // Available tokens are `{date:}` and `{git:}`. + // The format you pass to `date` will be passed to PHP's `date()` function. + // The format you pass to `git` can be either "short" or "long". + // Note: does not work for `external` docs types + 'last_updated' => 'Last updated: {date:F j, Y}', + + 'examples' => [ + // Set this to any number to generate the same example values for parameters on each run, + 'faker_seed' => 1234, + + // With API resources and transformers, Scribe tries to generate example models to use in your API responses. + // By default, Scribe will try the model's factory, and if that fails, try fetching the first from the database. + // You can reorder or remove strategies here. + 'models_source' => ['factoryCreate', 'factoryMake', 'databaseFirst'], + ], + + // The strategies Scribe will use to extract information about your routes at each stage. + // Use configureStrategy() to specify settings for a strategy in the list. + // Use removeStrategies() to remove an included strategy. + 'strategies' => [ + 'metadata' => [ + ...Defaults::METADATA_STRATEGIES, + ], + 'headers' => [ + ...Defaults::HEADERS_STRATEGIES, + Strategies\StaticData::withSettings(data: [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]), + ], + 'urlParameters' => [ + ...Defaults::URL_PARAMETERS_STRATEGIES, + ], + 'queryParameters' => [ + ...Defaults::QUERY_PARAMETERS_STRATEGIES, + ], + 'bodyParameters' => [ + ...Defaults::BODY_PARAMETERS_STRATEGIES, + ], + 'responses' => configureStrategy( + Defaults::RESPONSES_STRATEGIES, + Strategies\Responses\ResponseCalls::withSettings( + only: ['GET *'], + // Recommended: disable debug mode in response calls to avoid error stack traces in responses + config: [ + 'app.debug' => false, + ] + ) + ), + 'responseFields' => [ + ...Defaults::RESPONSE_FIELDS_STRATEGIES, + ] + ], + + // For response calls, API resource responses and transformer responses, + // Scribe will try to start database transactions, so no changes are persisted to your database. + // Tell Scribe which connections should be transacted here. If you only use one db connection, you can leave this as is. + 'database_connections_to_transact' => [config('database.default')], + + 'fractal' => [ + // If you are using a custom serializer with league/fractal, you can specify it here. + 'serializer' => null, + ], +]; diff --git a/database/migrations/2025_05_14_160634_create_personal_access_tokens_table.php b/database/migrations/2025_05_14_160634_create_personal_access_tokens_table.php new file mode 100644 index 0000000..e828ad8 --- /dev/null +++ b/database/migrations/2025_05_14_160634_create_personal_access_tokens_table.php @@ -0,0 +1,33 @@ +id(); + $table->morphs('tokenable'); + $table->string('name'); + $table->string('token', 64)->unique(); + $table->text('abilities')->nullable(); + $table->timestamp('last_used_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('personal_access_tokens'); + } +}; diff --git a/public/vendor/scribe/css/theme-default.print.css b/public/vendor/scribe/css/theme-default.print.css new file mode 100644 index 0000000..18ab760 --- /dev/null +++ b/public/vendor/scribe/css/theme-default.print.css @@ -0,0 +1,393 @@ +/* Copied from https://github.com/slatedocs/slate/blob/c4b4c0b8f83e891ca9fab6bbe9a1a88d5fe41292/stylesheets/print.css and unminified */ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100% +} + +body { + margin: 0 +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block +} + +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline +} + +audio:not([controls]) { + display: none; + height: 0 +} + +[hidden], +template { + display: none +} + +a { + background-color: transparent +} + +a:active, +a:hover { + outline: 0 +} + +abbr[title] { + border-bottom: 1px dotted +} + +b, +strong { + font-weight: bold +} + +dfn { + font-style: italic +} + +h1 { + font-size: 2em; + margin: 0.67em 0 +} + +mark { + background: #ff0; + color: #000 +} + +small { + font-size: 80% +} + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline +} + +sup { + top: -0.5em +} + +sub { + bottom: -0.25em +} + +img { + border: 0 +} + +svg:not(:root) { + overflow: hidden +} + +figure { + margin: 1em 40px +} + +hr { + box-sizing: content-box; + height: 0 +} + +pre { + overflow: auto +} + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em +} + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0 +} + +button { + overflow: visible +} + +button, +select { + text-transform: none +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer +} + +button[disabled], +html input[disabled] { + cursor: default +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0 +} + +input { + line-height: normal +} + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0 +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto +} + +input[type="search"] { + -webkit-appearance: textfield; + box-sizing: content-box +} + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none +} + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em +} + +legend { + border: 0; + padding: 0 +} + +textarea { + overflow: auto +} + +optgroup { + font-weight: bold +} + +table { + border-collapse: collapse; + border-spacing: 0 +} + +td, +th { + padding: 0 +} + +.content h1, +.content h2, +.content h3, +.content h4, +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 14px +} + +.content h1, +.content h2, +.content h3, +.content h4 { + font-weight: bold +} + +.content pre, +.content code { + font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; + font-size: 12px; + line-height: 1.5 +} + +.content pre, +.content code { + word-break: break-all; + -webkit-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto +} + +@font-face { + font-family: 'slate'; + src: url(../fonts/slate.eot?-syv14m); + src: url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), url(../fonts/slate.woff2?-syv14m) format("woff2"), url(../fonts/slate.woff?-syv14m) format("woff"), url(../fonts/slate.ttf?-syv14m) format("truetype"), url(../fonts/slate.svg?-syv14m#slate) format("svg"); + font-weight: normal; + font-style: normal +} + +.content aside.warning:before, +.content aside.notice:before, +.content aside.success:before { + font-family: 'slate'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1 +} + +.content aside.warning:before { + content: "\e600" +} + +.content aside.notice:before { + content: "\e602" +} + +.content aside.success:before { + content: "\e606" +} + +.tocify, +.toc-footer, +.lang-selector, +.search, +#nav-button { + display: none +} + +.tocify-wrapper>img { + margin: 0 auto; + display: block +} + +.content { + font-size: 12px +} + +.content pre, +.content code { + border: 1px solid #999; + border-radius: 5px; + font-size: 0.8em +} + +.content pre code { + border: 0 +} + +.content pre { + padding: 1.3em +} + +.content code { + padding: 0.2em +} + +.content table { + border: 1px solid #999 +} + +.content table tr { + border-bottom: 1px solid #999 +} + +.content table td, +.content table th { + padding: 0.7em +} + +.content p { + line-height: 1.5 +} + +.content a { + text-decoration: none; + color: #000 +} + +.content h1 { + font-size: 2.5em; + padding-top: 0.5em; + padding-bottom: 0.5em; + margin-top: 1em; + margin-bottom: 21px; + border: 2px solid #ccc; + border-width: 2px 0; + text-align: center +} + +.content h2 { + font-size: 1.8em; + margin-top: 2em; + border-top: 2px solid #ccc; + padding-top: 0.8em +} + +.content h1+h2, +.content h1+div+h2 { + border-top: none; + padding-top: 0; + margin-top: 0 +} + +.content h3, +.content h4 { + font-size: 0.8em; + margin-top: 1.5em; + margin-bottom: 0.8em; + text-transform: uppercase +} + +.content h5, +.content h6 { + text-transform: uppercase +} + +.content aside { + padding: 1em; + border: 1px solid #ccc; + border-radius: 5px; + margin-top: 1.5em; + margin-bottom: 1.5em; + line-height: 1.6 +} + +.content aside:before { + vertical-align: middle; + padding-right: 0.5em; + font-size: 14px +} diff --git a/public/vendor/scribe/css/theme-default.style.css b/public/vendor/scribe/css/theme-default.style.css new file mode 100644 index 0000000..9a4741c --- /dev/null +++ b/public/vendor/scribe/css/theme-default.style.css @@ -0,0 +1,1090 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +html { + font-family: 'Open Sans', sans-serif; + font-size: 1.2em; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100% +} + +body { + margin: 0 +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section { + display: block +} + +summary { + cursor: pointer; +} + +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline +} + +audio:not([controls]) { + display: none; + height: 0 +} + +[hidden], +template { + display: none +} + +a { + background-color: transparent +} + +a:active, +a:hover { + outline: 0 +} + +abbr[title] { + border-bottom: 1px dotted +} + +b, +strong { + font-weight: 700 +} + +dfn { + font-style: italic +} + +h1 { + font-size: 2em; + margin: .67em 0 +} + +mark { + background: #ff0; + color: #000 +} + +small { + font-size: 80% +} + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline +} + +sup { + top: -.5em +} + +sub { + bottom: -.25em +} + +img { + border: 0 +} + +svg:not(:root) { + overflow: hidden +} + +figure { + margin: 1em 40px +} + +hr { + box-sizing: content-box; + height: 0 +} + +pre { + overflow: auto +} + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em +} + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0 +} + +button { + overflow: visible +} + +button, +select { + text-transform: none +} + +button, +html input[type=button], +input[type=reset], +input[type=submit] { + -webkit-appearance: button; + cursor: pointer +} + +button[disabled], +html input[disabled] { + cursor: default +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0 +} + +input { + line-height: normal +} + +input[type=checkbox], +input[type=radio] { + box-sizing: border-box; + padding: 0 +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + height: auto +} + +input[type=search] { + -webkit-appearance: textfield; + box-sizing: content-box +} + +input[type=search]::-webkit-search-cancel-button, +input[type=search]::-webkit-search-decoration { + -webkit-appearance: none +} + +fieldset { + border: 1px solid silver; + margin: 0 2px; + padding: .35em .625em .75em +} + +legend { + border: 0; + padding: 0 +} + +textarea { + overflow: auto +} + +optgroup { + font-weight: 700 +} + +table { + border-collapse: collapse; + border-spacing: 0 +} + +td, +th { + padding: 0 +} + +body, +html { + font-family: 'Open Sans', Helvetica Neue, Helvetica, Arial, Microsoft Yahei, 微软雅黑, STXihei, 华文细黑, sans-serif; + font-size: 16px; +} + +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6 { + font-family: 'Open Sans', Helvetica Neue, Helvetica, Arial, Microsoft Yahei, 微软雅黑, STXihei, 华文细黑, sans-serif; +} + +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6 { + font-weight: 700 +} + +.content code, +.content pre { + font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; + font-size: 14px; + line-height: 1.5 +} + +.content code { + word-break: break-all; + word-break: break-word; + -webkit-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto +} + +.content aside.notice:before, +.content aside.success:before, +.content aside.warning:before, +.tocify-wrapper>.search:before { + font-family: 'Open Sans', sans-serif; + speak: none; + font-style: normal; + font-variant: normal; + text-transform: none; + line-height: 1 +} + +.content aside.warning:before { + content: "✋" +} + +.content aside.notice:before { + content: "ℹ" +} + +.content aside.success:before { + content: "✅" +} + +.tocify-wrapper>.search:before { + content: "🔎" +} + +.highlight .c, +.highlight .c1, +.highlight .cm, +.highlight .cs { + color: #909090 +} + +.highlight, +.highlight .w { + background-color: #292929 +} + +.hljs { + display: block; + overflow-x: auto; + padding: .5em; + background: #23241f +} + +.hljs, +.hljs-subst, +.hljs-tag { + color: #f8f8f2 +} + +.hljs-emphasis, +.hljs-strong { + color: #a8a8a2 +} + +.hljs-bullet, +.hljs-link, +.hljs-literal, +.hljs-number, +.hljs-quote, +.hljs-regexp { + color: #ae81ff +} + +.hljs-code, +.hljs-section, +.hljs-selector-class, +.hljs-title { + color: #a6e22e +} + +.hljs-strong { + font-weight: 700 +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-attr, +.hljs-keyword, +.hljs-name, +.hljs-selector-tag { + color: #f92672 +} + +.hljs-attribute, +.hljs-symbol { + color: #66d9ef +} + +.hljs-class .hljs-title, +.hljs-params { + color: #f8f8f2 +} + +.hljs-addition, +.hljs-built_in, +.hljs-builtin-name, +.hljs-selector-attr, +.hljs-selector-id, +.hljs-selector-pseudo, +.hljs-string, +.hljs-template-variable, +.hljs-type, +.hljs-variable { + color: #e6db74 +} + +.hljs-comment, +.hljs-deletion, +.hljs-meta { + color: #75715e +} + +body, +html { + color: #333; + padding: 0; + margin: 0; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background-color: whitesmoke; + height: 100%; + -webkit-text-size-adjust: none +} + +#toc>ul>li>a>span { + float: right; + background-color: #2484ff; + border-radius: 40px; + width: 20px +} + +.tocify-wrapper { + transition: left .3s ease-in-out; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + z-index: 30; + top: 0; + left: 0; + bottom: 0; + width: 230px; + background-color: #393939; + font-size: 13px; + font-weight: 700 +} + +.tocify-wrapper .lang-selector { + display: none +} + +.tocify-wrapper .lang-selector a { + padding-top: .5em; + padding-bottom: .5em +} + +.tocify-wrapper>img { + display: block +} + +.tocify-wrapper>.search { + position: relative +} + +.tocify-wrapper>.search input { + background: #393939; + border-width: 0 0 1px; + border-color: #666; + padding: 6px 0 6px 20px; + box-sizing: border-box; + margin: 10px 15px; + width: 200px; + outline: none; + color: #fff; + border-radius: 0 +} + +.tocify-wrapper>.search:before { + position: absolute; + top: 17px; + left: 15px; + color: #fff +} + +.tocify-wrapper img+.tocify { + margin-top: 20px +} + +.tocify-wrapper .search-results { + margin-top: 0; + box-sizing: border-box; + height: 0; + overflow-y: auto; + overflow-x: hidden; + transition-property: height, margin; + transition-duration: .18s; + transition-timing-function: ease-in-out; + background: linear-gradient(180deg, rgba(0, 0, 0, .2), transparent 8px), linear-gradient(0deg, rgba(0, 0, 0, .2), transparent 8px), linear-gradient(180deg, #000, transparent 1.5px), linear-gradient(0deg, #939393, hsla(0, 0%, 58%, 0) 1.5px), #262626 +} + +.tocify-wrapper .search-results.visible { + height: 30%; + margin-bottom: 1em +} + +.tocify-wrapper .search-results li { + margin: 1em 15px; + line-height: 1 +} + +.tocify-wrapper a { + color: #fff; + text-decoration: none +} + +.tocify-wrapper .search-results a:hover { + text-decoration: underline +} + +.tocify-wrapper .toc-footer li, +.tocify-wrapper .tocify-item>a { + padding: 0 15px; + display: block; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis +} +.tocify-wrapper .tocify-item.level-3>a { + padding: 0 25px; +} + +.tocify-wrapper li, +.tocify-wrapper ul { + list-style: none; + margin: 0; + padding: 0; + line-height: 28px +} + +.tocify-wrapper li { + color: #fff; + transition-property: background; + transition-timing-function: linear; + transition-duration: .23s +} + +.tocify-wrapper .tocify-focus { + box-shadow: 0 1px 0 #000; + background-color: #2467af; + color: #fff; + font-weight: bold; +} + +.tocify-wrapper .tocify-subheader { + display: none; + background-color: #262626; + font-weight: 500; + background: linear-gradient(180deg, rgba(0, 0, 0, .2), transparent 8px), linear-gradient(0deg, rgba(0, 0, 0, .2), transparent 8px), linear-gradient(180deg, #000, transparent 1.5px), linear-gradient(0deg, #939393, hsla(0, 0%, 58%, 0) 1.5px), #262626 +} + +.tocify-wrapper .jets-searching .tocify-subheader, +.tocify-wrapper .tocify-subheader.visible { + display: block; +} + +.tocify-wrapper .tocify-subheader .tocify-item>a { + padding-left: 25px; + font-size: 12px +} + +.tocify-wrapper .tocify-subheader .tocify-item.level-3>a { + padding-left: 35px; +} + +.tocify-wrapper .tocify-subheader>li:last-child { + box-shadow: none +} + +.tocify-wrapper .toc-footer { + padding: 1em 0; + margin-top: 1em; + border-top: 1px dashed #666 +} + +.tocify-wrapper .toc-footer a, +.tocify-wrapper .toc-footer li { + color: #fff; + text-decoration: none +} + +.tocify-wrapper .toc-footer a:hover { + text-decoration: underline +} + +.tocify-wrapper .toc-footer li { + font-size: .8em; + line-height: 1.7; + text-decoration: none +} + +#nav-button { + padding: 0 1.5em 5em 0; + display: none; + position: fixed; + top: 0; + left: 0; + z-index: 100; + color: #000; + text-decoration: none; + font-weight: 700; + opacity: .7; + line-height: 16px; + transition: left .3s ease-in-out +} + +#nav-button span { + display: block; + padding: 6px; + background-color: rgba(234, 242, 246, .7); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: rotate(-90deg) translate(-100%); + transform: rotate(-90deg) translate(-100%); + border-radius: 0 0 0 5px +} + +#nav-button img { + height: 16px; + vertical-align: bottom +} + +#nav-button:hover { + opacity: 1 +} + +#nav-button.open { + left: 230px +} + +.page-wrapper { + margin-left: 230px; + position: relative; + z-index: 10; + background-color: #eaf2f6; + min-height: 100%; + padding-bottom: 1px +} + +.page-wrapper .dark-box { + width: 50%; + background-color: #393939; + position: absolute; + right: 0; + top: 0; + bottom: 0 +} + +.page-wrapper .lang-selector { + position: fixed; + z-index: 50; + border-bottom: 5px solid #393939 +} + +.lang-selector { + background-color: #222; + width: 100%; + font-weight: 700 +} + +.lang-selector button { + display: block; + float: left; + color: #fff; + text-decoration: none; + padding: 0 10px; + line-height: 30px; + outline: 0; + background: transparent; + border: none; +} + +.lang-selector button:active, +.lang-selector button:hover, +.lang-selector button:focus { + background-color: #111; + color: #fff +} + +.lang-selector button.active { + background-color: #393939; + color: #fff +} + +.lang-selector:after { + content: ''; + clear: both; + display: block +} + +.content { + position: relative; + z-index: 30 +} + +.content:after { + content: ''; + display: block; + clear: both +} + +.content>aside, +.content>details, +.content>dl, +.content>h1, +.content>h2, +.content>h3, +.content>h4, +.content>h5, +.content>h6, +.content>ol, +.content>p, +.content>table, +.content>ul, +.content>div, +.content>form>aside, +.content>form>details, +.content>form>h1, +.content>form>h2, +.content>form>h3, +.content>form>h4, +.content>form>h5, +.content>form>h6, +.content>form>p, +.content>form>table, +.content>form>ul, +.content>form>div { + margin-right: 50%; + padding: 0 28px; + box-sizing: border-box; + display: block; + text-shadow: 0 1px 0 #fff +} + +.content>ol, +.content>ul { + padding-left: 43px +} + +.content>div, +.content>h1, +.content>h2 { + clear: both +} + +.content h1 { + font-size: 30px; + padding-top: .5em; + padding-bottom: .5em; + border-bottom: 1px solid #ccc; + margin-bottom: 21px; + margin-top: 2em; + border-top: 1px solid #ddd; + background-image: linear-gradient(180deg, #fff, #f9f9f9) +} + +.content div:first-child+h1, +.content h1:first-child { + border-top-width: 0; + margin-top: 0 +} + +.content h2 { + font-size: 20px; + margin-top: 4em; + margin-bottom: 0; + border-top: 1px solid #ccc; + padding-top: 1.2em; + padding-bottom: 1.2em; + background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .4), hsla(0, 0%, 100%, 0)) +} + +.content h1+div+h2, +.content h1+h2 { + margin-top: -21px; + border-top: none +} + +.content h3, +.content h4, +.content h5, +.content h6 { + font-size: 15px; + margin-top: 2.5em; + margin-bottom: .8em +} + +.content h4, +.content h5, +.content h6 { + font-size: 10px +} + +.content hr { + margin: 2em 0; + border-top: 2px solid #393939; + border-bottom: 2px solid #eaf2f6 +} + +.content table { + margin-bottom: 1em; + overflow: auto +} + +.content table td, +.content table th { + text-align: left; + vertical-align: top; + line-height: 1.6 +} + +.content table th { + padding: 5px 10px; + border-bottom: 1px solid #ccc; + vertical-align: bottom +} + +.content table td { + padding: 10px +} + +.content table tr:last-child { + border-bottom: 1px solid #ccc +} + +.content table tr:nth-child(odd)>td { + background-color: #ebf3f6 +} + +.content table tr:nth-child(even)>td { + background-color: #ebf2f6 +} + +.content dt { + font-weight: 700 +} + +.content dd { + margin-left: 15px +} + +.content dd, +.content dt, +.content li, +.content p { + line-height: 1.6; + margin-top: 0 +} + +.content img { + max-width: 100% +} + +.content code { + padding: 3px; + border-radius: 3px +} + +.content pre>code { + background-color: transparent; + padding: 0 +} + +.content aside { + padding-top: 1em; + padding-bottom: 1em; + margin-top: 1.5em; + margin-bottom: 1.5em; + background: #292929; + line-height: 1.6; + color: #c8c8c8; + text-shadow: none; +} + +.content aside.info { + background: #8fbcd4; + text-shadow: 0 1px 0 #a0c6da; + color: initial; +} + +.content aside.warning { + background-color: #c97a7e; + text-shadow: 0 1px 0 #d18e91; + color: initial; +} + +.content aside.success { + background-color: #6ac174; + text-shadow: 0 1px 0 #80ca89; + color: initial; +} + +.content aside:before { + vertical-align: middle; + padding-right: .5em; + font-size: 14px +} + +.content .search-highlight { + padding: 2px; + margin: -2px; + border-radius: 4px; + border: 1px solid #f7e633; + text-shadow: 1px 1px 0 #666; + background: linear-gradient(to top left, #f7e633, #f1d32f) +} + +.content blockquote, +.content pre { + background-color: #292929; + color: #fff; + padding: 1.5em 28px; + margin: 0; + width: 50%; + float: right; + clear: right; + box-sizing: border-box; + text-shadow: 0 1px 2px rgba(0, 0, 0, .4) +} + +.content blockquote pre.sf-dump, +.content pre pre.sf-dump { + width: 100%; +} + +.content .annotation { + background-color: #292929; + color: #fff; + padding: 0 28px; + margin: 0; + width: 50%; + float: right; + clear: right; + box-sizing: border-box; + text-shadow: 0 1px 2px rgba(0, 0, 0, .4) +} + +.content .annotation pre { + padding: 0 0; + width: 100%; + float: none; +} + +.content blockquote>p, +.content pre>p { + margin: 0 +} + +.content blockquote a, +.content pre a { + color: #fff; + text-decoration: none; + border-bottom: 1px dashed #ccc +} + +.content blockquote>p { + background-color: #1c1c1c; + border-radius: 5px; + padding: 13px; + color: #ccc; + border-top: 1px solid #000; + border-bottom: 1px solid #404040 +} + +@media (max-width:930px) { + .tocify-wrapper { + left: -230px + } + .tocify-wrapper.open { + left: 0 + } + .page-wrapper { + margin-left: 0 + } + #nav-button { + display: block + } + .tocify-wrapper .tocify-item>a { + padding-top: .3em; + padding-bottom: .3em + } +} + +@media (max-width:700px) { + .dark-box { + display: none + } + .tocify-wrapper .lang-selector { + display: block + } + .page-wrapper .lang-selector { + display: none + } + .content>aside, + .content>details, + .content>dl, + .content>h1, + .content>h2, + .content>h3, + .content>h4, + .content>h5, + .content>h6, + .content>ol, + .content>p, + .content>table, + .content>ul, + .content>div, + .content>form>aside, + .content>form>details, + .content>form>h1, + .content>form>h2, + .content>form>h3, + .content>form>h4, + .content>form>h5, + .content>form>h6, + .content>form>p, + .content>form>table, + .content>form>ul, + .content>form>div { + margin-right: 0; + } + .content blockquote, + .content pre { + float: none; + width: auto + } + .content .annotation { + float: none; + width: auto + } +} + +.badge { + padding: 1px 9px 2px; + white-space: nowrap; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; + color: #ffffff; + text-shadow: none !important; + font-weight: bold; +} + +.badge.badge-darkred { + background-color: darkred; +} + +.badge.badge-red { + background-color: red; +} + +.badge.badge-blue { + background-color: blue; +} + +.badge.badge-darkblue { + background-color: darkblue; +} + +.badge.badge-green { + background-color: green; +} + +.badge.badge-darkgreen { + background-color: darkgreen; +} + +.badge.badge-purple { + background-color: purple; +} + +.badge.badge-black { + background-color: black; +} + +.badge.badge-grey { + background-color: grey; +} + +.fancy-heading-panel { + background-color: lightgrey; + border-radius: 5px; + padding-left: 5px !important; + padding-top: 5px !important; + padding-bottom: 5px !important; + margin-left: 25px; + margin-right: 10px; + width: 47%; +} + +@media screen and (max-width: 700px) { + .fancy-heading-panel { + width: 95%; + } + +} + +button { + border: none; +} + +* { + /* Foreground, Background */ + scrollbar-color: #3c4c67 transparent; +} +*::-webkit-scrollbar { /* Background */ + width: 10px; + height: 10px; + background: transparent; +} + +*::-webkit-scrollbar-thumb { /* Foreground */ + background: #626161; +} diff --git a/public/vendor/scribe/images/navbar.png b/public/vendor/scribe/images/navbar.png new file mode 100644 index 0000000..df38e90 Binary files /dev/null and b/public/vendor/scribe/images/navbar.png differ diff --git a/public/vendor/scribe/js/theme-default-5.2.1.js b/public/vendor/scribe/js/theme-default-5.2.1.js new file mode 100644 index 0000000..31c8451 --- /dev/null +++ b/public/vendor/scribe/js/theme-default-5.2.1.js @@ -0,0 +1,149 @@ +document.addEventListener('DOMContentLoaded', function() { + const updateHash = function (id) { + window.location.hash = `#${id}`; + }; + + const navButton = document.getElementById('nav-button'); + const menuWrapper = document.querySelector('.tocify-wrapper'); + function toggleSidebar(event) { + event.preventDefault(); + if (menuWrapper) { + menuWrapper.classList.toggle('open'); + navButton.classList.toggle('open'); + } + } + function closeSidebar() { + if (menuWrapper) { + menuWrapper.classList.remove('open'); + navButton.classList.remove('open'); + } + } + navButton.addEventListener('click', toggleSidebar); + + window.hljs.highlightAll(); + + const wrapper = document.getElementById('toc'); + // https://jets.js.org/ + window.jets = new window.Jets({ + // *OR - Selects elements whose values contains at least one part of search substring + searchSelector: '*OR', + searchTag: '#input-search', + contentTag: '#toc li', + didSearch: function(term) { + wrapper.classList.toggle('jets-searching', String(term).length > 0) + }, + // map these accent keys to plain values + diacriticsMap: { + a: 'ÀÁÂÃÄÅàáâãäåĀāąĄ', + c: 'ÇçćĆčČ', + d: 'đĐďĎ', + e: 'ÈÉÊËèéêëěĚĒēęĘ', + i: 'ÌÍÎÏìíîïĪī', + l: 'łŁ', + n: 'ÑñňŇńŃ', + o: 'ÒÓÔÕÕÖØòóôõöøŌō', + r: 'řŘ', + s: 'ŠšśŚ', + t: 'ťŤ', + u: 'ÙÚÛÜùúûüůŮŪū', + y: 'ŸÿýÝ', + z: 'ŽžżŻźŹ' + } + }); + + function hashChange() { + const currentItems = document.querySelectorAll('.tocify-subheader.visible, .tocify-item.tocify-focus'); + Array.from(currentItems).forEach((elem) => { + elem.classList.remove('visible', 'tocify-focus'); + }); + + const currentTag = document.querySelector(`a[href="${window.location.hash}"]`); + if (currentTag) { + const parent = currentTag.closest('.tocify-subheader'); + if (parent) { + parent.classList.add('visible'); + } + + const siblings = currentTag.closest('.tocify-header'); + if (siblings) { + Array.from(siblings.querySelectorAll('.tocify-subheader')).forEach((elem) => { + elem.classList.add('visible'); + }); + } + + currentTag.parentElement.classList.add('tocify-focus'); + + // wait for dom changes to be done + setTimeout(() => { + currentTag.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' }); + // only close the sidebar on level-2 events + if (currentTag.parentElement.classList.contains('level-2')) { + closeSidebar(); + } + }, 1500); + } + } + + let languages = JSON.parse(document.body.getAttribute('data-languages')); + // Support a key => value object where the key is the name, or an array of strings where the value is the name + if (!Array.isArray(languages)) { + languages = Object.values(languages); + } + // if there is no language use the first one + const currentLanguage = window.localStorage.getItem('language') || languages[0]; + const languageStyle = document.getElementById('language-style'); + const langSelector = document.querySelectorAll('.lang-selector button.lang-button'); + + function setActiveLanguage(newLanguage) { + window.localStorage.setItem('language', newLanguage); + if (!languageStyle) { + return; + } + + const newStyle = languages.map((language) => { + return language === newLanguage + // the current one should be visible + ? `body .content .${language}-example pre { display: block; }` + // the inactive one should be hidden + : `body .content .${language}-example pre { display: none; }`; + }).join(`\n`); + + Array.from(langSelector).forEach((elem) => { + elem.classList.toggle('active', elem.getAttribute('data-language-name') === newLanguage); + }); + + const activeHash = window.location.hash.slice(1); + + languageStyle.innerHTML = newStyle; + + setTimeout(() => { + updateHash(activeHash); + }, 200); + } + + setActiveLanguage(currentLanguage); + + Array.from(langSelector).forEach((elem) => { + elem.addEventListener('click', () => { + const newLanguage = elem.getAttribute('data-language-name'); + setActiveLanguage(newLanguage); + }); + }); + + window.addEventListener('hashchange', hashChange, false); + + const divs = document.querySelectorAll('.content h1[id], .content h2[id]'); + + document.addEventListener('scroll', () => { + divs.forEach(item => { + const rect = item.getBoundingClientRect(); + if (rect.top > 0 && rect.top < 150) { + const location = window.location.toString().split('#')[0]; + history.replaceState(null, null, location + '#' + item.id); + hashChange(); + } + }); + }); + + hashChange(); +}); diff --git a/public/vendor/scribe/js/tryitout-5.2.1.js b/public/vendor/scribe/js/tryitout-5.2.1.js new file mode 100644 index 0000000..2a1d2b8 --- /dev/null +++ b/public/vendor/scribe/js/tryitout-5.2.1.js @@ -0,0 +1,289 @@ +window.abortControllers = {}; + +function cacheAuthValue() { + // Whenever the auth header is set for one endpoint, cache it for the others + window.lastAuthValue = ''; + let authInputs = document.querySelectorAll(`.auth-value`) + authInputs.forEach(el => { + el.addEventListener('input', (event) => { + window.lastAuthValue = event.target.value; + authInputs.forEach(otherInput => { + if (otherInput === el) return; + // Don't block the main thread + setTimeout(() => { + otherInput.value = window.lastAuthValue; + }, 0); + }); + }); + }); +} + +window.addEventListener('DOMContentLoaded', cacheAuthValue); + +function getCookie(name) { + if (!document.cookie) { + return null; + } + + const cookies = document.cookie.split(';') + .map(c => c.trim()) + .filter(c => c.startsWith(name + '=')); + + if (cookies.length === 0) { + return null; + } + + return decodeURIComponent(cookies[0].split('=')[1]); +} + +function tryItOut(endpointId) { + document.querySelector(`#btn-tryout-${endpointId}`).hidden = true; + document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = false; + const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`).hidden = false; + executeBtn.disabled = false; + + // Show all input fields + document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`) + .forEach(el => el.style.display = 'block'); + + if (document.querySelector(`#form-${endpointId}`).dataset.authed === "1") { + const authElement = document.querySelector(`#auth-${endpointId}`); + authElement && (authElement.hidden = false); + } + // Expand all nested fields + document.querySelectorAll(`#form-${endpointId} details`) + .forEach(el => el.open = true); +} + +function cancelTryOut(endpointId) { + if (window.abortControllers[endpointId]) { + window.abortControllers[endpointId].abort(); + delete window.abortControllers[endpointId]; + } + + document.querySelector(`#btn-tryout-${endpointId}`).hidden = false; + const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`); + executeBtn.hidden = true; + executeBtn.textContent = executeBtn.dataset.initialText; + document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = true; + // Hide inputs + document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`) + .forEach(el => el.style.display = 'none'); + document.querySelectorAll(`#form-${endpointId} details`) + .forEach(el => el.open = false); + const authElement = document.querySelector(`#auth-${endpointId}`); + authElement && (authElement.hidden = true); + + document.querySelector('#execution-results-' + endpointId).hidden = true; + document.querySelector('#execution-error-' + endpointId).hidden = true; + + // Revert to sample code blocks + document.querySelector('#example-requests-' + endpointId).hidden = false; + document.querySelector('#example-responses-' + endpointId).hidden = false; +} + +function makeAPICall(method, path, body = {}, query = {}, headers = {}, endpointId = null) { + console.log({endpointId, path, body, query, headers}); + + if (!(body instanceof FormData) && typeof body !== "string") { + body = JSON.stringify(body) + } + + const url = new URL(window.tryItOutBaseUrl + '/' + path.replace(/^\//, '')); + + // We need this function because if you try to set an array or object directly to a URLSearchParams object, + // you'll get [object Object] or the array.toString() + function addItemToSearchParamsObject(key, value, searchParams) { + if (Array.isArray(value)) { + value.forEach((v, i) => { + // Append {filters: [first, second]} as filters[0]=first&filters[1]second + addItemToSearchParamsObject(key + '[' + i + ']', v, searchParams); + }) + } else if (typeof value === 'object' && value !== null) { + Object.keys(value).forEach((i) => { + // Append {filters: {name: first}} as filters[name]=first + addItemToSearchParamsObject(key + '[' + i + ']', value[i], searchParams); + }); + } else { + searchParams.append(key, value); + } + } + + Object.keys(query) + .forEach(key => addItemToSearchParamsObject(key, query[key], url.searchParams)); + + window.abortControllers[endpointId] = new AbortController(); + + return fetch(url, { + method, + headers, + body: method === 'GET' ? undefined : body, + signal: window.abortControllers[endpointId].signal, + referrer: window.tryItOutBaseUrl, + mode: 'cors', + credentials: 'same-origin', + }) + .then(response => Promise.all([response.status, response.statusText, response.text(), response.headers])); +} + +function hideCodeSamples(endpointId) { + document.querySelector('#example-requests-' + endpointId).hidden = true; + document.querySelector('#example-responses-' + endpointId).hidden = true; +} + +function handleResponse(endpointId, response, status, headers) { + hideCodeSamples(endpointId); + + // Hide error views + document.querySelector('#execution-error-' + endpointId).hidden = true; + + const responseContentEl = document.querySelector('#execution-response-content-' + endpointId); + + // Check if the response contains Laravel's dd() default dump output + const isLaravelDump = response.includes('Sfdump'); + + // If it's a Laravel dd() dump, use innerHTML to render it safely + if (isLaravelDump) { + responseContentEl.innerHTML = response === '' ? responseContentEl.dataset.emptyResponseText : response; + } else { + // Otherwise, stick to textContent for regular responses + responseContentEl.textContent = response === '' ? responseContentEl.dataset.emptyResponseText : response; + } + + // Prettify it if it's JSON + let isJson = false; + try { + const jsonParsed = JSON.parse(response); + if (jsonParsed !== null) { + isJson = true; + response = JSON.stringify(jsonParsed, null, 4); + responseContentEl.textContent = response; + } + } catch (e) { + + } + + isJson && window.hljs.highlightElement(responseContentEl); + const statusEl = document.querySelector('#execution-response-status-' + endpointId); + statusEl.textContent = ` (${status})`; + document.querySelector('#execution-results-' + endpointId).hidden = false; + statusEl.scrollIntoView({behavior: "smooth", block: "center"}); +} + +function handleError(endpointId, err) { + hideCodeSamples(endpointId); + // Hide response views + document.querySelector('#execution-results-' + endpointId).hidden = true; + + // Show error views + let errorMessage = err.message || err; + const $errorMessageEl = document.querySelector('#execution-error-message-' + endpointId); + $errorMessageEl.textContent = errorMessage + $errorMessageEl.textContent; + const errorEl = document.querySelector('#execution-error-' + endpointId); + errorEl.hidden = false; + errorEl.scrollIntoView({behavior: "smooth", block: "center"}); + +} + +async function executeTryOut(endpointId, form) { + const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`); + executeBtn.textContent = executeBtn.dataset.loadingText; + executeBtn.disabled = true; + executeBtn.scrollIntoView({behavior: "smooth", block: "center"}); + + let body; + let setter; + if (form.dataset.hasfiles === "1") { + body = new FormData(); + setter = (name, value) => body.append(name, value); + } else if (form.dataset.isarraybody === "1") { + body = []; + setter = (name, value) => _.set(body, name, value); + } else { + body = {}; + setter = (name, value) => _.set(body, name, value); + } + const bodyParameters = form.querySelectorAll('input[data-component=body]'); + bodyParameters.forEach(el => { + let value = el.value; + + if (el.type === 'number' && typeof value === 'string') { + value = parseFloat(value); + } + + if (el.type === 'file' && el.files[0]) { + setter(el.name, el.files[0]); + return; + } + + if (el.type !== 'radio') { + if (value === "" && el.required === false) { + // Don't include empty optional values in the request + return; + } + setter(el.name, value); + return; + } + + if (el.checked) { + value = (value === 'false') ? false : true; + setter(el.name, value); + } + }); + + const query = {}; + const queryParameters = form.querySelectorAll('input[data-component=query]'); + queryParameters.forEach(el => { + if (el.type !== 'radio' || (el.type === 'radio' && el.checked)) { + if (el.value === '') { + // Don't include empty values in the request + return; + } + + _.set(query, el.name, el.value); + } + }); + + let path = form.dataset.path; + const urlParameters = form.querySelectorAll('input[data-component=url]'); + urlParameters.forEach(el => (path = path.replace(new RegExp(`\\{${el.name}\\??}`), el.value))); + + const headers = Object.fromEntries(Array.from(form.querySelectorAll('input[data-component=header]')) + .map(el => [el.name, el.value])); + + // When using FormData, the browser sets the correct content-type + boundary + let method = form.dataset.method; + if (body instanceof FormData) { + delete headers['Content-Type']; + + // When using FormData with PUT or PATCH, use method spoofing so PHP can access the post body + if (['PUT', 'PATCH'].includes(form.dataset.method)) { + method = 'POST'; + setter('_method', form.dataset.method); + } + } + + let preflightPromise = Promise.resolve(); + if (window.useCsrf && window.csrfUrl) { + preflightPromise = makeAPICall('GET', window.csrfUrl).then(() => { + headers['X-XSRF-TOKEN'] = getCookie('XSRF-TOKEN'); + }); + } + + return preflightPromise.then(() => makeAPICall(method, path, body, query, headers, endpointId)) + .then(([responseStatus, statusText, responseContent, responseHeaders]) => { + handleResponse(endpointId, responseContent, responseStatus, responseHeaders) + }) + .catch(err => { + if (err.name === "AbortError") { + console.log("Request cancelled"); + return; + } + console.log("Error while making request: ", err); + handleError(endpointId, err); + }) + .finally(() => { + executeBtn.disabled = false; + executeBtn.textContent = executeBtn.dataset.initialText; + }); +} diff --git a/resources/views/scribe/index.blade.php b/resources/views/scribe/index.blade.php new file mode 100644 index 0000000..71dffb2 --- /dev/null +++ b/resources/views/scribe/index.blade.php @@ -0,0 +1,286 @@ + + + + + + + Laravel API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + MENU + navbar-image + + +
+ +
+ + +
+ + + +
+ + + +
+ + + + +
+ +
+
+
+

Introduction

+ +
This documentation aims to provide all the information you need to work with our API.
+
+<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
+You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
+ +

Authenticating requests

+

This API is not authenticated.

+ +

Endpoints

+ + + + + +

+

+ + + + +
Example request:
+ + +
+
curl --request GET \
+    --get "https://KTV.test/api/artists/search" \
+    --header "Content-Type: application/json" \
+    --header "Accept: application/json"
+ + +
+
const url = new URL(
+    "https://KTV.test/api/artists/search"
+);
+
+const headers = {
+    "Content-Type": "application/json",
+    "Accept": "application/json",
+};
+
+fetch(url, {
+    method: "GET",
+    headers,
+}).then(response => response.json());
+ +
+ + +
+

Example response (200):

+
+
+ + Show headers + +
cache-control: no-cache, private
+content-type: application/json
+access-control-allow-origin: *
+ 
+
+[
+    {
+        "id": 10984,
+        "name": "&TEAM"
+    },
+    {
+        "id": 2,
+        "name": "=LOVE(等愛)"
+    },
+    {
+        "id": 3,
+        "name": "≒JOY"
+    },
+    {
+        "id": 4,
+        "name": "100%樂團"
+    },
+    {
+        "id": 5,
+        "name": "1088"
+    },
+    {
+        "id": 6,
+        "name": "10CC"
+    },
+    {
+        "id": 7,
+        "name": "10CM"
+    },
+    {
+        "id": 8,
+        "name": "183CLUB"
+    },
+    {
+        "id": 9,
+        "name": "187INC"
+    },
+    {
+        "id": 10,
+        "name": "19"
+    }
+]
+ 
+
+ + + + + + + +
+
+
+ + +
+
+
+ + diff --git a/開發手冊.ini b/開發手冊.ini index 2fc1393..3dd2d67 100644 --- a/開發手冊.ini +++ b/開發手冊.ini @@ -118,4 +118,13 @@ php artisan migrate php artisan migrate:rollback php artisan migrate -php artisan transfer:sqlite-to-mysql \ No newline at end of file +php artisan transfer:sqlite-to-mysql + + +composer require laravel/sanctum +php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider" +php artisan migrate + +composer require knuckleswtf/scribe +php artisan vendor:publish --tag=scribe-config +php artisan scribe:generate \ No newline at end of file