@medusajs/types 2.8.3-preview-20250521120154 → 2.8.3-preview-20250521180140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/mutations.d.ts +37 -2
- package/dist/analytics/mutations.d.ts.map +1 -1
- package/dist/analytics/provider.d.ts +12 -0
- package/dist/analytics/provider.d.ts.map +1 -1
- package/dist/analytics/service.d.ts +18 -10
- package/dist/analytics/service.d.ts.map +1 -1
- package/dist/file/service.d.ts +8 -1
- package/dist/file/service.d.ts.map +1 -1
- package/package.json +1 -1
@@ -9,28 +9,63 @@ export interface TrackAnalyticsEventDTO {
|
|
9
9
|
actor_id?: string;
|
10
10
|
/**
|
11
11
|
* The group that the event is for, such as an organization or team.
|
12
|
-
* The "type" defines the name of the group (eg. "organization"), and the "id" is the id of the group.
|
13
12
|
*/
|
14
13
|
group?: {
|
14
|
+
/**
|
15
|
+
* The name of the group.
|
16
|
+
*
|
17
|
+
* @example
|
18
|
+
* "organization"
|
19
|
+
*/
|
15
20
|
type?: string;
|
21
|
+
/**
|
22
|
+
* The group's ID.
|
23
|
+
*/
|
16
24
|
id?: string;
|
17
25
|
};
|
18
26
|
/**
|
19
|
-
* The properties of the event. The format and content depends on the provider.
|
27
|
+
* The properties of the event. The format and content is dynamic and depends on the integrated provider.
|
20
28
|
*/
|
21
29
|
properties?: Record<string, any>;
|
22
30
|
}
|
23
31
|
export interface IdentifyActorDTO {
|
32
|
+
/**
|
33
|
+
* The actor of the event, if there is any.
|
34
|
+
*/
|
24
35
|
actor_id: string;
|
36
|
+
/**
|
37
|
+
* The properties of the actor. The format and content is dynamic and depends on the integrated provider.
|
38
|
+
*/
|
25
39
|
properties?: Record<string, any>;
|
26
40
|
}
|
27
41
|
export interface IdentifyGroupDTO {
|
42
|
+
/**
|
43
|
+
* The group that the event is for, such as an organization or team.
|
44
|
+
*/
|
28
45
|
group: {
|
46
|
+
/**
|
47
|
+
* The name of the group.
|
48
|
+
*
|
49
|
+
* @example
|
50
|
+
* "organization"
|
51
|
+
*/
|
29
52
|
type: string;
|
53
|
+
/**
|
54
|
+
* The group's ID.
|
55
|
+
*/
|
30
56
|
id: string;
|
31
57
|
};
|
58
|
+
/**
|
59
|
+
* When identifying a group, the actor can potentially be passed as well as metadata.
|
60
|
+
*/
|
32
61
|
actor_id?: string;
|
62
|
+
/**
|
63
|
+
* The properties of the group. The format and content is dynamic and depends on the integrated provider.
|
64
|
+
*/
|
33
65
|
properties?: Record<string, any>;
|
34
66
|
}
|
67
|
+
/**
|
68
|
+
* Either the `actor_id` or the `group` property must be set.
|
69
|
+
*/
|
35
70
|
export type IdentifyAnalyticsEventDTO = IdentifyActorDTO | IdentifyGroupDTO;
|
36
71
|
//# sourceMappingURL=mutations.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/analytics/mutations.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/analytics/mutations.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;;;;WAKG;QACH,IAAI,CAAC,EAAE,MAAM,CAAA;QACb;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAA;KACZ,CAAA;IACD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE;QACL;;;;;WAKG;QACH,IAAI,EAAE,MAAM,CAAA;QACZ;;WAEG;QACH,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IACD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,gBAAgB,CAAA"}
|
@@ -21,8 +21,20 @@ export interface IAnalyticsProvider {
|
|
21
21
|
/**
|
22
22
|
* This method is used to shutdown the analytics provider, and flush all data before shutting down.
|
23
23
|
*
|
24
|
+
* This method is called by the Analytics Module when the Medusa application is shutting down.
|
25
|
+
*
|
24
26
|
* @returns {Promise<void>} Resolves when the provider is shutdown successfully.
|
25
27
|
*
|
28
|
+
* @example
|
29
|
+
* class MyAnalyticsProviderService extends AbstractAnalyticsProviderService {
|
30
|
+
* // ...
|
31
|
+
* async shutdown(): Promise<void> {
|
32
|
+
* // perform any cleanup or shutdown logic
|
33
|
+
* // in the analytics provider or using custom logic
|
34
|
+
* // for example:
|
35
|
+
* await this.client.shutdown()
|
36
|
+
* }
|
37
|
+
* }
|
26
38
|
*/
|
27
39
|
shutdown?(): Promise<void>;
|
28
40
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/analytics/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAE/E,MAAM,MAAM,8BAA8B,GAAG,sBAAsB,CAAA;AAEnE,MAAM,MAAM,iCAAiC,GAAG,yBAAyB,CAAA;AAEzE,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1D;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhE
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/analytics/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAE/E,MAAM,MAAM,8BAA8B,GAAG,sBAAsB,CAAA;AAEnE,MAAM,MAAM,iCAAiC,GAAG,yBAAyB,CAAA;AAEzE,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1D;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhE;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
|
@@ -3,33 +3,41 @@ import { IdentifyAnalyticsEventDTO, TrackAnalyticsEventDTO } from "./mutations";
|
|
3
3
|
import { IAnalyticsProvider } from "./provider";
|
4
4
|
export interface IAnalyticsModuleService extends IModuleService {
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* This method returns the service of the configured Analytics Module Provider in `medusa-config.ts`. This is useful
|
7
|
+
* if you want to execute custom methods defined in the provider's service or you need direct access to it.
|
8
|
+
*
|
9
|
+
* @returns {IAnalyticsProvider} An instance of the Analytics Module Provider's service.
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* const postHogProviderService = analyticsModuleService.getProvider()
|
13
|
+
* // TODO: perform custom actions with the provider
|
7
14
|
*/
|
8
15
|
getProvider(): IAnalyticsProvider;
|
9
16
|
/**
|
10
|
-
* This method tracks an event in the analytics provider
|
17
|
+
* This method tracks an event in the analytics provider. The Analytics Module
|
18
|
+
* will use the `track` method of the underlying provider configured in `medusa-config.ts` to track the event.
|
11
19
|
*
|
12
|
-
* @param {TrackAnalyticsEventDTO} data - The
|
20
|
+
* @param {TrackAnalyticsEventDTO} data - The event's details.
|
13
21
|
* @returns {Promise<void>} Resolves when the event is tracked successfully.
|
14
22
|
*
|
15
|
-
*
|
16
23
|
* @example
|
17
24
|
* await analyticsModuleService.track({
|
18
|
-
* event: "
|
25
|
+
* event: "order_placed",
|
19
26
|
* properties: {
|
20
|
-
*
|
21
|
-
*
|
27
|
+
* order_id: "order_123",
|
28
|
+
* customer_id: "customer_456",
|
29
|
+
* total: 100,
|
22
30
|
* }
|
23
31
|
* })
|
24
32
|
*/
|
25
33
|
track(data: TrackAnalyticsEventDTO): Promise<void>;
|
26
34
|
/**
|
27
|
-
* This method identifies an actor or group in the analytics provider
|
35
|
+
* This method identifies an actor or group in the analytics provider. The Analytics Module
|
36
|
+
* will use the `identify` method of the underlying provider configured in `medusa-config.ts` to identify the actor or group.
|
28
37
|
*
|
29
|
-
* @param {IdentifyAnalyticsEventDTO} data - The
|
38
|
+
* @param {IdentifyAnalyticsEventDTO} data - The details of the actor or group.
|
30
39
|
* @returns {Promise<void>} Resolves when the actor or group is identified successfully.
|
31
40
|
*
|
32
|
-
*
|
33
41
|
* @example
|
34
42
|
* await analyticsModuleService.identify({
|
35
43
|
* actor_id: "123",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/analytics/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/analytics/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D;;;;;;;;;OASG;IACH,WAAW,IAAI,kBAAkB,CAAA;IAEjC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElD;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzD"}
|
package/dist/file/service.d.ts
CHANGED
@@ -7,7 +7,14 @@ import { IFileProvider } from "./provider";
|
|
7
7
|
import { CreateFileDTO, GetUploadFileUrlDTO } from "./mutations";
|
8
8
|
export interface IFileModuleService extends IModuleService {
|
9
9
|
/**
|
10
|
-
*
|
10
|
+
* This method returns the service of the configured File Module Provider in `medusa-config.ts`. This is useful
|
11
|
+
* if you want to execute custom methods defined in the provider's service or you need direct access to it.
|
12
|
+
*
|
13
|
+
* @returns {IFileProvider} An instance of the File Module Provider's service.
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* const s3ProviderService = fileModuleService.getProvider()
|
17
|
+
* // TODO: perform custom actions with the provider
|
11
18
|
*/
|
12
19
|
getProvider(): IFileProvider;
|
13
20
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/file/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,OAAO,E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