@milemaker/milemaker-js 2.0.0-alpha.5 → 2.0.0-alpha.8

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.
Files changed (35) hide show
  1. package/dist/actions/marker/createClusterMarkersAction.factory.d.ts +4 -1
  2. package/dist/actions/marker/index.d.ts +4 -1
  3. package/dist/apis/aerisWeather/aerisWeather.api.d.ts +1 -1
  4. package/dist/apis/aerisWeather/aerisWeather.slice.d.ts +0 -7
  5. package/dist/components/WeatherLegend/RainSnowIceLegend/RainSnowIceLegend.types.d.ts +1 -0
  6. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.types.d.ts +1 -0
  7. package/dist/components/WeatherLegend/WeatherLegend.types.d.ts +1 -0
  8. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.types.d.ts +1 -0
  9. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.types.d.ts +1 -0
  10. package/dist/createMap/createMap.d.ts +1 -1
  11. package/dist/index.cjs +260 -260
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.esm-8a133e09.js +1 -0
  14. package/dist/index.esm-8a133e09.js.map +1 -0
  15. package/dist/index.esm-e8122a0a.cjs +1 -0
  16. package/dist/index.esm-e8122a0a.cjs.map +1 -0
  17. package/dist/index.js +29109 -30094
  18. package/dist/index.js.map +1 -0
  19. package/dist/nmaps-gl-69f5266d.js +1 -0
  20. package/dist/nmaps-gl-69f5266d.js.map +1 -0
  21. package/dist/nmaps-gl-6afeae26.cjs +1 -0
  22. package/dist/nmaps-gl-6afeae26.cjs.map +1 -0
  23. package/dist/utils/apis/api.constants.d.ts +6 -0
  24. package/dist/utils/apis/api.types.d.ts +5 -0
  25. package/dist/utils/apis/logEvents.api.d.ts +37 -0
  26. package/dist/utils/apis/sdkEvents.api.d.ts +4 -0
  27. package/dist/utils/constants.d.ts +3 -4
  28. package/dist/utils/helpers/httpHeader.helpers.d.ts +29 -0
  29. package/dist/utils/helpers/prepareAppErrorMailToData.helper.d.ts +2 -2
  30. package/dist/utils/helpers/sourcemap.helpers.d.ts +14 -0
  31. package/dist/utils/types.d.ts +0 -7
  32. package/dist/utils/version.d.ts +1 -1
  33. package/package.json +3 -1
  34. package/dist/helpers/sdkEvents.helpers.d.ts +0 -4
  35. package/dist/utils/helpers/prepareContactSupportMandatoryFields.helper.d.ts +0 -4
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Use this value to omit header which was set in bse query.
3
+ * It may be useful to fetch 3-d party API or when we need to specify some custom headers for a specific request for our API.
4
+ */
5
+ export declare const OMIT_HEADER_VALUE = "omit";
6
+ export declare const LICENSED_MODULE = "map_sdk";
@@ -0,0 +1,5 @@
1
+ export declare enum ApiParams {
2
+ TYPE = "type",
3
+ API_KEY = "apiKey",
4
+ LICENSED_MODULE = "licensedModule"
5
+ }
@@ -0,0 +1,37 @@
1
+ interface LogEvent {
2
+ data: Record<string, unknown>;
3
+ component: LogEventComponent;
4
+ datetime: string;
5
+ }
6
+ type LogEventDataProp = Record<string, unknown>;
7
+ declare enum LogEventComponent {
8
+ MAP_SDK = "map_sdk"
9
+ }
10
+ export declare enum LogEventScope {
11
+ API = "api",
12
+ REACT = "react",
13
+ WINDOW_ERROR = "windowError",
14
+ WINDOW_UNHANDLED_REJECTION = "windowUnhandledRejection",
15
+ NDRIVE = "ndrive",
16
+ BILLING = "billing",
17
+ WEATHER = "weather"
18
+ }
19
+ export declare const prepareLogEvent: ({ event, scope, destination, apiKey }: {
20
+ event: LogEventDataProp;
21
+ scope: LogEventScope;
22
+ destination: "api" | "email";
23
+ apiKey: string;
24
+ }) => Promise<LogEvent>;
25
+ export declare const handleLogEvents: ({ events: propEvents, scope, apiKey, baseApiUrl }: {
26
+ events: Record<string, unknown>[];
27
+ scope: LogEventScope;
28
+ apiKey: string;
29
+ baseApiUrl: string;
30
+ }) => Promise<void>;
31
+ export declare const handleLogErrorEvents: ({ errors: propErrors, scope, apiKey, baseApiUrl }: {
32
+ errors: Error[];
33
+ scope: LogEventScope;
34
+ apiKey: string;
35
+ baseApiUrl: string;
36
+ }) => Promise<void>;
37
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const triggerMapSdkInitEvent: ({ apiKey, baseApiUrl }: {
2
+ apiKey: string;
3
+ baseApiUrl: string;
4
+ }) => Promise<void>;
@@ -3,11 +3,10 @@ export declare const PROXY_ENVS: Record<string, Env>;
3
3
  export declare const MILE_MAKER_API_ENVS: Record<Env, string>;
4
4
  export declare const MILE_MAKER_APP_ENVS: Record<Env, string>;
5
5
  export declare enum HttpHeader {
6
- X_CLIENT = "x-client"
6
+ X_CLIENT = "x-client",
7
+ AUTHORIZATION = "authorization"
7
8
  }
8
9
  export declare enum XClient {
9
- WEB_APP = "web_app",
10
- EXCEL_ADD_IN = "excel_add_in",
11
10
  MAP_SDK = "map_sdk"
12
11
  }
13
12
  export declare const MILE_MAKER_PAGE_PATH: {
@@ -47,7 +46,7 @@ export declare const MEASURE_UNITS_LABELS: {
47
46
  };
48
47
  };
49
48
  export declare const EMAIL_SUBJECT_LENGTH_LIMITATION = 255;
50
- export declare const EMAIL_BODY_LENGTH_LIMITATION = 2000;
49
+ export declare const EMAIL_BODY_LENGTH_LIMITATION = 1100;
51
50
  export declare const IndexedDB: IDBFactory;
52
51
  /**
53
52
  * This is a MAIN_LENGTH_UNIT constant that contains the distance unit supported by the backend when making requests
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This helper is used to receive the boolean value based on condition, to understand header type is "omit".
3
+ * @param {Headers} headers - Request headers
4
+ * @param {string} name - Header name
5
+ */
6
+ export declare const getIsOmitHeader: ({ headers, name }: {
7
+ headers: Headers;
8
+ name: string;
9
+ }) => boolean;
10
+ /**
11
+ * This helper is used to add new headers for request.
12
+ * @param {Headers} headers - Request headers
13
+ * @param {string} name - Header name
14
+ * @param {string} value - Header value
15
+ */
16
+ export declare const handleHeader: ({ headers, name, value }: {
17
+ headers: Headers;
18
+ name: string;
19
+ value: string;
20
+ }) => void;
21
+ /**
22
+ * This helper is used to add Authorization header for request.
23
+ * @param {Headers} headers - Request headers
24
+ * @param {string} apiKey - Map SDK key
25
+ */
26
+ export declare const handleAuthorizationHeader: ({ headers, apiKey }: {
27
+ headers: Headers;
28
+ apiKey: string;
29
+ }) => void;
@@ -1,7 +1,7 @@
1
1
  export declare const prepareAppErrorMailToData: ({ appError, accessToken }: {
2
2
  appError: Error;
3
3
  accessToken: string;
4
- }) => {
4
+ }) => Promise<{
5
5
  subject: string;
6
6
  body: string;
7
- };
7
+ }>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Reduces a full error stack to show only relevant application code frames.
3
+ * In production, it first applies source map transformations, then filters out framework/library noise.
4
+ * In development, it just filters the stack.
5
+ *
6
+ * @param stack - Full error stack trace string
7
+ * @param maxFrames - Maximum number of relevant frames to return (default: 1)
8
+ * @returns Reduced stack trace string with only application code
9
+ */
10
+ export declare function getReducedErrorStack(stack: string | undefined, maxFrames?: number): Promise<string | undefined>;
11
+ /**
12
+ * This helper will either adapt the error track to the original code if possible or return the built chunk track.
13
+ */
14
+ export declare function getAdaptedErrorStack(stack: string): Promise<string>;
@@ -5,13 +5,6 @@ export declare enum Env {
5
5
  }
6
6
  export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
7
7
  export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
8
- export declare enum ContactSupportMandatoryField {
9
- MAP_SDK_KEY = "mapSdkKey",
10
- BROWSER_INFO = "browserInfo",
11
- TIMESTAMP = "timestamp",
12
- APP_VERSION = "appVersion",
13
- SCOPE = "scope"
14
- }
15
8
  export declare enum Mail {
16
9
  SUPPORT = "support@milemaker.com",
17
10
  SALES = "mmsales@milemaker.com"
@@ -1 +1 @@
1
- export declare const APP_VERSION = "2.0.0-alpha.5";
1
+ export declare const APP_VERSION = "2.0.0-alpha.6";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@milemaker/milemaker-js",
3
3
  "private": false,
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.8",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",
7
7
  "files": [
@@ -32,6 +32,8 @@
32
32
  "easy-web-worker": "^7.0.5",
33
33
  "gmp-wasm": "^1.3.2",
34
34
  "lodash": "^4.17.21",
35
+ "serialize-error": "^12.0.0",
36
+ "source-map-js": "^1.2.1",
35
37
  "uuid": "^9.0.0",
36
38
  "zod": "^4.2.1"
37
39
  },
@@ -1,4 +0,0 @@
1
- export declare const triggerMapSdkInitEvent: ({ apiKey, proxyEnv }: {
2
- apiKey: string;
3
- proxyEnv: string;
4
- }) => Promise<void>;
@@ -1,4 +0,0 @@
1
- import { ContactSupportMandatoryField } from "../types";
2
- export declare const prepareContactSupportMandatoryFields: ({ accessToken }: {
3
- accessToken: string;
4
- }) => Record<ContactSupportMandatoryField, unknown>;