@ankhorage/permissions 0.3.4 → 0.3.6

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,17 @@
1
1
  # @ankhorage/permissions
2
2
 
3
+ ## 0.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a2a1e1: Migrate permission capability declarations and validation to the released Contracts 26 and Capability APIs.
8
+
9
+ ## 0.3.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 16d34b5: Update dependencies: `@ankhorage/ankh`, `@ankhorage/devtools`.
14
+
3
15
  ## 0.3.4
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # PERMISSIONS
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.3.4](././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) ![paradox: canonical](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.3.6](././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) ![paradox: canonical](././paradox/badges/docs.svg)
7
7
 
8
8
  Cross-platform permission registry and runtime helpers for Expo, React Native, and React Native Web apps, with unified request/check APIs for camera, media, location, notifications, microphone, and other web/native capabilities.
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"ankh.provider.js","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,iBAAiB,CAA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,CAAC;AAEJ,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,wBAAwB;IAC5B,QAAQ,EAAE,4BAA4B;IACtC,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,YAAY,EAAE,YAAY;IAC1B,QAAQ;IACR,QAAQ;CACqC,CAAC;AAEhD,eAAe,QAAQ,CAAC","sourcesContent":["import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';\nimport type { Capability } from '@ankhorage/contracts/capabilities';\nimport type { AnkhCommandDescriptor } from '@ankhorage/contracts/cli';\n\nimport packageJson from '../package.json';\nimport { CAPABILITIES } from './capabilities/index';\nimport { PERMISSIONS } from './registry/permissions';\n\nconst PERMISSIONS_PACKAGE_NAME = '@ankhorage/permissions';\nconst PERMISSIONS_COMMAND_CATEGORY = 'permissions';\n\nconst commands = [\n {\n path: ['list'],\n summary: 'List known permission identifiers and registry metadata.',\n capability: 'permissions.inspect' satisfies Capability['id'],\n aliases: ['registry'],\n examples: ['ankh permissions list'],\n },\n {\n path: ['check'],\n summary: 'Check a permission state through a host-provided permission client.',\n capability: 'permissions.check' satisfies Capability['id'],\n examples: ['ankh permissions check camera'],\n },\n {\n path: ['request'],\n summary: 'Request a permission through a host-provided permission client.',\n capability: 'permissions.request' satisfies Capability['id'],\n examples: ['ankh permissions request camera'],\n },\n {\n path: ['manifest'],\n summary: 'Show native/web manifest metadata required by registered permissions.',\n capability: 'permissions.manifest' satisfies Capability['id'],\n examples: ['ankh permissions manifest camera'],\n },\n] as const satisfies readonly (AnkhCommandDescriptor & {\n readonly capability: Capability['id'];\n})[];\n\nconst handlers = commands.map((command) => ({\n path: command.path,\n handler(request: {\n readonly context: {\n writeStdout(text: string): void;\n };\n }) {\n request.context.writeStdout(\n `${command.path.join(' ')} is provided by ${PERMISSIONS_PACKAGE_NAME}. ` +\n `Known permissions: ${PERMISSIONS.join(', ')}.\\n`,\n );\n return { exitCode: 0 };\n },\n}));\n\nconst provider = {\n id: PERMISSIONS_PACKAGE_NAME,\n category: PERMISSIONS_COMMAND_CATEGORY,\n version: packageJson.version,\n capabilities: CAPABILITIES,\n commands,\n handlers,\n} as const satisfies AnkhRuntimeCommandProvider;\n\nexport default provider;\n"]}
1
+ {"version":3,"file":"ankh.provider.js","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAC1D,MAAM,4BAA4B,GAAG,aAAa,CAAC;AAEnD,MAAM,QAAQ,GAAG;IACf;QACE,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,0DAA0D;QACnE,UAAU,EAAE,qBAAgD;QAC5D,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB,QAAQ,EAAE,CAAC,uBAAuB,CAAC;KACpC;IACD;QACE,IAAI,EAAE,CAAC,OAAO,CAAC;QACf,OAAO,EAAE,qEAAqE;QAC9E,UAAU,EAAE,mBAA8C;QAC1D,QAAQ,EAAE,CAAC,+BAA+B,CAAC;KAC5C;IACD;QACE,IAAI,EAAE,CAAC,SAAS,CAAC;QACjB,OAAO,EAAE,iEAAiE;QAC1E,UAAU,EAAE,qBAAgD;QAC5D,QAAQ,EAAE,CAAC,iCAAiC,CAAC;KAC9C;IACD;QACE,IAAI,EAAE,CAAC,UAAU,CAAC;QAClB,OAAO,EAAE,uEAAuE;QAChF,UAAU,EAAE,sBAAiD;QAC7D,QAAQ,EAAE,CAAC,kCAAkC,CAAC;KAC/C;CAGC,CAAC;AAEL,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,CAAC,OAIP;QACC,OAAO,CAAC,OAAO,CAAC,WAAW,CACzB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,wBAAwB,IAAI;YACtE,sBAAsB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CACpD,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzB,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,wBAAwB;IAC5B,QAAQ,EAAE,4BAA4B;IACtC,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,YAAY,EAAE,YAAY;IAC1B,QAAQ;IACR,QAAQ;CACqC,CAAC;AAEhD,eAAe,QAAQ,CAAC","sourcesContent":["import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';\nimport type { Capability } from '@ankhorage/contracts/capability';\nimport type { AnkhCommandDescriptor } from '@ankhorage/contracts/cli';\n\nimport packageJson from '../package.json';\nimport { CAPABILITIES } from './capabilities/index';\nimport { PERMISSIONS } from './registry/permissions';\n\nconst PERMISSIONS_PACKAGE_NAME = '@ankhorage/permissions';\nconst PERMISSIONS_COMMAND_CATEGORY = 'permissions';\n\nconst commands = [\n {\n path: ['list'],\n summary: 'List known permission identifiers and registry metadata.',\n capability: 'permissions.inspect' satisfies Capability['id'],\n aliases: ['registry'],\n examples: ['ankh permissions list'],\n },\n {\n path: ['check'],\n summary: 'Check a permission state through a host-provided permission client.',\n capability: 'permissions.check' satisfies Capability['id'],\n examples: ['ankh permissions check camera'],\n },\n {\n path: ['request'],\n summary: 'Request a permission through a host-provided permission client.',\n capability: 'permissions.request' satisfies Capability['id'],\n examples: ['ankh permissions request camera'],\n },\n {\n path: ['manifest'],\n summary: 'Show native/web manifest metadata required by registered permissions.',\n capability: 'permissions.manifest' satisfies Capability['id'],\n examples: ['ankh permissions manifest camera'],\n },\n] as const satisfies readonly (AnkhCommandDescriptor & {\n readonly capability: Capability['id'];\n})[];\n\nconst handlers = commands.map((command) => ({\n path: command.path,\n handler(request: {\n readonly context: {\n writeStdout(text: string): void;\n };\n }) {\n request.context.writeStdout(\n `${command.path.join(' ')} is provided by ${PERMISSIONS_PACKAGE_NAME}. ` +\n `Known permissions: ${PERMISSIONS.join(', ')}.\\n`,\n );\n return { exitCode: 0 };\n },\n}));\n\nconst provider = {\n id: PERMISSIONS_PACKAGE_NAME,\n category: PERMISSIONS_COMMAND_CATEGORY,\n version: packageJson.version,\n capabilities: CAPABILITIES,\n commands,\n handlers,\n} as const satisfies AnkhRuntimeCommandProvider;\n\nexport default provider;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,0DAA0D;KACxE;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,iEAAiE;KAC/E;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,2EAA2E;KACzF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capabilities';\n\n/*** Define the executable permission operations published by this package. */\nexport const CAPABILITIES = [\n {\n id: 'permissions.inspect',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Inspect permissions',\n description: 'List known permission identifiers and registry metadata.',\n },\n {\n id: 'permissions.check',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Check permission',\n description: 'Check a permission state through a host-provided permission client.',\n },\n {\n id: 'permissions.request',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Request permission',\n description: 'Request a permission through a host-provided permission client.',\n },\n {\n id: 'permissions.manifest',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Inspect permission manifest',\n description: 'Show native and web manifest metadata required by registered permissions.',\n },\n] as const satisfies readonly Capability[];\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,0DAA0D;KACxE;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,iEAAiE;KAC/E;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,2EAA2E;KACzF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capability';\n\n/*** Define the executable permission operations published by this package. */\nexport const CAPABILITIES = [\n {\n id: 'permissions.inspect',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Inspect permissions',\n description: 'List known permission identifiers and registry metadata.',\n },\n {\n id: 'permissions.check',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Check permission',\n description: 'Check a permission state through a host-provided permission client.',\n },\n {\n id: 'permissions.request',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Request permission',\n description: 'Request a permission through a host-provided permission client.',\n },\n {\n id: 'permissions.manifest',\n owner: '@ankhorage/permissions',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Inspect permission manifest',\n description: 'Show native and web manifest metadata required by registered permissions.',\n },\n] as const satisfies readonly Capability[];\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/permissions",
3
3
  "type": "module",
4
- "version": "0.3.4",
4
+ "version": "0.3.6",
5
5
  "description": "Cross-platform permission registry and runtime helpers for Expo, React Native, and React Native Web apps, with unified request/check APIs for camera, media, location, notifications, microphone, and other web/native capabilities.",
6
6
  "homepage": "https://github.com/ankhorage/permissions#readme",
7
7
  "bugs": {
@@ -35,8 +35,8 @@
35
35
  "web"
36
36
  ],
37
37
  "dependencies": {
38
- "@ankhorage/ankh": "^0.13.0",
39
- "@ankhorage/contracts": "^24.2.1"
38
+ "@ankhorage/ankh": "^0.13.1",
39
+ "@ankhorage/contracts": "^26.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=18.2.0 || >=19.0.0"
@@ -200,12 +200,13 @@
200
200
  "knip:check": "ankhorage-knip"
201
201
  },
202
202
  "devDependencies": {
203
- "@ankhorage/devtools": "^2.3.9",
203
+ "@ankhorage/capability": "^0.2.1",
204
+ "@ankhorage/devtools": "^2.3.18",
204
205
  "@ankhorage/paradox": "^0.3.1",
205
206
  "@types/bun": "^1.4.2",
206
207
  "@types/node": "^26.6.5",
207
208
  "@types/react": "^19.3.0",
208
- "react": "^19.3.0",
209
+ "react": "^19.3.1",
209
210
  "typescript": "^6.0.3"
210
211
  },
211
212
  "packageManager": "bun@1.4.2"
@@ -1,5 +1,5 @@
1
1
  import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';
2
- import type { Capability } from '@ankhorage/contracts/capabilities';
2
+ import type { Capability } from '@ankhorage/contracts/capability';
3
3
  import type { AnkhCommandDescriptor } from '@ankhorage/contracts/cli';
4
4
 
5
5
  import packageJson from '../package.json';
@@ -1,4 +1,4 @@
1
- import { isCapability } from '@ankhorage/contracts/capabilities';
1
+ import { isCapability } from '@ankhorage/capability';
2
2
  import { describe, expect, test } from 'bun:test';
3
3
 
4
4
  import { CAPABILITIES } from './index';
@@ -1,4 +1,4 @@
1
- import type { Capability } from '@ankhorage/contracts/capabilities';
1
+ import type { Capability } from '@ankhorage/contracts/capability';
2
2
 
3
3
  /*** Define the executable permission operations published by this package. */
4
4
  export const CAPABILITIES = [