diff --git a/.travis.yml b/.travis.yml index e6ec9be..f4de93a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ env: - SENECA_VER=senecajs/seneca node_js: + - '13' - '12' - - '11' - '10' - '8' diff --git a/README.md b/README.md index 1cf8b10..2626294 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ +![Seneca](http://senecajs.org/files/assets/seneca-logo.png) + +> A [Seneca.js][] plugin for generic membership relations between entities. + # seneca-member +[![npm version][npm-badge]][npm-url] +[![Build Status][travis-badge]][travis-url] +[![Coverage Status][coveralls-badge]][coveralls-url] +[![Dependency Status][david-badge]][david-url] +[![Gitter][gitter-badge]][gitter-url] -[Seneca](senecajs.org) plugin for generic membership relations between entities. -[![Npm][BadgeNpm]][Npm] -[![Travis][BadgeTravis]][Travis] -[![Coveralls][BadgeCoveralls]][Coveralls] +NOTE: requires underlying entity store to support "value array" queries. ## Install @@ -74,101 +80,7 @@ Add parent and child entity types. #### Parameters -* _kinds_ : { type: 'object', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - dependencies: null, - keys: null, - patterns: [ [Object] ], - renames: null }, - '$_super': { default: [Function: bound default] } } +* _kinds_ : object ---------- @@ -180,570 +92,15 @@ Add child (id) to parent (id) under relationship `kind` (idempotent). #### Parameters -* _parent_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: - { presence: 'required', - description: 'Parent entity identifier.' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _child_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { description: 'Child entity identifier.' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _kind_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { presence: 'required' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _code_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _tags_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } -* _children_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: { description: 'Child entity identifiers (optional).' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } +* _parent_ : string {presence:required} + : Parent entity identifier. +* _child_ : string + : Child entity identifier. +* _kind_ : string {presence:required} +* _code_ : string +* _tags_ : array +* _children_ : array + : Child entity identifiers (optional). ---------- @@ -759,475 +116,6 @@ No description provided. No description provided. -#### Parameters - - -* _parent_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { presence: 'required' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _child_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { description: 'Child entity identifier.' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _kind_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _code_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _tags_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } - ---------- ### « `list:children,role:member` » @@ -1238,471 +126,11 @@ No description provided. #### Parameters -* _parent_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _child_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _kind_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _code_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _tags_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } +* _parent_ : string +* _child_ : string +* _kind_ : string +* _code_ : string +* _tags_ : array ---------- @@ -1714,471 +142,11 @@ No description provided. #### Parameters -* _parent_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _child_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _kind_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _code_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _tags_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } +* _parent_ : string +* _child_ : string +* _kind_ : string +* _code_ : string +* _tags_ : array ---------- @@ -2197,563 +165,14 @@ No description provided. #### Parameters -* _parent_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { description: 'Parent entity identifier.' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _child_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { description: 'Child entity identifier.' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _kind_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _code_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: null, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } -* _tags_ : { type: 'array', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [ { name: 'items', _resolve: [], method: 'items' } ], - _singleRules: - Map { 'items' => { name: 'items', _resolve: [], method: 'items' } }, - _refs: { refs: [] }, - _flags: {}, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - items: [ [Object] ], - ordered: [], - _exclusions: [], - _inclusions: [ [Object] ], - _requireds: [] }, - '$_super': {} } -* _id_ : { type: 'string', - '$_root': - { _types: - Set { - 'alternatives', - 'any', - 'array', - 'boolean', - 'date', - 'function', - 'link', - 'number', - 'object', - 'string', - 'symbol', - 'binary' }, - alternatives: [Function], - any: [Function], - array: [Function], - boolean: [Function], - date: [Function], - function: [Function], - link: [Function], - number: [Function], - object: [Function], - string: [Function], - symbol: [Function], - binary: [Function], - allow: [Function], - custom: [Function], - disallow: [Function], - equal: [Function], - exist: [Function], - forbidden: [Function], - invalid: [Function], - not: [Function], - only: [Function], - optional: [Function], - options: [Function], - prefs: [Function], - preferences: [Function], - required: [Function], - strip: [Function], - valid: [Function], - when: [Function], - ValidationError: [Function: Error], - version: '17.1.0', - cache: { provision: [Function: provision] }, - assert: [Function: assert], - attempt: [Function: attempt], - build: [Function: build], - checkPreferences: [Function: checkPreferences], - compile: [Function: compile], - defaults: [Function: defaults], - expression: [Function: expression], - extend: [Function: extend], - isError: [Function: isError], - isExpression: [Function: isTemplate], - isRef: [Function], - isSchema: [Function], - in: [Function: in], - override: Symbol(override), - ref: [Function: ref], - types: [Function: types], - alt: [Function], - bool: [Function], - func: [Function], - x: [Function: expression], - trace: [Function: trace], - untrace: [Function], - [Symbol(@hapi/lab/coverage/initialize)]: [Function: trace] }, - '$_temp': { ruleset: false, whens: {} }, - _ids: { _byId: Map {}, _byKey: Map {}, _schemaChain: false }, - _preferences: null, - _valids: null, - _invalids: null, - _rules: [], - _singleRules: Map {}, - _refs: { refs: [] }, - _flags: { presence: 'required' }, - _cache: null, - '$_terms': - { alterations: null, - examples: null, - externals: null, - metas: [], - notes: [], - shared: null, - tags: [], - whens: null, - replacements: null }, - '$_super': {} } +* _parent_ : string + : Parent entity identifier. +* _child_ : string + : Child entity identifier. +* _kind_ : string +* _code_ : string +* _tags_ : array +* _id_ : string {presence:required} ---------- @@ -2762,14 +181,22 @@ No description provided. -## Development -* Retain @hapi/joi@15 until seneca-joi is updated +## License +Copyright (c) 2019-2020, Richard Rodger and other contributors. +Licensed under [MIT][]. -[BadgeCoveralls]: https://coveralls.io/repos/voxgig/seneca-member/badge.svg?branch=master&service=github -[BadgeNpm]: https://badge.fury.io/js/seneca-member.svg -[BadgeTravis]: https://travis-ci.org/voxgig/seneca-member.svg?branch=master -[Coveralls]: https://coveralls.io/github/voxgig/seneca-member?branch=master -[Npm]: https://www.npmjs.com/package/seneca-member -[Travis]: https://travis-ci.org/voxgig/seneca-member?branch=master +[MIT]: ./LICENSE +[Seneca.js]: https://www.npmjs.com/package/seneca +[travis-badge]: https://travis-ci.org/senecajs/seneca-member.svg +[travis-url]: https://travis-ci.org/senecajs/seneca-member +[npm-badge]: https://img.shields.io/npm/v/@seneca/member.svg +[npm-url]: https://npmjs.com/package/@seneca/member +[david-badge]: https://david-dm.org/senecajs/seneca-member.svg +[david-url]: https://david-dm.org/senecajs/seneca-member +[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg +[gitter-url]: https://gitter.im/senecajs/seneca +[coveralls-badge]: https://coveralls.io/repos/github/senecajs/seneca-member/badge.svg?branch=master +[coveralls-url]: https://coveralls.io/github/senecajs/seneca-member?branch=master +[Senecajs org]: https://github.com/senecajs/ diff --git a/member.js b/member.js index 31fc823..da662f2 100644 --- a/member.js +++ b/member.js @@ -17,7 +17,12 @@ member.defaults = { kinds: {} } -function member(opts) { +member.errors = { + invalid_as: + 'Invalid member `as` value (<%=as%>), should be one of: child, parent, child-id, parent-id, member, member-id.' +} + +function member(options) { const seneca = this function define_patterns() { @@ -25,10 +30,7 @@ function member(opts) { .message('role:member,add:kinds', add_kinds) .message('role:member,get:kinds', get_kinds) .message('role:member,add:member', intern.make_multi(add_member)) - .message( - 'role:member,is:member', - intern.make_multi(is_member, intern.is_single_member) - ) + .message('role:member,is:member', is_member) .message( 'role:member,remove:member', intern.make_multi(remove_member, intern.is_single_remove) @@ -47,33 +49,13 @@ function member(opts) { } async function add_kinds(msg) { - opts.kinds = Object.assign(opts.kinds, msg.kinds) - return { kinds: opts.kinds } + options.kinds = Object.assign(options.kinds, msg.kinds) + return { kinds: options.kinds } } async function get_kinds(msg) { - return { kinds: opts.kinds } - } - - /* - async function add_member(msg, meta, ...rest) { - if(msg.child) { - return add_member_single.call(this, msg, meta, ...rest) - } - else if(msg.children) { - var members = [] - for(var cI = 0; cI < msg.children.length; cI++) { - var child_msg = {...msg, child:msg.children[cI], children: null} - members.push(await add_member_single.call(this, child_msg, meta, ...rest)) - } - return members - } - // else no action no result - else { - return null - } + return { kinds: options.kinds } } - */ // idemptotent async function add_member(msg) { @@ -117,27 +99,6 @@ function member(opts) { return member } - /* - async function is_member(msg, meta, ...rest) { - // NOTE: code could be a unique child for parent - if(msg.child || msg.code) { - return is_member_single.call(this, msg, meta, ...rest) - } - else if(msg.children) { - var members = [] - for(var cI = 0; cI < msg.children.length; cI++) { - var child_msg = {...msg, child:msg.children[cI], children: null} - members.push(await is_member_single.call(this, child_msg, meta, ...rest)) - } - return members - } - // else no action no result - else { - return null - } - } -*/ - async function is_member(msg) { const member_ent = this.entity('sys/member') @@ -146,8 +107,9 @@ function member(opts) { p: msg.parent } - if (msg.child) { - q.c = msg.child + var msg_children = intern.resolve_children(msg) + if (msg_children) { + q.c = msg_children } if (msg.kind) { @@ -158,14 +120,30 @@ function member(opts) { q.d = msg.code } - const member = await member_ent.load$(q) - var child = [] + var valid_query = null != q.c || null != q.d + + const members = valid_query ? await member_ent.list$(q) : [] + var children = [] + + var membership = {} + for (var mI = 0; mI < members.length; mI++) { + membership[members[mI].c] = true + } + + if (0 < members.length && 'child' === msg.as) { + children = await intern.load_items(seneca, options, members, msg, 'c') + } - if (member && 'child' === msg.as) { - child = await load_items(seneca, [member], msg, 'c') + var out = { + q: q, + member: members[0], + child: children[0], + members: members, + children: children, + membership: membership } - return { member: member, child: child[0], q: q } + return out } async function remove_member(msg) { @@ -278,40 +256,56 @@ function member(opts) { // Return referenced entities else if (prefix == msg.as) { - list = await load_items(seneca, list, msg, type) + list = await intern.load_items(seneca, options, list, msg, type) + } else { + seneca.fail('invalid_as', { as: msg.as }) } return { items: list } } - async function load_items(seneca, list, msg, type) { - const out = [] + return define_patterns() +} + +const intern = (module.exports.intern = { + load_items: async function(seneca, options, list, msg, type) { + var out = [] - for (var i = 0; i < list.length; i++) { - var kind = list[i].k - var canon = opts.kinds[kind][type] + if (0 < list.length) { + // assume list is all of same kind + var kind = list[0].k + var canon = options.kinds[kind][type] var ent = seneca.entity(canon) - var entid = list[i][type] - var q = { id: entid } + var q = { id: list.map(x => x[type]) } if (msg.fields) { q.fields$ = msg.fields } - var found = (await ent.list$(q))[0] - //var found = await ent.load$(q) - if (found) { - out.push(found) - } + out = await ent.list$(q) } return out - } + }, - return define_patterns() -} + resolve_children: function(msg) { + var children = null + + // children has precedence + if (msg.children) { + children = msg.children + } else if (msg.child) { + children = msg.child + } + + // always convert to list + if (null != children && !Array.isArray(children)) { + children = [children] + } + + return children + }, -const intern = (module.exports.intern = { make_multi: function(single_action, is_single) { var func = async function(msg, meta, ...rest) { if (msg.child || (is_single && is_single(msg))) { diff --git a/package-lock.json b/package-lock.json index d02da91..042d39a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "seneca-member", - "version": "0.5.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,12 +14,12 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.7.tgz", + "integrity": "sha512-DQwjiKJqH4C3qGiyQCAExJHoZssn49JTMJgZ8SANGgVFdkupcUhLOdkAeoC6kmHZCPfoDG5M0b6cFlSN5wW7Ew==", "dev": true, "requires": { - "@babel/types": "^7.8.3", + "@babel/types": "^7.8.7", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -74,43 +74,43 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.7.tgz", + "integrity": "sha512-9JWls8WilDXFGxs0phaXAZgpxTZhSk/yOYH2hTHC0X1yC7Z78IJfvR1vJ+rmJKq3I35td2XzXzN6ZLYlna+r/A==", "dev": true }, "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.6.tgz", + "integrity": "sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.6", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.7.tgz", + "integrity": "sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -186,9 +186,9 @@ "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==" }, "@hapi/hoek": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.2.tgz", - "integrity": "sha512-LyibKv2QnD9BPI5g2L+g85yiIPv3ajYpENGFgy4u0xCLPhXWG1Zdx29neSB8sgX0/wz6k5TMjHzTwJ6+DaBYOA==" + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.3.tgz", + "integrity": "sha512-jKtjLLDiH95b002sJVc5c74PE6KKYftuyVdVmsuYId5stTaWcRFqE+5ukZI4gDUKjGn8wv2C3zPn3/nyjEI7gg==" }, "@hapi/joi": { "version": "17.1.0", @@ -307,6 +307,12 @@ "fastq": "^1.6.0" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -331,27 +337,27 @@ "dev": true }, "@types/node": { - "version": "13.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.5.1.tgz", - "integrity": "sha512-Jj2W7VWQ2uM83f8Ls5ON9adxN98MvyJsMSASYFuSvrov8RMRY64Ayay7KV35ph1TSGIJ2gG9ZVDdEq3c3zaydA==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.0.tgz", + "integrity": "sha512-0ARSQootUG1RljH2HncpsY2TJBfGQIKOOi7kxzUY6z54ePu/ZD+wJA8zI2Q6v8rol2qpG/rvqsReco8zNMPvhQ==", "dev": true }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -361,12 +367,20 @@ } }, "ansi-escapes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", - "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } } }, "ansi-regex": { @@ -439,15 +453,15 @@ "dev": true }, "babel-eslint": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz", - "integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", "eslint-visitor-keys": "^1.0.0", "resolve": "^1.12.0" } @@ -613,9 +627,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.3.tgz", + "integrity": "sha512-+bMdgqjMN/Z77a6NlY/I3U5LlRDbnmaAk6lDveAPKwSpcPM4tKAuYsvYF8xjhOPXhOYGe/73vVLVez5PW+jqhw==", "dev": true } } @@ -772,9 +786,9 @@ }, "dependencies": { "globals": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", - "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { "type-fest": "^0.8.1" @@ -808,13 +822,13 @@ "dev": true }, "espree": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", - "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^7.1.0", - "acorn-jsx": "^5.1.0", + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.1.0" } }, @@ -825,9 +839,9 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", + "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", "dev": true, "requires": { "estraverse": "^4.0.0" @@ -884,16 +898,17 @@ "dev": true }, "fast-glob": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", - "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.0", "merge2": "^1.3.0", - "micromatch": "^4.0.2" + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" } }, "fast-json-stable-stringify": { @@ -915,18 +930,18 @@ "dev": true }, "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.1.tgz", + "integrity": "sha512-mpIH5sKYueh3YyeJwqtVo8sORi0CgtmkVbK6kZStpQlZBYQuTzG2CZ7idSiJuA7bY0SFCWUc5WIs+oYumGCQNw==", "dev": true, "requires": { - "reusify": "^1.0.0" + "reusify": "^1.0.4" } }, "figures": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", - "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -1077,9 +1092,9 @@ } }, "handlebars": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.2.tgz", - "integrity": "sha512-4PwqDL2laXtTWZghzzCtunQUTLbo31pcCJrd/B/9JP8XbhVzpS5ZXuKqlOzsd1rtcaLo4KqAn8nl8mkknS4MHw==", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.3.tgz", + "integrity": "sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -1177,24 +1192,70 @@ "dev": true }, "inquirer": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.4.tgz", - "integrity": "sha512-Bu5Td5+j11sCkqfqmUTiwv+tWisMtP0L7Q8WrqA2C/BbBhy1YTdFrvjjlrKq8oagA/tLQBski2Gcx/Sqyi2qSQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", - "chalk": "^2.4.2", + "chalk": "^3.0.0", "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.15", "mute-stream": "0.0.8", - "run-async": "^2.2.0", + "run-async": "^2.4.0", "rxjs": "^6.5.3", "string-width": "^4.1.0", - "strip-ansi": "^5.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "is-extglob": { @@ -1514,9 +1575,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.3.tgz", + "integrity": "sha512-+bMdgqjMN/Z77a6NlY/I3U5LlRDbnmaAk6lDveAPKwSpcPM4tKAuYsvYF8xjhOPXhOYGe/73vVLVez5PW+jqhw==", "dev": true } } @@ -1763,9 +1824,9 @@ "dev": true }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -1775,7 +1836,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -1785,15 +1846,15 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" } }, "resolve": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", - "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1837,9 +1898,9 @@ "dev": true }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", "dev": true, "requires": { "is-promise": "^2.1.0" @@ -1885,9 +1946,9 @@ "dev": true }, "seneca": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/seneca/-/seneca-3.20.0.tgz", - "integrity": "sha512-rt/D+1d0wbadLiF0Y2EHzaAysqJQmvJx7BUeOE4sA3ENtvT3fB2eMdSBuVSp7+HSHN2pLrvEQAVKFY+EOX8Dpw==", + "version": "3.20.1", + "resolved": "https://registry.npmjs.org/seneca/-/seneca-3.20.1.tgz", + "integrity": "sha512-ap3YcF6CF2gpOuCUx9EcbLBAmJhf7VqGLedPwli7MiOgZ5m1wprrsyBRcskL+kjohXia+mAQVs4rtIkPjxaV2w==", "dev": true, "requires": { "@hapi/joi": "^17.1.0", @@ -1911,9 +1972,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.3.tgz", + "integrity": "sha512-+bMdgqjMN/Z77a6NlY/I3U5LlRDbnmaAk6lDveAPKwSpcPM4tKAuYsvYF8xjhOPXhOYGe/73vVLVez5PW+jqhw==", "dev": true }, "qs": { @@ -1925,65 +1986,26 @@ } }, "seneca-doc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/seneca-doc/-/seneca-doc-2.0.1.tgz", - "integrity": "sha512-zgMzQRtiSWyWur+J4nbKBq9vLPKdeq5KNlwZk7yxXIqGQIdhoz1+ziHbhtbe0EEMAZL2oCurGxLzY1ukIIlxhw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/seneca-doc/-/seneca-doc-2.1.2.tgz", + "integrity": "sha512-ehCQviAHK4vptPqm8A6ItdZeDPHzrsq+C7sCBH8oJhDdNzY1AAWEs95KyEi61pC+W+FnWIzXLb+IFspmXGDmEw==", "dev": true, "requires": { - "seneca": "^3.20.0", + "@hapi/joi": "^17.1.0", + "seneca": "^3.20.1", "seneca-promisify": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "qs": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", - "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", - "dev": true - }, - "seneca": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/seneca/-/seneca-3.20.0.tgz", - "integrity": "sha512-rt/D+1d0wbadLiF0Y2EHzaAysqJQmvJx7BUeOE4sA3ENtvT3fB2eMdSBuVSp7+HSHN2pLrvEQAVKFY+EOX8Dpw==", - "dev": true, - "requires": { - "@hapi/joi": "^17.1.0", - "@hapi/wreck": "^17.0.0", - "eraro": "^2.1.0", - "fast-safe-stringify": "^2.0.7", - "gate-executor": "^2.1.0", - "gex": "^1.0.0", - "jsonic": "^0.3.1", - "lodash": "^4.17.15", - "minimist": "^1.2.0", - "nid": "^0.3.2", - "norma": "^2.0.2", - "optioner": "^5.0.0", - "ordu": "^0.1.1", - "patrun": "^3.0.0", - "qs": "^6.9.1", - "rolling-stats": "^0.1.1", - "seneca-transport": "^5.0.1", - "use-plugin": "^7.0.0" - } - } } }, "seneca-entity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/seneca-entity/-/seneca-entity-7.0.0.tgz", - "integrity": "sha512-WL0h/XYbY8DN9crEz3orO2MillJXhRUxIepnmSp6giRPMzVVccllI3GWTO5j2d/bHuDzt0aAys1sTBHLHQOGGA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/seneca-entity/-/seneca-entity-7.1.0.tgz", + "integrity": "sha512-2254Goh1JMHPo9jAUT7MQO6BMZuDNvz3zLMtnOWU5WC+DUYeoVOJ3WoMVL3GKwWMES19UJr1kxLO4Wr9uDBtTw==", "dev": true, "requires": { "eraro": "^2.1.0", "jsonic": "^0.3.1", "nid": "^0.3.2", - "seneca-mem-store": "^1.6.0" + "seneca-mem-store": "^1.7.1" } }, "seneca-joi": { @@ -1996,24 +2018,13 @@ } }, "seneca-mem-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/seneca-mem-store/-/seneca-mem-store-1.6.0.tgz", - "integrity": "sha512-NpQVS8s6NaHwB0Mil5uFA5ivRMMJP1AY2QCq+0U9dCnUERk8gMNtgNVw6HSLksSMDva8ym6R73f/Ft1qCPOTMA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/seneca-mem-store/-/seneca-mem-store-1.7.1.tgz", + "integrity": "sha512-Q0U9RrJYwxiFIhB+CykSeJs45MZ4s8IjSbYV16GHl0X+TMO/laNLd+63WLmvG47PMVCRIk5MEiqFQh9cClhEJQ==", "dev": true, "requires": { - "eraro": "^1.1.0", + "eraro": "^2.1.0", "lodash": "^4.17.15" - }, - "dependencies": { - "eraro": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eraro/-/eraro-1.1.0.tgz", - "integrity": "sha512-Iniul1qlKYp4XHkf4H6+qGUkRYLjE6xwhIyZU6D5q5DiMgjU8uUBkOT9Y8856GkNPJ1Zw5GYN9bvER5HCN6alQ==", - "dev": true, - "requires": { - "lodash": "4" - } - } } }, "seneca-plugin-validator": { @@ -2074,9 +2085,9 @@ "dev": true }, "@hapi/hoek": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.0.tgz", - "integrity": "sha512-7XYT10CZfPsH7j9F1Jmg1+d0ezOux2oM2GfArAzLwWe4mE2Dr3hVjsAL6+TFY49RRJlCdJDMw3nJsLFroTc8Kw==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.1.tgz", + "integrity": "sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==", "dev": true }, "@hapi/wreck": { @@ -2372,27 +2383,19 @@ } }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, "tunnel-agent": { @@ -2432,9 +2435,9 @@ "dev": true }, "uglify-js": { - "version": "3.7.6", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.6.tgz", - "integrity": "sha512-yYqjArOYSxvqeeiYH2VGjZOqq6SVmhxzaPjJC1W2F9e+bqvFL9QXQ2osQuKUFjM2hGjKG2YclQnRKWQSt/nOTQ==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.0.tgz", + "integrity": "sha512-ugNSTT8ierCsDHso2jkBHXYrU8Y5/fY2ZUprfrJUiD7YpuFvV4jODLFmb3h4btQjqr5Nh4TX4XtgDfCU1WdioQ==", "dev": true, "optional": true, "requires": { diff --git a/package.json b/package.json index e4c98b8..75deff7 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "seneca-member", - "version": "0.5.0", + "version": "1.0.0", "description": "Seneca plugin for generic membership.", "main": "member.js", "scripts": { "test": "lab -v -P test -t 80 -L -r console -o stdout -r html -o test/coverage.html", "doc": "seneca-doc", - "prettier": "prettier --write --no-semi --single-quote *.js lib/*.js test/*.js", + "prettier": "prettier --write *.js lib/*.js test/*.js", "coveralls": "lab -s -P test -r lcov | coveralls", "clean": "rm -rf node_modules package-lock.json yarn.lock", "reset": "npm run clean && npm i && npm test", @@ -36,9 +36,9 @@ "@hapi/lab": "^22.0.3", "coveralls": "^3.0.9", "prettier": "^1.19.1", - "seneca": "^3.20.0", - "seneca-doc": "^2.0.1", - "seneca-entity": "^7.0.0", + "seneca": "^3.20.1", + "seneca-doc": "^2.1.2", + "seneca-entity": "^7.1.0", "seneca-joi": "^7.0.1", "seneca-plugin-validator": "^0.6.0", "seneca-promisify": "^1.2.0" diff --git a/test/coverage.html b/test/coverage.html index 356ff53..6239eee 100644 --- a/test/coverage.html +++ b/test/coverage.html @@ -540,7 +540,7 @@ member-doc.js
  • - 97.35 + 100 member.js
  • Linting Report
  • @@ -551,7 +551,7 @@

    Test Report

    0
    0
    12
    -
    1019
    +
    1762
    @@ -574,77 +574,77 @@

    Test Report

    validate - 8 + 5 2 happy - 232 + 248 3 validate - 145 + 200 4 no-dups - 51 + 206 5 list-children - 161 + 299 6 list-parents - 109 + 240 7 fields - 80 + 163 8 bad-update - 42 + 63 9 update - 55 + 88 10 remove - 81 + 125 11 kinds - 44 + 112 12 @@ -659,10 +659,10 @@

    Test Report

    Code Coverage Report

    -
    97.87%
    -
    282
    -
    276
    -
    6
    +
    100%
    +
    307
    +
    307
    +
    0
    @@ -1102,10 +1102,10 @@

    member-doc.js

    member.js

    -
    97.35%
    -
    226
    -
    220
    -
    6
    +
    100%
    +
    251
    +
    251
    +
    0
    @@ -1235,770 +1235,770 @@

    member.js

    - - + + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - - + + - + - - + + - + - - + + - - + + - + - + - + - + - - + + - - + + - - + + - + - + - + - + - + - - + + - - + + - - + + - + - - + + - - + + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - + - + - - + + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - - + + - + @@ -2009,20 +2009,20 @@

    member.js

    - - + + - + - - + + @@ -2033,158 +2033,158 @@

    member.js

    - - + + - + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -2195,44 +2195,44 @@

    member.js

    - - + + - + - + - - + + - - + + - + - + - - + + @@ -2240,59 +2240,59 @@

    member.js

    - + - + - + - - + + - + - - + + - + - - + + - - + + - - + + - + @@ -2304,31 +2304,31 @@

    member.js

    - + - - + + - - + + - - + + - + @@ -2339,32 +2339,32 @@

    member.js

    - - + + - + - + - - + + - - + + @@ -2375,272 +2375,272 @@

    member.js

    - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - + - - + + - + - + - - + + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + @@ -2657,38 +2657,38 @@

    member.js

    - - + + - - + + - - + + - - + + - - + + - - + + @@ -2699,56 +2699,56 @@

    member.js

    - - + + - - + + - - + + - - + + - + - + - - + + - - + + - + @@ -2759,158 +2759,158 @@

    member.js

    - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -2921,188 +2921,188 @@

    member.js

    - - + + - - + + - + - - + + - - + + - + - - + + - + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - + - - + + - - + + - + @@ -3113,97 +3113,61 @@

    member.js

    - - + + - + - + - - + + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/member.test.js b/test/member.test.js index 6d67bf6..b66c3cf 100644 --- a/test/member.test.js +++ b/test/member.test.js @@ -153,10 +153,24 @@ lab.test('list-children', async () => { expect(out.items[0].toString()).equal('$-/-/bar;id=c0;{f2:100,f3:A}') expect(out.items[1].toString()).equal('$-/-/bar;id=c1;{f2:101,f3:B}') + // just get child ids + out = await si.post('role:member,list:children,parent:p0,kind:k0,code:d0') + //console.log(out) + expect(out).equal({ items: ['c0', 'c1'] }) + + try { + await si.post( + 'role:member,list:children,parent:p0,kind:k0,code:d0,as:not-a-valid-thing' + ) + Code.fail() + } catch (e) { + expect(e.code).equal('invalid_as') + } + out = await si.post( 'role:member,is:member,parent:p0,child:c0,as:child,fields:["f2"]' ) - expect(out.q).equal({ p: 'p0', c: 'c0' }) + expect(out.q).equal({ p: 'p0', c: ['c0'] }) expect(out.member.toString()).equal( '$-/sys/member;id=m0;{p:p0,c:c0,k:k0,d:d0,t:[t0],sv:0}' ) @@ -182,13 +196,21 @@ lab.test('list-children', async () => { // nothing can match this out = await si.post('role:member,is:member,parent:p0,as:child,fields:["f2"]') - expect(out).equal(null) + expect(out).equal({ + q: { p: 'p0' }, + member: undefined, + child: undefined, + members: [], + children: [], + membership: {} + }) out = await si.post( 'role:member,is:member,parent:p3,children:["c4","c5","c6"]' ) //console.log(out) - expect(out.map(x => !!x.member)).equal([false, true, true]) + //expect(out.map(x => !!x.member)).equal([false, true, true]) + expect(out.membership).equals({ c5: true, c6: true }) out = await si.post('role:member,list:children,parent:not-a-parent') expect(out.items).equal([]) @@ -403,6 +425,13 @@ lab.test('remove', async () => { kind: 'k1', code: 'd1' }) + await si.post('role:member,add:member', { + id: 'm2c', + parent: 'p3', + child: 'c3', + kind: 'k1', + code: 'd1' + }) list = await si.post('role:member,list:parents,child:c2,kind:k1,code:d1') expect(list.items).equal(['p1', 'p2']) @@ -414,6 +443,23 @@ lab.test('remove', async () => { list = await si.post('role:member,list:children,parent:p2') expect(list.items).equal([]) + + // won't delete if not enough info + + list = await si.post('role:member,list:children,parent:p3') + expect(list.items).equal(['c3']) + + await si.post( + 'role:member,remove:member,parent:p3,child:not-c3,kind:k1,code:d1' + ) + + list = await si.post('role:member,list:children,parent:p3') + expect(list.items).equal(['c3']) + + await si.post('role:member,remove:member,parent:p3,kind:k1,code:d1') + + list = await si.post('role:member,list:children,parent:p3') + expect(list.items).equal(['c3']) }) lab.test('kinds', async () => { @@ -460,10 +506,20 @@ lab.test('kinds', async () => { lab.test('intern', async () => { expect(Plugin.intern).exists() + expect(await Plugin.intern.load_items(null, null, [])).equals([]) + expect(Plugin.intern.is_single_member({})).false() + expect(Plugin.intern.is_single_member({ children: [] })).false() expect(Plugin.intern.is_single_member({ child: 1 })).true() expect(Plugin.intern.is_single_member({ code: 2 })).true() expect(Plugin.intern.is_single_member({ child: 1, code: 2 })).true() + + expect(Plugin.intern.is_single_remove({})).false() + expect(Plugin.intern.is_single_remove({ children: [] })).false() + expect(Plugin.intern.is_single_remove({ child: 1 })).true() + expect(Plugin.intern.is_single_remove({ code: 2 })).true() + expect(Plugin.intern.is_single_remove({ child: 1, code: 2 })).true() + expect(Plugin.intern.is_single_remove({ id: 'id0' })).true() }) async function make_data0(si) {
    20 function member(opts) {1member.errors = {
    21 10 const seneca = this invalid_as:
    22 'Invalid member `as` value (<%=as%>), should be one of: child, parent, child-id, parent-id, member, member-id.'
    23 function define_patterns() {}
    24 10 seneca
    25 .message('role:member,add:kinds', add_kinds)function member(options) {
    26 .message('role:member,get:kinds', get_kinds)10 const seneca = this
    27 .message('role:member,add:member', intern.make_multi(add_member))
    28 .message( function define_patterns() {
    29 'role:member,is:member',10 seneca
    30 intern.make_multi(is_member, intern.is_single_member) .message('role:member,add:kinds', add_kinds)
    31 ) .message('role:member,get:kinds', get_kinds)
    32 .message( .message('role:member,add:member', intern.make_multi(add_member))
    33 'role:member,remove:member', .message('role:member,is:member', is_member)
    34 intern.make_multi(remove_member, intern.is_single_remove) .message(
    35 ) 'role:member,remove:member',
    36 .message('role:member,update:member', update_member) intern.make_multi(remove_member, intern.is_single_remove)
    37 .message('role:member,list:children', list_children) )
    38 .message('role:member,list:parents', list_parents) .message('role:member,update:member', update_member)
    39 } .message('role:member,list:children', list_children)
    40 .message('role:member,list:parents', list_parents)
    41 10 const validate_member = { }
    42 parent: Joi.string(),
    43 child: Joi.string(),10 const validate_member = {
    44 kind: Joi.string(), parent: Joi.string(),
    45 code: Joi.string(), child: Joi.string(),
    46 tags: Joi.array().items(Joi.string()) kind: Joi.string(),
    47 } code: Joi.string(),
    48 tags: Joi.array().items(Joi.string())
    49 async function add_kinds(msg) { }
    50 1 opts.kinds = Object.assign(opts.kinds, msg.kinds)
    51 1 return { kinds: opts.kinds } async function add_kinds(msg) {
    52 }1 options.kinds = Object.assign(options.kinds, msg.kinds)
    53 1 return { kinds: options.kinds }
    54 async function get_kinds(msg) { }
    55 1 return { kinds: opts.kinds }
    56 } async function get_kinds(msg) {
    57 1 return { kinds: options.kinds }
    58 /* }
    59 async function add_member(msg, meta, ...rest) {
    60 if(msg.child) { // idemptotent
    61 return add_member_single.call(this, msg, meta, ...rest) async function add_member(msg) {
    62 }37 const member_ent = this.entity('sys/member')
    63 else if(msg.children) {
    64 var members = []37 const q = {
    65 for(var cI = 0; cI < msg.children.length; cI++) { p: msg.parent,
    66 var child_msg = {...msg, child:msg.children[cI], children: null} c: msg.child,
    67 members.push(await add_member_single.call(this, child_msg, meta, ...rest)) k: msg.kind,
    68 } d: msg.code
    69 return members }
    70 }37 const prev = await member_ent.make$().load$(q)
    71 // else no action no result
    72 else {37 var member
    73 return null
    74 }37 if (prev) {
    75 }1 member = await prev
    76 */ .data$({
    77 t: msg.tags
    78 // idemptotent })
    79 async function add_member(msg) { .save$()
    80 36 const member_ent = this.entity('sys/member') } else {
    81 36 const data = {
    82 36 const q = { p: msg.parent,
    83 p: msg.parent, c: msg.child,
    84 c: msg.child, k: msg.kind,
    85 k: msg.kind, d: msg.code,
    86 d: msg.code t: msg.tags,
    87 } sv: SYS_MEMBER_SV
    88 36 const prev = await member_ent.make$().load$(q) }
    89 36 if (msg.id) {
    90 36 var member27 data.id$ = msg.id
    91 }
    92 36 if (prev) {
    93 1 member = await prev36 member = await member_ent
    94 .data$({ .make$()
    95 t: msg.tags .data$(data)
    96 }) .save$()
    97 .save$() }
    98 } else {
    99 35 const data = {37 return member
    100 p: msg.parent, }
    101 c: msg.child,
    102 k: msg.kind, async function is_member(msg) {
    103 d: msg.code,7 const member_ent = this.entity('sys/member')
    104 t: msg.tags,
    105 sv: SYS_MEMBER_SV // required
    106 }7 const q = {
    107 35 if (msg.id) { p: msg.parent
    108 26 data.id$ = msg.id }
    109 }
    110 7 var msg_children = intern.resolve_children(msg)
    111 35 member = await member_ent7 if (msg_children) {
    112 .make$()5 q.c = msg_children
    113 .data$(data) }
    114 .save$()
    115 }7 if (msg.kind) {
    116 2 q.k = msg.kind
    117 36 return member }
    118 }
    119 7 if (msg.code) {
    120 /*2 q.d = msg.code
    121 async function is_member(msg, meta, ...rest) { }
    122 // NOTE: code could be a unique child for parent
    123 if(msg.child || msg.code) {7 var valid_query = null != q.c || null != q.d
    124 return is_member_single.call(this, msg, meta, ...rest)
    125 }7 const members = valid_query ? await member_ent.list$(q) : []
    126 else if(msg.children) {7 var children = []
    127 var members = []
    128 for(var cI = 0; cI < msg.children.length; cI++) {7 var membership = {}
    129 var child_msg = {...msg, child:msg.children[cI], children: null}7 for (var mI = 0; mI < members.length; mI++) {
    130 members.push(await is_member_single.call(this, child_msg, meta, ...rest))8 membership[members[mI].c] = true
    131 } }
    132 return members
    133 }7 if (0 < members.length && 'child' === msg.as) {
    134 // else no action no result3 children = await intern.load_items(seneca, options, members, msg, 'c')
    135 else { }
    136 return null
    137 }7 var out = {
    138 } q: q,
    139 */ member: members[0],
    140 child: children[0],
    141 async function is_member(msg) { members: members,
    142 8 const member_ent = this.entity('sys/member') children: children,
    143 membership: membership
    144 // required }
    145 8 const q = {
    146 p: msg.parent7 return out
    147 } }
    148
    149 8 if (msg.child) { async function remove_member(msg) {
    150 7 q.c = msg.child const member_ent = this.entity('sys/member')
    151 }7 var list = []
    152
    153 8 if (msg.kind) {7 if (null != msg.id) {
    154 2 q.k = msg.kind const item = await member_ent.load$(msg.id)
    155 }2 if (item) {
    156 1 list.push(item)
    157 8 if (msg.code) { }
    158 2 q.d = msg.code await member_ent.make$().remove$(msg.id)
    159 }5 } else if (null != msg.child && null != msg.kind) {
    160 // required
    161 8 const member = await member_ent.load$(q)3 const q = {
    162 8 var child = [] c: msg.child,
    163 k: msg.kind
    164 8 if (member && 'child' === msg.as) { }
    165 3 child = await load_items(seneca, [member], msg, 'c')
    166 }3 if (msg.parent) {
    167 1 q.p = msg.parent
    168 8 return { member: member, child: child[0], q: q } }
    169 }
    170 3 if (msg.code) {
    171 async function remove_member(msg) {2 q.d = msg.code
    172 5 const member_ent = this.entity('sys/member') }
    173 5 var list = []
    174 3 const found = await member_ent.list$(q)
    175 5 if (null != msg.id) {
    176 2 const item = await member_ent.load$(msg.id)3 for (var i = 0; i < found.length; i++) {
    177 2 if (item) {3 list.push(found)
    178 1 list.push(item)3 await found[i].remove$()
    179
    180 2 await member_ent.make$().remove$(msg.id) }
    181
    } else if (
    null != msg.child
    && null != msg.kind) {
    182 // required7 return { items: list }
    183 2 const q = { }
    184 c: msg.child,
    185 k: msg.kind async function update_member(msg) {
    186 }3 const member_ent = this.entity('sys/member')
    187
    188
    if (
    msg.parent
    ) {
    // TODO: support list of ids - need seneca-entity to support this
    189 q.p = msg.parent3 var member = await member_ent.make$().load$(msg.id)
    190 }
    191 3 if (member) {
    192 2 if (msg.code) { member.p = null == msg.parent ? member.p : msg.parent
    193 1 q.d = msg.code2 member.c = null == msg.child ? member.c : msg.child
    194 }2 member.k = null == msg.kind ? member.k : msg.kind
    195 2 member.d = null == msg.code ? member.d : msg.code
    196 2 const found = await member_ent.list$(q) member.t = null == msg.tags ? member.t : msg.tags
    197 198 2 for (var i = 0; i < found.length; i++) { member = await member.save$()
    199 3 list.push(found) }
    200 3 await found[i].remove$()
    201 }3 return member
    202 } }
    203
    204 5 return { items: list }10 list_children.validate = Object.assign({}, validate_member, {})
    205 }
    206 async function list_children(msg) {
    207 async function update_member(msg) {22 return build_list(this, msg, 'c')
    208 3 const member_ent = this.entity('sys/member') }
    209
    210 // TODO: support list of ids - need seneca-entity to support this10 list_parents.validate = Object.assign({}, validate_member, {})
    211 3 var member = await member_ent.make$().load$(msg.id)
    212 async function list_parents(msg) {
    213 3 if (member) {11 return build_list(this, msg, 'p')
    214 2 member.p = null == msg.parent ? member.p : msg.parent }
    215 2 member.c = null == msg.child ? member.c : msg.child
    216 2 member.k = null == msg.kind ? member.k : msg.kind async function build_list(seneca, msg, type) {
    217 2 member.d = null == msg.code ? member.d : msg.code33 const member_ent = seneca.entity('sys/member')
    218 2 member.t = null == msg.tags ? member.t : msg.tags
    219 // const fields = []
    220 2 member = await member.save$()33 const q = {}
    221 }
    222 33 if ('c' === type && null != msg.parent) {
    223 3 return member21 q.p = msg.parent
    224 } }
    225 33 if ('p' === type && null != msg.child) {
    226 10 list_children.validate = Object.assign({}, validate_member, {}) q.c = msg.child
    227 }
    228 async function list_children(msg) {33 if (null != msg.kind) {
    229 17 return build_list(this, msg, 'c')19 q.k = msg.kind
    230 } }
    231 33 if (null != msg.code) {
    232 10 list_parents.validate = Object.assign({}, validate_member, {})16 q.d = msg.code
    233 }
    234 async function list_parents(msg) {
    235 11 return build_list(this, msg, 'p')33 var list = await member_ent.list$(q)
    236 }
    237 33 var seen = {}
    238 async function build_list(seneca, msg, type) {33 list = list.filter(x => (seen[x[type]] ? false : (seen[x[type]] = true)))
    239 28 const member_ent = seneca.entity('sys/member')
    240 33 const prefix = 'c' === type ? 'child' : 'parent'
    241 // const fields = []
    242 28 const q = {} // Return referenced entity ids
    243 33 if (null == msg.as || prefix + '-id' == msg.as) {
    244 28 if ('c' === type && null != msg.parent) {24 list = list.map(x => x[type])
    245 16 q.p = msg.parent }
    246 }
    247 28 if ('p' === type && null != msg.child) { // Return sys/member ids
    248 10 q.c = msg.child9 else if ('member-id' == msg.as) {
    249 }2 list = list.map(x => x.id)
    250 28 if (null != msg.kind) { }
    251 17 q.k = msg.kind
    252 } // Return sys/member ents
    253 28 if (null != msg.code) {7 else if ('member' == msg.as) {
    254 14 q.d = msg.code // use list as is
    255
    257 28 var list = await member_ent.list$(q) // Return referenced entities
    258 5 else if (prefix == msg.as) {
    259 28 var seen = {}4 list = await intern.load_items(seneca, options, list, msg, type)
    260 28 list = list.filter(x => (seen[x[type]] ? false : (seen[x[type]] = true))) } else {
    261 1 seneca.fail('invalid_as', { as: msg.as })
    262 28 const prefix = 'c' === type ? 'child' : 'parent' }
    263
    264 // Return referenced entity ids32 return { items: list }
    265 28 if (null == msg.as || prefix + '-id' == msg.as) { }
    266 20 list = list.map(x => x[type])
    267 }10 return define_patterns()
    268 }
    269 // Return sys/member ids
    270 8 else if ('member-id' == msg.as) {1const intern = (module.exports.intern = {
    271 2 list = list.map(x => x.id) load_items: async function(seneca, options, list, msg, type) {
    272 } var out = []
    273
    274 // Return sys/member ents8 if (0 < list.length) {
    275 6 else if ('member' == msg.as) { // assume list is all of same kind
    276 // use list as is7 var kind = list[0].k
    277 }7 var canon = options.kinds[kind][type]
    278 7 var ent = seneca.entity(canon)
    279 // Return referenced entities
    280
    else if (
    prefix == msg.as
    ) {
    7 var q = { id: list.map(x => x[type]) }
    281 4 list = await load_items(seneca, list, msg, type)7 if (msg.fields) {
    282 }5 q.fields$ = msg.fields
    283 }
    284 28 return { items: list }
    285 }7 out = await ent.list$(q)
    286 }
    287 async function load_items(seneca, list, msg, type) {
    288 7 const out = []8 return out
    289 },
    290 7 for (var i = 0; i < list.length; i++) {
    291 11 var kind = list[i].k resolve_children: function(msg) {
    292 11 var canon = opts.kinds[kind][type] var children = null
    293 11 var ent = seneca.entity(canon)
    294 11 var entid = list[i][type] // children has precedence
    295 7 if (msg.children) {
    296 11 var q = { id: entid }1 children = msg.children
    297 11 if (msg.fields) {6 } else if (msg.child) {
    298 7 q.fields$ = msg.fields4 children = msg.child
    299 } }
    300
    301 11 var found = (await ent.list$(q))[0] // always convert to list
    302 //var found = await ent.load$(q)7 if (null != children && !Array.isArray(children)) {
    303
    if (
    found
    ) {
    4 children = [children]
    304 11 out.push(found) }
    305 }
    306 }7 return children
    307 },
    308 7 return out
    309 } make_multi: function(single_action, is_single) {
    310 var func = async function(msg, meta, ...rest) {
    311 10 return define_patterns() if (msg.child || (is_single && is_single(msg))) {
    312 }38 return single_action.call(this, msg, meta, ...rest)
    313 7 } else if (msg.children) {
    314 1const intern = (module.exports.intern = {3 var out = []
    315 make_multi: function(single_action, is_single) {3 for (var cI = 0; cI < msg.children.length; cI++) {
    316 var func = async function(msg, meta, ...rest) {6 var child_msg = { ...msg, child: msg.children[cI], children: null }
    317 if (msg.child || (is_single && is_single(msg))) {6 out.push(await single_action.call(this, child_msg, meta, ...rest))
    318 40 return single_action.call(this, msg, meta, ...rest) }
    319 9 } else if (msg.children) {3 return out
    320 4 var out = [] }
    321 4 for (var cI = 0; cI < msg.children.length; cI++) { // else no action no result
    322 9 var child_msg = { ...msg, child: msg.children[cI], children: null } else {
    323 9 out.push(await single_action.call(this, child_msg, meta, ...rest))4 return null
    324 } }
    325 4 return out }
    326 }
    327 // else no action no result20 Object.defineProperty(func, 'name', {
    328 else { value: single_action.name + '_multi'
    329 5 return null })
    330 }20 return func
    331 } },
    332
    333 30 Object.defineProperty(func, 'name', { // The code could be a unique child for the parent.
    334 value: single_action.name + '_multi' is_single_member: function(msg) {
    335 }) return !msg.children && !!(msg.child || msg.code)
    336 30 return func },
    337 },
    338 is_single_remove: function(msg) {
    339 // The code could be a unique child for the parent. return !msg.children && !!(msg.id || msg.child || msg.code)
    340 is_single_member: function(msg) { }
    341 return !msg.children && !!(msg.child || msg.code)})
    342 },
    343
    344 is_single_remove: function(msg) {
    345
    return
    !msg.children
    && !!(msg.id ||
    msg.child
    || msg.code)
    346 }
    347})
    348