hapi-sequelize 3.0.4 support for Hapi version 17.2.0 - hapi.js

I am trying to use hapi-sequelize 3.0.4 with hapi.js 17.2.0 using the following configuration:
{
plugin: require("hapi-sequelize"),
options:[
{
name: "mysql", // identifier
models: ["./plugins/sequelize/models/*.js"], // paths/globs to model files
sequelize: new Sequelize(
process.env.DB_NAME,
process.env.DB_USER,
process.env.DB_PASS,
{
host: process.env.DB_HOST,
dialect: "mysql",
port: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 3306
}
), // sequelize instance
sync: false, // sync models - default false
forceSync: false // force sync (drops tables) - default false
}
]
}
It gives the following error:
name[1] --missing---
Is this the latest version of hapi-sequelize compatible with hapi.js 17.2.0?

Related

Deploying Synapse Workspace with Managed Vnet Enabled (Bicep), but cannot assign private endpoints in UI

Situation:
I am deploying a Synapse workspace instance in Bicep with Managed Virtual Network Enabled.
I can see the Managed Vnet Is enabled from the UI:
However, when I enter the workspace my integration runtimes are not enabled for virtual network access and I cannot create managed private endpoints.
I'm writing the following code for the bicep deployment:
resource synapse_workspace 'Microsoft.Synapse/workspaces#2021-06-01' = {
name: synapse_workspace_name
location: location
tags: {
Workload: '####'
Environment: envName
Classification: 'Confidential'
Criticality: 'Low'
}
identity: {
type: 'SystemAssigned'
}
properties: {
// Git Repo
workspaceRepositoryConfiguration: {
accountName: '#####'
collaborationBranch: 'main'
projectName: '####'
repositoryName: '#############'
rootFolder: '/synapse/syn-data-${envName}'
tenantId: '####################'
type: 'WorkspaceVSTSConfiguration'
}
defaultDataLakeStorage: {
resourceId: storage_account_id
createManagedPrivateEndpoint: true
accountUrl: ###################
filesystem: ################
}
encryption: {
cmk: {
kekIdentity: {
useSystemAssignedIdentity: true
}
key: {
name: 'default'
keyVaultUrl: '#########################'
}
}
}
managedVirtualNetwork: 'default'
connectivityEndpoints: {
web: 'https://web.azuresynapse.net?workspace=%2fsubscriptions%######################
dev: 'https://##############.dev.azuresynapse.net'
sqlOnDemand: '################-ondemand.sql.azuresynapse.net'
sql: '################.sql.azuresynapse.net'
}
managedResourceGroupName: guid('synapseworkspace-managed-resource-group-${envName}')
sqlAdministratorLogin: 'sqladminuser'
privateEndpointConnections: []
managedVirtualNetworkSettings: {
preventDataExfiltration: true
allowedAadTenantIdsForLinking: []
}
publicNetworkAccess: 'Disabled'
cspWorkspaceAdminProperties: {
initialWorkspaceAdminObjectId: '#########################'
}
trustedServiceBypassEnabled: false
}
}
I get no errors in the deployment regarding the virtual network or any associated settings, but I still get the default integration runtime set to "Public" and not "Managed Virtual Network".
Is this a limitation in Bicep or am I missing some parameter?
Any help would be great
Joao

Javascript evaluation failed: input('#login_field','dummy') on running karate feature

I am getting error
"java.lang.AssertionError: failed features:
feature.demo-01: demo-01.feature:16 - javascript evaluation failed: input('#login_field','dummy'), ReferenceError: "input" is not defined in at line number 1"
on running the below feature
Feature: browser automation 1
Background:
* configure driver = { type: 'chrome', showDriverLog: true }
# * configure driverTarget = { docker: 'justinribeiro/chrome-headless', showDriverLog: true }
# * configure driverTarget = { docker: 'ptrthomas/karate-chrome', showDriverLog: true }
* configure driver = { type: 'chromedriver', showDriverLog: true }
# * configure driver = { type: 'geckodriver', showDriverLog: true }
# * configure driver = { type: 'safaridriver', showDriverLog: true }
# * configure driver = { type: 'iedriver', showDriverLog: true, httpConfig: { readTimeout: 120000 } }
Scenario: try to login to github and then do a google search
Given driver 'https://github.com/login'
And input('#login_field','dummy')
And input('//input[#id='password']', 'world')
You must be on an old version of Karate. Use 0.9.5.
Maybe try the ZIP Release first and get familiar: https://github.com/intuit/karate/wiki/ZIP-Release

Codeception seeInDatabase() not working as expected

I have problems getting codeceptions seeInDatabase() to work. This is my Cest:
public function testContactMailCheckbox(AcceptanceTester $I) {
$I->scrollTo("#adminMailSettingsForm", 0, -200);
$I->seeInDatabase("pib_users", [
"user_email" => "admin-cest#example.org",
"user_receive_contact_notification" => 0
]);
$I->click("//label[#for='contactMailNotification']", "#adminMailSettingsForm");
$I->waitForJS("return $.active == 0;",10);
$I->wait(100);
$I->seeInDatabase("pib_users", [
"user_email" => "admin-cest#example.org",
"user_receive_contact_notification" => 1
]);
}
The first seeInDatabase() passes, everything is fine. I can verify that this seeInDatabase-Assertion works correctly, by changing the default-data in my database dump. When I change the default data to "user_receive_contact_notification" => 1, the first seeInDatabase fails, which means it is working correctly.
I use $I->wait(100) to verify, that there are no synchronisation-issues. During this timespan I can check via phpMyAdmin, that the row was indeed updated correctly. That means the test should pass.
Here is my Db-config:
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://pib.local/'
window_size: false # disabled in ChromeDriver
port: 5555
browser: chrome
capabilities:
chromeOptions:
args: ["--headless", "--no-sandbox", "--disable-gpu", "--window-size=1920,1080"]
- \Helper\Acceptance
- Sequence
- \Helper\DbHelper
config:
\Helper\DbHelper:
user: "root"
password: ""
dsn: "mysql:host=localhost;dbname=pib"
cleanup: true
dump: 'tests/database_dump_tests.sql'
populate: true
reconnect: true
step_decorators: ~
My DbHelper contains only a single function:
class DbHelper extends \Codeception\Module\Db
{
public function putInDatabase($table, $data, $insertOnlyIfNotExisting = true) {
// if ignoreDuplicateError is true, only execute insert when not existing already
if($this->countInDatabase($table, $data) == 0 | !$insertOnlyIfNotExisting) {
$this->_insertInDatabase($table, $data);
}
}
}
This might be related to this question. I don't use Laravel though, so just using the seeRecord()-helper isn't going to help me.

There is no extension able to load the

I integrating of bundles FOSRestBundle,JMSSerializerBundle and NelmioApiDocBundle, I modified the files config.yml and routing.yml but I find this problem
code config.yml:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: "#UserBundle/Resources/config/services.yml" }
# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: fr
framework:
#esi: ~
translator: ~
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
templating:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: test\UserBundle\Entity\User
fos_rest:
view:
view_response_listener: 'force'
formats:
json: true
format_listener:
rules:
- { path: '^/api', priorities: ['json'], fallback_format: json, prefer_extension: true }
- { path: '^/', stop: true }
nelmio_cors:
paths:
'^/api/':
allow_credentials: true
allow_origin: ['*']
allow_headers: ['*']
allow_methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']
max_age: 3600
code routing.yml:
user:
resource: "#UserBundle/Resources/config/routing.yml"
prefix: /
med:
resource: "#MedBundle/Resources/config/routing.yml"
prefix: /
app:
resource: "#AppBundle/Controller/"
type: annotation
fos_user:
resource: "#FOSUserBundle/Resources/config/routing/all.xml"
NelmioApiDocBundle:
resource: "#NelmioApiDocBundle/Resources/config/routing.yml"
prefix: /api/doc
app_api:
resource: "#MedBundle/Resources/config/routing_rest.yml"
type: rest
prefix: /api
code routing_rest.yml:
api_app:
resource: MedBundle\Controller\Api\AppController
type: rest
code AppController.php:
<?php
namespace test\MedBundle\Controller\Api;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FOS\RestBundle\Controller\Annotations\RouteResource;
/**
* #RouteResource("User")
*/
Class AppController extends Controller {
public function getAction() {
$em = $this->getDoctrine()->getManager();
$test = $em->getRepository('MedBundle:Apps')->findAll();
return array("test" => $test);
}
public function postAction(Request $request){
return $request->request->all();
}
}
Now I find this problem when it can test API
What is the solution and thank you
You don't have any configuration for assetic in your config.yml file. I assume you don't have the AsseticBundle installed on your app. Since Symfony 2.8, Assetic is no longer included by default in the Symfony Standard Edition. You need to install it yourself:
First require the bundle with composer:
composer require symfony/assetic-bundle
Enable the bundle in the AppKernel.php file
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
);
// ...
}
}
add the following minimal configuration to your config.yml file to enable Assetic
# app/config/config.yml
assetic:
debug: '%kernel.debug%'
use_controller: '%kernel.debug%'
filters:
cssrewrite: ~

ember-data mappings for sideloading revision 11

What has happened to mappings to the revision 11 ember-data with regard to sideloading?
I have the following 2 model classes:
WZ.Exercise = WZ.Model.extend
name: DS.attr 'string'
description: DS.attr 'string'
group: DS.belongsTo('WZ.Group', {key: 'groups'}) #I don't think the key does anything
WZ.Group = WZ.Model.extend
name: DS.attr 'string'
exercises: DS.hasMany('WZ.Exercise')
Previously I had a mappings property on the adapter which no longer seems to do anything:
WZ.Store = DS.Store.extend
revision: 11
adapter: DS.RESTAdapter.create
bulkCommit: false
mappings:
groups: WZ.Group
The sideloading code expects the sideloaded root json property to be the same as the property name:
for (var prop in json) {
if (!json.hasOwnProperty(prop)) { continue; }
if (prop === root) { continue; }
if (prop === this.configOption(type, 'meta')) { continue; }
sideloadedType = type.typeForRelationship(prop);
I don't see anyway to get round this. Either the json is in the state the code expects or it will not work.
This is how I sideload data:
DS.RESTAdapter.configure('App.Groups', {
sideloadAs: 'groups'
});
App.Store = DS.Store.extend({
revision: 11,
adapter: DS.RESTAdapter.create({})
});
I encountered a similar problem and found a mapping in the ember_data_example project that resolved it for me. In my case, a ticketEntries: hasMany('App.TicketEntry') was not loading.
// Prepare our global Ember Data 'store'
App.RESTSerializer = DS.RESTSerializer.extend({
init: function() {
this._super();
this.map('App.Ticket', {
creator: {embedded: 'always'},
ticketEntries: {embedded: 'always'}
});
}
});
App.Adapter = DS.RESTAdapter.extend({
bulkCommit: false,
serializer: App.RESTSerializer.create()
});
App.Store = DS.Store.extend({
revision: 11,
adapter: App.Adapter.create()
});
App.store = App.Store.create(
);