Commit Graph

3858 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
4d16acf5f0 feat(link-modules,modules-sdk, utils, types, products) - Remote Link and Link modules (#4695)
What:
- Definition of all Modules links
- `link-modules` package to manage the creation of all pre-defined link or custom ones

```typescript
import { initialize as iniInventory } from "@medusajs/inventory";
import { initialize as iniProduct } from "@medusajs/product";

import {
  initialize as iniLinks,
  runMigrations as migrateLinks
} from "@medusajs/link-modules";

await Promise.all([iniInventory(), iniProduct()]);


await migrateLinks(); // create tables based on previous loaded modules

await iniLinks(); // load link based on previous loaded modules

await iniLinks(undefined, [
  {
    serviceName: "product_custom_translation_service_link",
    isLink: true,
    databaseConfig: {
      tableName: "product_transalations",
    },
    alias: [
      {
        name: "translations",
      },
    ],
    primaryKeys: ["id", "product_id", "translation_id"],
    relationships: [
      {
        serviceName: Modules.PRODUCT,
        primaryKey: "id",
        foreignKey: "product_id",
        alias: "product",
      },
      {
        serviceName: "custom_translation_service",
        primaryKey: "id",
        foreignKey: "translation_id",
        alias: "transalation",
        deleteCascade: true,
      },
    ],
    extends: [
      {
        serviceName: Modules.PRODUCT,
        relationship: {
          serviceName: "product_custom_translation_service_link",
          primaryKey: "product_id",
          foreignKey: "id",
          alias: "translations",
          isList: true,
        },
      },
      {
        serviceName: "custom_translation_service",
        relationship: {
          serviceName: "product_custom_translation_service_link",
          primaryKey: "product_id",
          foreignKey: "id",
          alias: "product_link",
        },
      },
    ],
  },
]); // custom links
```

Remote Link

```typescript
import { RemoteLink, Modules } from "@medusajs/modules-sdk";

// [...] initialize modules and links

const remoteLink = new RemoteLink();

// upsert the relationship
await remoteLink.create({ // one (object) or many (array)
  [Modules.PRODUCT]: {
    variant_id: "var_abc",
  },
  [Modules.INVENTORY]: {
    inventory_item_id: "iitem_abc",
  },
  data: { // optional additional fields
    required_quantity: 5
  }
});

// dismiss (doesn't cascade)
await remoteLink.dismiss({ // one (object) or many (array)
  [Modules.PRODUCT]: {
    variant_id: "var_abc",
  },
  [Modules.INVENTORY]: {
    inventory_item_id: "iitem_abc",
  },
});

// delete
await remoteLink.delete({
  // every key is a module
  [Modules.PRODUCT]: {
    // every key is a linkable field
    variant_id: "var_abc", // single or multiple values
  },
});

// restore
await remoteLink.restore({
  // every key is a module
  [Modules.PRODUCT]: {
    // every key is a linkable field
    variant_id: "var_abc", // single or multiple values
  },
});

```

Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
2023-08-30 14:31:32 +00:00
Shahed Nasser
bc4c9e0d32 docs: update admin CLI configurations (#4910)
* docs: update admin configurations

* fix in dev command name
2023-08-30 17:12:16 +03:00
Shahed Nasser
b05bae1471 docs: update Create Fulfillment Provider guide (#4911) 2023-08-30 16:03:56 +03:00
Andreas Deininger
a0bbc1893b chore: fix typos (#4877)
* Chore: Fix typos

* Add generated resources

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-08-30 13:27:46 +03:00
Shahed Nasser
359bd290ba docs: added expected columns for imports (#4908)
* docs: added expected columns for imports

* linked from user guide to new sections
2023-08-30 12:00:43 +03:00
Riqwan Thamir
460161a69f feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)
What:

- Setups the skeleton for pricing module
- Creates service/model/repository for currency model
- Setups types
- Setups DB
- Moved some utils to a common place

RESOLVES CORE-1477
RESOLVES CORE-1476
2023-08-29 21:58:34 +00:00
Rares Stefan
470379e631 fix(medusa, admin-ui): Add deleted_at to Return Reason unique constraint (#4834)
* Update return reason create to upsert

* Create strange-wombats-invite.md

* Revert upsert, make value index only apply on non-deleted entities
2023-08-29 19:26:58 +02:00
Lacey Pevey
046b0dcfa5 chore(medusa-file-s3): Add cache-control option + update to sdk v3 (#4884)
* add cache-control option, fix delete function, update to sdk v3

* Create cool-pears-trade.md

* reformat throw line, remove dev comment

* remove console.log debugging statement

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-29 19:25:17 +02:00
Shahed Nasser
33ffdaf42d docs: added B2B recipe (#4901)
* added b2b recipe

* added redirect rule

* fix build errors

* fix broken links
2023-08-29 19:50:14 +03:00
Shahed Nasser
e086e3efbd docs: fix customer_id name in create endpoints docs (#4900) 2023-08-29 17:42:05 +03:00
Shahed Nasser
f75d9806f9 docs: added rbac recipe (#4895)
* docs: added rbac recipe

* fix eslint errors

* fixed indentation causing build error

* fix build warning

* small fixes

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-29 15:11:52 +03:00
Micky Jittjana
4d439bed38 fix(medusa): Make event enqueuer reconnect the database when it lost the connection (#4855)
* Try to periodically reconnect database from enqueuer

* Create great-months-train.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2023-08-29 13:03:11 +02:00
Oli Juhl
4897040c92 fix(ci): Increase memory allocation for plugin tests (#4898) 2023-08-29 11:58:17 +02:00
Carlos R. L. Rodrigues
d9c5e165cd chore: pipeline node version (#4896) 2023-08-28 19:41:47 +00:00
Frane Polić
b7de679e9b feat(admin-ui): batch job completed notification (#4886) 2023-08-28 20:21:42 +02:00
Frane Polić
758f035c2f fix(admin-ui): delete customer group (#4893) 2023-08-28 19:05:31 +02:00
Jhony Babs
0b397878f7 docs: fix edit button links (#4883)
* docs: fix docusaurus.config.js

* chore : fix lint

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-08-28 19:14:43 +03:00
Frane Polić
50798d1189 fix(admin-ui): currency input exception (#4888)
* fix: infer cell formatting

* chore: changeset

* Update friendly-months-attack.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-28 16:58:34 +02:00
Andreas Deininger
88e68af501 chore(ci): Bump GitHub workflows to run on node 16 (#4876)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-28 16:58:05 +02:00
Riqwan Thamir
a1110b3438 fix(medusa): category_id and q params for list products endpoint ld work (#4889)
Looks like during an earlier refactor, some of the categories logic wasn't ported over to the handler that works with q params. 

what:

- adds a fix that allows queries to be made on category_id when q param is passed.

Fixes https://github.com/medusajs/medusa/issues/4885
2023-08-28 11:46:55 +00:00
Shahed Nasser
962c907dfa docs: updated create file service guide (#4887) 2023-08-28 12:50:34 +03:00
Oli Juhl
af09a4b7b4 fix(medusa-file-*): Add types as devDeps (#4871) 2023-08-27 16:32:59 +02:00
Shahed Nasser
17c26c4f66 docs,api-ref: fixed search bugs (#4866) 2023-08-25 18:39:31 +03:00
github-actions[bot]
facaf8c399 chore(docs): Generated Docs Announcement Bar (automated) (#4868)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-08-25 18:22:16 +03:00
Oli Juhl
ae6dd17ca8 chore: v1.15.0 upgrade guide (#4862)
* chore: v1.15.0 upgrade guide

* Update 1-15-0.md

* eslint fixes

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-08-25 17:04:38 +02:00
github-actions[bot]
81904762b0 chore: Version Packages (#4867)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-25 16:49:02 +02:00
olivermrbl
e91bd9e1c1 chore(changesets): Minor bump file plugins 2023-08-25 16:36:54 +02:00
olivermrbl
d7e435650a chore: Release 2023-08-25 16:24:58 +02:00
github-actions[bot]
362abdfad7 chore: Version Packages (#4826)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-25 16:15:33 +02:00
Oli Juhl
f28fa6a7b3 chore(admin): Add caret range to peer deps (#4865) 2023-08-25 16:07:43 +02:00
Shahed Nasser
6d94c0c181 docs: added beta features documentation (#4859) 2023-08-25 14:59:20 +03:00
github-actions[bot]
7aaa332a32 chore(docs): Generated API Reference (#4857)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-08-25 13:24:26 +03:00
Shahed Nasser
d04b9635f9 chore(oas): fix Get Variant's Inventory OAS (#4856)
* chore(oas): fix Get Variant's Inventory OAS

* fix the curl example
2023-08-25 13:03:55 +03:00
Sebastian Rindom
819d27e774 chore(tests): add integration test of canceling order with many items (#4776)
What

- Adds an integration test to check if canceling an order with many items succeeds.

Related to #4763
2023-08-25 09:00:47 +00:00
Victor Frunza
9766758e19 Fixed: Typo for should in the "Create Region" form (#4854)
closes #4853
2023-08-25 08:41:54 +00:00
Frane Polić
0c7c2eeeab feat(admin-ui): refresh products when a BatchJob is completed (#4840) 2023-08-25 07:34:48 +00:00
Shahed Nasser
f07dc0384f docs,api-ref: added search filters (#4830)
* initial implementation of search modal

* added hit and search suggestions

* added support for multiple indices

* updated sample env

* added close when click outside dropdown

* test for mobile

* added mobile design

* added shortcut

* dark mode fixes

* added search to docs

* added plugins filter

* added React import

* moved filters to configurations

* handled error on page load

* change suggestion text

* removed hits limit

* handle select all

* open link in current tab

* change highlight colors

* added support for shortcuts + auto focus

* change header and footer

* redesigned search ui
2023-08-24 18:36:06 +03:00
Rares Stefan
f4bf9ee169 fix(admin-ui): Fix variant creation when no stock locations provided (#4843)
* Update check on variant creation, whether to create stock locations

* Create spicy-shoes-type.md
2023-08-24 08:51:12 +02:00
Rares Stefan
57e199ef52 fix(admin-ui): Fix sign out in admin panel not redirecting correctly (#4837) 2023-08-23 21:54:45 +02:00
Frane Polić
8b860416d2 feat(medusa): PriceListImportStrategy descriptive errors (#4842) 2023-08-23 21:39:34 +02:00
Shahed Nasser
c58588904c fix(medusa-telemetry): added missing babel dependencies (#4817) 2023-08-23 14:26:06 +02:00
Frane Polić
d8a6e3e0d8 feat(medusa-file-local): implement missing streaming methods (#4788) 2023-08-23 13:05:04 +02:00
github-actions[bot]
4843cc6301 chore(docs): Removed Docs Announcement Bar (automated) (#4836)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-08-23 10:01:16 +03:00
olivermrbl
8a43a6bc1d chore: Bump @medusajs/utils + @medusajs/product 2023-08-22 15:46:59 +02:00
olivermrbl
e9d76fa3d7 chore(changesets): Change minor to patch 2023-08-22 15:36:10 +02:00
Carlos R. L. Rodrigues
c53fa6cd3b fix(utils,product): mikro orm connection loader (#4825)
Fix shared connection property check
2023-08-22 12:35:52 +00:00
Frane Polić
edf9ed4e59 fix(medusa-interfaces, medusa-file-*): flag for streaming to a private bucket (#4771)
* wip: unify file service api

* fix: flag type

* fix: update Spaces service

* fix: S3/Spaces - default to private

* fix: MinIO `isPrivate` for `getPresignedDownloadUrl`, add `isPrivate` to `GetUploadedFileType`

* chore: changeset
2023-08-22 13:05:30 +02:00
Shahed Nasser
80d603a63d docs: improved glossary definitions (#4820)
* docs: improved glossary definitions

* Update glossary.ts
2023-08-21 13:09:59 +03:00
Shahed Nasser
740a3c6e18 docs: improved glossary feature (#4819) 2023-08-21 12:31:16 +03:00
Shahed Nasser
f11375a686 docs: remove yarn create-medusa-app until a fix is out (#4818) 2023-08-21 11:49:18 +03:00