Skip to content
FreePhoenix888 edited this page Apr 5, 2023 · 17 revisions

Welcome to the Documentation wiki!

Before you begin

Do not just memorize this information. This is not a verse that you must tell to your teacher. This is a guide must help you to learn deep by doing

First Steps

What you will learn in First steps part

  • Insert links
  • Edit links
  • Query links
  • Login

Launch deep

Choose one of the variants. Right now we recommend you to use gitpod

Open deepcase (Deep Graphical user interface)

Deepcase is located on 3007 port. Note: For local deep it is localhost:3007, in gitpod you can see ports on the ports panel

Query links to see them.

By default you see links contained in your space, you can see more by using queries.

Insert query

Press right mouse button and choose insert in context menu - insertion window will appear. Write query in search panel located in insertion window and choose list view by using one of the two buttons on the top-right corner of the insertion window and then choose query link and create it by using mark button near to the bottom-right corner.

Edit value of Query link

Press right mouse button on query link and choose editor from the context menu. Query all the users. Literally we are going to query all links where type link is contained as User in @deep-foundation/core space

{
  type_id: {
    _id: ["@deep-foundation/core", "User"]
  }
}

Make query active

Press right mouse button and choose insert in context menu - insertion window will appear. Write active in search panel located in insertion window and choose list view by using one of the two buttons on the top-right corner of the insertion window and then choose active link and create it by using mark button near to the bottom-right corner.

See all users

Find user with name "admin"

Login as admin

Press right mouse button on the user with name admin and press on the login button in context menu

See that you are authenticated as admin user and see admin space (space link + links contained in the space)

Congratulations! 🎉🎉🎉
You have completed First steps and now you can

  • Insert links
  • Edit links
  • Query links
  • Login

Your first package

Insert package link

You have learned how to insert links in the First steps. Feel free to refresh your memory by re-reading it again, it is not scary, our mind is not ideal!

Set package name

Edit value of Package link (not contain link) to set name of the package

Switch to package space

You see links contained in the space. When you insert links they are contained in the space. We are going to see and contain new links in your new package so we have to switch to its space Press right mouse button on the package link and press space in the context menu

Insert type

Do you remember query and active links? They are links of type Type that is contained in the @deep-foundation/core and they by the way contained in the same package. Let us create our own type! 🔨
Note: when we were inserting query and active links types of those links were Query and Active types that are contained in the @deep-foundation/core package. Do not be scared! Types are links too and you use can use links as type, from, to for another link.
Insert Type link by using right mouse button and insertion window. If you have forgot how to do that refresh your memory by reading Insert query step

Choose how your package treats your type

Edit value of the Contain link which points from your package to the Type link In short - to give a name to your type - you have edit Contain link which goes from your Package link to the Type link In detail - Query link contained in the @deep-foundation/core package is just a Type link. A "meaning" is in the string value of the Contain link that points from the package to the type with specific string value.
Literally we say our package treats this type as ...(anything you have written in the value of the contain link)

Insert npm token

  • Go to the space of your user by clicking X near to the space button.
  • Insert link Token from the @deep-foundation/npm-packager package (package name is written below type name)
  • Set your npm token as value of Token link

Publish your package

  • Press left mouse button on the Package link
  • Write package name and version in the appeared window
  • Click publish button

Look at your package on npm

Handle events

General Information

Links

SyncTextFile

SyncTextFile contains code of handler. Each type of handler expects different types of code. For example supportsDockerJs handlers expect async arrow function inside your SyncTextFile while plv8SupportsJs expects arrow function

Handler

Handler points from supports link to SyncTextFile. Supports links present which environment your code will be executed in

List of support:
  • dockerSupportsJs
  • plv8SupportsJs
  • TODO...

Handle

Handle points from link-type which links-instances will trigger handler
to Handler

Your first Insert/Update/Delete handler

Insert SyncTextFile

Set this as content of the SyncTextFile:

() => {
  return "Hello Deep!"
}

Insert Query

You have to see docketSupportsJs link therefore we need query Content of the Query:

{
  id: {
    _id: ["@deep-foundation/core", "dockerSupportsJs"]
  }
}

This query literally says give me link that is contained as dockerSupportsJs in the @deep-foundation/core package

Make the Query active

After making the query active you should see dockerSupportsJs link

Insert Handler

Insert Handler. It must poing from dockerSupportsJs to SyncTextFile as you can see on the deepcase's hint on the right-bottom corner

Insert Handle

You have handler but it is not used yet. To handle insertion of specific links we must create Handle which points from your link to Handler

Insert link of type Type

Give a name to your new link of type Type by editing Contain

Insert Handle

Insert YourTypeName

Enable promises by clicking on promises word on the top panel

See result of your handler

Clone this wiki locally