@logilab/cwclientlibjs
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -0,1 +1,3 @@ | ||
import { Schema, EntitySchema } from './providers'; | ||
export declare function applySchema(jsonEntity: any): EntitySchema; | ||
/** | ||
@@ -32,2 +34,6 @@ * Interface for an http response | ||
/** | ||
* The base URL to the CubicWeb instance | ||
*/ | ||
readonly baseUrl: string; | ||
/** | ||
* Executes an HTTP request | ||
@@ -40,3 +46,3 @@ * @param path The path and query string | ||
*/ | ||
request(path: string, method: string, content: any, contentType: string, accept: string): Promise<HttpResponse>; | ||
request(path: string, method: string, content: any, contentType: string | null, accept: string): Promise<HttpResponse>; | ||
} | ||
@@ -73,3 +79,3 @@ /** | ||
hasCookies(): boolean; | ||
request(path: string, method: string, content: any, contentType: string, accept: string): Promise<HttpResponse>; | ||
request(path: string, method: string, content: any, contentType: string | null, accept: string): Promise<HttpResponse>; | ||
/** | ||
@@ -218,2 +224,10 @@ * Performs login onto the associated cubicweb instance | ||
/** | ||
* Fetch the cubicweb schema from a server supporting cubicweb_rqlcontroller | ||
*/ | ||
getSchema(): Promise<Schema>; | ||
/** | ||
* Fetch the cubicweb schema hash from a server supporting cubicweb_rqlcontroller | ||
*/ | ||
getSchemaHash(): Promise<string | null>; | ||
/** | ||
* Executes RQL queries in a transaction through RQL/IO v1.0 | ||
@@ -252,2 +266,4 @@ * @param queries The queries | ||
}): Promise<RqlSolutions>; | ||
getSchema(): Promise<Schema>; | ||
getSchemaHash(): Promise<string | null>; | ||
queryAndTransform(query: string, params: { | ||
@@ -254,0 +270,0 @@ [key: string]: any; |
@@ -76,2 +76,17 @@ import { RqlClient } from './client'; | ||
/** | ||
* Gets the cardinality for its string representation | ||
* @param c The string representation | ||
*/ | ||
export declare function getCardinality(c: string): EntityRelationSchemaCardinality; | ||
/** | ||
* Gets the cardinality for the 'from' end of a relation | ||
* @param cardString The cardinality string for the relation | ||
*/ | ||
export declare function getFromCardinality(cardString: string | undefined | null): EntityRelationSchemaCardinality; | ||
/** | ||
* Gets the cardinality for the 'to' end of a relation | ||
* @param cardString The cardinality string for the relation | ||
*/ | ||
export declare function getToCardinality(cardString: string | undefined | null): EntityRelationSchemaCardinality; | ||
/** | ||
* The schema of an attribute | ||
@@ -176,2 +191,3 @@ */ | ||
load(): Promise<Schema>; | ||
getSchemaHash(): Promise<string | null>; | ||
} | ||
@@ -191,2 +207,6 @@ /** | ||
/** | ||
* The key to the storage for the schema hash | ||
*/ | ||
private readonly hashStorageKey; | ||
/** | ||
* A validation function to check whether the cached schema is still usable | ||
@@ -206,3 +226,7 @@ */ | ||
*/ | ||
constructor(inner: EntitySchemasLoader, storageKey: string, isCacheUsable?: (schema: Schema) => Promise<boolean>, onRetrieved?: (schema: Schema) => Promise<Schema>); | ||
/** | ||
* Promise used to fetch the most recent schema hash from the server | ||
*/ | ||
readonly getSchemaHash: () => Promise<string | null>; | ||
constructor(inner: EntitySchemasLoader, storageKey: string, hashStorageKey?: string | null, isCacheUsable?: (schema: Schema) => Promise<boolean>, onRetrieved?: (schema: Schema) => Promise<Schema>); | ||
load(): Promise<Schema>; | ||
@@ -227,11 +251,3 @@ /** | ||
load(): Promise<Schema>; | ||
/** | ||
* Loads the content of an entity schema | ||
* @param typeNames The rows for type names and eids | ||
* @param specializes The rows for the specializes | ||
* @param attributeNames The rows for attributes | ||
* @param relationsTo The rows for relations in which the entity is a subject | ||
* @param relationsFrom The rows for relations in which the entity is an object | ||
*/ | ||
private loadEntitySchema; | ||
getSchemaHash(): Promise<string | null>; | ||
} | ||
@@ -270,3 +286,3 @@ /** | ||
*/ | ||
load(): Promise<{}>; | ||
load(): Promise<Schema>; | ||
private closeRelations; | ||
@@ -296,4 +312,5 @@ getAllRelationsFor(typeEid: number): { | ||
*/ | ||
constructor(rqlClient: RqlClient, storageKey?: string, isCacheUsable?: (schema: Schema) => Promise<boolean>, onRetrieved?: (schema: Schema) => Promise<Schema>); | ||
constructor(rqlClient: RqlClient, storageKey?: string, hashStorageKey?: string | null, isCacheUsable?: (schema: Schema) => Promise<boolean>, onRetrieved?: (schema: Schema) => Promise<Schema>); | ||
getEntitySchemaFor(eid: number): Promise<EntitySchema | null>; | ||
getSchemaHash(): Promise<string | null>; | ||
} | ||
@@ -300,0 +317,0 @@ /** |
{ | ||
"name": "@logilab/cwclientlibjs", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "client library for CubicWeb's rqlcontroller API", | ||
@@ -55,2 +55,3 @@ "homepage": "https://forge.extranet.logilab.fr/open-source/cwclientlibjs", | ||
"build": "webpack --mode=development", | ||
"build:watch": "webpack --watch --mode=development", | ||
"test": "mocha --reporter spec --require ts-node/register src/**/*.spec.ts", | ||
@@ -57,0 +58,0 @@ "lint": "tsc --noEmit && eslint --ext .tsx,.ts,.js,.jsx src", |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1929851
2635
228
8