@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 +6 -0
- package/README.md +1 -1
- package/dist/requirements.d.ts +1 -1
- package/dist/requirements.d.ts.map +1 -1
- package/dist/requirements.js +1 -0
- package/dist/requirements.js.map +1 -1
- package/package.json +1 -1
- package/src/appManifest.test.ts +1 -1
- package/src/requirements.test.ts +23 -0
- package/src/requirements.ts +1 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# CONTRACTS
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
9
9
|
|
package/dist/requirements.d.ts
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/requirements.js
CHANGED
package/dist/requirements.js.map
CHANGED
|
@@ -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
package/src/appManifest.test.ts
CHANGED
|
@@ -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
|
+
});
|
package/src/requirements.ts
CHANGED