@ankhorage/contracts 8.0.0 → 8.0.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/contracts
2
2
 
3
+ ## 8.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f932e26: Add the canonical `ebookReader` platform requirement capability for manifest-authored EPUB and PDF reader surfaces.
8
+
3
9
  ## 8.0.0
4
10
 
5
11
  ### Major Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # CONTRACTS
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v7.8.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v8.0.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
9
9
 
@@ -1,6 +1,6 @@
1
1
  export declare const ANKHORAGE_PERMISSION_NAMES: readonly ["camera", "microphone", "mediaLibrary", "mediaLibraryWrite", "locationForeground", "locationBackground", "notifications", "clipboard"];
2
2
  export type AnkhoragePermissionName = (typeof ANKHORAGE_PERMISSION_NAMES)[number];
3
- export declare const ANKHORAGE_CAPABILITY_NAMES: readonly ["barcodeScanner", "cameraPreview", "mediaPicker", "filePicker", "location", "notifications", "clipboard"];
3
+ export declare const ANKHORAGE_CAPABILITY_NAMES: readonly ["barcodeScanner", "cameraPreview", "ebookReader", "mediaPicker", "filePicker", "location", "notifications", "clipboard"];
4
4
  export type AnkhorageCapabilityName = (typeof ANKHORAGE_CAPABILITY_NAMES)[number];
5
5
  export interface ScreenPermissionRequirement {
6
6
  readonly permission: AnkhoragePermissionName;
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,kJAS7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,eAAO,MAAM,0BAA0B,qHAQ7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAChE;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAChE"}
1
+ {"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,kJAS7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,eAAO,MAAM,0BAA0B,oIAS7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAChE;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAChE"}
@@ -11,6 +11,7 @@ export const ANKHORAGE_PERMISSION_NAMES = [
11
11
  export const ANKHORAGE_CAPABILITY_NAMES = [
12
12
  'barcodeScanner',
13
13
  'cameraPreview',
14
+ 'ebookReader',
14
15
  'mediaPicker',
15
16
  'filePicker',
16
17
  'location',
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.js","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,eAAe;IACf,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,YAAY;IACZ,UAAU;IACV,eAAe;IACf,WAAW;CACH,CAAC","sourcesContent":["export const ANKHORAGE_PERMISSION_NAMES = [\n 'camera',\n 'microphone',\n 'mediaLibrary',\n 'mediaLibraryWrite',\n 'locationForeground',\n 'locationBackground',\n 'notifications',\n 'clipboard',\n] as const;\n\nexport type AnkhoragePermissionName = (typeof ANKHORAGE_PERMISSION_NAMES)[number];\n\nexport const ANKHORAGE_CAPABILITY_NAMES = [\n 'barcodeScanner',\n 'cameraPreview',\n 'mediaPicker',\n 'filePicker',\n 'location',\n 'notifications',\n 'clipboard',\n] as const;\n\nexport type AnkhorageCapabilityName = (typeof ANKHORAGE_CAPABILITY_NAMES)[number];\n\nexport interface ScreenPermissionRequirement {\n readonly permission: AnkhoragePermissionName;\n}\n\nexport interface ScreenCapabilityRequirement {\n readonly capability: AnkhorageCapabilityName;\n}\n\nexport interface ScreenRequirements {\n readonly permissions?: readonly ScreenPermissionRequirement[];\n readonly capabilities?: readonly ScreenCapabilityRequirement[];\n}\n\nexport interface ComponentRequirements {\n readonly permissions?: readonly ScreenPermissionRequirement[];\n readonly capabilities?: readonly ScreenCapabilityRequirement[];\n}\n"]}
1
+ {"version":3,"file":"requirements.js","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,eAAe;IACf,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,eAAe;IACf,WAAW;CACH,CAAC","sourcesContent":["export const ANKHORAGE_PERMISSION_NAMES = [\n 'camera',\n 'microphone',\n 'mediaLibrary',\n 'mediaLibraryWrite',\n 'locationForeground',\n 'locationBackground',\n 'notifications',\n 'clipboard',\n] as const;\n\nexport type AnkhoragePermissionName = (typeof ANKHORAGE_PERMISSION_NAMES)[number];\n\nexport const ANKHORAGE_CAPABILITY_NAMES = [\n 'barcodeScanner',\n 'cameraPreview',\n 'ebookReader',\n 'mediaPicker',\n 'filePicker',\n 'location',\n 'notifications',\n 'clipboard',\n] as const;\n\nexport type AnkhorageCapabilityName = (typeof ANKHORAGE_CAPABILITY_NAMES)[number];\n\nexport interface ScreenPermissionRequirement {\n readonly permission: AnkhoragePermissionName;\n}\n\nexport interface ScreenCapabilityRequirement {\n readonly capability: AnkhorageCapabilityName;\n}\n\nexport interface ScreenRequirements {\n readonly permissions?: readonly ScreenPermissionRequirement[];\n readonly capabilities?: readonly ScreenCapabilityRequirement[];\n}\n\nexport interface ComponentRequirements {\n readonly permissions?: readonly ScreenPermissionRequirement[];\n readonly capabilities?: readonly ScreenCapabilityRequirement[];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -117,7 +117,7 @@ function createManifest(): Record<string, unknown> {
117
117
  ],
118
118
  requires: {
119
119
  permissions: [{ permission: 'camera' }],
120
- capabilities: [{ capability: 'barcodeScanner' }],
120
+ capabilities: [{ capability: 'barcodeScanner' }, { capability: 'ebookReader' }],
121
121
  },
122
122
  },
123
123
  },
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+
3
+ import {
4
+ ANKHORAGE_CAPABILITY_NAMES,
5
+ type AnkhorageCapabilityName,
6
+ type ComponentRequirements,
7
+ type ScreenRequirements,
8
+ } from './index';
9
+
10
+ describe('platform requirements', () => {
11
+ it('exports ebookReader as the canonical reader capability', () => {
12
+ const capability: AnkhorageCapabilityName = 'ebookReader';
13
+ const componentRequirements: ComponentRequirements = {
14
+ capabilities: [{ capability }],
15
+ };
16
+ const screenRequirements: ScreenRequirements = {
17
+ capabilities: [{ capability }],
18
+ };
19
+
20
+ expect(ANKHORAGE_CAPABILITY_NAMES).toContain(capability);
21
+ expect(componentRequirements).toEqual(screenRequirements);
22
+ });
23
+ });
@@ -14,6 +14,7 @@ export type AnkhoragePermissionName = (typeof ANKHORAGE_PERMISSION_NAMES)[number
14
14
  export const ANKHORAGE_CAPABILITY_NAMES = [
15
15
  'barcodeScanner',
16
16
  'cameraPreview',
17
+ 'ebookReader',
17
18
  'mediaPicker',
18
19
  'filePicker',
19
20
  'location',