From 712e04627c32e68c5292ec2d925773908cc8a5cc Mon Sep 17 00:00:00 2001 From: Ivan S Glazunov Date: Thu, 3 Oct 2024 22:17:43 +0300 Subject: [PATCH] 0.0.601 --- imports/packager.ts | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/imports/packager.ts b/imports/packager.ts index c13be501..6faa6405 100644 --- a/imports/packager.ts +++ b/imports/packager.ts @@ -1,5 +1,5 @@ import Debug from 'debug'; -import { DeepClient } from './client.js'; +import { _ids, DeepClient } from './client.js'; import type { DeepSerialOperation } from './client.js'; import { Id, Link, minilinks, MinilinksResult } from './minilinks.js'; import { serializeError } from 'serialize-error'; @@ -1090,8 +1090,13 @@ export class Packager> { }) { const deep = this.client; if (!deep.isId(packageId)) throw new Error('!packageId'); - console.log(inserting); - await deep.insert(inserting.map(i => ({ ...i, containerId: packageId }))); + const contains = inserting.map((l, i) => { + const r = { type_id: _ids['@deep-foundation/core']['Contain'], from_id: packageId, to_id: l.id, string: l.name }; + delete inserting[i].containerId; + delete inserting[i].name; + return r; + }); + await deep.insert([...inserting, ...contains]); for (let u of updating) { if (u.value) await deep.value(u.id, u.value); else await deep.update(u.id, { from_id: u.from_id, to_id: u.to_id }) diff --git a/package.json b/package.json index 121b13ce..7bddcbfa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deep-foundation/deeplinks", - "version": "0.0.600", + "version": "0.0.601", "license": "Unlicense", "type": "module", "main": "import.js",