@intlayer/api 5.8.1 → 6.0.0-canary.1
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/cjs/distantDictionary/fetchDistantDictionaries.cjs +3 -12
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +3 -16
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/distantDictionary/index.cjs +3 -3
- package/dist/cjs/distantDictionary/index.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +8 -2
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs +2 -2
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/proxy.cjs +123 -0
- package/dist/cjs/proxy.cjs.map +1 -0
- package/dist/cjs/types.cjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +3 -12
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +3 -16
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/distantDictionary/index.mjs +1 -1
- package/dist/esm/distantDictionary/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +8 -2
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +2 -2
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/proxy.mjs +99 -0
- package/dist/esm/proxy.mjs.map +1 -0
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
- package/dist/types/distantDictionary/index.d.ts +1 -1
- package/dist/types/distantDictionary/index.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/dictionary.d.ts +3 -2
- package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/editor.d.ts +3 -3
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/proxy.d.ts +14 -0
- package/dist/types/proxy.d.ts.map +1 -0
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +10 -13
- package/dist/cjs/IntlayerEventListener.cjs +0 -127
- package/dist/cjs/IntlayerEventListener.cjs.map +0 -1
- package/dist/esm/IntlayerEventListener.mjs +0 -93
- package/dist/esm/IntlayerEventListener.mjs.map +0 -1
- package/dist/types/IntlayerEventListener.d.ts +0 -63
- package/dist/types/IntlayerEventListener.d.ts.map +0 -1
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { DictionaryAPI } from '@intlayer/backend';
|
|
2
|
-
import type { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
export type IntlayerMessageEvent = MessageEvent;
|
|
4
|
-
/**
|
|
5
|
-
* IntlayerEventListener class to listen for dictionary changes via SSE (Server-Sent Events).
|
|
6
|
-
*
|
|
7
|
-
* Usage example:
|
|
8
|
-
*
|
|
9
|
-
* import { buildIntlayerDictionary } from './transpiler/declaration_file_to_dictionary/intlayer_dictionary';
|
|
10
|
-
* import { IntlayerEventListener } from '@intlayer/api';
|
|
11
|
-
*
|
|
12
|
-
* export const checkDictionaryChanges = async () => {
|
|
13
|
-
* // Instantiate the listener
|
|
14
|
-
* const eventListener = new IntlayerEventListener();
|
|
15
|
-
*
|
|
16
|
-
* // Set up your callbacks
|
|
17
|
-
* eventListener.onDictionaryChange = async (dictionary) => {
|
|
18
|
-
* await buildIntlayerDictionary(dictionary);
|
|
19
|
-
* };
|
|
20
|
-
*
|
|
21
|
-
* // Initialize the listener
|
|
22
|
-
* await eventListener.initialize();
|
|
23
|
-
*
|
|
24
|
-
* // Optionally, clean up later when you’re done
|
|
25
|
-
* // eventListener.cleanup();
|
|
26
|
-
* };
|
|
27
|
-
*/
|
|
28
|
-
export declare class IntlayerEventListener {
|
|
29
|
-
private intlayerConfig;
|
|
30
|
-
private eventSource;
|
|
31
|
-
/**
|
|
32
|
-
* Callback triggered when a Dictionary is ADDED.
|
|
33
|
-
*/
|
|
34
|
-
onDictionaryAdded?: (dictionary: DictionaryAPI) => any;
|
|
35
|
-
/**
|
|
36
|
-
* Callback triggered when a Dictionary is UPDATED.
|
|
37
|
-
*/
|
|
38
|
-
onDictionaryChange?: (dictionary: DictionaryAPI) => any;
|
|
39
|
-
/**
|
|
40
|
-
* Callback triggered when a Dictionary is DELETED.
|
|
41
|
-
*/
|
|
42
|
-
onDictionaryDeleted?: (dictionary: DictionaryAPI) => any;
|
|
43
|
-
constructor(intlayerConfig?: IntlayerConfig);
|
|
44
|
-
/**
|
|
45
|
-
* Initializes the EventSource connection using the given intlayerConfig
|
|
46
|
-
* (or the default config if none was provided).
|
|
47
|
-
*/
|
|
48
|
-
initialize(): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Cleans up (closes) the EventSource connection.
|
|
51
|
-
*/
|
|
52
|
-
cleanup(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Handles incoming SSE messages, parses the event data,
|
|
55
|
-
* and invokes the appropriate callback.
|
|
56
|
-
*/
|
|
57
|
-
private handleMessage;
|
|
58
|
-
/**
|
|
59
|
-
* Handles any SSE errors and then performs cleanup.
|
|
60
|
-
*/
|
|
61
|
-
private handleError;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=IntlayerEventListener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerEventListener.d.ts","sourceRoot":"","sources":["../../src/IntlayerEventListener.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,qBAAqB;IAkBpB,OAAO,CAAC,cAAc;IAjBlC,OAAO,CAAC,WAAW,CAA4B;IAE/C;;OAEG;IACI,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,GAAG,CAAC;IAE9D;;OAEG;IACI,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,GAAG,CAAC;IAE/D;;OAEG;IACI,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,GAAG,CAAC;gBAE5C,cAAc,GAAE,cAA8B;IAElE;;;OAGG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBxC;;OAEG;IACI,OAAO,IAAI,IAAI;IAOtB;;;OAGG;YACW,aAAa;IAkC3B;;OAEG;IACH,OAAO,CAAC,WAAW;CAIpB"}
|