@akanjs/next 0.0.4 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/next",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { useCsrValues } from "./useCsrValues";
15
15
  export { createRobotPage } from "./createRobotPage";
16
16
  export { createSitemapPage } from "./createSitemapPage";
17
17
  export { createNextMiddleware } from "./createNextMiddleware";
18
+ export { useFirebaseMessaging, type UseFirebaseMessagingProps, type FirebaseMessagingOptions, } from "./useFirebaseMessaging";
18
19
  export { useThrottle } from "./useThrottle";
19
20
  export { useHistory } from "./useHistory";
20
21
  export { useLocation } from "./useLocation";
package/src/index.js CHANGED
@@ -29,6 +29,7 @@ __export(src_exports, {
29
29
  useCsrValues: () => import_useCsrValues.useCsrValues,
30
30
  useDebounce: () => import_useDebounce.useDebounce,
31
31
  useFetch: () => import_useFetch.useFetch,
32
+ useFirebaseMessaging: () => import_useFirebaseMessaging.useFirebaseMessaging,
32
33
  useGeoLocation: () => import_useGeoLocation.useGeoLocation,
33
34
  useHistory: () => import_useHistory.useHistory,
34
35
  useInterval: () => import_useInterval.useInterval,
@@ -54,6 +55,7 @@ var import_useCsrValues = require("./useCsrValues");
54
55
  var import_createRobotPage = require("./createRobotPage");
55
56
  var import_createSitemapPage = require("./createSitemapPage");
56
57
  var import_createNextMiddleware = require("./createNextMiddleware");
58
+ var import_useFirebaseMessaging = require("./useFirebaseMessaging");
57
59
  var import_useThrottle = require("./useThrottle");
58
60
  var import_useHistory = require("./useHistory");
59
61
  var import_useLocation = require("./useLocation");
@@ -72,6 +74,7 @@ var import_useLocation = require("./useLocation");
72
74
  useCsrValues,
73
75
  useDebounce,
74
76
  useFetch,
77
+ useFirebaseMessaging,
75
78
  useGeoLocation,
76
79
  useHistory,
77
80
  useInterval,
@@ -0,0 +1,18 @@
1
+ export interface UseFirebaseMessagingProps {
2
+ options: FirebaseMessagingOptions;
3
+ serverHttpUri: string;
4
+ }
5
+ export interface FirebaseMessagingOptions {
6
+ apiKey: string;
7
+ authDomain: string;
8
+ projectId: string;
9
+ storageBucket: string;
10
+ messagingSenderId: string;
11
+ appId: string;
12
+ measurementId: string;
13
+ vapidKey: string;
14
+ }
15
+ export declare const useFirebaseMessaging: ({ options, serverHttpUri }: UseFirebaseMessagingProps) => {
16
+ getToken: () => Promise<string>;
17
+ initialized: boolean;
18
+ };
@@ -1,2 +0,0 @@
1
- import { CapacitorConfig } from "@capacitor/cli";
2
- export declare const withBase: (applyConfig: (config: CapacitorConfig) => CapacitorConfig) => CapacitorConfig;
@@ -1,72 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var capacitor_base_config_exports = {};
29
- __export(capacitor_base_config_exports, {
30
- withBase: () => withBase
31
- });
32
- module.exports = __toCommonJS(capacitor_base_config_exports);
33
- var import_os = __toESM(require("os"));
34
- const getLocalIP = () => {
35
- const interfaces = import_os.default.networkInterfaces();
36
- for (const interfaceName in interfaces) {
37
- const iface = interfaces[interfaceName];
38
- if (!iface)
39
- continue;
40
- for (const alias of iface) {
41
- if (alias.family === "IPv4" && !alias.internal)
42
- return alias.address;
43
- }
44
- }
45
- return "127.0.0.1";
46
- };
47
- const withBase = (applyConfig) => {
48
- const projectName = process.env.NX_TASK_TARGET_PROJECT;
49
- if (!projectName)
50
- throw new Error("projectName is not defined, please run with nx command");
51
- const ip = getLocalIP();
52
- const baseConfig = {
53
- appId: `com.${projectName}.app`,
54
- appName: projectName,
55
- webDir: `../../dist/apps/${projectName}/csr/`,
56
- bundledWebRuntime: false,
57
- server: process.env.APP_OPERATION_MODE !== "release" ? {
58
- androidScheme: "http",
59
- url: `http://${ip}:4201`,
60
- cleartext: true,
61
- allowNavigation: [`http://${ip}:8080/*`]
62
- } : void 0,
63
- plugins: {
64
- CapacitorCookies: { enabled: true }
65
- }
66
- };
67
- return applyConfig(baseConfig);
68
- };
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- withBase
72
- });