@ankhorage/expo-runtime 6.0.0 → 6.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/capabilities/index.js.map +1 -1
- package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.d.ts.map +1 -1
- package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.js +1 -1
- package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.js.map +1 -1
- package/dist/types/expoRuntimeCapability.d.ts +1 -1
- package/dist/types/expoRuntimeCapability.d.ts.map +1 -1
- package/dist/types/expoRuntimeCapability.js.map +1 -1
- package/package.json +4 -3
- package/src/capabilities/index.test.ts +2 -2
- package/src/capabilities/index.ts +1 -1
- package/src/expoCapabilityBridge.test.ts +1 -1
- package/src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts +2 -1
- package/src/types/expoRuntimeCapability.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# EXPO-RUNTIME
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
|
|
9
9
|
|
|
@@ -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,YAAY;QAChB,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,CAAC,QAAQ,CAAC;SACvB;QACD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,oDAAoD;QACjE,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,UAAU,EAAE;oBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC5B;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/
|
|
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,YAAY;QAChB,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,CAAC,QAAQ,CAAC;SACvB;QACD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,oDAAoD;QACjE,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,UAAU,EAAE;oBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC5B;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capability';\n\n/*** Publish the portable capabilities that Expo Runtime owns and executes. */\nexport const CAPABILITIES = [\n {\n id: 'expo.alert',\n owner: '@ankhorage/expo-runtime',\n access: ['invoke'],\n binding: {\n kind: 'action',\n bindableAs: ['target'],\n },\n label: 'Show an Expo alert',\n description: 'Display a platform alert through the Expo runtime.',\n input: {\n schema: {\n type: 'object',\n required: ['message'],\n properties: {\n message: { type: 'string' },\n },\n additionalProperties: false,\n },\n },\n },\n] as const satisfies readonly Capability[];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeExpoRuntimeCapabilityAsync.d.ts","sourceRoot":"","sources":["../../../src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executeExpoRuntimeCapabilityAsync.d.ts","sourceRoot":"","sources":["../../../src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gCAAgC,EAGjC,MAAM,mCAAmC,CAAC;AAE3C,yGAAyG;AACzG,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,gCAAgC,GACrC,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isCapability } from '@ankhorage/
|
|
1
|
+
import { isCapability } from '@ankhorage/capability';
|
|
2
2
|
/*** Execute an Expo-owned capability or delegate another canonical capability to its runtime handler. */
|
|
3
3
|
export async function executeExpoRuntimeCapabilityAsync(args) {
|
|
4
4
|
const { capability, input, capabilityHandlers, alertImpl } = args;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeExpoRuntimeCapabilityAsync.js","sourceRoot":"","sources":["../../../src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"executeExpoRuntimeCapabilityAsync.js","sourceRoot":"","sources":["../../../src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AASrD,yGAAyG;AACzG,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,IAAsC;IAEtC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAClE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;QAAE,OAAO;IAEtC,IAAI,UAAU,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC;QACnC,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;IAED,MAAM,qBAAqB,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED,gGAAgG;AAChG,SAAS,qBAAqB,CAC5B,kBAAuE,EACvE,YAA8B;IAE9B,OAAO,kBAAkB,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,KAAK,YAAY,CAAC,EAAE,OAAO,CAAC;AAC/F,CAAC;AAED,+FAA+F;AAC/F,SAAS,gBAAgB,CACvB,KAAc,EACd,SAAkD;IAElD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO;IACrC,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC","sourcesContent":["import { isCapability } from '@ankhorage/capability';\nimport type { Capability } from '@ankhorage/contracts/capability';\n\nimport type {\n ExecuteExpoRuntimeCapabilityArgs,\n ExpoRuntimeCapabilityHandler,\n ExpoRuntimeCapabilityHandlerArgs,\n} from '../../types/expoRuntimeCapability';\n\n/*** Execute an Expo-owned capability or delegate another canonical capability to its runtime handler. */\nexport async function executeExpoRuntimeCapabilityAsync(\n args: ExecuteExpoRuntimeCapabilityArgs,\n): Promise<void> {\n const { capability, input, capabilityHandlers, alertImpl } = args;\n if (!isCapability(capability)) return;\n\n if (capability.id === 'expo.alert') {\n executeExpoAlert(input, alertImpl);\n return;\n }\n\n await findCapabilityHandler(capabilityHandlers, capability.id)?.({ capability, input });\n}\n\n/*** Find the configured executor for one canonical capability without dynamic record access. */\nfunction findCapabilityHandler(\n capabilityHandlers: readonly ExpoRuntimeCapabilityHandler[] | undefined,\n capabilityId: Capability['id'],\n): ((args: ExpoRuntimeCapabilityHandlerArgs) => Promise<void> | void) | undefined {\n return capabilityHandlers?.find((handler) => handler.capabilityId === capabilityId)?.execute;\n}\n\n/*** Display a valid Expo-owned alert invocation without exposing alert as a generic action. */\nfunction executeExpoAlert(\n input: unknown,\n alertImpl: ((message: string) => void) | undefined,\n): void {\n if (!isExpoAlertInput(input)) return;\n alertImpl?.(input.message);\n}\n\n/*** Validate the serializable input accepted by the Expo alert capability. */\nfunction isExpoAlertInput(input: unknown): input is { readonly message: string } {\n return (\n typeof input === 'object' &&\n input !== null &&\n 'message' in input &&\n typeof input.message === 'string'\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoRuntimeCapability.d.ts","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"expoRuntimeCapability.d.ts","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpF;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoRuntimeCapability.js","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"","sourcesContent":["import type { Capability } from '@ankhorage/contracts/
|
|
1
|
+
{"version":3,"file":"expoRuntimeCapability.js","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capability';\n\nexport interface ExpoRuntimeCapabilityHandlerArgs {\n readonly capability: Capability;\n readonly input: unknown;\n}\n\nexport interface ExpoRuntimeCapabilityHandler {\n readonly capabilityId: Capability['id'];\n readonly execute: (args: ExpoRuntimeCapabilityHandlerArgs) => Promise<void> | void;\n}\n\nexport interface ExecuteExpoRuntimeCapabilityArgs {\n readonly capability: unknown;\n readonly input?: unknown;\n readonly capabilityHandlers?: readonly ExpoRuntimeCapabilityHandler[];\n readonly alertImpl?: (message: string) => void;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.1",
|
|
5
5
|
"description": "Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/expo-runtime#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"runtime"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ankhorage/
|
|
29
|
+
"@ankhorage/capability": "^0.2.1",
|
|
30
|
+
"@ankhorage/contracts": "^25.0.0"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"dist",
|
|
@@ -249,7 +250,7 @@
|
|
|
249
250
|
}
|
|
250
251
|
},
|
|
251
252
|
"devDependencies": {
|
|
252
|
-
"@ankhorage/devtools": "^2.
|
|
253
|
+
"@ankhorage/devtools": "^2.3.13",
|
|
253
254
|
"@ankhorage/paradox": "^0.2.27",
|
|
254
255
|
"@ankhorage/permissions": "^0.2.63",
|
|
255
256
|
"@ankhorage/zora": "^24.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isCapabilityCatalog } from '@ankhorage/capability';
|
|
2
2
|
import { describe, expect, test } from 'bun:test';
|
|
3
3
|
|
|
4
4
|
import packageJson from '../../package.json';
|
|
@@ -6,7 +6,7 @@ import { CAPABILITIES } from './index';
|
|
|
6
6
|
|
|
7
7
|
describe('Expo Runtime capability catalog', () => {
|
|
8
8
|
test('contains unique valid canonical descriptors', () => {
|
|
9
|
-
expect(CAPABILITIES
|
|
9
|
+
expect(isCapabilityCatalog(CAPABILITIES)).toBe(true);
|
|
10
10
|
expect(new Set(CAPABILITIES.map(({ id }) => id)).size).toBe(CAPABILITIES.length);
|
|
11
11
|
expect(CAPABILITIES.map(({ id }) => id)).toEqual(['expo.alert']);
|
|
12
12
|
});
|