@tiendanube/nexo 0.0.0 → 0.1.2
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 -3
- package/actions/actions.js +4 -2
- package/helpers/helpers.d.ts +5 -3
- package/helpers/helpers.js +20 -6
- package/package.json +1 -1
package/actions/actions.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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 NavigatePathnameReponse = {
|
|
11
11
|
pathname: string | null;
|
|
12
12
|
};
|
|
13
13
|
export declare const ACTION_NAVIGATE_SYNC = "app/navigate/sync";
|
|
@@ -31,3 +31,14 @@ export declare type CopyToClipboardRequest = {
|
|
|
31
31
|
export declare type CopyToClipboardReponse = {
|
|
32
32
|
success: boolean;
|
|
33
33
|
};
|
|
34
|
+
export declare const ACTION_NAVIGATE_GOTO_OLD_ADMIN = "app/navigate/goToOldAdmin";
|
|
35
|
+
export declare type NavigateGoToOldAdminRequest = {
|
|
36
|
+
pathToOldAdmin: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const ACTION_NAVIGATE_HEADER = "app/navigate/header";
|
|
39
|
+
export declare type NavigateHeaderRequest = {
|
|
40
|
+
goTo?: "back" | string;
|
|
41
|
+
goToAdmin?: string;
|
|
42
|
+
text?: string;
|
|
43
|
+
remove?: boolean;
|
|
44
|
+
};
|
package/actions/actions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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";
|
|
@@ -11,3 +11,5 @@ exports.ACTION_NAVIGATE_SYNC = "app/navigate/sync";
|
|
|
11
11
|
exports.ACTION_AUTH_SESSION_TOKEN = "app/auth/sessionToken";
|
|
12
12
|
exports.ACTION_STORE_INFO = "app/store/info";
|
|
13
13
|
exports.ACTION_UTILS_COPY_TO_CLIPBOARD = "app/utils/copyToClipboard";
|
|
14
|
+
exports.ACTION_NAVIGATE_GOTO_OLD_ADMIN = "app/navigate/goToOldAdmin";
|
|
15
|
+
exports.ACTION_NAVIGATE_HEADER = "app/navigate/header";
|
package/helpers/helpers.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { StoreInfoReponse } from "../actions/actions";
|
|
1
|
+
import { StoreInfoReponse, 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
10
|
export declare const getStoreInfo: (nexo: NexoClient) => Promise<StoreInfoReponse>;
|
|
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: 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.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) {
|
|
@@ -117,3 +117,17 @@ var copyToClipboard = function (nexo, text) { return __awaiter(void 0, void 0, v
|
|
|
117
117
|
});
|
|
118
118
|
}); };
|
|
119
119
|
exports.copyToClipboard = copyToClipboard;
|
|
120
|
+
var navigateHeader = function (nexo, config) {
|
|
121
|
+
nexo.dispatch({
|
|
122
|
+
type: actions_1.ACTION_NAVIGATE_HEADER,
|
|
123
|
+
payload: config,
|
|
124
|
+
});
|
|
125
|
+
};
|
|
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;
|