Commit Graph

4372 Commits

Author SHA1 Message Date
olivermrbl
d2ef0cff2b chore(changesets): Use correct medusa-react package 2024-01-03 15:34:30 +01:00
Frane Polić
fe007d01bd feat(medusa, link-modules): sales channel <> order link (#5810) 2024-01-03 14:07:54 +01:00
Adrien de Peretti
278b7fb203 fix(medusa): Update cart sales channel should not remove all line items (#5980) 2024-01-03 14:06:07 +01:00
Riqwan Thamir
42cc8ae3f8 feat(types,utils): added promotion create with rules and application target rules (#5957)
* feat(types,utils): added promotion create with rules

* chore: add rules to promotion and application method

* chore: use common code for rule and values

* chore: address pr reviews

* chore: fix test
2024-01-03 09:54:48 +01:00
Philip Korsholm
d16d10619d Feat(medusa-test-utils, utils, pricing, product, link-modules): upgrade mikro orm version to latest (#5985)
* update mikro-orm version

* add changeset

* update product tests

* add optional number serializer util

* upgrade cart mikro-orm versions

* clean up test
2024-01-02 17:11:55 +01:00
Oli Juhl
925feea04a feat(cart): Add cart module package (#5982)
* feat: Add CartModule foundation

* remove migration

* fix ts issue

* Create hot-dingos-pay.md
2024-01-02 15:59:23 +01:00
Oli Juhl
487067fb48 fix(medusa): Resolve babel executable with npx (#5952) 2024-01-02 10:13:54 +01:00
Minh Tu Ngo
c8f03e3a47 Update create.md (#5978)
typo
2024-01-02 09:09:39 +00:00
Shahed Nasser
5ef41bd86d docs: fix file name for scheduled jobs (#5972) 2023-12-28 12:07:05 +02:00
Frane Polić
76332ca6c1 feat(medusa, link-modules): sales channel <> cart link (#5459)
* feat: sales channel joiner config

* feat: product sales channel link config, SC list method

* feat: migration

* fix: refactor list SC

* refactor: SC repo api

* chore: changeset

* feat: add dedicated FF

* wip: cart<>sc link and migration

* chore: changeset

* fix: update migration with the cart table constraints

* feat: populate the pivot table

* chore: remove relation from joiner config

* fix: constraint name

* fix: filter out link relations when calling internal services

* feat: product<> sc join entity

* fix: update case

* fix: add FF on in the repository, fix tests

* fix: assign id when FF is on

* fix: target table

* feat: product service - fetch SC with RQ

* feat: admin list products & SC with isolated product domain

* feat: get admin product

* feat: store endpoints

* fix: remove duplicate import

* fix: remove "name" prop

* feat: typeorm entity changes

* feat: pivot table, entity, on cart create changes

* feat: update carts' SC

* feat: cart - getValidatedSalesChannel with RQ

* feat: refactor

* wip: changes to create cart workflow

* fix: remove join table entity due to migrations failing

* fix: product seeder if FF is on

* feat: attach SC handler and test

* fix: env

* feat: workflow compensation, cart service retrieve with RQ

* fix: remote joiner implode map

* chore: update changesets

* fix: remove methods from SC service/repo

* feat: use remote link in handlers

* fix: remove SC service calls

* fix: link params

* fix: migration add constraint to make link upsert pass

* refactor: workflow product handlers to handle remote links

* fix: condition

* fix: use correct method

* fix: build

* wip: update FF

* fix: update FF in the handlers

* chore: migrate to medusav2 FF

* chore: uncomment test

* fix: product factory

* fix: unlinking SC and product

* fix: use module name variable

* refactor: cleanup query definitions

* fix: add constraint

* wip: migrate FF

* fix: comments

* feat: cart entity callbacks, fix tests

* fix: only create SC in test

* wip: services updates, changes to models

* chore: rename prop

* fix: add hook

* fix: address comments

* fix: temp sc filtering

* fix: use RQ to filter by SC

* fix: relations on retrieve

* feat: migration sync data, remove FF

* fix: revert order of queries

* fix: alter migration, relations in service

* fix: revert id

* fix: migrations

* fix: make expand work

* fix: remote link method call

* fix: try making tests work without id in the pivot table

* test: use remote link

* test: relations changes

* fix: preserve channel id column

* fix: seeder and factory

* fix: remove sales_channels from response

* feat: support feature flag arrays

* fix: cover everything with correct FF

* fix: remove verbose

* fix: unit and plugin tests

* chore: comments

* fix: reenable workflow handler, add comments, split cart create workflow tests

* chore: reenable link in the create mehod, update changesets

* fix: address feedback

* fix: revert migration

* fix: change the migration to follow link module

* fix: migration syntax

* fix: merge conflicts

* fix: typo

* feat: remove store sales channel foreign key

* fix: merge migrations

* fix: FF keys

* refactor: cart service

* refactor: FF missing key

* fix: comments

* fix: address PR comments

* fix: new changesets

* fix: revert flag router changes

* chore: refactor `isFeatureEnabled`

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-12-22 13:05:36 +01:00
cyf0e
b5a07cfcf4 fix(medusa): add payments default relation to getTotalsRelations (#5875)
* bugfix: Add payments relation to getTotalsRelations

* update order test to expect correct paid_total and refundable_amount
2023-12-22 08:13:39 +01:00
Adrien de Peretti
a0dd18c12a feat(workflows-sdk): Allow primitive values to be passed as well as WorkflowDataProperties (#5953)
* feat(workflows-sdk): Allow primitive values to be passed as well as WorkflowDataProperties

* feat(workflows-sdk): improve playground tests

* Create nine-shrimps-reply.md
2023-12-22 07:39:28 +01:00
Shahed Nasser
bfd10dadaf fix(medusa-js): remove unnecessary query field in AdminInventoryItemsResource.deleteLocationLevel method (#5941)
## What

The underlying endpoint `/admin/inventory-items/{id}/location-levels/{location_id}` that the JS Client's `AdminInventoryItemsResource.deleteLocationLevel` method sends a request to doesn't accept query parameters. So, the `query` argument of the `deleteLocationLevel` is unnecessary.

Fixes CORE-1550
2023-12-21 14:38:53 +00:00
Adrien de Peretti
8402f46970 feat(workflows-sdk): Allow a step to not define an expected input (#5775)
**What**
Allow a step to not define an expected input, previously even if no input was expected, an object was always expected to be passed to the stepFunction inside the workflow composition. Now
```ts
const stepWithoutArgs = createStep("step1", () => {
  return new StepResponse("string")
})

const stepWithoutExepectedInput = createStep("step2", (_: {}, context) => {
  console.log("input", _) // {}
  return new StepResponse("string")
})

const workflow = createWorkflow("workflow1", () => {
  stepWithoutArgs()
  return stepWithoutExepectedInput()
})

workflow()
  .run()
  .then((res) => {
    console.log(res.result) // string
  })
```
2023-12-21 13:41:58 +00:00
Riqwan Thamir
890e76a5c5 feat(types,utils): add promotions create with application method (#5945)
What:

- Promotions can be created with its bare attributes
- Promotions one to one relationship with ApplicationMethod can be created with its attributes + validation

RESOLVES CORE-1592
RESOLVES CORE-1595
2023-12-21 11:04:50 +00:00
Adrien de Peretti
c41f3002f3 fix(utils): More resilient object from string path (#5929)
**What**
More resilient util in case an undefined, nu,, '' value is passed as part of the relations
2023-12-21 09:28:13 +00:00
Sujal Gurung
29bb2e4f6e docs: rename EVENT_REDIS_URL (#5948)
fix typo in 2 places
closes medusajs/medusa#5936
2023-12-21 08:55:27 +00:00
Philip Korsholm
c1c470e6b8 fix(medusa, pricing, types): pass dates as Date-objects rather than strings to the pricing module (#5768)
* init

* remove date string validator;

* add transformOptionalDate transformer to api

* move type conversion to the datalayer

* fix final module integration test

* update arrow-function

* make string optional

* move work to utils

* make check for value exists

* move util back to pricng

* change utils

* refactor get-iso-string

* fix build

* flip transform condition

* add null check for isDate

* feat(pricing): Separate Pricing Module internal types from `@medusajs/types` (#5777)

* create types for pricing repositories

* create RepositoryTypes input

* add service types

* use models for repository types

* fix build

* update types to match interface types

* add aliases

* types instead of moduletypes

* move repository to types for pricing module

* add changeset

* fix merge error

* fix conflict

* fix build

* re-add validation of dates in updatePriceLists_
2023-12-21 08:29:41 +01:00
Philip Korsholm
6d1e3cc028 feat(types,module-sdk): setup authentication module skeleton (#5943)
**What**
- add authentication module skeleton
2023-12-21 06:56:20 +00:00
Riqwan Thamir
3f6d79961d feat(types,modules-sdk): basic module setup for promotions (#5920)
RESOLVES CORE-1580
2023-12-20 12:21:13 +00:00
Oli Juhl
f25ca30b3a fix(medusa, medusa-js): publishable api key bugs (#5926)
* fix: publishable api key bugs

* Create old-meals-run.md
2023-12-20 12:57:13 +01:00
Aldo Román
f81367f84a fix: Typo in documentation (#5933)
Expendable -> Expandable
2023-12-20 11:11:03 +00:00
Nicklas Gellner
699c363c25 Add link to our official Plugin directory (#5931)
Replaced the link for our awesome-Medusa-repo with a direct link to our official plugins page.

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-12-20 10:45:21 +00:00
github-actions[bot]
05a9ffb9ea chore(docs): Removed Docs Announcement Bar (automated) (#5934)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-12-20 10:07:44 +02:00
hmmhmmhm
a3460e5a1a feat(admin): Add Japanese language support (#5795) 2023-12-19 15:06:37 +00:00
Petr Kolonicz
7ecea34487 feat(admin): Add Czech language support (#5822)
- add Czech messages
- add Czech to supported languages
- add Czech to the docs

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2023-12-19 14:35:00 +00:00
Adrien de Peretti
45996d58a2 chore(medusa, interfaces): Uniformise class checks (#5869)
**What**
One problem with local development can be the dependencies management. To mitigate that, transform checks from an instance of to value check as well as harmonize utils function to be part of the class as a static method instead of separate utilities. By using this approach we are not dependent of the origin of the class and therefore it should ease the user experience.

**NOTE**
As a next step to discuss, we should probably move the interfaces from the interfaces/medusa package to the utils package. Then we can deprecate the interfaces package and remove it at a later time
2023-12-19 13:26:57 +00:00
Adrien de Peretti
496dcf10c4 feat(medusa): Prevent cart completion conflict (#5814) 2023-12-19 10:47:41 +01:00
Adrien de Peretti
9cc787cac4 feat(workflows-sdk): Configurable retries upon step creation (#5728)
**What**
- Allow to create step that can be configured to have a max retry
- Step end retry mechanism on permanent failure

Also added an API to override a step configuration from within the createWorkflow
```ts
const step = createStep({ name: "step", maxRetries: 3 }, async (_, context) => {
  return new StepResponse({ output: "output" })
})

const workflow = createWorkflow("workflow", function () {
  const res = step().config({ maxRetries: 5 }) // This will override the original maxRetries of 3
})
```

**NOTE**
We can maybe find another name than config on the step workflow data to override the step config.
2023-12-19 09:38:27 +00:00
Adrien de Peretti
1a2f513d53 fix(medusa): Passport loader resolving to early (#5901)
* fix(medusa): Passport loader resolving to early

* fix(medusa): Passport loader resolving to early

* Create hungry-bikes-give.md
2023-12-18 17:02:51 +01:00
Katarzyna Stokłosa
05520391d1 fix: redis_options for job scheduler (#5894)
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-12-18 16:40:10 +01:00
Shahed Nasser
8cb53da34e docs: fix medusa-react guide + specify react-query version (#5918)
* docs: fix medusa-react guide by adding missing link

* fix link

* add v4.22 as the supported version of react-query
2023-12-18 16:01:24 +02:00
Sujal Gurung
bd60efbe65 docs: set rejectUnauthorized based on condition (#5907)
The general guide for hosting the server tells users to set `ssl.rejectUnauthorized` to false for production environments. However, the provided code snippet doesn't check the environment while setting the value. Directly pasting it into `medusa-config.js` will cause database connection attempts made from a development environment to be rejected and you can't even login to the admin account.

The change only sets the ssl property to false if the environment is a non-development one.  ~I got this code suggestion from the Kapa bot on discord so not sure if this is the best way to do this.~ This code is taken from the [configuration docs](https://docs.medusajs.com/development/backend/configurations#database_extra) themselves.

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-12-18 12:27:10 +00:00
Shahed Nasser
ddc6cc13a0 docs: add TSDoc for payment processor + generate docs (#5917)
* added tsdocs for payment processor

* generated reference for payment processor
2023-12-18 14:02:18 +02:00
Shahed Nasser
e63f4e6c7a docs: fix wishlist route (#5914) 2023-12-18 13:47:15 +02:00
Bogdan Ošep
e513cbae6b Slovenian(sl) translation (#5828)
Admin UI  - Translation into slovenian language(sl - slovenščina)
2023-12-18 11:15:57 +00:00
Edi
9c71c1d864 Bulgarian language support (#5786)
Bulgarian language support for the Admin dashboard
2023-12-18 10:49:04 +00:00
Chris
c444b036f7 feat(admin): Added Simplified Chinese support (#5798)
* feat(admin): Added Simplified Chinese support

* feat(admin): Update zh translation.json

* docs: Add Simplified Chinese to Admin language support list

* Revert "docs: Add Simplified Chinese to Admin language support list"

This reverts commit 51cca40211ac7e01ac7f78429107ace44785878a.
2023-12-18 11:23:26 +01:00
IdekDude
25dd570578 Changed 'duplicate' to 'delete' in "Delete a Variant" Section (#5823)
References [Issue 5787](https://github.com/medusajs/medusa/issues/5787)
2023-12-18 09:36:23 +00:00
Sujal Gurung
60f86c477e docs: update Railway pricing info in deploy guide (#5908)
Railway got rid of their free tier in [June](https://blog.railway.app/p/introducing-trial-hobby-pro-plans)
2023-12-18 08:53:17 +00:00
Shahed Nasser
a34fe9bfe3 docs: updated digital ocean spaces guide (#5900)
* docs: updated digital ocean spaces guide

* fix example
2023-12-15 17:25:18 +02:00
Shahed Nasser
525ae6d728 docs: added missing service method in digital products recipe (#5899)
* docs: added missing service method in digital products recipe

* fix lint
2023-12-15 15:40:05 +02:00
Frane Polić
1d7888afca feat(medusa, link-modules): sales channel <> product module link (#5450)
* feat: sales channel joiner config

* feat: product sales channel link config, SC list method

* feat: migration

* fix: refactor list SC

* refactor: SC repo api

* chore: changeset

* feat: add dedicated FF

* feat: product<> sc join entity

* fix: update case

* fix: add FF on in the repository, fix tests

* fix: assign id when FF is on

* fix: target table

* feat: product service - fetch SC with RQ

* feat: admin list products & SC with isolated product domain

* feat: get admin product

* feat: store endpoints

* fix: remove duplicate import

* fix: remove "name" prop

* feat: refactor

* fix: product seeder if FF is on

* fix: env

* refactor: workflow product handlers to handle remote links

* fix: condition

* fix: use correct method

* fix: build

* wip: update FF

* fix: update FF in the handlers

* chore: migrate to medusav2 FF

* chore: uncomment test

* fix: product factory

* fix: unlinking SC and product

* fix: use module name variable

* refactor: cleanup query definitions

* fix: add constraint

* chore: rename prop

* fix: add hook

* fix: address comments

* fix: temp sc filtering

* fix: use RQ to filter by SC

* fix: add sc to filter to list

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-12-15 13:43:00 +01:00
Shahed Nasser
11b1a61969 docs: fixes to digital products recipe (#5897)
* docs: fixes to digital products recipe

* fix lint errors
2023-12-15 12:39:40 +02:00
Philip Korsholm
56b07ed0cf feat(medusa): Update shipping option price type (#5895)
**What**
- allow updates to shipping option price type
- Clean up the use of strings in the api validation

Fixes #5824
2023-12-15 10:12:43 +00:00
Shahed Nasser
761d2e7a69 docs: update documentation websites (#5882)
* docs: update next.js to 14.0.4

* update docusaurus to v3.0.1

* update packages dependencies

* added engines

* update lock
2023-12-14 20:43:16 +02:00
github-actions[bot]
2d127a4c67 chore(docs): Generated References (#5881)
Generated the following references:
- `EventBusTypes`
- `IPricingModuleService`
- `ModulesSdkTypes`
- `PriceListWorkflow`
- `fulfillment`
- `js_client`
- `medusa`
- `modules`
- `pricing`
- `services`
- `types`
- `workflows`

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-12-14 18:28:23 +00:00
Shahed Nasser
fde1e23995 chore: refactored docs-util (#5876) 2023-12-14 18:25:40 +02:00
Riqwan Thamir
2d79eeeecc feat(medusa): add currency to region responses (#5857)
Resolves https://github.com/medusajs/medusa/issues/5837
2023-12-14 15:52:54 +00:00
github-actions[bot]
ff92619d6c chore(docs): Generated Docs Announcement Bar (automated) (#5877)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-12-14 15:28:26 +00:00