Compare commits

..

282 Commits

Author SHA1 Message Date
snipe
b3e7619adc Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-07-23 16:11:20 +01:00
snipe
6e56d56137 Merge remote-tracking branch 'origin/develop' 2025-07-23 15:06:25 +01:00
snipe
2528f6a07b Merge remote-tracking branch 'origin/develop' 2025-07-23 14:56:49 +01:00
snipe
423d07c919 Merge remote-tracking branch 'origin/develop' 2025-07-23 12:41:20 +01:00
snipe
cc608de4bf Merge remote-tracking branch 'origin/develop' 2025-07-23 12:28:35 +01:00
snipe
f999a68608 Merge remote-tracking branch 'origin/develop' 2025-07-22 20:28:53 +01:00
snipe
db78a9f18f Merge remote-tracking branch 'origin/develop' 2025-07-22 15:25:51 +01:00
snipe
816039f48e Merge remote-tracking branch 'origin/develop' 2025-07-22 15:18:50 +01:00
snipe
ae240bae6d Updated prod CSS
Signed-off-by: snipe <snipe@snipe.net>
2025-07-22 15:14:42 +01:00
snipe
9e30c69e6d Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-07-22 15:14:32 +01:00
snipe
43c7de9049 Updated prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-07-22 14:38:04 +01:00
snipe
7e51c5db81 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-07-22 14:34:10 +01:00
snipe
0ee3c45e7b Merge remote-tracking branch 'origin/develop' 2025-07-22 13:39:54 +01:00
snipe
981e69929c Merge remote-tracking branch 'origin/develop' 2025-07-21 12:36:44 +01:00
snipe
1eae5d12fc Merge remote-tracking branch 'origin/develop' 2025-07-18 17:56:20 +01:00
snipe
8863208333 Merge remote-tracking branch 'origin/develop' 2025-07-16 17:35:55 +01:00
snipe
5f38a74a72 Merge remote-tracking branch 'origin/develop' 2025-07-16 17:02:29 +01:00
snipe
fe15dacb1f Merge remote-tracking branch 'origin/develop' 2025-07-16 16:54:30 +01:00
snipe
c2d44cf2f2 Merge remote-tracking branch 'origin/develop' 2025-07-16 12:25:14 +01:00
snipe
7f1bdb6f34 Merge remote-tracking branch 'origin/develop' 2025-07-15 10:58:58 +01:00
snipe
b0305e12d2 Merge remote-tracking branch 'origin/develop' 2025-07-10 13:11:10 +01:00
snipe
58f76b5c99 Merge remote-tracking branch 'origin/develop' 2025-07-09 21:01:24 +01:00
snipe
7c4ee632cf Merge remote-tracking branch 'origin/develop' 2025-07-09 20:58:17 +01:00
snipe
b6b0f716eb Merge remote-tracking branch 'origin/develop' 2025-07-09 20:22:25 +01:00
snipe
bd0e04ed15 Merge remote-tracking branch 'origin/develop' 2025-07-09 15:48:17 +01:00
snipe
8599981d44 Merge remote-tracking branch 'origin/develop' 2025-07-09 15:46:53 +01:00
snipe
6fc6e95c67 Merge remote-tracking branch 'origin/develop' 2025-07-08 22:02:34 +01:00
snipe
43b585bde8 Merge remote-tracking branch 'origin/develop' 2025-07-08 21:59:58 +01:00
snipe
710f89291f Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-07-08 21:27:06 +01:00
snipe
4c6249eb9e Merge remote-tracking branch 'origin/develop' 2025-07-07 22:09:45 +01:00
snipe
016900bad8 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-07-07 21:54:04 +01:00
snipe
2e8ae33761 Merge remote-tracking branch 'origin/develop' 2025-07-07 20:58:36 +01:00
snipe
0d325060da Merge remote-tracking branch 'origin/develop' 2025-07-07 17:06:24 +01:00
snipe
1a6e98e18f Merge remote-tracking branch 'origin/develop' 2025-07-07 16:24:04 +01:00
snipe
97e34595f6 Merge remote-tracking branch 'origin/develop' 2025-07-07 16:00:10 +01:00
snipe
a179d5234b Merge remote-tracking branch 'origin/develop' 2025-07-07 14:43:28 +01:00
snipe
64c6121fdb Merge remote-tracking branch 'origin/develop' 2025-07-07 14:00:55 +01:00
snipe
08d8954a85 Merge remote-tracking branch 'origin/develop' 2025-07-07 14:00:03 +01:00
snipe
4f20955d0d Merge remote-tracking branch 'origin/develop' 2025-07-07 13:46:03 +01:00
snipe
3a703c8bcf Merge remote-tracking branch 'origin/develop' 2025-07-07 13:35:07 +01:00
snipe
ccbffa086b Merge remote-tracking branch 'origin/develop' 2025-07-07 11:36:33 +01:00
snipe
07ee4be840 Merge remote-tracking branch 'origin/develop' 2025-07-02 18:38:12 +01:00
snipe
4cc9b2d312 Merge remote-tracking branch 'origin/develop' 2025-07-02 17:21:39 +01:00
snipe
24dddae1d1 Merge remote-tracking branch 'origin/develop' 2025-07-02 11:57:57 +01:00
snipe
ad0165d085 Merge remote-tracking branch 'origin/develop' 2025-07-02 11:44:30 +01:00
snipe
39dc38c5d1 Merge remote-tracking branch 'origin/develop' 2025-07-01 23:32:43 +01:00
snipe
046ce19dbb Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-06-30 11:46:24 +01:00
snipe
33263f5a93 Merge remote-tracking branch 'origin/develop' 2025-06-27 13:52:09 +01:00
snipe
8ef8e76300 Merge remote-tracking branch 'origin/develop' 2025-06-27 12:48:54 +01:00
snipe
73cfdae9e7 Merge remote-tracking branch 'origin/develop' 2025-06-25 15:00:46 +01:00
snipe
54a3e41281 Merge remote-tracking branch 'origin/develop' 2025-06-25 14:58:46 +01:00
snipe
d59ba6da84 Merge remote-tracking branch 'origin/develop' 2025-06-25 13:11:39 +01:00
snipe
1b28b06934 Merge remote-tracking branch 'origin/develop' 2025-06-25 11:04:15 +01:00
snipe
ff3e69a56c Merge remote-tracking branch 'origin/develop' 2025-06-23 20:51:24 +01:00
snipe
6b975a5fb4 Merge remote-tracking branch 'origin/develop' 2025-06-23 16:41:42 +01:00
snipe
3a02b15124 Merge remote-tracking branch 'origin/develop' 2025-06-23 12:38:40 +01:00
snipe
5f73d81935 Merge remote-tracking branch 'origin/develop' 2025-06-22 20:14:59 +01:00
snipe
002b5c0f6f Merge remote-tracking branch 'origin/develop' 2025-06-22 20:07:52 +01:00
snipe
8086842570 Merge remote-tracking branch 'origin/develop' 2025-06-22 19:42:03 +01:00
snipe
51f2d5a664 Merge remote-tracking branch 'origin/develop' 2025-06-22 19:30:42 +01:00
snipe
b74b76de75 Merge remote-tracking branch 'origin/develop' 2025-06-17 18:17:10 +01:00
snipe
a1b1498106 Merge remote-tracking branch 'origin/develop' 2025-06-17 17:51:37 +01:00
snipe
1158851ea7 Merge remote-tracking branch 'origin/develop' 2025-06-17 15:57:12 +01:00
snipe
e1ab9e959e Merge remote-tracking branch 'origin/develop' 2025-06-17 13:03:27 +01:00
snipe
2bbac3ae9d Merge remote-tracking branch 'origin/develop' 2025-06-17 12:38:52 +01:00
snipe
e889b1d5e5 Merge remote-tracking branch 'origin/develop' 2025-06-17 11:42:00 +01:00
snipe
233bf856f4 Merge remote-tracking branch 'origin/develop' 2025-06-17 11:39:12 +01:00
snipe
bca843e06c Merge remote-tracking branch 'origin/develop' 2025-06-16 20:32:40 +01:00
snipe
30a79a1278 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-06-16 14:45:53 +01:00
snipe
0f92dee2c4 Merge remote-tracking branch 'origin/develop' 2025-06-15 03:41:23 +01:00
snipe
f04efede15 Merge remote-tracking branch 'origin/develop' 2025-06-15 02:59:47 +01:00
snipe
f0dfdf6720 Merge remote-tracking branch 'origin/develop' 2025-06-14 23:56:06 +01:00
snipe
e26d731382 Merge remote-tracking branch 'origin/develop' 2025-06-14 23:08:48 +01:00
snipe
d684d3e559 Merge remote-tracking branch 'origin/develop' 2025-06-14 22:22:54 +01:00
snipe
47c54cb998 Merge remote-tracking branch 'origin/develop' 2025-06-14 17:45:44 +01:00
snipe
592cb2b3ec Merge remote-tracking branch 'origin/develop' 2025-06-14 17:08:11 +01:00
snipe
f5a7871a2e Merge remote-tracking branch 'origin/develop' 2025-06-14 16:44:48 +01:00
snipe
ec411fa0db Merge remote-tracking branch 'origin/develop' 2025-06-14 12:17:43 +01:00
snipe
a850a9bb83 Merge remote-tracking branch 'origin/develop' 2025-06-12 21:34:59 +01:00
snipe
479b7a3f94 Merge remote-tracking branch 'origin/develop' 2025-06-11 10:32:49 +01:00
snipe
f7cfee77c9 Merge remote-tracking branch 'origin/develop' 2025-06-11 10:20:22 +01:00
snipe
65a8126a13 Merge remote-tracking branch 'origin/develop' 2025-06-09 13:40:44 +01:00
snipe
a39bc102d5 Merge remote-tracking branch 'origin/develop' 2025-06-08 15:30:32 +01:00
snipe
81d930c4d2 Merge remote-tracking branch 'origin/develop' 2025-06-08 15:19:19 +01:00
snipe
6839623061 Merge remote-tracking branch 'origin/develop' 2025-06-06 17:03:37 +01:00
snipe
7de2809d42 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2025-06-06 14:05:47 +01:00
snipe
98ec6b6886 Merge remote-tracking branch 'origin/develop' 2025-06-06 12:48:54 +01:00
snipe
04827f00cc Merge remote-tracking branch 'origin/develop' 2025-06-06 11:54:10 +01:00
snipe
660bfc6578 Merge remote-tracking branch 'origin/develop' 2025-06-06 08:31:09 +01:00
snipe
1152cd5537 Merge remote-tracking branch 'origin/develop' 2025-06-06 08:26:52 +01:00
snipe
f30e8497b2 Merge remote-tracking branch 'origin/develop' 2025-06-04 16:17:26 +01:00
snipe
06495bc45d Merge remote-tracking branch 'origin/develop' 2025-06-04 12:13:30 +01:00
snipe
26067916b3 Merge remote-tracking branch 'origin/develop' 2025-06-04 11:49:03 +01:00
snipe
c36ee4852b Merge remote-tracking branch 'origin/develop' 2025-06-04 10:40:56 +01:00
snipe
2cb992ad44 Merge remote-tracking branch 'origin/develop' 2025-06-04 08:43:52 +01:00
snipe
083b7be6c0 Make version number match tagged version :(
Signed-off-by: snipe <snipe@snipe.net>
2025-06-03 11:03:33 +01:00
snipe
e24854558f Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-06-03 11:03:05 +01:00
snipe
e4314cf426 Merge remote-tracking branch 'origin/develop' 2025-06-03 06:07:20 +01:00
snipe
4106e4e45c Merge remote-tracking branch 'origin/develop' 2025-06-02 22:29:09 +01:00
snipe
05f143db2b Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-06-02 18:15:54 +01:00
snipe
64aeaeeeea Merge remote-tracking branch 'origin/develop' 2025-06-02 17:29:52 +01:00
snipe
61db37ab0d Merge remote-tracking branch 'origin/develop' 2025-06-02 15:28:08 +01:00
snipe
f9c4d921e7 Merge remote-tracking branch 'origin/develop' 2025-06-02 15:07:15 +01:00
snipe
ca099df573 Merge remote-tracking branch 'origin/develop' 2025-06-02 15:04:00 +01:00
snipe
28b584b8bc Merge remote-tracking branch 'origin/develop' 2025-06-02 02:08:19 +01:00
snipe
70449e694d Merge remote-tracking branch 'origin/develop' 2025-05-29 22:18:50 +01:00
snipe
8395ea552d Merge remote-tracking branch 'origin/develop' 2025-05-29 16:17:58 +01:00
snipe
dc66452633 Merge remote-tracking branch 'origin/develop' 2025-05-29 13:32:41 +01:00
snipe
53ce44ac91 Merge remote-tracking branch 'origin/develop' 2025-05-29 12:38:40 +01:00
snipe
c7c3243bbc Merge remote-tracking branch 'origin/develop' 2025-05-29 12:35:21 +01:00
snipe
8bdd77d33d Merge remote-tracking branch 'origin/develop' 2025-05-29 12:24:51 +01:00
snipe
acd7d0db3a Merge remote-tracking branch 'origin/develop' 2025-05-29 12:09:08 +01:00
snipe
2bfadb8a3c Merge remote-tracking branch 'origin/develop' 2025-05-28 15:21:34 +01:00
snipe
0912e4af7b Merge remote-tracking branch 'origin/develop' 2025-05-26 13:17:38 +01:00
snipe
5aa5c48018 Merge remote-tracking branch 'origin/develop' 2025-05-23 19:37:42 +01:00
snipe
8cdd998f79 Merge remote-tracking branch 'origin/develop' 2025-05-23 17:35:08 +01:00
snipe
050d4d6b25 Merge remote-tracking branch 'origin/develop' 2025-05-23 14:51:48 +01:00
snipe
366cd11238 Merge remote-tracking branch 'origin/develop' 2025-05-23 14:31:10 +01:00
snipe
58d6443331 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-05-23 13:27:44 +01:00
snipe
101b8afb56 Merge remote-tracking branch 'origin/develop' 2025-05-23 13:07:47 +01:00
snipe
5df5c47945 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-05-23 10:43:58 +01:00
snipe
a04740ba86 Merge remote-tracking branch 'origin/develop' 2025-05-23 10:42:44 +01:00
snipe
425ad93ac5 Merge remote-tracking branch 'origin/develop' 2025-05-23 10:17:10 +01:00
snipe
8a44144c20 Merge pull request #16954 from grokability/develop
Merge dev into master
2025-05-16 11:16:14 +02:00
snipe
ee82c70582 Merge remote-tracking branch 'origin/develop' 2025-05-15 18:32:05 +02:00
snipe
c87e8e606b Merge remote-tracking branch 'origin/develop' 2025-05-15 18:02:47 +02:00
snipe
37a50dd953 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-05-15 17:51:54 +02:00
snipe
a2669a3084 Removed temp code
Signed-off-by: snipe <snipe@snipe.net>
2025-05-15 17:31:16 +02:00
snipe
77da22f4dd Print errors if they exist (temp)
Signed-off-by: snipe <snipe@snipe.net>
2025-05-15 17:26:04 +02:00
snipe
7830ffe202 Temp echo errors
Signed-off-by: snipe <snipe@snipe.net>
2025-05-15 17:24:08 +02:00
snipe
1c9e20d59f Merge remote-tracking branch 'origin/develop' 2025-05-15 17:10:57 +02:00
snipe
320edac286 Merge remote-tracking branch 'origin/develop' 2025-05-14 17:39:30 +02:00
snipe
d49878371d Merge remote-tracking branch 'origin/develop' 2025-05-14 16:23:38 +02:00
snipe
d2575a5d9b Add @JassonCordones as a contributor 2025-05-14 15:03:04 +02:00
Marcus Moore
ea6cf72580 Formatting 2025-05-14 15:03:04 +02:00
Marcus Moore
2118155b37 Fix bug in getImageUrl method 2025-05-14 15:03:04 +02:00
Marcus Moore
ba4f5bb71f Add test for existing functionality 2025-05-14 15:03:04 +02:00
Marcus Moore
d5a74a5a8b Remove unneeded div 2025-05-14 15:03:04 +02:00
Marcus Moore
23be1df360 Remove the replaced locales form macro 2025-05-14 15:03:04 +02:00
Marcus Moore
b5c1a1da4c Replace Form::locales on user setup 2025-05-14 15:03:04 +02:00
Marcus Moore
c11e784f51 Replace Form::locales on bulk edit users page 2025-05-14 15:03:04 +02:00
Marcus Moore
06f51c8f9c Replace Form::locales on user edit page 2025-05-14 15:03:04 +02:00
Marcus Moore
181bcbbda6 Replace Form::locales on localization page 2025-05-14 15:03:04 +02:00
Marcus Moore
d008ead6a4 Fix input name 2025-05-14 15:03:04 +02:00
Marcus Moore
75924be958 Introduce locale select component and make replacement on profile page 2025-05-14 15:03:04 +02:00
snipe
b1a6e3f8a2 Merge pull request #16930 from JassonCordones/master
fix typo in snipeit.sh
2025-05-14 15:01:41 +02:00
snipe
06712a6041 Merge remote-tracking branch 'origin/develop' 2025-05-14 13:42:51 +02:00
snipe
62b16339a9 Merge remote-tracking branch 'origin/develop' 2025-05-13 20:44:34 +02:00
Jasson
9a2f1a36ba fix typo in snipeit.sh
fix redirect output to stderr
2025-05-13 14:31:37 -04:00
snipe
95cc4d3a73 Merge remote-tracking branch 'origin/develop' 2025-05-09 21:16:58 +01:00
snipe
497eeeb2e0 Merge remote-tracking branch 'origin/develop' 2025-05-09 19:29:01 +01:00
snipe
4be21ca249 Merge remote-tracking branch 'origin/develop' 2025-05-09 18:03:38 +01:00
snipe
e8598e214e Merge remote-tracking branch 'origin/develop' 2025-05-09 17:23:22 +01:00
snipe
54b1d65e3c Merge remote-tracking branch 'origin/develop' 2025-05-09 14:46:37 +01:00
snipe
f7648496d3 Merge remote-tracking branch 'origin/develop' 2025-05-08 16:26:02 +01:00
snipe
59a57c7197 Merge remote-tracking branch 'origin/develop' 2025-05-08 15:43:53 +01:00
snipe
5659b26827 Merge remote-tracking branch 'origin/develop' 2025-05-08 15:22:43 +01:00
snipe
ee4443aaf0 Merge remote-tracking branch 'origin/develop' 2025-05-08 15:09:26 +01:00
snipe
839dcad358 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-black-dark.css
#	public/css/dist/skins/skin-black-dark.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/mix-manifest.json
2025-05-07 11:41:31 +01:00
snipe
d67933ab49 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	CONTRIBUTORS.md
2025-05-06 16:46:41 +01:00
Godfrey M
0eb3f6b952 set max to 5 2025-05-05 14:42:06 +01:00
Godfrey M
68b0f80fce fix input max, and help block position 2025-05-05 14:42:06 +01:00
Godfrey M
93489529a3 adds Field offset option to labels 2025-05-05 14:42:06 +01:00
snipe
511be74e74 Add @chfsx as a contributor 2025-05-05 14:42:06 +01:00
Fabian Schmid
bdee067803 [FIX] set upload-limit 2025-05-05 14:42:06 +01:00
snipe
32156cace3 Merge pull request #16847 from realchrisolin/issue16214
add barcode support for Avery 3490
2025-05-05 14:40:54 +01:00
snipe
30688114be Merge remote-tracking branch 'origin/develop' 2025-05-05 14:04:52 +01:00
snipe
34088bcc17 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-05-05 11:17:01 +01:00
Calvin Schwartz
07835766cc adds support for Avery 3490 2025-05-01 21:11:42 -04:00
Brady Wetherington
251851ec6a Try to get Docker images to build for both architectures 2025-04-30 18:00:39 +01:00
snipe
049a669186 Merge remote-tracking branch 'origin/develop' 2025-04-30 16:46:16 +01:00
snipe
d29f13bae9 Merge remote-tracking branch 'origin/develop' 2025-04-30 16:26:38 +01:00
snipe
c758355df9 Merge remote-tracking branch 'origin/develop' 2025-04-30 16:14:34 +01:00
snipe
79d97a83af Merge remote-tracking branch 'origin/develop' 2025-04-30 15:48:38 +01:00
snipe
85bd47c240 Merge remote-tracking branch 'origin/develop' 2025-04-30 15:35:10 +01:00
snipe
473ead9616 Merge remote-tracking branch 'origin/develop' 2025-04-30 13:57:27 +01:00
snipe
cf2850933c Merge remote-tracking branch 'origin/develop' 2025-04-30 10:19:43 +01:00
snipe
ff2564c57a Merge remote-tracking branch 'origin/develop' 2025-04-30 10:12:05 +01:00
snipe
91d3848246 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-04-29 23:17:51 +01:00
snipe
c031f0b45e Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/mix-manifest.json
2025-04-29 20:38:41 +01:00
snipe
fdbb9568ae Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-29 12:39:31 +01:00
snipe
d817883459 Merge remote-tracking branch 'origin/develop' 2025-04-29 10:25:42 +01:00
snipe
12255979ac Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-29 10:22:21 +01:00
snipe
366b61850b Merge remote-tracking branch 'origin/develop' 2025-04-26 17:54:02 +01:00
snipe
89be6bd183 Merge remote-tracking branch 'origin/develop' 2025-04-24 14:06:00 +01:00
snipe
e120331a2c Merge remote-tracking branch 'origin/develop' 2025-04-24 12:16:53 +01:00
snipe
cb8a212d96 Merge remote-tracking branch 'origin/develop' 2025-04-23 21:57:20 +01:00
snipe
7aec431ac5 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>
2025-04-23 21:30:16 +01:00
snipe
d19681dea1 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>
2025-04-23 21:05:38 +01:00
snipe
bf2299daf8 Merge remote-tracking branch 'origin/develop' 2025-04-22 17:51:48 +01:00
snipe
164930d0dd Merge remote-tracking branch 'origin/develop' 2025-04-22 16:35:23 +01:00
snipe
387dbac809 Merge remote-tracking branch 'origin/develop' 2025-04-22 14:36:14 +01:00
snipe
3b661e5a99 Merge remote-tracking branch 'origin/develop' 2025-04-22 12:39:35 +01:00
snipe
90c1c0e655 Merge remote-tracking branch 'origin/develop' 2025-04-22 11:42:49 +01:00
snipe
21d8e7695b Merge remote-tracking branch 'origin/develop' 2025-04-21 20:19:54 +01:00
snipe
1acc452cfe Merge remote-tracking branch 'origin/develop' 2025-04-21 14:59:26 +01:00
snipe
1375e1feee Merge remote-tracking branch 'origin/develop' 2025-04-21 12:21:08 +01:00
snipe
2187adf59a Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>
2025-04-19 15:34:58 +01:00
snipe
0dcb315d9d Merge remote-tracking branch 'origin/develop' 2025-04-18 00:56:26 +01:00
snipe
327ccbd0c9 Merge remote-tracking branch 'origin/develop' 2025-04-18 00:37:11 +01:00
snipe
f571d400e6 Merge remote-tracking branch 'origin/develop' 2025-04-17 23:29:12 +01:00
snipe
293aa52335 Merge remote-tracking branch 'origin/develop' 2025-04-17 23:13:04 +01:00
snipe
ca178ae9a7 Merge remote-tracking branch 'origin/develop' 2025-04-17 22:48:35 +01:00
snipe
d0c810e418 Merge remote-tracking branch 'origin/develop' 2025-04-17 16:42:37 +01:00
snipe
d496d2caeb Merge remote-tracking branch 'origin/develop' 2025-04-17 11:59:24 +01:00
snipe
e70b75c350 Merge remote-tracking branch 'origin/develop' 2025-04-17 01:00:34 +01:00
snipe
a50befeda5 Merge remote-tracking branch 'origin/develop' 2025-04-16 20:16:18 +01:00
snipe
e2616e8039 Merge remote-tracking branch 'origin/develop' 2025-04-16 15:52:18 +01:00
snipe
904266debe Merge remote-tracking branch 'origin/develop' 2025-04-16 09:47:18 +01:00
snipe
72d5783795 Merge remote-tracking branch 'origin/develop' 2025-04-16 09:19:05 +01:00
snipe
d699fb1473 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>
2025-04-15 20:46:43 +01:00
snipe
fab1a6c33a Merge remote-tracking branch 'origin/develop' 2025-04-15 20:30:02 +01:00
snipe
be73c30194 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2025-04-15 20:01:20 +01:00
snipe
451646fe4f Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-04-15 19:42:26 +01:00
snipe
decc919991 Merge remote-tracking branch 'origin/develop' 2025-04-15 19:33:23 +01:00
snipe
e0b4005921 Merge remote-tracking branch 'origin/develop' 2025-04-15 16:48:17 +01:00
snipe
3ef36e7534 Merge remote-tracking branch 'origin/develop' 2025-04-14 11:02:06 +01:00
snipe
1949e1e1e9 Merge remote-tracking branch 'origin/develop' 2025-04-14 09:26:25 +01:00
snipe
3358382358 Comment out location scoping option for now
Signed-off-by: snipe <snipe@snipe.net>
2025-04-09 21:44:38 +01:00
snipe
3eca3ecd75 Merge remote-tracking branch 'origin/develop' 2025-04-09 21:31:41 +01:00
snipe
140c6b91b0 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-09 02:40:28 +01:00
snipe
a5315ec240 Merge remote-tracking branch 'origin/develop' 2025-04-08 08:32:25 +01:00
snipe
93f1656e0b Merge remote-tracking branch 'origin/develop' 2025-04-08 06:51:21 +01:00
snipe
f1d006c236 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-08 05:58:51 +01:00
snipe
b0b5a96694 Merge remote-tracking branch 'origin/develop' 2025-04-07 13:54:23 +01:00
snipe
7dbe9a85f4 Merge remote-tracking branch 'origin/develop' 2025-04-05 21:02:33 +01:00
snipe
d2c39528d5 Merge remote-tracking branch 'origin/develop' 2025-04-05 15:44:22 +01:00
snipe
0420543c94 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-05 14:11:07 +01:00
snipe
aae0db902b Merge remote-tracking branch 'origin/develop' 2025-04-03 15:41:08 +01:00
snipe
88dae7cef7 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2025-04-03 15:28:10 +01:00
snipe
e5cb17e934 Merge remote-tracking branch 'origin/develop' 2025-04-03 10:16:18 +01:00
snipe
9d609805f2 Merge remote-tracking branch 'origin/develop' 2025-04-02 18:33:48 +01:00
snipe
e2b9ca8254 Merge remote-tracking branch 'origin/develop' 2025-04-02 14:03:22 +01:00
snipe
e16a2fe8af Merge remote-tracking branch 'origin/develop' 2025-04-02 13:51:09 +01:00
snipe
22d61a533d Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-04-02 12:50:35 +01:00
snipe
af408bb45f Merge remote-tracking branch 'origin/develop' 2025-04-01 21:33:07 +01:00
snipe
24bfbc06f0 Merge remote-tracking branch 'origin/develop' 2025-04-01 19:40:03 +01:00
snipe
5eb9f353b5 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2025-04-01 11:25:33 +01:00
snipe
473ce15f47 Merge pull request #16526 from snipe/develop
Merge #16486  and #16519 into master
2025-03-19 15:31:50 -01:00
snipe
eb9cfbaed6 Merge pull request #16498 from snipe/develop
Merge develop into master
2025-03-12 23:23:44 +00:00
snipe
faeb037ff9 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
2025-03-12 21:26:34 +00:00
snipe
07602f697d Merge remote-tracking branch 'origin/develop' 2025-03-12 18:13:22 +00:00
snipe
11abb0fdb1 Merge remote-tracking branch 'origin/develop' 2025-03-11 22:13:34 +00:00
snipe
deeb2fa543 Merge remote-tracking branch 'origin/develop' 2025-03-11 21:14:12 +00:00
snipe
ef8d5ff11e Merge remote-tracking branch 'origin/develop' 2025-03-06 12:06:10 +00:00
snipe
91f3e07b83 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-03-05 17:05:28 +00:00
snipe
c29bdbdacb Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/mix-manifest.json
2025-03-05 13:46:29 +00:00
snipe
a20d104d2f Merge remote-tracking branch 'origin/develop' 2025-03-05 11:59:47 +00:00
snipe
a61dd8ac17 Merge remote-tracking branch 'origin/develop' 2025-03-05 10:52:42 +00:00
snipe
7ee9a690ea Merge remote-tracking branch 'origin/develop' 2025-03-05 01:12:22 +00:00
snipe
5ba94c6c41 Merge remote-tracking branch 'origin/develop' 2025-03-05 00:12:09 +00:00
snipe
9fa855c837 Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 23:30:45 +00:00
snipe
9251007574 Merge remote-tracking branch 'origin/develop' 2025-03-04 23:29:31 +00:00
snipe
cc73b984cb Merge remote-tracking branch 'origin/develop' 2025-03-04 21:13:43 +00:00
snipe
548ef97c32 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-03-04 19:57:33 +00:00
snipe
ed8a486726 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:54:08 +00:00
snipe
1ab0911fc8 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:52:16 +00:00
snipe
bdbaea7294 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:43:28 +00:00
snipe
5cfd1f6fb2 Merge remote-tracking branch 'origin/develop' 2025-03-04 17:16:26 +00:00
snipe
5eda67381f Merge remote-tracking branch 'origin/develop' 2025-03-04 17:07:13 +00:00
snipe
2c8b8bfaf2 Merge remote-tracking branch 'origin/develop' 2025-03-04 17:05:55 +00:00
snipe
8f3159751a Merge remote-tracking branch 'origin/develop' 2025-03-04 17:01:07 +00:00
snipe
4b05e55b29 Merge remote-tracking branch 'origin/develop' 2025-03-04 15:56:05 +00:00
snipe
3d3c13fcd0 Merge remote-tracking branch 'origin/develop' 2025-03-04 15:38:58 +00:00
snipe
88e1d8a8cf Merge remote-tracking branch 'origin/develop' 2025-03-04 15:28:53 +00:00
snipe
e007db34e2 Merge remote-tracking branch 'origin/develop' 2025-03-03 22:12:26 +00:00
snipe
f9f06d2c02 Merge remote-tracking branch 'origin/develop' 2025-02-27 19:08:45 +00:00
snipe
234f7d00c8 Merge remote-tracking branch 'origin/develop' 2025-02-27 16:18:18 +00:00
snipe
9924553da5 Merge remote-tracking branch 'origin/develop' 2025-02-27 15:45:57 +00:00
snipe
df38d7e3ed Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-02-27 12:22:30 +00:00
snipe
44dd061619 Merge remote-tracking branch 'origin/develop' 2025-02-26 20:55:57 +00:00
snipe
7603a932b1 Merge remote-tracking branch 'origin/develop' 2025-02-26 20:29:42 +00:00
snipe
138e7acc13 Merge remote-tracking branch 'origin/develop' 2025-02-26 12:47:54 +00:00
snipe
e863d3e7e5 Merge remote-tracking branch 'origin/develop' 2025-02-26 12:02:00 +00:00
snipe
c8e401f5ed Merge remote-tracking branch 'origin/develop' 2025-02-26 11:59:53 +00:00
snipe
3ba20a8e28 Merge remote-tracking branch 'origin/develop' 2025-02-26 11:39:10 +00:00
snipe
ebae63752f Merge remote-tracking branch 'origin/develop' 2025-02-26 10:25:18 +00:00
snipe
8bc73901cf Merge remote-tracking branch 'origin/develop' 2025-02-26 08:25:35 +00:00
snipe
b4f70d9244 Merge remote-tracking branch 'origin/develop' 2025-02-26 07:16:59 +00:00
snipe
21e9f2bba3 Merge remote-tracking branch 'origin/develop' 2025-02-26 07:11:22 +00:00
snipe
881f4e3d6a Merge remote-tracking branch 'origin/develop' 2025-02-25 14:43:57 +00:00
snipe
b141945add Updated branch
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 12:18:52 +00:00
2517 changed files with 156628 additions and 260081 deletions

View File

@@ -3206,8 +3206,7 @@
"avatar_url": "https://avatars.githubusercontent.com/u/3755203?v=4",
"profile": "https://github.com/swift2512",
"contributions": [
"bug",
"code"
"bug"
]
},
{
@@ -4190,51 +4189,6 @@
"contributions": [
"code"
]
},
{
"login": "mckaygerhard",
"name": "Герхард PICCORO Lenz McKAY ",
"avatar_url": "https://avatars.githubusercontent.com/u/1571724?v=4",
"profile": "https://github-readme-stats.vercel.app/api?username=mckaygerhard",
"contributions": [
"code"
]
},
{
"login": "FlorestanII",
"name": "Johannes Pollitt",
"avatar_url": "https://avatars.githubusercontent.com/u/15015119?v=4",
"profile": "https://github.com/FlorestanII",
"contributions": [
"code"
]
},
{
"login": "strobelm",
"name": "Michael Strobel",
"avatar_url": "https://avatars.githubusercontent.com/u/14185442?v=4",
"profile": "https://strobelm.de",
"contributions": [
"code"
]
},
{
"login": "nickwest",
"name": "Nicky West",
"avatar_url": "https://avatars.githubusercontent.com/u/634790?v=4",
"profile": "http://nickwest.me",
"contributions": [
"code"
]
},
{
"login": "akaspeh1",
"name": "akaspeh1",
"avatar_url": "https://avatars.githubusercontent.com/u/1347327?v=4",
"profile": "https://github.com/akaspeh1",
"contributions": [
"code"
]
}
]
}

View File

@@ -28,7 +28,6 @@ PUBLIC_FILESYSTEM_DISK=local_public
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=db
DB_SOCKET=null
DB_PORT='3306'
DB_DATABASE=snipeit
DB_USERNAME=snipeit

View File

@@ -24,7 +24,6 @@ PUBLIC_FILESYSTEM_DISK=local_public
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_SOCKET=null
DB_PORT=3306
DB_DATABASE=null
DB_USERNAME=null
@@ -193,17 +192,11 @@ LDAP_TIME_LIM=600
IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000
REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120
CSV_ESCAPE_FORMULAS=true
LIVEWIRE_URL_PREFIX=null
# --------------------------------------------
# OPTIONAL: SAML SETTINGS
# --------------------------------------------
REQUIRE_SAML=false
SAML_KEY_SIZE=2048
# --------------------------------------------
# OPTIONAL: HASHING
# --------------------------------------------

View File

@@ -1,105 +0,0 @@
name: Bug Report
description: File a bug report.
title: "[Bug]: "
projects: ["grokability/snipe-it"]
type: bug
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Most issues are documented in the [Snipe-IT repository's issues](https://github.com/grokability/snipe-it/issues) or in the official [Common Issues section of the Documentation](https://snipe-it.readme.io/docs/common-issues#/) and are due to the following:
- `.env` misconfiguration
- [Server Permissions](https://snipe-it.readme.io/docs/debugging-permissions#/)
- [Database Migrations](https://snipe-it.readme.io/docs/database-issues#run-migrations)
Please make sure you've checked these resources before submitting a new issue. If you find an existing issue, please add your context to it instead of opening a new issue. If your issue is more of a question, consider [opening a new discussion](https://github.com/grokability/snipe-it/discussions) or [pop by our Discord](https://discord.gg/yZFtShAcKk) instead of creating an issue.
**Please write your bug report in English.** You can use tools like [DeepL](https://www.deepl.com) or [Google Translate](https://translate.google.com/) to translate if necessary.
**If you choose to upload screenshots or videos (which we always encourage), please make sure they do not contain any sensitive information.**
- type: input
id: version
attributes:
label: Snipe-IT Version
description: What version of Snipe-IT are you seeing this issue on? You can find the version number in the footer of any page in Snipe-IT.
placeholder: ex. v8.3.1 - build 19577 (master)
validations:
required: true
- type: input
id: db-version
attributes:
label: MySQL/MariaDB version
description: What database are you using, and what version?
placeholder: ex. MySQL 5.7
validations:
required: true
- type: dropdown
id: install-method
attributes:
label: How did you install Snipe-IT?
options:
- Git install
- Manual install (downloading zip/tar.gz)
- Docker
- install.sh
- Hosted by Grokability
- Other
- Not sure
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see! (Be nice!)
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Other
- type: textarea
id: server-logs
attributes:
label: Application log output
description: Please copy and paste any relevant log output from `storage/logs/laravel.log`. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: browser-logs
attributes:
label: Browser console output
description: Please copy and paste any relevant log output from your browser console. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: common-issues
attributes:
label: Common Issues
description: Please make sure you have done the following before submitting your issue.
options:
- label: I have searched this repo for existing issues related to my issue (including closed issues)
required: true
- label: My APP_URL is set correctly in my .env file (including http or https and no trailing slash)
required: true
- label: I have searched the official Snipe-IT documentation and have checked the Common Issues documentation (where applicable)
required: true
- label: I have run database migrations (where applicable).
required: true
- label: I have attached screenshots and/or videos of the issue (where applicable)
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/grokability/snipe-it/blob/master/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -1,38 +0,0 @@
name: Feature Request
description: Request a new feature.
title: "[Feature]: "
projects: ["grokability/snipe-it"]
type: feature
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request! Please make sure to search the existing issues in this repository to see if your feature has already been requested, and feel free to add your context to any existing requests.
**Please write your issue in English.** You can use tools like [DeepL](https://www.deepl.com) or [Google Translate](https://translate.google.com/) to translate if necessary.
**If you choose to upload screenshots or videos (which we always encourage), please make sure they do not contain any sensitive information.**
- type: input
id: version
attributes:
label: Snipe-IT Version
description: What version of Snipe-IT are you currently running? You can find the version number in the footer of any page in Snipe-IT.
placeholder: ex. v8.3.1 - build 19577 (master)
validations:
required: true
- type: textarea
id: feature-description
attributes:
label: How can we help?
description: Let us know in detail what feature you'd like to see added. While we can't promise to implement every feature request, we do read every one and take them into consideration when planning future releases.
placeholder: Tell us what you'd like to see in Snipe-IT! (Be nice!)
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/grokability/snipe-it/blob/master/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -26,7 +26,7 @@ jobs:
language: [ 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -32,7 +32,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v4
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Crowdin push
uses: crowdin/github-action@v2

View File

@@ -42,7 +42,7 @@ jobs:
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v5
uses: actions/checkout@v4
# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx

View File

@@ -42,7 +42,7 @@ jobs:
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v5
uses: actions/checkout@v4
# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx

View File

@@ -11,7 +11,7 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Docker Hub Description
uses: grokability/dockerhub-description@7ea9d275c7cdbe2b676a093a0308c50665e3b8b4

View File

@@ -11,7 +11,7 @@ jobs:
issues: write
# pull-requests: write
steps:
- uses: actions/stale@v10
- uses: actions/stale@v9
with:
debug-only: true
ascending: true

View File

@@ -37,7 +37,7 @@ jobs:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Get Composer Cache Directory
id: composer-cache
@@ -76,16 +76,4 @@ jobs:
DB_DATABASE: snipeit
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
LOG_CHANNEL: single
LOG_LEVEL: debug
run: php artisan test
- name: Upload Laravel logs as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
path: |
storage/logs/*.log
if-no-files-found: ignore
retention-days: 7

View File

@@ -34,7 +34,7 @@ jobs:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Get Composer Cache Directory
id: composer-cache
@@ -75,16 +75,4 @@ jobs:
DB_PORT: ${{ job.services.postgresql.ports[5432] }}
DB_USERNAME: snipeit
DB_PASSWORD: password
LOG_CHANNEL: single
LOG_LEVEL: debug
run: php artisan test
- name: Upload Laravel logs as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
path: |
storage/logs/*.log
if-no-files-found: ignore
retention-days: 7

View File

@@ -25,7 +25,7 @@ jobs:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Get Composer Cache Directory
id: composer-cache
@@ -61,16 +61,4 @@ jobs:
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
LOG_CHANNEL: single
LOG_LEVEL: debug
run: php artisan test
- name: Upload Laravel logs as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: laravel-logs-php-${{ matrix.php-version }}-run-${{ github.run_attempt }}
path: |
storage/logs/*.log
if-no-files-found: ignore
retention-days: 7

View File

@@ -1,4 +0,0 @@
# 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=f325b28dd095cc9f79495c3014b20f70
.scribe/auth.md=a1780016c25c90a3c1e981b22cfb10e6

View File

@@ -1,7 +0,0 @@
# Authenticating requests
To authenticate requests, include an **`Authorization`** header with the value **`"Bearer your-token"`**.
All authenticated endpoints are marked with a `requires authentication` badge in the documentation below.
If your account has API access enabled, you can generate a token by clicking in the top right account menu and clicking <b>API tokens</b>.

View File

@@ -1,329 +0,0 @@
name: Account
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/account/requests
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Display Requested Assets'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=qIWm6chVMaJXUcKG9E8EHhnb7F9wQT14AjEraiFE; expires=Sat, 18 Oct 2025 20:42:51 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/account/eulas
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Display Accepted EULAs'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=nhItaWioeRLO0dKBgjno1X73ttHn50uXRQ7L7BAc; expires=Sat, 18 Oct 2025 20:42:51 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/account/request/{asset_id}'
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Store Asset Request'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
asset_id:
name: asset_id
description: 'The ID of the asset.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
asset_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/account/request/{asset_id}/cancel'
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Cancel Asset Request'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
asset_id:
name: asset_id
description: 'The ID of the asset.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
asset_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/account/personal-access-tokens
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create API token'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/account/personal-access-tokens
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show API tokens'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=yUjH3zpUXM18qZVCvvVEp1y5zfNNok8NctCrwGof; expires=Sat, 18 Oct 2025 20:42:51 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/account/personal-access-tokens/{tokenId}'
metadata:
groupName: Account
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete API token'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
tokenId:
name: tokenId
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
tokenId: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

File diff suppressed because it is too large Load Diff

View File

@@ -1,636 +0,0 @@
name: Accessories
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/v1/accessories/{accessory}/checkedout'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Accessory Checkouts'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
accessory:
name: accessory
description: 'The accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
accessory: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=QwqPH3txF8T3F17zuocUxlzlAourAOPvfWbLeuj9; expires=Sat, 18 Oct 2025 20:42:51 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/accessories/{accessory_id}/checkout'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Checkout Accessory'
description: |-
If Slack is enabled and/or asset acceptance is enabled, it will also
trigger a Slack message and send an email.
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
accessory_id:
name: accessory_id
description: 'The ID of the accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
accessory_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/accessories/{accessory}/checkin'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Checkin Accessory'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
accessory:
name: accessory
description: 'The accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
accessory: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/accessories/selectlist
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'A search term to filter results by name.'
required: false
example: null
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=kCGqdKxExAZopEwv7oy5l7SRnyqXXXDCU5Jyu7jU; expires=Sat, 18 Oct 2025 20:42:51 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/accessories
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List accessories'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'A search term to filter results by.'
required: false
example: keyboard
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
'filter[<fieldname>]':
name: 'filter[<fieldname>]'
description: 'A field to filter by. Example'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
company_id:
name: company_id
description: 'Filter by company ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
category_id:
name: category_id
description: 'Filter by category ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
manufacturer_id:
name: manufacturer_id
description: 'Filter by manufacturer ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
supplier_id:
name: supplier_id
description: 'Filter by supplier ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
location_id:
name: location_id
description: 'Filter by location ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
notes:
name: notes
description: 'Filter by notes.'
required: false
example: 'For office use only'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'The number of items to skip before starting to collect the result set.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'The number of items to return.'
required: false
example: 50
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'The field to sort by.'
required: false
example: created_at
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'The order to sort by.'
required: false
example: desc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: keyboard
'filter[<fieldname>]': architecto
company_id: 1
category_id: 1
manufacturer_id: 1
supplier_id: 1
location_id: 1
notes: 'For office use only'
offset: 0
limit: 50
sort: created_at
order: desc
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=2HABGaRbPqMGeiNPKWTPnN0AwM4t7W2yN4TFOJqm; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/accessories
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Accessory'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters:
name:
name: name
description: 'The name of the accessory.'
required: true
example: 'Apple Bluetooth Keyboard'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
qty:
name: qty
description: 'The number of accessories to create.'
required: true
example: 10
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
category_id:
name: category_id
description: 'The ID of the category to assign this accessory to.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
image:
name: image
description: ''
required: false
example: null
type: file
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
name: 'Apple Bluetooth Keyboard'
qty: 10
category_id: 1
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/accessories/{id}'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Accessory'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=1Tv5gekmNofKNDwolDkOEcEH9JUfM9rX0PaTFfWI; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/accessories/{id}'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update accessory.'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/accessories/{id}'
metadata:
groupName: Accessories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Accessory'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the accessory.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,306 +0,0 @@
name: Categories
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/v1/categories/{item_type}/selectlist'
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
item_type:
name: item_type
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
item_type: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=Wy5FSLyBn1xpLQy08hVrBlmoANJohF4ZIzpEcIZy; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/categories
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Categories'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=ErvltKvHZdVobMWCabFa83cWRCOTTtIgAPf7kLWS; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/categories
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Category'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/categories/{id}'
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Category'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the category.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=V2YFWiG0waCLFesMFr3kkLb0Io41yz4MPzVEfytq; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/categories/{id}'
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Category'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the category.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/categories/{id}'
metadata:
groupName: Categories
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Category'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the category.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,295 +0,0 @@
name: Companies
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/companies/selectlist
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=IqjgsK1DVTQS5qlZI7l96rTJH0m95aILfWx6eAS2; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/companies
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Companies'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=cEVlfAwtjQtu004rU9aEgFwcozHbApb3l0gEpL3C; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/companies
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Company'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/companies/{id}'
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Company'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the company.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=YqczMPKZfCp7CKkULGsRoDqufIWQ9yGkni3Cto4R; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/companies/{id}'
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Company'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the company.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/companies/{id}'
metadata:
groupName: Companies
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Company'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the company.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,394 +0,0 @@
name: Departments
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/departments/selectlist
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=0Ld2mnJEdBRIaREXQ37xGTuIS9SWJ4pT3WC79wc3; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/departments
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Departments'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: IT
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
name:
name: name
description: 'Filter by exact department name.'
required: false
example: IT
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
company_id:
name: company_id
description: 'Filter by exact company ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
manager_id:
name: manager_id
description: 'Filter by exact manager (user) ID. Example:'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
location_id:
name: location_id
description: 'Filter by exact location ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort results by. Allowed values: id, name, image, users_count, notes, created_at, updated_at, location, manager, company. Default: created_at.'
required: false
example: name
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorted results. Allowed values: asc, desc. Default: desc.'
required: false
example: asc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'Offset/starting position of the results. Default: 0.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'Limit the number of results returned. Default: 25. Maximum: 100.'
required: false
example: 50
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: IT
name: IT
company_id: 1
manager_id: 16
location_id: 1
sort: name
order: asc
offset: 0
limit: 50
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=A3I9GYZHlismQEeDjfx7XM9EFccWImskxth6x9OH; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/departments
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Department'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/departments/{id}'
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Department'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the department.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=f5nA1I31NqT4m4T3BeSDmKt2LuBQs7KtcZZNRDKq; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/departments/{id}'
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Department'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the department.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/departments/{id}'
metadata:
groupName: Departments
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Department'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the department.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,419 +0,0 @@
name: Components
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/v1/components/{component}/assets'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Component Assets'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
component:
name: component
description: 'The component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
component: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=wiPOiV7Xae1fyzS2Jv3w9d060WDRgnET70IrBjTj; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/components/{id}/checkin'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Checkin Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/components/{id}/checkout'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Checkout Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters:
assigned_to:
name: assigned_to
description: 'The <code>id</code> of an existing record in the assets table.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
assigned_qty:
name: assigned_qty
description: ''
required: false
example: null
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
assigned_to: architecto
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/components
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Categories'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=vXpBDH4e4puagaeAOAWHnpHEOQ7rCwXKeEDeGn5W; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/components
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/components/{id}'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=mIFtURJNZowrCIpSMAMYNVYW5XvKIReOCIJ57XgL; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/components/{id}'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/components/{id}'
metadata:
groupName: Components
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Component'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the component.'
required: true
example: 3
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 3
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,535 +0,0 @@
name: Consumables
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/consumables/selectlist
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=9SzZeaG6J8yoJtsrcqY5kJPcLvX7ObZeYK0JivkB; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/consumables/{id}/users'
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'User Assignments'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the consumable.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=eO7NKRGNCHJ34NL6woGI5Ux80o2tg9rIBW0LuGGd; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/consumables/{consumable}/checkout'
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Checkout Consumable'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
consumable:
name: consumable
description: 'The consumable.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
consumable: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/consumables
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Consumables'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
filter:
name: filter
description: 'A JSON encoded array of key/value pairs to filter results by.'
required: false
example: '{"company":"1","location":"2"}'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
search:
name: search
description: 'A search term to filter results by.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
name:
name: name
description: 'Filter by exact name.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
company_id:
name: company_id
description: 'Filter by exact company ID.'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
category_id:
name: category_id
description: 'Filter by exact category ID.'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
model_number:
name: model_number
description: 'Filter by exact model number.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
manufacturer_id:
name: manufacturer_id
description: 'Filter by exact manufacturer ID.'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
supplier_id:
name: supplier_id
description: 'Filter by exact supplier ID.'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
location_id:
name: location_id
description: 'Filter by exact location ID.'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
notes:
name: notes
description: 'Filter by exact notes.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
sort:
name: sort
description: 'The column to sort results by. Must be one of the following: id, name, order_number, min_amt, purchase_date, purchase_cost, company, category, model_number, item_no, manufacturer, location, qty, image, company, location, category, supplier, manufacturer. Default is created_at.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
order:
name: order
description: 'The order to sort results by. Must be one of the following: asc, desc. Default is desc.'
required: false
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanQueryParameters:
filter: '{"company":"1","location":"2"}'
search: architecto
name: architecto
company_id: 16
category_id: 16
model_number: architecto
manufacturer_id: 16
supplier_id: 16
location_id: 16
notes: architecto
sort: architecto
order: architecto
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=WMv6quPUXaLnZTkEXk5aBwdTDMuUgt7fQTd6uLZf; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/consumables
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Store a newly created resource in storage.'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/consumables/{id}'
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Consumable'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the consumable.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=oTfWSAjrq9p5g7qEYt7eFY4Dl7io060HverF1daF; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/consumables/{id}'
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Consumable'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the consumable.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/consumables/{id}'
metadata:
groupName: Consumables
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Consumable'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the consumable.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,244 +0,0 @@
name: Depreciations
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/depreciations
metadata:
groupName: Depreciations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Depreciations'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=TaZAI56rS9h74YByHlSA9ZrXGsTjQD4onwKaqiFF; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/depreciations
metadata:
groupName: Depreciations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Depreciation'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/depreciations/{depreciation_id}'
metadata:
groupName: Depreciations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Depreciation'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
depreciation_id:
name: depreciation_id
description: 'The ID of the depreciation.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
depreciation_id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=qFky4u180BfuHQB1d4a5A7K5Q4MOHcVdqELFA4ow; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/depreciations/{depreciation_id}'
metadata:
groupName: Depreciations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Depreciation'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
depreciation_id:
name: depreciation_id
description: 'The ID of the depreciation.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
depreciation_id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/depreciations/{depreciation_id}'
metadata:
groupName: Depreciations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Depreciation'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
depreciation_id:
name: depreciation_id
description: 'The ID of the depreciation.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
depreciation_id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,726 +0,0 @@
name: 'Custom Fields'
description: ''
endpoints:
-
httpMethods:
- POST
uri: 'api/v1/fields/fieldsets/{id}/order'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Reorder Fields'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/fields/{field}/associate'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Add Field to Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
field:
name: field
description: 'The field.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
field: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/fields/{field}/disassociate'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Remove Field from Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
field:
name: field
description: 'The field.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
field: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/fields
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Custom Fields'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=MTrOxDhLsWMBw1aLYKK9q1GA3VjT43PhCRp7KBa9; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/fields
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Field'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/fields/{field}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Field'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
field:
name: field
description: 'The field.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
field: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=jdlBn85i46xp3MdUb7Dbb1igonFqeCNdzQwTOmnl; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/fields/{field}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Field'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
field:
name: field
description: 'The field.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
field: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/fields/{field}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Field'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
field:
name: field
description: 'The field.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
field: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/fieldsets/{fieldset}/fields'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Show Fields in Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
fieldset:
name: fieldset
description: 'The fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
fieldset: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/fieldsets/{fieldset}/fields/{model}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Fields in Fieldset with Default Values for Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
fieldset:
name: fieldset
description: 'The fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
model:
name: model
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
fieldset: architecto
model: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/fieldsets
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'List Fieldsets'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=DtH1Q5VV2HTu9NhlX5CxdYBImN4ZqxolMxRmhDyk; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/fieldsets
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Create Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/fieldsets/{id}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Show Fieldset and Fields'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=haApTgbAdDCFdvIN3hU8DshPXbfKMRdlXqBMBKdM; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/fieldsets/{id}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Update Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/fieldsets/{id}'
metadata:
groupName: 'Custom Fields'
groupDescription: ''
subgroup: 'Custom Fieldsets'
subgroupDescription: ''
title: 'Delete Fieldset'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the fieldset.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,244 +0,0 @@
name: 'User Groups'
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/groups
metadata:
groupName: 'User Groups'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Display a listing of the resource.'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=evRZVbrjaLPlDGuAmSjuQxAfBkaXVVI3h6YJ8xCC; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/groups
metadata:
groupName: 'User Groups'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Group'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/groups/{id}'
metadata:
groupName: 'User Groups'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Group'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the group.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=lUFcyrjpTiMJiziJCYaZzhxr9o4YDOHuJhtyxe9O; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/groups/{id}'
metadata:
groupName: 'User Groups'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Group'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the group.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/groups/{id}'
metadata:
groupName: 'User Groups'
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Remove the specified resource from storage.'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the group.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,354 +0,0 @@
name: Maintenances
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/maintenances
metadata:
groupName: Maintenances
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Maintenances'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: repair
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
asset_id:
name: asset_id
description: 'Filter by exact asset ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
supplier_id:
name: supplier_id
description: 'Filter by exact supplier ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
created_by:
name: created_by
description: 'Filter by exact user ID who created the maintenance. Example'
required: false
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
url:
name: url
description: 'Filter by exact URL.'
required: false
example: 'http://example.com'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
asset_maintenance_type:
name: asset_maintenance_type
description: 'Filter by exact maintenance type.'
required: false
example: repair
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort results by. Allowed values: id, name, asset_maintenance_time, asset_maintenance_type, cost, start_date, completion_date, notes, asset_tag, asset_name, serial, created_by, supplier, location, is_warranty, status_label. Default: created_at.'
required: false
example: name
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorted results. Allowed values: asc, desc. Default: desc.'
required: false
example: asc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'Offset/starting position of the results. Default: 0.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'Limit the number of results returned. Default: 25. Maximum: 100.'
required: false
example: 50
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: repair
asset_id: 1
supplier_id: 1
created_by: 16
url: 'http://example.com'
asset_maintenance_type: repair
sort: name
order: asc
offset: 0
limit: 50
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=HIPWn994ZVwWTllISCuyT1n0vLjhvE6GtJdyvVt5; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/maintenances
metadata:
groupName: Maintenances
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Maintenance'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/maintenances/{id}'
metadata:
groupName: Maintenances
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'View Maintenance'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the maintenance.'
required: true
example: 2
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 2
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=SMRgTfJyiKW4MwqoQkxPhRwZ7s0NG6iXfqrgvOF3; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/maintenances/{id}'
metadata:
groupName: Maintenances
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Maintenance'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the maintenance.'
required: true
example: 2
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 2
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/maintenances/{id}'
metadata:
groupName: Maintenances
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Maintenance'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the maintenance.'
required: true
example: 2
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 2
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,181 +0,0 @@
name: Imports
description: ''
endpoints:
-
httpMethods:
- POST
uri: 'api/v1/imports/process/{import}'
metadata:
groupName: Imports
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Process Import'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
import:
name: import
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
import: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/imports
metadata:
groupName: Imports
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Import Files'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=lj8o7doJNMvuEIVNyZKehmNRHGnHDPN2afmwMD6i; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/imports
metadata:
groupName: Imports
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Save Import File'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/imports/{id}'
metadata:
groupName: Imports
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Import File'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the import.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,116 +0,0 @@
name: Labels
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/v1/labels/{name}'
metadata:
groupName: Labels
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Label'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
name:
name: name
description: ''
required: true
example: '|{+-0p'
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
name: '|{+-0p'
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=rEUcrmsA92vKXWOMa9gjkZircoRHtwh2NGzh46Ym; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/labels
metadata:
groupName: Labels
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Labels'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=uOfOzJMa5lIhRnkxrSV7W6Lh6At2caeav8pgRq3i; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,576 +0,0 @@
name: Licenses
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/licenses/selectlist
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=WCUA668q64Tb6nEAAMH6QDj0KxiWwfnKfCVC1WL5; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/licenses
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Licenses'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
status:
name: status
description: 'Filter by license status. Options: active, inactive, expiring'
required: false
example: '?status=active'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
company_id:
name: company_id
description: 'Filter by exact company ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
name:
name: name
description: 'Filter by exact license name.'
required: false
example: 'Microsoft 365'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
product_key:
name: product_key
description: 'Filter by exact product key.'
required: false
example: W269N
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order_number:
name: order_number
description: 'Filter by exact order number.'
required: false
example: '12345'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
purchase_order:
name: purchase_order
description: 'Filter by exact purchase order.'
required: false
example: PO12345
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
license_name:
name: license_name
description: 'Filter by exact licensee name.'
required: false
example: 'John Doe'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
license_email:
name: license_email
description: 'Filter by exact licensee email.'
required: false
example: john.d
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
status: '?status=active'
company_id: 1
name: 'Microsoft 365'
product_key: W269N
order_number: '12345'
purchase_order: PO12345
license_name: 'John Doe'
license_email: john.d
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=FsSfFEzLbFI2oqcTFwXV523YHYRteVgVbhwU1KjU; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/licenses
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create License'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/licenses/{license_id}'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show License'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=fr7kJMaaASq4b53DwioCqOIG1A7k7COxiBsYFjXL; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/licenses/{license_id}'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update License'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/licenses/{license_id}'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete License'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/licenses/{license_id}/seats'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: 'License Seats'
subgroupDescription: ''
title: 'List License Seats'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=StfngPkbKXNpOhusZSc3gJVfFrY1dHeurAa4otwt; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/licenses/{license_id}/seats/{id}'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: 'License Seats'
subgroupDescription: ''
title: 'Show License Seat'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the seat.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=4NcQjrTDkyy5Ps1lwLlvwwkW8zLNdvkt4jLniAbj; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/licenses/{license_id}/seats/{id}'
metadata:
groupName: Licenses
groupDescription: ''
subgroup: 'License Seats'
subgroupDescription: ''
title: 'Update License Seat'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
license_id:
name: license_id
description: 'The ID of the license.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the seat.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
license_id: 1
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,644 +0,0 @@
name: Locations
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/locations/selectlist
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Gets a paginated collection for the select2 menus'
description: |-
This is handled slightly differently as of ~4.7.8-pre, as
we have to do some recursive magic to get the hierarchy to display
properly when looking at the parent/child relationship in the
rich menus.
This means we can't use the normal pagination that we use elsewhere
in our selectlists, since we have to get the full set before we can
determine which location is parent/child/grandchild, etc.
This also means that hierarchy display gets a little funky when people
use the Select2 search functionality, but there's not much we can do about
that right now.
As a result, instead of paginating as part of the query, we have to grab
the entire data set, and then invoke a paginator manually and pass that
through to the SelectListTransformer.
Many thanks to @uberbrady for the help getting this working better.
Recursion still sucks, but I guess he doesn't have to get in the
sea... this time.
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=UpVwalXoUKqNpdc1JZOoxLIbtfuGTDjmXv2FL0U4; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/locations/{location_id}/assets'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Assets with Default Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
location_id:
name: location_id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
location_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=s6eLrXoHfx9aHRHsGokhuXGIfcWMyMK6s8Y7CuQb; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/locations/{location_id}/assigned/assets'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Assets Assigned to Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
location_id:
name: location_id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
location_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=6IjNjFVBRoxfcpk3lgt97JCcwcwkJ18MblUUArEa; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/locations/{location_id}/assigned/accessories'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Accessories Assigned to Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
location_id:
name: location_id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
location_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=8QVLWPz9VFdTVM9oelFsOvXEnefwKOeIuos7D23G; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/locations
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Locations'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: Headquarters
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
name:
name: name
description: 'Filter by exact location name.'
required: false
example: Headquarters
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
address:
name: address
description: 'Filter by exact address.'
required: false
example: '123 Main St'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
address2:
name: address2
description: 'Filter by exact address2.'
required: false
example: 'Suite 100'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
city:
name: city
description: 'Filter by exact city.'
required: false
example: Springfield
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
zip:
name: zip
description: 'Filter by exact zip code.'
required: false
example: '12345'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
country:
name: country
description: 'Filter by exact country.'
required: false
example: USA
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
manager_id:
name: manager_id
description: 'Filter by exact manager (user) ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
company_id:
name: company_id
description: 'Filter by exact company ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
parent_id:
name: parent_id
description: 'Filter by exact parent location ID.'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
status:
name: status
description: 'Filter by location status. Allowed values: active, deleted.'
required: false
example: active
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort results by. Allowed values: accessorries_count, address, address2, assets_count, assigned_assets_count, rtd_assets_count, accessories_count, assigned_accessories_count, components_count, consumables_count, users_count, children_count, city, country, created_at, currency, id, image, ldap_ou, company_id, manager_id, name, rtd_assets_count, state, updated_at, zip. Default: created_at.'
required: false
example: name
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorted results. Allowed values: asc, desc. Default: desc.'
required: false
example: asc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: Headquarters
name: Headquarters
address: '123 Main St'
address2: 'Suite 100'
city: Springfield
zip: '12345'
country: USA
manager_id: 1
company_id: 1
parent_id: 1
status: active
sort: name
order: asc
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=OrGO92pRr2bN1MO0HEk74EaOyIBpyNWW8nBBM9w1; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/locations
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/locations/{id}'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=r40jhYlCjVborgeetW7XFFJzC3FPckbK3wiqaq9b; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/locations/{id}'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/locations/{id}'
metadata:
groupName: Locations
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Location'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the location.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,462 +0,0 @@
name: Manufacturers
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/manufacturers/selectlist
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=wsdZCoP7veaDGNxSgmEVyiIXMCynDJaplPtmclKS; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/manufacturers/{id}/restore'
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Restore Deleted Manufacturer'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the manufacturer.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/manufacturers
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Manufacturers'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: Dell
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
name:
name: name
description: 'Filter by exact manufacturer name.'
required: false
example: Dell
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
url:
name: url
description: 'Filter by exact URL.'
required: false
example: 'http://example.com'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
support_url:
name: support_url
description: 'Filter by exact support URL.'
required: false
example: 'http://support.example.com'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
warranty_lookup_url:
name: warranty_lookup_url
description: 'Filter by exact warranty lookup URL.'
required: false
example: 'http://warranty.example.com'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
support_phone:
name: support_phone
description: 'Filter by exact support phone number.'
required: false
example: 1-800-555-5555
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
support_email:
name: support_email
description: 'Filter by exact support email address.'
required: false
example: support@example.org
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort results by. Allowed values: id, name, url, support_url, support_email, warranty_lookup_url, support_phone, created_at, updated_at, assets_count, consumables_count, components_count, licenses_count. Default: created_at.'
required: false
example: name
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorted results. Allowed values: asc, desc. Default: desc.'
required: false
example: asc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'Offset/starting position of the results. Default: 0.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'Limit the number of results returned. Default: 25. Maximum: 100.'
required: false
example: 50
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: Dell
name: Dell
url: 'http://example.com'
support_url: 'http://support.example.com'
warranty_lookup_url: 'http://warranty.example.com'
support_phone: 1-800-555-5555
support_email: support@example.org
sort: name
order: asc
offset: 0
limit: 50
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=hLpuGgLKlkZ3lxAdCVVQh6AknrP7V8ucHP12iJyL; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/manufacturers
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Maintenance'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/manufacturers/{id}'
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Manufacturer'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the manufacturer.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=AihyA0pGOpolpeaHgVkhwxZ48ZIGlH5C4cWn2ky1; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/manufacturers/{id}'
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Manufacturer'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the manufacturer.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/manufacturers/{id}'
metadata:
groupName: Manufacturers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Manufacturer'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the manufacturer.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,357 +0,0 @@
name: Models
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/models/selectlist
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Selectlist of Models'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=jwtFIyYGPRatDfntlAj40jo0O4Sj0FCnKi976PR2; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/models/assets
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Assets in Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the model.'
required: true
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 16
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=nvMGTR69fETV88dw8dfKSbREZAJ66IYQUUNSpf7Y; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/models
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Models'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=QArLWCify7SZSmEfdwLa8MuiE73ySbcjczNWAP5t; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/models
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/models/{id}'
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the model.'
required: true
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 16
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=Fi7bcrWvfZzmZFbGKAT0DPwaht8G2vkcbjoJPdZ1; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/models/{id}'
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the model.'
required: true
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 16
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/models/{id}'
metadata:
groupName: Models
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Model'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the model.'
required: true
example: 16
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: 16
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,117 +0,0 @@
name: Notes
description: ''
endpoints:
-
httpMethods:
- POST
uri: 'api/v1/notes/{asset_id}/store'
metadata:
groupName: Notes
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Store Note'
description: |-
Checks authorization for updating assets, validates the presence of the 'note',
attempts to find the asset by ID, and creates a new ActionLog entry if successful.
Returns JSON responses indicating success or failure with appropriate HTTP status codes.
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
asset_id:
name: asset_id
description: 'The ID of the asset.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
asset_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/notes/{asset_id}/index'
metadata:
groupName: Notes
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'List Notes'
description: |-
Checks authorization to view assets, attempts to find the asset by ID,
and fetches related action log entries of type 'note added', including
user information for each note. Returns a JSON response with the notes or errors.
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
asset_id:
name: asset_id
description: 'The ID of the asset.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
asset_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=0996I9pgG6hTiplyAUfm6hARQqlLp2KcZRKbrsM4; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,398 +0,0 @@
name: Settings
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/settings/ldaptest
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Test LDAP Connection'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=sXQmK1seBet712r1kd4fxKvJ8eS1G5JIQGi7Jk76; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/settings/purge_barcodes
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Barcode Cache'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/settings/login-attempts
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Get a list of login attempts'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=3WvRIFmkRUjvmDyyocP7gGkeVA8nsKCstMlpD2ll; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/settings/ldaptestlogin
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Test LDAP Login'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters:
ldaptest_user:
name: ldaptest_user
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
ldaptest_password:
name: ldaptest_password
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
ldaptest_user: architecto
ldaptest_password: architecto
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/settings/mailtest
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Test Email Configuration'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/settings/backups
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Lists backup files'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=c1LnO2y90g9cXIQdH1B3ALRTwBznlJR0MPn7UYwI; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/settings/backups/download/latest
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Determines and downloads the latest backup'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=h8vmsBd9n2ThBnox919dPAo17WMNdGSmFDgmUWbJ; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/settings/backups/download/{file}'
metadata:
groupName: Settings
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Downloads a backup file.'
description: |-
We use response()->download() here instead of Storage::download() because Storage::download()
exhausts memory on larger files.
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
file:
name: file
description: ''
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
file: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=dEPJObU3yZeyRQ0ZNZQmLDg70DDH6mt8OLUoXk7b; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,539 +0,0 @@
name: 'Status Labels'
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/statuslabels/selectlist
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=wkMPeN6kxHTgcy7pBWCmBb2skYp7Ozxo03ll2QRI; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/statuslabels/assets/name
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Show Count for Pie Chart'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=BwSbIkmBBnKEl1eHDB5irvFrSmdOermismgPqdVt; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/statuslabels/assets/type
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Show Count for Pie Chart by Meta Status'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=qgDpluENzw06DYesVDJ62VPNypFZR7TMXA5YuERD; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/statuslabels/{id}/assetlist'
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Show Assets with Status Label'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the statuslabel.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=prHwFCnHCRfbaQBGGsb9zl9HAqpNQVahgTzOn5TU; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/statuslabels/{statuslabel}/deployable'
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Check for Deployable Status'
description: |-
Returns a boolean response based on whether the status label
is one that is deployable or pending.
This is used by the hardware create/edit view to determine whether
we should provide a dropdown of users for them to check the asset out to,
and whether we show a warning that the asset will be checked in if it's already
assigned but the status is changed to one that isn't pending or deployable
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
statuslabel:
name: statuslabel
description: 'The statuslabel.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
statuslabel: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=gGlaRILsVZF4fEWWem29LTEhtwQLJo5jRgFzetFi; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/statuslabels
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Show Status Labels'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: Inventory
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: Inventory
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=wZlTwk63tGu1kRBFJuzb8R1UY1k0ZU2YI5NAAZt8; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/statuslabels
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Store a newly created resource in storage.'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/statuslabels/{id}'
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Show Status Labels'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the statuslabel.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=BoPls7yDoCtaubgDPfK5nEabHin9oYkJpg9vZT3b; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/statuslabels/{id}'
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Update Status Label'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the statuslabel.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/statuslabels/{id}'
metadata:
groupName: 'Status Labels'
groupDescription: ''
subgroup: Assets
subgroupDescription: ''
title: 'Delete Status Label'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the statuslabel.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,482 +0,0 @@
name: Suppliers
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/suppliers/selectlist
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: Selectlist
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=XCddlMqcqKqWUTBwJenBf996h9VUAuQn9onGzMNw; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: api/v1/suppliers
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Suppliers'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results.'
required: false
example: Acme
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
name:
name: name
description: 'Filter by exact supplier name.'
required: false
example: 'Acme Corp'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
address:
name: address
description: 'Filter by exact address.'
required: false
example: '123 Main St'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
address2:
name: address2
description: 'Filter by exact address2.'
required: false
example: 'Suite 100'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
city:
name: city
description: 'Filter by exact city.'
required: false
example: Springfield
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
state:
name: state
description: 'Filter by exact state.'
required: false
example: IL
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
zip:
name: zip
description: 'Filter by exact zip code.'
required: false
example: '62701'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
country:
name: country
description: 'Filter by exact country.'
required: false
example: USA
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
phone:
name: phone
description: 'Filter by exact phone number.'
required: false
example: 555-1234
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
fax:
name: fax
description: 'Filter by exact fax number.'
required: false
example: 555-5678
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
email:
name: email
description: 'Filter by exact email address.'
required: false
example: info@example.org
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
url:
name: url
description: 'Filter by exact URL.'
required: false
example: 'http://example.com'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
notes:
name: notes
description: 'Filter by exact notes.'
required: false
example: 'This is a note.'
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort results by. Allowed values: id, name, address, address2, city, state, country, zip, phone, contact, fax, email, image, assets_count, licenses_count, accessories_count, components_count, consumables_count, url, notes. Default: created_at.'
required: false
example: name
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorted results. Allowed values: asc, desc. Default: desc.'
required: false
example: asc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'Offset/starting position of the results. Default: 0.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'Limit the number of results returned. Default: 25. Maximum: 100.'
required: false
example: 50
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: Acme
name: 'Acme Corp'
address: '123 Main St'
address2: 'Suite 100'
city: Springfield
state: IL
zip: '62701'
country: USA
phone: 555-1234
fax: 555-5678
email: info@example.org
url: 'http://example.com'
notes: 'This is a note.'
sort: name
order: asc
offset: 0
limit: 50
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=R5PUii8mbVR2t8EyWTQHM80dstDyhZxcQR15nKb7; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: api/v1/suppliers
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Create Supplier'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/suppliers/{id}'
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Show Supplier'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the supplier.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=aqFNCFcjAl7hMG1Q0RCnYmK7HTNWcq0kYhd1R9NN; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- PUT
- PATCH
uri: 'api/v1/suppliers/{id}'
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Update Supplier'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the supplier.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/suppliers/{id}'
metadata:
groupName: Suppliers
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete Supplier'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
id:
name: id
description: 'The ID of the supplier.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,207 +0,0 @@
name: Reports
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/reports/activity
metadata:
groupName: Reports
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Activity Report'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters:
search:
name: search
description: 'Search term to filter results'
required: false
example: updated
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
target_type:
name: target_type
description: 'Filter by target type'
required: false
example: user
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
target_id:
name: target_id
description: 'Filter by target ID'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
item_type:
name: item_type
description: 'Filter by item type'
required: false
example: asset
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
item_id:
name: item_id
description: 'Filter by item ID'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
action_type:
name: action_type
description: 'Filter by action type'
required: false
example: create
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
created_by:
name: created_by
description: 'Filter by user ID who created the log'
required: false
example: 1
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
action_source:
name: action_source
description: 'Filter by action source'
required: false
example: web
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
remote_ip:
name: remote_ip
description: 'Filter by remote IP address Example:'
required: false
example: null
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
uploads:
name: uploads
description: 'Filter to only show logs with file uploads'
required: false
example: true
type: boolean
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
sort:
name: sort
description: 'Column to sort by. Allowed values: id, created_at, target_id, created_by, accept_signature, action_type, note, remote_ip, user_agent, target_type, item_type, action_source, action_date. Default is created_at.'
required: false
example: created_at
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
order:
name: order
description: 'Order of sorting. Allowed values: asc, desc. Default is desc.'
required: false
example: desc
type: string
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
offset:
name: offset
description: 'Number of records to skip for pagination. Default is 0.'
required: false
example: 0
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
limit:
name: limit
description: 'Maximum number of records to return. Default is 25.'
required: false
example: 25
type: integer
enumValues: []
exampleWasSpecified: true
nullable: false
custom: []
cleanQueryParameters:
search: updated
target_type: user
target_id: 1
item_type: asset
item_id: 1
action_type: create
created_by: 1
action_source: web
uploads: true
sort: created_at
order: desc
offset: 0
limit: 25
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=Q7c7iu2qi9Mil7UrdGdQhd5UHhMHwIs9J7wKxvhY; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,54 +0,0 @@
name: Misc
description: ''
endpoints:
-
httpMethods:
- GET
uri: api/v1/version
metadata:
groupName: Misc
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Version API routes'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters: []
cleanUrlParameters: []
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=4opUPyEuZlodDlaWWG7JNFN7lCuHNMim1KxZHPur; expires=Sat, 18 Oct 2025 20:42:52 GMT; Max-Age=719999; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,285 +0,0 @@
name: Files
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/v1/{object_type}/{id}/files'
metadata:
groupName: Files
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'List Files for an Object'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
object_type:
name: object_type
description: ''
required: true
example: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the {object type}.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
object_type: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=HfR9HTwK8SuIGE2OuiaImTbUpBhp1HtUBHMeilHy; expires=Sat, 18 Oct 2025 20:42:53 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/v1/{object_type}/{id}/files/{file_id}'
metadata:
groupName: Files
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Display File'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
object_type:
name: object_type
description: ''
required: true
example: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the {object type}.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
file_id:
name: file_id
description: 'The ID of the file.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
object_type: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
id: architecto
file_id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 401
content: '{"error":"Unauthorized or unauthenticated."}'
headers:
cache-control: 'max-age=0, must-revalidate, no-cache, no-store, private'
content-type: application/json
vary: Origin
pragma: no-cache
expires: 'Sun, 02 Jan 1990 00:00:00 GMT'
x-content-type-options: nosniff
feature-policy: "accelerometer 'none';autoplay 'none';camera 'none';display-capture 'none';document-domain 'none';encrypted-media 'none';fullscreen 'none';geolocation 'none';sync-xhr 'none';usb 'none';xr-spatial-tracking 'none'"
referrer-policy: same-origin
content-security-policy: "default-src 'self';style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self';object-src 'none';font-src 'self' data:;img-src 'self' data: https://snipe-it.test https://avatars.githubusercontent.com/u/ https://www.google.com/images/branding/googlelogo/2x/ https://snipe-flysystem-public-test.s3-us-west-2.amazonaws.com https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com"
set-cookie: 'snipe-dev_local=N688uqN5BWG2WKvT3v6TxAJAl1Il05lzaTycQ40x; expires=Sat, 18 Oct 2025 20:42:53 GMT; Max-Age=720000; path=/; secure; httponly; samesite=lax'
description: null
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/v1/{object_type}/{id}/files'
metadata:
groupName: Files
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Upload File to an Object'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
object_type:
name: object_type
description: ''
required: true
example: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the {object type}.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
object_type: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/v1/{object_type}/{id}/files/{file_id}/delete'
metadata:
groupName: Files
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: 'Delete File'
description: ''
authenticated: true
deprecated: false
custom: []
headers:
Authorization: 'Bearer 6g43cv8PD1aE5beadkZfhV6'
Content-Type: application/json
Accept: application/json
urlParameters:
object_type:
name: object_type
description: ''
required: true
example: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
id:
name: id
description: 'The ID of the {object type}.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
file_id:
name: file_id
description: 'The ID of the file.'
required: true
example: architecto
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
object_type: accessories|assets|components|consumables|hardware|licenses|locations|maintenances|models|users
id: architecto
file_id: architecto
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 6g43cv8PD1aE5beadkZfhV6'
controller: null
method: null
route: null
custom: []

View File

@@ -1,53 +0,0 @@
# 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

View File

@@ -1,11 +0,0 @@
# Introduction
This documentation aims to provide the information you need to work with the Snipe-IT JSON REST API.
<aside>
<strong>Base URL</strong>: <code>https://snipe-it.test/api/v1</code>
</aside>
<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>

View File

@@ -52,7 +52,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars.githubusercontent.com/u/2565989?v=4" width="110px;"/><br /><sub>coach1988</sub>](https://github.com/coach1988)<br />[💻](https://github.com/snipe/snipe-it/commits?author=coach1988 "Code") | [<img src="https://avatars.githubusercontent.com/u/11910225?v=4" width="110px;"/><br /><sub>MrM</sub>](https://github.com/mauro-miatello)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mauro-miatello "Code") | [<img src="https://avatars.githubusercontent.com/u/60405354?v=4" width="110px;"/><br /><sub>koiakoia</sub>](https://github.com/koiakoia)<br />[💻](https://github.com/snipe/snipe-it/commits?author=koiakoia "Code") | [<img src="https://avatars.githubusercontent.com/u/5323832?v=4" width="110px;"/><br /><sub>Mustafa Online</sub>](https://github.com/mustafa-online)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mustafa-online "Code") | [<img src="https://avatars.githubusercontent.com/u/104601439?v=4" width="110px;"/><br /><sub>franceslui</sub>](https://github.com/franceslui)<br />[💻](https://github.com/snipe/snipe-it/commits?author=franceslui "Code") | [<img src="https://avatars.githubusercontent.com/u/125313163?v=4" width="110px;"/><br /><sub>Q4kK</sub>](https://github.com/Q4kK)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Q4kK "Code") | [<img src="https://avatars.githubusercontent.com/u/55590532?v=4" width="110px;"/><br /><sub>squintfox</sub>](https://github.com/squintfox)<br />[💻](https://github.com/snipe/snipe-it/commits?author=squintfox "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1380084?v=4" width="110px;"/><br /><sub>Jeff Clay</sub>](https://github.com/jeffclay)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jeffclay "Code") | [<img src="https://avatars.githubusercontent.com/u/52716446?v=4" width="110px;"/><br /><sub>Phil J R</sub>](https://github.com/PP-JN-RL)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PP-JN-RL "Code") | [<img src="https://avatars.githubusercontent.com/u/1496725?v=4" width="110px;"/><br /><sub>i_virus</sub>](https://www.corelight.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chandanchowdhury "Code") | [<img src="https://avatars.githubusercontent.com/u/1020541?v=4" width="110px;"/><br /><sub>Paul Grime</sub>](https://github.com/gitgrimbo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gitgrimbo "Code") | [<img src="https://avatars.githubusercontent.com/u/922815?v=4" width="110px;"/><br /><sub>Lee Porte</sub>](https://leeporte.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=LeePorte "Code") | [<img src="https://avatars.githubusercontent.com/u/23613427?v=4" width="110px;"/><br /><sub>BRYAN </sub>](https://github.com/bryanlopezinc)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Code") [⚠️](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Tests") | [<img src="https://avatars.githubusercontent.com/u/64061710?v=4" width="110px;"/><br /><sub>U-H-T</sub>](https://github.com/U-H-T)<br />[💻](https://github.com/snipe/snipe-it/commits?author=U-H-T "Code") |
| [<img src="https://avatars.githubusercontent.com/u/5395363?v=4" width="110px;"/><br /><sub>Matt Tyree</sub>](https://github.com/Tyree)<br />[📖](https://github.com/snipe/snipe-it/commits?author=Tyree "Documentation") | [<img src="https://avatars.githubusercontent.com/u/292081?v=4" width="110px;"/><br /><sub>Florent Bervas</sub>](http://spoontux.net)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorentDotMe "Code") | [<img src="https://avatars.githubusercontent.com/u/4498077?v=4" width="110px;"/><br /><sub>Daniel Albertsen</sub>](https://ditscheri.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dbakan "Code") | [<img src="https://avatars.githubusercontent.com/u/100710244?v=4" width="110px;"/><br /><sub>r-xyz</sub>](https://github.com/r-xyz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=r-xyz "Code") | [<img src="https://avatars.githubusercontent.com/u/47491036?v=4" width="110px;"/><br /><sub>Steven Mainor</sub>](https://github.com/DrekiDegga)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DrekiDegga "Code") | [<img src="https://avatars.githubusercontent.com/u/65785975?v=4" width="110px;"/><br /><sub>arne-kroeger</sub>](https://github.com/arne-kroeger)<br />[💻](https://github.com/snipe/snipe-it/commits?author=arne-kroeger "Code") | [<img src="https://avatars.githubusercontent.com/u/167117705?v=4" width="110px;"/><br /><sub>Glukose1</sub>](https://github.com/Glukose1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Glukose1 "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1197791?v=4" width="110px;"/><br /><sub>Scarzy</sub>](https://github.com/Scarzy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Scarzy "Code") | [<img src="https://avatars.githubusercontent.com/u/37372069?v=4" width="110px;"/><br /><sub>setpill</sub>](https://github.com/setpill)<br />[💻](https://github.com/snipe/snipe-it/commits?author=setpill "Code") | [<img src="https://avatars.githubusercontent.com/u/3755203?v=4" width="110px;"/><br /><sub>swift2512</sub>](https://github.com/swift2512)<br />[🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aswift2512 "Bug reports") [💻](https://github.com/snipe/snipe-it/commits?author=swift2512 "Code") | [<img src="https://avatars.githubusercontent.com/u/6136439?v=4" width="110px;"/><br /><sub>Darren Rainey</sub>](https://darrenraineys.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DarrenRainey "Code") | [<img src="https://avatars.githubusercontent.com/u/133033121?v=4" width="110px;"/><br /><sub>maciej-poleszczyk</sub>](https://github.com/maciej-poleszczyk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=maciej-poleszczyk "Code") | [<img src="https://avatars.githubusercontent.com/u/143394709?v=4" width="110px;"/><br /><sub>Sebastian Groß</sub>](https://github.com/sgross-emlix)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sgross-emlix "Code") | [<img src="https://avatars.githubusercontent.com/u/41107778?v=4" width="110px;"/><br /><sub>Anouar Touati</sub>](https://github.com/AnouarTouati)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AnouarTouati "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1197791?v=4" width="110px;"/><br /><sub>Scarzy</sub>](https://github.com/Scarzy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Scarzy "Code") | [<img src="https://avatars.githubusercontent.com/u/37372069?v=4" width="110px;"/><br /><sub>setpill</sub>](https://github.com/setpill)<br />[💻](https://github.com/snipe/snipe-it/commits?author=setpill "Code") | [<img src="https://avatars.githubusercontent.com/u/3755203?v=4" width="110px;"/><br /><sub>swift2512</sub>](https://github.com/swift2512)<br />[🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aswift2512 "Bug reports") | [<img src="https://avatars.githubusercontent.com/u/6136439?v=4" width="110px;"/><br /><sub>Darren Rainey</sub>](https://darrenraineys.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DarrenRainey "Code") | [<img src="https://avatars.githubusercontent.com/u/133033121?v=4" width="110px;"/><br /><sub>maciej-poleszczyk</sub>](https://github.com/maciej-poleszczyk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=maciej-poleszczyk "Code") | [<img src="https://avatars.githubusercontent.com/u/143394709?v=4" width="110px;"/><br /><sub>Sebastian Groß</sub>](https://github.com/sgross-emlix)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sgross-emlix "Code") | [<img src="https://avatars.githubusercontent.com/u/41107778?v=4" width="110px;"/><br /><sub>Anouar Touati</sub>](https://github.com/AnouarTouati)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AnouarTouati "Code") |
| [<img src="https://avatars.githubusercontent.com/u/25596663?v=4" width="110px;"/><br /><sub>aHVzY2g</sub>](https://github.com/aHVzY2g)<br />[💻](https://github.com/snipe/snipe-it/commits?author=aHVzY2g "Code") | [<img src="https://avatars.githubusercontent.com/u/13408130?v=4" width="110px;"/><br /><sub>林博仁 Buo-ren Lin</sub>](https://brlin.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=brlin-tw "Code") | [<img src="https://avatars.githubusercontent.com/u/18550946?v=4" width="110px;"/><br /><sub>Adugna Gizaw</sub>](https://orbalia.pythonanywhere.com/)<br />[🌍](#translation-addex12 "Translation") | [<img src="https://avatars.githubusercontent.com/u/760989?v=4" width="110px;"/><br /><sub>Jesse Ostrander</sub>](https://github.com/jostrander)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jostrander "Code") | [<img src="https://avatars.githubusercontent.com/u/31522486?v=4" width="110px;"/><br /><sub>James M</sub>](https://github.com/azmcnutt)<br />[💻](https://github.com/snipe/snipe-it/commits?author=azmcnutt "Code") | [<img src="https://avatars.githubusercontent.com/u/5183146?v=4" width="110px;"/><br /><sub>Fiala06</sub>](https://github.com/Fiala06)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Fiala06 "Code") | [<img src="https://avatars.githubusercontent.com/u/28693782?v=4" width="110px;"/><br /><sub>Nathan Taylor</sub>](https://github.com/ntaylor-86)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ntaylor-86 "Code") |
| [<img src="https://avatars.githubusercontent.com/u/16699443?v=4" width="110px;"/><br /><sub>fvollmer</sub>](https://github.com/fvollmer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fvollmer "Code") | [<img src="https://avatars.githubusercontent.com/u/109086466?v=4" width="110px;"/><br /><sub>36864</sub>](https://github.com/36864)<br />[💻](https://github.com/snipe/snipe-it/commits?author=36864 "Code") | [<img src="https://avatars.githubusercontent.com/u/365751?v=4" width="110px;"/><br /><sub>Daniel O'Connor</sub>](http://clockwerx.blogspot.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=CloCkWeRX "Code") | [<img src="https://avatars.githubusercontent.com/u/102852568?v=4" width="110px;"/><br /><sub>BeatSpark</sub>](https://github.com/BeatSpark)<br />[💻](https://github.com/snipe/snipe-it/commits?author=BeatSpark "Code") | [<img src="https://avatars.githubusercontent.com/u/59203607?v=4" width="110px;"/><br /><sub>mrdahbi</sub>](https://github.com/mrdahbi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mrdahbi "Code") | [<img src="https://avatars.githubusercontent.com/u/6661332?v=4" width="110px;"/><br /><sub>Fabian Schmid</sub>](http://sr.solutions)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chfsx "Code") | [<img src="https://avatars.githubusercontent.com/u/1288116?v=4" width="110px;"/><br /><sub>Chris Olin</sub>](https://www.chrisolin.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=realchrisolin "Code") |
| [<img src="https://avatars.githubusercontent.com/u/3803132?v=4" width="110px;"/><br /><sub>Dan</sub>](https://github.com/mnemonicly)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mnemonicly "Code") | [<img src="https://avatars.githubusercontent.com/u/43917728?v=4" width="110px;"/><br /><sub>Nebel</sub>](https://github.com/NebelKreis)<br />[💻](https://github.com/snipe/snipe-it/commits?author=NebelKreis "Code") | [<img src="https://avatars.githubusercontent.com/u/132433803?v=4" width="110px;"/><br /><sub>test1337ahp</sub>](https://github.com/test1337ahp)<br />[💻](https://github.com/snipe/snipe-it/commits?author=test1337ahp "Code") | [<img src="https://avatars.githubusercontent.com/u/1916566?v=4" width="110px;"/><br /><sub>Jonathon Reinhart</sub>](https://github.com/JonathonReinhart)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JonathonReinhart "Code") | [<img src="https://avatars.githubusercontent.com/u/484742?v=4" width="110px;"/><br /><sub>aranar-pro</sub>](https://github.com/aranar-pro)<br />[💻](https://github.com/snipe/snipe-it/commits?author=aranar-pro "Code") | [<img src="https://avatars.githubusercontent.com/u/27019397?v=4" width="110px;"/><br /><sub>Phil</sub>](https://github.com/phil-flip)<br />[💻](https://github.com/snipe/snipe-it/commits?author=phil-flip "Code") | [<img src="https://avatars.githubusercontent.com/u/6473460?v=4" width="110px;"/><br /><sub>Steffy Fort</sub>](https://fe80.fr/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fe80 "Code") |
@@ -68,7 +68,6 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars.githubusercontent.com/u/181059?v=4" width="110px;"/><br /><sub>Juan Font</sub>](https://github.com/juanfont)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juanfont "Code") | [<img src="https://avatars.githubusercontent.com/u/13137708?v=4" width="110px;"/><br /><sub>Juho Taipale</sub>](https://github.com/juhotaipale)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juhotaipale "Code") | [<img src="https://avatars.githubusercontent.com/u/1007419?v=4" width="110px;"/><br /><sub>Korvin Szanto</sub>](https://github.com/KorvinSzanto)<br />[💻](https://github.com/snipe/snipe-it/commits?author=KorvinSzanto "Code") | [<img src="https://avatars.githubusercontent.com/u/8513053?v=4" width="110px;"/><br /><sub>Lewis Foster</sub>](https://lewisfoster.foo/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sniff122 "Code") | [<img src="https://avatars.githubusercontent.com/u/33877541?v=4" width="110px;"/><br /><sub>Logan Swartzendruber</sub>](https://github.com/loganswartz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=loganswartz "Code") | [<img src="https://avatars.githubusercontent.com/u/1156208?v=4" width="110px;"/><br /><sub>Lorenzo P.</sub>](https://github.com/lopezio)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lopezio "Code") | [<img src="https://avatars.githubusercontent.com/u/33946590?v=4" width="110px;"/><br /><sub>Lukas Jung</sub>](https://github.com/m4us1ne)<br />[💻](https://github.com/snipe/snipe-it/commits?author=m4us1ne "Code") |
| [<img src="https://avatars.githubusercontent.com/u/10965027?v=4" width="110px;"/><br /><sub>Ellie</sub>](https://leafedfox.xyz/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=LeafedFox "Code") | [<img src="https://avatars.githubusercontent.com/u/20960555?v=4" width="110px;"/><br /><sub>GA Stamper</sub>](https://github.com/gastamper)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gastamper "Code") | [<img src="https://avatars.githubusercontent.com/u/206553556?v=4" width="110px;"/><br /><sub>Guillaume Lefranc</sub>](https://github.com/gl-pup)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gl-pup "Code") | [<img src="https://avatars.githubusercontent.com/u/733892?v=4" width="110px;"/><br /><sub>Hajo Möller</sub>](https://github.com/dasjoe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dasjoe "Code") | [<img src="https://avatars.githubusercontent.com/u/3420063?v=4" width="110px;"/><br /><sub>Istvan Basa</sub>](https://github.com/pottom)<br />[💻](https://github.com/snipe/snipe-it/commits?author=pottom "Code") | [<img src="https://avatars.githubusercontent.com/u/810824?v=4" width="110px;"/><br /><sub>JJ Asghar</sub>](https://jjasghar.github.io/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jjasghar "Code") | [<img src="https://avatars.githubusercontent.com/u/40404495?v=4" width="110px;"/><br /><sub>James E. Msenga</sub>](https://github.com/JemCdo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JemCdo "Code") |
| [<img src="https://avatars.githubusercontent.com/u/6865786?v=4" width="110px;"/><br /><sub>Jan Felix Wiebe</sub>](https://github.com/jfwiebe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jfwiebe "Code") | [<img src="https://avatars.githubusercontent.com/u/43412008?v=4" width="110px;"/><br /><sub>Jo Drexl</sub>](https://www.nfon.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=drexljo "Code") | [<img src="https://avatars.githubusercontent.com/u/4807843?v=4" width="110px;"/><br /><sub>Austin Sasko</sub>](https://github.com/austinsasko)<br />[💻](https://github.com/snipe/snipe-it/commits?author=austinsasko "Code") | [<img src="https://avatars.githubusercontent.com/u/4875039?v=4" width="110px;"/><br /><sub>Jasson</sub>](http://jassoncordones.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JassonCordones "Code") | [<img src="https://avatars.githubusercontent.com/u/76069640?v=4" width="110px;"/><br /><sub>Okean</sub>](https://github.com/Tinyblargon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tinyblargon "Code") | [<img src="https://avatars.githubusercontent.com/u/6515064?v=4" width="110px;"/><br /><sub>Alejandro Medrano</sub>](https://www.lst.tfo.upm.es/alejandro-medrano/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=amedranogil "Code") | [<img src="https://avatars.githubusercontent.com/u/58696401?v=4" width="110px;"/><br /><sub>Lukas Kraic</sub>](https://github.com/lukaskraic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukaskraic "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1571724?v=4" width="110px;"/><br /><sub>Герхард PICCORO Lenz McKAY </sub>](https://github-readme-stats.vercel.app/api?username=mckaygerhard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mckaygerhard "Code") | [<img src="https://avatars.githubusercontent.com/u/15015119?v=4" width="110px;"/><br /><sub>Johannes Pollitt</sub>](https://github.com/FlorestanII)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorestanII "Code") | [<img src="https://avatars.githubusercontent.com/u/14185442?v=4" width="110px;"/><br /><sub>Michael Strobel</sub>](https://strobelm.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=strobelm "Code") | [<img src="https://avatars.githubusercontent.com/u/634790?v=4" width="110px;"/><br /><sub>Nicky West</sub>](http://nickwest.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nickwest "Code") | [<img src="https://avatars.githubusercontent.com/u/1347327?v=4" width="110px;"/><br /><sub>akaspeh1</sub>](https://github.com/akaspeh1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akaspeh1 "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View File

@@ -1,74 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Models\CheckoutRequest;
use Illuminate\Console\Command;
class CleanOldCheckoutRequests extends Command
{
private int $deletions = 0;
private int $skips = 0;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:clean-old-checkout-requests';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Removes checkout requests that reference deleted assets or users.';
/**
* Execute the console command.
*/
public function handle()
{
$requests = CheckoutRequest::with([
'user' => function ($query) {
$query->withTrashed();
},
'requestedItem' => function ($query) {
$query->withTrashed();
},
])->get();
$this->info("Processing {$requests->count()} checkout requests");
$this->withProgressBar($requests, function ($request) {
if ($this->shouldForceDelete($request)) {
$request->forceDelete();
$this->deletions++;
return;
}
if ($this->shouldSoftDelete($request)) {
$request->delete();
$this->deletions++;
return;
}
$this->skips++;
});
$this->info("Final deletion count: $this->deletions, and skip count: $this->skips");
return 0;
}
private function shouldForceDelete(CheckoutRequest $request)
{
// check if the requestable or user relationship is null
return !$request->requestable || !$request->user;
}
private function shouldSoftDelete(CheckoutRequest $request)
{
return $request->requestable->trashed() || $request->user->trashed();
}
}

View File

@@ -55,8 +55,6 @@ class LdapSync extends Command
ini_set('max_execution_time', env('LDAP_TIME_LIM', 600)); //600 seconds = 10 minutes
ini_set('memory_limit', env('LDAP_MEM_LIM', '500M'));
// Map the LDAP attributes to the Snipe-IT user fields.
$ldap_map = [
"username" => Setting::getSettings()->ldap_username_field,
"last_name" => Setting::getSettings()->ldap_lname_field,
@@ -65,17 +63,11 @@ class LdapSync extends Command
"emp_num" => Setting::getSettings()->ldap_emp_num,
"email" => Setting::getSettings()->ldap_email,
"phone" => Setting::getSettings()->ldap_phone_field,
"mobile" => Setting::getSettings()->ldap_mobile,
"jobtitle" => Setting::getSettings()->ldap_jobtitle,
"address" => Setting::getSettings()->ldap_address,
"city" => Setting::getSettings()->ldap_city,
"state" => Setting::getSettings()->ldap_state,
"zip" => Setting::getSettings()->ldap_zip,
"country" => Setting::getSettings()->ldap_country,
"location" => Setting::getSettings()->ldap_location,
"dept" => Setting::getSettings()->ldap_dept,
"manager" => Setting::getSettings()->ldap_manager,
"display_name" => Setting::getSettings()->ldap_display_name,
];
$ldap_default_group = Setting::getSettings()->ldap_default_group;
@@ -242,11 +234,9 @@ class LdapSync extends Command
}
// Assign the mapped LDAP attributes for each user to the Snipe-IT user fields
for ($i = 0; $i < $results['count']; $i++) {
$item = [];
$item['username'] = $results[$i][$ldap_map["username"]][0] ?? '';
$item['display_name'] = $results[$i][$ldap_map["display_name"]][0] ?? '';
$item['employee_number'] = $results[$i][$ldap_map["emp_num"]][0] ?? '';
$item['lastname'] = $results[$i][$ldap_map["last_name"]][0] ?? '';
$item['firstname'] = $results[$i][$ldap_map["first_name"]][0] ?? '';
@@ -254,13 +244,8 @@ class LdapSync extends Command
$item['ldap_location_override'] = $results[$i]['ldap_location_override'] ?? '';
$item['location_id'] = $results[$i]['location_id'] ?? '';
$item['telephone'] = $results[$i][$ldap_map["phone"]][0] ?? '';
$item['mobile'] = $results[$i][$ldap_map["mobile"]][0] ?? '';
$item['jobtitle'] = $results[$i][$ldap_map["jobtitle"]][0] ?? '';
$item['address'] = $results[$i][$ldap_map["address"]][0] ?? '';
$item['city'] = $results[$i][$ldap_map["city"]][0] ?? '';
$item['state'] = $results[$i][$ldap_map["state"]][0] ?? '';
$item['country'] = $results[$i][$ldap_map["country"]][0] ?? '';
$item['zip'] = $results[$i][$ldap_map["zip"]][0] ?? '';
$item['department'] = $results[$i][$ldap_map["dept"]][0] ?? '';
$item['manager'] = $results[$i][$ldap_map["manager"]][0] ?? '';
$item['location'] = $results[$i][$ldap_map["location"]][0] ?? '';
@@ -293,9 +278,6 @@ class LdapSync extends Command
if($ldap_map["username"] != null){
$user->username = $item['username'];
}
if($ldap_map["display_name"] != null){
$user->display_name = $item['display_name'];
}
if($ldap_map["last_name"] != null){
$user->last_name = $item['lastname'];
}
@@ -311,9 +293,6 @@ class LdapSync extends Command
if($ldap_map["phone"] != null){
$user->phone = $item['telephone'];
}
if($ldap_map["mobile"] != null){
$user->mobile = $item['mobile'];
}
if($ldap_map["jobtitle"] != null){
$user->jobtitle = $item['jobtitle'];
}

View File

@@ -6,7 +6,6 @@ use Illuminate\Console\Command;
use App\Models\Setting;
use Exception;
use Illuminate\Support\Facades\Crypt;
use App\Models\Ldap;
/**
* Check if a given ip is in a network
@@ -161,15 +160,7 @@ class LdapTroubleshooter extends Command
$output[] = "-x";
$output[] = "-b ".escapeshellarg($settings->ldap_basedn);
$output[] = "-D ".escapeshellarg($settings->ldap_uname);
try {
$w = Crypt::Decrypt($settings->ldap_pword);
} catch (\Exception $e) {
$this->warn("Could not decrypt password. This usually means an LDAP password was not set or the APP_KEY was changed since the LDAP pasword was last saved. Aborting.");
exit(0);
}
$output[] = "-w ". escapeshellarg($w);
$output[] = "-w ".escapeshellarg(Crypt::Decrypt($settings->ldap_pword));
$output[] = escapeshellarg(parenthesized_filter($settings->ldap_filter));
if($settings->ldap_tls) {
$this->line("# adding STARTTLS option");
@@ -180,23 +171,6 @@ class LdapTroubleshooter extends Command
$this->line(implode(" \\\n",$output));
exit(0);
}
//PHP Version check for warning
$php_version = phpversion();
list($major, $minor, $patch) = explode('.', $php_version);
if (
$major < 8 ||
($major == 8 && $minor < 3) ||
($major == 8 && $minor == 3 && $patch < 21) ||
($major == 8 && $minor == 4 && $patch < 7)
) {
$this->warn("PHP Version: $php_version WARNING - Versions before 8.3.21 or 8.4.7 will return INCONSISTENT results!");
if (!$this->confirm("Are you sure you wish to continue?")) {
$this->warn("ABORTING");
exit(-1);
}
}
if(!$this->option('force')) {
$confirmation = $this->confirm('WARNING: This command will make several attempts to connect to your LDAP server. Are you sure this is ok?');
if(!$confirmation) {
@@ -205,7 +179,7 @@ class LdapTroubleshooter extends Command
}
}
//$this->line(print_r($settings,true));
$this->line("STAGE 1: Checking settings");
$this->info("STAGE 1: Checking settings");
if(!$settings->ldap_enabled) {
$this->error("WARNING: Snipe-IT's LDAP setting is not turned on. (That may be OK if you're still trying to figure out settings)");
}
@@ -236,40 +210,32 @@ class LdapTroubleshooter extends Command
$this->info("Determined LDAP hostname to be: ".$parsed['host']);
}
$this->info("Performing DNS lookup of: ".$parsed['host']);
$ips = dns_get_record($parsed['host']);
$raw_ips = [];
if (inet_pton($parsed['host']) !== false) {
$this->line($parsed['host'] . " already looks like an address; skipping DNS lookup");
$raw_ips[] = $parsed['host'];
} else {
$this->line("Performing DNS lookup of: " . $parsed['host']);
$ips = dns_get_record($parsed['host']);
//$this->info("Host IP is: ".print_r($ips,true));
//$this->info("Host IP is: ".print_r($ips,true));
if (!$ips || count($ips) == 0) {
$this->error("ERROR: DNS lookup of host: " . $parsed['host'] . " has failed. ABORTING.");
exit(-1);
}
$this->debugout("IP's? " . print_r($ips, true));
foreach ($ips as $ip) {
if (!isset($ip['ip'])) {
continue;
}
$raw_ips[] = $ip['ip'];
}
if(!$ips || count($ips) == 0) {
$this->error("ERROR: DNS lookup of host: ".$parsed['host']." has failed. ABORTING.");
exit(-1);
}
foreach ($raw_ips as $ip) {
if ($ip == "127.0.0.1") {
$this->debugout("IP's? ".print_r($ips,true));
foreach($ips as $ip) {
if(!isset($ip['ip'])) {
continue;
}
$raw_ips[]=$ip['ip'];
if($ip['ip'] == "127.0.0.1") {
$this->error("WARNING: Using the localhost IP as the LDAP server. This is usually wrong");
}
if (ip_in_range($ip, '10.0.0.0/8') || ip_in_range($ip, '192.168.0.0/16') || ip_in_range($ip, '172.16.0.0/12')) {
if(ip_in_range($ip['ip'],'10.0.0.0/8') || ip_in_range($ip['ip'],'192.168.0.0/16') || ip_in_range($ip['ip'], '172.16.0.0/12')) {
$this->error("WARNING: Using an RFC1918 Private address for LDAP server. This may be correct, but it can be a problem if your Snipe-IT instance is not hosted on your private network");
}
}
$this->line("STAGE 2: Checking basic network connectivity");
$ports = [636, 389];
$this->info("STAGE 2: Checking basic network connectivity");
$ports = [389,636];
if(@$parsed['port'] && !in_array($parsed['port'],$ports)) {
$ports[] = $parsed['port'];
}
@@ -280,7 +246,7 @@ class LdapTroubleshooter extends Command
$errstr = '';
$timeout = 30.0;
$result = '';
$this->line("Attempting to connect to port: " . $port . " - may take up to $timeout seconds");
$this->info("Attempting to connect to port: ".$port." - may take up to $timeout seconds");
try {
$result = fsockopen($parsed['host'], $port, $errno, $errstr, 30.0);
} catch(Exception $e) {
@@ -299,9 +265,9 @@ class LdapTroubleshooter extends Command
exit(-1);
}
$this->line("STAGE 3: Determine encryption algorithm, if any");
$this->info("STAGE 3: Determine encryption algorithm, if any");
$ldap_urls = []; // [url, cert-check?, start_tls?]
$ldap_urls = [];
$pretty_ldap_urls = [];
foreach($open_ports as $port) {
$this->line("Trying TLS first for port $port");
@@ -309,46 +275,35 @@ class LdapTroubleshooter extends Command
if($this->test_anonymous_bind($ldap_url)) {
$this->info("Anonymous bind succesful to $ldap_url!");
$ldap_urls[] = [ $ldap_url, true, false ];
$pretty_ldap_urls[] = [$ldap_url, "enabled", "n/a (no)"];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "no" ];
continue; // TODO - lots of copypasta in these if(test_anonymous_bind()) routines...
} else {
$this->error("WARNING: Failed to bind to $ldap_url - trying without certificate checks.");
}
if($this->test_anonymous_bind($ldap_url, false)) {
$this->info("Anonymous bind successful to $ldap_url with certificate-checks disabled");
$ldap_urls[] = [$ldap_url, false, false];
$pretty_ldap_urls[] = [$ldap_url, "DISABLED", "n/a (no)"];
$this->info("Anonymous bind succesful to $ldap_url with certifcate-checks disabled");
$ldap_urls[] = [ $ldap_url, false, false ];
$pretty_ldap_urls[] = [ $ldap_url, "no", "no" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url with certificate checks disabled. Trying unencrypted with STARTTLS");
}
// now switching to ldap:// URL's from ldaps://
$ldap_url = "ldap://".$parsed['host'].":$port";
if($this->test_anonymous_bind($ldap_url, true, true)) {
$this->info("Plain connection to $ldap_url with STARTTLS succesful!");
$ldap_urls[] = [ $ldap_url, true, true ];
$pretty_ldap_urls[] = [$ldap_url, "enabled", "STARTTLS ENABLED"];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "YES" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url with STARTTLS enabled. Trying without certificate checks.");
}
if ($this->test_anonymous_bind($ldap_url, false, true)) {
$this->info("Plain connection to $ldap_url with STARTTLS and cert checks *disabled* successful!");
$ldap_urls[] = [$ldap_url, false, true];
$pretty_ldap_urls[] = [$ldap_url, "DISABLED", "STARTTLS ENABLED"];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url with STARTTLS enabled, and cert checks disabled. Trying without STARTTLS");
$this->error("WARNING: Failed to bind to $ldap_url with STARTTLS enabled. Trying without STARTTLS");
}
if($this->test_anonymous_bind($ldap_url)) {
$this->info("Plain connection to $ldap_url succesful!");
$ldap_urls[] = [ $ldap_url, true, false ];
$pretty_ldap_urls[] = [$ldap_url, "n/a", "starttls disabled"];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "no" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url. Giving up on port $port");
@@ -358,29 +313,23 @@ class LdapTroubleshooter extends Command
$this->debugout(print_r($ldap_urls,true));
if(count($ldap_urls) > 0 ) {
$this->debugout("Found working LDAP URL's: ");
$this->info("Found working LDAP URL's: ");
foreach($ldap_urls as $ldap_url) { // TODO maybe do this as a $this->table() instead?
$this->debugout("LDAP URL: " . $ldap_url[0]);
$this->debugout($ldap_url[0] . ($ldap_url[1] ? " certificate checks enabled" : " certificate checks disabled") . ($ldap_url[2] ? " STARTTLS Enabled " : " STARTTLS Disabled"));
$this->info("LDAP URL: ".$ldap_url[0]);
$this->info($ldap_url[0]. ($ldap_url[1] ? " certificate checks enabled" : " certificate checks disabled"). ($ldap_url[2] ? " STARTTLS Enabled ": " STARTTLS Disabled"));
}
$this->table(["URL", "Cert Checks?", "STARTTLS?"], $pretty_ldap_urls);
$this->table(["URL", "Cert Checks Enabled?", "STARTTLS Enabled?"],$pretty_ldap_urls);
} else {
$this->error("ERROR - no valid LDAP URL's available - ABORTING");
exit(1);
}
$this->line("STAGE 4: Test Administrative Bind for LDAP Sync");
$this->info("STAGE 4: Test Administrative Bind for LDAP Sync");
foreach($ldap_urls AS $ldap_url) {
try {
$w = Crypt::Decrypt($settings->ldap_pword);
} catch (\Exception $e) {
$this->warn("Could not decrypt password. This usually means an LDAP password was not set or the APP_KEY was changed since the LDAP pasword was last saved. Aborting.");
exit(0);
}
$this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $settings->ldap_uname, $w);
$this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $settings->ldap_uname, Crypt::decrypt($settings->ldap_pword));
}
$this->line("STAGE 5: Test BaseDN");
$this->info("STAGE 5: Test BaseDN");
//grab all LDAP_ constants and fill up a reversed array mapping from weird LDAP dotted-strings to (Constant Name)
$all_defined_constants = get_defined_constants();
$ldap_constants = [];
@@ -392,23 +341,16 @@ class LdapTroubleshooter extends Command
$this->debugout("LDAP constants are: ".print_r($ldap_constants,true));
foreach($ldap_urls AS $ldap_url) {
try {
$w = Crypt::Decrypt($settings->ldap_pword);
} catch (\Exception $e) {
$this->warn("Could not decrypt password. This usually means an LDAP password was not set or the APP_KEY was changed since the LDAP pasword was last saved. Aborting.");
exit(0);
}
if($this->test_informational_bind($ldap_url[0],$ldap_url[1],$ldap_url[2],$settings->ldap_uname,$w,$settings)) {
if($this->test_informational_bind($ldap_url[0],$ldap_url[1],$ldap_url[2],$settings->ldap_uname,Crypt::decrypt($settings->ldap_pword),$settings)) {
$this->info("Success getting informational bind!");
} else {
$this->error("Unable to get information from bind.");
}
}
$this->line("STAGE 6: Test LDAP Login to Snipe-IT");
$this->info("STAGE 6: Test LDAP Login to Snipe-IT");
foreach($ldap_urls AS $ldap_url) {
$this->line("Starting auth to " . $ldap_url[0]);
$this->info("Starting auth to ".$ldap_url[0]);
while(true) {
$with_tls = $ldap_url[1] ? "with": "without";
$with_startssl = $ldap_url[2] ? "using": "not using";
@@ -417,12 +359,7 @@ class LdapTroubleshooter extends Command
}
$username = $this->ask("Username");
$password = $this->secret("Password");
$results = $this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $username, $password); // FIXME - should do some other stuff here, maybe with the concatenating or something? maybe? and/or should put up some results?
if ($results) {
$this->info("Success authenticating with " . $username);
} else {
$this->error("Unable to authenticate with " . $username);
}
$this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $username, $password); // FIXME - should do some other stuff here, maybe with the concatenating or something? maybe? and/or should put up some results?
}
}
@@ -431,17 +368,14 @@ class LdapTroubleshooter extends Command
public function connect_to_ldap($ldap_url, $check_cert, $start_tls)
{
if ($check_cert) {
$this->line("we *ARE* checking certs");
Ldap::ignoreCertificates(false);
} else {
$this->line("we are IGNORING certs");
Ldap::ignoreCertificates(true);
}
$lconn = ldap_connect($ldap_url);
ldap_set_option($lconn, LDAP_OPT_PROTOCOL_VERSION, 3); // should we 'test' different protocol versions here? Does anyone even use anything other than LDAPv3?
// no - it's formally deprecated: https://tools.ietf.org/html/rfc3494
if(!$check_cert) {
putenv('LDAPTLS_REQCERT=never'); // This is horrible; is this *really* the only way to do it?
} else {
putenv('LDAPTLS_REQCERT'); // have to very explicitly and manually *UN* set the env var here to ensure it works
}
if($this->settings->ldap_client_tls_cert && $this->settings->ldap_client_tls_key) {
// client-side TLS certificate support for LDAP (Google Secure LDAP)
putenv('LDAPTLS_CERT=storage/ldap_client_tls.cert');
@@ -470,10 +404,9 @@ class LdapTroubleshooter extends Command
return $this->timed_boolean_execute(function () use ($ldap_url, $check_cert , $start_tls) {
try {
$lconn = $this->connect_to_ldap($ldap_url, $check_cert, $start_tls);
$this->line("Attempting to bind now, this can take a while if we mess it up");
$this->info("gonna try to bind now, this can take a while if we mess it up");
$bind_results = ldap_bind($lconn);
$this->line("Bind results are: " . $bind_results . " which translate into boolean: " . (bool)$bind_results);
ldap_close($lconn);
$this->info("Bind results are: ".$bind_results." which translate into boolean: ".(bool)$bind_results);
return (bool)$bind_results;
} catch (Exception $e) {
$this->error("WARNING: Exception caught during bind - ".$e->getMessage());
@@ -488,7 +421,6 @@ class LdapTroubleshooter extends Command
try {
$lconn = $this->connect_to_ldap($ldap_url, $check_cert, $start_tls);
$bind_results = ldap_bind($lconn, $username, $password);
ldap_close($lconn);
if(!$bind_results) {
$this->error("WARNING: Failed to bind to $ldap_url as $username");
return false;
@@ -514,62 +446,22 @@ class LdapTroubleshooter extends Command
return false;
}
$this->info("SUCCESS - Able to bind to $ldap_url as $username");
$cleaned_results = [];
try {
// This _may_ only work for Active Directory?
$result = ldap_read($conn, '', '(objectClass=*)'/* , ['supportedControl']*/);
$results = ldap_get_entries($conn, $result);
$cleaned_results = $this->ldap_results_cleaner($results);
//$this->line(print_r($cleaned_results,true));
$default_naming_contexts = $cleaned_results[0]['namingcontexts'];
$this->info("Default Naming Contexts:");
$this->info(implode(", ", $default_naming_contexts));
//okay, great - now how do we display those results? I have no idea.
} catch (\Exception $e) {
$this->error("Unable to get base naming contexts - here's what we *did* get:");
$this->line(print_r($cleaned_results, true));
}
$result = ldap_read($conn, '', '(objectClass=*)'/* , ['supportedControl']*/);
$results = ldap_get_entries($conn, $result);
$cleaned_results = $this->ldap_results_cleaner($results);
$this->line(print_r($cleaned_results,true));
//okay, great - now how do we display those results? I have no idea.
// I don't see why this throws an Exception for Google LDAP, but I guess we ought to try and catch it?
$this->debugout("I guess we're trying to do the ldap search here, but sometimes it takes too long?");
$this->comment("I guess we're trying to do the ldap search here, but sometimes it takes too long?");
$this->debugout("Base DN is: ".$settings->ldap_basedn." and filter is: ".parenthesized_filter($settings->ldap_filter));
$search_results = ldap_search($conn, $settings->ldap_basedn, parenthesized_filter($settings->ldap_filter));
$entries = ldap_get_entries($conn, $search_results);
$this->info("Printing first 10 results: ");
$pretty_data = array_slice($this->ldap_results_cleaner($entries), 0, 10);
//print_r($data);
$headers = [];
foreach ($pretty_data as $row) {
//populate headers
foreach ($row as $key => $value) {
//skip objectsid and objectguid because it junks up output
if ($key == "objectsid" || $key == "objectguid") {
continue;
}
if (!in_array($key, $headers)) {
$headers[] = $key;
}
}
for($i=0;$i<10;$i++) {
$this->info($search_results[$i]);
}
$table = [];
//repeat again to populate table
foreach ($pretty_data as $row) {
$newrow = [];
foreach ($headers as $header) {
if (is_array(@$row[$header])) {
$newrow[] = "[" . implode(", ", $row[$header]) . "]";
} else {
$newrow[] = @$row[$header];
}
}
$table[] = $newrow;
}
$this->table($headers, $table);
} catch (\Exception $e) {
$this->error("WARNING: Exception caught during Authed bind to $username - ".$e->getMessage());
return false;
} finally {
ldap_close($conn);
}
});
}
@@ -585,7 +477,7 @@ class LdapTroubleshooter extends Command
{
if(!(function_exists('pcntl_sigtimedwait') && function_exists('posix_getpid') && function_exists('pcntl_fork') && function_exists('posix_kill') && function_exists('pcntl_wifsignaled'))) {
// POSIX functions needed for forking aren't present, just run the function inline (ignoring timeout)
$this->line('WARNING: Unable to execute POSIX fork() commands, timeout may not be respected');
$this->info('WARNING: Unable to execute POSIX fork() commands, timeout may not be respected');
return $function();
} else {
$parent_pid = posix_getpid();
@@ -622,6 +514,4 @@ class LdapTroubleshooter extends Command
}
}
}

View File

@@ -96,7 +96,7 @@ class MoveUploadsToNewDisk extends Command
$private_uploads['assets'] = glob('storage/private_uploads/assets'."/*.*");
$private_uploads['signatures'] = glob('storage/private_uploads/signatures'."/*.*");
$private_uploads['audits'] = glob('storage/private_uploads/audits'."/*.*");
$private_uploads['assetmodels'] = glob('storage/private_uploads/models'."/*.*");
$private_uploads['assetmodels'] = glob('storage/private_uploads/assetmodels'."/*.*");
$private_uploads['imports'] = glob('storage/private_uploads/imports'."/*.*");
$private_uploads['licenses'] = glob('storage/private_uploads/licenses'."/*.*");
$private_uploads['users'] = glob('storage/private_uploads/users'."/*.*");

View File

@@ -59,9 +59,6 @@ class PaveIt extends Command
'migrations',
'settings',
'users',
'telescope_entries',
'telescope_entries_tags',
'telescope_monitoring',
];
// We only need to find out what these are so we can nuke these columns on the assets table.

View File

@@ -62,19 +62,19 @@ class Purge extends Command
$assetcount = $assets->count();
$this->info($assets->count().' assets purged.');
$asset_assoc = 0;
$maintenances = 0;
$asset_maintenances = 0;
foreach ($assets as $asset) {
$this->info('- Asset "'.$asset->display_name.'" deleted.');
$this->info('- Asset "'.$asset->present()->name().'" deleted.');
$asset_assoc += $asset->assetlog()->count();
$asset->assetlog()->forceDelete();
$maintenances += $asset->maintenances()->count();
$asset->maintenances()->forceDelete();
$asset_maintenances += $asset->assetmaintenances()->count();
$asset->assetmaintenances()->forceDelete();
$asset->forceDelete();
}
$this->info($asset_assoc.' corresponding log records purged.');
$this->info($maintenances.' corresponding maintenance records purged.');
$this->info($asset_maintenances.' corresponding maintenance records purged.');
$locations = Location::whereNotNull('deleted_at')->withTrashed()->get();
$this->info($locations->count().' locations purged.');

View File

@@ -1,56 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Models\Actionlog;
use Illuminate\Console\Command;
class RemoveInvalidUploadDeleteActionLogItems extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:remove-invalid-upload-delete-action-log-items';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Permanently remove invalid "upload deleted" action log items that have a null filename. This command can potentially result in deleted files being "resurrected" in the UI.';
/**
* Execute the console command.
*/
public function handle()
{
$invalidLogs = Actionlog::query()
->where('action_type', 'upload deleted')
->whereNull('filename')
->withTrashed()
->get();
$this->info("{$invalidLogs->count()} invalid log items found.");
if ($invalidLogs->count() === 0) {
return 0;
}
$this->table(['ID', 'Action Type', 'Item Type', 'Item ID', 'Created At', 'Deleted At'], $invalidLogs->map(fn($log) => [
$log->id,
$log->action_type,
$log->item_type,
$log->item_id,
$log->created_at,
$log->deleted_at,
])->toArray());
if ($this->confirm("Do you wish to remove {$invalidLogs->count()} log items?")) {
$invalidLogs->each(fn($log) => $log->forceDelete());
}
return 0;
}
}

View File

@@ -5,7 +5,6 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use ZipArchive;
use Illuminate\Support\Facades\Log;
use enshrined\svgSanitize\Sanitizer;
class SQLStreamer {
private $input;
@@ -243,10 +242,7 @@ class RestoreFromBackup extends Command
$private_dirs = [
'storage/private_uploads/accessories',
'storage/private_uploads/assetmodels' => 'storage/private_uploads/models', //this was changed from assetmodels => models Aug 10 2025
'storage/private_uploads/asset_maintenances' => 'storage/private_uploads/maintenances', //this was changed from asset_maintenances => maintenances Aug 10 2025
'storage/private_uploads/maintenances', //but let 'maintenances' take precedence
'storage/private_uploads/models', //and let 'models' take precedence
'storage/private_uploads/assetmodels',
'storage/private_uploads/assets', // these are asset _files_, not the pictures.
'storage/private_uploads/audits',
'storage/private_uploads/components',
@@ -264,10 +260,9 @@ class RestoreFromBackup extends Command
];
$public_dirs = [
'public/uploads/accessories',
// 'public/uploads/assetmodels' => 'public/uploads/models', //according to git, this was _never_ a thing... (see below)
'public/uploads/maintenances',
'public/uploads/assets', // these are asset _pictures_, not asset files
'public/uploads/avatars',
//'public/uploads/barcodes', // we don't want this, let the barcodes be regenerated
'public/uploads/categories',
'public/uploads/companies',
'public/uploads/components',
@@ -275,7 +270,7 @@ class RestoreFromBackup extends Command
'public/uploads/departments',
'public/uploads/locations',
'public/uploads/manufacturers',
'public/uploads/models', // ...it's been this way for 9 years (as of late 2025)
'public/uploads/models',
'public/uploads/suppliers',
];
@@ -288,6 +283,8 @@ class RestoreFromBackup extends Command
'public/uploads/favicon-uploaded.*',
];
$all_files = $private_dirs + $public_dirs;
$sqlfiles = [];
$sqlfile_indices = [];
@@ -295,20 +292,6 @@ class RestoreFromBackup extends Command
$boring_files = [];
$unsafe_files = [];
$good_extensions = config('filesystems.allowed_upload_extensions_array');
$private_extensions = array_merge($good_extensions, ["csv", "key"]); //add csv, and 'key'
$public_extensions = array_diff($good_extensions, ["xml"]); //remove xml
$sanitizer = new Sanitizer();
/**
* TODO: I _hate_ the "continue 3" thing we keep doing here
* I think a better approach might be to have the "each file" stuff be in a method on this class, and the
* boring_files and interesting_files be properties on it that we fill out. Then, in that method, we could
* just do a 'return' once the file is actually handled (yay or nay). We could also start to break out some of
* the _other_ things that we do into their own methods too? But I don't care about that as much.
*/
for ($i = 0; $i < $za->numFiles; $i++) {
$stat_results = $za->statIndex($i);
// echo "index: $i\n";
@@ -323,7 +306,7 @@ class RestoreFromBackup extends Command
// skip macOS resource fork files (?!?!?!)
if (strpos($raw_path, '__MACOSX') !== false && strpos($raw_path, '._') !== false) {
//print "SKIPPING macOS Resource fork file: $raw_path\n";
// $boring_files[] = $raw_path; //stop adding this to the boring files list; it's just confusing
$boring_files[] = $raw_path;
continue;
}
if (@pathinfo($raw_path, PATHINFO_EXTENSION) == 'sql') {
@@ -332,70 +315,44 @@ class RestoreFromBackup extends Command
$sqlfile_indices[] = $i;
continue;
}
if ($raw_path[-1] == '/') {
//last character is '/' - this is a directory, and we don't need it, and we don't need to warn about it
continue;
}
if (in_array(basename($raw_path), [".gitkeep", ".gitignore", ".DS_Store"])) {
//skip these boring files silently without reporting on them; they're stupid
continue;
}
$extension = strtolower(pathinfo($raw_path, PATHINFO_EXTENSION));
foreach (['public' => $public_dirs, 'private' => $private_dirs] as $purpose => $dirs) {
$allowed_extensions = match ($purpose) {
'public' => $public_extensions,
'private' => $private_extensions,
};
foreach ($dirs as $dir => $destdir) {
if (is_int($dir)) {
$dir = $destdir;
}
$last_pos = strrpos($raw_path, $dir . '/');
if ($last_pos !== false) {
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $dir - last_pos+strlen(\$dir) is: ".($last_pos+strlen($dir))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//print("We would copy $raw_path to $dir.\n"); //FIXME append to a path?
//the CSV bit, below, is because we store CSV files as "blahcsv" - without an extension
if (!in_array($extension, $allowed_extensions) && !($dir == "storage/private_uploads/imports" && substr($raw_path, -3) == "csv" && $extension == "")) {
$unsafe_files[] = $raw_path;
Log::debug($raw_path . ' from directory ' . $dir . ' is being skipped');
} else {
if ($dir != $destdir) {
Log::debug("Getting ready to save file $raw_path to new directory $destdir");
}
$interesting_files[$raw_path] = ['dest' => $destdir, 'index' => $i];
}
continue 3;
foreach (array_merge($private_dirs, $public_dirs) as $dir) {
$last_pos = strrpos($raw_path, $dir . '/');
if ($last_pos !== false) {
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $dir - last_pos+strlen(\$dir) is: ".($last_pos+strlen($dir))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//print("We would copy $raw_path to $dir.\n"); //FIXME append to a path?
$interesting_files[$raw_path] = ['dest' => $dir, 'index' => $i];
continue 2;
if ($last_pos + strlen($dir) + 1 == strlen($raw_path)) {
// we don't care about that; we just want files with the appropriate prefix
//print("FOUND THE EXACT DIRECTORY: $dir AT: $raw_path!!!\n");
}
}
}
foreach (['public' => $public_files, 'private' => $private_files] as $purpose => $files) {
$allowed_extensions = match ($purpose) {
'public' => $public_extensions,
'private' => $private_extensions,
};
foreach ($files as $file) {
$has_wildcard = (strpos($file, '*') !== false);
if ($has_wildcard) {
$file = substr($file, 0, -1); //trim last character (which should be the wildcard)
$good_extensions = config('filesystems.allowed_upload_extensions_array');
foreach (array_merge($private_files, $public_files) as $file) {
$has_wildcard = (strpos($file, '*') !== false);
if ($has_wildcard) {
$file = substr($file, 0, -1); //trim last character (which should be the wildcard)
}
$last_pos = strrpos($raw_path, $file); // no trailing slash!
if ($last_pos !== false) {
$extension = strtolower(pathinfo($raw_path, PATHINFO_EXTENSION));
if (!in_array($extension, $good_extensions)) {
// gathering potentially unsafe files here to return at exit
$unsafe_files[] = $raw_path;
Log::debug('Potentially unsafe file '.$raw_path.' is being skipped');
$boring_files[] = $raw_path;
continue 2;
}
$last_pos = strrpos($raw_path, $file); // no trailing slash!
if ($last_pos !== false) {
if (!in_array($extension, $allowed_extensions)) {
// gathering potentially unsafe files here to return at exit
$unsafe_files[] = $raw_path;
Log::debug('Potentially unsafe file ' . $raw_path . ' is being skipped');
$boring_files[] = $raw_path;
continue 3;
}
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $file - last_pos+strlen(\$file) is: ".($last_pos+strlen($file))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//no wildcards found in $file, process 'normally'
if ($last_pos + strlen($file) == strlen($raw_path) || $has_wildcard) { //again, no trailing slash. or this is a wildcard and we just take it.
// print("FOUND THE EXACT FILE: $file AT: $raw_path!!!\n"); //we *do* care about this, though.
$interesting_files[$raw_path] = ['dest' => dirname($file), 'index' => $i];
continue 3;
}
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $file - last_pos+strlen(\$file) is: ".($last_pos+strlen($file))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//no wildcards found in $file, process 'normally'
if ($last_pos + strlen($file) == strlen($raw_path) || $has_wildcard) { //again, no trailing slash. or this is a wildcard and we just take it.
// print("FOUND THE EXACT FILE: $file AT: $raw_path!!!\n"); //we *do* care about this, though.
$interesting_files[$raw_path] = ['dest' => dirname($file), 'index' => $i];
continue 2;
}
}
}
@@ -532,25 +489,18 @@ class RestoreFromBackup extends Command
}
foreach ($interesting_files as $pretty_file_name => $file_details) {
$ugly_file_name = $za->statIndex($file_details['index'])['name'];
$migrated_file_name = $file_details['dest'] . '/' . basename($pretty_file_name);
if (strcasecmp(substr($pretty_file_name, -4), ".svg") === 0) {
$svg_contents = $za->getFromIndex($file_details['index']);
$cleaned_svg = $sanitizer->sanitize($svg_contents);
file_put_contents($migrated_file_name, $cleaned_svg);
} else {
$fp = $za->getStream($ugly_file_name);
//$this->info("Weird problem, here are file details? ".print_r($file_details,true));
if (!is_dir($file_details['dest'])) {
mkdir($file_details['dest'], 0755, true); //0755 is what Laravel uses, so we do that
}
$migrated_file = fopen($migrated_file_name, 'w');
while (($buffer = fgets($fp, SQLStreamer::$buffer_size)) !== false) {
fwrite($migrated_file, $buffer);
}
fclose($migrated_file);
fclose($fp);
//$this->info("Wrote $ugly_file_name to $pretty_file_name");
$fp = $za->getStream($ugly_file_name);
//$this->info("Weird problem, here are file details? ".print_r($file_details,true));
if (!is_dir($file_details['dest'])) {
mkdir($file_details['dest'], 0755, true); //0755 is what Laravel uses, so we do that
}
$migrated_file = fopen($file_details['dest'].'/'.basename($pretty_file_name), 'w');
while (($buffer = fgets($fp, SQLStreamer::$buffer_size)) !== false) {
fwrite($migrated_file, $buffer);
}
fclose($migrated_file);
fclose($fp);
//$this->info("Wrote $ugly_file_name to $pretty_file_name");
if ($bar) {
$bar->advance();
}

View File

@@ -77,7 +77,7 @@ class SendAcceptanceReminder extends Command
if(!$email){
$no_email_list[] = [
'id' => $acceptance->assignedTo?->id,
'name' => $acceptance->assignedTo?->display_name,
'name' => $acceptance->assignedTo?->present()->fullName(),
];
} else {
$count++;

View File

@@ -2,7 +2,6 @@
namespace App\Console\Commands;
use App\Helpers\Helper;
use App\Mail\ExpiringAssetsMail;
use App\Mail\ExpiringLicenseMail;
use App\Models\Asset;
@@ -53,73 +52,19 @@ class SendExpirationAlerts extends Command
->filter(fn($item) => !empty($item))
->all();
// Expiring Assets
$assets = Asset::getExpiringWarrantyOrEol($alert_interval);
$assets = Asset::getExpiringWarrantee($alert_interval);
if ($assets->count() > 0) {
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $alert_interval));
$this->table(
[
trans('general.id'),
trans('admin/hardware/form.tag'),
trans('admin/hardware/form.model'),
trans('general.model_no'),
trans('general.purchase_date'),
trans('admin/hardware/form.eol_rate'),
trans('admin/hardware/form.eol_date'),
trans('admin/hardware/form.warranty_expires'),
],
$assets->map(fn($item) =>
[
trans('general.id') => $item->id,
trans('admin/hardware/form.tag') => $item->asset_tag,
trans('admin/hardware/form.model') => $item->model->name,
trans('general.model_no') => $item->model->model_number,
trans('general.purchase_date') => $item->purchase_date_formatted,
trans('admin/hardware/form.eol_rate') => $item->model->eol,
trans('admin/hardware/form.eol_date') => $item->eol_date ? $item->eol_formatted_date .' ('.$item->eol_diff_for_humans.')' : '',
trans('admin/hardware/form.warranty_expires') => $item->warranty_expires ? $item->warranty_expires_formatted_date .' ('.$item->warranty_expires_diff_for_humans.')' : '',
])
);
}
// Expiring licenses
$licenses = License::query()->ExpiringLicenses($alert_interval)
->with('manufacturer','category')
->orderBy('expiration_date', 'ASC')
->orderBy('termination_date', 'ASC')
->get();
$licenses = License::getExpiringLicenses($alert_interval);
if ($licenses->count() > 0) {
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $alert_interval));
$this->table(
[
trans('general.id'),
trans('general.name'),
trans('general.purchase_date'),
trans('admin/licenses/form.expiration'),
trans('mail.expires'),
trans('admin/licenses/form.termination_date'),
trans('mail.terminates')],
$licenses->map(fn($item) => [
trans('general.id') => $item->id,
trans('general.name') => $item->name,
trans('general.purchase_date') => $item->purchase_date_formatted,
trans('admin/licenses/form.expiration') => $item->expires_formatted_date,
trans('mail.expires') => $item->expires_diff_for_humans,
trans('admin/licenses/form.termination_date') => $item->terminates_formatted_date,
trans('mail.terminates') => $item->terminates_diff_for_humans
])
);
}
// Send a message even if the count is 0
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
} else {
if ($settings->alert_email == '') {
$this->error('Could not send email. No alert email configured in settings');

View File

@@ -47,7 +47,7 @@ class SendUpcomingAuditReport extends Command
$today = Carbon::now();
$interval_date = $today->copy()->addDays($interval);
$assets = Asset::whereNull('deleted_at')->dueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'asc')->get();
$assets = Asset::whereNull('deleted_at')->dueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'desc')->get();
$this->info($assets->count() . ' assets must be audited in on or before ' . $interval_date . ' is deadline');
@@ -61,28 +61,6 @@ class SendUpcomingAuditReport extends Command
$this->info('Sending Admin SendUpcomingAuditNotification to: ' . $settings->alert_email);
Mail::to($recipients)->send(new SendUpcomingAuditMail($assets, $settings->audit_warning_days));
$this->table(
[
trans('general.id'),
trans('general.name'),
trans('general.last_audit'),
trans('general.next_audit_date'),
trans('mail.Days'),
trans('mail.supplier'),
trans('mail.assigned_to'),
],
$assets->map(fn($item) => [
trans('general.id') => $item->id,
trans('general.name') => $item->display_name,
trans('general.last_audit') => $item->last_audit_formatted_date,
trans('general.next_audit_date') => $item->next_audit_formatted_date,
trans('mail.Days') => round($item->next_audit_diff_in_days),
trans('mail.supplier') => $item->supplier ? $item->supplier->name : '',
trans('mail.assigned_to') => $item->assignedTo ? $item->assignedTo->display_name : '',
])
);
}
}

View File

@@ -94,7 +94,7 @@ class Handler extends ExceptionHandler
// Handle API requests that fail because Carbon cannot parse the date on validation (when a submitted date value is definitely not a date)
if ($e instanceof InvalidFormatException) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('validation.date', ['attribute' => 'date'])), config('app.validation_status_code'));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('validation.date', ['attribute' => 'date'])), 200);
}
// Handle API requests that fail because the model doesn't exist
@@ -124,7 +124,7 @@ class Handler extends ExceptionHandler
// never even get to the controller where we normally nicely format JSON responses
if ($e instanceof ValidationException) {
$response = $this->invalidJson($request, $e);
return response()->json(Helper::formatStandardApiResponse('error', null, $e->errors()), config('app.validation_status_code'));
return response()->json(Helper::formatStandardApiResponse('error', null, $e->errors()), 200);
}
}
@@ -138,13 +138,13 @@ class Handler extends ExceptionHandler
if (in_array('bulkedit', $ids, true)) {
$error_array = session()->get('bulk_asset_errors');
return redirect()
->route('hardware.index')
->route('hardware.bulkedit')
->withErrors($error_array, 'bulk_asset_errors')
->withInput();
}
// This gets the MVC model name from the exception and formats in a way that's less fugly
$model_name = trim(strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel()))))));
// This gets the MVC model name from the exception and formats in a way that's less fugly
$model_name = strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel())))));
$route = str_plural(strtolower(last(explode('\\', $e->getModel())))).'.index';
// Sigh.
@@ -160,7 +160,9 @@ class Handler extends ExceptionHandler
$route = 'maintenances.index';
} elseif ($route === 'licenseseats.index') {
$route = 'licenses.index';
} elseif (($route === 'customfieldsets.index') || ($route === 'customfields.index')) {
} elseif ($route === 'customfields.index') {
$route = 'fields.index';
} elseif ($route === 'customfieldsets.index') {
$route = 'fields.index';
}
@@ -198,7 +200,7 @@ class Handler extends ExceptionHandler
protected function invalidJson($request, ValidationException $exception)
{
return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors()), config('app.validation_status_code'));
return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors()), 200);
}

View File

@@ -95,7 +95,7 @@ class Helper
$Parsedown->setSafeMode(true);
if ($str) {
return $Parsedown->text(strip_tags($str));
return $Parsedown->text($str);
}
}
@@ -105,7 +105,7 @@ class Helper
$Parsedown->setSafeMode(true);
if ($str) {
return $Parsedown->line(strip_tags($str));
return $Parsedown->line($str);
}
}
@@ -435,34 +435,6 @@ class Helper
return $colors[$index];
}
/**
* Check if a string has any RTL characters
* @param $value
* @return bool
*/
public static function hasRtl($string) {
$rtlChar = '/[\x{0590}-\x{083F}]|[\x{08A0}-\x{08FF}]|[\x{FB1D}-\x{FDFF}]|[\x{FE70}-\x{FEFF}]/u';
return preg_match($rtlChar, $string) != 0;
}
// is chinese, japanese or korean language
public static function isCjk($string) {
return Helper::isChinese($string) || Helper::isJapanese($string) || Helper::isKorean($string);
}
public static function isChinese($string) {
return preg_match("/\p{Han}+/u", $string);
}
public static function isJapanese($string) {
return preg_match('/[\x{4E00}-\x{9FBF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}]/u', $string);
}
public static function isKorean($string) {
return preg_match('/[\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]/u', $string);
}
/**
* Increases or decreases the brightness of a color by a percentage of the current brightness.
*
@@ -1225,30 +1197,19 @@ class Helper
'webp' => 'far fa-image',
'avif' => 'far fa-image',
'svg' => 'fas fa-vector-square',
// word
'doc' => 'far fa-file-word',
'docx' => 'far fa-file-word',
// Excel
'xls' => 'far fa-file-excel',
'xlsx' => 'far fa-file-excel',
'ods' => 'far fa-file-excel',
// Presentation
'ppt' => 'far fa-file-powerpoint',
'odp' => 'far fa-file-powerpoint',
// archive
'zip' => 'fas fa-file-archive',
'rar' => 'fas fa-file-archive',
//Text
'odt' => 'far fa-file-alt',
'txt' => 'far fa-file-alt',
'rtf' => 'far fa-file-alt',
'xml' => 'fas fa-code',
// Misc
'pdf' => 'far fa-file-pdf',
'lic' => 'far fa-save',
@@ -1582,6 +1543,11 @@ class Helper
// return to previous page
if ($redirect_option === 'back') {
if ($backUrl === route('home')) {
return redirect()->to($backUrl)
->with('warning', trans('general.page_error'));
}
return redirect()->to($backUrl);
}
@@ -1734,5 +1700,5 @@ class Helper
}
}
return $mismatched;
}
}
}

View File

@@ -16,7 +16,6 @@ class IconHelper
case 'clone':
return 'far fa-clone';
case 'delete':
case 'upload deleted':
return 'fas fa-trash';
case 'create':
return 'fa-solid fa-plus';
@@ -44,8 +43,6 @@ class IconHelper
return 'fa-regular fa-envelope';
case 'phone':
return 'fa-solid fa-phone';
case 'mobile':
return 'fas fa-mobile-screen-button';
case 'long-arrow-right':
return 'fas fa-long-arrow-alt-right';
case 'download':
@@ -154,7 +151,6 @@ class IconHelper
case 'location':
return 'fas fa-map-marker-alt';
case 'superadmin':
case 'admin':
return 'fas fa-crown';
case 'print':
return 'fa-solid fa-print';

View File

@@ -27,45 +27,6 @@ class StorageHelper
}
}
public static function getMediaType($file_with_path) {
// Get the file extension and determine the media type
if (Storage::exists($file_with_path)) {
$fileinfo = pathinfo($file_with_path);
$extension = strtolower($fileinfo['extension']);
switch ($extension) {
case 'avif':
case 'jpg':
case 'png':
case 'gif':
case 'svg':
case 'webp':
return 'image';
case 'pdf':
return 'pdf';
case 'mp3':
case 'wav':
case 'ogg':
return 'audio';
case 'mp4':
case 'webm':
case 'mov':
return 'video';
case 'doc':
case 'docx':
return 'document';
case 'txt':
return 'text';
case 'xls':
case 'xlsx':
case 'ods':
return 'spreadsheet';
default:
return $extension; // Default for unknown types
}
}
return null;
}
/**
* This determines the file types that should be allowed inline and checks their fileinfo extension
@@ -91,6 +52,7 @@ class StorageHelper
'pdf',
'png',
'svg',
'svg',
'wav',
'webm',
'webp',

View File

@@ -77,25 +77,9 @@ class AccessoriesController extends Controller
$accessory->supplier_id = request('supplier_id');
$accessory->notes = request('notes');
if ($request->has('use_cloned_image')) {
$cloned_model_img = Accessory::select('image')->find($request->input('clone_image_from_id'));
if ($cloned_model_img) {
$new_image_name = 'clone-'.date('U').'-'.$cloned_model_img->image;
$new_image = 'accessories/'.$new_image_name;
Storage::disk('public')->copy('accessories/'.$cloned_model_img->image, $new_image);
$accessory->image = $new_image_name;
}
} else {
$accessory = $request->handleImages($accessory);
}
if($request->get('redirect_option') === 'back'){
session()->put(['redirect_option' => 'index']);
} else {
session()->put(['redirect_option' => $request->get('redirect_option')]);
}
$accessory = $request->handleImages($accessory);
session()->put(['redirect_option' => $request->get('redirect_option')]);
// Was the accessory created?
if ($accessory->save()) {
// Redirect to the new accessory page
@@ -130,12 +114,11 @@ class AccessoriesController extends Controller
$this->authorize('create', Accessory::class);
$cloned = clone $accessory;
$accessory_to_clone = $accessory;
$cloned->id = null;
$cloned->deleted_at = '';
$cloned->location_id = null;
return view('accessories/edit')
->with('cloned_model', $accessory_to_clone)
->with('item', $cloned);
}

View File

@@ -0,0 +1,132 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Helpers\StorageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\UploadFileRequest;
use App\Models\Actionlog;
use App\Models\Accessory;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Log;
use \Illuminate\Contracts\View\View;
use \Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Response;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
class AccessoriesFilesController extends Controller
{
/**
* Validates and stores files associated with a accessory.
*
* @param UploadFileRequest $request
* @param int $accessoryId
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @todo Switch to using the AssetFileRequest form request validator.
*/
public function store(UploadFileRequest $request, $accessoryId = null) : RedirectResponse
{
if (config('app.lock_passwords')) {
return redirect()->route('accessories.show', ['accessory'=>$accessoryId])->with('error', trans('general.feature_disabled'));
}
$accessory = Accessory::find($accessoryId);
if (isset($accessory->id)) {
$this->authorize('accessories.files', $accessory);
if ($request->hasFile('file')) {
if (! Storage::exists('private_uploads/accessories')) {
Storage::makeDirectory('private_uploads/accessories', 775);
}
foreach ($request->file('file') as $file) {
$file_name = $request->handleFile('private_uploads/accessories/', 'accessory-'.$accessory->id, $file);
//Log the upload to the log
$accessory->logUpload($file_name, e($request->input('notes')));
}
return redirect()->route('accessories.show', $accessory->id)->withFragment('files')->with('success', trans('general.file_upload_success'));
}
return redirect()->route('accessories.show', $accessory->id)->withFragment('files')->with('error', trans('general.no_files_uploaded'));
}
// Prepare the error message
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
* Deletes the selected accessory file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $accessoryId
* @param int $fileId
*/
public function destroy($accessoryId = null, $fileId = null) : RedirectResponse
{
if ($accessory = Accessory::find($accessoryId)) {
$this->authorize('update', $accessory);
if ($log = Actionlog::find($fileId)) {
if (Storage::exists('private_uploads/accessories/'.$log->filename)) {
try {
Storage::delete('private_uploads/accessories/' . $log->filename);
$log->delete();
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
} catch (\Exception $e) {
Log::debug($e);
return redirect()->route('accessories.index')->with('error', trans('general.file_does_not_exist'));
}
}
}
return redirect()->route('accessories.show', ['accessory' => $accessory])->withFragment('files')->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
* Allows the selected file to be viewed.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.4]
* @param int $accessoryId
* @param int $fileId
*/
public function show($accessoryId = null, $fileId = null) : View | RedirectResponse | Response | BinaryFileResponse | StreamedResponse
{
// the accessory is valid
if ($accessory = Accessory::find($accessoryId)) {
$this->authorize('view', $accessory);
$this->authorize('accessories.files', $accessory);
if ($log = Actionlog::whereNotNull('filename')->where('item_id', $accessory->id)->find($fileId)) {
$file = 'private_uploads/accessories/'.$log->filename;
try {
return StorageHelper::showOrDownloadFile($file, $log->filename);
} catch (\Exception $e) {
return redirect()->route('accessories.show', ['accessory' => $accessory])->with('error', trans('general.file_not_found'));
}
}
return redirect()->route('accessories.show', ['accessory' => $accessory])->withFragment('files')->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
}

View File

@@ -71,7 +71,6 @@ class AccessoryCheckoutController extends Controller
$this->authorize('checkout', $accessory);
$target = $this->determineCheckoutTarget();
session()->put(['checkout_to_type' => $target]);
$accessory->checkout_qty = $request->input('checkout_qty', 1);

View File

@@ -8,23 +8,33 @@ use App\Events\ItemAccepted;
use App\Events\ItemDeclined;
use App\Http\Controllers\Controller;
use App\Mail\CheckoutAcceptanceResponseMail;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\CheckoutAcceptance;
use App\Models\Company;
use App\Models\Contracts\Acceptable;
use App\Models\Setting;
use App\Models\User;
use App\Models\AssetModel;
use App\Models\Accessory;
use App\Models\License;
use App\Models\Component;
use App\Models\Consumable;
use App\Notifications\AcceptanceAssetAcceptedNotification;
use App\Notifications\AcceptanceAssetAcceptedToUserNotification;
use App\Notifications\AcceptanceAssetDeclinedNotification;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Http\Controllers\SettingsController;
use Barryvdh\DomPDF\Facade\Pdf;
use Carbon\Carbon;
use \Illuminate\Contracts\View\View;
use \Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Log;
use App\Helpers\Helper;
class AcceptanceController extends Controller
{
@@ -75,10 +85,6 @@ class AcceptanceController extends Controller
public function store(Request $request, $id) : RedirectResponse
{
$acceptance = CheckoutAcceptance::find($id);
$assigned_user = User::find($acceptance->assigned_to_id);
$settings = Setting::getSettings();
$sig_filename='';
if (is_null($acceptance)) {
return redirect()->route('account.accept')->with('error', trans('admin/hardware/message.does_not_exist'));
@@ -101,84 +107,139 @@ class AcceptanceController extends Controller
}
/**
* Check for the signature directory
* Get the signature and save it
*/
if (! Storage::exists('private_uploads/signatures')) {
Storage::makeDirectory('private_uploads/signatures', 775);
}
/**
* Check for the eula-pdfs directory
*/
if (! Storage::exists('private_uploads/eula-pdfs')) {
Storage::makeDirectory('private_uploads/eula-pdfs', 775);
}
$item = $acceptance->checkoutable_type::find($acceptance->checkoutable_id);
// If signatures are required, make sure we have one
if (Setting::getSettings()->require_accept_signature == '1') {
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
// Convert PDF logo to base64 for TCPDF
// This is needed for TCPDF to properly embed the image if it's a png and the cache isn't writable
$encoded_logo = null;
if ($settings->acceptance_pdf_logo) {
$encoded_logo = base64_encode(file_get_contents(public_path() . '/uploads/' . $settings->acceptance_pdf_logo));
}
// Get the data array ready for the notifications and PDF generation
$data = [
'item_tag' => $item->asset_tag,
'item_name' => $item->name, // this handles licenses seats, which don't have a 'name' field
'item_model' => $item->model?->name,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'eula' => $item->getEula(),
'note' => $request->input('note'),
'check_out_date' => Helper::getFormattedDateObject($acceptance->created_at, 'datetime', false),
'accepted_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
'declined_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
'assigned_to' => $assigned_user->display_name,
'email' => $assigned_user->email,
'employee_num' => $assigned_user->employee_num,
'site_name' => $settings->site_name,
'company_name' => $item->company?->name?? $settings->site_name,
'signature' => (($sig_filename && array_key_exists('1', $encoded_image))) ? $encoded_image[1] : null,
'logo' => ($encoded_logo) ?? null,
'date_settings' => $settings->date_display_format,
'admin' => auth()->user()->present()?->fullName,
'qty' => $acceptance->qty ?? 1,
];
$display_model = '';
$pdf_view_route = '';
$pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf';
$sig_filename='';
if ($request->input('asset_acceptance') == 'accepted') {
/**
* Check for the eula-pdfs directory
*/
if (! Storage::exists('private_uploads/eula-pdfs')) {
Storage::makeDirectory('private_uploads/eula-pdfs', 775);
}
$pdf_filename = 'accepted-'.$acceptance->checkoutable_id.'-'.$acceptance->display_checkoutable_type.'-eula-'.date('Y-m-d-h-i-s').'.pdf';
if (Setting::getSettings()->require_accept_signature == '1') {
// Check if the signature directory exists, if not create it
if (!Storage::exists('private_uploads/signatures')) {
Storage::makeDirectory('private_uploads/signatures', 775);
}
// Generate the PDF content
$pdf_content = $acceptance->generateAcceptancePdf($data, $acceptance);
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf_content);
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
$assigned_user = User::find($acceptance->assigned_to_id);
// this is horrible
switch($acceptance->checkoutable_type){
case 'App\Models\Asset':
$pdf_view_route ='account.accept.accept-asset-eula';
$asset_model = AssetModel::find($item->model_id);
if (!$asset_model) {
return redirect()->back()->with('error', trans('admin/models/message.does_not_exist'));
}
$display_model = $asset_model->name;
break;
case 'App\Models\Accessory':
$pdf_view_route ='account.accept.accept-accessory-eula';
$accessory = Accessory::find($item->id);
$display_model = $accessory->name;
break;
case 'App\Models\LicenseSeat':
$pdf_view_route ='account.accept.accept-license-eula';
$license = License::find($item->license_id);
$display_model = $license->name;
break;
case 'App\Models\Component':
$pdf_view_route ='account.accept.accept-component-eula';
$component = Component::find($item->id);
$display_model = $component->name;
break;
case 'App\Models\Consumable':
$pdf_view_route ='account.accept.accept-consumable-eula';
$consumable = Consumable::find($item->id);
$display_model = $consumable->name;
break;
}
// if ($acceptance->checkoutable_type == 'App\Models\Asset') {
// $pdf_view_route ='account.accept.accept-asset-eula';
// $asset_model = AssetModel::find($item->model_id);
// $display_model = $asset_model->name;
// $assigned_to = User::find($item->assigned_to)->present()->fullName;
//
// } elseif ($acceptance->checkoutable_type== 'App\Models\Accessory') {
// $pdf_view_route ='account.accept.accept-accessory-eula';
// $accessory = Accessory::find($item->id);
// $display_model = $accessory->name;
// $assigned_to = User::find($item->assignedTo);
//
// }
/**
* Gather the data for the PDF. We fire this whether there is a signature required or not,
* since we want the moment-in-time proof of what the EULA was when they accepted it.
*/
$branding_settings = SettingsController::getPDFBranding();
$path_logo = "";
// Check for the PDF logo path and use that, otherwise use the regular logo path
if (!is_null($branding_settings->acceptance_pdf_logo)) {
$path_logo = public_path() . '/uploads/' . $branding_settings->acceptance_pdf_logo;
} elseif (!is_null($branding_settings->logo)) {
$path_logo = public_path() . '/uploads/' . $branding_settings->logo;
}
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'eula' => $item->getEula(),
'note' => $request->input('note'),
'check_out_date' => Carbon::parse($acceptance->created_at)->format('Y-m-d'),
'accepted_date' => Carbon::parse($acceptance->accepted_at)->format('Y-m-d'),
'assigned_to' => $assigned_user->present()->fullName,
'company_name' => $branding_settings->site_name,
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'logo' => $path_logo,
'date_settings' => $branding_settings->date_display_format,
];
if ($pdf_view_route!='') {
Log::debug($pdf_filename.' is the filename, and the route was specified.');
$pdf = Pdf::loadView($pdf_view_route, $data);
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf->output());
}
// Log the acceptance
$acceptance->accept($sig_filename, $item->getEula(), $pdf_filename, $request->input('note'));
// Send the PDF to the signing user
@@ -186,14 +247,15 @@ class AcceptanceController extends Controller
// Add the attachment for the signing user into the $data array
$data['file'] = $pdf_filename;
try {
$assigned_user->notify((new AcceptanceAssetAcceptedToUserNotification($data))->locale($assigned_user->locale));
$assigned_user->notify(new AcceptanceAssetAcceptedToUserNotification($data));
} catch (\Exception $e) {
Log::warning($e);
}
}
try {
$acceptance->notify((new AcceptanceAssetAcceptedNotification($data))->locale(Setting::getSettings()->locale));
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
} catch (\Exception $e) {
Log::warning($e);
}
@@ -201,43 +263,112 @@ class AcceptanceController extends Controller
$return_msg = trans('admin/users/message.accepted');
// Item was declined
} else {
for ($i = 0; $i < ($acceptance->qty ?? 1); $i++) {
$acceptance->decline($sig_filename, $request->input('note'));
/**
* Check for the eula-pdfs directory
*/
if (! Storage::exists('private_uploads/eula-pdfs')) {
Storage::makeDirectory('private_uploads/eula-pdfs', 775);
}
if (Setting::getSettings()->require_accept_signature == '1') {
// Check if the signature directory exists, if not create it
if (!Storage::exists('private_uploads/signatures')) {
Storage::makeDirectory('private_uploads/signatures', 775);
}
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
// Format the data to send the declined notification
$branding_settings = SettingsController::getPDFBranding();
// This is the most horriblest
switch($acceptance->checkoutable_type){
case 'App\Models\Asset':
$asset_model = AssetModel::find($item->model_id);
$display_model = $asset_model->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Accessory':
$accessory = Accessory::find($item->id);
$display_model = $accessory->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\LicenseSeat':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Component':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Consumable':
$consumable = Consumable::find($item->id);
$display_model = $consumable->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
}
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'note' => $request->input('note'),
'declined_date' => Carbon::parse($acceptance->declined_at)->format('Y-m-d'),
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'assigned_to' => $assigned_to,
'company_name' => $branding_settings->site_name,
'date_settings' => $branding_settings->date_display_format,
];
if ($pdf_view_route!='') {
Log::debug($pdf_filename.' is the filename, and the route was specified.');
$pdf = Pdf::loadView($pdf_view_route, $data);
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf->output());
}
$acceptance->decline($sig_filename, $request->input('note'));
$acceptance->notify(new AcceptanceAssetDeclinedNotification($data));
Log::debug('New event acceptance.');
event(new CheckoutDeclined($acceptance));
$return_msg = trans('admin/users/message.declined');
}
// Send an email notification if one is requested
if ($acceptance->alert_on_response_id) {
try {
$recipient = User::find($acceptance->alert_on_response_id);
if ($recipient) {
Log::debug('Attempting to send email acceptance.');
Mail::to($recipient)->send(new CheckoutAcceptanceResponseMail(
$acceptance,
$recipient,
$request->input('asset_acceptance') === 'accepted',
));
Log::debug('Send email notification sucess on checkout acceptance response.');
}
} catch (Exception $e) {
Log::error($e->getMessage());
Log::warning($e);
}
}
return redirect()->to('account/accept')->with('success', $return_msg);
}
}

View File

@@ -3,13 +3,11 @@
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Actionlog;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use \Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class ActionlogController extends Controller
{
public function displaySig($filename) : RedirectResponse | Response | bool
@@ -41,29 +39,17 @@ class ActionlogController extends Controller
public function getStoredEula($filename) : Response | BinaryFileResponse | RedirectResponse
{
$this->authorize('view', \App\Models\Asset::class);
if ($actionlog = Actionlog::where('filename', $filename)->with('user')->with('target')->firstOrFail()) {
$this->authorize('view', $actionlog->target);
$this->authorize('view', $actionlog->user);
if (config('filesystems.default') == 's3_private') {
return redirect()->away(Storage::disk('s3_private')->temporaryUrl('private_uploads/eula-pdfs/' . $filename, now()->addMinutes(5)));
}
if (Storage::exists('private_uploads/eula-pdfs/' . $filename)) {
if (request()->input('inline') == 'true') {
return response()->file(config('app.private_uploads') . '/eula-pdfs/' . $filename);
}
return response()->download(config('app.private_uploads') . '/eula-pdfs/' . $filename);
}
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
if (config('filesystems.default') == 's3_private') {
return redirect()->away(Storage::disk('s3_private')->temporaryUrl('private_uploads/eula-pdfs/'.$filename, now()->addMinutes(5)));
}
return redirect()->back()->with('error', trans('general.record_not_found'));
if (Storage::exists('private_uploads/eula-pdfs/'.$filename)) {
return response()->download(config('app.private_uploads').'/eula-pdfs/'.$filename);
}
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
}
}

View File

@@ -11,9 +11,12 @@ use App\Http\Requests\StoreAccessoryRequest;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;
use App\Models\AccessoryCheckout;
@@ -23,25 +26,11 @@ class AccessoriesController extends Controller
use CheckInOutRequest;
/**
* List accessories
* Display a listing of the resource.
*
* @group Accessories
* @queryParam search string A search term to filter results by. Example: keyboard
* @queryParam filter[<fieldname>] string A field to filter by. Example
* @queryParam company_id int Filter by company ID. Example: 1
* @queryParam category_id int Filter by category ID. Example: 1
* @queryParam manufacturer_id int Filter by manufacturer ID. Example: 1
* @queryParam supplier_id int Filter by supplier ID. Example: 1
* @queryParam location_id int Filter by location ID. Example: 1
* @queryParam notes string Filter by notes. Example: For office use only
* @queryParam offset int The number of items to skip before starting to collect the result set. Example: 0
* @queryParam limit int The number of items to return. Example: 50
* @queryParam sort string The field to sort by. Example: created_at
* @queryParam order string The order to sort by. Example: desc
*
* @return \Illuminate\Http\Response
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
@@ -65,15 +54,6 @@ class AccessoriesController extends Controller
'notes',
'checkouts_count',
'qty',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'company',
'location',
'category',
'supplier',
'manufacturer',
];
@@ -81,23 +61,10 @@ class AccessoriesController extends Controller
->with('category', 'company', 'manufacturer', 'checkouts', 'location', 'supplier', 'adminuser')
->withCount('checkouts as checkouts_count');
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
if ($request->filled('search')) {
$accessories = $accessories->TextSearch($request->input('search'));
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$accessories->ByFilter($filter);
} elseif ($request->filled('search')) {
$accessories->TextSearch($request->input('search'));
}
if ($request->filled('company_id')) {
$accessories->where('accessories.company_id', '=', $request->input('company_id'));
}
@@ -162,13 +129,9 @@ class AccessoriesController extends Controller
/**
* Create Accessory
* Store a newly created resource in storage.
*
* @group Accessories
* @bodyParam name string required The name of the accessory. Example: Apple Bluetooth Keyboard
* @bodyParam qty int required The number of accessories to create. Example: 10
* @bodyParam category_id int required The ID of the category to assign this accessory to. Example: 1
* @bodyParam image file No-example
* @param \App\Http\Requests\ImageUploadRequest $request
* @return \Illuminate\Http\JsonResponse
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
@@ -188,9 +151,8 @@ class AccessoriesController extends Controller
}
/**
* Show Accessory
* Display the specified resource.
*
* @group Accessories
* @param int $id
* @return array
* @author [A. Gianotto] [<snipe@snipe.net>]
@@ -205,11 +167,26 @@ class AccessoriesController extends Controller
}
/**
* Display the specified resource.
*
* @param int $id
* @return array
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
public function accessory_detail($id)
{
$this->authorize('view', Accessory::class);
$accessory = Accessory::findOrFail($id);
return (new AccessoriesTransformer)->transformAccessory($accessory);
}
/**
* Show Accessory Checkouts
* Get the list of checkouts for a specific accessory
*
* @group Accessories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -239,9 +216,8 @@ class AccessoriesController extends Controller
/**
* Update accessory.
* Update the specified resource in storage.
*
* @group Accessories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -263,9 +239,8 @@ class AccessoriesController extends Controller
}
/**
* Delete Accessory
* Remove the specified resource from storage.
*
* @group Accessories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -288,12 +263,11 @@ class AccessoriesController extends Controller
/**
* Checkout Accessory
* Save the Accessory checkout information.
*
* If Slack is enabled and/or asset acceptance is enabled, it will also
* trigger a Slack message and send an email.
*
* @group Accessories
* @param int $accessoryId
* @return \Illuminate\Http\JsonResponse
* @author [A. Gianotto] [<snipe@snipe.net>]
@@ -314,43 +288,32 @@ class AccessoriesController extends Controller
'note' => $request->input('note'),
]);
$accessory_checkout->created_by = auth()->id();
$accessory_checkout->save();
$payload = [
'accessory_id' => $accessory->id,
'assigned_to' => $target->id,
'assigned_type' => $target::class,
'note' => $request->input('note'),
'created_by' => auth()->id(),
'pivot' => $accessory_checkout->id,
];
}
// Set this value to be able to pass the qty through to the event
event(new CheckoutableCheckedOut($accessory, $target, auth()->user(), $request->input('note')));
return response()->json(Helper::formatStandardApiResponse('success', $payload, trans('admin/accessories/message.checkout.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
}
/**
* Checkin Accessory
* Check in the item so that it can be checked out again to someone else
*
* @group Accessories
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param int $accessoryUserId
* @param string $backto
* @return JsonResponse
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @return \Illuminate\Http\RedirectResponse
* @internal param int $accessoryId
*/
public function checkin(Request $request, $accessoryUserId = null)
{
if (is_null($accessory_checkout = AccessoryCheckout::find($accessoryUserId))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist', ['id' => $accessoryUserId])));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist')));
}
$accessory = Accessory::find($accessory_checkout->accessory_id);
@@ -364,14 +327,7 @@ class AccessoriesController extends Controller
$user = User::find($accessory_checkout->assigned_to);
}
$payload = [
'accessory_id' => $accessory->id,
'note' => $request->input('note'),
'created_by' => auth()->id(),
'pivot' => $accessory_checkout->id,
];
return response()->json(Helper::formatStandardApiResponse('success', $payload, trans('admin/accessories/message.checkin.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
@@ -380,10 +336,8 @@ class AccessoriesController extends Controller
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Accessories
* @queryParam search string A search term to filter results by name. No-example
* @see \App\Http\Transformers\SelectlistTransformer
*
*/

View File

@@ -4,11 +4,11 @@ namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\ImageUploadRequest;
use App\Http\Transformers\MaintenancesTransformer;
use App\Http\Transformers\AssetMaintenancesTransformer;
use App\Models\Asset;
use App\Models\Maintenance;
use App\Models\AssetMaintenance;
use App\Models\Company;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
@@ -18,24 +18,13 @@ use Illuminate\Http\JsonResponse;
*
* @version v2.0
*/
class MaintenancesController extends Controller
class AssetMaintenancesController extends Controller
{
/**
* List Maintenances
* Generates the JSON response for asset maintenances listing view.
*
* @group Maintenances
* @queryParam search string Search term to filter results. Example: repair
* @queryParam asset_id integer Filter by exact asset ID. Example: 1
* @queryParam supplier_id integer Filter by exact supplier ID. Example: 1
* @queryParam created_by integer Filter by exact user ID who created the maintenance. Example
* @queryParam url string Filter by exact URL. Example: http://example.com
* @queryParam asset_maintenance_type string Filter by exact maintenance type. Example: repair
* @queryParam sort string Column to sort results by. Allowed values: id, name, asset_maintenance_time, asset_maintenance_type, cost, start_date, completion_date, notes, asset_tag, asset_name, serial, created_by, supplier, location, is_warranty, status_label. Default: created_at. Example: name
* @queryParam order string Order of sorted results. Allowed values: asc, desc. Default: desc. Example: asc
* @queryParam offset integer Offset/starting position of the results. Default: 0. Example: 0
* @queryParam limit integer Limit the number of results returned. Default: 25. Maximum: 100. Example: 50
* @see MaintenancesController::getIndex() method that generates view
* @see AssetMaintenancesController::getIndex() method that generates view
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
@@ -44,7 +33,7 @@ class MaintenancesController extends Controller
{
$this->authorize('view', Asset::class);
$maintenances = Maintenance::select('maintenances.*')
$maintenances = AssetMaintenance::select('asset_maintenances.*')
->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'asset.assetstatus', 'adminuser');
if ($request->filled('search')) {
@@ -56,15 +45,11 @@ class MaintenancesController extends Controller
}
if ($request->filled('supplier_id')) {
$maintenances->where('maintenances.supplier_id', '=', $request->input('supplier_id'));
$maintenances->where('asset_maintenances.supplier_id', '=', $request->input('supplier_id'));
}
if ($request->filled('created_by')) {
$maintenances->where('maintenances.created_by', '=', $request->input('created_by'));
}
if ($request->filled('url')) {
$maintenances->where('maintenances.url', '=', $request->input('url'));
$maintenances->where('asset_maintenances.created_by', '=', $request->input('created_by'));
}
if ($request->filled('asset_maintenance_type')) {
@@ -78,7 +63,7 @@ class MaintenancesController extends Controller
$allowed_columns = [
'id',
'name',
'title',
'asset_maintenance_time',
'asset_maintenance_type',
'cost',
@@ -127,33 +112,31 @@ class MaintenancesController extends Controller
$total = $maintenances->count();
$maintenances = $maintenances->skip($offset)->take($limit)->get();
return (new MaintenancesTransformer())->transformMaintenances($maintenances, $total);
return (new AssetMaintenancesTransformer())->transformAssetMaintenances($maintenances, $total);
}
/**
* Create Maintenance
* Validates and stores the new asset maintenance
*
* @group Maintenances
* @see MaintenancesController::getCreate() method for the form
* @see AssetMaintenancesController::getCreate() method for the form
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
*/
public function store(ImageUploadRequest $request) : JsonResponse | array
public function store(Request $request) : JsonResponse | array
{
$this->authorize('update', Asset::class);
// create a new model instance
$maintenance = new Maintenance();
$maintenance = new AssetMaintenance();
$maintenance->fill($request->all());
$maintenance->created_by = auth()->id();
$maintenance = $request->handleImages($maintenance);
// Was the asset maintenance created?
if ($maintenance->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $maintenance, trans('admin/maintenances/message.create.success')));
return response()->json(Helper::formatStandardApiResponse('success', $maintenance, trans('admin/asset_maintenances/message.create.success')));
}
@@ -162,9 +145,8 @@ class MaintenancesController extends Controller
}
/**
* Update Maintenance
* Validates and stores an update to an asset maintenance
*
* @group Maintenances
* @author A. Gianotto <snipe@snipe.net>
* @param int $id
* @param int $request
@@ -175,11 +157,11 @@ class MaintenancesController extends Controller
{
$this->authorize('update', Asset::class);
if ($maintenance = Maintenance::with('asset')->find($id)) {
if ($maintenance = AssetMaintenance::with('asset')->find($id)) {
// Can this user manage this asset?
if (! Company::isCurrentUserHasAccess($maintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.action_permission_denied', ['item_type' => trans('admin/maintenances/general.maintenance'), 'id' => $id, 'action' => trans('general.edit')])));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.action_permission_denied', ['item_type' => trans('admin/asset_maintenances/general.maintenance'), 'id' => $id, 'action' => trans('general.edit')])));
}
// The asset this miantenance is attached to is not valid or has been deleted
@@ -190,57 +172,55 @@ class MaintenancesController extends Controller
$maintenance->fill($request->all());
if ($maintenance->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $maintenance, trans('admin/maintenances/message.edit.success')));
return response()->json(Helper::formatStandardApiResponse('success', $maintenance, trans('admin/asset_maintenances/message.edit.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $maintenance->getErrors()));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.item_not_found', ['item_type' => trans('admin/maintenances/general.maintenance'), 'id' => $id])));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.item_not_found', ['item_type' => trans('admin/asset_maintenances/general.maintenance'), 'id' => $id])));
}
/**
* Delete Maintenance
* Delete an asset maintenance
*
* @group Maintenances
* @author A. Gianotto <snipe@snipe.net>
* @param int $maintenanceId
* @param int $assetMaintenanceId
* @version v1.0
* @since [v4.0]
*/
public function destroy($maintenanceId) : JsonResponse | array
public function destroy($assetMaintenanceId) : JsonResponse | array
{
$this->authorize('update', Asset::class);
// Check if the asset maintenance exists
$maintenance = Maintenance::findOrFail($maintenanceId);
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
$maintenance->delete();
$assetMaintenance->delete();
return response()->json(Helper::formatStandardApiResponse('success', $maintenance, trans('admin/maintenances/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', $assetMaintenance, trans('admin/asset_maintenances/message.delete.success')));
}
/**
* View Maintenance
* View an asset maintenance
*
* @group Maintenances
* @author A. Gianotto <snipe@snipe.net>
* @param int $maintenanceId
* @param int $assetMaintenanceId
* @version v1.0
* @since [v4.0]
*/
public function show($maintenanceId) : JsonResponse | array
public function show($assetMaintenanceId) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$maintenance = Maintenance::findOrFail($maintenanceId);
if (! Company::isCurrentUserHasAccess($maintenance->asset)) {
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
if (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot view a maintenance for that asset'));
}
return (new MaintenancesTransformer())->transformMaintenance($maintenance);
return (new AssetMaintenancesTransformer())->transformAssetMaintenance($assetMaintenance);
}
}

View File

@@ -25,9 +25,8 @@ use Illuminate\Http\JsonResponse;
class AssetModelsController extends Controller
{
/**
* List Models
* Display a listing of the resource.
*
* @group Models
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -47,20 +46,10 @@ class AssetModelsController extends Controller
'manufacturer',
'requestable',
'assets_count',
'assets_assigned_count',
'assets_archived_count',
'remaining',
'category',
'fieldset',
'deleted_at',
'updated_at',
'require_serial',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'manufacturer',
'category',
];
$assetmodels = AssetModel::select([
@@ -80,31 +69,9 @@ class AssetModelsController extends Controller
'models.fieldset_id',
'models.deleted_at',
'models.updated_at',
'models.require_serial'
])
->with('category', 'depreciation', 'manufacturer', 'fieldset.fields.defaultValues', 'adminuser')
->withCount('assets as assets_count')
->withCount('availableAssets as remaining')
->withCount('assignedAssets as assets_assigned_count')
->withCount('archivedAssets as assets_archived_count');
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$assetmodels->ByFilter($filter);
} elseif ($request->filled('search')) {
$assetmodels->TextSearch($request->input('search'));
}
->withCount('assets as assets_count');
if ($request->input('status')=='deleted') {
$assetmodels->onlyTrashed();
@@ -173,9 +140,8 @@ class AssetModelsController extends Controller
/**
* Create Model
* Store a newly created resource in storage.
*
* @group Models
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\StoreAssetModelRequest $request
@@ -196,12 +162,11 @@ class AssetModelsController extends Controller
}
/**
* Show Model
* Display the specified resource.
*
* @group Models
* @urlParam id int required The ID of the model.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function show($id) : array
{
@@ -212,13 +177,11 @@ class AssetModelsController extends Controller
}
/**
* List Assets in Model
* Display the specified resource's assets
*
* @group Models
* @urlParam id int required The ID of the model.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*
* @param int $id
*/
public function assets($id) : array
{
@@ -230,12 +193,12 @@ class AssetModelsController extends Controller
/**
* Update Model
* Update the specified resource in storage.
*
* @group Models
* @urlParam id int required The ID of the model.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(StoreAssetModelRequest $request, $id) : JsonResponse
@@ -266,12 +229,11 @@ class AssetModelsController extends Controller
}
/**
* Delete Model
* Remove the specified resource from storage.
*
* @group Models
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @urlParam id int required The ID of the model.
* @param int $id
*/
public function destroy($id) : JsonResponse
{
@@ -297,9 +259,8 @@ class AssetModelsController extends Controller
}
/**
* Selectlist of Models
* Gets a paginated collection for the select2 menus
*
* @group Models
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -6,7 +6,6 @@ use App\Events\CheckoutableCheckedIn;
use App\Http\Requests\StoreAssetRequest;
use App\Http\Requests\UpdateAssetRequest;
use App\Http\Traits\MigratesLegacyAssetLocations;
use App\Http\Transformers\ComponentsTransformer;
use App\Models\AccessoryCheckout;
use App\Models\CheckoutAcceptance;
use App\Models\LicenseSeat;
@@ -50,32 +49,10 @@ class AssetsController extends Controller
use MigratesLegacyAssetLocations;
/**
* List Assets
* Returns JSON listing of all assets
*
* @group Assets
* @queryParam action string The action to filter by: audits, checkins. No-example
* @queryParam upcoming_status string The status to filter by: `due`, `overdue`, `due-or-overdue`. No-example
* @queryParam status string The asset status to filter by: `RTD`, `Deployed`, `Pending`, `Undeployable`, `Archived`, `Requestable`. No-example
* @queryParam status_id int The asset status ID to filter by. No-example
* @queryParam asset_tag string The asset tag to filter by. No-example
* @queryParam serial string The serial number to filter by. No-example
* @queryParam requestable boolean Filter by requestable assets. No-example
* @queryParam model_id int The model ID or IDs to filter by. No-example
* @queryParam category_id int The category ID to filter by. No-example
* @queryParam location_id int The location ID to filter by. No-example
* @queryParam rtd_location_id int The RTD location ID to filter by. No-example
* @queryParam supplier_id int The supplier ID to filter by. No-example
* @queryParam asset_eol_date date The asset end-of-life date to filter by. No-example
* @queryParam assigned_to int The user ID or department ID the asset is assigned to. No-example
* @queryParam assigned_type string The type of assignment, either 'user' or 'asset' or 'location'. Example: user
* @queryParam company_id int The company ID to filter by. No-example
* @queryParam manufacturer_id int The manufacturer ID to filter by. No-example
* @queryParam depreciation_id int The depreciation ID to filter by. No-example
* @queryParam byod boolean Filter by BYOD assets. Example: true
* @queryParam order_number string The order number to filter by. Example: No-example
* @queryParam search string A text string to search for. Example: No-example
* @queryParam filter string A JSON object of key/value pairs to filter by. No-example
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v4.0]
*/
public function index(Request $request, $action = null, $upcoming_status = null) : JsonResponse | array
@@ -138,39 +115,17 @@ class AssetsController extends Controller
'asset_eol_date',
'requestable',
'jobtitle',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'company',
'model',
'location',
'rtd_location',
'category',
'status_label',
'manufacturer',
'supplier',
'jobtitle',
'assigned_to',
'created_by',
];
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
foreach ($all_custom_fields as $field) {
$allowed_columns[] = $field->db_column_name();
}
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
}
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
foreach ($all_custom_fields as $field) {
$allowed_columns[] = $field->db_column_name();
}
$assets = Asset::select('assets.*')
@@ -186,7 +141,6 @@ class AssetsController extends Controller
'model.category',
'model.manufacturer',
'model.fieldset',
'model.depreciation',
'supplier'
); // it might be tempting to add 'assetlog' here, but don't. It blows up update-heavy users.
@@ -497,10 +451,9 @@ class AssetsController extends Controller
/**
* Lookup by Tag
* Returns JSON with information about an asset (by tag) for detail view.
*
* @group Assets
* @urlParam $tag string required The asset tag. Example: 1
* @param string $tag
* @since [v4.2.1]
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
@@ -533,11 +486,10 @@ class AssetsController extends Controller
}
/**
* Lookup by Serial
* Returns JSON with information about an asset (by serial) for detail view.
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @urlParam $serial string
* @param string $serial
* @since [v4.2.1]
* @return \Illuminate\Http\JsonResponse
*/
@@ -577,11 +529,10 @@ class AssetsController extends Controller
}
/**
* Show Asset
* Returns JSON with information about an asset for detail view.
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @queryParam $assetId int required The asset ID. Example: 1
* @param int $assetId
* @since [v4.0]
* @return \Illuminate\Http\JsonResponse
*/
@@ -598,13 +549,6 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
/**
* Licenses Assigned to Asset
*
* @group Assets
* @queryParam $assetId int required The asset ID. Example: 1
* @return \Illuminate\Http\JsonResponse
*/
public function licenses(Request $request, $id): array
{
$this->authorize('view', Asset::class);
@@ -617,12 +561,8 @@ class AssetsController extends Controller
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Assets
* @queryParam $search string String to search on. No-example
* @queryParam $companyId int Company ID to filter by. No-example
* @queryParam $assetStatusType string The asset status type to filter by: `RTD`. No-example
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
@@ -664,7 +604,7 @@ class AssetsController extends Controller
$asset->use_text = $asset->present()->fullName;
if (($asset->checkedOutToUser()) && ($asset->assigned)) {
$asset->use_text .= ' → ' . $asset->assigned->display_name;
$asset->use_text .= ' → ' . $asset->assigned->getFullNameAttribute();
}
@@ -680,9 +620,8 @@ class AssetsController extends Controller
/**
* Create Asset
* Accepts a POST request to create a new asset
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param \App\Http\Requests\ImageUploadRequest $request
* @since [v4.0]
@@ -776,15 +715,8 @@ class AssetsController extends Controller
/**
* Update Asset
* Accepts a POST request to update an asset
*
* @group Assets
* @queryParam model_id int The model ID to associate the asset with. Example: 1
* @queryParam company_id int The company ID to associate the asset with. Example: 1
* @queryParam rtd_location_id int The RTD location ID to associate the asset with. Example: 1
* @queryParam last_audit_date date The last audit date for the asset. Example: 2023-12-31
* @queryParam image file The image file to upload for the asset. Example: (binary)
* @param \App\Http\Requests\UpdateAssetRequest $request
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -875,10 +807,8 @@ class AssetsController extends Controller
/**
* Delete Asset
* Delete a given asset (mark as deleted).
*
* @group Assets
* @param int $id
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v4.0]
@@ -912,9 +842,8 @@ class AssetsController extends Controller
/**
* Restore Asset
* Restore a soft-deleted asset.
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v5.1.18]
@@ -941,9 +870,8 @@ class AssetsController extends Controller
}
/**
* Checkout by Asset Tag
* Checkout an asset by its tag.
*
* @group Assets
* @author [N. Butler]
* @param string $tag
* @since [v6.0.5]
@@ -957,9 +885,8 @@ class AssetsController extends Controller
}
/**
* Checkout Asset
* Checkout an asset
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v4.0]
@@ -1033,9 +960,8 @@ class AssetsController extends Controller
/**
* Checkin Asset
* Checkin an asset
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v4.0]
@@ -1119,9 +1045,8 @@ class AssetsController extends Controller
}
/**
* Checkin by Asset Tag
* Checkin an asset by asset tag
*
* @group Assets
* @author [A. Janes] [<ajanes@adagiohealth.org>]
* @since [v6.0]
*/
@@ -1144,9 +1069,8 @@ class AssetsController extends Controller
/**
* Audit Asset
* Mark an asset as audited
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
* @since [v4.0]
@@ -1270,9 +1194,8 @@ class AssetsController extends Controller
/**
* Show Requestable Assets
* Returns JSON listing of all requestable assets
*
* @group Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -1359,33 +1282,13 @@ class AssetsController extends Controller
}
/**
* List Assets Assigned to Asset
*
* @group Assets
*/
public function assignedAssets(Request $request, Asset $asset) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$this->authorize('view', $asset);
$query = Asset::where([
'assigned_to' => $asset->id,
'assigned_type' => Asset::class,
]);
$total = $query->count();
$assets = $query->applyOffsetAndLimit($total)->get();
return (new AssetsTransformer)->transformAssets($assets, $total);
return [];
// to do
}
/**
* List Accessories Assigned to Asset
*
* @group Assets
*/
public function assignedAccessories(Request $request, Asset $asset) : JsonResponse | array
{
$this->authorize('view', Asset::class);
@@ -1403,29 +1306,12 @@ class AssetsController extends Controller
return (new AssetsTransformer)->transformCheckedoutAccessories($accessory_checkouts, $total);
}
/**
* List Components Assigned to Asset
*
* @group Assets
*/
public function assignedComponents(Request $request, Asset $asset): JsonResponse|array
{
$this->authorize('view', Asset::class);
$this->authorize('view', $asset);
$asset->loadCount('components');
$total = $asset->components_count;
$components = $asset->load(['components' => fn($query) => $query->applyOffsetAndLimit($total)])->components;
return (new ComponentsTransformer)->transformComponents($components, $total);
}
/**
* Generate Label by Asset Tag
*
* @group Assets
* Generate asset labels by tag
*
* @author [Nebelkreis] [https://github.com/NebelKreis]
*
* @param Request $request Contains asset_tags array of asset tags to generate labels for
* @return JsonResponse Returns base64 encoded PDF on success, error message on failure
*/

View File

@@ -15,9 +15,8 @@ use Illuminate\Support\Facades\Storage;
class CategoriesController extends Controller
{
/**
* List Categories
* Display a listing of the resource.
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
@@ -39,8 +38,6 @@ class CategoriesController extends Controller
'consumables_count',
'components_count',
'licenses_count',
'created_at',
'updated_at',
'image',
'notes',
];
@@ -62,23 +59,6 @@ class CategoriesController extends Controller
->withCount('accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count', 'models as models_count');
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$categories->ByFilter($filter);
} elseif ($request->filled('search')) {
$categories->TextSearch($request->input('search'));
}
/*
* This checks to see if we should override the Admin Setting to show archived assets in list.
* We don't currently use it within the Snipe-IT GUI, but will be useful for API integrations where they
@@ -92,6 +72,10 @@ class CategoriesController extends Controller
$categories = $categories->withCount('showableAssets as assets_count');
}
if ($request->filled('search')) {
$categories = $categories->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$categories->where('name', '=', $request->input('name'));
}
@@ -149,9 +133,8 @@ class CategoriesController extends Controller
/**
* Create Category
* Store a newly created resource in storage.
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -173,9 +156,8 @@ class CategoriesController extends Controller
}
/**
* Show Category
* Display the specified resource.
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -190,9 +172,8 @@ class CategoriesController extends Controller
/**
* Update Category
* Update the specified resource in storage.
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -221,9 +202,8 @@ class CategoriesController extends Controller
}
/**
* Delete Category
* Remove the specified resource from storage.
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -246,9 +226,8 @@ class CategoriesController extends Controller
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Categories
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -14,11 +14,6 @@ use Exception;
class CheckoutRequest extends Controller
{
/**
* Store Asset Request
*
* @group Account
*/
public function store(Asset $asset): JsonResponse
{
try {
@@ -34,11 +29,6 @@ class CheckoutRequest extends Controller
}
}
/**
* Cancel Asset Request
*
* @group Account
*/
public function destroy(Asset $asset): JsonResponse
{
try {

View File

@@ -15,9 +15,8 @@ use Illuminate\Http\JsonResponse;
class CompaniesController extends Controller
{
/**
* List Companies
* Display a listing of the resource.
*
* @group Companies
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -91,12 +90,11 @@ class CompaniesController extends Controller
/**
* Create Company
* Store a newly created resource in storage.
*
* @group Companies
* @param \App\Http\Requests\ImageUploadRequest $request
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
*/
public function store(ImageUploadRequest $request) : JsonResponse
{
@@ -114,12 +112,11 @@ class CompaniesController extends Controller
}
/**
* Show Company
* Display the specified resource.
*
* @group Companies
* @param int $id
* @since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function show($id) : array
{
@@ -132,13 +129,12 @@ class CompaniesController extends Controller
/**
* Update Company
* Update the specified resource in storage.
*
* @group Companies
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
* @param int $id
*@author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
public function update(ImageUploadRequest $request, $id) : JsonResponse
{
@@ -158,12 +154,11 @@ class CompaniesController extends Controller
}
/**
* Delete Company
* Remove the specified resource from storage.
*
* @group Companies
* @param int $id
* @since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function destroy($id) : JsonResponse
{
@@ -182,9 +177,8 @@ class CompaniesController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Companies
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -20,9 +20,8 @@ use Carbon\Carbon;
class ComponentsController extends Controller
{
/**
* List Categories
* Display a listing of the resource.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*
@@ -46,40 +45,16 @@ class ComponentsController extends Controller
'qty',
'image',
'notes',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'company',
'location',
'category',
'manufacturer',
'supplier',
];
$components = Component::select('components.*')
->with('company', 'location', 'category', 'assets', 'supplier', 'adminuser', 'manufacturer', 'uncontrainedAssets')
->withSum('uncontrainedAssets', 'components_assets.assigned_qty');
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
if ($request->filled('search')) {
$components = $components->TextSearch($request->input('search'));
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$components->ByFilter($filter);
} elseif ($request->filled('search')) {
$components->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$components->where('name', '=', $request->input('name'));
}
@@ -152,9 +127,8 @@ class ComponentsController extends Controller
/**
* Create Component
* Store a newly created resource in storage.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -174,9 +148,8 @@ class ComponentsController extends Controller
}
/**
* Show Component
* Display the specified resource.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
@@ -191,9 +164,8 @@ class ComponentsController extends Controller
}
/**
* Update Component
* Update the specified resource in storage.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -215,9 +187,8 @@ class ComponentsController extends Controller
}
/**
* Delete Component
* Remove the specified resource from storage.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -238,9 +209,8 @@ class ComponentsController extends Controller
}
/**
* Component Assets
* Display all assets attached to a component
*
* @group Components
* @author [A. Bergamasco] [@vjandrea]
* @since [v4.0]
* @param Request $request
@@ -280,10 +250,10 @@ class ComponentsController extends Controller
/**
* Checkout Component
* Validate and checkout the component.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* t
* @since [v5.1.8]
* @param Request $request
* @param int $componentId
@@ -335,9 +305,8 @@ class ComponentsController extends Controller
}
/**
* Checkin Component
* Validate and store checkin data.
*
* @group Components
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.1.8]
* @param Request $request

View File

@@ -19,21 +19,8 @@ use Illuminate\Http\JsonResponse;
class ConsumablesController extends Controller
{
/**
* List Consumables
* Display a listing of the resource.
*
* @group Consumables
* @queryParam filter string A JSON encoded array of key/value pairs to filter results by. Example: {"company":"1","location":"2"}
* @queryParam search string A search term to filter results by.
* @queryParam name string Filter by exact name.
* @queryParam company_id integer Filter by exact company ID.
* @queryParam category_id integer Filter by exact category ID.
* @queryParam model_number string Filter by exact model number.
* @queryParam manufacturer_id integer Filter by exact manufacturer ID.
* @queryParam supplier_id integer Filter by exact supplier ID.
* @queryParam location_id integer Filter by exact location ID.
* @queryParam notes string Filter by exact notes.
* @queryParam sort string The column to sort results by. Must be one of the following: id, name, order_number, min_amt, purchase_date, purchase_cost, company, category, model_number, item_no, manufacturer, location, qty, image, company, location, category, supplier, manufacturer. Default is created_at.
* @queryParam order string The order to sort results by. Must be one of the following: asc, desc. Default is desc.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -44,53 +31,10 @@ class ConsumablesController extends Controller
$consumables = Consumable::with('company', 'location', 'category', 'supplier', 'manufacturer')
->withCount('users as consumables_users_count');
// This array is what determines which fields should be allowed to be sorted on ON the table itself.
// These must match a column on the consumables table directly.
$allowed_columns = [
'id',
'name',
'order_number',
'min_amt',
'purchase_date',
'purchase_cost',
'company',
'category',
'model_number',
'item_no',
'manufacturer',
'location',
'qty',
'image',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'company',
'location',
'category',
'supplier',
'manufacturer',
];
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
if ($request->filled('search')) {
$consumables = $consumables->TextSearch(e($request->input('search')));
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$consumables->ByFilter($filter);
} elseif ($request->filled('search')) {
$consumables->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$consumables->where('name', '=', $request->input('name'));
}
@@ -152,6 +96,25 @@ class ConsumablesController extends Controller
$consumables = $consumables->OrderByCreatedBy($order);
break;
default:
// This array is what determines which fields should be allowed to be sorted on ON the table itself.
// These must match a column on the consumables table directly.
$allowed_columns = [
'id',
'name',
'order_number',
'min_amt',
'purchase_date',
'purchase_cost',
'company',
'category',
'model_number',
'item_no',
'manufacturer',
'location',
'qty',
'image'
];
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$consumables = $consumables->orderBy($sort, $order);
break;
@@ -166,7 +129,6 @@ class ConsumablesController extends Controller
/**
* Store a newly created resource in storage.
*
* @group Consumables
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -186,9 +148,8 @@ class ConsumablesController extends Controller
}
/**
* Show Consumable
* Display the specified resource.
*
* @group Consumables
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
@@ -201,9 +162,8 @@ class ConsumablesController extends Controller
}
/**
* Update Consumable
* Update the specified resource in storage.
*
* @group Consumables
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -224,9 +184,8 @@ class ConsumablesController extends Controller
}
/**
* Delete Consumable
* Remove the specified resource from storage.
*
* @group Consumables
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -242,9 +201,8 @@ class ConsumablesController extends Controller
}
/**
* User Assignments
* Returns a JSON response containing details on the users associated with this consumable.
*
* @group Consumables
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see \App\Http\Controllers\Consumables\ConsumablesController::getView() method that returns the form.
* @since [v1.0]
@@ -270,16 +228,11 @@ class ConsumablesController extends Controller
foreach ($consumable->consumableAssignments as $consumable_assignment) {
$rows[] = [
'avatar' => ($consumable_assignment->user) ? e($consumable_assignment->user->present()->gravatar) : '',
'user' => ($consumable_assignment->user) ? [
'id' => (int) $consumable_assignment->user->id,
'name'=> e($consumable_assignment->user->display_name),
] : null,
'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User',
'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'),
'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null,
'created_by' => ($consumable_assignment->adminuser) ? [
'id' => (int) $consumable_assignment->adminuser->id,
'name'=> e($consumable_assignment->adminuser->display_name),
] : null,
'admin' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null, // legacy, so we don't change the shape of the response
'created_by' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null,
];
}
@@ -290,9 +243,8 @@ class ConsumablesController extends Controller
}
/**
* Checkout Consumable
* Checkout a consumable
*
* @group Consumables
* @author [A. Gutierrez] [<andres@baller.tv>]
* @param int $id
* @since [v4.9.5]
@@ -353,9 +305,8 @@ class ConsumablesController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Consumables
* @see \App\Http\Transformers\SelectlistTransformer
*/
public function selectlist(Request $request) : array

View File

@@ -14,9 +14,8 @@ use Illuminate\Http\JsonResponse;
class CustomFieldsController extends Controller
{
/**
* List Custom Fields
* Reorder the custom fields within a fieldset
*
* @group Custom Fields
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v3.0]
@@ -31,9 +30,7 @@ class CustomFieldsController extends Controller
}
/**
* Show Field
*
* @group Custom Fields
* Shows the given field
* @author [V. Cordes] [<volker@fdatek.de>]
* @param int $id
* @since [v4.1.10]
@@ -49,9 +46,8 @@ class CustomFieldsController extends Controller
}
/**
* Update Field
* Update the specified field
*
* @group Custom Fields
* @author [V. Cordes] [<volker@fdatek.de>]
* @since [v4.1.10]
* @param \Illuminate\Http\Request $request
@@ -84,9 +80,8 @@ class CustomFieldsController extends Controller
}
/**
* Create Field
* Store a newly created field.
*
* @group Custom Fields
* @author [V. Cordes] [<volker@fdatek.de>]
* @since [v4.1.10]
* @param \Illuminate\Http\Request $request
@@ -117,12 +112,6 @@ class CustomFieldsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $field->getErrors()));
}
/**
* Reorder Fields
*
* @group Custom Fields
* @param \Illuminate\Http\Request $request
*/
public function postReorder(Request $request, $id)
{
$fieldset = CustomFieldset::find($id);
@@ -145,12 +134,6 @@ class CustomFieldsController extends Controller
return $fieldset->fields()->sync($fields);
}
/**
* Add Field to Fieldset
*
* @group Custom Fields
* @param \Illuminate\Http\Request $request
*/
public function associate(Request $request, $field_id) : JsonResponse
{
$this->authorize('update', CustomFieldset::class);
@@ -170,12 +153,6 @@ class CustomFieldsController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.update.success')));
}
/**
* Remove Field from Fieldset
*
* @group Custom Fields
* @param \Illuminate\Http\Request $request
*/
public function disassociate(Request $request, $field_id) : JsonResponse
{
$this->authorize('update', CustomFieldset::class);
@@ -195,9 +172,8 @@ class CustomFieldsController extends Controller
}
/**
* Delete Field
* Delete a custom field.
*
* @group Custom Fields
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
*/

View File

@@ -24,10 +24,7 @@ use Illuminate\Http\JsonResponse;
class CustomFieldsetsController extends Controller
{
/**
* List Fieldsets
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
@@ -42,13 +39,10 @@ class CustomFieldsetsController extends Controller
}
/**
* Show Fieldset and Fields
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @param int $id
* @author [Josh Gibson]
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
* @since [v1.8]
*/
public function show($id) : JsonResponse | array
@@ -62,14 +56,12 @@ class CustomFieldsetsController extends Controller
}
/**
* Update Fieldset
* Update the specified resource in storage.
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
* @param int $id
*@author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
public function update(Request $request, $id) : JsonResponse
{
@@ -85,13 +77,11 @@ class CustomFieldsetsController extends Controller
}
/**
* Create Fieldset
* Store a newly created resource in storage.
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @param \Illuminate\Http\Request $request
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
*/
public function store(Request $request) : JsonResponse
{
@@ -119,10 +109,8 @@ class CustomFieldsetsController extends Controller
}
/**
* Delete Fieldset
* Delete a custom fieldset.
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -146,14 +134,12 @@ class CustomFieldsetsController extends Controller
}
/**
* Show Fields in Fieldset
* Return JSON containing a list of fields belonging to a fieldset.
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @param $fieldsetId
* @return string JSON
* @author [V. Cordes] [<volker@fdatek.de>]
* @since [v4.1.10]
* @param $fieldsetId
* @return string JSON
*/
public function fields($id) : array
{
@@ -165,10 +151,9 @@ class CustomFieldsetsController extends Controller
}
/**
* Fields in Fieldset with Default Values for Model
* Return JSON containing a list of fields belonging to a fieldset with the
* default values for a given model
*
* @group Custom Fields
* @subgroup Custom Fieldsets
* @param $modelId
* @param $fieldsetId
* @return string JSON

View File

@@ -15,18 +15,8 @@ use Illuminate\Http\JsonResponse;
class DepartmentsController extends Controller
{
/**
* List Departments
* Display a listing of the resource.
*
* @group Departments
* @queryParam search string Search term to filter results. Example: IT
* @queryParam name string Filter by exact department name. Example: IT
* @queryParam company_id integer Filter by exact company ID. Example: 1
* @queryParam manager_id integer Filter by exact manager (user) ID. Example:
* @queryParam location_id integer Filter by exact location ID. Example: 1
* @queryParam sort string Column to sort results by. Allowed values: id, name, image, users_count, notes, created_at, updated_at, location, manager, company. Default: created_at. Example: name
* @queryParam order string Order of sorted results. Allowed values: asc, desc. Default: desc. Example: asc
* @queryParam offset integer Offset/starting position of the results. Default: 0. Example: 0
* @queryParam limit integer Limit the number of results returned. Default: 25. Maximum: 100. Example: 50
* @author [Godfrey Martinez] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -98,9 +88,8 @@ class DepartmentsController extends Controller
}
/**
* Create Department
* Store a newly created resource in storage.
*
* @group Departments
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -123,9 +112,8 @@ class DepartmentsController extends Controller
}
/**
* Show Department
* Display the specified resource.
*
* @group Departments
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -138,9 +126,8 @@ class DepartmentsController extends Controller
}
/**
* Update Department
* Update the specified resource in storage.
*
* @group Departments
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -162,9 +149,8 @@ class DepartmentsController extends Controller
/**
* Delete Department
* Validates and deletes selected department.
*
* @group Departments
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $locationId
* @since [v4.0]
@@ -185,9 +171,8 @@ class DepartmentsController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Departments
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -12,9 +12,8 @@ use Illuminate\Http\JsonResponse;
class DepreciationsController extends Controller
{
/**
* List Depreciations
* Display a listing of the resource.
*
* @group Depreciations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -66,9 +65,8 @@ class DepreciationsController extends Controller
}
/**
* Create Depreciation
* Store a newly created resource in storage.
*
* @group Depreciations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -87,9 +85,8 @@ class DepreciationsController extends Controller
}
/**
* Show Depreciation
* Display the specified resource.
*
* @group Depreciations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -103,9 +100,8 @@ class DepreciationsController extends Controller
}
/**
* Update Depreciation
* Update the specified resource in storage.
*
* @group Depreciations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -125,9 +121,8 @@ class DepreciationsController extends Controller
}
/**
* Delete Depreciation
* Remove the specified resource from storage.
*
* @group Depreciations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id

View File

@@ -15,7 +15,6 @@ class GroupsController extends Controller
/**
* Display a listing of the resource.
*
* @group User Groups
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -66,9 +65,8 @@ class GroupsController extends Controller
}
/**
* Create Group
* Store a newly created resource in storage.
*
* @group User Groups
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -94,9 +92,8 @@ class GroupsController extends Controller
}
/**
* Show Group
* Display the specified resource.
*
* @group User Groups
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -109,9 +106,8 @@ class GroupsController extends Controller
}
/**
* Update Group
* Update the specified resource in storage.
*
* @group User Groups
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -136,7 +132,6 @@ class GroupsController extends Controller
/**
* Remove the specified resource from storage.
*
* @group User Groups
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id

View File

@@ -24,9 +24,8 @@ use Illuminate\Http\JsonResponse;
class ImportController extends Controller
{
/**
* List Import Files
* Display a listing of the resource.
*
* @group Imports
*/
public function index() : JsonResponse | array
{
@@ -36,9 +35,8 @@ class ImportController extends Controller
}
/**
* Save Import File
* Process and store a CSV upload file.
*
* @group Imports
* @param \Illuminate\Http\Request $request
*/
public function store() : JsonResponse
@@ -71,7 +69,7 @@ class ImportController extends Controller
if (function_exists('iconv')) {
$file_contents = $file->getContent(); //TODO - this *does* load the whole file in RAM, but we need that to be able to 'iconv' it?
$encoding = $detector->getEncoding($file_contents);
\Log::debug("Discovered encoding: $encoding in uploaded CSV");
\Log::warning("Discovered encoding: $encoding in uploaded CSV");
$reader = null;
if (strcasecmp($encoding, 'UTF-8') != 0) {
$transliterated = false;
@@ -105,7 +103,7 @@ class ImportController extends Controller
$reader = Reader::createFromFileObject($file->openFile('r')); //file pointer leak?
try {
$import->header_row = $reader->nth(0);
$import->header_row = $reader->fetchOne(0);
} catch (JsonEncodingException $e) {
return response()->json(
Helper::formatStandardApiResponse(
@@ -138,7 +136,7 @@ class ImportController extends Controller
try {
// Grab the first row to display via ajax as the user picks fields
$import->first_row = $reader->nth(1);
$import->first_row = $reader->fetchOne(1);
} catch (JsonEncodingException $e) {
return response()->json(
Helper::formatStandardApiResponse(
@@ -186,9 +184,8 @@ class ImportController extends Controller
}
/**
* Process Import
* Processes the specified Import.
*
* @group Imports
* @param int $import_id
*/
public function process(ItemImportRequest $request, $import_id) : JsonResponse
@@ -198,7 +195,7 @@ class ImportController extends Controller
// Run a backup immediately before processing
if ($request->get('run-backup')) {
Log::debug('Backup manually requested via importer');
Artisan::call('snipeit:backup', ['--filename' => 'pre-import-backup-'.date('Y-m-d-H-i-s')]);
Artisan::call('snipeit:backup', ['--filename' => 'pre-import-backup-'.date('Y-m-d-H:i:s')]);
} else {
Log::debug('NO BACKUP requested via importer');
}
@@ -258,9 +255,8 @@ class ImportController extends Controller
}
/**
* Delete Import File
* Remove the specified resource from storage.
*
* @group Imports
* @param int $import_id
*/
public function destroy($import_id) : JsonResponse

View File

@@ -13,9 +13,8 @@ use Illuminate\Http\JsonResponse;
class LabelsController extends Controller
{
/**
* List Labels
* Returns JSON listing of all labels.
*
* @group Labels
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
*/
public function index(Request $request) : JsonResponse | array
@@ -46,9 +45,8 @@ class LabelsController extends Controller
}
/**
* Show Label
* Returns JSON with information about a label for detail view.
*
* @group Labels
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @param string $labelName
*/

View File

@@ -15,10 +15,8 @@ use Illuminate\Http\Request;
class LicenseSeatsController extends Controller
{
/**
* List License Seats
* Display a listing of the resource.
*
* @group Licenses
* @subgroup License Seats
* @param \Illuminate\Http\Request $request
* @param int $licenseId
*/
@@ -70,10 +68,8 @@ class LicenseSeatsController extends Controller
}
/**
* Show License Seat
* Display the specified resource.
*
* @group Licenses
* @subgroup License Seats
* @param int $licenseId
* @param int $seatId
*/
@@ -95,10 +91,8 @@ class LicenseSeatsController extends Controller
}
/**
* Update License Seat
* Update the specified resource in storage.
*
* @group Licenses
* @subgroup License Seats
* @param \Illuminate\Http\Request $request
* @param int $licenseId
* @param int $seatId
@@ -134,9 +128,7 @@ class LicenseSeatsController extends Controller
// nothing to update
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
if( $touched && $licenseSeat->unreassignable_seat) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/licenses/message.checkout.unavailable')));
}
// the logging functions expect only one "target". if both asset and user are present in the request,
// we simply let assets take precedence over users...
if ($licenseSeat->isDirty('assigned_to')) {
@@ -153,11 +145,7 @@ class LicenseSeatsController extends Controller
if ($licenseSeat->save()) {
if ($is_checkin) {
if(!$licenseSeat->license->reassignable){
$licenseSeat->unreassignable_seat = true;
$licenseSeat->save();
}
$licenseSeat->logCheckin($target, $licenseSeat->notes);
$licenseSeat->logCheckin($target, $request->input('notes'));
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}

View File

@@ -7,7 +7,6 @@ use App\Http\Controllers\Controller;
use App\Http\Transformers\LicensesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\License;
use App\Models\Setting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\JsonResponse;
@@ -15,17 +14,8 @@ use Illuminate\Http\JsonResponse;
class LicensesController extends Controller
{
/**
* List Licenses
* Display a listing of the resource.
*
* @group Licenses
* @queryParam status string Filter by license status. Options: active, inactive, expiring Example: ?status=active
* @queryParam company_id integer Filter by exact company ID. Example: 1
* @queryParam name string Filter by exact license name. Example: Microsoft 365
* @queryParam product_key string Filter by exact product key. Example: W269N
* @queryParam order_number string Filter by exact order number. Example: 12345
* @queryParam purchase_order string Filter by exact purchase order. Example: PO12345
* @queryParam license_name string Filter by exact licensee name. Example: John Doe
* @queryParam license_email string Filter by exact licensee email. Example: john.d
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*
@@ -35,15 +25,6 @@ class LicensesController extends Controller
$this->authorize('view', License::class);
$licenses = License::with('company', 'manufacturer', 'supplier','category', 'adminuser')->withCount('freeSeats as free_seats_count');
$settings = Setting::getSettings();
if ($request->input('status')=='inactive') {
$licenses->ExpiredLicenses();
} elseif ($request->input('status')=='expiring') {
$licenses->ExpiringLicenses($settings->alert_interval);
} else {
$licenses->ActiveLicenses();
}
if ($request->filled('company_id')) {
$licenses->where('licenses.company_id', '=', $request->input('company_id'));
@@ -113,8 +94,6 @@ class LicensesController extends Controller
$licenses->onlyTrashed();
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $licenses->count()) ? $licenses->count() : app('api_offset_value');
$limit = app('api_limit_value');
@@ -175,9 +154,8 @@ class LicensesController extends Controller
}
/**
* Create License
* Store a newly created resource in storage.
*
* @group Licenses
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -196,9 +174,8 @@ class LicensesController extends Controller
}
/**
* Show License
* Display the specified resource.
*
* @group Licenses
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
@@ -212,9 +189,8 @@ class LicensesController extends Controller
}
/**
* Update License
* Update the specified resource in storage.
*
* @group Licenses
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -236,9 +212,8 @@ class LicensesController extends Controller
}
/**
* Delete License
* Remove the specified resource from storage.
*
* @group Licenses
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -266,9 +241,8 @@ class LicensesController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Licenses
* @see \App\Http\Transformers\SelectlistTransformer
*/
public function selectlist(Request $request) : array

View File

@@ -23,26 +23,11 @@ use Illuminate\Support\Collection;
class LocationsController extends Controller
{
/**
* List Locations
* Display a listing of the resource.
*
* @group Locations
* @queryParam search string Search term to filter results. Example: Headquarters
* @queryParam name string Filter by exact location name. Example: Headquarters
* @queryParam address string Filter by exact address. Example: 123 Main St
* @queryParam address2 string Filter by exact address2. Example: Suite 100
* @queryParam city string Filter by exact city. Example: Springfield
* @queryParam zip string Filter by exact zip code. Example: 12345
* @queryParam country string Filter by exact country. Example: USA
* @queryParam manager_id integer Filter by exact manager (user) ID. Example: 1
* @queryParam company_id integer Filter by exact company ID. Example: 1
* @queryParam parent_id integer Filter by exact parent location ID. Example: 1
* @queryParam status string Filter by location status. Allowed values: active, deleted. Example: active
* @queryParam sort string Column to sort results by. Allowed values: accessorries_count, address, address2, assets_count, assigned_assets_count, rtd_assets_count, accessories_count, assigned_accessories_count, components_count, consumables_count, users_count, children_count, city, country, created_at, currency, id, image, ldap_ou, company_id, manager_id, name, rtd_assets_count, state, updated_at, zip. Default: created_at. Example: name
* @queryParam order string Order of sorted results. Allowed values: asc, desc. Default: desc. Example: asc
*
* @return \Illuminate\Http\Response
* @since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
*/
public function index(Request $request) : JsonResponse | array
{
@@ -52,14 +37,10 @@ class LocationsController extends Controller
'address',
'address2',
'assets_count',
'assigned_assets_count',
'rtd_assets_count',
'accessories_count',
'assets_count',
'assigned_accessories_count',
'components_count',
'consumables_count',
'users_count',
'children_count',
'assigned_assets_count',
'assigned_assets_count',
'city',
'country',
'created_at',
@@ -73,6 +54,7 @@ class LocationsController extends Controller
'rtd_assets_count',
'state',
'updated_at',
'users_count',
'zip',
'notes',
];
@@ -97,9 +79,8 @@ class LocationsController extends Controller
'locations.currency',
'locations.company_id',
'locations.notes',
'locations.created_by',
'locations.deleted_at',
])
->withCount('assignedAssets as assigned_assets_count')
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('assignedAccessories as assigned_accessories_count')
@@ -107,8 +88,6 @@ class LocationsController extends Controller
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')
->withCount('consumables as consumables_count')
->withCount('components as components_count')
->with('adminuser');
// Only scope locations if the setting is enabled
@@ -152,14 +131,6 @@ class LocationsController extends Controller
$locations->where('locations.company_id', '=', $request->input('company_id'));
}
if ($request->filled('parent_id')) {
$locations->where('locations.parent_id', '=', $request->input('parent_id'));
}
if ($request->input('status') == 'deleted') {
$locations->onlyTrashed();
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $locations->count()) ? $locations->count() : app('api_offset_value');
$limit = app('api_limit_value');
@@ -167,6 +138,8 @@ class LocationsController extends Controller
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
switch ($request->input('sort')) {
case 'parent':
$locations->OrderParent($order);
@@ -191,9 +164,8 @@ class LocationsController extends Controller
/**
* Create Location
* Store a newly created resource in storage.
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -222,9 +194,8 @@ class LocationsController extends Controller
}
/**
* Show Location
* Display the specified resource.
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -253,13 +224,8 @@ class LocationsController extends Controller
])
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('assignedAccessories as assigned_accessories_count')
->withCount('accessories as accessories_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')
->withCount('consumables as consumables_count')
->withCount('components as components_count')
->findOrFail($id);
return (new LocationsTransformer)->transformLocation($location);
@@ -267,9 +233,8 @@ class LocationsController extends Controller
/**
* Update Location
* Update the specified resource in storage.
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -311,13 +276,7 @@ class LocationsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
}
/**
* Show Assets with Default Location
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
public function assets(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Asset::class);
@@ -327,13 +286,6 @@ class LocationsController extends Controller
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
/**
* Show Assets Assigned to Location
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
public function assignedAssets(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Asset::class);
@@ -343,13 +295,6 @@ class LocationsController extends Controller
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
/**
* Show Accessories Assigned to Location
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
public function assignedAccessories(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Accessory::class);
@@ -365,9 +310,8 @@ class LocationsController extends Controller
}
/**
* Delete Location
* Remove the specified resource from storage.
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -376,15 +320,11 @@ class LocationsController extends Controller
{
$this->authorize('delete', Location::class);
$location = Location::withCount('assignedAssets as assigned_assets_count')
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('assignedAccessories as assigned_accessories_count')
->withCount('accessories as accessories_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')
->withCount('consumables as consumables_count')
->withCount('components as components_count')
->withCount('accessories as accessories_count')
->findOrFail($id);
if (! $location->isDeletable()) {
@@ -421,7 +361,6 @@ class LocationsController extends Controller
* Recursion still sucks, but I guess he doesn't have to get in the
* sea... this time.
*
* @group Locations
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -16,20 +16,8 @@ use Illuminate\Http\JsonResponse;
class ManufacturersController extends Controller
{
/**
* List Manufacturers
* Display a listing of the resource.
*
* @group Manufacturers
* @queryParam search string Search term to filter results. Example: Dell
* @queryParam name string Filter by exact manufacturer name. Example: Dell
* @queryParam url string Filter by exact URL. Example: http://example.com
* @queryParam support_url string Filter by exact support URL. Example: http://support.example.com
* @queryParam warranty_lookup_url string Filter by exact warranty lookup URL. Example: http://warranty.example.com
* @queryParam support_phone string Filter by exact support phone number. Example: 1-800-555-5555
* @queryParam support_email string Filter by exact support email address. Example: support@example.org
* @queryParam sort string Column to sort results by. Allowed values: id, name, url, support_url, support_email, warranty_lookup_url, support_phone, created_at, updated_at, assets_count, consumables_count, components_count, licenses_count. Default: created_at. Example: name
* @queryParam order string Order of sorted results. Allowed values: asc, desc. Default: desc. Example: asc
* @queryParam offset integer Offset/starting position of the results. Default: 0. Example: 0
* @queryParam limit integer Limit the number of results returned. Default: 25. Maximum: 100. Example: 50
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
@@ -132,9 +120,8 @@ class ManufacturersController extends Controller
}
/**
* Create Maintenance
* Store a newly created resource in storage.
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -154,9 +141,8 @@ class ManufacturersController extends Controller
}
/**
* Show Manufacturer
* Display the specified resource.
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -170,9 +156,8 @@ class ManufacturersController extends Controller
}
/**
* Update Manufacturer
* Update the specified resource in storage.
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -193,9 +178,8 @@ class ManufacturersController extends Controller
}
/**
* Delete Manufacturer
* Remove the specified resource from storage.
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -216,9 +200,8 @@ class ManufacturersController extends Controller
}
/**
* Restore Deleted Manufacturer
* Restore a given Manufacturer (mark as un-deleted)
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.3.4]
* @param int $id
@@ -254,9 +237,8 @@ class ManufacturersController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Manufacturers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -1,99 +0,0 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
/**
* This class controls all API actions related to notes for
* the Snipe-IT Asset Management application.
*/
class NotesController extends Controller
{
/**
* List Notes
*
* Checks authorization to view assets, attempts to find the asset by ID,
* and fetches related action log entries of type 'note added', including
* user information for each note. Returns a JSON response with the notes or errors.
*
* @group Notes
* @subgroup Assets
* @param \Illuminate\Http\Request $request The incoming HTTP request.
* @param Asset $asset The ID of the asset whose notes to retrieve.
* @return \Illuminate\Http\JsonResponse
*/
public function index(Asset $asset): JsonResponse
{
$this->authorize('view', $asset);
// Get the manual notes for the asset
$notes = ActionLog::with('user:id,username')
->where('item_type', Asset::class)
->where('item_id', $asset->id)
->where('action_type', 'note added')
->orderBy('created_at', 'desc')
->get(['id', 'created_at', 'note', 'created_by', 'item_id', 'item_type', 'action_type', 'target_id', 'target_type']);
$notesArray = $notes->map(function ($note) {
return [
'id' => $note->id,
'created_at' => $note->created_at,
'note' => $note->note,
'created_by' => $note->created_by,
'username' => $note->user?->username, // adding the username
'item_id' => $note->item_id,
'item_type' => $note->item_type,
'action_type' => $note->action_type,
];
});
// Return a success response
return response()->json(Helper::formatStandardApiResponse('success', ['notes' => $notesArray, 'asset_id' => $asset->id]));
}
/**
* Store Note
*
* Checks authorization for updating assets, validates the presence of the 'note',
* attempts to find the asset by ID, and creates a new ActionLog entry if successful.
* Returns JSON responses indicating success or failure with appropriate HTTP status codes.
*
* @group Notes
* @subgroup Assets
* @param \Illuminate\Http\Request $request The incoming HTTP request containing the 'note'.
* @param Asset $asset The ID of the asset to attach the note to.
* @return \Illuminate\Http\JsonResponse
*/
public function store(Request $request, Asset $asset): JsonResponse
{
$this->authorize('update', $asset);
if ($request->input('note', '') == '') {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('validation.required', ['attribute' => 'note'])), 422);
}
// Create the note
$logaction = new ActionLog();
$logaction->item_type = get_class($asset);
$logaction->created_by = Auth::id();
$logaction->item_id = $asset->id;
$logaction->note = $request->input('note', '');
if ($logaction->logaction('note added')) {
// Return a success response
return response()->json(Helper::formatStandardApiResponse('success', ['note' => $logaction->note, 'item_id' => $asset->id], trans('general.note_added')));
}
// Return an error response if something went wrong
return response()->json(Helper::formatStandardApiResponse('error', null, 'Something went wrong'), 500);
}
}

View File

@@ -16,9 +16,8 @@ use App\Http\Transformers\SelectlistTransformer;
class PredefinedKitsController extends Controller
{
/**
* List Kits
* Display a listing of the resource.
*
* @group Predefined Kits
* @return \Illuminate\Http\Response
*/
public function index(Request $request) : JsonResponse | array
@@ -63,9 +62,8 @@ class PredefinedKitsController extends Controller
}
/**
* Create Kit
* Store a newly created resource in storage.
*
* @group Predefined Kits
* @param \Illuminate\Http\Request $request
*/
public function store(Request $request) : JsonResponse
@@ -82,10 +80,9 @@ class PredefinedKitsController extends Controller
}
/**
* Show Kit
* Display the specified resource.
*
* @group Predefined Kits
* @urlParam $id int required The ID of the kit. Example: 1
* @param int $id
*/
public function show($id) : array
{
@@ -96,10 +93,10 @@ class PredefinedKitsController extends Controller
}
/**
* Update Kit
* Update the specified resource in storage.
*
* @group Predefined Kits
* @urlParam $id int required The ID of the kit. Example: 1
* @param \Illuminate\Http\Request $request
* @param int $id kit id
*/
public function update(Request $request, $id) : JsonResponse
{
@@ -115,10 +112,9 @@ class PredefinedKitsController extends Controller
}
/**
* Delete Kit
* Remove the specified resource from storage.
*
* @group Predefined Kits
* @urlParam $id int required The ID of the kit. Example: 1
* @param int $id
*/
public function destroy($id) : JsonResponse
{
@@ -137,9 +133,8 @@ class PredefinedKitsController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Predefined Kits
* @see \App\Http\Transformers\SelectlistTransformer
*/
public function selectlist(Request $request) : array
@@ -159,10 +154,9 @@ class PredefinedKitsController extends Controller
}
/**
* List Licenses in Kit
* Display the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @param int $id
* @return \Illuminate\Http\Response
*/
public function indexLicenses($kit_id) : array
@@ -175,12 +169,9 @@ class PredefinedKitsController extends Controller
}
/**
* Add License to Kit
* Store the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @bodyParam license int required The ID of the license. Example: 1
* @bodyParam quantity int The quantity of the license. Example: 1
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeLicense(Request $request, $kit_id) : JsonResponse
@@ -205,11 +196,10 @@ class PredefinedKitsController extends Controller
}
/**
* Update License in Kit
* Update the specified resource in storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $license_id int required The ID of the license. Example: 1
* @param \Illuminate\Http\Request $request
* @param int $kit_id
*/
public function updateLicense(Request $request, $kit_id, $license_id) : JsonResponse
{
@@ -225,11 +215,9 @@ class PredefinedKitsController extends Controller
}
/**
* Remove License from Kit
* Remove the specified resource from storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $license_id int required The ID of the license. Example: 1
* @param int $kit_id
*/
public function detachLicense($kit_id, $license_id) : JsonResponse
{
@@ -242,10 +230,9 @@ class PredefinedKitsController extends Controller
}
/**
* List Models in Kit
* Display the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @param int $kit_id
*/
public function indexModels($kit_id) : array
{
@@ -257,11 +244,9 @@ class PredefinedKitsController extends Controller
}
/**
* Add Model to Kit
* Store the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @bodyParam model int required The ID of the model. Example: 1
* @param int $id
*/
public function storeModel(Request $request, $kit_id) : JsonResponse
{
@@ -285,11 +270,10 @@ class PredefinedKitsController extends Controller
}
/**
* Update Model in Kit
* Update the specified resource in storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @bodyParam quantity int required The quantity of the model. Example: 1
* @param \Illuminate\Http\Request $request
* @param int $kit_id
*/
public function updateModel(Request $request, $kit_id, $model_id) : JsonResponse
{
@@ -305,11 +289,9 @@ class PredefinedKitsController extends Controller
}
/**
* Delete Model from Kit
* Remove the specified resource from storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $model_id int required The ID of the model. Example: 1
* @param int $kit_id
*/
public function detachModel($kit_id, $model_id) : JsonResponse
{
@@ -322,10 +304,9 @@ class PredefinedKitsController extends Controller
}
/**
* List Consumables in Kit
* Display the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @param int $kit_id
*/
public function indexConsumables($kit_id) : array
{
@@ -337,12 +318,9 @@ class PredefinedKitsController extends Controller
}
/**
* Add Consumable to Kit
* Store the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @bodyParam consumable int required The ID of the consumable. Example: 1
* @bodyParam quantity int The quantity of the consumable. Example: 1
* @param int $id
*/
public function storeConsumable(Request $request, $kit_id) : JsonResponse
{
@@ -366,12 +344,10 @@ class PredefinedKitsController extends Controller
}
/**
* Update Consumable in Kit
* Update the specified resource in storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $consumable_id int required The ID of the consumable. Example: 1
* @bodyParam quantity int The quantity of the consumable. Example: 1
* @param \Illuminate\Http\Request $request
* @param int $kit_id
*/
public function updateConsumable(Request $request, $kit_id, $consumable_id) : JsonResponse
{
@@ -387,11 +363,9 @@ class PredefinedKitsController extends Controller
}
/**
* Remove Consumable from Kit
* Remove the specified resource from storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $consumable_id int required The ID of the consumable. Example: 1
* @param int $kit_id
*/
public function detachConsumable($kit_id, $consumable_id) : JsonResponse
{
@@ -404,10 +378,9 @@ class PredefinedKitsController extends Controller
}
/**
* List Accessories in Kit
* Display the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @param int $kit_id
*/
public function indexAccessories($kit_id) : array
{
@@ -419,12 +392,9 @@ class PredefinedKitsController extends Controller
}
/**
* Add Accessory to Kit
* Store the specified resource.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @bodyParam accessory int required The ID of the accessory. Example: 1
* @bodyParam quantity int The quantity of the accessory. Example: 1
* @param int $kit_id
*/
public function storeAccessory(Request $request, $kit_id) : JsonResponse
{
@@ -448,12 +418,10 @@ class PredefinedKitsController extends Controller
}
/**
* Update Accessory in Kit
* Update the specified resource in storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $accessory_id int required The ID of the accessory. Example: 1
* @bodyParam quantity int The quantity of the accessory. Example: 1
* @param \Illuminate\Http\Request $request
* @param int $kit_id
*/
public function updateAccessory(Request $request, $kit_id, $accessory_id) : JsonResponse
{
@@ -469,11 +437,9 @@ class PredefinedKitsController extends Controller
}
/**
* Remove Accessory from Kit
* Remove the specified resource from storage.
*
* @group Predefined Kits
* @urlParam $kit_id int required The ID of the kit. Example: 1
* @urlParam $accessory_id int required The ID of the accessory. Example: 1
* @param int $kit_id
*/
public function detachAccessory($kit_id, $accessory_id) : JsonResponse
{

View File

@@ -42,9 +42,8 @@ class ProfileController extends Controller
}
/**
* Display Requested Assets
* Display a listing of requested assets.
*
* @group Account
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.3.0]
*/
@@ -70,7 +69,7 @@ class ProfileController extends Controller
if ($checkoutRequest && $checkoutRequest->itemRequested()) {
$assets = [
'image' => e($checkoutRequest->itemRequested()->present()->getImageUrl()),
'name' => e($checkoutRequest->itemRequested()->display_name),
'name' => e($checkoutRequest->itemRequested()->present()->name()),
'type' => e($checkoutRequest->itemType()),
'qty' => (int) $checkoutRequest->quantity,
'location' => ($checkoutRequest->location()) ? e($checkoutRequest->location()->name) : null,
@@ -94,8 +93,8 @@ class ProfileController extends Controller
/**
* Create API token
* @group Account
* Delete an API token
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*/
@@ -123,9 +122,8 @@ class ProfileController extends Controller
/**
* Delete API token
* Delete an API token
*
* @group Account
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*/
@@ -152,9 +150,8 @@ class ProfileController extends Controller
/**
* Show API tokens
* Show user's API tokens
*
* @group Account
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*/
@@ -175,12 +172,11 @@ class ProfileController extends Controller
}
/**
* Display Accepted EULAs
* Display the EULAs accepted by the user.
*
* @group Account
* @param \App\Http\Transformers\ActionlogsTransformer $transformer
* @return \Illuminate\Http\JsonResponse
* @since [v8.1.16]
* @param \App\Http\Transformers\ActionlogsTransformer $transformer
* @return \Illuminate\Http\JsonResponse
*@since [v8.1.16]
* @author [Godfrey Martinez] [<gmartinez@grokability.com>]
*/
public function eulas(ProfileTransformer $transformer)

View File

@@ -13,23 +13,8 @@ use Illuminate\Http\JsonResponse;
class ReportsController extends Controller
{
/**
* Activity Report
* Returns Activity Report JSON.
*
* @group Reports
* @queryParam search string Search term to filter results Example: updated
* @queryParam target_type string Filter by target type Example: user
* @queryParam target_id integer Filter by target ID Example: 1
* @queryParam item_type string Filter by item type Example: asset
* @queryParam item_id integer Filter by item ID Example: 1
* @queryParam action_type string Filter by action type Example: create
* @queryParam created_by integer Filter by user ID who created the log Example: 1
* @queryParam action_source string Filter by action source Example: web
* @queryParam remote_ip string Filter by remote IP address Example: No-example
* @queryParam uploads boolean Filter to only show logs with file uploads Example: true
* @queryParam sort string Column to sort by. Allowed values: id, created_at, target_id, created_by, accept_signature, action_type, note, remote_ip, user_agent, target_type, item_type, action_source, action_date. Default is created_at. Example: created_at
* @queryParam order string Order of sorting. Allowed values: asc, desc. Default is desc. Example: desc
* @queryParam offset integer Number of records to skip for pagination. Default is 0. Example: 0
* @queryParam limit integer Maximum number of records to return. Default is 25. Example: 25
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Helpers\StorageHelper;
use App\Http\Transformers\DatatablesTransformer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
@@ -23,12 +24,6 @@ class SettingsController extends Controller
{
/**
* Test LDAP Connection
*
* @group Settings
* @return JsonResponse
*/
public function ldaptest() : JsonResponse
{
$settings = Setting::getSettings();
@@ -56,22 +51,10 @@ class SettingsController extends Controller
})->slice(0, 10)->map(function ($item) use ($settings) {
return (object) [
'username' => $item[$settings['ldap_username_field']][0] ?? null,
'display_name' => $item[$settings['ldap_display_name']][0] ?? null,
'employee_number' => $item[$settings['ldap_emp_num']][0] ?? null,
'lastname' => $item[$settings['ldap_lname_field']][0] ?? null,
'firstname' => $item[$settings['ldap_fname_field']][0] ?? null,
'email' => $item[$settings['ldap_email']][0] ?? null,
'phone' => $item[$settings['ldap_phone_field']][0] ?? null,
'mobile' => $item[$settings['ldap_mobile']][0] ?? null,
'jobtitle' => $item[$settings['ldap_jobtitle']][0] ?? null,
'department' => $item[$settings['ldap_department']][0] ?? null,
'manager' => $item[$settings['ldap_manager']][0] ?? null,
'address' => $item[$settings['ldap_address']][0] ?? null,
'city' => $item[$settings['ldap_city']][0] ?? null,
'state' => $item[$settings['ldap_state']][0] ?? null,
'zip' => $item[$settings['ldap_zip']][0] ?? null,
'country' => $item[$settings['ldap_country']][0] ?? null,
'location' => $item[$settings['ldap_location']][0] ?? null,
];
});
if ($users->count() > 0) {
@@ -95,19 +78,12 @@ class SettingsController extends Controller
}
} catch (\Exception $e) {
Log::debug('Connection failed but we cannot debug it any further on our end.');
return response()->json(['message' => $e->getMessage()], 400);
return response()->json(['message' => $e->getMessage()], 500);
}
}
/**
* Test LDAP Login
*
* @group Settings
* @param Request $request
* @return JsonResponse
*/
public function ldaptestlogin(Request $request) : JsonResponse
{
@@ -164,9 +140,8 @@ class SettingsController extends Controller
}
/**
* Test Email Configuration
* Test the email configuration
*
* @group Settings
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
*/
@@ -175,11 +150,8 @@ class SettingsController extends Controller
if (!config('app.lock_passwords')) {
try {
Notification::send(Setting::first(), new MailTest());
Log::debug('Attempting to sending to '.config('mail.reply_to.address'));
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
} catch (\Exception $e) {
Log::error('Mail sent error using '.config('mail.reply_to.address') .': '. $e->getMessage());
Log::debug($e);
return response()->json(['message' => $e->getMessage()], 500);
}
}
@@ -189,9 +161,8 @@ class SettingsController extends Controller
/**
* Delete Barcode Cache
* Delete server-cached barcodes
*
* @group Settings
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0.0]
*/
@@ -231,7 +202,6 @@ class SettingsController extends Controller
/**
* Get a list of login attempts
*
* @group Settings
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0.0]
* @param \Illuminate\Http\Request $request
@@ -255,7 +225,6 @@ class SettingsController extends Controller
/**
* Lists backup files
*
* @group Settings
* @author [A. Gianotto]
*/
public function listBackups() : array
@@ -296,11 +265,9 @@ class SettingsController extends Controller
/**
* Downloads a backup file.
*
* We use response()->download() here instead of Storage::download() because Storage::download()
* exhausts memory on larger files.
*
* @group Settings
* @author [A. Gianotto]
*/
public function downloadBackup($file) : JsonResponse | BinaryFileResponse
@@ -320,7 +287,6 @@ class SettingsController extends Controller
/**
* Determines and downloads the latest backup
*
* @group Settings
* @author [A. Gianotto]
* @since [v6.3.1]
*/
@@ -349,4 +315,4 @@ class SettingsController extends Controller
}
}
}

View File

@@ -17,11 +17,7 @@ use Illuminate\Http\JsonResponse;
class StatuslabelsController extends Controller
{
/**
* Show Status Labels
*
* @group Status Labels
* @subgroup Assets
* @queryParam search string Search term to filter results. Example: Inventory
* Display a listing of the resource.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
@@ -89,11 +85,9 @@ class StatuslabelsController extends Controller
/**
* Store a newly created resource in storage.
*
* @group Status Labels
* @subgroup Assets
* @param \Illuminate\Http\Request $request
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
*/
public function store(Request $request) : JsonResponse
{
@@ -125,13 +119,11 @@ class StatuslabelsController extends Controller
}
/**
* Show Status Labels
* Display the specified resource.
*
* @group Status Labels
* @subgroup Assets
* @param int $id
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function show($id) : array
{
@@ -143,14 +135,12 @@ class StatuslabelsController extends Controller
/**
* Update Status Label
* Update the specified resource in storage.
*
* @group Status Labels
* @subgroup Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
* @param int $id
*@author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
public function update(Request $request, $id) : JsonResponse
{
@@ -182,13 +172,11 @@ class StatuslabelsController extends Controller
}
/**
* Delete Status Label
* Remove the specified resource from storage.
*
* @group Status Labels
* @subgroup Assets
* @param int $id
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function destroy($id) : JsonResponse
{
@@ -209,10 +197,8 @@ class StatuslabelsController extends Controller
/**
* Show Count for Pie Chart
* Show a count of assets by status label for pie chart
*
* @group Status Labels
* @subgroup Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
*/
@@ -243,10 +229,8 @@ class StatuslabelsController extends Controller
}
/**
* Show Count for Pie Chart by Meta Status
* Show a count of assets by meta status type for pie chart
*
* @group Status Labels
* @subgroup Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.11]
*/
@@ -273,13 +257,11 @@ class StatuslabelsController extends Controller
}
/**
* Show Assets with Status Label
* Display the specified resource.
*
* @group Status Labels
* @subgroup Assets
* @param int $id
*@since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
*/
public function assets(Request $request, $id) : array
{
@@ -307,8 +289,6 @@ class StatuslabelsController extends Controller
/**
* Check for Deployable Status
*
* Returns a boolean response based on whether the status label
* is one that is deployable or pending.
*
@@ -316,8 +296,7 @@ class StatuslabelsController extends Controller
* we should provide a dropdown of users for them to check the asset out to,
* and whether we show a warning that the asset will be checked in if it's already
* assigned but the status is changed to one that isn't pending or deployable
* @group Status Labels
* @subgroup Assets
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
@@ -332,10 +311,8 @@ class StatuslabelsController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Status Labels
* @subgroup Assets
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.1.1]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -15,30 +15,11 @@ use Illuminate\Http\JsonResponse;
class SuppliersController extends Controller
{
/**
* List Suppliers
* Display a listing of the resource.
*
* @group Suppliers
* @queryParam search string Search term to filter results. Example: Acme
* @queryParam name string Filter by exact supplier name. Example: Acme Corp
* @queryParam address string Filter by exact address. Example: 123 Main St
* @queryParam address2 string Filter by exact address2. Example: Suite 100
* @queryParam city string Filter by exact city. Example: Springfield
* @queryParam state string Filter by exact state. Example: IL
* @queryParam zip string Filter by exact zip code. Example: 62701
* @queryParam country string Filter by exact country. Example: USA
* @queryParam phone string Filter by exact phone number. Example: 555-1234
* @queryParam fax string Filter by exact fax number. Example: 555-5678
* @queryParam email string Filter by exact email address. Example: info@example.org
* @queryParam url string Filter by exact URL. Example: http://example.com
* @queryParam notes string Filter by exact notes. Example: This is a note.
* @queryParam sort string Column to sort results by. Allowed values: id, name, address, address2, city, state, country, zip, phone, contact, fax, email, image, assets_count, licenses_count, accessories_count, components_count, consumables_count, url, notes. Default: created_at. Example: name
* @queryParam order string Order of sorted results. Allowed values: asc, desc. Default: desc. Example: asc
* @queryParam offset integer Offset/starting position of the results. Default: 0. Example: 0
* @queryParam limit integer Limit the number of results returned. Default: 25. Maximum: 100. Example: 50
* @see SuppliersController::getIndex()
* @return \Illuminate\Http\Response
* @since [v4.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
*/
public function index(Request $request): array
{
@@ -145,9 +126,8 @@ class SuppliersController extends Controller
/**
* Create Supplier
* Store a newly created resource in storage.
*
* @group Suppliers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -167,9 +147,8 @@ class SuppliersController extends Controller
}
/**
* Show Supplier
* Display the specified resource.
*
* @group Suppliers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -184,9 +163,8 @@ class SuppliersController extends Controller
/**
* Update Supplier
* Update the specified resource in storage.
*
* @group Suppliers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
@@ -207,9 +185,8 @@ class SuppliersController extends Controller
}
/**
* Delete Supplier
* Remove the specified resource from storage.
*
* @group Suppliers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -217,7 +194,7 @@ class SuppliersController extends Controller
public function destroy($id) : JsonResponse
{
$this->authorize('delete', Supplier::class);
$supplier = Supplier::with('maintenances', 'assets', 'licenses')->withCount('maintenances as maintenances_count', 'assets as assets_count', 'licenses as licenses_count')->findOrFail($id);
$supplier = Supplier::with('asset_maintenances', 'assets', 'licenses')->withCount('asset_maintenances as asset_maintenances_count', 'assets as assets_count', 'licenses as licenses_count')->findOrFail($id);
$this->authorize('delete', $supplier);
@@ -225,8 +202,8 @@ class SuppliersController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_assets', ['asset_count' => (int) $supplier->assets_count])));
}
if ($supplier->maintenances_count > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_maintenances', ['maintenances_count' => $supplier->maintenances_count])));
if ($supplier->asset_maintenances_count > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_maintenances', ['asset_maintenances_count' => $supplier->asset_maintenances_count])));
}
if ($supplier->licenses_count > 0) {
@@ -239,9 +216,8 @@ class SuppliersController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Suppliers
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer

View File

@@ -7,9 +7,18 @@ use App\Helpers\StorageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\UploadFileRequest;
use App\Http\Transformers\UploadedFilesTransformer;
use App\Models\Accessory;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Component;
use App\Models\Consumable;
use App\Models\License;
use App\Models\Location;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -19,10 +28,48 @@ class UploadedFilesController extends Controller
{
static $map_object_type = [
'accessories' => Accessory::class,
'assets' => Asset::class,
'components' => Component::class,
'consumables' => Consumable::class,
'hardware' => Asset::class,
'licenses' => License::class,
'locations' => Location::class,
'models' => AssetModel::class,
'users' => User::class,
];
static $map_storage_path = [
'accessories' => 'private_uploads/accessories/',
'assets' => 'private_uploads/assets/',
'components' => 'private_uploads/components/',
'consumables' => 'private_uploads/consumables/',
'hardware' => 'private_uploads/assets/',
'licenses' => 'private_uploads/licenses/',
'locations' => 'private_uploads/locations/',
'models' => 'private_uploads/assetmodels/',
'users' => 'private_uploads/users/',
];
static $map_file_prefix= [
'accessories' => 'accessory',
'assets' => 'asset',
'components' => 'component',
'consumables' => 'consumable',
'hardware' => 'asset',
'licenses' => 'license',
'locations' => 'location',
'models' => 'model',
'users' => 'user',
];
/**
* List Files for an Object
* List files for an object
*
* @group Files
* @param \App\Http\Requests\UploadFileRequest $request
* @param string $object_type the type of object to upload the file to
* @param int $id the ID of the object to list files for
@@ -33,7 +80,7 @@ class UploadedFilesController extends Controller
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$object = self::$map_object_type[$object_type]::find($id);
$this->authorize('view', $object);
if (!$object) {
@@ -51,18 +98,15 @@ class UploadedFilesController extends Controller
'created_at',
];
$uploads = self::$map_object_type[$object_type]::withTrashed()->find($id)->uploads()
->with('adminuser');
$offset = ($request->input('offset') > $uploads->count()) ? $uploads->count() : abs($request->input('offset'));
$uploads = $object->uploads();
$offset = ($request->input('offset') > $object->count()) ? $object->count() : abs($request->input('offset'));
$limit = app('api_limit_value');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'action_logs.created_at';
// Text search on action_logs fields
// We could use the normal Actionlogs text scope, but it's a very heavy query since it's searching across all relations
// and we generally won't need that here
// We could use the normal Actionlogs text scope, but it's a very heavy query since it's searcghing across all relations
// And we generally won't need that here
if ($request->filled('search')) {
$uploads->where(
@@ -73,17 +117,14 @@ class UploadedFilesController extends Controller
);
}
$total = $uploads->count();
$uploads = $uploads->skip($offset)->take($limit)->orderBy($sort, $order)->get();
return (new UploadedFilesTransformer())->transformFiles($uploads, $total);
return (new UploadedFilesTransformer())->transformFiles($uploads, $uploads->count());
}
/**
* Upload File to an Object
* Accepts a POST to upload a file to the server.
*
* @group Files
* @param \App\Http\Requests\UploadFileRequest $request
* @param string $object_type the type of object to upload the file to
* @param int $id the ID of the object to store so we can check permisisons
@@ -94,7 +135,7 @@ class UploadedFilesController extends Controller
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$object = self::$map_object_type[$object_type]::find($id);
$this->authorize('view', $object);
if (!$object) {
@@ -130,9 +171,8 @@ class UploadedFilesController extends Controller
/**
* Display File
* Check for permissions and display the file.
*
* @group Files
* @param \App\Http\Requests\UploadFileRequest $request
* @param string $object_type the type of object to upload the file to
* @param int $id the ID of the object to delete from so we can check permisisons
@@ -143,7 +183,7 @@ class UploadedFilesController extends Controller
public function show($object_type, $id, $file_id) : JsonResponse | StreamedResponse | Storage | StorageHelper | BinaryFileResponse
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$object = self::$map_object_type[$object_type]::find($id);
$this->authorize('view', $object);
if (!$object) {
@@ -174,9 +214,8 @@ class UploadedFilesController extends Controller
}
/**
* Delete File
* Delete the associated file
*
* @group Files
* @param \App\Http\Requests\UploadFileRequest $request
* @param string $object_type the type of object to upload the file to
* @param int $id the ID of the object to delete from so we can check permisisons
@@ -188,7 +227,7 @@ class UploadedFilesController extends Controller
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$object = self::$map_object_type[$object_type]::find($id);
$this->authorize('update', self::$map_object_type[$object_type]);
if (!$object) {
@@ -197,12 +236,8 @@ class UploadedFilesController extends Controller
// Check for the file
$log = Actionlog::query()
->where('id', $file_id)
->where('action_type', 'uploaded')
->where('item_type', self::$map_object_type[$object_type])
->where('item_id', $object->id)
->first();
$log = Actionlog::find($file_id)->where('item_type', self::$map_object_type[$object_type])
->where('item_id', $object->id)->first();
if ($log) {
// Check the file actually exists, and delete it
@@ -210,7 +245,7 @@ class UploadedFilesController extends Controller
Storage::delete(self::$map_storage_path[$object_type].'/'.$log->filename);
}
// Delete the record of the file
if ($log->logUploadDelete($object, $log->filename)) {
if ($log->delete()) {
return response()->json(Helper::formatStandardApiResponse('success', null, trans_choice('general.file_upload_status.delete.success', 1)), 200);
}
@@ -221,4 +256,4 @@ class UploadedFilesController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans_choice('general.file_upload_status.delete.error', 1)), 500);
}
}
}

View File

@@ -20,8 +20,6 @@ use App\Models\Consumable;
use App\Models\License;
use App\Models\User;
use App\Notifications\CurrentInventory;
use App\Notifications\WelcomeNotification;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
@@ -35,36 +33,8 @@ use Illuminate\Http\JsonResponse;
class UsersController extends Controller
{
/**
* List Users
* Display a listing of the resource.
*
* @group Users
* @queryParam search string Search term to filter results. Example: John
* @queryParam filter string JSON object of key/value pairs to filter results. Allowed keys: last_name, first_name, display_name, email, jobtitle, username, employee_num, groups, activated, created_at, updated_at, two_factor_enrolled, two_factor_optin, last_login, assets_count, licenses_count, consumables_count, accessories_count, manages_users_count, manages_locations_count, phone, mobile, address, city, state, country, zip, id, ldap_import, remote, vip, start_date, end_date, autoassign_licenses, website, locale, notes. Example: {"last_name":"Doe","first_name":"John"}
* @queryParam activated integer Filter by exact activation status. Allowed values: 0, 1. Example: 1
* @queryParam admins boolean Filter to only admin and superadmin users. Allowed values: true, false. Example: true
* @queryParam superadmins boolean Filter to only superadmin users. Allowed values: true, false. Example: true
* @queryParam company_id integer Filter by exact company ID. Example: 1
* @queryParam phone string Filter by exact phone number. Example: 555-1234
* @queryParam mobile string Filter by exact mobile number. Example: 555-5678
* @queryParam location_id integer Filter by exact location ID. Example: 1
* @queryParam created_by integer Filter by exact user ID who created the user. Example: 1
* @queryParam email string Filter by exact email address. Example: jdoe@example.com
* @queryParam username string Filter by exact username. Example: jdoe
* @queryParam first_name string Filter by exact first name. Example: John
* @queryParam last_name string Filter by exact last name. Example: Doe
* @queryParam display_name string Filter by exact display name. Example: John Doe
* @queryParam employee_num string Filter by exact employee number. Example: 12345
* @queryParam state string Filter by exact state. Example: CA
* @queryParam country string Filter by exact country. Example: USA
* @queryParam website string Filter by exact website URL. Example: https://example.com
* @queryParam zip string Filter by exact ZIP code. Example: 90210
* @queryParam group_id integer Filter by exact group ID. Example: 1
* @queryParam department_id integer Filter by exact department ID. Example: 1
* @queryParam manager_id integer Filter by exact manager (user) ID. Example: 1
* @queryParam ldap_import integer Filter by exact LDAP import status. Allowed values: 0, 1. Example: 1
* @queryParam remote integer Filter by exact remote status. Allowed values: 0, 1. Example: 1
* @queryParam vip integer Filter by exact VIP status. Allowed values: 0, 1. Example: 1
* @queryParam two_factor_enrolled integer Filter by exact two-factor authentication enrollment status. Allowed values: 0, 1. Example: 1
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*
@@ -93,14 +63,12 @@ class UsersController extends Controller
'users.jobtitle',
'users.last_login',
'users.last_name',
'users.display_name',
'users.locale',
'users.location_id',
'users.manager_id',
'users.notes',
'users.permissions',
'users.phone',
'users.mobile',
'users.state',
'users.two_factor_enrolled',
'users.two_factor_optin',
@@ -131,101 +99,19 @@ class UsersController extends Controller
'managedLocations as manages_locations_count'
]);
$allowed_columns =
[
'last_name',
'first_name',
'display_name',
'email',
'jobtitle',
'username',
'employee_num',
'groups',
'activated',
'created_at',
'updated_at',
'two_factor_enrolled',
'two_factor_optin',
'last_login',
'assets_count',
'licenses_count',
'consumables_count',
'accessories_count',
'manages_users_count',
'manages_locations_count',
'phone',
'mobile',
'address',
'city',
'state',
'country',
'zip',
'id',
'ldap_import',
'two_factor_optin',
'two_factor_enrolled',
'remote',
'vip',
'start_date',
'end_date',
'autoassign_licenses',
'website',
'locale',
'notes',
'employee_num',
// These are *relationships* so we wouldn't normally include them in this array,
// since they would normally create a `column not found` error,
// BUT we account for them in the ordering switch down at the end of this method
// DO NOT ADD ANYTHING TO THIS LIST WITHOUT CHECKING THE ORDERING SWITCH BELOW!
'company',
'location',
'department',
'manager',
'created_by',
];
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
$filter = array_filter($filter, function ($key) use ($allowed_columns) {
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
}
if ((! is_null($filter)) && (count($filter)) > 0) {
$users->ByFilter($filter);
} elseif ($request->filled('search')) {
$users->TextSearch($request->input('search'));
if ($request->filled('search') != '') {
$users = $users->TextSearch($request->input('search'));
}
if ($request->filled('activated')) {
$users = $users->where('users.activated', '=', $request->input('activated'));
}
if ($request->input('admins') == 'true') {
$users = $users->OnlyAdminsAndSuperAdmins();
}
if ($request->input('superadmins') == 'true') {
$users = $users->OnlySuperAdmins();
}
if ($request->filled('company_id')) {
$users = $users->where('users.company_id', '=', $request->input('company_id'));
}
if ($request->filled('phone')) {
$users = $users->where('users.phone', '=', $request->input('phone'));
}
if ($request->filled('mobile')) {
$users = $users->where('users.mobile', '=', $request->input('mobile'));
}
if ($request->filled('location_id')) {
$users = $users->where('users.location_id', '=', $request->input('location_id'));
}
@@ -250,10 +136,6 @@ class UsersController extends Controller
$users = $users->where('users.last_name', '=', $request->input('last_name'));
}
if ($request->filled('display_name')) {
$users = $users->where('users.display_name', '=', $request->input('display_name'));
}
if ($request->filled('employee_num')) {
$users = $users->where('users.employee_num', '=', $request->input('employee_num'));
}
@@ -380,6 +262,47 @@ class UsersController extends Controller
$users->orderBy('first_name', $order);
break;
default:
$allowed_columns =
[
'last_name',
'first_name',
'email',
'jobtitle',
'username',
'employee_num',
'groups',
'activated',
'created_at',
'updated_at',
'two_factor_enrolled',
'two_factor_optin',
'last_login',
'assets_count',
'licenses_count',
'consumables_count',
'accessories_count',
'manages_users_count',
'manages_locations_count',
'phone',
'address',
'city',
'state',
'country',
'zip',
'id',
'ldap_import',
'two_factor_optin',
'two_factor_enrolled',
'remote',
'vip',
'start_date',
'end_date',
'autoassign_licenses',
'website',
'locale',
'notes',
];
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'first_name';
$users = $users->orderBy($sort, $order);
break;
@@ -398,9 +321,8 @@ class UsersController extends Controller
}
/**
* Selectlist
* Gets a paginated collection for the select2 menus
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
@@ -414,7 +336,6 @@ class UsersController extends Controller
'users.employee_num',
'users.first_name',
'users.last_name',
'users.display_name',
'users.gravatar',
'users.avatar',
'users.email',
@@ -425,17 +346,20 @@ class UsersController extends Controller
$users = $users->where(function ($query) use ($request) {
$query->SimpleNameSearch($request->get('search'))
->orWhere('username', 'LIKE', '%'.$request->get('search').'%')
->orWhere('display_name', 'LIKE', '%'.$request->get('search').'%')
->orWhere('email', 'LIKE', '%'.$request->get('search').'%')
->orWhere('employee_num', 'LIKE', '%'.$request->get('search').'%');
});
}
$users = $users->orderBy('display_name', 'asc')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc');
$users = $users->orderBy('last_name', 'asc')->orderBy('first_name', 'asc');
$users = $users->paginate(50);
foreach ($users as $user) {
$name_str = $user->display_name;
$name_str = '';
if ($user->last_name != '') {
$name_str .= $user->last_name.', ';
}
$name_str .= $user->first_name;
if ($user->username != '') {
$name_str .= ' ('.$user->username.')';
@@ -455,9 +379,8 @@ class UsersController extends Controller
/**
* Create User
* Store a newly created resource in storage.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -488,20 +411,9 @@ class UsersController extends Controller
$user->password = $user->noPassword();
}
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'avatar', 'avatars', 'avatar');
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
if ($user->save()) {
if (($user->activated == '1') && ($user->email != '') && ($request->input('send_welcome') == '1')) {
try {
$user->notify(new WelcomeNotification($user));
} catch (\Exception $e) {
Log::warning('Could not send welcome notification for user: ' . $e->getMessage());
}
}
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
@@ -515,9 +427,8 @@ class UsersController extends Controller
}
/**
* Show User
* Display the specified resource.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id
*/
@@ -536,9 +447,8 @@ class UsersController extends Controller
/**
* Update User
* Update the specified resource in storage.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param \Illuminate\Http\Request $request
@@ -582,10 +492,6 @@ class UsersController extends Controller
$user->username = $request->input('username');
}
if ($request->filled('display_name')) {
$user->display_name = $request->input('display_name');
}
if ($request->filled('email')) {
$user->email = $request->input('email');
}
@@ -615,7 +521,7 @@ class UsersController extends Controller
Asset::where('assigned_type', User::class)
->where('assigned_to', $user->id)->update(['location_id' => $request->input('location_id', null)]);
}
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'avatar', 'avatars', 'avatar');
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
if ($user->save()) {
// Check if the request has groups passed and has a value, AND that the user us a superuser
@@ -638,9 +544,8 @@ class UsersController extends Controller
}
/**
* Delete User
* Remove the specified resource from storage.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
@@ -676,9 +581,8 @@ class UsersController extends Controller
}
/**
* List Assets Assigned to User
* Return JSON containing a list of assets assigned to a user.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @param $userId
@@ -720,9 +624,8 @@ class UsersController extends Controller
}
/**
* Email Asset List to User
* Notify a specific user via email with all of their assigned assets.
*
* @group Users
* @author [Lukas Fehling] [<lukas.fehling@adabay.rocks>]
* @since [v6.0.13]
* @param Request $request
@@ -750,9 +653,8 @@ class UsersController extends Controller
}
/**
* List Consumables Assigned to User
* Return JSON containing a list of consumables assigned to a user.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @param $userId
@@ -768,9 +670,8 @@ class UsersController extends Controller
}
/**
* List Accessories Assigned to User
* Return JSON containing a list of accessories assigned to a user.
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.6.14]
* @param $userId
@@ -787,9 +688,8 @@ class UsersController extends Controller
}
/**
* List Licenses Assigned to User
* Return JSON containing a list of licenses assigned to a user.
*
* @group Users
* @author [N. Mathar] [<snipe@snipe.net>]
* @since [v5.0]
* @param $userId
@@ -809,9 +709,8 @@ class UsersController extends Controller
}
/**
* Reset Two-factor
* Reset the user's two-factor status
*
* @group Users
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @param $userId
@@ -849,9 +748,8 @@ class UsersController extends Controller
}
/**
* Get Current User Info
* Get info on the current user.
*
* @group Users
* @author [Juan Font] [<juanfontalonso@gmail.com>]
* @since [v4.4.2]
* @param \Illuminate\Http\Request $request
@@ -862,14 +760,11 @@ class UsersController extends Controller
}
/**
* User EULAs
* Display the EULAs accepted by the user.
*
* Gets the lst of accepted EULAs for a user,
*
* @group Users
* @param \App\Models\User $user
* @param \App\Http\Transformers\ActionlogsTransformer $transformer
* @return \Illuminate\Http\JsonResponse
* @param \App\Models\User $user
* @param \App\Http\Transformers\ActionlogsTransformer $transformer
* @return \Illuminate\Http\JsonResponse
*@since [v8.1.16]
* @author [Godfrey Martinez] [<gmartinez@grokability.com>]
*/
@@ -884,9 +779,8 @@ class UsersController extends Controller
}
/**
* Restore User
* Restore a soft-deleted user.
*
* @group Users
* @author [E. Taylor] [<dev@evantaylor.name>]
* @param int $userId
* @since [v6.0.0]
@@ -920,38 +814,4 @@ class UsersController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.user_not_found')), 200);
}
/**
* LDAP Sync Users
*
* @group Users
* @author A. Gianotto <snipe@snipe.net>
* @since 8.2.2
*
* @return \Illuminate\Http\JsonResponse
*/
public function syncLdapUsers(Request $request)
{
$this->authorize('update', User::class);
// Call Artisan LDAP import command.
Artisan::call('snipeit:ldap-sync', ['--location_id' => $request->input('location_id'), '--json_summary' => true]);
// Collect and parse JSON summary.
$ldap_results_json = Artisan::output();
$ldap_results = json_decode($ldap_results_json, true);
if (!$ldap_results) {
return response()->json(Helper::formatStandardApiResponse('error', null,trans('general.no_results')), 200);
}
// Direct user to appropriate status page.
if ($ldap_results['error']) {
return response()->json(Helper::formatStandardApiResponse('error', null, $ldap_results['error_message']), 200);
}
return response()->json(Helper::formatStandardApiResponse('success', null, $ldap_results['summary']), 200);
}
}

View File

@@ -2,9 +2,8 @@
namespace App\Http\Controllers;
use App\Http\Requests\ImageUploadRequest;
use App\Models\Asset;
use App\Models\Maintenance;
use App\Models\AssetMaintenance;
use App\Models\Company;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;
@@ -18,23 +17,29 @@ use \Illuminate\Http\RedirectResponse;
*
* @version v2.0
*/
class MaintenancesController extends Controller
class AssetMaintenancesController extends Controller
{
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the asset maintenances listing.
* the content for the asset maintenances listing, which is generated in getDatatable.
*
* @todo This should be replaced with middleware and/or policies
* @see AssetMaintenancesController::getDatatable() method that generates the JSON response
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
*/
public function index() : View
{
$this->authorize('view', Asset::class);
return view('maintenances.index');
return view('asset_maintenances/index');
}
/**
* Returns a form view to create a new asset maintenance.
*
* @see MaintenancesController::postCreate() method that stores the data
* @see AssetMaintenancesController::postCreate() method that stores the data
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
@@ -50,21 +55,21 @@ class MaintenancesController extends Controller
$asset->asset_id = $asset->id;
}
return view('maintenances/edit')
->with('maintenanceType', Maintenance::getImprovementOptions())
return view('asset_maintenances/edit')
->with('assetMaintenanceType', AssetMaintenance::getImprovementOptions())
->with('asset', $asset)
->with('item', new Maintenance);
->with('item', new AssetMaintenance);
}
/**
* Validates and stores the new asset maintenance
*
* @see MaintenancesController::getCreate() method for the form
* @see AssetMaintenancesController::getCreate() method for the form
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
*/
public function store(ImageUploadRequest $request) : RedirectResponse
public function store(Request $request) : RedirectResponse
{
$this->authorize('update', Asset::class);
@@ -73,74 +78,72 @@ class MaintenancesController extends Controller
// Loop through the selected assets
foreach ($assets as $asset) {
$maintenance = new Maintenance();
$maintenance->supplier_id = $request->input('supplier_id');
$maintenance->is_warranty = $request->input('is_warranty');
$maintenance->cost = $request->input('cost');
$maintenance->notes = $request->input('notes');
$maintenance->url = $request->input('url');
$assetMaintenance = new AssetMaintenance();
$assetMaintenance->supplier_id = $request->input('supplier_id');
$assetMaintenance->is_warranty = $request->input('is_warranty');
$assetMaintenance->cost = $request->input('cost');
$assetMaintenance->notes = $request->input('notes');
// Save the asset maintenance data
$maintenance->asset_id = $asset->id;
$maintenance->asset_maintenance_type = $request->input('asset_maintenance_type');
$maintenance->name = $request->input('name');
$maintenance->start_date = $request->input('start_date');
$maintenance->completion_date = $request->input('completion_date');
$maintenance->created_by = auth()->id();
$assetMaintenance->asset_id = $asset->id;
$assetMaintenance->asset_maintenance_type = $request->input('asset_maintenance_type');
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
$assetMaintenance->created_by = auth()->id();
if (($maintenance->completion_date !== null)
&& ($maintenance->start_date !== '')
&& ($maintenance->start_date !== '0000-00-00')
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($maintenance->start_date);
$completionDate = Carbon::parse($maintenance->completion_date);
$maintenance->asset_maintenance_time = (int) $completionDate->diffInDays($startDate, true);
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = (int) $completionDate->diffInDays($startDate, true);
}
$maintenance = $request->handleImages($maintenance);
// Was the asset maintenance created?
if (!$maintenance->save()) {
return redirect()->back()->withInput()->withErrors($maintenance->getErrors());
if (!$assetMaintenance->save()) {
return redirect()->back()->withInput()->withErrors($assetMaintenance->getErrors());
}
}
return redirect()->route('maintenances.index')
->with('success', trans('admin/maintenances/message.create.success'));
->with('success', trans('admin/asset_maintenances/message.create.success'));
}
/**
* Returns a form view to edit a selected asset maintenance.
*
* @see MaintenancesController::postEdit() method that stores the data
* @see AssetMaintenancesController::postEdit() method that stores the data
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
*/
public function edit(Maintenance $maintenance) : View | RedirectResponse
public function edit(AssetMaintenance $maintenance) : View | RedirectResponse
{
$this->authorize('update', Asset::class);
$this->authorize('update', $maintenance->asset);
return view('maintenances/edit')
return view('asset_maintenances/edit')
->with('selected_assets', $maintenance->asset->pluck('id')->toArray())
->with('asset_ids', request()->input('asset_ids', []))
->with('maintenanceType', Maintenance::getImprovementOptions())
->with('assetMaintenanceType', AssetMaintenance::getImprovementOptions())
->with('item', $maintenance);
}
/**
* Validates and stores an update to an asset maintenance
*
* @see MaintenancesController::postEdit() method that stores the data
* @see AssetMaintenancesController::postEdit() method that stores the data
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @param Request $request
* @param int $maintenanceId
* @param int $assetMaintenanceId
* @version v1.0
* @since [v1.8]
*/
public function update(ImageUploadRequest $request, Maintenance $maintenance) : View | RedirectResponse
public function update(Request $request, AssetMaintenance $maintenance) : View | RedirectResponse
{
$this->authorize('update', Asset::class);
$this->authorize('update', $maintenance->asset);
@@ -150,10 +153,9 @@ class MaintenancesController extends Controller
$maintenance->cost = $request->input('cost');
$maintenance->notes = $request->input('notes');
$maintenance->asset_maintenance_type = $request->input('asset_maintenance_type');
$maintenance->name = $request->input('name');
$maintenance->title = $request->input('title');
$maintenance->start_date = $request->input('start_date');
$maintenance->completion_date = $request->input('completion_date');
$maintenance->url = $request->input('url');
// Todo - put this in a getter/setter?
@@ -174,11 +176,10 @@ class MaintenancesController extends Controller
$completionDate = Carbon::parse($maintenance->completion_date);
$maintenance->asset_maintenance_time = (int) $completionDate->diffInDays($startDate, true);
}
$maintenance = $request->handleImages($maintenance);
if ($maintenance->save()) {
return redirect()->route('maintenances.index')
->with('success', trans('admin/maintenances/message.edit.success'));
->with('success', trans('admin/asset_maintenances/message.edit.success'));
}
return redirect()->back()->withInput()->withErrors($maintenance->getErrors());
@@ -188,11 +189,11 @@ class MaintenancesController extends Controller
* Delete an asset maintenance
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @param int $maintenanceId
* @param int $assetMaintenanceId
* @version v1.0
* @since [v1.8]
*/
public function destroy(Maintenance $maintenance) : RedirectResponse
public function destroy(AssetMaintenance $maintenance) : RedirectResponse
{
$this->authorize('update', Asset::class);
$this->authorize('update', $maintenance->asset);
@@ -200,19 +201,19 @@ class MaintenancesController extends Controller
$maintenance->delete();
// Redirect to the asset_maintenance management page
return redirect()->route('maintenances.index')
->with('success', trans('admin/maintenances/message.delete.success'));
->with('success', trans('admin/asset_maintenances/message.delete.success'));
}
/**
* View an asset maintenance
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @param int $maintenanceId
* @param int $assetMaintenanceId
* @version v1.0
* @since [v1.8]
*/
public function show(Maintenance $maintenance) : View | RedirectResponse
public function show(AssetMaintenance $maintenance) : View | RedirectResponse
{
return view('maintenances.view')->with('maintenance', $maintenance);
return view('asset_maintenances/view')->with('assetMaintenance', $maintenance);
}
}

View File

@@ -82,26 +82,12 @@ class AssetModelsController extends Controller
$model->notes = $request->input('notes');
$model->created_by = auth()->id();
$model->requestable = $request->has('requestable');
$model->require_serial = $request->input('require_serial', 0);
if ($request->input('fieldset_id') != '') {
$model->fieldset_id = $request->input('fieldset_id');
}
if ($request->has('use_cloned_image')) {
$cloned_model_img = AssetModel::select('image')->find($request->input('clone_image_from_id'));
if ($cloned_model_img) {
$new_image_name = 'clone-'.date('U').'-'.$cloned_model_img->image;
$new_image = 'models/'.$new_image_name;
Storage::disk('public')->copy('models/'.$cloned_model_img->image, $new_image);
$model->image = $new_image_name;
}
} else {
$model = $request->handleImages($model);
}
$model = $request->handleImages($model);
if ($model->save()) {
if ($this->shouldAddDefaultValues($request->input())) {
@@ -156,7 +142,7 @@ class AssetModelsController extends Controller
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->requestable = $request->input('requestable', '0');
$model->require_serial = $request->input('require_serial', 0);
$model->fieldset_id = $request->input('fieldset_id');
if ($model->save()) {
@@ -285,7 +271,7 @@ class AssetModelsController extends Controller
->with('depreciation_list', Helper::depreciationList())
->with('item', $model)
->with('model_id', $model->id)
->with('cloned_model', $cloned_model);
->with('clone_model', $cloned_model);
}

View File

@@ -0,0 +1,115 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\StorageHelper;
use App\Http\Requests\UploadFileRequest;
use App\Models\Actionlog;
use App\Models\AssetModel;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Storage;
use \Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class AssetModelsFilesController extends Controller
{
/**
* Upload a file to the server.
*
* @param UploadFileRequest $request
* @param int $modelId
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*@since [v1.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
public function store(UploadFileRequest $request, $modelId = null) : RedirectResponse
{
if (! $model = AssetModel::find($modelId)) {
return redirect()->route('models.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('update', $model);
if ($request->hasFile('file')) {
if (! Storage::exists('private_uploads/assetmodels')) {
Storage::makeDirectory('private_uploads/assetmodels', 775);
}
foreach ($request->file('file') as $file) {
$file_name = $request->handleFile('private_uploads/assetmodels/','model-'.$model->id,$file);
$model->logUpload($file_name, $request->get('notes'));
}
return redirect()->back()->withFragment('files')->with('success', trans('general.file_upload_success'));
}
return redirect()->back()->withFragment('files')->with('error', trans('admin/hardware/message.upload.nofiles'));
}
/**
* Check for permissions and display the file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $modelId
* @param int $fileId
* @since [v1.0]
*/
public function show(AssetModel $model, $fileId = null) : StreamedResponse | Response | RedirectResponse | BinaryFileResponse
{
$this->authorize('view', $model);
if (! $log = Actionlog::find($fileId)) {
return response('No matching record for that model/file', 500)
->header('Content-Type', 'text/plain');
}
$file = 'private_uploads/assetmodels/'.$log->filename;
if (! Storage::exists($file)) {
return response('File '.$file.' not found on server', 404)
->header('Content-Type', 'text/plain');
}
if (request('inline') == 'true') {
$headers = [
'Content-Disposition' => 'inline',
];
return Storage::download($file, $log->filename, $headers);
}
return StorageHelper::downloader($file);
}
/**
* Delete the associated file
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $modelId
* @param int $fileId
* @since [v1.0]
*/
public function destroy(AssetModel $model, $fileId = null) : RedirectResponse
{
$rel_path = 'private_uploads/assetmodels';
$this->authorize('update', $model);
$log = Actionlog::find($fileId);
if ($log) {
if (Storage::exists($rel_path.'/'.$log->filename)) {
Storage::delete($rel_path.'/'.$log->filename);
}
$log->delete();
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
}
}

View File

@@ -65,8 +65,6 @@ class AssetCheckoutController extends Controller
*/
public function store(AssetCheckoutRequest $request, $assetId) : RedirectResponse
{
try {
// Check if the asset exists
if (! $asset = Asset::find($assetId)) {
@@ -83,7 +81,6 @@ class AssetCheckoutController extends Controller
$admin = auth()->user();
$target = $this->determineCheckoutTarget();
session()->put(['checkout_to_type' => $target]);
$asset = $this->updateAssetLocation($asset, $target);

Some files were not shown because too many files have changed in this diff Show More