@k-msg/template 0.16.0 → 0.18.0
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/README.md +4 -0
- package/dist/index.js +22 -22
- package/dist/index.js.map +5 -8
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +5 -8
- package/dist/registry/template.registry.d.ts +2 -2
- package/dist/shared/event-emitter.d.ts +15 -0
- package/package.json +3 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Template Registry - Manages templates across providers and categories
|
|
3
3
|
*/
|
|
4
|
-
import { EventEmitter } from "
|
|
4
|
+
import { EventEmitter } from "../shared/event-emitter";
|
|
5
5
|
import type { AlimTalkTemplate, TemplateCategory, TemplateStatus } from "../types/template.types";
|
|
6
6
|
export interface TemplateSearchFilters {
|
|
7
7
|
provider?: string;
|
|
@@ -63,7 +63,6 @@ export interface TemplateRegistryOptions {
|
|
|
63
63
|
enableValidationOnRegister: boolean;
|
|
64
64
|
}
|
|
65
65
|
export declare class TemplateRegistry extends EventEmitter {
|
|
66
|
-
private options;
|
|
67
66
|
private templates;
|
|
68
67
|
private templatesByCode;
|
|
69
68
|
private templatesByProvider;
|
|
@@ -72,6 +71,7 @@ export declare class TemplateRegistry extends EventEmitter {
|
|
|
72
71
|
private usageStats;
|
|
73
72
|
private backupTimer?;
|
|
74
73
|
private defaultOptions;
|
|
74
|
+
private options;
|
|
75
75
|
constructor(options?: Partial<TemplateRegistryOptions>);
|
|
76
76
|
/**
|
|
77
77
|
* Register a new template
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Listener = (...args: unknown[]) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Minimal event emitter implementation for runtime-neutral (Edge/Web) usage.
|
|
4
|
+
*/
|
|
5
|
+
export declare class EventEmitter {
|
|
6
|
+
private listenersMap;
|
|
7
|
+
on(eventName: string, listener: Listener): this;
|
|
8
|
+
addListener(eventName: string, listener: Listener): this;
|
|
9
|
+
off(eventName: string, listener: Listener): this;
|
|
10
|
+
removeListener(eventName: string, listener: Listener): this;
|
|
11
|
+
once(eventName: string, listener: Listener): this;
|
|
12
|
+
emit(eventName: string, ...args: unknown[]): boolean;
|
|
13
|
+
removeAllListeners(eventName?: string): this;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-msg/template",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"packageManager": "bun@1.3.8",
|
|
5
5
|
"description": "AlimTalk template engine for parsing, building and managing templates",
|
|
6
6
|
"type": "module",
|
|
@@ -29,13 +29,12 @@
|
|
|
29
29
|
"publish": "bun publish --access public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@k-msg/core": "0.
|
|
32
|
+
"@k-msg/core": "0.18.0",
|
|
33
33
|
"zod": "^4.0.14"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typescript": "^5.7.2",
|
|
37
|
-
"@types/bun": "
|
|
38
|
-
"@types/node": "^22.0.0"
|
|
37
|
+
"@types/bun": "^1.3.9"
|
|
39
38
|
},
|
|
40
39
|
"keywords": [
|
|
41
40
|
"alimtalk",
|