Commit Graph

2935 Commits

Author SHA1 Message Date
Philip Korsholm
8ec093dc07 fix(authentication): remove providers loader (#6257)
**What**
- remove file leftover from renaming authentication -> auth
2024-01-29 15:38:31 +00:00
Riqwan Thamir
10c67ecd74 chore(core-flows): reorganize folder structure for promotion workflows (#6243)
workflows folder structure:

```
- src/
  - promotion/
    - workflows/
      - create-promotion.ts
    - steps/
      - prepare-create-promotion-data.ts
```

RESOLVES CORE-1688
2024-01-29 14:35:59 +00:00
Oli Juhl
c15438c744 feat(cart): Migration file (#6156)
* feat(cart): Migration file

* fixup migration

* Add indexes on cart table for currency, region, and sales channel

* fix indexes

* address PR comments
2024-01-29 12:49:48 +01:00
Philip Korsholm
512b041929 Feat(auth): Rename authentication to auth (#6229)
**What**
- rename `authenticationModule` -> `authModule`
2024-01-29 10:19:30 +00:00
Philip Korsholm
a41aad4bea feat(authentication, types, utils): Add Authentication provider scopes (#6228)
* initial implementation

* add test for invalid scope

* get config from scope not db

* assign config from scope

* fix package.json

* optional providers

* make providers options

* update type
2024-01-29 17:42:42 +08:00
Philip Korsholm
d1c18a3090 feat(medusa, stock-location, types): Add q and order params to list-stock-locations (#6197)
**What**
- add `q` and `order` params to list-stock-location endpoint

closes #6189
2024-01-29 09:14:39 +00:00
Frane Polić
3db2f95e65 feat: sales channel module (#5923) 2024-01-29 09:47:28 +01:00
github-actions[bot]
dfd9e7c772 chore(docs): Updated UI Reference (#6221)
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>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-01-29 08:20:51 +00:00
Oli Juhl
5c4a5a1454 feat(cart): JoinerConfig (#6157) 2024-01-28 11:10:40 +01:00
Sebastian Rindom
360c71e39a fix: improve error message on incorrect service export (#6240)
**What**
- Provide a more helpful error message if a user adds a file in `src/services` that doesn't export a service class.

**Why**
If you forget to `export default MyClass` in a custom service you can end up with this error:
![CleanShot 2024-01-27 at 6  24 19](https://github.com/medusajs/medusa/assets/7554214/d3700487-33e0-4629-b2c4-a2a37cb86b3e)

It's almost impossible to know how to recover from this which can be an issue for new users. The new error message informs the user that there is a missing class export and shows which file the error is related to.
2024-01-27 23:28:11 +00:00
Sebastian Rindom
8c6cc82c5d feat(customer): add customer addresses (#6224)
**What**
- adds methods to create update list customer addresses
- removes default_shipping_id and billing id from customer record and moves them to address (better normalization)
2024-01-26 15:35:23 +00:00
Philip Korsholm
638b47ff70 feat(authentication, types): split authenticate method into two (#6184)
* init

* fetch providers using updated string

* update loaders

* add more tests

* add authenticationresponse type

* update types for authentication method

* add entity_id and update provider

* update pr with return type

* create loaders onApplicationStart

* cleanup provider class

* run application start hook before each

* fix pr feedback

* create private onApplicationStart method

* assign repository

* 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

* 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>

* split authentication methods

* call verify with token

* update integration tests

* feedback

* rename split methods

* fix provider integration test

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-01-26 11:37:23 +08:00
github-actions[bot]
5a550e73b4 chore(docs): Generated References (#6222)
Generated the following references:
- `entities`
- `file`
- `fulfillment`
- `inventory`
- `js_client`
- `medusa`
- `medusa_config`
- `medusa_react`
- `modules`
- `notification`
- `payment`
- `price_selection`
- `pricing`
- `product`
- `search`
- `services`
- `stock_location`
- `tax`
- `tax_calculation`
- `types`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-01-25 18:12:27 +00:00
Sebastian Rindom
21c1c5ce6c feat(customer): add migration file (#6205) 2024-01-25 16:52:30 +00:00
github-actions[bot]
3d0ae72887 chore: Version Packages (#6039)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-25 16:23:53 +01:00
Sebastian Rindom
4ad761788b chore: move v2 api behind ff (#6213) 2024-01-25 14:39:22 +00:00
Rodney
bf1125209a feat(medusa-js): add axios adapter to config (#6214)
**What**

- Adds the ability to pass an Axios adapter through the client's config.

**Why**

- When using NextJS with the edge runtime for deployment on Cloudflare Pages, for example, Axios does not work. Therefore, it is necessary to pass an adapter like [@vespaiach/axios-fetch-adapter](https://github.com/vespaiach/axios-fetch-adapter).

**How**

- Receives the **axiosAdapter** in the config and implements it when creating the **axiosClient**.

Closes #6133
2024-01-25 14:15:22 +00:00
olivermrbl
7b30512a65 chore: Remove workspace range in deps 2024-01-25 14:08:25 +01:00
Sebastian Rindom
e9435a8680 feat(customer): add softdelete/restore (#6203) 2024-01-25 12:38:02 +00:00
Shahed Nasser
e84847be36 feat(medusa-oas-cli): updated redocly-cli to v1.7 (#6211)
## What

Updates `@redocly/cli` to v1.7. This resolves the bug of TypeScript and tsx code samples in the OAS being generated as undefined files (see files under `www/apps/api-reference/specs/admin/code_samples/tsx` and `www/apps/api-reference/specs/store/code_samples/tsx`

I avoided re-generating OAS so that this PR doesn't have a huge diff. When the next release is out, an automated PR will be opened to update the OAS files, replacing the undefined files with `.tsx` files.

### Other Changes

- Small fixes to `medusa-oas-cli` README for clarity
2024-01-25 07:53:58 +00:00
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