0.0.20 • Published 29 days ago

oute-services-variable-sdk v0.0.20

Weekly downloads
-
License
-
Repository
-
Last release
29 days 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.20

29 days ago

0.0.19

29 days ago

0.0.18

3 months ago

0.0.17

8 months ago

0.0.16

8 months ago

0.0.15

9 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.12

9 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago