@peculiar/asn1-schema
Advanced tools
Comparing version 1.1.2 to 2.0.1
@@ -5,5 +5,6 @@ import { AsnPropTypes, AsnTypeTypes } from "./enums"; | ||
type: AsnTypeTypes; | ||
itemType?: AsnPropTypes | IEmptyConstructor<any>; | ||
} | ||
export declare type AsnRepeatTypeString = "sequence" | "set"; | ||
export declare type AsnRepeatType = boolean | AsnRepeatTypeString; | ||
export declare type AsnRepeatType = AsnRepeatTypeString; | ||
interface IAsn1PropOptions { | ||
@@ -10,0 +11,0 @@ type: AsnPropTypes | IEmptyConstructor<any>; |
@@ -13,29 +13,29 @@ /** | ||
export declare enum AsnPropTypes { | ||
Any = 0, | ||
Boolean = 1, | ||
OctetString = 2, | ||
BitString = 3, | ||
Integer = 4, | ||
Enumerated = 5, | ||
ObjectIdentifier = 6, | ||
Utf8String = 7, | ||
BmpString = 8, | ||
UniversalString = 9, | ||
NumericString = 10, | ||
PrintableString = 11, | ||
TeletexString = 12, | ||
VideotexString = 13, | ||
IA5String = 14, | ||
GraphicString = 15, | ||
VisibleString = 16, | ||
GeneralString = 17, | ||
CharacterString = 18, | ||
UTCTime = 19, | ||
GeneralizedTime = 20, | ||
DATE = 21, | ||
TimeOfDay = 22, | ||
DateTime = 23, | ||
Duration = 24, | ||
TIME = 25, | ||
Null = 26 | ||
Any = 1, | ||
Boolean = 2, | ||
OctetString = 3, | ||
BitString = 4, | ||
Integer = 5, | ||
Enumerated = 6, | ||
ObjectIdentifier = 7, | ||
Utf8String = 8, | ||
BmpString = 9, | ||
UniversalString = 10, | ||
NumericString = 11, | ||
PrintableString = 12, | ||
TeletexString = 13, | ||
VideotexString = 14, | ||
IA5String = 15, | ||
GraphicString = 16, | ||
VisibleString = 17, | ||
GeneralString = 18, | ||
CharacterString = 19, | ||
UTCTime = 20, | ||
GeneralizedTime = 21, | ||
DATE = 22, | ||
TimeOfDay = 23, | ||
DateTime = 24, | ||
Duration = 25, | ||
TIME = 26, | ||
Null = 27 | ||
} |
import { IAsnConvertible } from "./types"; | ||
export declare function isConvertible(target: any): target is IAsnConvertible<any>; | ||
export declare function isTypeOfArray(target: any): target is typeof Array; | ||
export declare function isArrayEqual(bytes1: ArrayBuffer, bytes2: ArrayBuffer): boolean; |
export * from "./converters"; | ||
export * from "./types/index"; | ||
export { AsnProp, AsnType } from "./decorators"; | ||
@@ -7,2 +8,4 @@ export { AsnTypeTypes, AsnPropTypes } from "./enums"; | ||
export { IAsnConverter, IAsnConvertible } from "./types"; | ||
export * as errors from "./errors"; | ||
export * from "./errors"; | ||
export * from "./objects"; | ||
export * from "./convert"; |
@@ -0,1 +1,2 @@ | ||
import * as asn1 from "asn1js"; | ||
import { AsnRepeatType } from "./decorators"; | ||
@@ -15,2 +16,3 @@ import { AsnPropTypes, AsnTypeTypes } from "./enums"; | ||
type: AsnTypeTypes; | ||
itemType: AsnPropTypes | IEmptyConstructor<any>; | ||
items: { | ||
@@ -22,3 +24,3 @@ [key: string]: IAsnSchemaItem; | ||
export declare class AsnSchemaStorage { | ||
protected items: Map<object, IAsnSchema>; | ||
protected items: WeakMap<object, IAsnSchema>; | ||
has(target: object): boolean; | ||
@@ -28,5 +30,5 @@ get(target: object): IAsnSchema; | ||
createDefault(target: object): IAsnSchema; | ||
create(target: object, useNames: boolean): any; | ||
create(target: object, useNames: boolean): asn1.Sequence | asn1.Set | asn1.Choice; | ||
set(target: object, schema: IAsnSchema): this; | ||
protected findParentSchema(target: object): IAsnSchema | null; | ||
} |
@@ -15,2 +15,3 @@ /** | ||
static toASN(obj: any): any; | ||
private static toAsnItem; | ||
} |
/** | ||
* ASN1 type | ||
*/ | ||
import * as asn1 from "asn1js"; | ||
export interface IEmptyConstructor<T> { | ||
@@ -30,2 +31,3 @@ new (): T; | ||
toASN(): T; | ||
toSchema(name: string): asn1.BaseBlock<asn1.LocalValueBlock>; | ||
} |
105
package.json
{ | ||
"name": "@peculiar/asn1-schema", | ||
"version": "1.1.2", | ||
"description": "This package uses ES2015 decorators to simplify working with ASN.1 creation and parsing", | ||
"main": "build/index.js", | ||
"module": "build/index.es.js", | ||
"types": "build/types/index.d.ts", | ||
"scripts": { | ||
"test": "mocha", | ||
"prepare": "npm run build", | ||
"build": "npm run build:module && npm run build:types", | ||
"build:module": "rollup -c", | ||
"build:types": "tsc -p tsconfig.types.json", | ||
"clear": "rimraf build/*", | ||
"rebuild": "npm run clear && npm run build", | ||
"lint": "tslint -p .", | ||
"lint:fix": "tslint --fix -p .", | ||
"tsc": "tsc --noEmit", | ||
"prepub": "npm run lint && npm run test && npm run tsc", | ||
"pub": "npm version patch && npm publish --access=public && git push", | ||
"coverage": "nyc npm test", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls" | ||
"version": "2.0.1", | ||
"description": "Decorators for ASN.1 schemas building", | ||
"files": [ | ||
"build", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/PeculiarVentures/asn1-schema/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/PeculiarVentures/asn1-schema.git" | ||
}, | ||
"homepage": "https://github.com/PeculiarVentures/asn1-schema/tree/master/packages/schema#readme", | ||
"keywords": [ | ||
@@ -35,3 +21,26 @@ "asn", | ||
], | ||
"license": "MIT", | ||
"author": "PeculiarVentures, Inc", | ||
"main": "build/cjs/index.js", | ||
"module": "build/es2015/index.js", | ||
"types": "build/types/index.d.ts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"test": "mocha", | ||
"clear": "rimraf build", | ||
"build": "npm run build:module && npm run build:types", | ||
"build:module": "npm run build:cjs && npm run build:es2015", | ||
"build:cjs": "tsc -p tsconfig.compile.json --removeComments --module commonjs --outDir build/cjs", | ||
"build:es2015": "tsc -p tsconfig.compile.json --removeComments --module ES2015 --outDir build/es2015", | ||
"prebuild:types": "rimraf build/types", | ||
"build:types": "tsc -p tsconfig.compile.json --outDir build/types --declaration --emitDeclarationOnly", | ||
"rebuild": "npm run clear && npm run build" | ||
}, | ||
"dependencies": { | ||
"asn1js": "^2.0.26", | ||
"pvtsutils": "^1.0.10", | ||
"tslib": "^1.11.1" | ||
}, | ||
"contributors": [ | ||
@@ -47,49 +56,3 @@ { | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/PeculiarVentures/asn1-schema/issues" | ||
}, | ||
"homepage": "https://github.com/PeculiarVentures/asn1-schema#readme", | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^10.17.19", | ||
"mocha": "^7.1.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.6.0", | ||
"rollup-plugin-typescript2": "^0.26.0", | ||
"ts-node": "^8.8.2", | ||
"typescript": "^3.8.3" | ||
}, | ||
"dependencies": { | ||
"asn1js": "^2.0.26", | ||
"tslib": "^1.11.1" | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"**/*.d.ts" | ||
], | ||
"reporter": [ | ||
"text-summary", | ||
"html" | ||
] | ||
}, | ||
"mocha": { | ||
"require": "ts-node/register", | ||
"extension": [ | ||
"ts" | ||
], | ||
"watch-files": [ | ||
"test/**/*.ts" | ||
] | ||
} | ||
"gitHead": "9785f62ff36780c91ff8d0e143ee8ffbdf953a97" | ||
} |
# `@peculiar/asn1-schema` | ||
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/asn1-schema/master/LICENSE.md) | ||
[![CircleCI](https://circleci.com/gh/PeculiarVentures/asn1-schema.svg?style=svg)](https://circleci.com/gh/PeculiarVentures/asn1-schema) | ||
[![Coverage Status](https://coveralls.io/repos/github/PeculiarVentures/asn1-schema/badge.svg?branch=master&t=ddJivl)](https://coveralls.io/github/PeculiarVentures/asn1-schema?branch=master) | ||
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/asn1-schema/master/packages/schema/LICENSE.md) | ||
[![npm version](https://badge.fury.io/js/%40peculiar%2Fasn1-schema.svg)](https://badge.fury.io/js/%40peculiar%2Fasn1-schema) | ||
@@ -109,5 +107,1 @@ | ||
``` | ||
## API | ||
Use [index.d.ts](index.d.ts) file |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
75268
0
54
1809
3
107
1
1
+ Addedpvtsutils@^1.0.10
+ Addedpvtsutils@1.3.5(transitive)
+ Addedtslib@2.8.0(transitive)