You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

furystack-core

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

furystack-core

FuryStack framework, Core package

1.0.0-alpha-8
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

furystack-core

Build Status codecov Codacy Badge

FuryStack framework, core package.

Model declaration with @PrimaryKey, @Property and @ForeignKey decorators:

class RefExample {
    @PrimaryKey
    public Id;

    @Property
    public Value: string;
}

class MyModel {
    @PrimaryKey
    public Id: number;

    @Property
    public MyPropertyA: string;

    @Property
    public MyPropertyB: string;

    @ForeignKey(RefExample, 'RefExample')
    public RefExampleId: number;
    public RefExample: RefExample;
}

Accessing model metadata via Global ModelDescriptorStore, usage:

const descriptor = ModelDescriptorStore.GetDescriptor(MyModel);
/*

descriptor.Object = {constructor: class MyModel { … }}

descriptor.Entries = [
  PrimaryKeyDescriptorEntry {PrimaryKey: "Id"}
  ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyA", EdmType: 0}
  ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyB", EdmType: 0}
  ForeignKeyDescriptorEntry {ForeignKeyField: "RefExample", ReferenceName: "RefExample"}
]

descriptor..PrimaryKey = PrimaryKeyDescriptorEntry {PrimaryKey: "Id"}

descriptor.Properties = [
  ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyA", EdmType: 0}
  ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyB", EdmType: 0}
]

descriptor.ForeignKeys = [
  ForeignKeyDescriptorEntry {ForeignKeyField: "RefExample", ReferenceName: "RefExample"}
]

*/

Setup and endpoint with the EndpointBuilder class:

    const builder = new EndpointBuilder('api');

    builder.EntityType(MyModel);
    builder.EntityType(RefExample);

    builder.EntitySet(MyModel, 'mymodels');

Keywords

FuryStack

FAQs

Package last updated on 29 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts