docs: added how-to guides for architectural modules (#11883)

* added initial how-tos

* finished changes

* generated sidebars
This commit is contained in:
Shahed Nasser
2025-03-18 09:49:19 +02:00
committed by GitHub
parent 0099c1e2e9
commit cb68a9e67b
37 changed files with 5265 additions and 68 deletions
@@ -0,0 +1,442 @@
{
"id": 0,
"name": "cache",
"variant": "project",
"kind": 1,
"flags": {},
"children": [
{
"id": 1,
"name": "ICacheService",
"variant": "declaration",
"kind": 256,
"flags": {},
"children": [
{
"id": 2,
"name": "get",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "service.ts",
"line": 11,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L11"
}
],
"signatures": [
{
"id": 3,
"name": "get",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method retrieves data from the cache."
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "The item that was stored in the cache. If the item was not found, null is returned."
}
]
},
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nconst data = await cache.get(\"my-key\")\n```"
}
]
}
]
},
"sources": [
{
"fileName": "service.ts",
"line": 11,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L11"
}
],
"typeParameters": [
{
"id": 4,
"name": "T",
"variant": "typeParam",
"kind": 131072,
"flags": {}
}
],
"parameters": [
{
"id": 5,
"name": "key",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The key of the item to retrieve."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "union",
"types": [
{
"type": "literal",
"value": null
},
{
"type": "reference",
"target": 4,
"name": "T",
"package": "@medusajs/types",
"refersToTypeParameter": true
}
]
}
],
"name": "Promise",
"package": "typescript"
}
}
]
},
{
"id": 6,
"name": "set",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "service.ts",
"line": 22,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L22"
}
],
"signatures": [
{
"id": 7,
"name": "set",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method stores data in the cache."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nawait cache.set(\"my-key\", { product_id: \"prod_123\" }, 60)\n```"
}
]
}
]
},
"sources": [
{
"fileName": "service.ts",
"line": 22,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L22"
}
],
"parameters": [
{
"id": 8,
"name": "key",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The key of the item to store."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 9,
"name": "data",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The data to store in the cache."
}
]
},
"type": {
"type": "intrinsic",
"name": "unknown"
}
},
{
"id": 10,
"name": "ttl",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The time-to-live (TTL) value in seconds. If not provided, the default TTL value is used. The default value is based on the used Cache Module."
}
]
},
"type": {
"type": "intrinsic",
"name": "number"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "void"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
},
{
"id": 11,
"name": "invalidate",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "service.ts",
"line": 31,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L31"
}
],
"signatures": [
{
"id": 12,
"name": "invalidate",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method removes an item from the cache."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nawait cache.invalidate(\"my-key\")\n```"
}
]
}
]
},
"sources": [
{
"fileName": "service.ts",
"line": 31,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L31"
}
],
"parameters": [
{
"id": 13,
"name": "key",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The key of the item to remove."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "void"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
}
],
"groups": [
{
"title": "Methods",
"children": [
2,
6,
11
]
}
],
"sources": [
{
"fileName": "service.ts",
"line": 1,
"character": 17,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/cache/service.ts#L1"
}
]
}
],
"groups": [
{
"title": "Interfaces",
"children": [
1
]
}
],
"packageName": "@medusajs/types",
"symbolIdMap": {
"0": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": ""
},
"1": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService"
},
"2": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.get"
},
"3": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.get"
},
"4": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "T"
},
"5": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "key"
},
"6": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.set"
},
"7": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.set"
},
"8": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "key"
},
"9": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "data"
},
"10": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ttl"
},
"11": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.invalidate"
},
"12": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "ICacheService.invalidate"
},
"13": {
"sourceFileName": "../../../../packages/core/types/src/cache/service.ts",
"qualifiedName": "key"
}
},
"files": {
"entries": {
"1": "../../../../packages/core/types/src/cache/service.ts"
},
"reflections": {
"1": 0
}
}
}
@@ -0,0 +1,783 @@
{
"id": 58,
"name": "event",
"variant": "project",
"kind": 1,
"flags": {},
"children": [
{
"id": 59,
"name": "IEventBusModuleService",
"variant": "declaration",
"kind": 256,
"flags": {},
"children": [
{
"id": 60,
"name": "emit",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 18,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L18"
}
],
"signatures": [
{
"id": 61,
"name": "emit",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method emits one or more events. Subscribers listening to the event(s) are executed asynchronously."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nawait eventBus.emit({ \n name: \"user.created\", \n data: { \n user_id: \"user_123\"\n }\n})\n```"
}
]
}
]
},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 18,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L18"
}
],
"typeParameters": [
{
"id": 62,
"name": "T",
"variant": "typeParam",
"kind": 131072,
"flags": {}
}
],
"parameters": [
{
"id": 63,
"name": "data",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The details of the events to emit."
}
]
},
"type": {
"type": "union",
"types": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "Message"
},
"typeArguments": [
{
"type": "reference",
"target": 62,
"name": "T",
"package": "@medusajs/types",
"refersToTypeParameter": true
}
],
"name": "Message",
"package": "@medusajs/types"
},
{
"type": "array",
"elementType": {
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "Message"
},
"typeArguments": [
{
"type": "reference",
"target": 62,
"name": "T",
"package": "@medusajs/types",
"refersToTypeParameter": true
}
],
"name": "Message",
"package": "@medusajs/types"
}
}
]
}
},
{
"id": 64,
"name": "options",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "Additional options for the event."
}
]
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Record"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "unknown"
}
],
"name": "Record",
"package": "typescript"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "void"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
},
{
"id": 65,
"name": "subscribe",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 36,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L36"
}
],
"signatures": [
{
"id": 66,
"name": "subscribe",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method adds a subscriber to an event. It's mainly used internally to register subscribers."
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "The instance of the Event Module"
}
]
},
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\neventBus.subscribe(\"user.created\", async (data) => {\n console.log(\"User created\", data)\n})\n```"
}
]
}
]
},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 36,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L36"
}
],
"parameters": [
{
"id": 67,
"name": "eventName",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The name of the event to subscribe to."
}
]
},
"type": {
"type": "union",
"types": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "symbol"
}
]
}
},
{
"id": 68,
"name": "subscriber",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The subscriber function to execute when the event is emitted."
}
]
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "Subscriber"
},
"name": "Subscriber",
"package": "@medusajs/types"
}
},
{
"id": 69,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The context of the subscriber."
}
]
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "SubscriberContext"
},
"name": "SubscriberContext",
"package": "@medusajs/types"
}
}
],
"type": {
"type": "intrinsic",
"name": "this"
}
}
]
},
{
"id": 70,
"name": "unsubscribe",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 55,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L55"
}
],
"signatures": [
{
"id": 71,
"name": "unsubscribe",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method removes a subscriber from an event. It's mainly used internally to unregister subscribers."
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "The instance of the Event Module"
}
]
},
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\neventBus.unsubscribe(\"user.created\", async (data) => {\n console.log(\"User created\", data)\n})\n```"
}
]
}
]
},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 55,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L55"
}
],
"parameters": [
{
"id": 72,
"name": "eventName",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The name of the event to unsubscribe from."
}
]
},
"type": {
"type": "union",
"types": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "symbol"
}
]
}
},
{
"id": 73,
"name": "subscriber",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The subscriber function to remove."
}
]
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "Subscriber"
},
"name": "Subscriber",
"package": "@medusajs/types"
}
},
{
"id": 74,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The context of the subscriber."
}
]
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts",
"qualifiedName": "SubscriberContext"
},
"name": "SubscriberContext",
"package": "@medusajs/types"
}
}
],
"type": {
"type": "intrinsic",
"name": "this"
}
}
]
},
{
"id": 75,
"name": "releaseGroupedEvents",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 70,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L70"
}
],
"signatures": [
{
"id": 76,
"name": "releaseGroupedEvents",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method emits all events in the specified group. Grouped events are useful when you have distributed transactions\nwhere you need to explicitly group, release and clear events upon lifecycle events of a transaction."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nawait eventBus.releaseGroupedEvents(\"group_123\")\n```"
}
]
}
]
},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 70,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L70"
}
],
"parameters": [
{
"id": 77,
"name": "eventGroupId",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The ID of the event group."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "void"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
},
{
"id": 78,
"name": "clearGroupedEvents",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 80,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L80"
}
],
"signatures": [
{
"id": 79,
"name": "clearGroupedEvents",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "This method removes all events in the specified group. Grouped events are useful when you have distributed transactions\nwhere you need to explicitly group, release and clear events upon lifecycle events of a transaction."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nawait eventBus.clearGroupedEvents(\"group_123\")\n```"
}
]
}
]
},
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 80,
"character": 2,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L80"
}
],
"parameters": [
{
"id": 80,
"name": "eventGroupId",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The ID of the event group."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "void"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
}
],
"groups": [
{
"title": "Methods",
"children": [
60,
65,
70,
75,
78
]
}
],
"sources": [
{
"fileName": "event-bus-module.ts",
"line": 3,
"character": 17,
"url": "https://github.com/medusajs/medusa/blob/cb6249320e7322e8eabfec8434f1278f8d63e96c/packages/core/types/src/event-bus/event-bus-module.ts#L3"
}
]
}
],
"groups": [
{
"title": "Interfaces",
"children": [
59
]
}
],
"packageName": "@medusajs/types",
"symbolIdMap": {
"58": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": ""
},
"59": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService"
},
"60": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.emit"
},
"61": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.emit"
},
"62": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "T"
},
"63": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "data"
},
"64": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "options"
},
"65": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.subscribe"
},
"66": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.subscribe"
},
"67": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "eventName"
},
"68": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "subscriber"
},
"69": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "context"
},
"70": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.unsubscribe"
},
"71": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.unsubscribe"
},
"72": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "eventName"
},
"73": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "subscriber"
},
"74": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "context"
},
"75": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.releaseGroupedEvents"
},
"76": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.releaseGroupedEvents"
},
"77": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "eventGroupId"
},
"78": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.clearGroupedEvents"
},
"79": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "IEventBusModuleService.clearGroupedEvents"
},
"80": {
"sourceFileName": "../../../../packages/core/types/src/event-bus/event-bus-module.ts",
"qualifiedName": "eventGroupId"
}
},
"files": {
"entries": {
"1": "../../../../packages/core/types/src/event-bus/event-bus-module.ts"
},
"reflections": {
"1": 58
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -11,6 +11,17 @@ import { modules } from "./references.js"
import { getCoreFlowNamespaces } from "../utils/get-namespaces.js"
const customOptions: Record<string, Partial<TypeDocOptions>> = {
"auth-provider": getOptions({
entryPointPath: "packages/core/utils/src/auth/abstract-auth-provider.ts",
tsConfigName: "utils.json",
name: "auth-provider",
parentIgnore: true,
}),
cache: getOptions({
entryPointPath: "packages/core/types/src/cache/service.ts",
tsConfigName: "types.json",
name: "cache",
}),
"core-flows": getOptions({
entryPointPath: "packages/core/core-flows/src/index.ts",
tsConfigName: "core-flows.json",
@@ -21,17 +32,6 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
// @ts-expect-error there's a typing issue in typedoc
generatePathNamespaces: getCoreFlowNamespaces(),
}),
"auth-provider": getOptions({
entryPointPath: "packages/core/utils/src/auth/abstract-auth-provider.ts",
tsConfigName: "utils.json",
name: "auth-provider",
parentIgnore: true,
}),
locking: getOptions({
entryPointPath: "packages/core/types/src/locking/index.ts",
tsConfigName: "types.json",
name: "locking",
}),
dml: getOptions({
entryPointPath: [
"packages/core/utils/src/dml/entity-builder.ts",
@@ -42,29 +42,28 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
name: "dml",
generateCustomNamespaces: true,
}),
event: getOptions({
entryPointPath: "packages/core/types/src/event-bus/event-bus-module.ts",
tsConfigName: "types.json",
name: "event",
}),
file: getOptions({
entryPointPath: "packages/core/utils/src/file/abstract-file-provider.ts",
tsConfigName: "utils.json",
name: "file",
parentIgnore: true,
}),
"file-service": getOptions({
entryPointPath: "packages/core/types/src/file/service.ts",
tsConfigName: "types.json",
name: "file-service",
}),
"fulfillment-provider": getOptions({
entryPointPath: "packages/core/utils/src/fulfillment/provider.ts",
tsConfigName: "utils.json",
name: "fulfillment-provider",
parentIgnore: true,
}),
"js-sdk": getOptions({
entryPointPath: [
"packages/core/js-sdk/src/admin/index.ts",
"packages/core/js-sdk/src/auth/index.ts",
"packages/core/js-sdk/src/store/index.ts",
],
tsConfigName: "js-sdk.json",
name: "js-sdk",
enableInternalResolve: true,
exclude: [...(baseOptions.exclude || []), "**/dist/**"],
}),
"helper-steps": getOptions({
entryPointPath: "packages/core/core-flows/src/common/index.ts",
tsConfigName: "core-flows.json",
@@ -77,6 +76,22 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
),
],
}),
"js-sdk": getOptions({
entryPointPath: [
"packages/core/js-sdk/src/admin/index.ts",
"packages/core/js-sdk/src/auth/index.ts",
"packages/core/js-sdk/src/store/index.ts",
],
tsConfigName: "js-sdk.json",
name: "js-sdk",
enableInternalResolve: true,
exclude: [...(baseOptions.exclude || []), "**/dist/**"],
}),
locking: getOptions({
entryPointPath: "packages/core/types/src/locking/index.ts",
tsConfigName: "types.json",
name: "locking",
}),
medusa: getOptions({
entryPointPath: "packages/medusa/src/index.ts",
tsConfigName: "medusa.json",
@@ -104,6 +119,11 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
"**/modules-config.ts",
],
}),
"modules-sdk": getOptions({
entryPointPath: "packages/core/modules-sdk/src/index.ts",
tsConfigName: "modules-sdk.json",
name: "modules-sdk",
}),
notification: getOptions({
entryPointPath:
"packages/core/utils/src/notification/abstract-notification-provider.ts",
@@ -111,6 +131,11 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
name: "notification",
parentIgnore: true,
}),
"notification-service": getOptions({
entryPointPath: "packages/core/types/src/notification/service.ts",
tsConfigName: "types.json",
name: "notification-service",
}),
"payment-provider": getOptions({
entryPointPath:
"packages/core/utils/src/payment/abstract-payment-provider.ts",
@@ -143,11 +168,6 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
),
],
}),
"modules-sdk": getOptions({
entryPointPath: "packages/core/modules-sdk/src/index.ts",
tsConfigName: "modules-sdk.json",
name: "modules-sdk",
}),
utils: getOptions({
entryPointPath: "packages/core/utils/src/index.ts",
tsConfigName: "utils.json",
@@ -0,0 +1,49 @@
import { FormattingOptionsType } from "types"
const cacheOptions: FormattingOptionsType = {
"^cache/.*ICacheService": {
reflectionGroups: {
Constructors: false,
},
reflectionDescription: `In this document, youll learn about the different methods in the Cache Module's service and how to use them.`,
frontmatterData: {
slug: "/references/cache-service",
tags: ["cache", "server", "how to"],
sidebar_label: "Use Cache Module",
},
reflectionTitle: {
fullReplacement: "How to Use Cache Module",
},
expandMembers: true,
startSections: [
`## Resolve Cache Module's Service
In your workflow's step, you can resolve the Cache Module's service from the Medusa container:
\`\`\`ts
import { Modules } from "@medusajs/framework/utils"
import { createStep } from "@medusajs/framework/workflows-sdk"
const step1 = createStep(
"step-1",
async ({}, { container }) => {
const cacheModuleService = container.resolve(
Modules.CACHE
)
// TODO use cacheModuleService
}
)
\`\`\`
This will resolve the service of the configured Cache Module, which is the [In-Memory Cache Module](https://docs.medusajs.com/resources/architectural-modules/cache/in-memory) by default.
You can then use the Cache Module's service's methods in the step. The rest of this guide details these methods.
---
`,
],
},
}
export default cacheOptions
@@ -0,0 +1,49 @@
import { FormattingOptionsType } from "types"
const eventOptions: FormattingOptionsType = {
"^event/.*IEventBusModuleService": {
reflectionGroups: {
Constructors: false,
},
reflectionDescription: `In this document, youll learn about the different methods in the Event Module's service and how to use them.`,
frontmatterData: {
slug: "/references/event-service",
tags: ["event", "server", "how to"],
sidebar_label: "Use Event Module",
},
reflectionTitle: {
fullReplacement: "How to Use Event Module",
},
expandMembers: true,
startSections: [
`## Resolve Event Module's Service
In your workflow's step, you can resolve the Event Module's service from the Medusa container:
\`\`\`ts
import { Modules } from "@medusajs/framework/utils"
import { createStep } from "@medusajs/framework/workflows-sdk"
const step1 = createStep(
"step-1",
async ({}, { container }) => {
const eventModuleService = container.resolve(
Modules.EVENT
)
// TODO use eventModuleService
}
)
\`\`\`
This will resolve the service of the configured Event Module, which is the [Local Event Module](https://docs.medusajs.com/resources/architectural-modules/event/local) by default.
You can then use the Event Module's service's methods in the step. The rest of this guide details these methods.
---
`,
],
},
}
export default eventOptions
@@ -0,0 +1,47 @@
import { FormattingOptionsType } from "types"
const fileServiceOptions: FormattingOptionsType = {
"^file_service/.*IFileModuleService": {
reflectionGroups: {
Constructors: false,
},
reflectionDescription: `In this document, youll learn about the different methods in the File Module's service and how to use them.`,
frontmatterData: {
slug: "/references/file-service",
tags: ["file", "server", "how to"],
sidebar_label: "Use File Module",
},
reflectionTitle: {
fullReplacement: "How to Use File Module",
},
expandMembers: true,
startSections: [
`## Resolve File Module's Service
In your workflow's step, you can resolve the File Module's service from the Medusa container:
\`\`\`ts
import { Modules } from "@medusajs/framework/utils"
import { createStep } from "@medusajs/framework/workflows-sdk"
const step1 = createStep(
"step-1",
async ({}, { container }) => {
const fileModuleService = container.resolve(
Modules.FILE
)
// TODO use fileModuleService
}
)
\`\`\`
You can then use the File Module's service's methods in the step. The rest of this guide details these methods.
---
`,
],
},
}
export default fileServiceOptions
@@ -14,11 +14,18 @@ import dmlOptions from "./dml.js"
import coreFlowsOptions from "./core-flows.js"
import jsSdkOptions from "./js-sdk.js"
import lockingOptions from "./locking.js"
import cacheOptions from "./cache.js"
import eventOptions from "./event.js"
import fileServiceOptions from "./file-service.js"
import notificationServiceOptions from "./notification-service.js"
const mergerCustomOptions: FormattingOptionsType = {
...authProviderOptions,
...cacheOptions,
...coreFlowsOptions,
...dmlOptions,
...eventOptions,
...fileServiceOptions,
...fileOptions,
...fulfillmentProviderOptions,
...helperStepsOptions,
@@ -26,6 +33,7 @@ const mergerCustomOptions: FormattingOptionsType = {
...lockingOptions,
...medusaConfigOptions,
...medusaOptions,
...notificationServiceOptions,
...notificationOptions,
...paymentProviderOptions,
...searchOptions,
@@ -0,0 +1,47 @@
import { FormattingOptionsType } from "types"
const notificationServiceOptions: FormattingOptionsType = {
"^notification_service/.*INotificationModuleService": {
reflectionGroups: {
Constructors: false,
},
reflectionDescription: `In this document, youll learn about the different methods in the Notification Module's service and how to use them.`,
frontmatterData: {
slug: "/references/notification-service",
tags: ["notification", "server", "how to"],
sidebar_label: "Use Notification Module",
},
reflectionTitle: {
fullReplacement: "How to Use Notification Module",
},
expandMembers: true,
startSections: [
`## Resolve Notification Module's Service
In your workflow's step, you can resolve the Notification Module's service from the Medusa container:
\`\`\`ts
import { Modules } from "@medusajs/framework/utils"
import { createStep } from "@medusajs/framework/workflows-sdk"
const step1 = createStep(
"step-1",
async ({}, { container }) => {
const notificationModuleService = container.resolve(
Modules.NOTIFICATION
)
// TODO use notificationModuleService
}
)
\`\`\`
You can then use the Notification Module's service's methods in the step. The rest of this guide details these methods.
---
`,
],
},
}
export default notificationServiceOptions
@@ -39,6 +39,10 @@ const allReferences = [
"utils",
"workflows",
"locking",
"cache",
"event",
"file-service",
"notification-service",
]
export default allReferences