Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atproto/xrpc

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atproto/xrpc - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

2

dist/util.d.ts

@@ -5,3 +5,3 @@ import { LexXrpcProcedure, LexXrpcQuery } from '@atproto/lexicon';

export declare function constructMethodCallUri(nsid: string, schema: LexXrpcProcedure | LexXrpcQuery, serviceUri: URL, params?: QueryParams): string;
export declare function encodeQueryParam(type: 'string' | 'number' | 'integer' | 'boolean' | 'datetime' | 'array' | 'unknown', value: any): string;
export declare function encodeQueryParam(type: 'string' | 'float' | 'integer' | 'boolean' | 'datetime' | 'array' | 'unknown', value: any): string;
export declare function constructMethodCallHeaders(schema: LexXrpcProcedure | LexXrpcQuery, data?: any, opts?: CallOptions): Headers;

@@ -8,0 +8,0 @@ export declare function encodeMethodCallBody(headers: Headers, data?: any): ArrayBuffer | undefined;

{
"name": "@atproto/xrpc",
"version": "0.0.4",
"version": "0.1.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -1,3 +0,8 @@

import { LexXrpcProcedure, LexXrpcQuery } from '@atproto/lexicon'
import {
jsonStringToLex,
LexXrpcProcedure,
LexXrpcQuery,
stringifyLex,
} from '@atproto/lexicon'
import {
CallOptions,

@@ -57,3 +62,3 @@ Headers,

| 'string'
| 'number'
| 'float'
| 'integer'

@@ -69,3 +74,3 @@ | 'boolean'

}
if (type === 'number') {
if (type === 'float') {
return String(Number(value))

@@ -118,3 +123,3 @@ } else if (type === 'integer') {

if (headers['Content-Type'].startsWith('application/json')) {
return new TextEncoder().encode(JSON.stringify(data))
return new TextEncoder().encode(stringifyLex(data))
}

@@ -150,3 +155,3 @@ return data

const str = new TextDecoder().decode(data)
return JSON.parse(str)
return jsonStringToLex(str)
} catch (e) {

@@ -170,3 +175,6 @@ throw new XRPCError(

}
if (data instanceof ArrayBuffer) {
return new Uint8Array(data)
}
return data
}

@@ -10,4 +10,5 @@ {

"references": [
{ "path": "../common/tsconfig.build.json" },
{ "path": "../lexicon/tsconfig.build.json" }
]
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc