UNPKG

@sickrin/openalex-sdk

Version:

A TypeScript SDK for interacting with the OpenAlex API - forked and enhanced version

498 lines 18.3 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CountsByYear = exports.ConceptWork = exports.Biblio = exports.Source = exports.LocationOpenAlex = exports.ApcPayment = exports.Institution = exports.Author = exports.Authorship = exports.Work = void 0; const typeorm_1 = require("typeorm"); let Work = class Work { }; exports.Work = Work; __decorate([ (0, typeorm_1.PrimaryColumn)(), __metadata("design:type", String) ], Work.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Object) ], Work.prototype, "abstract_inverted_index", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Object) ], Work.prototype, "alternate_host_venues", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => Authorship, (authorship) => authorship.work), __metadata("design:type", Array) ], Work.prototype, "authorships", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => ApcPayment), (0, typeorm_1.JoinColumn)(), __metadata("design:type", ApcPayment) ], Work.prototype, "apc_list", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => ApcPayment), (0, typeorm_1.JoinColumn)(), __metadata("design:type", ApcPayment) ], Work.prototype, "apc_paid", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => LocationOpenAlex), (0, typeorm_1.JoinColumn)(), __metadata("design:type", LocationOpenAlex) ], Work.prototype, "best_oa_location", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => Biblio), (0, typeorm_1.JoinColumn)(), __metadata("design:type", Biblio) ], Work.prototype, "biblio", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "cited_by_api_url", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "cited_by_count", void 0); __decorate([ (0, typeorm_1.ManyToMany)(() => ConceptWork), (0, typeorm_1.JoinTable)(), __metadata("design:type", Array) ], Work.prototype, "concepts", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Work.prototype, "corresponding_author_ids", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Work.prototype, "corresponding_institution_ids", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "countries_distinct_count", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => CountsByYear, (count) => count.year), __metadata("design:type", Array) ], Work.prototype, "counts_by_year", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "created_date", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "display_name", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "doi", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "fulltext_origin", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Object) ], Work.prototype, "grants", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], Work.prototype, "has_fulltext", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => LocationOpenAlex), (0, typeorm_1.JoinColumn)(), __metadata("design:type", LocationOpenAlex) ], Work.prototype, "host_venue", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Object) ], Work.prototype, "ids", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "institutions_distinct_count", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], Work.prototype, "is_paratext", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], Work.prototype, "is_retracted", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Array) ], Work.prototype, "keywords", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "language", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "license", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => LocationOpenAlex, (location) => location.work), __metadata("design:type", Array) ], Work.prototype, "locations", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "locations_count", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Object) ], Work.prototype, "mesh", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "ngrams_url", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Object) ], Work.prototype, "open_access", void 0); __decorate([ (0, typeorm_1.OneToOne)(() => LocationOpenAlex), (0, typeorm_1.JoinColumn)(), __metadata("design:type", LocationOpenAlex) ], Work.prototype, "primary_location", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "publication_date", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "publication_year", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Work.prototype, "referenced_works", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Work.prototype, "related_works", void 0); __decorate([ (0, typeorm_1.Column)('simple-json', { nullable: true }), __metadata("design:type", Array) ], Work.prototype, "sustainable_development_goals", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "title", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "type", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "type_crossref", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "updated_date", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Work.prototype, "ngrams", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "ngram_count", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "ngram_tokens", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], Work.prototype, "term_frequency", void 0); exports.Work = Work = __decorate([ (0, typeorm_1.Entity)() ], Work); let Authorship = class Authorship { }; exports.Authorship = Authorship; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)(), __metadata("design:type", String) ], Authorship.prototype, "id", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => Author, (author) => author.authorships), __metadata("design:type", Author) ], Authorship.prototype, "author", void 0); __decorate([ (0, typeorm_1.Column)({ enum: ['first', 'last', 'middle'], nullable: true }), __metadata("design:type", String) ], Authorship.prototype, "author_position", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Authorship.prototype, "countries", void 0); __decorate([ (0, typeorm_1.ManyToMany)(() => Institution), (0, typeorm_1.JoinTable)(), __metadata("design:type", Array) ], Authorship.prototype, "institutions", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], Authorship.prototype, "is_corresponding", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Authorship.prototype, "raw_affiliation_string", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Authorship.prototype, "raw_author_name", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => Work, (work) => work.authorships), __metadata("design:type", Work) ], Authorship.prototype, "work", void 0); exports.Authorship = Authorship = __decorate([ (0, typeorm_1.Entity)() ], Authorship); let Author = class Author { }; exports.Author = Author; __decorate([ (0, typeorm_1.PrimaryColumn)(), __metadata("design:type", String) ], Author.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)(), __metadata("design:type", String) ], Author.prototype, "display_name", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Author.prototype, "orcid", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => Authorship, (authorship) => authorship.author), __metadata("design:type", Array) ], Author.prototype, "authorships", void 0); exports.Author = Author = __decorate([ (0, typeorm_1.Entity)() ], Author); let Institution = class Institution { }; exports.Institution = Institution; __decorate([ (0, typeorm_1.PrimaryColumn)(), __metadata("design:type", String) ], Institution.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Institution.prototype, "display_name", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Institution.prototype, "ror", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Institution.prototype, "country_code", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Institution.prototype, "type", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Institution.prototype, "lineage", void 0); exports.Institution = Institution = __decorate([ (0, typeorm_1.Entity)() ], Institution); let ApcPayment = class ApcPayment { }; exports.ApcPayment = ApcPayment; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)(), __metadata("design:type", String) ], ApcPayment.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], ApcPayment.prototype, "value", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], ApcPayment.prototype, "currency", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], ApcPayment.prototype, "provenance", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], ApcPayment.prototype, "value_usd", void 0); exports.ApcPayment = ApcPayment = __decorate([ (0, typeorm_1.Entity)() ], ApcPayment); let LocationOpenAlex = class LocationOpenAlex { }; exports.LocationOpenAlex = LocationOpenAlex; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)(), __metadata("design:type", String) ], LocationOpenAlex.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], LocationOpenAlex.prototype, "is_accepted", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], LocationOpenAlex.prototype, "is_oa", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Boolean) ], LocationOpenAlex.prototype, "is_published", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], LocationOpenAlex.prototype, "landing_page_url", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], LocationOpenAlex.prototype, "license", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => Source, (source) => source.locations), __metadata("design:type", Source) ], LocationOpenAlex.prototype, "source", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], LocationOpenAlex.prototype, "pdf_url", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], LocationOpenAlex.prototype, "version", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => Work, (work) => work.locations), __metadata("design:type", Work) ], LocationOpenAlex.prototype, "work", void 0); exports.LocationOpenAlex = LocationOpenAlex = __decorate([ (0, typeorm_1.Entity)() ], LocationOpenAlex); let Source = class Source { }; exports.Source = Source; __decorate([ (0, typeorm_1.PrimaryColumn)(), __metadata("design:type", String) ], Source.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Source.prototype, "display_name", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Source.prototype, "issn_l", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'simple-array', nullable: true }), __metadata("design:type", Array) ], Source.prototype, "issn", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Source.prototype, "host_organization", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Source.prototype, "type", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => LocationOpenAlex, (location) => location.source), __metadata("design:type", Array) ], Source.prototype, "locations", void 0); exports.Source = Source = __decorate([ (0, typeorm_1.Entity)() ], Source); let Biblio = class Biblio { }; exports.Biblio = Biblio; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)(), __metadata("design:type", String) ], Biblio.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Biblio.prototype, "volume", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Biblio.prototype, "issue", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Biblio.prototype, "first_page", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], Biblio.prototype, "last_page", void 0); exports.Biblio = Biblio = __decorate([ (0, typeorm_1.Entity)() ], Biblio); let ConceptWork = class ConceptWork { }; exports.ConceptWork = ConceptWork; __decorate([ (0, typeorm_1.PrimaryColumn)(), __metadata("design:type", String) ], ConceptWork.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], ConceptWork.prototype, "wikidata", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", String) ], ConceptWork.prototype, "display_name", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], ConceptWork.prototype, "level", void 0); __decorate([ (0, typeorm_1.Column)({ nullable: true }), __metadata("design:type", Number) ], ConceptWork.prototype, "score", void 0); __decorate([ (0, typeorm_1.ManyToMany)(() => Work), __metadata("design:type", Array) ], ConceptWork.prototype, "works", void 0); exports.ConceptWork = ConceptWork = __decorate([ (0, typeorm_1.Entity)() ], ConceptWork); let CountsByYear = class CountsByYear { }; exports.CountsByYear = CountsByYear; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)(), __metadata("design:type", String) ], CountsByYear.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)(), __metadata("design:type", Number) ], CountsByYear.prototype, "year", void 0); __decorate([ (0, typeorm_1.Column)(), __metadata("design:type", Number) ], CountsByYear.prototype, "count", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => Work, (work) => work.counts_by_year), __metadata("design:type", Work) ], CountsByYear.prototype, "work", void 0); exports.CountsByYear = CountsByYear = __decorate([ (0, typeorm_1.Entity)() ], CountsByYear); //# sourceMappingURL=work.js.map