craft-native 0.0.392 → 0.0.393

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/dist/cli.js CHANGED
@@ -3047,7 +3047,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3047
3047
  `);
3048
3048
  }
3049
3049
  // package.json
3050
- var version = "0.0.392";
3050
+ var version = "0.0.393";
3051
3051
 
3052
3052
  // bin/cli.ts
3053
3053
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -375,7 +375,7 @@ function craftBinaryNotFoundMessage(triedPath) {
375
375
  `);
376
376
  }
377
377
  // package.json
378
- var version = "0.0.392";
378
+ var version = "0.0.393";
379
379
 
380
380
  // src/sdk-version.ts
381
381
  var SDK_VERSION = version;
@@ -10783,6 +10783,15 @@ ${stdout}`;
10783
10783
  detail: `Expected Team ID ${policy.teamId}, bundle is signed by ${identity.teamId ?? "nobody"}`
10784
10784
  };
10785
10785
  }
10786
+ if (policy.bundleIdentifier && identity.identifier !== policy.bundleIdentifier) {
10787
+ return {
10788
+ ok: false,
10789
+ identity,
10790
+ gatekeeperSource,
10791
+ reason: "identifier-mismatch",
10792
+ detail: `Expected bundle identifier ${policy.bundleIdentifier}, received ${identity.identifier ?? "none"}`
10793
+ };
10794
+ }
10786
10795
  return { ok: true, identity, gatekeeperSource };
10787
10796
  }
10788
10797
  async function clearQuarantine(appPath) {
@@ -10998,7 +11007,8 @@ class AutoUpdater extends import_events3.EventEmitter {
10998
11007
  if (!response.ok) {
10999
11008
  throw new Error(`HTTP ${response.status}`);
11000
11009
  }
11001
- const updateInfo = await response.json();
11010
+ const input = await response.json();
11011
+ const updateInfo = this.config.parseManifest ? this.config.parseManifest(input) : input;
11002
11012
  this.cachedEtag = response.headers.get("etag") || null;
11003
11013
  this.cachedLastModified = response.headers.get("last-modified") || null;
11004
11014
  this.cachedManifest = updateInfo;
package/dist/index.js CHANGED
@@ -117,7 +117,7 @@ function craftBinaryNotFoundMessage(triedPath) {
117
117
  `);
118
118
  }
119
119
  // package.json
120
- var version = "0.0.392";
120
+ var version = "0.0.393";
121
121
 
122
122
  // src/sdk-version.ts
123
123
  var SDK_VERSION = version;
@@ -10539,6 +10539,15 @@ ${stdout}`;
10539
10539
  detail: `Expected Team ID ${policy.teamId}, bundle is signed by ${identity.teamId ?? "nobody"}`
10540
10540
  };
10541
10541
  }
10542
+ if (policy.bundleIdentifier && identity.identifier !== policy.bundleIdentifier) {
10543
+ return {
10544
+ ok: false,
10545
+ identity,
10546
+ gatekeeperSource,
10547
+ reason: "identifier-mismatch",
10548
+ detail: `Expected bundle identifier ${policy.bundleIdentifier}, received ${identity.identifier ?? "none"}`
10549
+ };
10550
+ }
10542
10551
  return { ok: true, identity, gatekeeperSource };
10543
10552
  }
10544
10553
  async function clearQuarantine(appPath) {
@@ -10754,7 +10763,8 @@ class AutoUpdater extends EventEmitter3 {
10754
10763
  if (!response.ok) {
10755
10764
  throw new Error(`HTTP ${response.status}`);
10756
10765
  }
10757
- const updateInfo = await response.json();
10766
+ const input = await response.json();
10767
+ const updateInfo = this.config.parseManifest ? this.config.parseManifest(input) : input;
10758
10768
  this.cachedEtag = response.headers.get("etag") || null;
10759
10769
  this.cachedLastModified = response.headers.get("last-modified") || null;
10760
10770
  this.cachedManifest = updateInfo;
@@ -33,6 +33,8 @@ export interface UpdaterConfig {
33
33
  * The constructor will throw on a plain `http://` URL.
34
34
  */
35
35
  updateUrl: string;
36
+ /** Normalize an alternate release feed before version checks and caching. */
37
+ parseManifest?: (input: unknown) => UpdateInfo;
36
38
  currentVersion: string;
37
39
  appPath: string;
38
40
  autoDownload?: boolean;
@@ -32,6 +32,8 @@ export interface BundleIdentity {
32
32
  authority: string | null;
33
33
  }
34
34
  export interface BundleTrustPolicy {
35
+ /** Require the same application, in addition to the signing team. */
36
+ bundleIdentifier?: string;
35
37
  /**
36
38
  * Team ID the bundle must be signed by.
37
39
  *
@@ -49,7 +51,7 @@ export interface BundleTrustPolicy {
49
51
  */
50
52
  requireNotarized?: boolean;
51
53
  }
52
- export type BundleTrustFailure = 'unreadable' | 'codesign-invalid' | 'gatekeeper-rejected' | 'team-mismatch';
54
+ export type BundleTrustFailure = 'unreadable' | 'codesign-invalid' | 'gatekeeper-rejected' | 'team-mismatch' | 'identifier-mismatch';
53
55
  export interface BundleTrustResult {
54
56
  ok: boolean;
55
57
  identity: BundleIdentity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.392",
3
+ "version": "0.0.393",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",