Giter VIP home page Giter VIP logo

Comments (9)

tyduptyler13 avatar tyduptyler13 commented on August 20, 2024 1

This is something I can change in our client builder type mapping file. I will look into fixing it.

from fusionauth-typescript-client.

han4wluc avatar han4wluc commented on August 20, 2024

I am attempting to register a user with data. But the data is always empty. I suspect this may be because the data is a Map type. Same thing if I try to use the updateUser, patchUser API.

import { FusionAuthClient } from '@fusionauth/typescript-client'

const client = new FusionAuthClient(
  'xxxx',
  'http://localhost:9011'
)

const main = async () => {
  try {
    const res = await client.register(undefined, {
      user: {
        username: 'bbbwer',
        password: 'rqergeq34aL',
        data: new Map([
          ['aaa', 'one'],
          ['bb', 'eee'],
          ['displayName', 'zERwje']
        ])
      },
      registration: {
        applicationId: '3149641a-81d8-4202-9715-7d5367ca94f1',
      }
    })

    console.warn('res', res)
  } catch (error) {
    console.warn('error', JSON.stringify(error, null, 2))
  }
}

main()

If I run the code. response is:

res ClientResponse {
  statusCode: 200,
  response: {
    registration: {
      applicationId: '3149641a-81d8-4202-9715-7d5367ca94f1',
      id: '0e29262e-fb33-4b13-8498-eccd22141f18',
      insertInstant: 1584104747639,
      usernameStatus: 'ACTIVE',
      verified: true
    },
    user: {
      active: true,
      id: '7abf7a10-13eb-4f26-8cb2-52338fdc7421',
      insertInstant: 1584104747566,
      passwordChangeRequired: false,
      passwordLastUpdateInstant: 1584104747601,
      tenantId: '3e75863b-17bd-712f-22c6-d884ba501412',
      twoFactorDelivery: 'None',
      twoFactorEnabled: false,
      username: 'bbbwer',
      usernameStatus: 'ACTIVE',
      verified: true
    }
  }
}

There is no data field.

Screen Shot 2020-03-13 at 2 07 35 PM

from fusionauth-typescript-client.

rintaun avatar rintaun commented on August 20, 2024

@han4wluc try using a normal object instead of a Map, e.g.

{
  aaa: 'one',
  bb: 'eee',
  displayName: 'zERwje',
}

from fusionauth-typescript-client.

han4wluc avatar han4wluc commented on August 20, 2024

@han4wluc try using a normal object instead of a Map, e.g.

{
  aaa: 'one',
  bb: 'eee',
  displayName: 'zERwje',
}

Yes, I have tried, but this way I get a type error.

Screen Shot 2020-03-13 at 2 26 13 PM

from fusionauth-typescript-client.

rintaun avatar rintaun commented on August 20, 2024

have you tried suppressing the error with @ts-ignore? if not, I would check to see if that works; that type error is incorrect because the Map type is being used incorrectly.

from fusionauth-typescript-client.

han4wluc avatar han4wluc commented on August 20, 2024

have you tried suppressing the error with @ts-ignore? if not, I would check to see if that works; that type error is incorrect because the Map type is being used incorrectly.

Yes, it works with @ts-ignore. Thank you. I will use this workaround for now.

from fusionauth-typescript-client.

robotdan avatar robotdan commented on August 20, 2024

Thanks @rintaun for the assist!

@tyduptyler13 Is this something we can incorporate into our client library to make this work a bit better?

from fusionauth-typescript-client.

tyduptyler13 avatar tyduptyler13 commented on August 20, 2024

Published the change in 1.15.8. Let me know if you have any problems.

from fusionauth-typescript-client.

rintaun avatar rintaun commented on August 20, 2024

@tyduptyler13 is there a particular reason for the choice to use a custom ObjectMap<K,T> type over the built-in Record<K,T>? It looks like its doing the same thing

from fusionauth-typescript-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.