docs: added how-to guides for architectural modules (#11883)
* added initial how-tos * finished changes * generated sidebars
This commit is contained in:
@@ -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
Reference in New Issue
Block a user