@atproto/xrpc
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1,2 +0,1 @@ | ||
const pkgJson = require('@npmcli/package-json') | ||
const { nodeExternalsPlugin } = require('esbuild-node-externals') | ||
@@ -7,9 +6,2 @@ | ||
if (process.argv.includes('--update-main-to-dist')) { | ||
return pkgJson | ||
.load(__dirname) | ||
.then((pkg) => pkg.update({ main: 'dist/index.js' })) | ||
.then((pkg) => pkg.save()) | ||
} | ||
require('esbuild').build({ | ||
@@ -16,0 +8,0 @@ logLevel: 'info', |
{ | ||
"name": "@atproto/xrpc", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prettier": "prettier --check src/", | ||
"prettier:fix": "prettier --write src/", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"lint:fix": "yarn lint --fix", | ||
"verify": "run-p prettier lint", | ||
"verify:fix": "yarn prettier:fix && yarn lint:fix", | ||
"build": "node ./build.js", | ||
"postbuild": "tsc --build tsconfig.build.json", | ||
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist", | ||
"update-main-to-src": "node ./update-pkg.js --update-main-to-src", | ||
"prepublish": "npm run update-main-to-dist", | ||
"postpublish": "npm run update-main-to-src" | ||
}, | ||
"license": "MIT", | ||
@@ -26,5 +12,11 @@ "repository": { | ||
"dependencies": { | ||
"@atproto/lexicon": "*", | ||
"zod": "^3.21.4" | ||
} | ||
} | ||
"zod": "^3.21.4", | ||
"@atproto/lexicon": "^0.2.1" | ||
}, | ||
"scripts": { | ||
"build": "node ./build.js", | ||
"postbuild": "tsc --build tsconfig.build.json", | ||
"update-main-to-dist": "node ../../update-main-to-dist.js packages/xrpc" | ||
}, | ||
"types": "dist/index.d.ts" | ||
} |
@@ -17,3 +17,3 @@ # XRPC API | ||
type: 'params', | ||
properties: {message: { type: 'string' }} | ||
properties: { message: { type: 'string' } }, | ||
}, | ||
@@ -25,5 +25,5 @@ output: { | ||
required: ['message'], | ||
properties: {message: { type: 'string' }}, | ||
properties: { message: { type: 'string' } }, | ||
}, | ||
} | ||
}, | ||
}, | ||
@@ -33,6 +33,10 @@ }, | ||
const res1 = await xrpc.call('https://example.com', 'io.example.ping', {message: 'hello world'}) | ||
const res1 = await xrpc.call('https://example.com', 'io.example.ping', { | ||
message: 'hello world', | ||
}) | ||
res1.encoding // => 'application/json' | ||
res1.body // => {message: 'hello world'} | ||
const res2 = await xrpc.service('https://example.com').call('io.example.ping', {message: 'hello world'}) | ||
const res2 = await xrpc | ||
.service('https://example.com') | ||
.call('io.example.ping', { message: 'hello world' }) | ||
res2.encoding // => 'application/json' | ||
@@ -50,6 +54,6 @@ res2.body // => {message: 'hello world'} | ||
type: 'params', | ||
properties: {fileName: { type: 'string' }}, | ||
properties: { fileName: { type: 'string' } }, | ||
}, | ||
input: { | ||
encoding: 'application/json' | ||
encoding: 'application/json', | ||
}, | ||
@@ -60,8 +64,7 @@ }, | ||
const res3 = await xrpc | ||
.service('https://example.com') | ||
.call('io.example.writeJsonFile', | ||
{fileName: 'foo.json'}, // query parameters | ||
{hello: 'world', thisIs: 'the file to write'} // input body | ||
) | ||
const res3 = await xrpc.service('https://example.com').call( | ||
'io.example.writeJsonFile', | ||
{ fileName: 'foo.json' }, // query parameters | ||
{ hello: 'world', thisIs: 'the file to write' }, // input body | ||
) | ||
``` | ||
@@ -68,0 +71,0 @@ |
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["**/*.spec.ts", "**/*.test.ts"] | ||
} | ||
} |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"include": ["./src","__tests__/**/**.ts"], | ||
"include": ["./src", "__tests__/**/**.ts"], | ||
"references": [ | ||
@@ -14,2 +14,2 @@ { "path": "../common/tsconfig.build.json" }, | ||
] | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
0
70
1986308
18
15864
+ Added@atproto/common-web@0.2.4(transitive)
+ Added@atproto/lexicon@0.2.3(transitive)
+ Added@atproto/syntax@0.1.5(transitive)
- Removed@atproto/common-web@0.3.1(transitive)
- Removed@atproto/lexicon@0.4.3(transitive)
- Removed@atproto/syntax@0.3.1(transitive)
Updated@atproto/lexicon@^0.2.1