@bridgething/catalog 0.15.1 → 0.15.3

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.
@@ -0,0 +1,8 @@
1
+ import type { AppEntry } from './types.ts';
2
+ export declare const CATEGORIES: readonly ["music", "clocks-weather", "dashboards", "home-control", "productivity", "ambient", "games", "travel", "tools"];
3
+ export type Category = (typeof CATEGORIES)[number];
4
+ export declare const MAX_CATEGORIES = 2;
5
+ export declare const CATEGORY_LABELS: Record<Category, string>;
6
+ export declare function isCategory(slug: string): slug is Category;
7
+ export declare function appCategories(app: AppEntry): Category[];
8
+ //# sourceMappingURL=categories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../src/categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,UAAU,2HAUb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAUpD,CAAC;AAIF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,QAAQ,CAEzD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAOvD"}
@@ -0,0 +1,38 @@
1
+ export const CATEGORIES = [
2
+ 'music',
3
+ 'clocks-weather',
4
+ 'dashboards',
5
+ 'home-control',
6
+ 'productivity',
7
+ 'ambient',
8
+ 'games',
9
+ 'travel',
10
+ 'tools',
11
+ ];
12
+ export const MAX_CATEGORIES = 2;
13
+ export const CATEGORY_LABELS = {
14
+ music: 'music',
15
+ 'clocks-weather': 'clocks & weather',
16
+ dashboards: 'dashboards',
17
+ 'home-control': 'home & control',
18
+ productivity: 'productivity',
19
+ ambient: 'ambient',
20
+ games: 'games',
21
+ travel: 'travel',
22
+ tools: 'tools',
23
+ };
24
+ const KNOWN = new Set(CATEGORIES);
25
+ export function isCategory(slug) {
26
+ return KNOWN.has(slug);
27
+ }
28
+ export function appCategories(app) {
29
+ const out = [];
30
+ for (const slug of app.categories ?? []) {
31
+ if (isCategory(slug) && !out.includes(slug))
32
+ out.push(slug);
33
+ if (out.length === MAX_CATEGORIES)
34
+ break;
35
+ }
36
+ return out;
37
+ }
38
+ //# sourceMappingURL=categories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.js","sourceRoot":"","sources":["../src/categories.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO;IACP,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,cAAc;IACd,SAAS;IACT,OAAO;IACP,QAAQ;IACR,OAAO;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,KAAK,EAAE,OAAO;IACd,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,UAAU,CAAC,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAa;IACzC,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;QACxC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,cAAc;YAAE,MAAM;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function changelogText(markdown: string | null | undefined): string | null;
2
+ //# sourceMappingURL=changelog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAsCA,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAUhF"}
@@ -0,0 +1,52 @@
1
+ const LIST_ITEM = /^\s*(?:[-*+]|\d+[.)])\s+/;
2
+ const HEADING = /^\s{0,3}#{1,6}\s+/;
3
+ const RULE = /^\s*(?:[-*_]\s*){3,}$/;
4
+ function inline(text) {
5
+ return text
6
+ .replace(/!\[([^\]]*)\]\([^)]*\)/g, '$1')
7
+ .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1')
8
+ .replace(/<\/?[a-z][^>]*>/gi, '')
9
+ .replace(/`([^`]+)`/g, '$1')
10
+ .replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, '$2')
11
+ .replace(/~~(?=\S)([\s\S]*?\S)~~/g, '$1')
12
+ .replace(/(^|[^\w*])\*(?=\S)([^*]*?\S)\*(?!\w)/g, '$1$2')
13
+ .replace(/(^|[^\w_])_(?=\S)([^_]*?\S)_(?![\w_])/g, '$1$2')
14
+ .replace(/\\([\\`*_{}[\]()#+\-.!~])/g, '$1');
15
+ }
16
+ function block(raw) {
17
+ const lines = [];
18
+ for (const line of raw.split('\n')) {
19
+ if (RULE.test(line))
20
+ continue;
21
+ if (HEADING.test(line)) {
22
+ lines.push(line.replace(HEADING, '').trim());
23
+ continue;
24
+ }
25
+ if (LIST_ITEM.test(line)) {
26
+ const numbered = /^\s*(\d+[.)])/.exec(line);
27
+ lines.push(`${numbered ? numbered[1] : '•'} ${line.replace(LIST_ITEM, '').trim()}`);
28
+ continue;
29
+ }
30
+ const text = line.trim();
31
+ if (!text)
32
+ continue;
33
+ if (lines.length === 0)
34
+ lines.push(text);
35
+ else
36
+ lines[lines.length - 1] += ` ${text}`;
37
+ }
38
+ return lines.map(inline).join('\n');
39
+ }
40
+ export function changelogText(markdown) {
41
+ if (!markdown)
42
+ return null;
43
+ const text = markdown
44
+ .replace(/\r\n?/g, '\n')
45
+ .split(/\n\s*\n/)
46
+ .map(block)
47
+ .filter(Boolean)
48
+ .join('\n\n')
49
+ .trim();
50
+ return text || null;
51
+ }
52
+ //# sourceMappingURL=changelog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog.js","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAC7C,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,IAAI,GAAG,uBAAuB,CAAC;AAErC,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI;SACR,OAAO,CAAC,yBAAyB,EAAE,IAAI,CAAC;SACxC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC;SACvC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC;SAC3B,OAAO,CAAC,gCAAgC,EAAE,IAAI,CAAC;SAC/C,OAAO,CAAC,yBAAyB,EAAE,IAAI,CAAC;SACxC,OAAO,CAAC,uCAAuC,EAAE,MAAM,CAAC;SACxD,OAAO,CAAC,wCAAwC,EAAE,MAAM,CAAC;SACzD,OAAO,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,KAAK,CAAC,GAAW;IACxB,MAAM,KAAK,GAAa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;SACvB,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,KAAK,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,MAAM,CAAC;SACZ,IAAI,EAAE,CAAC;IACV,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC"}
package/dist/copy.d.ts CHANGED
@@ -1,20 +1,16 @@
1
- import type { CatalogAppListing } from './resolve.ts';
1
+ import type { StoreSource } from './store.ts';
2
2
  export declare const STORE_COPY: {
3
- readonly appsTitle: "apps";
4
- readonly appsEmpty: "no apps";
5
- readonly communityTitle: "community";
6
- readonly communityNote: "unreviewed";
7
- readonly communityHint: "from sources you have not added";
8
- readonly communityEmpty: "nothing here";
9
- readonly suggestedTitle: "suggested sources";
10
- readonly suggestedHint: "listed in the bridgething directory";
11
- readonly suggestedEmpty: "none";
3
+ readonly empty: "no apps";
4
+ readonly noMatches: "no matches";
12
5
  readonly needsFirmware: "needs newer firmware";
13
6
  readonly unpublished: "not published yet";
7
+ readonly unreviewed: "not reviewed by bridgething";
8
+ readonly suggestedTitle: "suggested sources";
9
+ readonly suggestedEmpty: "none";
14
10
  };
15
- export declare function countLine(listings: number, sources: number): string;
16
11
  export declare function failureLine(failures: number): string;
17
12
  export declare function installsLabel(installs: number): string | null;
18
13
  export declare function alsoAvailableLabel(alsoAvailableFrom: readonly string[]): string | null;
19
- export declare function listingTraits(listing: CatalogAppListing): string[];
14
+ export declare function permissionLabel(permission: string): string;
15
+ export declare function sourceLine(source: StoreSource | null | undefined): string;
20
16
  //# sourceMappingURL=copy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAO,MAAM,UAAU;;;;;;;;;;;;CAYb,CAAC;AAMX,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAEtF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAQlE"}
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;;;;;CAQb,CAAC;AAMX,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAEtF;AAaD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKzE"}
package/dist/copy.js CHANGED
@@ -1,22 +1,15 @@
1
1
  export const STORE_COPY = {
2
- appsTitle: 'apps',
3
- appsEmpty: 'no apps',
4
- communityTitle: 'community',
5
- communityNote: 'unreviewed',
6
- communityHint: 'from sources you have not added',
7
- communityEmpty: 'nothing here',
8
- suggestedTitle: 'suggested sources',
9
- suggestedHint: 'listed in the bridgething directory',
10
- suggestedEmpty: 'none',
2
+ empty: 'no apps',
3
+ noMatches: 'no matches',
11
4
  needsFirmware: 'needs newer firmware',
12
5
  unpublished: 'not published yet',
6
+ unreviewed: 'not reviewed by bridgething',
7
+ suggestedTitle: 'suggested sources',
8
+ suggestedEmpty: 'none',
13
9
  };
14
10
  function plural(count, word) {
15
11
  return `${count} ${word}${count === 1 ? '' : 's'}`;
16
12
  }
17
- export function countLine(listings, sources) {
18
- return `${listings} across ${plural(sources, 'source')}`;
19
- }
20
13
  export function failureLine(failures) {
21
14
  return `${plural(failures, 'source')} unreachable`;
22
15
  }
@@ -26,13 +19,26 @@ export function installsLabel(installs) {
26
19
  export function alsoAvailableLabel(alsoAvailableFrom) {
27
20
  return alsoAvailableFrom.length > 0 ? `also offered by ${plural(alsoAvailableFrom.length, 'other source')}` : null;
28
21
  }
29
- export function listingTraits(listing) {
30
- const newest = listing.newestCompatible;
31
- return [
32
- newest ? `lib ${newest.min_libbridgething_version}` : null,
33
- newest?.role === 'launcher' ? 'launcher' : null,
34
- newest?.provides_overlay ? 'overlay' : null,
35
- installsLabel(listing.installs),
36
- ].filter((trait) => trait !== null);
22
+ const PERMISSION_LABELS = {
23
+ 'net.fetch': 'internet',
24
+ 'net.ws': 'websockets',
25
+ 'net.proxy': 'TCP tunnel',
26
+ geo: 'location',
27
+ notifications: 'notifications',
28
+ audio: 'sound',
29
+ 'audio.tts': 'sound',
30
+ mic: 'microphone',
31
+ };
32
+ export function permissionLabel(permission) {
33
+ return PERMISSION_LABELS[permission] ?? permission;
34
+ }
35
+ export function sourceLine(source) {
36
+ if (!source)
37
+ return STORE_COPY.unreviewed;
38
+ if (source.trust === 'official')
39
+ return 'from bridgething';
40
+ if (source.trust === 'attested')
41
+ return `from ${source.name}`;
42
+ return `from ${source.name} · ${STORE_COPY.unreviewed}`;
37
43
  }
38
44
  //# sourceMappingURL=copy.js.map
package/dist/copy.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"copy.js","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,SAAS;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C,CAAC,CAAC,IAAI,CAAC;AACrH,CAAC;AAED,MAAM,iBAAiB,GAA2B;IAChD,WAAW,EAAE,UAAU;IACvB,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,YAAY;IACzB,GAAG,EAAE,UAAU;IACf,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,OAAO;IACpB,GAAG,EAAE,YAAY;CAClB,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,OAAO,iBAAiB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAsC;IAC/D,IAAI,CAAC,MAAM;QAAE,OAAO,UAAU,CAAC,UAAU,CAAC;IAC1C,IAAI,MAAM,CAAC,KAAK,KAAK,UAAU;QAAE,OAAO,kBAAkB,CAAC;IAC3D,IAAI,MAAM,CAAC,KAAK,KAAK,UAAU;QAAE,OAAO,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9D,OAAO,QAAQ,MAAM,CAAC,IAAI,MAAM,UAAU,CAAC,UAAU,EAAE,CAAC;AAC1D,CAAC"}
@@ -210,12 +210,13 @@ var require_validator = __commonJS(function(exports, module) {
210
210
  var formats0 = require_formats().fullFormats.uri;
211
211
  var formats2 = require_formats().fullFormats["date-time"];
212
212
  var func1 = require_ucs2length().default;
213
- var schema33 = { type: "object", additionalProperties: true, description: "One installable webapp. Unknown keys are tolerated so a catalog that carries a property added after a client shipped still validates; every key defined here is still checked strictly.", required: ["id", "name", "description", "author", "icon", "homepage", "source", "versions"], properties: { id: { $ref: "#/$defs/Uuid" }, name: { type: "string", minLength: 1, maxLength: 100, description: "Display name." }, description: { type: "string", minLength: 1, maxLength: 300, description: "One-line tagline for store cards." }, author: { type: "string", minLength: 1, maxLength: 100 }, icon: { type: ["string", "null"], format: "uri", description: "Hosted square icon. The publish step extracts the bundle's icon and uploads it; null until then." }, screenshots: { type: "array", minItems: 1, maxItems: 6, items: { type: "string", format: "uri" }, description: "Captures of the app running on a device, 800x480 landscape. The store shows the first one on the listing. Omit the key entirely rather than sending an empty array." }, homepage: { type: ["string", "null"], format: "uri" }, source: { type: ["string", "null"], format: "uri", description: "Repository or source URL, for users who want to check it themselves." }, versions: { type: "array", minItems: 1, items: { $ref: "#/$defs/AppVersion" }, description: "Published versions, newest-first. The companion installs the newest version compatible with the connected device." } } };
213
+ var schema33 = { type: "object", additionalProperties: true, description: "One installable webapp. Unknown keys are tolerated so a catalog that carries a property added after a client shipped still validates; every key defined here is still checked strictly.", required: ["id", "name", "description", "author", "icon", "homepage", "source", "versions"], properties: { id: { $ref: "#/$defs/Uuid" }, name: { type: "string", minLength: 1, maxLength: 100, description: "Display name." }, description: { type: "string", minLength: 1, maxLength: 300, description: "One-line tagline for store cards." }, author: { type: "string", minLength: 1, maxLength: 100 }, icon: { type: ["string", "null"], format: "uri", description: "Hosted square icon. The publish step extracts the bundle's icon and uploads it; null until then." }, screenshots: { type: "array", minItems: 1, maxItems: 6, items: { type: "string", format: "uri" }, description: "Captures of the app running on a device, 800x480 landscape. The store shows the first one on the listing. Omit the key entirely rather than sending an empty array." }, categories: { type: "array", minItems: 1, maxItems: 2, uniqueItems: true, items: { type: "string", pattern: "^[a-z][a-z-]{0,31}$" }, description: "Store categories, at most two, from the vocabulary in @bridgething/catalog (CATEGORIES). Clients ignore slugs they do not know, so a newer category never breaks an older client. Omit the key rather than sending an empty array." }, homepage: { type: ["string", "null"], format: "uri" }, source: { type: ["string", "null"], format: "uri", description: "Repository or source URL, for users who want to check it themselves." }, versions: { type: "array", minItems: 1, items: { $ref: "#/$defs/AppVersion" }, description: "Published versions, newest-first. The companion installs the newest version compatible with the connected device." } } };
214
214
  var formats8 = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
215
+ var pattern4 = new RegExp("^[a-z][a-z-]{0,31}$", "u");
215
216
  var schema35 = { type: "object", additionalProperties: true, description: "One published version. Unknown keys are tolerated so a catalog that carries a property added after a client shipped still validates; every key defined here is still checked strictly.", required: ["version", "released_at", "download", "permissions", "min_libbridgething_version", "changelog"], properties: { version: { $ref: "#/$defs/Version" }, released_at: { type: "string", format: "date-time" }, download: { $ref: "#/$defs/Download" }, settings: { $ref: "#/$defs/Download", description: "The bundle's settings page, hosted separately so a companion can fetch it over the internet instead of pulling it off the device over Bluetooth. Its sha256 MUST be the digest of the same bytes the bundle ships, which is what the device reports as settings_hash; a client verifies against the device's hash and falls back to the device when they disagree. Absent when the version ships no settings page." }, permissions: { type: "array", items: { type: "string", minLength: 1 }, uniqueItems: true, description: "Permission catalog keys this version requests (net.fetch, geo, ...). Shown at install, informational, never a gate." }, role: { enum: ["standard", "launcher"], description: "Mirrors the bundle manifest's role. A launcher can take the device's launcher slot and replace the built-in hub. Absent means standard." }, provides_overlay: { type: "boolean", description: "Whether this version ships an overlay the device can inject over every webapp. Absent means it does not." }, extension: { $ref: "#/$defs/Extension" }, min_libbridgething_version: { $ref: "#/$defs/Semver" }, changelog: { type: ["string", "null"], description: "Markdown changelog for this version." } } };
216
- var pattern4 = new RegExp("^[A-Za-z0-9](?:[A-Za-z0-9.+\\-]*[A-Za-z0-9])?$", "u");
217
- var pattern6 = new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+(?:[.+\\-][0-9A-Za-z.\\-]+)?$", "u");
218
- var pattern5 = new RegExp("^[a-f0-9]{64}$", "u");
217
+ var pattern5 = new RegExp("^[A-Za-z0-9](?:[A-Za-z0-9.+\\-]*[A-Za-z0-9])?$", "u");
218
+ var pattern7 = new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+(?:[.+\\-][0-9A-Za-z.\\-]+)?$", "u");
219
+ var pattern6 = new RegExp("^[a-f0-9]{64}$", "u");
219
220
  function validate23(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
220
221
  let vErrors = null;
221
222
  let errors = 0;
@@ -313,7 +314,7 @@ var require_validator = __commonJS(function(exports, module) {
313
314
  if (data.sha256 !== undefined) {
314
315
  let data2 = data.sha256;
315
316
  if (typeof data2 === "string") {
316
- if (!pattern5.test(data2)) {
317
+ if (!pattern6.test(data2)) {
317
318
  const err8 = { instancePath: instancePath + "/sha256", schemaPath: "#/$defs/Sha256/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "' + "^[a-f0-9]{64}$" + '"' };
318
319
  if (vErrors === null) {
319
320
  vErrors = [err8];
@@ -431,7 +432,7 @@ var require_validator = __commonJS(function(exports, module) {
431
432
  }
432
433
  errors++;
433
434
  }
434
- if (!pattern4.test(data0)) {
435
+ if (!pattern5.test(data0)) {
435
436
  const err8 = { instancePath: instancePath + "/version", schemaPath: "#/$defs/Version/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9](?:[A-Za-z0-9.+\\-]*[A-Za-z0-9])?$" }, message: 'must match pattern "' + "^[A-Za-z0-9](?:[A-Za-z0-9.+\\-]*[A-Za-z0-9])?$" + '"' };
436
437
  if (vErrors === null) {
437
438
  vErrors = [err8];
@@ -681,7 +682,7 @@ var require_validator = __commonJS(function(exports, module) {
681
682
  if (data.min_libbridgething_version !== undefined) {
682
683
  let data12 = data.min_libbridgething_version;
683
684
  if (typeof data12 === "string") {
684
- if (!pattern6.test(data12)) {
685
+ if (!pattern7.test(data12)) {
685
686
  const err27 = { instancePath: instancePath + "/min_libbridgething_version", schemaPath: "#/$defs/Semver/pattern", keyword: "pattern", params: { pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[.+\\-][0-9A-Za-z.\\-]+)?$" }, message: 'must match pattern "' + "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[.+\\-][0-9A-Za-z.\\-]+)?$" + '"' };
686
687
  if (vErrors === null) {
687
688
  vErrors = [err27];
@@ -1000,87 +1001,164 @@ var require_validator = __commonJS(function(exports, module) {
1000
1001
  errors++;
1001
1002
  }
1002
1003
  }
1004
+ if (data.categories !== undefined) {
1005
+ let data7 = data.categories;
1006
+ if (Array.isArray(data7)) {
1007
+ if (data7.length > 2) {
1008
+ const err26 = { instancePath: instancePath + "/categories", schemaPath: "#/properties/categories/maxItems", keyword: "maxItems", params: { limit: 2 }, message: "must NOT have more than 2 items" };
1009
+ if (vErrors === null) {
1010
+ vErrors = [err26];
1011
+ } else {
1012
+ vErrors.push(err26);
1013
+ }
1014
+ errors++;
1015
+ }
1016
+ if (data7.length < 1) {
1017
+ const err27 = { instancePath: instancePath + "/categories", schemaPath: "#/properties/categories/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
1018
+ if (vErrors === null) {
1019
+ vErrors = [err27];
1020
+ } else {
1021
+ vErrors.push(err27);
1022
+ }
1023
+ errors++;
1024
+ }
1025
+ const len1 = data7.length;
1026
+ for (let i1 = 0;i1 < len1; i1++) {
1027
+ let data8 = data7[i1];
1028
+ if (typeof data8 === "string") {
1029
+ if (!pattern4.test(data8)) {
1030
+ const err28 = { instancePath: instancePath + "/categories/" + i1, schemaPath: "#/properties/categories/items/pattern", keyword: "pattern", params: { pattern: "^[a-z][a-z-]{0,31}$" }, message: 'must match pattern "' + "^[a-z][a-z-]{0,31}$" + '"' };
1031
+ if (vErrors === null) {
1032
+ vErrors = [err28];
1033
+ } else {
1034
+ vErrors.push(err28);
1035
+ }
1036
+ errors++;
1037
+ }
1038
+ } else {
1039
+ const err29 = { instancePath: instancePath + "/categories/" + i1, schemaPath: "#/properties/categories/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
1040
+ if (vErrors === null) {
1041
+ vErrors = [err29];
1042
+ } else {
1043
+ vErrors.push(err29);
1044
+ }
1045
+ errors++;
1046
+ }
1047
+ }
1048
+ let i2 = data7.length;
1049
+ let j0;
1050
+ if (i2 > 1) {
1051
+ const indices0 = {};
1052
+ for (;i2--; ) {
1053
+ let item0 = data7[i2];
1054
+ if (typeof item0 !== "string") {
1055
+ continue;
1056
+ }
1057
+ if (typeof indices0[item0] == "number") {
1058
+ j0 = indices0[item0];
1059
+ const err30 = { instancePath: instancePath + "/categories", schemaPath: "#/properties/categories/uniqueItems", keyword: "uniqueItems", params: { i: i2, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i2 + " are identical)" };
1060
+ if (vErrors === null) {
1061
+ vErrors = [err30];
1062
+ } else {
1063
+ vErrors.push(err30);
1064
+ }
1065
+ errors++;
1066
+ break;
1067
+ }
1068
+ indices0[item0] = i2;
1069
+ }
1070
+ }
1071
+ } else {
1072
+ const err31 = { instancePath: instancePath + "/categories", schemaPath: "#/properties/categories/type", keyword: "type", params: { type: "array" }, message: "must be array" };
1073
+ if (vErrors === null) {
1074
+ vErrors = [err31];
1075
+ } else {
1076
+ vErrors.push(err31);
1077
+ }
1078
+ errors++;
1079
+ }
1080
+ }
1003
1081
  if (data.homepage !== undefined) {
1004
- let data7 = data.homepage;
1005
- if (typeof data7 !== "string" && data7 !== null) {
1006
- const err26 = { instancePath: instancePath + "/homepage", schemaPath: "#/properties/homepage/type", keyword: "type", params: { type: schema33.properties.homepage.type }, message: "must be string,null" };
1082
+ let data9 = data.homepage;
1083
+ if (typeof data9 !== "string" && data9 !== null) {
1084
+ const err32 = { instancePath: instancePath + "/homepage", schemaPath: "#/properties/homepage/type", keyword: "type", params: { type: schema33.properties.homepage.type }, message: "must be string,null" };
1007
1085
  if (vErrors === null) {
1008
- vErrors = [err26];
1086
+ vErrors = [err32];
1009
1087
  } else {
1010
- vErrors.push(err26);
1088
+ vErrors.push(err32);
1011
1089
  }
1012
1090
  errors++;
1013
1091
  }
1014
- if (typeof data7 === "string") {
1015
- if (!formats0(data7)) {
1016
- const err27 = { instancePath: instancePath + "/homepage", schemaPath: "#/properties/homepage/format", keyword: "format", params: { format: "uri" }, message: 'must match format "' + "uri" + '"' };
1092
+ if (typeof data9 === "string") {
1093
+ if (!formats0(data9)) {
1094
+ const err33 = { instancePath: instancePath + "/homepage", schemaPath: "#/properties/homepage/format", keyword: "format", params: { format: "uri" }, message: 'must match format "' + "uri" + '"' };
1017
1095
  if (vErrors === null) {
1018
- vErrors = [err27];
1096
+ vErrors = [err33];
1019
1097
  } else {
1020
- vErrors.push(err27);
1098
+ vErrors.push(err33);
1021
1099
  }
1022
1100
  errors++;
1023
1101
  }
1024
1102
  }
1025
1103
  }
1026
1104
  if (data.source !== undefined) {
1027
- let data8 = data.source;
1028
- if (typeof data8 !== "string" && data8 !== null) {
1029
- const err28 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: schema33.properties.source.type }, message: "must be string,null" };
1105
+ let data10 = data.source;
1106
+ if (typeof data10 !== "string" && data10 !== null) {
1107
+ const err34 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: schema33.properties.source.type }, message: "must be string,null" };
1030
1108
  if (vErrors === null) {
1031
- vErrors = [err28];
1109
+ vErrors = [err34];
1032
1110
  } else {
1033
- vErrors.push(err28);
1111
+ vErrors.push(err34);
1034
1112
  }
1035
1113
  errors++;
1036
1114
  }
1037
- if (typeof data8 === "string") {
1038
- if (!formats0(data8)) {
1039
- const err29 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/format", keyword: "format", params: { format: "uri" }, message: 'must match format "' + "uri" + '"' };
1115
+ if (typeof data10 === "string") {
1116
+ if (!formats0(data10)) {
1117
+ const err35 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/format", keyword: "format", params: { format: "uri" }, message: 'must match format "' + "uri" + '"' };
1040
1118
  if (vErrors === null) {
1041
- vErrors = [err29];
1119
+ vErrors = [err35];
1042
1120
  } else {
1043
- vErrors.push(err29);
1121
+ vErrors.push(err35);
1044
1122
  }
1045
1123
  errors++;
1046
1124
  }
1047
1125
  }
1048
1126
  }
1049
1127
  if (data.versions !== undefined) {
1050
- let data9 = data.versions;
1051
- if (Array.isArray(data9)) {
1052
- if (data9.length < 1) {
1053
- const err30 = { instancePath: instancePath + "/versions", schemaPath: "#/properties/versions/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
1128
+ let data11 = data.versions;
1129
+ if (Array.isArray(data11)) {
1130
+ if (data11.length < 1) {
1131
+ const err36 = { instancePath: instancePath + "/versions", schemaPath: "#/properties/versions/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
1054
1132
  if (vErrors === null) {
1055
- vErrors = [err30];
1133
+ vErrors = [err36];
1056
1134
  } else {
1057
- vErrors.push(err30);
1135
+ vErrors.push(err36);
1058
1136
  }
1059
1137
  errors++;
1060
1138
  }
1061
- const len1 = data9.length;
1062
- for (let i1 = 0;i1 < len1; i1++) {
1063
- if (!validate22(data9[i1], { instancePath: instancePath + "/versions/" + i1, parentData: data9, parentDataProperty: i1, rootData, dynamicAnchors })) {
1139
+ const len2 = data11.length;
1140
+ for (let i3 = 0;i3 < len2; i3++) {
1141
+ if (!validate22(data11[i3], { instancePath: instancePath + "/versions/" + i3, parentData: data11, parentDataProperty: i3, rootData, dynamicAnchors })) {
1064
1142
  vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
1065
1143
  errors = vErrors.length;
1066
1144
  }
1067
1145
  }
1068
1146
  } else {
1069
- const err31 = { instancePath: instancePath + "/versions", schemaPath: "#/properties/versions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
1147
+ const err37 = { instancePath: instancePath + "/versions", schemaPath: "#/properties/versions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
1070
1148
  if (vErrors === null) {
1071
- vErrors = [err31];
1149
+ vErrors = [err37];
1072
1150
  } else {
1073
- vErrors.push(err31);
1151
+ vErrors.push(err37);
1074
1152
  }
1075
1153
  errors++;
1076
1154
  }
1077
1155
  }
1078
1156
  } else {
1079
- const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1157
+ const err38 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1080
1158
  if (vErrors === null) {
1081
- vErrors = [err32];
1159
+ vErrors = [err38];
1082
1160
  } else {
1083
- vErrors.push(err32);
1161
+ vErrors.push(err38);
1084
1162
  }
1085
1163
  errors++;
1086
1164
  }
package/dist/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
- export type { AppEntry, AppExtension, AppVersion, Catalog, Download, InstallCount, RecommendedSource, Repo, SourceCatalog, } from './types.ts';
1
+ export type { AppEntry, AppExtension, AppVersion, Catalog, Download, InstallCount, RecommendedSource, Repo, SourceCatalog, StorePin, TrendingCount, } from './types.ts';
2
+ export { CATEGORIES, CATEGORY_LABELS, MAX_CATEGORIES, appCategories, isCategory, type Category } from './categories.ts';
2
3
  export { CatalogValidationError, validate, validateInvariants, validateSchema } from './validate.ts';
3
4
  export { EXTENSION_PERMISSION_PATTERN, EXTENSION_SOURCE_PATTERN, declaresExtension, describeExtensionPermission, describeExtensionPermissions, extensionOf, extensionRepoLabel, isExtensionPermission, } from './extension.ts';
4
5
  export { releasedAtInstant, sortNewestFirst } from './versions.ts';
5
6
  export { webHref } from './href.ts';
7
+ export { changelogText } from './changelog.ts';
6
8
  export { SETTINGS_PAGE_MIME, aggregate, compareVersions, fillsSlot, isListedWebapp, listedWebapps, newestCompatible, offersApp, pinsFrom, recommendedSources, satisfies, settingsOrigin, settingsOriginFor, slotCandidates, updates, versionCompatible, type CatalogAppListing, type CatalogAppUpdate, type ExtensionOffering, type InstalledWebapp, type WebappSlotName, } from './resolve.ts';
7
- export { blendStoreListings, type StoreListings } from './blend.ts';
8
- export { STORE_COPY, alsoAvailableLabel, countLine, failureLine, installsLabel, listingTraits } from './copy.ts';
9
+ export { reviewed, storeCatalog, type SourceTrust, type StoreCatalog, type StoreSource } from './store.ts';
10
+ export { FEATURED_COUNT, SHELF_SIZE, SORT_LABELS, browse, featuredListings, filterKey, filterLabel, firstReleasedAt, hasScreenshot, isLauncher, isOverlay, lastReleasedAt, listingKindLabel, matchesFilter, moreFromAuthor, pinnedListing, queryTitle, search, storeFilters, storefront, type BrowseQuery, type ChipFilter, type FilterChip, type Shelf, type ShelfId, type StoreFilter, type StoreKind, type StoreSort, type Storefront, } from './storefront.ts';
11
+ export { STORE_COPY, alsoAvailableLabel, failureLine, installsLabel, permissionLabel, sourceLine } from './copy.ts';
9
12
  export { CATALOG_FETCH_TIMEOUT_MS, DIRECTORY_ORIGIN, DirectoryApiError, OFFICIAL_CATALOG_URL, SOURCE_DIRECTORY_URL, SOURCE_STATUSES, SourceUrlError, fetchCatalog, fetchMergedApps, fetchSources, installedBody, normalizeSourceUrl, parseSourceUrl, reportInstalled, submitSource, unwrapDirectory, type CatalogSnapshot, type DirectoryEntry, type InstalledApp, type InstalledReport, type MergedApps, type MergedCatalog, type SourceFailure, type SourceStatus, } from './sources.ts';
10
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACJ,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,WAAW,EACX,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,E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L,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,12 @@
1
+ export { CATEGORIES, CATEGORY_LABELS, MAX_CATEGORIES, appCategories, isCategory } from "./categories.js";
1
2
  export { CatalogValidationError, validate, validateInvariants, validateSchema } from "./validate.js";
2
3
  export { EXTENSION_PERMISSION_PATTERN, EXTENSION_SOURCE_PATTERN, declaresExtension, describeExtensionPermission, describeExtensionPermissions, extensionOf, extensionRepoLabel, isExtensionPermission, } from "./extension.js";
3
4
  export { releasedAtInstant, sortNewestFirst } from "./versions.js";
4
5
  export { webHref } from "./href.js";
6
+ export { changelogText } from "./changelog.js";
5
7
  export { SETTINGS_PAGE_MIME, aggregate, compareVersions, fillsSlot, isListedWebapp, listedWebapps, newestCompatible, offersApp, pinsFrom, recommendedSources, satisfies, settingsOrigin, settingsOriginFor, slotCandidates, updates, versionCompatible, } from "./resolve.js";
6
- export { blendStoreListings } from "./blend.js";
7
- export { STORE_COPY, alsoAvailableLabel, countLine, failureLine, installsLabel, listingTraits } from "./copy.js";
8
+ export { reviewed, storeCatalog } from "./store.js";
9
+ export { FEATURED_COUNT, SHELF_SIZE, SORT_LABELS, browse, featuredListings, filterKey, filterLabel, firstReleasedAt, hasScreenshot, isLauncher, isOverlay, lastReleasedAt, listingKindLabel, matchesFilter, moreFromAuthor, pinnedListing, queryTitle, search, storeFilters, storefront, } from "./storefront.js";
10
+ export { STORE_COPY, alsoAvailableLabel, failureLine, installsLabel, permissionLabel, sourceLine } from "./copy.js";
8
11
  export { CATALOG_FETCH_TIMEOUT_MS, DIRECTORY_ORIGIN, DirectoryApiError, OFFICIAL_CATALOG_URL, SOURCE_DIRECTORY_URL, SOURCE_STATUSES, SourceUrlError, fetchCatalog, fetchMergedApps, fetchSources, installedBody, normalizeSourceUrl, parseSourceUrl, reportInstalled, submitSource, unwrapDirectory, } from "./sources.js";
9
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,WAAW,EACX,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,iBAAiB,GAMlB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEjH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe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ACZ,UAAU,GAUX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEpH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,eAAe,GAShB,MAAM,cAAc,CAAC"}
package/dist/resolve.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AppEntry, AppVersion, Catalog, Download, InstallCount, RecommendedSource, SourceCatalog } from './types.ts';
1
+ import type { AppEntry, AppVersion, Catalog, Download, InstallCount, RecommendedSource, SourceCatalog, TrendingCount } from './types.ts';
2
2
  export type ExtensionOffering = 'listed' | 'omitted';
3
3
  export declare function offersApp(app: AppEntry, extensions: ExtensionOffering): boolean;
4
4
  export type InstalledWebapp = {
@@ -16,6 +16,8 @@ export type CatalogAppListing = {
16
16
  updateAvailable: boolean;
17
17
  alsoAvailableFrom: string[];
18
18
  installs: number;
19
+ trending: number;
20
+ official: boolean;
19
21
  };
20
22
  export type CatalogAppUpdate = {
21
23
  appId: string;
@@ -51,6 +53,7 @@ export declare function aggregate(args: {
51
53
  installed: InstalledWebapp[];
52
54
  deviceLibVersion: string | null;
53
55
  installs?: InstallCount[];
56
+ trending?: TrendingCount[];
54
57
  extensions: ExtensionOffering;
55
58
  }): CatalogAppListing[];
56
59
  export declare function updates(args: {
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACd,MAAM,YAAY,CAAC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iB,CAAC;CAC/B,GAAG,gBAAgB,EAAE,CAwBrB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,aAAa,EAAE,CAAC;IACjC,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,iBAAiB,EAAE,CAiBtB;AAED,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,EAAE,EACzB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAChC,QAAQ,GAAG,IAAI,CAMjB;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,EAAE,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAOvG"}
package/dist/resolve.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { declaresExtension } from "./extension.js";
2
+ import { OFFICIAL_CATALOG_URL } from "./sources.js";
2
3
  import { sortNewestFirst } from "./versions.js";
3
4
  export function offersApp(app, extensions) {
4
5
  return extensions === 'listed' || !declaresExtension(app);
@@ -60,7 +61,7 @@ export function fillsSlot(webapp, slot) {
60
61
  export function slotCandidates(list, slot) {
61
62
  return list.filter(webapp => fillsSlot(webapp, slot));
62
63
  }
63
- function installsById(counts) {
64
+ function tallyById(counts) {
64
65
  const out = new Map();
65
66
  for (const entry of counts) {
66
67
  const tally = Number(entry.count);
@@ -74,7 +75,8 @@ function installsById(counts) {
74
75
  export function aggregate(args) {
75
76
  const { orderedCatalogs, installed, deviceLibVersion, extensions } = args;
76
77
  const installedById = new Map(installed.map(i => [i.id.toLowerCase(), i]));
77
- const tallies = installsById(args.installs ?? []);
78
+ const tallies = tallyById(args.installs ?? []);
79
+ const recent = tallyById(args.trending ?? []);
78
80
  const pins = pinsFrom(installed);
79
81
  const offerings = new Map();
80
82
  for (const { url, catalog } of orderedCatalogs) {
@@ -105,6 +107,8 @@ export function aggregate(args) {
105
107
  updateAvailable: installedVersion !== null && newest !== null && isUpgrade(newest.version, installedVersion),
106
108
  alsoAvailableFrom,
107
109
  installs: tallies.get(id) ?? 0,
110
+ trending: recent.get(id) ?? 0,
111
+ official: primary.url === OFFICIAL_CATALOG_URL,
108
112
  });
109
113
  }
110
114
  return listings.sort((a, b) => b.installs - a.installs || a.app.name.localeCompare(b.app.name) || a.app.id.localeCompare(b.app.id));