Commit Graph

4386 Commits

Author SHA1 Message Date
Sajarin M
6b0b3fed7a fix(medusa): Fix typo in discounts error message (#5853) 2024-01-07 14:37:32 +01:00
Mohamed Abusaid
46d610bc55 feat(admin): Add Libya admin region and set Libya to formal name (#6001) 2024-01-07 14:33:40 +01:00
Adrien de Peretti
47be2ad723 fix(medusa): Order by using joins and pagination (#5990) 2024-01-07 13:58:30 +01:00
Oli Juhl
b57ad67d2f feat(cart): Data models (#5986)
**What**
Adds Cart Module data models
2024-01-05 17:32:36 +00:00
Riqwan Thamir
dc46ee1189 feat(types): promotion delete / update / retrieve / add/remove-rules (#5988) 2024-01-05 16:17:22 +01:00
Shahed Nasser
7d650771d1 docs: generate medusa-react reference (#6004)
* add new plugin for better organization

* added handling in theme for mutations and query types

* added tsdoc to hooks

* added tsdocs to utility functions

* added tsdoc to providers

* generated reference

* general fixes for generated reference

* generated api reference specs + general fixes

* add missing import react

* split utilities into different directories

* added overview page

* added link to customer authentication section

* fix lint errors

* added changeset

* fix readme

* fixed build error

* added expand fields + other sections to overview

* updated what's new section

* general refactoring

* remove unnecessary query field

* fix links

* added ignoreApi option
2024-01-05 17:03:38 +02:00
Frane Polić
6fc6a9de6a feat(medusa, link-modules): sales channel <> pubkey link (#5820) 2024-01-05 14:51:57 +01:00
Adrien de Peretti
bf63c4e6a3 feat(orchestration, workflows-sdk): Add events management and implementation to manage async workflows (#5951)
* feat(orchestration, workflows-sdk): Add events management and implementation to manage async workflows

* Create fresh-boxes-scream.md

* cleanup

* fix: resolveValue input ref

* resolve value recursive

* chore: resolve result value only for new api

* chore: save checkpoint before scheduling

* features

* fix: beginTransaction checking existing transaction

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-01-05 14:40:58 +01:00
Oli Juhl
99a4f94db5 feat(medusa-payment-stripe): Add delay to Stripe webhook (#5838)
**What**
- Migrate Stripe plugin to use API Routes + Subscribers
- Change the behaviour of Stripe webhook
Instead of processing webhook events immediately, we fire an event to perform the work in the background. The primary reason for changing the webhook is that the previous implementation led to occasional conflicts due to a race condition between the client's and the webhook's request to complete a cart. Now, we emit an event with a configurable delay (defaults to 2s) to prevent this from happening

This approach was preferred over adding a timeout directly to the webhook execution, as it is generally best practice to respond to a webhook event immediately after receiving it.
2024-01-05 12:37:53 +00:00
Adrien de Peretti
37fba9a168 fix(medusa): cart completion payment sessions (#5995)
* fix(medusa): cart completion payment sessions

* Create seven-moose-scream.md

* fix unit tests
2024-01-04 20:40:08 +01:00
Oli Juhl
cd2855182e docs: Update minimum node version requirement (#5994) 2024-01-04 13:13:41 +01:00
Adrien de Peretti
7f62ab1b58 fix(medusa-payment-stripe): Fix error handling (#5991) 2024-01-04 09:04:43 +01:00
Philip Korsholm
3550750975 feat(pricing, types, utils): Soft delete pricing entities (#5858) 2024-01-04 09:02:49 +01:00
Oli Juhl
1468646b99 chore(workflows): Use Node 16.14 in CLI workflow (#5993)
* make packages private

* add changeset

* Update test-cli-with-database.yml

* revert
2024-01-04 08:40:45 +01:00
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