0.0.39 • Published 1 year ago

oute-services-variable-sdk v0.0.39

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

This module expose helper functions

  • Initialization
  var params = {
    url: @server url
    token: @access token
  }
  var Variable = require("oute-services-variable-sdk")
  var variable_instance = new Variable(params)

Cache functions

  • transformed variable to state
  variables = {LOCAL: []}
  environment_id = null
  variable_instance.transformedToState(variables, environment_id)

Core functions

  • Save
  body = {
    "_id": "ZX7c062wq",
    "name": "test2",
    "data_type": "STRING",
    "mode": "LOCAL",
    "default" : "test",
    "state": "ACTIVE",
    "workspace_id": "work",
    "asset_id" : "q-GmTD5-K",
    "parent_id" : "q-GmTD5-K",
    "env":{
      "default": "test1"
    }
  }
  await variable_instance.save(body)
  • Delete
  variable_id = "ZX7c062wq"
  await variable_instance.delete(variable_id)
  • Get by parent/project id
  parent_id = "q-GmTD5-K"
  asset_cache_obj = {
    "_id": "test@gofo.app|ZzBfJMpfQ",
    "user_id": "test@gofo.app",
    "workspace_id": "ZzBfJMpfQ",
    "workspace": {
      "_id": "ZzBfJMpfQ",
      "name": "test"
    },
    "user": {
      "_id": "test@gofo.app",
      "name": "test",
      "src": "test",
      "email_id": "test@gofo.app"
    },
    "folders": [
      {
        "_id": "q-GmTD5-K",
        "owner_id": "test@gofo.app",
        "name": "test form",
        "owner": {
          "_id": "test@gofo.app",
          "name": "test",
          "src": "test",
        },
        "is_favorite": false,
        "childs": [
          {
            "_id": "MyTbZOnfH",
            "owner_id": "test@gofo.app",
            "name": "test form",
            "owner": {
              "_id": "test@gofo.app",
              "name": "test",
            },
            "is_favorite": false
          }
        ]
      }
    ],
    "files": [
      {
        "_id": "q-GmTD5-K",
        "owner_id": "test@gofo.app",
        "name": "test form",
        "owner": {
          "_id": "test@gofo.app",
          "name": "test"
        },
        "is_favorite": false,
        "childs": [
          {
            "_id": "MyTbZOnfH",
            "owner_id": "test@gofo.app",
            "name": "test form",
            "owner": {
              "_id": "test@gofo.app",
              "name": "test",
              "src": "test",
            },
            "is_favorite": false
          }
        ]
      }
    ],
    "recent": [],
    "recommendation": [],
    "shared": [],
    "favourites": [],
    "trash": [],
    "checksum": "68fe37b0-9101-49e8-b8b7-35e7c89b0759",
    "created_at": "2023-07-11T18:25:53.863Z",
    "updated_at": "2023-07-12T11:20:44.818Z"
  }
  await a.getByParent(parent_id, asset_cache_obj)
  • Save
  body = {
    "variable_ids": ["ZX7c062wq"],
    "workspace_id": "ZzBfJMpfQ",
    "asset_id" : "q-GmTD5-K"
  }
  await variable_instance.mapToAsset(body)
0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago