@namiml/web-sdk 1.7.3 → 1.7.4
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/CHANGELOG.md +9 -0
- package/README.md +23 -0
- package/dist/components/ContextProvider.d.ts +2 -1
- package/dist/components/NamiElement.d.ts +9 -3
- package/dist/components/containers/Container.d.ts +5 -0
- package/dist/components/utils/styles.d.ts +2 -0
- package/dist/legacy-support.cjs +27667 -0
- package/dist/legacy-support.d.ts +2 -0
- package/dist/legacy-support.mjs +27665 -0
- package/dist/nami/namiRefs.d.ts +5 -0
- package/dist/nami-web.cjs +62 -59
- package/dist/nami-web.d.ts +2 -0
- package/dist/nami-web.mjs +62 -59
- package/dist/nami-web.umd.js +25 -22
- package/dist/polyfills.cjs +26907 -0
- package/dist/polyfills.d.ts +6 -0
- package/dist/polyfills.js +26905 -0
- package/dist/repositories/device.repository.d.ts +3 -2
- package/dist/types/device.d.ts +1 -1
- package/dist/utils/anonymousMode.d.ts +19 -0
- package/dist/utils/simple-event-target.d.ts +7 -0
- package/package.json +33 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Device, DevicePayload } from "../types/device";
|
|
2
|
+
import { INamiRefsInstance } from "../utils/anonymousMode";
|
|
2
3
|
export declare class DeviceRepository {
|
|
3
4
|
static instance: DeviceRepository;
|
|
4
|
-
createOrUpdateDevice(deviceData: DevicePayload, splitPositionUUID?: string): {
|
|
5
|
+
createOrUpdateDevice(deviceData: DevicePayload, splitPositionUUID?: string, namiRefs?: INamiRefsInstance): {
|
|
5
6
|
id: string;
|
|
6
7
|
device: Promise<Device | null>;
|
|
7
8
|
};
|
|
8
|
-
createDevice(deviceData: DevicePayload): Promise<Device | null>;
|
|
9
|
+
createDevice(deviceData: DevicePayload, namiRefs?: INamiRefsInstance): Promise<Device | null>;
|
|
9
10
|
updateDevice(currentDeviceId: string, deviceData: DevicePayload): Promise<Device | null>;
|
|
10
11
|
updateDeviceField<T>(key: string, value: T): Promise<Device | null>;
|
|
11
12
|
private requestAPIData;
|
package/dist/types/device.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for NamiRefs instance to maintain type safety
|
|
3
|
+
* Only includes methods needed by utilities that depend on NamiRefs
|
|
4
|
+
*/
|
|
5
|
+
export interface INamiRefsInstance {
|
|
6
|
+
isInMemoryAnonymousMode(): boolean;
|
|
7
|
+
setInMemoryAnonymousMode(enabled: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Set the NamiRefs instance to avoid circular dependency issues
|
|
11
|
+
* Called from namiRefs.ts during initialization
|
|
12
|
+
*/
|
|
13
|
+
export declare function setNamiRefsInstance(instance: INamiRefsInstance): void;
|
|
14
|
+
/**
|
|
15
|
+
* Utility function to check anonymous mode status
|
|
16
|
+
* Checks both persistent (storage) and in-memory flags
|
|
17
|
+
* @returns true if device is in anonymous mode (either persistent or temporary)
|
|
18
|
+
*/
|
|
19
|
+
export declare function isAnonymousMode(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class SimpleEventTarget implements EventTarget {
|
|
2
|
+
private listeners;
|
|
3
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
|
4
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null): void;
|
|
5
|
+
dispatchEvent(event: Event): boolean;
|
|
6
|
+
}
|
|
7
|
+
export default SimpleEventTarget;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/web-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.4",
|
|
5
5
|
"source": "src/nami-web.ts",
|
|
6
6
|
"description": "Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clear-test-cache": "jest --clearCache",
|
|
9
9
|
"test": "yarn clear-test-cache && TZ=UTC jest --coverage -i --forceExit",
|
|
10
10
|
"build-sdk": "rm -rf dist && rollup -c",
|
|
11
|
-
"watch": "microbundle --tsconfig tsconfig.dev.json --output ./dist/nami-web.mjs --watch --no-compress --format modern --define NAMI_SDK_ENV='development'",
|
|
11
|
+
"watch": "microbundle --tsconfig tsconfig.dev.json --output ./dist/nami-web.mjs --watch --no-compress --format modern --define NAMI_SDK_ENV='development' src/nami-web.ts",
|
|
12
12
|
"dev": "NAMI_SDK_ENV=development rollup -c -w",
|
|
13
13
|
"build": "NAMI_SDK_ENV=production rollup -c",
|
|
14
14
|
"build:dev": "NAMI_SDK_ENV=development rollup -c",
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
"require": "./dist/nami-web.cjs",
|
|
34
34
|
"umd": "./dist/nami-web.umd.js",
|
|
35
35
|
"default": "./dist/nami-web.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./legacy-support": {
|
|
38
|
+
"types": "./dist/legacy-support.d.ts",
|
|
39
|
+
"import": "./dist/legacy-support.mjs",
|
|
40
|
+
"require": "./dist/legacy-support.cjs",
|
|
41
|
+
"default": "./dist/legacy-support.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./polyfills": {
|
|
44
|
+
"import": "./dist/polyfills.js",
|
|
45
|
+
"require": "./dist/polyfills.cjs"
|
|
36
46
|
}
|
|
37
47
|
},
|
|
38
48
|
"files": [
|
|
@@ -59,19 +69,32 @@
|
|
|
59
69
|
},
|
|
60
70
|
"license": "SEE LICENSE FILE",
|
|
61
71
|
"devDependencies": {
|
|
72
|
+
"@babel/core": "^7.28.3",
|
|
73
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
74
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
75
|
+
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
76
|
+
"@babel/preset-env": "^7.28.3",
|
|
77
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
62
78
|
"@eslint/js": "^9.2.0",
|
|
63
79
|
"@open-wc/testing": "^4.0.0",
|
|
80
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
64
81
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
65
82
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
66
83
|
"@rollup/plugin-replace": "^5.0.5",
|
|
67
84
|
"@rollup/plugin-terser": "^0.4.4",
|
|
68
85
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
86
|
+
"@types/babel__core": "^7",
|
|
87
|
+
"@types/babel__preset-env": "^7",
|
|
69
88
|
"@types/jest": "^29.5.12",
|
|
70
89
|
"@types/lodash-es": "^4.17.4",
|
|
71
90
|
"@types/node": "^22.2.0",
|
|
72
91
|
"@types/pako": "^2",
|
|
73
92
|
"@types/qrcode": "^1",
|
|
93
|
+
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
94
|
+
"abort-controller": "^3.0.0",
|
|
95
|
+
"babel-jest": "^29.7.0",
|
|
74
96
|
"buffer": "^6.0.3",
|
|
97
|
+
"core-js": "^3.45.1",
|
|
75
98
|
"eslint": "^9.2.0",
|
|
76
99
|
"jest": "^29.7.0",
|
|
77
100
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -85,12 +108,15 @@
|
|
|
85
108
|
"tslib": "^2.6.3",
|
|
86
109
|
"typescript": "^5.4.5",
|
|
87
110
|
"typescript-eslint": "^8.0.1",
|
|
111
|
+
"url-polyfill": "^1.1.13",
|
|
112
|
+
"whatwg-fetch": "^3.6.20",
|
|
88
113
|
"wrangler": "^3.66.0"
|
|
89
114
|
},
|
|
90
115
|
"dependencies": {
|
|
91
116
|
"@lit-labs/ssr-dom-shim": "^1.4.0",
|
|
92
117
|
"@lit/context": "^1.1.6",
|
|
93
118
|
"bowser": "^2.11.0",
|
|
119
|
+
"date-fns": "^4.1.0",
|
|
94
120
|
"date-fns-tz": "^3.2.0",
|
|
95
121
|
"hls.js": "^1.5.15",
|
|
96
122
|
"lit": "^3.3.1",
|
|
@@ -108,6 +134,11 @@
|
|
|
108
134
|
"type": "git",
|
|
109
135
|
"url": "https://github.com/namiml/nami-web-sdk.git"
|
|
110
136
|
},
|
|
137
|
+
"sideEffects": [
|
|
138
|
+
"dist/polyfills.js",
|
|
139
|
+
"dist/legacy-support.mjs",
|
|
140
|
+
"dist/legacy-support.cjs"
|
|
141
|
+
],
|
|
111
142
|
"resolutions": {
|
|
112
143
|
"@esm-bundle/chai": "4.3.4-fix.0"
|
|
113
144
|
},
|