Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appc-connector-utils

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appc-connector-utils - npm Package Compare versions

Comparing version 0.1.2 to 0.2.2

8

lib/model/api.js

@@ -15,3 +15,10 @@ const pluralize = require('pluralize')

}
const loadModels = connector.config.generateModels
return Object.keys(modelsMetadata).reduce(function (previousModels, modelName) {
if (loadModels && loadModels.indexOf(modelName) === -1) {
return previousModels
}
const metadata = modelsMetadata[modelName]

@@ -61,2 +68,1 @@

}

2

package.json
{
"name": "appc-connector-utils",
"version": "0.1.2",
"version": "0.2.2",
"description": "Utilities for Arrow Connectors",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -50,3 +50,14 @@ const Arrow = require('arrow')

test('generate custom number of models', t => {
connector.config.generateModels = ['People', 'Call']
const models = modelApi.createFromMetadata(connector, modelMetadata2)
t.equal(Object.keys(models).length, 2)
t.ok(models['People'])
t.ok(models['Call'])
connector.config.generateModels = null
t.end()
})
test('createFromMetadata - check extra fields are set', t => {
connector.config.skipModelNamespace = true
const models = modelApi.createFromMetadata(connector, modelMetadata3)

@@ -63,8 +74,29 @@ t.equal(Object.keys(models).length, 1)

t.ok(createdModel.metadata.primarykey)
t.equal(createdModel.name, 'appc.test/Airlines')
t.equal(createdModel.name, 'Airlines')
t.ok(createdModel.plural)
t.ok(createdModel.singular)
connector.config.skipModelNamespace = false
t.end()
})
test('model namespace', t => {
connector.config.modelNamespace = 'appc.test1'
const models = modelApi.createFromMetadata(connector, modelMetadata3)
t.equal(Object.keys(models).length, 1)
const createdModel = models['Airlines']
t.ok(createdModel)
t.ok(createdModel.actions)
t.ok(createdModel.autogen)
t.same(createdModel.connector, connector)
t.ok(createdModel.disabledActions)
t.ok(createdModel.fields.Name)
t.ok(createdModel.generated)
t.ok(createdModel.metadata.primarykey)
t.equal(createdModel.name, 'appc.test1/Airlines')
t.ok(createdModel.plural)
t.ok(createdModel.singular)
connector.config.modelNamespace = ''
t.end()
})
test('getRootModelName', t => {

@@ -113,2 +145,1 @@ const name1 = 'appc.test/myModel1'

})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc