Commit Graph

2915 Commits

Author SHA1 Message Date
Philip Korsholm
efd9204e26 Feat(medusa-test-utils, authentication, customer, cart, payment, pricing, product, promotion): Add initModule util (#6200)
* use initModules instead of initialize when runnning auth module integration tests

* rm unused module-config

* correct db schema fix

* update authentication integration tests w/ initModule

* update cart integration tests w/ initModule

* update customer integration tests w/ initModule

* update payment integration tests w/ initModule

* update pricing integration tests w/ initModule

* update product integration tests w/ initModule

* update promotion integration tests w/ initModule

* add initModule to more product tests and return medusaApp from initModule

* align moduleOptions naming

* update dependencies
2024-01-25 10:37:38 +08:00
Kasper Fabricius Kristensen
134af77667 fix(medusa): GET /admin/shipping-options params (#6208) 2024-01-24 19:16:57 +01:00
Kasper Fabricius Kristensen
6404b9abd1 fix(medusa): List Users return type (#6204) 2024-01-24 13:57:05 +01:00
Oli Juhl
489b7effb0 fix(medusa): Support q search in currencies (#6201)
Closes #6175
2024-01-24 12:31:17 +00:00
Oli Juhl
8ad7539ebc fix(medusa): Support q search and order in list regions (#6202) 2024-01-24 12:52:39 +01:00
Oli Juhl
2b35700dbc feat(cart): Item tax lines + shipping method tax lines (#6136) 2024-01-24 11:42:27 +00:00
Shahed Nasser
f29948a6a8 docs-util: created docblock-generator tool (#6096) 2024-01-24 11:13:40 +01:00
Kasper Fabricius Kristensen
d68089b2aa fix(medusa): Implement listAndCount for UserService and update list endpoint (#6190) 2024-01-24 10:41:35 +01:00
Govind
eb498c500e fix(medusa-plugin-sendgrid): Support custom templates (#5833) 2024-01-24 10:17:22 +01:00
Philip Korsholm
b3d013940f feat(authentication): Google authentication provider (#6104)
* init

* add entity_id and update provider

* initial implementation

* update lockfile

* fix conflicts

* add config variables

* update types

* refactor google provider

* re-order methods

* fix pr feedback p. 1

* add initial type and update callback authorization

* add google provider to integration test

* fix feedback

* initial implementation (#6171)

* initial implementation

* remove oauth lib

* move abstract authentication provider

* shuffle files around

* Update packages/authentication/src/migrations/Migration20240122041959.ts

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>

* call verify with token

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-01-24 09:57:58 +08:00
Kasper Fabricius Kristensen
c37c82c5b5 feat(dashboard): Pub Api Key domain (#6162)
**What**
- Adds Pub. Api Key domain

**Note**
- Pagination for sales channels associated with the pubkey is not implemented correctly as it is not supported by the API. Will open a separate issue on this, and revisit the impl. once fixed.

CLOSES CORE-1656
2024-01-23 20:15:16 +00:00
Riqwan Thamir
68d8daccd2 feat(medusa,types): added buyget support for modules (#6159) 2024-01-23 21:01:44 +01:00
Carlos R. L. Rodrigues
302323916b feat: Workflow engine modules (#6128) 2024-01-23 10:08:08 -03:00
Carlos R. L. Rodrigues
d85fee42ee chore: use loaded module reference (#5763) 2024-01-23 08:31:02 -03:00
Philip Korsholm
24bb26b81a Feat(authentication): username password provider (#6052) 2024-01-23 09:04:22 +00:00
lukebui
db4da56023 fix(medusa-js): correct invites resend path in js client (#6155)
Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2024-01-22 20:31:30 +00:00
Riqwan Thamir
daecd82a7c feat(utils): update joiner config for campaigns (#6161) 2024-01-22 20:39:26 +01:00
Adrien de Peretti
738e9115ec feat(workflows-sdk): run, registerStepSuccess and registerStepFailure shortcut (#6164)
**What**

Currently, when exporting a workflow using the workflowExport util, it is mandatory to first call the resulted function passing the container before being able to call run, registerStepSuccess or failure on it. Now, it is possible to either continue that way, or to directly call the run, registerStepSuccess or failure on the exported workflow and at that moment it is possible to pass a container if needed

e.g
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
const wfRunner = workflow(container)
wfRunner.run(...) // Here the container is not expected
```
or
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
workflow.run(...) // Here we can now pass an optional container 
```
2024-01-22 19:14:18 +00:00
Shahed Nasser
4792c55226 docs: migrate guides to TSDoc references (#6100) 2024-01-22 18:38:35 +01:00
Sebastian Rindom
f72340ad87 feat(customer): add remove from group, update group (#6158)
Open #6149 again - was merged to wrong base branch.
2024-01-22 13:49:13 +00:00
Riqwan Thamir
99045848fd feat(medusa,types,core-flows,utils): added delete endpoints for campaigns and promotions (#6152)
what:

adds delete endpoints for:
- campaigns (RESOLVES CORE-1686)
- promotions (RESOLVES CORE-1680)
2024-01-22 13:06:49 +00:00
Sebastian Rindom
76291823f4 feat(customers): add delete and update (#6148)
Depends on #6137 

**What**
- Add update and delete methods to the customer module
2024-01-22 12:31:46 +00:00
Riqwan Thamir
da5cc4cf7f feat(core-flows,medusa,utils): promotion and campaign create/update endpoint (#6130)
what:

- adds create endpoint for promotions including workflows and endpoint (RESOLVES CORE-1678)
- adds update endpoint for promotions including workflows and endpoint (RESOLVES CORE-1679)
- adds create endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1684)
- adds update endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1685)
2024-01-22 11:54:17 +00:00
Sebastian Rindom
a52586880c feat(customer): Introduce customer group (#6137)
**What**
Methods for:
- Bulk create customers
- Bulk and single create of customer groups
- Assigning customer <> group relationships
- listing of customers and customer groups

++ Uses new repository loading mechanism
2024-01-22 11:24:22 +00:00
Oli Juhl
fd78f5e242 feat(cart): Shipping method adjustments (#6119) 2024-01-22 11:29:20 +01:00
Frane Polić
d47e946496 feat(payment): PaymentCollection CRUD (#6124) 2024-01-22 11:04:46 +01:00
invalid w
3f41d818b6 chore(admin-ui): add key for gift-cards table cells map fn (#6154)
![image](https://github.com/medusajs/medusa/assets/24707417/e13ff43b-770e-4698-bb9a-e22b866069f6)
2024-01-22 09:43:23 +00:00
Oli Juhl
06b33a9b45 feat(cart): Line item adjustments (#6112) 2024-01-22 09:55:47 +01:00
Riqwan Thamir
af7af73745 feat(medusa,utils): added campaign get endpoints (#6125)
what:

adds endpoints for the following:

- list endpoint (RESOLVES CORE-1682)
- retrieve endpoint (RESOLVES CORE-1683)
2024-01-19 14:54:40 +00:00
Adrien de Peretti
5e655dd59b chore: Hide repository creation if they are not custom + add upsert support by default (#6127) 2024-01-19 15:09:38 +01:00
Sebastian Rindom
1b99c5dc22 fix(medusa): ensure transaction is reused when service calls itself (#6089)
**What**
- ProductService.create calls ProductService.retrieve before returning. This fix ensures that the manager created in the atomicPhase is used when ProductService.retrieve is called.

**Why**
- Without the explicit use of the same manager in the retrieve call, race conditions easily occur if you have concurrent ProductService.create calls. The code below can reproduce the scenario:
```javascript
  const productData = [
    {
      barcode: `1234233423-${Math.random() * 100}`,
      external_id: `1234233423-${Math.random() * 100}`,
      description: "super cool product",
      discountable: true,
      hs_code: "1234213",
      origin_country: "DK",
      title: `Super cool product ${Math.random() * 100}`,
      type: { value: "Eyewear" },
      sales_channels: [{ id: sc.id }],
    },
    {
      barcode: `1234233423-${Math.random() * 100}`,
      external_id: `random-external-id-${Math.random() * 100}`,
      description: "super cool product",
      discountable: true,
      hs_code: "1234213",
      origin_country: "DK",
      title: `Super cool product ${Math.random() * 100}`,
      type: { value: "Eyewear" },
      sales_channels: [{ id: sc.id }],
    },
  ];

  const result = await Promise.all(
    productData.map(async (product) => productService.create(product))
  );
```

**Explaination**

What happens is the following:

- Request 1 calls `ProductService.create`. This in turn calls `atomicPhase` which sets the `ProductService.transactionManager_ = txForReqOne`
- Request 1 creates the product in the DB with `txForReqOne`.
- Request 2 calls `ProductService.create`. This in turn calls `atomicPhase` which sets the `ProductService.transactionManager_ = txForReqTwo`
- Request 1 reaches the end of `ProductService.create` where `this.retrieve` is called. Because the ProductService is a singleton the retrieve call will attempt to use `txForReqTwo` to fetch the product. 
- **Error**: since `txForReqTwo` can't read the data of `txForReqOne`, the product is not found.



Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-19 11:03:17 +00:00
Sebastian Rindom
12aa1737d5 feat: customer module skeleton (#6126) 2024-01-19 10:18:54 +00:00
Riqwan Thamir
a12c28b7d5 feat(medusa,types): add promotion list/get endpoint (#6110)
what:

- adds get promotion endpoint (RESOLVES CORE-1677)
- adds list promotions endpoint (RESOLVES CORE-1676)
- uses new API routes
2024-01-18 16:01:19 +00:00
fPolic
16945f4fd2 Merge branch 'develop' into feat/payment-module-interfaces 2024-01-18 16:04:00 +01:00
fPolic
8e4e6b043d Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-18 16:01:51 +01:00
Frane Polić
844a5d990c feat: Payment module models (#6065) 2024-01-18 15:50:56 +01:00
invalid w
2cca3627c3 fix(admin-ui->Collections): add key for map fn. resolve #6106 (#6107)
resolve #6106.


just add key for map fn.
2024-01-18 14:32:45 +00:00
Kasper Fabricius Kristensen
e49b6944e3 feat(dashboard): 3.0 product collection (#6120) 2024-01-18 15:01:34 +01:00
Frane Polić
491848bb45 Merge branch 'develop' into feat/payment-module-models 2024-01-18 14:41:24 +01:00
Oli Juhl
b132ff7669 feat(cart): Add line items in cart-creation (#6114) 2024-01-18 14:39:40 +01:00
Frane Polić
af61195aad Merge branch 'develop' into feat/payment-module-models 2024-01-18 14:19:18 +01:00
Oli Juhl
7f7cb2a263 feat(cart): Shipping methods (#6101) 2024-01-18 12:16:15 +01:00
fPolic
c332375ff2 chore: update fields to new convention 2024-01-18 11:56:10 +01:00
fPolic
81544088d3 fix: change type 2024-01-18 10:52:14 +01:00
fPolic
a6aa09ad27 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-18 10:51:28 +01:00
fPolic
d5af7cc5f9 fix: add column type 2024-01-18 10:50:46 +01:00
Sebastian Rindom
5cfb662ec0 fix: migrate segment subscribers + typescript support (#5904)
Fixes #6068.

**What**

- Uses new Subscriber API.
- Adds support for typescript files in Segment plugin.
- Adds a peerDependency on @medusajs/medusa for the version that introduced new Subscriber API.
2024-01-18 09:38:33 +00:00
Adrien de Peretti
130c641e5c chore: Abstract module services (#6087)
**What**
Create a service abstraction for the modules internal service layer. The objective is to reduce the effort of building new modules when the logic is the same or otherwise allow to override the default behavior.

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-18 09:20:08 +00:00
Kasper Fabricius Kristensen
80feb972cb feat(dashboard): Customer groups domain (#6098)
**What**
- Adds list, detail, edit, create, add customers views to the CG domain.

**Note**
- Missing metadata in forms (coming in separate PR for entire admin)
- Missing table filters (separate PR)

CLOSES CORE-1648
2024-01-17 14:25:59 +00:00
Carlos R. L. Rodrigues
19bbae61f8 fix(modules-sdk): create workflow returning step transformer (#6102) 2024-01-17 09:17:37 -03:00