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

@atproto/xrpc

Package Overview
Dependencies
Maintainers
2
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.1 to 0.0.2

7

dist/src/types.d.ts
import { z } from 'zod';
import { ValidationError } from '@atproto/lexicon';
export declare type QueryParams = Record<string, any>;

@@ -83,1 +84,7 @@ export declare type Headers = Record<string, string>;

}
export declare class XRPCInvalidResponseError extends XRPCError {
lexiconNsid: string;
validationError: ValidationError;
responseBody: unknown;
constructor(lexiconNsid: string, validationError: ValidationError, responseBody: unknown);
}

2

package.json
{
"name": "@atproto/xrpc",
"version": "0.0.1",
"version": "0.0.2",
"main": "src/index.ts",

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

@@ -1,2 +0,2 @@

import { Lexicons } from '@atproto/lexicon'
import { Lexicons, ValidationError } from '@atproto/lexicon'
import {

@@ -21,2 +21,3 @@ getMethodSchemaHTTPMethod,

XRPCError,
XRPCInvalidResponseError,
} from './types'

@@ -113,2 +114,11 @@

if (resCode === ResponseType.Success) {
try {
this.baseClient.lex.assertValidXrpcOutput(methodNsid, res.body)
} catch (e: any) {
if (e instanceof ValidationError) {
throw new XRPCInvalidResponseError(methodNsid, e, res.body)
} else {
throw e
}
}
return new XRPCResponse(res.body, res.headers)

@@ -115,0 +125,0 @@ } else {

import { z } from 'zod'
import { ValidationError } from '@atproto/lexicon'

@@ -99,1 +100,15 @@ export type QueryParams = Record<string, any>

}
export class XRPCInvalidResponseError extends XRPCError {
constructor(
public lexiconNsid: string,
public validationError: ValidationError,
public responseBody: unknown,
) {
super(
ResponseType.InvalidResponse,
ResponseTypeStrings[ResponseType.InvalidResponse],
`The server gave an invalid response and may be out of date.`,
)
}
}

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