@tiendanube/nexo 0.1.0 → 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/actions/actions.d.ts +14 -9
- package/actions/actions.js +2 -2
- package/helpers/helpers.d.ts +6 -5
- package/helpers/helpers.js +13 -6
- package/package.json +1 -1
package/actions/actions.d.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
export declare const ACTION_READY = "app/ready";
|
|
2
2
|
export declare const ACTION_CONNECTED = "app/connected";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const ACTION_NAVIGATE_EXIT = "app/navigate/exit";
|
|
4
4
|
export declare const ACTION_NAVIGATE_BACK = "app/navigate/back";
|
|
5
5
|
export declare const ACTION_NAVIGATE_GOTO = "app/navigate/goTo";
|
|
6
|
-
export declare type
|
|
6
|
+
export declare type NavigateGoToRequest = {
|
|
7
7
|
pathname: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const ACTION_NAVIGATE_PATHNAME = "app/navigate/pathname";
|
|
10
|
-
export declare type
|
|
10
|
+
export declare type NavigatePathnameResponse = {
|
|
11
11
|
pathname: string | null;
|
|
12
12
|
};
|
|
13
13
|
export declare const ACTION_NAVIGATE_SYNC = "app/navigate/sync";
|
|
14
|
+
export declare type NavigateSyncResponse = {
|
|
15
|
+
path: string;
|
|
16
|
+
replace?: boolean;
|
|
17
|
+
};
|
|
14
18
|
export declare const ACTION_AUTH_SESSION_TOKEN = "app/auth/sessionToken";
|
|
15
|
-
export declare type
|
|
19
|
+
export declare type AuthSessionTokenResponse = {
|
|
16
20
|
token: string;
|
|
17
21
|
};
|
|
18
22
|
export declare const ACTION_STORE_INFO = "app/store/info";
|
|
19
|
-
export declare type
|
|
23
|
+
export declare type StoreInfoResponse = {
|
|
20
24
|
id: string;
|
|
21
25
|
name: string;
|
|
22
26
|
url: string;
|
|
@@ -28,16 +32,17 @@ export declare const ACTION_UTILS_COPY_TO_CLIPBOARD = "app/utils/copyToClipboard
|
|
|
28
32
|
export declare type CopyToClipboardRequest = {
|
|
29
33
|
text: string;
|
|
30
34
|
};
|
|
31
|
-
export declare type
|
|
35
|
+
export declare type CopyToClipboardResponse = {
|
|
32
36
|
success: boolean;
|
|
33
37
|
};
|
|
34
38
|
export declare const ACTION_NAVIGATE_GOTO_OLD_ADMIN = "app/navigate/goToOldAdmin";
|
|
35
|
-
export declare type
|
|
39
|
+
export declare type NavigateGoToOldAdminRequest = {
|
|
36
40
|
pathToOldAdmin: string;
|
|
37
41
|
};
|
|
38
42
|
export declare const ACTION_NAVIGATE_HEADER = "app/navigate/header";
|
|
39
|
-
export declare type
|
|
40
|
-
goTo?: string;
|
|
43
|
+
export declare type NavigateHeaderRequest = {
|
|
44
|
+
goTo?: "back" | string;
|
|
41
45
|
goToAdmin?: string;
|
|
42
46
|
text?: string;
|
|
47
|
+
remove?: boolean;
|
|
43
48
|
};
|
package/actions/actions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACTION_NAVIGATE_HEADER = exports.ACTION_NAVIGATE_GOTO_OLD_ADMIN = exports.ACTION_UTILS_COPY_TO_CLIPBOARD = exports.ACTION_STORE_INFO = exports.ACTION_AUTH_SESSION_TOKEN = exports.ACTION_NAVIGATE_SYNC = exports.ACTION_NAVIGATE_PATHNAME = exports.ACTION_NAVIGATE_GOTO = exports.ACTION_NAVIGATE_BACK = exports.
|
|
3
|
+
exports.ACTION_NAVIGATE_HEADER = exports.ACTION_NAVIGATE_GOTO_OLD_ADMIN = exports.ACTION_UTILS_COPY_TO_CLIPBOARD = exports.ACTION_STORE_INFO = exports.ACTION_AUTH_SESSION_TOKEN = exports.ACTION_NAVIGATE_SYNC = exports.ACTION_NAVIGATE_PATHNAME = exports.ACTION_NAVIGATE_GOTO = exports.ACTION_NAVIGATE_BACK = exports.ACTION_NAVIGATE_EXIT = exports.ACTION_CONNECTED = exports.ACTION_READY = void 0;
|
|
4
4
|
exports.ACTION_READY = "app/ready";
|
|
5
5
|
exports.ACTION_CONNECTED = "app/connected";
|
|
6
|
-
exports.
|
|
6
|
+
exports.ACTION_NAVIGATE_EXIT = "app/navigate/exit";
|
|
7
7
|
exports.ACTION_NAVIGATE_BACK = "app/navigate/back";
|
|
8
8
|
exports.ACTION_NAVIGATE_GOTO = "app/navigate/goTo";
|
|
9
9
|
exports.ACTION_NAVIGATE_PATHNAME = "app/navigate/pathname";
|
package/helpers/helpers.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoreInfoResponse, NavigateHeaderRequest } from "../actions/actions";
|
|
2
2
|
import { NexoClient } from "../core/nexoClient";
|
|
3
3
|
export declare const connect: (nexo: NexoClient, ttl?: number) => Promise<void>;
|
|
4
4
|
export declare const iAmReady: (nexo: NexoClient) => void;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const navigateExit: (nexo: NexoClient) => void;
|
|
6
|
+
export declare const navigateBack: (nexo: NexoClient) => void;
|
|
7
7
|
export declare const getSessionToken: (nexo: NexoClient) => Promise<string>;
|
|
8
8
|
export declare const getCurrentPathname: (nexo: NexoClient) => Promise<string | null>;
|
|
9
9
|
export declare const syncPathname: (nexo: NexoClient, pathname: string) => void;
|
|
10
|
-
export declare const getStoreInfo: (nexo: NexoClient) => Promise<
|
|
10
|
+
export declare const getStoreInfo: (nexo: NexoClient) => Promise<StoreInfoResponse>;
|
|
11
11
|
export declare const goTo: (nexo: NexoClient, pathname: string) => void;
|
|
12
12
|
export declare const copyToClipboard: (nexo: NexoClient, text: string) => Promise<boolean>;
|
|
13
|
-
export declare const navigateHeader: (nexo: NexoClient, config:
|
|
13
|
+
export declare const navigateHeader: (nexo: NexoClient, config: NavigateHeaderRequest) => void;
|
|
14
|
+
export declare const navigateHeaderRemove: (nexo: NexoClient) => void;
|
package/helpers/helpers.js
CHANGED
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.navigateHeader = exports.copyToClipboard = exports.goTo = exports.getStoreInfo = exports.syncPathname = exports.getCurrentPathname = exports.getSessionToken = exports.
|
|
39
|
+
exports.navigateHeaderRemove = exports.navigateHeader = exports.copyToClipboard = exports.goTo = exports.getStoreInfo = exports.syncPathname = exports.getCurrentPathname = exports.getSessionToken = exports.navigateBack = exports.navigateExit = exports.iAmReady = exports.connect = void 0;
|
|
40
40
|
var actions_1 = require("../actions/actions");
|
|
41
41
|
var utils_1 = require("../core/utils");
|
|
42
42
|
var connect = function (nexo, ttl) {
|
|
@@ -56,14 +56,14 @@ var iAmReady = function (nexo) {
|
|
|
56
56
|
nexo.dispatch((0, utils_1.message)(actions_1.ACTION_READY));
|
|
57
57
|
};
|
|
58
58
|
exports.iAmReady = iAmReady;
|
|
59
|
-
var
|
|
60
|
-
nexo.dispatch((0, utils_1.message)(actions_1.
|
|
59
|
+
var navigateExit = function (nexo) {
|
|
60
|
+
nexo.dispatch((0, utils_1.message)(actions_1.ACTION_NAVIGATE_EXIT));
|
|
61
61
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var
|
|
62
|
+
exports.navigateExit = navigateExit;
|
|
63
|
+
var navigateBack = function (nexo) {
|
|
64
64
|
nexo.dispatch((0, utils_1.message)(actions_1.ACTION_NAVIGATE_BACK));
|
|
65
65
|
};
|
|
66
|
-
exports.
|
|
66
|
+
exports.navigateBack = navigateBack;
|
|
67
67
|
var getSessionToken = function (nexo) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
68
|
var token;
|
|
69
69
|
return __generator(this, function (_a) {
|
|
@@ -124,3 +124,10 @@ var navigateHeader = function (nexo, config) {
|
|
|
124
124
|
});
|
|
125
125
|
};
|
|
126
126
|
exports.navigateHeader = navigateHeader;
|
|
127
|
+
var navigateHeaderRemove = function (nexo) {
|
|
128
|
+
nexo.dispatch({
|
|
129
|
+
type: actions_1.ACTION_NAVIGATE_HEADER,
|
|
130
|
+
payload: { remove: true },
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
exports.navigateHeaderRemove = navigateHeaderRemove;
|