Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 16:43
    uniconstructor edited #4126
  • Jan 31 2019 16:41
    uniconstructor edited #4126
  • Jan 31 2019 16:41
    uniconstructor opened #4126
  • Jan 31 2019 03:44
    dzungh0ang closed #4123
  • Jan 30 2019 00:25
    techaks closed #4125
  • Jan 30 2019 00:02
    techaks edited #4125
  • Jan 30 2019 00:01
    techaks opened #4125
  • Jan 29 2019 23:33
    jkpulido opened #4124
  • Jan 29 2019 13:32
    nabdelgadir closed #4114
  • Jan 29 2019 09:17

    bajtos on add-node10

    (compare)

  • Jan 29 2019 07:13
    dzungh0ang opened #4123
  • Jan 29 2019 04:25
    dhmlau closed #3881
  • Jan 28 2019 13:14
    bajtos edited #4119
  • Jan 28 2019 12:47
    bajtos labeled #4121
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos assigned #4118
  • Jan 25 2019 19:50
    dhmlau closed #3906
  • Jan 25 2019 19:13
    mschnee synchronize #4119
Diana Lau
@dhmlau
@vu-cv , you can look up from the API docs: https://loopback.io/doc/en/lb4/apidocs.rest.openapispecoptions.html.
Unfortunately, there's some formatting issue from the tsdocs. Hope you're able to get what you're looking for.
wc167167167
@wc167167167
Hi guys, I am getting an type error using loopback rest, looks like it complains about the import lines in loopback (e.g. import http from 'https'). How can I safely use loopback without changing all my projects setting esModuleInterop to true or the allowDefaultImport to true?
fabianblaicher
@fabianblaicher
Hi. In the past it was possible to send an authenticated request by using access_token in the body in LB3. We have a user who implemented this and now we need to upgrade to a higher version of LB3. How can we continue to support access_token via body?
KingGoujian
@KingGoujian

Hi. Nested arrays are parsed incorrectly

this is the most simplified example
/api/v1/user/Persons?filter[where][and][0][id][inq][0]=f3e76860-32e2-494b-b03c-29064a1747d7
it gets parsed in loopback to this
{"where":{"and":[{"id":{"inq":{"[0]":"f3e76860-32e2-494b-b03c-29064a1747d7"}}}]}}
and this gives error message
"Error: The id property has invalid clause {\"inq\":{\"[0]\":\"f3e76860-32e2-494b-b03c-29064a1747d7\"}}: Error: Value is not an array or object with sequential numeric indices

Has anyone had this problem too? Couldn't find anything from documentation nor from google.

hakim
@hakim79192279_twitter
Hello,
I'm trying to increment a field via updateById rest call. Is there a way in loopback 4 to do it like in this stackoverflow answer in the extended operator part: https://stackoverflow.com/a/40760296/6468645 or I have to write a custom controller method passing $inc to repository? Oh and I'm using mongodb. Thank's for your answers!
KingGoujian
@KingGoujian

Hi. Nested arrays are parsed incorrectly

this is the most simplified example
/api/v1/user/Persons?filter[where][and][0][id][inq][0]=f3e76860-32e2-494b-b03c-29064a1747d7
it gets parsed in loopback to this
{"where":{"and":[{"id":{"inq":{"[0]":"f3e76860-32e2-494b-b03c-29064a1747d7"}}}]}}
and this gives error message
"Error: The id property has invalid clause {\"inq\":{\"[0]\":\"f3e76860-32e2-494b-b03c-29064a1747d7\"}}: Error: Value is not an array or object with sequential numeric indices

Has anyone had this problem too? Couldn't find anything from documentation nor from google.

I have posted this question in Stackoverflow. https://stackoverflow.com/questions/62573661/nested-arrays-are-parsed-incorrectly-in-loopback-3

Rifa Achrinza
@achrinza
Hi everyone; just a gentle reminder that Gitter is not actively monitored. Please consider asking in Slack instead (see: strongloop/loopback-next#5048).
This is where most of the community resides, and would allow more eyes to look into the issue.
Ashwanth Madhav
@AshwanthMadhav
"files": {
    "loopback#static": [
        {
            "params": "$!../client"
        },
        {
            "paths": [
                "/admin"
            ],
            "params": "$!../clientAdmin"
        },
    ]
},

This is my middleware. I want to add a route like
{
"paths": [
"/sponsor/.*"
],
"params": "$!../client"
},
Means for any url that coming with a /sponsor/xxx need to take the build

How to add?

byteware Monoga
@bytewareteam_gitlab
loopback 4?
byteware Monoga
@bytewareteam_gitlab
Hello, good morning, is there a way to validate the fields when uploading files?
@post('/create-advertising')
  async createAdvertising(
    @requestBody.file()
      request: Request,
    @inject(RestBindings.Http.RESPONSE) response: Response,
  ) {
    // Custom Multer Handler
    const handler = this.fileUploadFactoryService.makeHandler();
    return new Promise((resolve, reject) => {
      handler(request, response, (err: unknown) => {
        if (err) return reject(err);
        // Validate Body
        /**
         * I try to validate based on this scheme
         * getModelSchemaRef(AdvertisingDto),
         */
        resolve({
          files: request.files,
          body: request.body
        });
      });
    });
  }
Help me!
Joey Connor
@wildtangent

hi, i was working my way through the LB4 tutorial and got stuck when this error started getting thrown when running npm run build / npm run migrate

Migrating schemas (alter existing schema) Cannot migrate database schema Error: Cannot migrate models not attached to this datasource: TodoList Todo TodoListImage Note at /Users/~/~/code/~/api-test/node_modules/loopback-datasource-juggler/lib/datasource.js:1146:12

Tried reverting to earlier commits, destroying the db, etc but to no avail - any ideas?

debugging the connector inside lib/datasource seems to suggest it is finding the postgresql connector, but the models are not assigned to it
Joey Connor
@wildtangent
previously it had worked, while using the same project so something has gone wrong along the way, subsequent to the original migrations being run
:(
DB is postgres, running on docker, nothing fancy
Sam Yuan
@SamYuan1990
Hi guys, I have two questions, 1) I had a model as {id:int, name:string} , which I hope generate create and get api in swagger like create accept {name:string} but what I get from swagger for create is {id:int, name:string}from module definition.
Dan Stockham
@DanStockham
Anybody on right now?
Sri Swetha Kappagantula
@ksreeswetha_gitlab
Anybody available now?
Rifa Achrinza
@achrinza
Hi everyone, gentle reminder that Slack is the recommended platform for the community. A link can be found on https://loopback.io navbar. strongloop/loopback-next#5048 also documents this shift to Slack.
vincentmarkcelino
@vincentmarkcelino
Hi
I know it's old question but i cant really find solution for my issue

var app = require('../../server/server');
console.log(app.models.Book);

it gives me undefined.

im using 3.x anyway.
Antonio Vargas
@juanantoniodamianv
Hi all! Anybody here using loopback 3? How I can see what method of encryptation is used in the password encrypt?
Thinh Nguyen
@thinhnk
Hi everyone, i have an issue with define model relation
i have 3 table
1: user (id, username)
2: role (id, rolename, roleKey)
3: user_role (userid, roleKey)
how to define a relation user has many roles thought user_role table?
i'm use loopback3
Thinh Nguyen
@thinhnk
"roles": {
"type": "hasMany",
"model": "role",
"foreignKey": "userid",
"through": "user_role",
"keyThrough": "roleKey"
}
that's was not work now
Mohammad Hossein Mardani
@mhmardani
hi, guys, I'm node js developer with over 5 years experience and now I'm looking for a development team to join them for work on startups, open-source projects, is anyone here to accept me :)
Chinh Le
@dangchinh2501_gitlab
hi guys, do you have any guide/tutorial to learn more about loopback? I'm just starting out and there are not many tutorials I can find online, and most of them is just using the cli to generate code, it doesn't help me to understand and use the framework, is there any tutorial that not only use the cli but actually write some new code? Thank you so much for your time!
Diana Lau
@dhmlau
@dangchinh2501_gitlab, here is a YouTube video created by one of our maintainers: https://www.youtube.com/watch?v=cgBCRY169qg&feature=youtu.be. It explains pretty well about the framework.
Here is a list of tutorials: https://loopback.io/doc/en/lb4/Tutorials.html. Hope can help you started.
For further questions, please join our Slack community: https://join.slack.com/t/loopbackio/shared_invite/zt-8lbow73r-SKAKz61Vdao~_rGf91pcsw. Thanks!
C C Sreenidhin
@ccsreenidhin

Hi everyone,
I am working on creating dynamic models and repositories in lb4. I came across this issue:

'BookModel' refers to a value, but is being used as a type here. Did you mean 'typeof BookModel'. in
'''
const DynamicRepositoryClass = defineCrudRepositoryClass<
BookModel, // issue is here
typeof BookModel.prototype.id,
{}

>(BookModel);

'''
But if typeof is used I get an error as follows:

Type 'DynamicModelCtor<typeof Entity, { id: number; title?: string | undefined; }>' does not satisfy the constraint 'Entity'.

I used the Model definitions as given in the documentation https://loopback.io/doc/en/lb4/Dynamic-models-repositories-controllers.html#defining-a-datasource
'''
const bookDef = new ModelDefinition({
name: 'book',
properties: {
....
},
},
title: {
},
settings: {
idInjection: false,
mysql: {schema: 'test', table: 'BookStore'},
},
});

const BookModel = defineModelClass<typeof Entity, {id: number; title?: string}>(
  Entity,
  bookDef,
);

'''

Please help.

Eduardo Mazzucchelli
@emazzu
image.png
hi people,
can do this ??? and send email to one or two conector ??
Amin Azimi
@aminazimi_gitlab
hi , Can you help me , when i wanna to use lb4 discover it doesnt show any connetor?
Amin Azimi
@aminazimi_gitlab
nothing for lb4 discover?
Henrik Holst
@hholst80
How can I use json5 for the endpoints in LB?
Can I switch out the default JSON parser for JSON5 API somehow?
I could only find one single reference to JSON5.. by myself on a closed issue ;-) strongloop/loopback#4247
arun.jayapal
@deostroll
Hello world. In lb3 can we trap errors in a remote call in some middleware?
For e.g. consider there is a model. and we try to create a record via the http api POST /api/Customers with some irrelevant json data...
There would be some output on the console to this reflect this...
what middleware is responsible for that...? And how do I put my middleware before it?
arun.jayapal
@deostroll
Okay. never mind. I found the answer.
Mohammad Quadri
@quadrixm
Is there any example for using Email Datasource for sending email in lb4
sumit shivaji sale
@sumitsale
has any one implement mongodb audit log in lp4?