GithubHelp home page GithubHelp logo

wassim-k / sp-entity Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 306 KB

Generate strongly-typed models from SharePoint lists in TypeScript

License: MIT License

TypeScript 96.09% HTML 1.63% JavaScript 2.28%
entity framework list model office365 paging sharepoint spfx typescript

sp-entity's People

Contributors

dependabot[bot] avatar wassim-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wassim-ss nzerr

sp-entity's Issues

Inconsistent names when using language with diacritics

When performing the REST api requests, the response returns the default language that is configured on the SharePoint site.
In some languages, diacritics prevent to generate a correct name for the entity fields.

For instance, on a site French, "Créé" results in "cr", "Modifié Par" results in "modifiPar" etc.

I think there are 2 options :

  • Either use the internal name of the field to generate the entities

  • Or remove the diacritics, here is a suggestion on how to do it (in TextUtil.ts)

public static camelCase(text: string): string {

        text = this.removeDiacritics(text);
        text = this.removeNonWordChars(text);
        return camelCase(text);
    }

    public static removeDiacritics(text: string): string {

        return text.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
    }

Support company proxy

The CLI tool does not support company proxy, thus it blocks all requests made to SharePoint API.

A suggestion would be to implement a custom implementation of NodeFetchClient by retrieving the proxy settings from the environment then use an http proxy agent. The may are better options though.

This would be something like :

export class NodeFetchClientWithProxy extends NodeFetchClient {
    constructor(parameters: IAuthOptions) {
        super(parameters);
    }

    public fetch(url: string, options: FetchOptions): Promise<any> {

        const optionsWithProxyAgent: any = options;

        if (process.env.HTTPS_PROXY || process.env.HTTP_PROXY) {
            optionsWithProxyAgent.agent = new ProxyAgent(process.env.HTTPS_PROXY || process.env.HTTP_PROXY);
        }

        return super.fetch(url, optionsWithProxyAgent || options);
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.