bm-webapp-sdk 0.1.1 → 0.1.3
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/index.d.ts +1 -2
- package/esm/index.js +2 -0
- package/package.json +6 -3
- package/dist/WebAppHandler.d.ts +0 -56
package/dist/index.d.ts
CHANGED
package/esm/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bm-webapp-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
5
|
+
"main": "esm/index.js",
|
|
6
|
+
"types": "esm/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"develop": "webpack-dev-server --mode development",
|
|
9
9
|
"build": "webpack --mode production"
|
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
"typescript": "^5.3.3",
|
|
23
23
|
"webpack-cli": "^5.1.4",
|
|
24
24
|
"webpack-dev-server": "^5.0.2"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"typescript-declaration-webpack-plugin": "^0.3.0"
|
|
25
28
|
}
|
|
26
29
|
}
|
package/dist/WebAppHandler.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
interface HandlerOptions {
|
|
2
|
-
sessionHash?: string;
|
|
3
|
-
scenarioCode?: string;
|
|
4
|
-
initVariables?: TData;
|
|
5
|
-
botTokenParamName?: string;
|
|
6
|
-
userApiToken?: string;
|
|
7
|
-
retryDelayOnTimeout?: number;
|
|
8
|
-
requestTimeout?: number;
|
|
9
|
-
responseVar?: string;
|
|
10
|
-
apiEndpoint?: string;
|
|
11
|
-
}
|
|
12
|
-
type TData = {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
interface INodeEventsDecl {
|
|
16
|
-
inbox: boolean;
|
|
17
|
-
outbox: boolean;
|
|
18
|
-
anyInbox: boolean;
|
|
19
|
-
dialogClosed: boolean;
|
|
20
|
-
invoicePaid: boolean;
|
|
21
|
-
externalRequest: boolean;
|
|
22
|
-
buttons: boolean;
|
|
23
|
-
customEvents: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface INode {
|
|
26
|
-
id: number;
|
|
27
|
-
title: string;
|
|
28
|
-
typeName: "basic" | "event" | "eventListener" | "condition" | "conditionBranch";
|
|
29
|
-
waitingForEvents?: INodeEventsDecl;
|
|
30
|
-
}
|
|
31
|
-
type TScenarioSessionStatus = "active" | "stopped" | "ended" | "unknownError" | "tunnelDisabled" | "expired" | "userDisabled" | "stepDeleted" | "transitionsLimit" | "parentStopped";
|
|
32
|
-
interface ScenarioSession {
|
|
33
|
-
id: number;
|
|
34
|
-
hash: string;
|
|
35
|
-
statusName: TScenarioSessionStatus;
|
|
36
|
-
ref: string | null;
|
|
37
|
-
variables: TData;
|
|
38
|
-
isTransitioning: boolean;
|
|
39
|
-
currentNode: INode | null;
|
|
40
|
-
}
|
|
41
|
-
export default class WebAppHandler {
|
|
42
|
-
readonly options: HandlerOptions;
|
|
43
|
-
data?: ScenarioSession;
|
|
44
|
-
private currentRequest?;
|
|
45
|
-
constructor(options: HandlerOptions);
|
|
46
|
-
isActive(): boolean;
|
|
47
|
-
init(): Promise<WebAppHandler>;
|
|
48
|
-
refreshData(): Promise<WebAppHandler>;
|
|
49
|
-
request(code: string, params?: TData, async?: boolean): Promise<WebAppHandler>;
|
|
50
|
-
abort(): void;
|
|
51
|
-
isTelegramInitAvailable(): boolean;
|
|
52
|
-
protected initNewSession(): Promise<WebAppHandler>;
|
|
53
|
-
protected makeRequest(method: string, path: string, json?: TData, signal?: AbortSignal): Promise<any>;
|
|
54
|
-
private waitUntilSessionFinishesTransition;
|
|
55
|
-
}
|
|
56
|
-
export {};
|