Commit Graph

7976 Commits

Author SHA1 Message Date
Riqwan Thamir
abc30517cb feat(): added percentage calculations for all cases (#6300)
what:

- adds missing percentage calculations for items and shipping methods
2024-02-02 11:39:34 +00:00
Philip Korsholm
9fda6a6824 feat(auth): add authentication endpoints (#6265)
**What**
- Add authentication endpoints: 
  - `/auth/[scope]/[provider]` 
  - `/auth/[scope]/[provider]/callback`
- update authenticate-middleware handler
- Add scope field to user
- Add unique constraint on scope and entity_id

note: there's still some remaining work related to jwt auth to be handled, this is mainly focussed on session auth with endpoints



Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2024-02-02 10:45:32 +00:00
Mohammad Awais
061c449179 [FIX] [Typo] Cart -> Card (#6302) 2024-02-01 20:36:37 +00:00
Oli Juhl
3a103f0c36 feat(modules-sdk): Module provider plugin loader (#6286) 2024-02-01 17:03:31 +01:00
Carlos R. L. Rodrigues
45134e4d11 chore: local workflow proxying methods to pass context (#6263)
What:
- When calling a module's method inside a Local Workflow the MedusaContext is passed as the last argument to the method if not provided
- Add `requestId` to req
- A couple of fixes on Remote Joiner and the data fetcher for internal services

Why:
- The context used to initialize the workflow has to be shared with all modules. properties like transactionId will be used to emit events and requestId to trace logs for example.
2024-02-01 13:37:26 +00:00
Sebastian Rindom
a2bf6756ac feat(customer): manage default address selection (#6295)
**What**
- Catches unique constraints on customer_id, is_default_billing/is_default_shipping and reformats
- Adds an step to create and update of addresses that unsets the previous default shipping/billing address if necessary.
  - This creates a behavior in the API where you can always set an address to be default and it will automatically unset the previous one for you.
2024-02-01 12:28:14 +00:00
Sebastian Rindom
a28822e0d4 feat(customer): store addresses (#6283)
- GET /customers/me/addresses
- POST /customers/me/addresses
- GET /customers/me/addresses/:address_id
- POST /customers/me/addresses/:address_id
- DELETE /customers/me/addresses/:address_id
2024-02-01 10:11:52 +00:00
github-actions[bot]
fab1799841 chore(docs): Removed Docs Announcement Bar (automated) (#6278)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2024-01-31 20:33:25 +01:00
Oli Juhl
d5e4707084 feat(medusa): Use remote query in get cart API route (#6285) 2024-01-31 19:20:48 +01:00
Shahed Nasser
2cebadc3a8 docs: fix title of the configuration page (#6268)
Fix the title of the configurations page which is generated by typedoc
2024-01-31 13:50:34 +00:00
Riqwan Thamir
e749dd653c feat(types): added computed actions for automatic promotions (#6272)
what:

- compute actions account for automatic promotions (RESOLVES CORE-1701)

RESOLVES CORE-1689
2024-01-31 12:30:33 +00:00
Sebastian Rindom
7903a15e0f feat(customer): Add create and retrieve customer from store side (#6267)
**What**
- GET /store/customers/me
- POST /store/customers
- Workflow for customer account creation
- Authentication middleware on customer routes
2024-01-31 11:58:29 +00:00
Sebastian Rindom
f41877ef61 feat(customer): add customer group customer management (#6276)
**What**
- GET /admin/customer-groups/:id/customers
- POST /admin/customer-groups/:id/customers/batch
- POST /admin/customer-groups/:id/customers/remove

Workflows
2024-01-31 10:24:22 +00:00
Sebastian Rindom
36ec3ea3aa feat(customer): admin addresses (#6235)
**What**
- GET /admin/customers/:id/addresses
- POST /admin/customers/:id/addresses
- POST /admin/customers/:id/addresses/:address_id
- DELETE /admin/customers/:id/addresses/:address_id
2024-01-31 09:55:07 +00:00
Sebastian Rindom
ca0e0631af feat(customer): add customer group management apis (#6233)
**What**
```
POST /admin/customer-groups
POST /admin/customer-groups/:id
GET /admin/customer-groups/:id
DELETE /admin/customer-groups/:id
```

- Workflows
2024-01-30 19:37:53 +00:00
Shahed Nasser
8c7a031090 docs: refactoring of docblock generator tool (#6261)
small refactoring of the docblock generator tool that moves all git operations and requests into the `GitManager`
2024-01-30 17:01:54 +00:00
Kasper Fabricius Kristensen
1100c21c63 feat(dashboard): Users domain (#6212) 2024-01-30 17:20:06 +01:00
Philip Korsholm
7d5a6f8b00 feat(auth, medusa): Initial auth module middleware (#6271)
note: This is an initial implementation

Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2024-01-30 12:23:20 +00:00
Oli Juhl
374b9b1fee feat(cart): GET /store/carts/:id (#6262) 2024-01-30 12:52:54 +01:00
Sebastian Rindom
18ff739a94 feat(customer): admin CRUD endpoints (#6232)
**What**

- GET /customers/:id
- POST /customers/:id
- DELETE /customers/:id
- POST /customers

Including workflows for each.
2024-01-30 11:43:30 +00:00
Riqwan Thamir
328eb85a8b feat(): added compute actions for buyget promotions (#6255)
what:

- computes actions for buyget promotion (RESOLVES CORE-1700)
2024-01-30 10:32:16 +00:00
Oli Juhl
1c27f7cb34 chore(cart): Clean up data models (#6256)
Clean up data models in Cart Module according to latest established conventions
2024-01-29 18:22:13 +00:00
Sebastian Rindom
87390704be feat(customer): list customer (#6206)
**What**

- GET /admin/customers
- GET /admin/customer-groups
2024-01-29 16:56:39 +00:00
Kasper Fabricius Kristensen
90cff0777f fix(medusa): add support for order field on GET /admin/orders (#6258)
**What**
- Adds support for `order` field on `GET /admin/orders`
2024-01-29 16:00:45 +00:00
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
Shahed Nasser
96629f1916 docs: change process for generating docblocks through actions (#6237)
This PR changes the original process of generating docblocks through actions. The process now is:

1. When a PR is merged for the branch `changeset-release/develop`, the docblock generator tool us used to generate docblocks for the changed files. The changed files are determined by retrieving all comments since the last release and the files in each of those commits.
2. If there are changes after using the docblock generator tool, a PR is opened in the branch `chore/generate-tsdocs`.
3. Once the `chore/generate-tsdocs` is merged, it triggers an action that generates the references for the docs. This changes the previous behaviour of generating references on a new release.

Both actions (that runs the docblock generator tool and that generates references for the docs) can also be triggered manually.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-29 08:05:14 +00:00
Oli Juhl
8f9a12c895 chore: PR team labeler (#6249) 2024-01-29 08:11:39 +01: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
github-actions[bot]
bbf79169a9 chore(docs): Updated API Reference (#6220)
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>
2024-01-25 17:58:17 +00:00
Sebastian Rindom
21c1c5ce6c feat(customer): add migration file (#6205) 2024-01-25 16:52:30 +00:00
github-actions[bot]
e38aa29708 chore(docs): Generated Docs Announcement Bar (automated) (#6219)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2024-01-25 16:47:24 +01:00
Shahed Nasser
b78ffedafb docs: add a section on custom templates in SendGrid guide (#6215) 2024-01-25 16:47:08 +01:00
olivermrbl
c27bb2a61d chore: Release 2024-01-25 16:27:55 +01: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
olivermrbl
4c4c0f655b chore: Add changeset for @medusajs/medusa-js 2024-01-25 15:24:03 +01: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