@contember/schema
Advanced tools
Comparing version 1.2.0-alpha.3 to 1.2.0-alpha.4
@@ -1,7 +0,7 @@ | ||
import Input from './schema/input'; | ||
import Model from './schema/model'; | ||
import Acl from './schema/acl'; | ||
import Validation from './schema/validation'; | ||
import Value from './schema/value'; | ||
import Result from './schema/result'; | ||
import { Input } from './schema/input'; | ||
import { Model } from './schema/model'; | ||
import { Acl } from './schema/acl'; | ||
import { Validation } from './schema/validation'; | ||
import { Value } from './schema/value'; | ||
import { Result } from './schema/result'; | ||
export * from './ProjectRole'; | ||
@@ -8,0 +8,0 @@ export * from './schema/json'; |
@@ -19,13 +19,13 @@ "use strict"; | ||
const input_1 = require("./schema/input"); | ||
exports.Input = input_1.default; | ||
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return input_1.Input; } }); | ||
const model_1 = require("./schema/model"); | ||
exports.Model = model_1.default; | ||
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return model_1.Model; } }); | ||
const acl_1 = require("./schema/acl"); | ||
exports.Acl = acl_1.default; | ||
Object.defineProperty(exports, "Acl", { enumerable: true, get: function () { return acl_1.Acl; } }); | ||
const validation_1 = require("./schema/validation"); | ||
exports.Validation = validation_1.default; | ||
Object.defineProperty(exports, "Validation", { enumerable: true, get: function () { return validation_1.Validation; } }); | ||
const result_1 = require("./schema/result"); | ||
exports.Result = result_1.default; | ||
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return result_1.Result; } }); | ||
__exportStar(require("./ProjectRole"), exports); | ||
__exportStar(require("./schema/json"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
import Input from './input'; | ||
import { Input } from './input'; | ||
import { JSONValue } from './json'; | ||
declare namespace Acl { | ||
export declare namespace Acl { | ||
enum VariableType { | ||
@@ -22,10 +22,2 @@ entity = "entity", | ||
}; | ||
type VariableValue = readonly JSONValue[]; | ||
type VariableMapEntry = { | ||
readonly definition: Variable; | ||
readonly value: VariableValue; | ||
}; | ||
type VariablesMap = { | ||
readonly [name: string]: VariableMapEntry; | ||
}; | ||
type PredicateVariable = string; | ||
@@ -88,5 +80,9 @@ type PredicateDefinition<E = never> = Input.Where<PredicateVariable | Input.Condition | E>; | ||
readonly assumeIdentity?: boolean; | ||
readonly export?: boolean; | ||
readonly import?: boolean; | ||
}; | ||
type ContentPermissions = { | ||
readonly assumeMembership?: MembershipMatchRule; | ||
readonly export?: boolean; | ||
readonly import?: boolean; | ||
}; | ||
@@ -119,4 +115,14 @@ interface BaseRolePermissions { | ||
}; | ||
type VariablesMap = { | ||
readonly [name: string]: Input.Condition; | ||
}; | ||
interface MembershipVariable { | ||
readonly name: string; | ||
readonly values: readonly string[]; | ||
} | ||
interface Membership { | ||
readonly role: string; | ||
readonly variables: readonly MembershipVariable[]; | ||
} | ||
} | ||
export default Acl; | ||
//# sourceMappingURL=acl.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Acl = void 0; | ||
var Acl; | ||
@@ -27,4 +28,3 @@ (function (Acl) { | ||
})(SystemPermissionsLevel = Acl.SystemPermissionsLevel || (Acl.SystemPermissionsLevel = {})); | ||
})(Acl || (Acl = {})); | ||
exports.default = Acl; | ||
})(Acl = exports.Acl || (exports.Acl = {})); | ||
//# sourceMappingURL=acl.js.map |
@@ -1,3 +0,3 @@ | ||
import Value from './value'; | ||
declare namespace Input { | ||
import { Value } from './value'; | ||
export declare namespace Input { | ||
type PrimaryValue<E = never> = Value.PrimaryValue<E>; | ||
@@ -127,5 +127,5 @@ type ColumnValue<E = never> = Value.FieldValue<E>; | ||
readonly eq?: T; | ||
readonly notEq?: T; | ||
readonly null?: boolean; | ||
readonly isNull?: boolean; | ||
readonly notEq?: T; | ||
readonly in?: readonly T[]; | ||
@@ -164,3 +164,2 @@ readonly notIn?: readonly T[]; | ||
} | ||
export default Input; | ||
//# sourceMappingURL=input.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Input = void 0; | ||
var Input; | ||
@@ -31,4 +32,3 @@ (function (Input) { | ||
})(FieldMeta = Input.FieldMeta || (Input.FieldMeta = {})); | ||
})(Input || (Input = {})); | ||
exports.default = Input; | ||
})(Input = exports.Input || (exports.Input = {})); | ||
//# sourceMappingURL=input.js.map |
@@ -1,3 +0,3 @@ | ||
import Input from './input'; | ||
declare namespace Model { | ||
import { Input } from './input'; | ||
export declare namespace Model { | ||
type Entity = { | ||
@@ -12,2 +12,3 @@ readonly name: string; | ||
readonly unique: UniqueConstraints; | ||
readonly indexes: Indexes; | ||
readonly view?: View; | ||
@@ -162,4 +163,10 @@ readonly eventLog: EventLogConfig; | ||
}; | ||
type Indexes = { | ||
readonly [name: string]: Index; | ||
}; | ||
type Index = { | ||
readonly fields: readonly string[]; | ||
readonly name: string; | ||
}; | ||
} | ||
export default Model; | ||
//# sourceMappingURL=model.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Model = void 0; | ||
const input_1 = require("./input"); | ||
@@ -31,5 +32,4 @@ var Model; | ||
})(OnDelete = Model.OnDelete || (Model.OnDelete = {})); | ||
Model.OrderDirection = input_1.default.OrderDirection; | ||
})(Model || (Model = {})); | ||
exports.default = Model; | ||
Model.OrderDirection = input_1.Input.OrderDirection; | ||
})(Model = exports.Model || (exports.Model = {})); | ||
//# sourceMappingURL=model.js.map |
@@ -1,3 +0,3 @@ | ||
import Value from './value'; | ||
declare namespace Result { | ||
import { Value } from './value'; | ||
export declare namespace Result { | ||
type MutationFieldResult = CreateResult | UpdateResult | DeleteResult | UpsertResult; | ||
@@ -71,3 +71,2 @@ interface CreateResult { | ||
} | ||
export default Result; | ||
//# sourceMappingURL=result.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Result = void 0; | ||
var Result; | ||
@@ -15,4 +16,3 @@ (function (Result) { | ||
})(ExecutionErrorType = Result.ExecutionErrorType || (Result.ExecutionErrorType = {})); | ||
})(Result || (Result = {})); | ||
exports.default = Result; | ||
})(Result = exports.Result || (exports.Result = {})); | ||
//# sourceMappingURL=result.js.map |
import { JSONValue } from './json'; | ||
declare namespace Validation { | ||
export declare namespace Validation { | ||
type ContextPath = readonly string[]; | ||
@@ -59,3 +59,2 @@ enum ArgumentType { | ||
} | ||
export default Validation; | ||
//# sourceMappingURL=validation.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Validation = void 0; | ||
var Validation; | ||
@@ -11,4 +12,3 @@ (function (Validation) { | ||
})(ArgumentType = Validation.ArgumentType || (Validation.ArgumentType = {})); | ||
})(Validation || (Validation = {})); | ||
exports.default = Validation; | ||
})(Validation = exports.Validation || (exports.Validation = {})); | ||
//# sourceMappingURL=validation.js.map |
@@ -1,4 +0,4 @@ | ||
declare namespace Value { | ||
export declare namespace Value { | ||
type Object<E = never> = { | ||
readonly [key: string]: FieldValue<E>; | ||
readonly [K in string]?: FieldValue<E>; | ||
}; | ||
@@ -12,3 +12,2 @@ type List<E = never> = readonly FieldValue<E>[]; | ||
} | ||
export default Value; | ||
//# sourceMappingURL=value.d.ts.map |
{ | ||
"name": "@contember/schema", | ||
"version": "1.2.0-alpha.3", | ||
"version": "1.2.0-alpha.4", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -1,7 +0,7 @@ | ||
import Input from './schema/input' | ||
import Model from './schema/model' | ||
import Acl from './schema/acl' | ||
import Validation from './schema/validation' | ||
import Value from './schema/value' | ||
import Result from './schema/result' | ||
import { Input } from './schema/input' | ||
import { Model } from './schema/model' | ||
import { Acl } from './schema/acl' | ||
import { Validation } from './schema/validation' | ||
import { Value } from './schema/value' | ||
import { Result } from './schema/result' | ||
@@ -8,0 +8,0 @@ export * from './ProjectRole' |
@@ -1,5 +0,5 @@ | ||
import Input from './input' | ||
import { Input } from './input' | ||
import { JSONValue } from './json' | ||
namespace Acl { | ||
export namespace Acl { | ||
export enum VariableType { | ||
@@ -50,12 +50,2 @@ entity = 'entity', | ||
export type VariableValue = readonly JSONValue[] | ||
export type VariableMapEntry = { | ||
readonly definition: Variable | ||
readonly value: VariableValue | ||
} | ||
export type VariablesMap = { | ||
readonly [name: string]: VariableMapEntry | ||
} | ||
export type PredicateVariable = string //{ name: string } | ||
@@ -133,2 +123,4 @@ export type PredicateDefinition<E = never> = Input.Where<PredicateVariable | Input.Condition | E> | ||
readonly assumeIdentity?: boolean | ||
readonly export?: boolean | ||
readonly import?: boolean | ||
} | ||
@@ -138,2 +130,4 @@ | ||
readonly assumeMembership?: MembershipMatchRule | ||
readonly export?: boolean | ||
readonly import?: boolean | ||
} | ||
@@ -167,4 +161,16 @@ | ||
} | ||
export type VariablesMap = { | ||
readonly [name: string]: Input.Condition | ||
} | ||
export interface MembershipVariable { | ||
readonly name: string | ||
readonly values: readonly string[] | ||
} | ||
export interface Membership { | ||
readonly role: string | ||
readonly variables: readonly MembershipVariable[] | ||
} | ||
} | ||
export default Acl |
@@ -1,4 +0,4 @@ | ||
import Value from './value' | ||
import { Value } from './value' | ||
namespace Input { | ||
export namespace Input { | ||
export type PrimaryValue<E = never> = Value.PrimaryValue<E> | ||
@@ -160,5 +160,5 @@ export type ColumnValue<E = never> = Value.FieldValue<E> | ||
readonly eq?: T | ||
readonly notEq?: T | ||
readonly null?: boolean // deprecated | ||
readonly isNull?: boolean | ||
readonly notEq?: T | ||
readonly in?: readonly T[] | ||
@@ -203,3 +203,1 @@ readonly notIn?: readonly T[] | ||
} | ||
export default Input |
@@ -1,4 +0,4 @@ | ||
import Input from './input' | ||
import { Input } from './input' | ||
namespace Model { | ||
export namespace Model { | ||
@@ -12,2 +12,3 @@ export type Entity = { | ||
readonly unique: UniqueConstraints | ||
readonly indexes: Indexes | ||
readonly view?: View | ||
@@ -280,4 +281,11 @@ readonly eventLog: EventLogConfig | ||
} | ||
export type Indexes = { | ||
readonly [name: string]: Index | ||
} | ||
export type Index = { | ||
readonly fields: readonly string[] | ||
readonly name: string | ||
} | ||
} | ||
export default Model |
@@ -1,4 +0,4 @@ | ||
import Value from './value' | ||
import { Value } from './value' | ||
namespace Result { | ||
export namespace Result { | ||
export type MutationFieldResult = CreateResult | UpdateResult | DeleteResult | UpsertResult | ||
@@ -78,3 +78,1 @@ | ||
} | ||
export default Result |
import { JSONValue } from './json' | ||
namespace Validation { | ||
export namespace Validation { | ||
export type ContextPath = readonly string[] | ||
@@ -69,3 +69,1 @@ | ||
} | ||
export default Validation |
@@ -1,5 +0,3 @@ | ||
namespace Value { | ||
export type Object<E = never> = { | ||
readonly [key: string]: FieldValue<E> | ||
} | ||
export namespace Value { | ||
export type Object<E = never> = { readonly [K in string]?: FieldValue<E> } | ||
@@ -17,3 +15,1 @@ export type List<E = never> = readonly FieldValue<E>[] | ||
} | ||
export default Value |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
109484
1495