nap-sdk 0.2.0
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/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/native.d.ts +9 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +4 -0
- package/index.d.ts +9 -0
- package/nap-sdk.darwin-arm64.node +0 -0
- package/nap-sdk.linux-x64-gnu.node +0 -0
- package/nap-sdk.win32-x64-msvc.node +0 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function parseUri(uri: string): Record<string, unknown>;
|
|
2
|
+
export declare function parseManifest(yamlStr: string): Record<string, unknown>;
|
|
3
|
+
export declare function resolve(uri: string, repoPath: string): Record<string, unknown>;
|
|
4
|
+
export declare function version(): string;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import native from "./native.js";
|
|
2
|
+
export function parseUri(uri) {
|
|
3
|
+
return JSON.parse(native.parseUri(uri));
|
|
4
|
+
}
|
|
5
|
+
export function parseManifest(yamlStr) {
|
|
6
|
+
return JSON.parse(native.parseManifest(yamlStr));
|
|
7
|
+
}
|
|
8
|
+
export function resolve(uri, repoPath) {
|
|
9
|
+
return JSON.parse(native.resolve(uri, repoPath));
|
|
10
|
+
}
|
|
11
|
+
export function version() {
|
|
12
|
+
return native.version();
|
|
13
|
+
}
|
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface NativeBindings {
|
|
2
|
+
parseUri(uri: string): string;
|
|
3
|
+
parseManifest(yamlStr: string): string;
|
|
4
|
+
resolve(uri: string, repoPath: string): string;
|
|
5
|
+
version(): string;
|
|
6
|
+
}
|
|
7
|
+
declare const native: NativeBindings;
|
|
8
|
+
export default native;
|
|
9
|
+
//# sourceMappingURL=native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,OAAO,IAAI,MAAM,CAAC;CACnB;AAGD,QAAA,MAAM,MAAM,EAA8B,cAAc,CAAC;AAEzD,eAAe,MAAM,CAAC"}
|
package/dist/native.js
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
export declare function parseUri(uriStr: string): string
|
|
7
|
+
export declare function parseManifest(yamlStr: string): string
|
|
8
|
+
export declare function resolve(uriStr: string, repoBasePath: string): string
|
|
9
|
+
export declare function version(): string
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nap-sdk",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "TypeScript SDK for NAP (Narrative Addressing Protocol), powered by Rust and NAPI-RS.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/DigitalCreationsCo/nap"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/DigitalCreationsCo/nap#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/DigitalCreationsCo/nap/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"index.cjs",
|
|
20
|
+
"index.d.ts",
|
|
21
|
+
"*.node"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build:native": "napi build --cargo-cwd . --platform --release && node -e \"require('fs').renameSync('index.js', 'index.cjs')\"",
|
|
25
|
+
"build:types": "tsc -p tsconfig.json",
|
|
26
|
+
"build": "npm run build:native && npm run build:types",
|
|
27
|
+
"test": "vitest run"
|
|
28
|
+
},
|
|
29
|
+
"napi": {
|
|
30
|
+
"name": "nap-sdk",
|
|
31
|
+
"binaryName": "nap-sdk",
|
|
32
|
+
"triples": {
|
|
33
|
+
"defaults": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20.11.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@napi-rs/cli": "^2.18.4",
|
|
41
|
+
"@types/node": "^22.10.2",
|
|
42
|
+
"typescript": "^5.7.2",
|
|
43
|
+
"vitest": "^2.1.8"
|
|
44
|
+
}
|
|
45
|
+
}
|