@codeimplants/version-control 1.0.6 → 1.0.7
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/README.md +1 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +6 -13
- package/package.json +1 -1
- package/src/sdk.ts +6 -10
package/README.md
CHANGED
|
@@ -105,8 +105,7 @@ Checks in order:
|
|
|
105
105
|
Checks in order:
|
|
106
106
|
|
|
107
107
|
1. Capacitor App plugin bundle ID
|
|
108
|
-
2.
|
|
109
|
-
3. Fallback: `"unknown.app"`
|
|
108
|
+
2. Fallback: `"unknown.app"`
|
|
110
109
|
|
|
111
110
|
## Configuration
|
|
112
111
|
|
package/dist/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK/C,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAY;IAE1B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;WAc1D,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAI9F,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK/C,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAY;IAE1B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;WAc1D,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAI9F,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC;CAkE5C"}
|
package/dist/sdk.js
CHANGED
|
@@ -23,19 +23,13 @@ export class VersionSDK {
|
|
|
23
23
|
// Auto-detect only if NOT provided, but allow them to remain undefined if detection fails or is not desired.
|
|
24
24
|
// The backend should handle cases where appId or version are missing (e.g. web or simple API key check).
|
|
25
25
|
if (!this.config.platform) {
|
|
26
|
-
|
|
27
|
-
if (detected !== 'web')
|
|
28
|
-
this.config.platform = detected;
|
|
26
|
+
this.config.platform = await detectPlatform();
|
|
29
27
|
}
|
|
30
28
|
if (!this.config.version) {
|
|
31
|
-
|
|
32
|
-
if (detected !== '1.0.0')
|
|
33
|
-
this.config.version = detected;
|
|
29
|
+
this.config.version = await detectVersion();
|
|
34
30
|
}
|
|
35
31
|
if (!this.config.appId) {
|
|
36
|
-
|
|
37
|
-
if (detected !== 'unknown.app')
|
|
38
|
-
this.config.appId = detected;
|
|
32
|
+
this.config.appId = await detectAppId();
|
|
39
33
|
}
|
|
40
34
|
if (this.config.debug) {
|
|
41
35
|
console.log("[VC-SDK] Checking version for:", {
|
|
@@ -44,10 +38,9 @@ export class VersionSDK {
|
|
|
44
38
|
version: this.config.version,
|
|
45
39
|
url: `${this.config.backendUrl}/sdk/version/check`
|
|
46
40
|
});
|
|
47
|
-
if (this.config.
|
|
48
|
-
console.warn("[VC-SDK] ⚠️ WARNING:
|
|
49
|
-
console.warn("[VC-SDK]
|
|
50
|
-
console.warn("[VC-SDK] Example: VersionSDK.init({ ..., platform: Platform.OS, appId: 'com.yourapp' })");
|
|
41
|
+
if (!this.config.platform || !this.config.version) {
|
|
42
|
+
console.warn("[VC-SDK] ⚠️ WARNING: Platform or Version not detected. Rules might not apply correctly.");
|
|
43
|
+
console.warn("[VC-SDK] Please ensure these are either auto-detectable or provided explicitly.");
|
|
51
44
|
}
|
|
52
45
|
}
|
|
53
46
|
const response = await fetchRules(this.config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeimplants/version-control",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A lightweight cross-platform SDK to remotely control app version behavior such as soft update, force update, and maintenance mode using backend-driven rules, without enforcing UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"version-control",
|
package/src/sdk.ts
CHANGED
|
@@ -29,16 +29,13 @@ export class VersionSDK {
|
|
|
29
29
|
// Auto-detect only if NOT provided, but allow them to remain undefined if detection fails or is not desired.
|
|
30
30
|
// The backend should handle cases where appId or version are missing (e.g. web or simple API key check).
|
|
31
31
|
if (!this.config.platform) {
|
|
32
|
-
|
|
33
|
-
if (detected !== 'web') this.config.platform = detected;
|
|
32
|
+
this.config.platform = await detectPlatform();
|
|
34
33
|
}
|
|
35
34
|
if (!this.config.version) {
|
|
36
|
-
|
|
37
|
-
if (detected !== '1.0.0') this.config.version = detected;
|
|
35
|
+
this.config.version = await detectVersion();
|
|
38
36
|
}
|
|
39
37
|
if (!this.config.appId) {
|
|
40
|
-
|
|
41
|
-
if (detected !== 'unknown.app') this.config.appId = detected;
|
|
38
|
+
this.config.appId = await detectAppId();
|
|
42
39
|
}
|
|
43
40
|
if (this.config.debug) {
|
|
44
41
|
console.log("[VC-SDK] Checking version for:", {
|
|
@@ -48,10 +45,9 @@ export class VersionSDK {
|
|
|
48
45
|
url: `${this.config.backendUrl}/sdk/version/check`
|
|
49
46
|
});
|
|
50
47
|
|
|
51
|
-
if (this.config.
|
|
52
|
-
console.warn("[VC-SDK] ⚠️ WARNING:
|
|
53
|
-
console.warn("[VC-SDK]
|
|
54
|
-
console.warn("[VC-SDK] Example: VersionSDK.init({ ..., platform: Platform.OS, appId: 'com.yourapp' })");
|
|
48
|
+
if (!this.config.platform || !this.config.version) {
|
|
49
|
+
console.warn("[VC-SDK] ⚠️ WARNING: Platform or Version not detected. Rules might not apply correctly.");
|
|
50
|
+
console.warn("[VC-SDK] Please ensure these are either auto-detectable or provided explicitly.");
|
|
55
51
|
}
|
|
56
52
|
}
|
|
57
53
|
|