Commit Graph

1467 Commits

Author SHA1 Message Date
Oliver Windall Juhl
7302d76e12 feat(medusa,medusa-js,medusa-react): Add BatchJob API support in medusa-js + medusa-react (#1704)
* Add BatchJob API to medusa-js

* Adds BatchJob API hooks

* Fix tests in medusa-react
2022-06-21 11:08:44 +02:00
Philip Korsholm
5f2744eb9f Feat (medusa): convert custom shipping option service to typescript (#1652)
* convert custom shipping option service to typescript

* polishing

* remove unnecessary imports

* Update packages/medusa/src/services/custom-shipping-option.ts

Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>

* pr feedback

* fix typing after removing optional metadataparameter

* add injected dependencies

* add await

Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
2022-06-21 09:25:54 +02:00
Zakaria El Asri
765c794b97 fix(medusa): Add images relation (#1693) 2022-06-20 12:07:17 +02:00
Zakaria El Asri
f0be31120f refactor(medusa): Migrate ProductService to TS (#1625)
* refactor: product service

* fix: type errors in consumers

* fix: use Status enum instead of ProductStatus

* fix: remove ProductStatus

* fix: rename ProductStatus

* fix: product model nullable fields

* fix: explicit typecasting in listVariants

* fix: use atomicPhase in public methods

* fix: use transactionManager in protected methods

* fix: remove disable eslint rule comment

* fix: retrieveVariants relations

* fix: retrieveVariants

* fix: FilterableProductProps validation

* fix: nullable thumbnail

* fix: tests by making model column types more explicit

* move upsert method to repo layer

* fix: unit tests

* fix: integration tests

* fix: product tags query + integration test

* fix: rename FindWithRelationsOptions to FindWithoutRelationsOptions

* fix (productRepository): use string[] for relations

* refactor: extract price relation filtering logic into util

* fix: failing unit test

* rename DTO suffix to Input suffix

* fix: missing awaits

* fix: check for images and tags length

* fix: remove unneeded function

* extract types used in product service to types folder

* fix: use text instead of varchar

* remove: reorderOptions from ProductService

* fix: product model

* fix: add private retrieve method

* fix: conflicts

* fix: failing unit test

* fix: integration test

* fix: remove ProductSelector type

* fix: remove validateId

* fix: use spread operator

* fix: repo method typings

* fix: remove comment
2022-06-20 10:50:46 +01:00
Zakaria El Asri
9e686a8e47 feat(medusa): Parsing CSV files (#1572)
* add: csv parser

* fix: tests

* fix: linting + comment

* add: missing dependency

* fix: generic transformers

* fix: address comments

* fix: make parser options generic

* add: support regex columns + fix missing columns bug

* improve test case

* add: support for reducer + tests

* fix: add comments to csv parser
2022-06-19 16:10:15 +01:00
Zakaria El Asri
46a6e1a4d3 fix(medusa): Remove duplicate DiscountRuleType import (#1699) 2022-06-19 16:17:48 +02:00
olivermrbl
1ee7691c2b Merge branch 'master' into develop 2022-06-19 13:12:21 +02:00
olivermrbl
8e43ef2b3a chore(release): Publish
- medusa-file-minio@1.0.6
 - medusa-file-s3@1.1.2
 - medusa-file-spaces@1.2.2
 - medusa-fulfillment-webshipper@1.3.2
 - @medusajs/medusa-js@1.2.2
 - medusa-payment-paypal@1.2.2
 - medusa-payment-stripe@1.1.40
 - medusa-plugin-algolia@0.2.2
 - medusa-plugin-contentful@1.2.2
 - medusa-plugin-mailchimp@1.1.41
 - medusa-plugin-meilisearch@0.2.2
 - medusa-plugin-sendgrid@1.3.2
 - medusa-plugin-slack-notification@1.3.2
 - medusa-plugin-twilio-sms@1.2.2
 - medusa-react@0.3.2
 - @medusajs/medusa@1.3.2
2022-06-19 13:11:05 +02:00
olivermrbl
c85ef984cc Merge branch 'master' into develop 2022-06-19 12:59:08 +02:00
Oliver Windall Juhl
6b23208d63 fix(medusa): Include adjustments when authorizing payment (#1697) 2022-06-19 12:58:47 +02:00
Adrien de Peretti
93aaaa71bd feat(medusa): Update BuildQuery typings (#1672) 2022-06-17 10:03:51 +02:00
Adrien de Peretti
453688682c feat(medusa): Support batch-job API (#1547)
* feat(medusa): Implement confirm batch job end point

* feat(medusa): Implement confirm batch-job end point

* feat(medusa): Add create batch job end point and implementation

* feat(medusa): remove cancelled related

* feat(medusa): Remove unrelated content for batch job creation

* feat(medusa): Cleanup migration

* feat(medusa): Cleanup context

* fix(medusa): Batch-job service import

* feat(medusa): Update migration

* test(medusa): Fix batch job tests

* feat(medusa): Start batch job end point

* feat(medusa): Continue end points

* feat(medusa): Continue end points

* feat(medusa): Finalize batch-job end points

* style(medusa): Lint

* feat(medusa): Cleanup

* feat(medusa): Fix list-batch-job endpoint column selection

* feat(medusa): Batch-job feedback

* feat(medusa): Update create-batch-job endpoint doc

* test(integration-tests): Fix batch-job integration reguarding the response status code

* feat(medusa): Finalize rebase from develop

* feat(medusa): Extend batch job status with ready_at and failed_at

* feat(medusa): Update migration and tests accordingly

* feat(medusa): Update status order on batchJob

* feat(medusa): Enhance batchJobService status update

* style(medusa): Cleanup

* style(medusa): Typo

* style(medusa): Remove unnecessary comment

* cleanup(medusa): Address feedback

* test(integration-tests): Update naming and snapshots

* fix(medusa): Update validator

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* Fix(medusa): update validator

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* test(intergration-tests): Fix creates batch job

* test(integration-tests): Fix snapshot

* feat(medusa): Re-work status

* tests(integration-tests): Fix batch job

* feat(medusa): Addresses feedback

* fix(medusa): Revert package.json script

* feat(medusa/batch-job-api): Improve status management

* feat(medusa): Improve batch job status and remove some context validation from the service

* feat(medusa): BatchJob api merge params

* feat(medusa): Apply last changes on the batch job service

* Update packages/medusa/src/services/batch-job.ts

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat(medusa): BatchJobStrategy and loaders (#1434)

* add batch job strategy interface

* update plugin loaders

* remove comment

* make map async

* ensure that only one of each strategy is registered

* register strategies plural

* add identifier and batchType properties

* extend batch job strategy identification method

* initial test

* update loaders to accomodate different ways of accessing batch job strategies

* identifier batch type field

* redo merge in plugins

* update interface and load only js files

* use switches instead of elif

* remove comments

* use static properties for strategy registration

* update tests

* fix unit tests

* update test names

* update isBatchJobStrategy method

* add check for TransactionBaseService in services for plugins

* update interfaces export

* update batchjob strategy interface with a prepare script

* update loaders

* update batchjob strategy interface

* remove everything but public interface methods from batchJobStrategy

* add default implementation to prepareBathJobForProcessing

* remove unused import

* docs: Add Services reference (#1548)

* added events reference

* add upgrade guide for 1.3.0

* Update 1-3-0.md

* merge 1.3.0 with 1.3.1

* rename to 1.3.0

* added paypal documentation

* Improve storefront quickstart documents

* chore(deps): bump sqlite3 from 5.0.2 to 5.0.3 (#1453)

Bumps [sqlite3](https://github.com/TryGhost/node-sqlite3) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/TryGhost/node-sqlite3/releases)
- [Changelog](https://github.com/TryGhost/node-sqlite3/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TryGhost/node-sqlite3/compare/v5.0.2...v5.0.3)

* fix: Issue with cache in CI pipeline

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-16 13:57:18 +02:00
Philip Korsholm
886dcbc82f feat(medusa): BatchJobStrategy and loaders (#1434)
* add batch job strategy interface

* update plugin loaders

* remove comment

* make map async

* ensure that only one of each strategy is registered

* register strategies plural

* add identifier and batchType properties

* extend batch job strategy identification method

* initial test

* update loaders to accomodate different ways of accessing batch job strategies

* identifier batch type field

* redo merge in plugins

* update interface and load only js files

* use switches instead of elif

* remove comments

* use static properties for strategy registration

* update tests

* fix unit tests

* update test names

* update isBatchJobStrategy method

* add check for TransactionBaseService in services for plugins

* update interfaces export

* update batchjob strategy interface with a prepare script

* update loaders

* update batchjob strategy interface

* remove everything but public interface methods from batchJobStrategy

* add default implementation to prepareBathJobForProcessing

* remove unused import
2022-06-15 10:46:55 +02:00
Sebastian Rindom
cffb03d197 fix(medusa): update cron schedule to be every 6 hours (#1658) 2022-06-14 14:52:27 +02:00
Sebastian Rindom
14366f536d fix: adds tax calculation to product pricing (#1354)
* fix: adds tax calculation to product pricing

* fix: dedupe

* fix: merge inconsistencies

* fix: merge inconsistencies
2022-06-14 10:11:18 +02:00
Adrien de Peretti
9a3ff32b42 refactor(medusa): Convert DraftOrderService to TS (#1259) 2022-06-13 20:29:23 +02:00
Adrien de Peretti
28ddf10446 fix(medusa): Plugin loader must also check for TransactionBaseService (#1601) 2022-06-13 17:53:52 +02:00
Adrien de Peretti
012513b6a1 feat(medusa-cli): Allow to revert migrations from the CLI (#1353) 2022-06-13 14:15:09 +02:00
Philip Korsholm
b478b10438 refactor(medusa): Convert ShippingOptionService to typescript (#1644)
* convert shipping option service to typescript

* update jsdoc

* make update look update object

* update price reverting for calculated prices  when deselecting free shipping option

* update typescript service implementation

* pr feedback
2022-06-13 09:55:50 +02:00
Adrien de Peretti
3359e189a7 feat(medusa): Support transformQuery/Body middleware, introduction of pipe feature (#1593)
* feat(medusa): Support transformQuery middleware

* feat(medusa): Add support for transformBody

* test(medusa): Fix unit tests

* feat(medusa): Cleanup import

* feat(medusa): Update pipe required fields

* feat(medusa): Cleanup

* feat(medusa): Types cleanup

* feat(medusa): Types cleanup

* feat(medusa): Improve global typings and add one more example

* fix(medusa): Wrong wording in the error for prepareListQuery utility
2022-06-10 16:25:09 +02:00
Philip Korsholm
d011f38305 add default file service (#1627) 2022-06-10 16:24:11 +02:00
Philip Korsholm
1fe518b4af Feat(medusa) refactor claim-item service to typescript (#1640)
* refactor claim-item service to typescript

* update pr
2022-06-10 10:15:48 +02:00
Adrien de Peretti
a605622bcb refactor(medusa): Migrate StoreService to TS (#1413) 2022-06-09 19:46:50 +01:00
Adrien de Peretti
5172b21d09 refactor(medusa): Refactor and fix EventBusService (#1377) 2022-06-09 17:18:22 +01:00
Adrien de Peretti
78bd61abe1 Refactor: claim service to TS + refactoring (#1287) 2022-06-09 10:29:44 +01:00
Adrien de Peretti
63bf684e66 refactor(medusa): Migrate middlewares to ts (#1469) 2022-06-08 14:52:45 +01:00
Adrien de Peretti
d98cd85d23 feat(medusa): Migrate utils to TS (#1415) 2022-06-08 11:05:24 +01:00
Zakaria El Asri
247ad6dc6d fix: includes variant prices when listing products using a search query (#1607)
* fix: return prices when lsiting products with a query

* add: integration test

* fix: integration test

* fix: move WithRequiredProperty to common.ts

* fix: comment
2022-06-05 21:52:31 +01:00
Philip Korsholm
abaf10b31d feat(medusa-file-spaces): DigitalOcean fileservice streaming (#1585)
* add file service interface initial

* pr feedback

* use abstract fileservice for file service plugins

* update plugin loader for services

* implement fileservices with abstractFileService and convert to ts

* update fileservice interface

* remove fileservice loading of old interface

* re-add loading of old fileservice interface

* re-rename digital ocean fileservice to javascript

* revert s3 to js

* revert minio to js

* remove irrelevant method implementation

* rename download stream method to reflect upload stream method

* update fileservice

* use isFileService in loaders

* remove fields from js class

* rename "generatePresignedDownloadUrl" to "getPresignedDownloadUrl"

* make methods abstract in AbstractFileService

* create download stream endpoint (#1583)

* Feat/upload to storage (#1580)

* add test generate endpoint to api

* rename method to getUploadStream

* cleanup generate example

* upload file example

* remove comment

* make vars const

* Feat/create presigned download url (#1582)

* implement "generatePresignedDownloadUrl"

* add get-download-url endpoint for testing

* remove examples

* update index ts

* create generalized method for aws update in DO fileservice

* update bucket configuration

* update interface types

* add typings to fileservice methods

* update service loaders

* update fileservice interface to extend transaction base service

* create download stream endpoint (#1583)

* Feat/upload to storage (#1580)

* add test generate endpoint to api

* rename method to getUploadStream

* cleanup generate example

* upload file example

* remove comment

* make vars const

* Feat/create presigned download url (#1582)

* implement "generatePresignedDownloadUrl"

* add get-download-url endpoint for testing

* remove examples

* update index ts

* create generalized method for aws update in DO fileservice

* update bucket configuration

* update interface types

* update download method name

* revert changes

* add filekey and optional extension to the fileservice result

* add key to the result of getUploadStream

* rename key to filekey

* rename key to filekey in getUploadStream result

* rename key to filekey in getDownloadStream and getPresignedDownloadUrl

* rename key to fileKey for getUploadedFileType

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2022-06-04 10:37:21 +02:00
Philip Korsholm
8e42d37e84 feat(medusa): Extend file-service interface + move to core (#1577) 2022-06-04 10:11:17 +02:00
Adrien de Peretti
d7a3218fbe test(medusa): Add few tests on PriceListService#update method (#1554) 2022-05-31 09:26:42 +02:00
olivermrbl
6c1a722b38 chore(release): Publish
- medusa-file-minio@1.0.5
 - medusa-file-s3@1.1.1
 - medusa-file-spaces@1.2.1
 - medusa-fulfillment-webshipper@1.3.1
 - @medusajs/medusa-js@1.2.1
 - medusa-payment-paypal@1.2.1
 - medusa-payment-stripe@1.1.39
 - medusa-plugin-algolia@0.2.1
 - medusa-plugin-contentful@1.2.1
 - medusa-plugin-mailchimp@1.1.40
 - medusa-plugin-meilisearch@0.2.1
 - medusa-plugin-sendgrid@1.3.1
 - medusa-plugin-slack-notification@1.3.1
 - medusa-plugin-twilio-sms@1.2.1
 - medusa-react@0.3.1
 - @medusajs/medusa@1.3.1
2022-05-31 09:12:18 +02:00
Philip Korsholm
3f23edea23 fix(medusa): Allow de-selecting configurations in price lists (#1596) 2022-05-30 19:34:34 +02:00
Adrien de Peretti
d0c679fc7e feat(medusa): Export BaseEntity/SoftDeletableEntity from the core (#1594) 2022-05-30 17:47:20 +02:00
Kasper Fabricius Kristensen
083ab09361 fix(medusa): Prevent discount type updates (#1584) 2022-05-30 09:44:53 +02:00
Adrien de Peretti
fa031fd28b feat(medusa): Support deleting prices from a price list by product or variant (#1555) 2022-05-30 09:41:57 +02:00
Sebastian Rindom
ad9cfedf04 chore: add telemetry ping (#1509)
* chore: add telemetry ping

* fix: add track and 6th hour
2022-05-28 13:58:48 +02:00
Kasper Fabricius Kristensen
5414148254 fix(medusa): Post /admin/discounts/:id not updating condition operator (#1573) 2022-05-24 12:28:40 +02:00
olivermrbl
ad85bd0006 Merge branch 'master' into develop 2022-05-24 10:02:35 +02:00
Adrien de Peretti
3503651ff2 Refactor(medusa): Create a BaseEntity and SoftDeletableEntity base class for common columns (#1315)
* refactor(medusa): Move some column to a base entity to make it easier to add new models without forgetting some columns

* styles(medusa): Cleanup models

* fix(medusa): typings due to model typings update

* feat(medusa): Cleanup models

* fix(medusa): A model must not return the generateId as part of the entity

* fix(medusa): Plugin integration snapshot

* fix(medusa): Typings from discount-rule-migration scripts

* refactor(medusa): Introduct BaseEntity/SoftDeletableEntity that the entity extends

* styles(medusa): Fix models linting

* test(medusa): Fix integration plugin tests

* feat(medusa): Create generateEntityId standalong function utility and update config to properly supprt ts spec files

* feat(medusa): Update entities to use the new utils to generate and apply the id

* test(medusa): Fix test suits

* feat(medusa): Improve generateEntityId utility
2022-05-23 14:27:58 +02:00
Kasper Fabricius Kristensen
2f08167480 fix(medusa): discount types across model, service and api (#1545) 2022-05-22 12:18:37 +02:00
Shahed Nasser
b4f0771202 small fixes 2022-05-20 11:44:20 +03:00
Shahed Nasser
be3ad001ee added readme links 2022-05-20 11:40:57 +03:00
Adrien de Peretti
4489b75f5a feat(medusa): List batch jobs + Introduce composable handler pattern (#1541) 2022-05-20 10:22:42 +02:00
Oliver Windall Juhl
f0ecef6b9a fix(medisa): Deleting price list should use remove (#1540) 2022-05-19 18:56:58 +02:00
Adrien de Peretti
58387936c9 fix(medusa-payment-paypal): Should not throw when canceling already canceled payment (#1470) 2022-05-19 18:28:51 +02:00
Kasper Fabricius Kristensen
a10ac19d8e fix(medusa): applicableness of discounts with conditions not related to customer groups (#1534)
Discounts with conditions not related to customer groups prevent the discount from being applicable to customers (#1534)
2022-05-19 09:00:35 +02:00
Kasper Fabricius Kristensen
46d9e6c44c fix(medusa): add q param to listAndCount product types and product tags (#1531) 2022-05-18 11:31:02 +02:00
Kasper Fabricius Kristensen
5ae5f15e98 fix(medusa): RMA on items from swaps and claims (#1182) 2022-05-17 11:19:46 +02:00
Oliver Windall Juhl
a87e1cdf65 feat(medusa): Add endpoint for retrieving a DiscountCondition (#1525) 2022-05-17 11:17:17 +02:00