Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.x #1744

Merged
merged 241 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
3400f03
refactor: create assign to default company
FredPeal May 16, 2024
57b8ae0
refactor: debug test
FredPeal Jul 23, 2024
001577b
add abilities and modules
FredPeal Jul 23, 2024
374c33b
enums
FredPeal Jul 23, 2024
6aaf194
command
FredPeal Jul 23, 2024
be03270
refactor: comment kanvas update abilities
FredPeal Jul 23, 2024
92a2b40
execute command out of transaction
FredPeal Jul 23, 2024
ab0c293
fix: Ability
FredPeal Jul 23, 2024
59a59b4
refactor: clean pr
FredPeal Jul 23, 2024
b09fa10
refactor: role permission
FredPeal Jul 24, 2024
d8f31d9
refactor: comment debug
FredPeal Jul 25, 2024
9c50c7e
refact: user welcome email
kaioken Jul 29, 2024
21549fe
refact: user welcome email
kaioken Jul 29, 2024
7039f8b
Merge pull request #1742 from bakaphp/refact-user-reminder-emails
kaioken Jul 29, 2024
8daa8fb
Merge pull request #1722 from bakaphp/abilities-module-template
FredPeal Jul 29, 2024
423c014
Merge pull request #1355 from bakaphp/KA-252
FredPeal Jul 29, 2024
b00072d
use 1.x.Dockerfile instead of development's
rwhite27 Jul 29, 2024
619ff0b
use franken Dockerfile for develoment
rwhite27 Jul 30, 2024
cb8092f
use frankenphp dockerfile
rwhite27 Jul 30, 2024
34b4086
Merge pull request #1743 from bakaphp/feat-octane-frankenphp
rwhite27 Jul 30, 2024
d9a3649
revert using franken dockerfile
rwhite27 Jul 30, 2024
fc675d7
Merge pull request #1745 from bakaphp/feat-octane-frankenphp
rwhite27 Jul 30, 2024
eef13a0
feat: create user welcome email
kaioken Jul 30, 2024
6d88197
Merge pull request #1746 from bakaphp/feat-create-user-welcome-emai
kaioken Jul 30, 2024
6539c7c
refact: sync
kaioken Jul 30, 2024
2bef40b
Merge pull request #1747 from bakaphp/feat-create-user-welcome-emai
kaioken Jul 30, 2024
28411a1
Add fields to algolia
arfenis Jul 30, 2024
e3c9668
Merge pull request #1748 from bakaphp/algolia-tuneup
kaioken Jul 30, 2024
b548b47
build(deps): bump laravel/scout from 10.10.2 to 10.11.0
dependabot[bot] Jul 30, 2024
e5473ff
build(deps): bump laravel/framework from 11.18.1 to 11.19.0
dependabot[bot] Jul 30, 2024
3a70c45
build(deps-dev): bump phpunit/phpunit from 11.2.8 to 11.2.9
dependabot[bot] Jul 30, 2024
d74615f
refact: message cache
kaioken Jul 31, 2024
ca34ffd
refact: message cache
kaioken Jul 31, 2024
26c0189
refact: message cache
kaioken Jul 31, 2024
c0f448b
refact: message cache
kaioken Jul 31, 2024
9d96198
Merge pull request #1749 from bakaphp/dependabot/composer/laravel/sco…
kaioken Jul 31, 2024
8580d2b
Merge pull request #1750 from bakaphp/dependabot/composer/laravel/fra…
kaioken Jul 31, 2024
0e41934
Merge pull request #1751 from bakaphp/dependabot/composer/phpunit/php…
kaioken Jul 31, 2024
eecffcd
Merge pull request #1752 from bakaphp/feat-light-cache
kaioken Jul 31, 2024
5278a15
refact: message cache
kaioken Jul 31, 2024
daa8a1c
refact: message cache
kaioken Jul 31, 2024
59a778e
Merge pull request #1753 from bakaphp/feat-light-cache
kaioken Jul 31, 2024
07a850f
refact: message cache
kaioken Jul 31, 2024
fa2dab6
refact: message cache
kaioken Jul 31, 2024
c1ce35c
Merge pull request #1754 from bakaphp/feat-light-cache
kaioken Jul 31, 2024
3757e32
refact: social login company
kaioken Jul 31, 2024
d37a570
refact: social login company
kaioken Jul 31, 2024
7bfbd78
Merge pull request #1755 from bakaphp/refactor-social-login-company
kaioken Jul 31, 2024
6c6d036
fix: schema
FredPeal Aug 1, 2024
04e6c7c
Merge pull request #1756 from bakaphp/fix-schema
FredPeal Aug 1, 2024
023ea06
Remove frankenphp dockerfile and docker compose
rwhite27 Aug 1, 2024
8c5f72d
Add swoole package
rwhite27 Aug 1, 2024
38cb13a
update laravel octane section
rwhite27 Aug 1, 2024
8a45faa
Change port to 8000 to support laravel octane
rwhite27 Aug 1, 2024
ed62628
Move App Key check on middleware
rwhite27 Aug 1, 2024
5c27b56
refact: app kanvas key
kaioken Aug 1, 2024
33b9efd
refact: app kanvas key
kaioken Aug 1, 2024
e46d304
refact: app kanvas key
kaioken Aug 1, 2024
b737bd5
Merge pull request #1758 from bakaphp/refact-app-kanvas-key
kaioken Aug 1, 2024
c8764c6
Merge branch 'development' into feat-octane-frankenphp
rwhite27 Aug 1, 2024
e80de5d
refact: app kanvas key
kaioken Aug 1, 2024
274b718
refact: app kanvas key
kaioken Aug 1, 2024
5412ca6
Merge pull request #1757 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 1, 2024
0d35802
add restart swoole on ec2 deploy
rwhite27 Aug 1, 2024
d14952d
Merge branch 'feat-octane-frankenphp' of github.com:bakaphp/kanvas-ec…
rwhite27 Aug 1, 2024
8a705ae
build(deps-dev): bump phpstan/phpstan from 1.11.8 to 1.11.9
dependabot[bot] Aug 1, 2024
12449b4
build(deps): bump powersync/authorizenet-sdk-php from 2.0.4 to 2.0.7
dependabot[bot] Aug 1, 2024
bec64dc
build(deps): bump stripe/stripe-php from 15.4.0 to 15.5.0
dependabot[bot] Aug 1, 2024
e5416c6
expose port 8000 instead of 8080
rwhite27 Aug 1, 2024
f0d375b
Merge pull request #1759 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 1, 2024
1f2c2f4
Remove octane start command
rwhite27 Aug 1, 2024
93d6a86
Merge pull request #1763 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 1, 2024
9171037
restart supervisor from action
rwhite27 Aug 1, 2024
04860aa
fix format
rwhite27 Aug 1, 2024
9972da3
Merge pull request #1764 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 1, 2024
7ff10bb
restart supervisor by restarting container
rwhite27 Aug 2, 2024
d0426a4
Merge pull request #1765 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 2, 2024
ed4519c
start supervisor process after restarting container
rwhite27 Aug 2, 2024
8d2298d
Merge pull request #1766 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 2, 2024
fd5d719
restart container to restart process
rwhite27 Aug 2, 2024
c3bf25b
Merge pull request #1767 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 2, 2024
d0a1a25
stop and then restart supervisor process
rwhite27 Aug 2, 2024
d781be5
use octane reload and start octane at container start
rwhite27 Aug 2, 2024
091aa80
Merge pull request #1768 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 2, 2024
8eb8f97
Merge pull request #1762 from bakaphp/dependabot/composer/stripe/stri…
kaioken Aug 2, 2024
d2a9a57
Merge pull request #1761 from bakaphp/dependabot/composer/powersync/a…
kaioken Aug 2, 2024
0e91ef9
Merge pull request #1760 from bakaphp/dependabot/composer/phpstan/php…
kaioken Aug 2, 2024
a70c97f
refact: test namespace
kaioken Aug 2, 2024
c98d57b
Merge pull request #1769 from bakaphp/hotfix-test-namespace
kaioken Aug 2, 2024
0346e6f
refact: test
kaioken Aug 2, 2024
c62a00c
Merge pull request #1770 from bakaphp/hotfix-test-namespace
kaioken Aug 2, 2024
62d58a9
merge
arfenis Aug 2, 2024
c8c5876
save product model for data manipulation
arfenis Aug 2, 2024
6ffd97f
delete and repopulate attribute data on product update
arfenis Aug 2, 2024
1858766
force delete on product attribute
arfenis Aug 2, 2024
3706d3b
feedback
arfenis Aug 2, 2024
5bed7c9
stylo
arfenis Aug 2, 2024
2c19eb0
Merge pull request #1771 from bakaphp/product-attribute-update
arfenis Aug 2, 2024
905fdfc
delete validation
arfenis Aug 2, 2024
2b7cf20
Merge pull request #1772 from bakaphp/warehouses-delete-validation
arfenis Aug 2, 2024
2e5a2d1
rename channel variant relation
arfenis Aug 2, 2024
f50240b
Merge pull request #1773 from bakaphp/channels-fields-renaming
arfenis Aug 2, 2024
f344294
add id renaming directive
arfenis Aug 2, 2024
2ea5596
fix: middleware response
kaioken Aug 2, 2024
d5509fa
Merge pull request #1774 from bakaphp/renaming-field
arfenis Aug 2, 2024
2551d4b
Merge pull request #1775 from bakaphp/hotfix-middleware-response
kaioken Aug 2, 2024
514ce1d
Shopify setup validation
arfenis Aug 2, 2024
9cffae9
Return type regration
arfenis Aug 2, 2024
305a75f
Merge pull request #1776 from bakaphp/shopify-setup-validation
arfenis Aug 2, 2024
ea224f6
build(deps-dev): bump phpunit/phpunit from 11.2.9 to 11.3.0
dependabot[bot] Aug 2, 2024
e647551
build(deps): bump spatie/laravel-health from 1.30.0 to 1.30.1
dependabot[bot] Aug 2, 2024
3d9bf68
Merge pull request #1777 from bakaphp/dependabot/composer/phpunit/php…
kaioken Aug 3, 2024
f127d25
Merge pull request #1778 from bakaphp/dependabot/composer/spatie/lara…
kaioken Aug 3, 2024
d31ee89
feat: Add swoole config,host and port
rwhite27 Aug 5, 2024
3bcd950
Merge pull request #1779 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 5, 2024
c54b270
remove host and port from command
rwhite27 Aug 5, 2024
098a6cf
Merge pull request #1780 from bakaphp/feat-octane-frankenphp
rwhite27 Aug 5, 2024
660204d
fix roleId
FredPeal Aug 5, 2024
3e123b2
refact: synz
kaioken Aug 5, 2024
b749d9a
build(deps-dev): bump nunomaduro/collision from 8.3.0 to 8.4.0
dependabot[bot] Aug 5, 2024
7b83499
build(deps-dev): bump kitloong/laravel-migrations-generator
dependabot[bot] Aug 5, 2024
05f6987
build(deps): bump nuwave/lighthouse from 6.42.1 to 6.42.2
dependabot[bot] Aug 5, 2024
80fd894
Merge pull request #1782 from bakaphp/dependabot/composer/nunomaduro/…
kaioken Aug 5, 2024
fd7d910
Merge pull request #1783 from bakaphp/dependabot/composer/kitloong/la…
kaioken Aug 5, 2024
2763496
Merge pull request #1784 from bakaphp/dependabot/composer/nuwave/ligh…
kaioken Aug 5, 2024
93033ce
Merge pull request #1781 from bakaphp/hotfix-sync
kaioken Aug 5, 2024
9c3c519
fix: sync owner
kaioken Aug 5, 2024
8b0e72f
Merge pull request #1785 from bakaphp/hotfix-sync
kaioken Aug 6, 2024
edfd4d5
fix: save
kaioken Aug 6, 2024
54f6184
Merge pull request #1786 from bakaphp/hotfix-sync
kaioken Aug 6, 2024
841ab0d
Merge pull request #1787 from bakaphp/KCT-76
FredPeal Aug 6, 2024
1de8800
build(deps-dev): bump kitloong/laravel-migrations-generator
dependabot[bot] Aug 6, 2024
3281377
build(deps): bump laravel/scout from 10.11.0 to 10.11.1
dependabot[bot] Aug 6, 2024
8ec1649
Merge pull request #1788 from bakaphp/dependabot/composer/kitloong/la…
kaioken Aug 7, 2024
90353b1
build(deps): bump laravel/octane from 2.5.2 to 2.5.3
dependabot[bot] Aug 7, 2024
bb398fc
Merge pull request #1791 from bakaphp/dependabot/composer/laravel/sco…
kaioken Aug 7, 2024
a472587
Merge pull request #1789 from bakaphp/dependabot/composer/laravel/oct…
kaioken Aug 7, 2024
1496b92
add api requests log middleware
rwhite27 Aug 7, 2024
4acb1e7
fix format
rwhite27 Aug 7, 2024
668ce7c
Merge pull request #1792 from bakaphp/feat-datadog-api-request-tracing
rwhite27 Aug 7, 2024
9887195
add type of request and resouce in request info
rwhite27 Aug 7, 2024
11ab6d4
fix format
rwhite27 Aug 7, 2024
0cb7ab8
fix format
rwhite27 Aug 7, 2024
60d19e6
fix format
rwhite27 Aug 7, 2024
f4a07e6
fix format
rwhite27 Aug 7, 2024
bad5534
Merge pull request #1793 from bakaphp/feat-datadog-api-request-tracing
rwhite27 Aug 7, 2024
5de10c8
refact: sync
kaioken Aug 7, 2024
aa4f26c
feat: message view
kaioken Aug 7, 2024
1df3fbd
refact: view message
kaioken Aug 7, 2024
722635c
refact: view message
kaioken Aug 8, 2024
43b33ff
Update APIRequestsLogMiddleware.php
kaioken Aug 8, 2024
d6414e7
feat: get user by displayname
kaioken Aug 8, 2024
7bd757d
fix: get user by displayname
kaioken Aug 8, 2024
52b0c32
Merge pull request #1794 from bakaphp/hotfix-sync
kaioken Aug 8, 2024
2703451
refact: middelware
kaioken Aug 8, 2024
6c85db4
disable api requests loggin middleware for now
rwhite27 Aug 8, 2024
315c63f
Merge pull request #1795 from bakaphp/feat-datadog-api-request-tracing
rwhite27 Aug 8, 2024
32db358
use redis to batch create logs
rwhite27 Aug 8, 2024
89bd790
add const for max log size
rwhite27 Aug 8, 2024
2396b75
fix format
rwhite27 Aug 8, 2024
f4048fd
fix format
rwhite27 Aug 8, 2024
ffbef3d
Merge branch 'development' into feat-datadog-api-request-tracing
rwhite27 Aug 8, 2024
92633e7
build(deps-dev): bump phpstan/phpstan from 1.11.9 to 1.11.10
dependabot[bot] Aug 8, 2024
0291bb8
Merge pull request #1797 from bakaphp/dependabot/composer/phpstan/php…
kaioken Aug 9, 2024
6d36aed
build(deps): bump stripe/stripe-php from 15.5.0 to 15.6.0
dependabot[bot] Aug 9, 2024
0406e03
Merge pull request #1798 from bakaphp/dependabot/composer/stripe/stri…
kaioken Aug 11, 2024
c88a1ad
refactor: run workflows with custom fields
FredPeal Aug 12, 2024
07ff13b
Apply fixes from StyleCI
StyleCIBot Aug 12, 2024
71c2712
Merge pull request #1800 from bakaphp/analysis-BoNDaO
FredPeal Aug 12, 2024
dc7caa9
Add batch logger job
rwhite27 Aug 12, 2024
b865043
Merge branch 'feat-datadog-api-request-tracing' of github.com:bakaphp…
rwhite27 Aug 12, 2024
ddae457
fix format
rwhite27 Aug 12, 2024
216e64b
add batch logger queue
rwhite27 Aug 12, 2024
f8c06fd
Rename Batch Logger Service and add app id on log message
rwhite27 Aug 12, 2024
9a0fee7
Merge pull request #1796 from bakaphp/feat-datadog-api-request-tracing
rwhite27 Aug 12, 2024
c7b0af3
add batch logger to queue restart
rwhite27 Aug 12, 2024
299cdbc
Merge pull request #1801 from bakaphp/feat-datadog-api-request-tracing
rwhite27 Aug 12, 2024
b997197
update: composer
kaioken Aug 13, 2024
911b0bc
refactor: fire workflow on custom fields
FredPeal Aug 13, 2024
0848fe1
refactor
FredPeal Aug 13, 2024
2f58f3b
Merge branch 'development' of github.com:bakaphp/kanvas-ecosystem-api…
FredPeal Aug 13, 2024
eb4f871
Apply fixes from StyleCI
StyleCIBot Aug 13, 2024
2547d34
build(deps): bump spatie/laravel-data from 4.8.0 to 4.8.1
dependabot[bot] Aug 13, 2024
0e3c3c2
Merge pull request #1803 from bakaphp/analysis-APnQEG
FredPeal Aug 13, 2024
784da1c
refactor: fix git lens
FredPeal Aug 13, 2024
95020d7
Merge branch 'KCT-106' of github.com:bakaphp/kanvas-ecosystem-api int…
FredPeal Aug 13, 2024
a1d4de6
change port to 8000 on 1.x dockerfile and add octane command on conta…
rwhite27 Aug 13, 2024
b907b5a
Merge pull request #1804 from bakaphp/dependabot/composer/spatie/lara…
kaioken Aug 13, 2024
0e1d1d3
refact: fix sync tags
kaioken Aug 14, 2024
20f1b27
Merge pull request #1806 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
aa99493
refactor: remove observer
FredPeal Aug 14, 2024
4c36733
refact: fix tags
kaioken Aug 14, 2024
b8884f8
Merge pull request #1807 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
8e1dd1d
fix: issues
kaioken Aug 14, 2024
fa89b08
fix: issues
kaioken Aug 14, 2024
ec7c71c
Merge pull request #1808 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
1f56664
refactor: remove custom fields
FredPeal Aug 14, 2024
6a0c094
Merge pull request #1809 from bakaphp/KCT-106
FredPeal Aug 14, 2024
22bf3ee
refact: add audience segment
kaioken Aug 14, 2024
e1045f6
refact: add audience segment
kaioken Aug 14, 2024
467d568
Merge pull request #1810 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
ca64f5e
refact: fix
kaioken Aug 14, 2024
eec2ef2
Merge pull request #1811 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
b4a3cfb
fix: retry
kaioken Aug 14, 2024
439711c
Merge pull request #1812 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
00064a0
fix: retry
kaioken Aug 14, 2024
dac60e0
Merge pull request #1813 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
f6ff1e7
fix: retry
kaioken Aug 14, 2024
394b3fd
Merge pull request #1814 from bakaphp/hotfix-sync-tags
kaioken Aug 14, 2024
3e35a5f
fix: hotfix stupid fix for user full table
kaioken Aug 15, 2024
1c6fc3d
Merge pull request #1815 from bakaphp/hotfix-sync-tags
kaioken Aug 15, 2024
bf9a83a
Add dislike property and functions for messages
rwhite27 Aug 15, 2024
7aba647
add total_disliked column to messages
rwhite27 Aug 15, 2024
709da6b
fix format of migration file
rwhite27 Aug 15, 2024
304912f
modify likeable trait to handle dislikes
rwhite27 Aug 15, 2024
ccb44f2
fix typo on migration
rwhite27 Aug 15, 2024
308971a
Merge pull request #1805 from bakaphp/feat-swoole-prod
kaioken Aug 15, 2024
8bc9857
add missing function on likeable trait
rwhite27 Aug 15, 2024
864ca2f
fix format
rwhite27 Aug 15, 2024
b6a4a1b
fix documentation
rwhite27 Aug 15, 2024
7be7f3a
fix format
rwhite27 Aug 15, 2024
93ad39f
build(deps): bump stripe/stripe-php from 15.6.0 to 15.7.0
dependabot[bot] Aug 15, 2024
6a389ca
build(deps): bump sentry/sentry-laravel from 4.7.1 to 4.8.0
dependabot[bot] Aug 15, 2024
0739dda
fix test
rwhite27 Aug 15, 2024
140e266
Merge pull request #1818 from bakaphp/dependabot/composer/stripe/stri…
kaioken Aug 15, 2024
d47115d
Merge pull request #1819 from bakaphp/dependabot/composer/sentry/sent…
kaioken Aug 15, 2024
26758c9
hotfix- social
kaioken Aug 16, 2024
fc2f92a
Update README.md
kaioken Aug 16, 2024
75520b1
Update README.md
kaioken Aug 16, 2024
53c720e
feat: add message tags
kaioken Aug 18, 2024
80bb5bb
feat: filter by tags
kaioken Aug 18, 2024
7e05834
fix: format
kaioken Aug 18, 2024
9701dfd
Merge pull request #1820 from bakaphp/feat-message-tags
kaioken Aug 18, 2024
48023b9
Merge branch 'development' into feat-total-unliked-column-social-message
kaioken Aug 19, 2024
01197ad
fix: test
kaioken Aug 19, 2024
a1c4816
fix: input
kaioken Aug 19, 2024
11003c2
fix: issues
kaioken Aug 19, 2024
0501482
feat: add graphql mutation
kaioken Aug 19, 2024
1cfbc4a
Merge pull request #1817 from bakaphp/feat-total-unliked-column-socia…
kaioken Aug 19, 2024
1d07862
feeat: add total view
kaioken Aug 19, 2024
4789fb7
Merge pull request #1823 from bakaphp/feat-total-unliked-column-socia…
kaioken Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ec2-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ jobs:
docker restart queue-notifications
docker restart queue-social
docker restart laravel-scheduler
docker restart batch-logger-queue
if [ "docker-compose.${{ github.ref_name }}.yml" == "docker-compose.1.x.yml" ]; then
docker restart queue4
docker restart queue5
docker restart queue6
fi

docker exec -i phpkanvas-ecosystem php artisan octane:reload
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
MEILISEARCH_HOST: http://localhost:7700
MEILISEARCH_KEY: masterKey
SCOUT_QUEUE: false
#APP_DEBUG: true
# APP_DEBUG: true

#third party integration
TEST_ZOHO_CLIENT_ID: ${{ secrets.TEST_ZOHO_CLIENT_ID }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ service-account.json
/tools/*
/tools/php-cs-fixer/*
/tools/php-cs-fixer/vendor/*

/caddy
frankenphp
frankenphp-worker.php
2 changes: 1 addition & 1 deletion 1.x.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ RUN chmod -R 777 /var/www/html/storage/logs/

RUN composer install --no-dev --optimize-autoloader

EXPOSE 8080
EXPOSE 8000
13 changes: 13 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ http://localhost {
# Enable compression (optional)
encode zstd br gzip

@options_method {
method OPTIONS
}

handle @options_method {
header Access-Control-Allow-Origin "*"
header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE"
header Access-Control-Allow-Headers "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Public-Key,Authorization,X-Kanvas-App,X-Kanvas-Key,X-Kanvas-Location"
header Access-Control-Max-Age "1728000"
header Content-Type "text/plain charset=UTF-8"
respond "" 204
}

php_fastcgi /php-fpm
# Execute PHP files from the public/ directory and serve assets
php_server
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ DB_CRM_PASSWORD=password

## Running the project with Laravel Octane

After doing all the steps above, you could run the project with Laravel Octane by using the command ```php artisan octane:start --port 8080 --host=0.0.0.0```.
After doing all the steps above, you could run the project with Laravel Octane by using the command ```php artisan octane:start --server=swoole --host=0.0.0.0 --port=8000```.

Use `--watch` in development allowing you to refresh modified files, this works assuming to have `npm install chokidar` installed in the project.
****
Expand All @@ -116,12 +116,3 @@ Note:
- To install Swoole you can use the command ```pecl install swoole```
- For production remove `--watch` from the command.
- roles_kanvas_legacy will be deleted in the future.


## Feature Labs

### Run the project using FrankenPHP

``` sh
docker compose -f docker-compose.franken.yml up -d --build
```
42 changes: 42 additions & 0 deletions app/Console/Commands/AccessControl/UpdateAbilitiesCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App\Console\Commands\AccessControl;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use Kanvas\AccessControlList\Actions\CreateAbilitiesByModule;
use Kanvas\Apps\Models\Apps;
use Kanvas\AccessControlList\Enums\ModuleEnum;
use Kanvas\AccessControlList\Repositories\RolesRepository;

class UpdateAbilitiesCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'kanvas:update-abilities {app?}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Execute the console command.
*/
public function handle()
{
if ($key = $this->argument('app')) {
$apps = Apps::where('key', $key)->get();
} else {
$apps = Apps::all();
}
foreach ($apps as $app) {
(new CreateAbilitiesByModule($app))->execute();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Kanvas\Inventory\Products\Models\Products;
use Kanvas\Inventory\Warehouses\Models\Warehouses;
use Kanvas\Users\Models\UserCompanyApps;
use Throwable;

class ShopifyInventorySyncCommand extends Command
{
Expand Down Expand Up @@ -53,11 +54,16 @@ public function handle()
->get();

foreach ($products as $product) {
$this->info("Checking product {$product->getId()} {$product->name} \n");
try {
$this->info("Checking product {$product->getId()} {$product->name} \n");

$shopifyService = new ShopifyInventoryService($product->app, $product->company, $warehouses);
$shopifyService->saveProduct($product, StatusEnum::ACTIVE, $channel);
$shopifyService = new ShopifyInventoryService($product->app, $product->company, $warehouses);
$shopifyService->saveProduct($product, StatusEnum::ACTIVE, $channel);
} catch (Throwable $e) {
$this->error("Error syncing product {$product->getId()} {$product->name} \n");
}
}

return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public function handle()
$leadsPerPage = (int) $this->argument('leadsPerPage');

$downloadAllLeads = new DownloadAllZohoLeadAction($app, $company, $leadReceiver);
$downloadAllLeads->execute($page, $leadsPerPage);
$leads = $downloadAllLeads->execute($page, $leadsPerPage);

foreach ($leads as $lead) {
echo 'Lead ' . $lead->id . ' downloaded' . PHP_EOL;
}

$this->info($downloadAllLeads->getTotalLeadsProcessed() . ' leads downloaded from Zoho to ' . $leadReceiver->name);

Expand Down
5 changes: 4 additions & 1 deletion app/GraphQL/Connector/Shopify/Mutations/ShopifyMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Kanvas\Apps\Models\Apps;
use Kanvas\Companies\Models\Companies;
use Kanvas\Connectors\Shopify\Client;
use Kanvas\Connectors\Shopify\DataTransferObject\Shopify as ShopifyDto;
use Kanvas\Connectors\Shopify\ShopifyService;
use Kanvas\Users\Repositories\UsersRepository;
Expand All @@ -22,6 +23,8 @@ public function shopifySetup(mixed $root, array $request): bool

$shopifyDto = ShopifyDto::viaRequest($request['input'], $app, $company);

return ShopifyService::shopifySetup($shopifyDto);
ShopifyService::shopifySetup($shopifyDto);

return ! empty(Client::getInstance($app, $company, $shopifyDto->region)->Shop->get());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Kanvas\Auth\Actions\SocialLoginAction;
use Kanvas\Auth\DataTransferObject\LoginInput;
use Kanvas\Auth\DataTransferObject\RegisterInput;
use Kanvas\Auth\Services\AuthenticationService;
use Kanvas\Auth\Services\ForgotPassword as ForgotPasswordService;
use Kanvas\Auth\Socialite\SocialManager;
use Kanvas\Auth\Traits\AuthTrait;
Expand Down Expand Up @@ -122,12 +123,7 @@ public function register(
)->validate();
PasswordValidation::validateArray($request['data'], $app);

$userRegistrationAssignToAppDefaultCompanyBranch = $app->get(AppSettingsEnums::GLOBAL_USER_REGISTRATION_ASSIGN_GLOBAL_COMPANY->getValue());
$branch = null;
if ($userRegistrationAssignToAppDefaultCompanyBranch) {
$branch = CompaniesBranches::getById($userRegistrationAssignToAppDefaultCompanyBranch);
}

$branch = AuthenticationService::getAppDefaultAssignCompanyBranch($app);
$data = RegisterInput::fromArray($request['data'], $branch);
$user = new RegisterUsersAction($data);
$request = request();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,47 @@ public function attachFile(mixed $rootValue, array $request): string
*/
public function deAttachFile(mixed $rootValue, array $request): bool
{
$app = app(Apps::class);
$user = auth()->user();

$fileEntity = FilesystemEntities::where('uuid', $request['uuid'])
->fromCompany(auth()->user()->getCurrentCompany())
->when(! $user->isAdmin(), function ($query) use ($user) {
$query->fromCompany($user->getCurrentCompany());
})
->notDeleted()
->firstOrFail();

if ($fileEntity->filesystem->apps_id != $app->getId()) {
return false;
}

return $fileEntity->softDelete();
}

public function deAttachFiles(mixed $rootValue, array $request): bool
{
$company = auth()->user()->getCurrentCompany();
$app = app(Apps::class);
$user = auth()->user();
$i = 0;

$fileEntities = FilesystemEntities::whereIn('uuid', $request['uuids'])
->fromCompany($company)
->when(! $user->isAdmin(), function ($query) use ($user) {
$query->fromCompany($user->getCurrentCompany());
})
->notDeleted()
->get();

foreach ($fileEntities as $fileEntity) {
$fileEntity->softDelete();
if ($fileEntity->filesystem->apps_id != $app->getId()) {
continue;
}

if ($fileEntity->softDelete()) {
$i++;
}
}

return true;
return $i == count($request['uuids']);
}

/**
Expand Down
29 changes: 26 additions & 3 deletions app/GraphQL/Ecosystem/Mutations/Roles/RolesManagementMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Baka\Support\Str;
use Bouncer;
use Illuminate\Support\Facades\Redis;
use Kanvas\AccessControlList\Actions\AssignRoleAction;
use Kanvas\AccessControlList\Actions\CreateRoleAction;
use Kanvas\AccessControlList\Actions\UpdateRoleAction;
Expand All @@ -14,6 +15,7 @@
use Kanvas\AccessControlList\Repositories\RolesRepository;
use Kanvas\Apps\Models\Apps;
use Kanvas\Exceptions\ValidationException;
use Kanvas\SystemModules\Repositories\SystemModulesRepository;
use Kanvas\Users\Repositories\UsersRepository;
use Nuwave\Lighthouse\Exceptions\AuthorizationException;
use Silber\Bouncer\Database\Role as SilberRole;
Expand Down Expand Up @@ -59,7 +61,7 @@ public function removeRoleFromUser(mixed $rootValue, array $request): bool

$role = RolesRepository::getByMixedParamFromCompany($request['role']);

if ($auth->isAppOwner()) {
if ($auth->isAdmin()) {
$user = UsersRepository::getUserOfAppById($userId, $app);
} else {
$user = UsersRepository::getUserOfCompanyById($company, $userId);
Expand All @@ -70,6 +72,28 @@ public function removeRoleFromUser(mixed $rootValue, array $request): bool
return true;
}

public function givePermissionToRole(mixed $rootValue, array $request): bool
{
$systemModule = SystemModulesRepository::getByModelName($request['systemModule'], app(Apps::class));
Bouncer::allow($request['role'])->to($request['permission'], $systemModule->model_name);

$roles = RolesRepository::getMapAbilityInModules($request['role']);
Redis::set(RolesEnums::KEY_MAP->value, $roles);

return true;
}

public function removePermissionToRole(mixed $rootValue, array $request): bool
{
$systemModule = SystemModulesRepository::getByModelName($request['systemModule'], app(Apps::class));
Bouncer::disallow($request['role'])->to($request['permission'], $systemModule->model_name);

$roles = RolesRepository::getMapAbilityInModules($request['role']);
Redis::set(RolesEnums::KEY_MAP->value, $roles);

return true;
}

/**
* givePermissionToUser.
*/
Expand All @@ -85,8 +109,7 @@ public function givePermissionToUser(mixed $rootValue, array $request): bool
} else {
$user = UsersRepository::getUserOfCompanyById($company, $userId);
}

Bouncer::allow($user)->to(Str::slug($request['permission']));
Bouncer::allow($user)->to(Str::simpleSlug($request['permission']));

return true;
}
Expand Down
19 changes: 17 additions & 2 deletions app/GraphQL/Ecosystem/Queries/Roles/RoleAbilitiesQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@

namespace App\GraphQL\Ecosystem\Queries\Roles;

use Illuminate\Support\Facades\Redis;
use Kanvas\AccessControlList\Repositories\RolesRepository;
use Kanvas\Companies\Repositories\CompaniesRepository;
use Kanvas\Users\Repositories\UsersRepository;
use Kanvas\AccessControlList\Enums\RolesEnums;

class RoleAbilitiesQuery
{
public function getAllAbilities(mixed $root, array $query): array
{
$company = $query['companyId'] ? CompaniesRepository::getById((int)$query['companyId']) : auth()->user()->getCurrentCompany();
$abilities = UsersRepository::getUserOfCompanyById(
auth()->user()->getCurrentCompany(),
$query['userId']
$company,
(int)$query['userId']
)->getAbilities();

$mapAbilities = $abilities->map(function ($ability) {
Expand All @@ -21,4 +26,14 @@ public function getAllAbilities(mixed $root, array $query): array

return $mapAbilities->all();
}

public function getAllAbilitiesByRoles(mixed $root, array $request): array
{
$roles = RolesRepository::getMapAbilityInModules($request['role']);
if ($map = Redis::get(RolesEnums::KEY_MAP->value)) {
return $map;
}
Redis::set(RolesEnums::KEY_MAP->value, $roles);
return $roles;
}
}
18 changes: 18 additions & 0 deletions app/GraphQL/Ecosystem/Queries/Users/UsersListQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace App\GraphQL\Ecosystem\Queries\Users;

use Kanvas\Apps\Models\Apps;
use Kanvas\Users\Models\Users;
use Kanvas\Users\Models\UsersAssociatedApps;
use Kanvas\Users\Repositories\UsersRepository;

class UsersListQuery
Expand All @@ -21,4 +23,20 @@ public function getFromCurrentCompany($rootValue, array $request): Users
(int) $request['id']
);
}

public function getByDisplayNameFromApp($rootValue, array $request): Users
{
$app = app(Apps::class);
$user = auth()->user();

$displayname = $request['displayname'];
if (! $user->isAppOwner()) {
$displayname = $user->displayname;
}

return UsersAssociatedApps::where('displayname', $displayname)
->fromApp($app)
->firstOrFail()
->user;
}
}
4 changes: 2 additions & 2 deletions app/GraphQL/Inventory/Mutations/Products/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public function update(mixed $root, array $req): ProductsModel

$product = ProductsRepository::getById((int) $req['id'], $company);
$productDto = ProductDto::viaRequest($req['input'], $product->company);
$action = new UpdateProductAction($product, $productDto, auth()->user());
$productModel = (new UpdateProductAction($product, $productDto, auth()->user()))->execute();

return $action->execute();
return $productModel;
}

/**
Expand Down
Loading
Loading