cds2types icon indicating copy to clipboard operation
cds2types copied to clipboard

Add support for self-referenced types

Open mattreddy3 opened this issue 2 years ago • 0 comments

Hi,

Thanks as always for maintaining this project! Wanted to ask for an enhancement. We sometimes reference field types across entity definitions (not necessarily referencing a distinct type declaration). For example:

entity MyEntity {
  Field1: String; // We will reference this field
  Field2: Integer;
}

entity TypeRefEntity { 
  Field3: MyEntity:Field1; // Should resolve to `String` as type
}

Here is an example of where this currently fails: image The error is _a.includes is not a function since _a is not a string as expected.

I'm using [email protected] - not sure if that is the problem? As a workaroudn I will try to explicitly type these.

mattreddy3 avatar May 08 '23 07:05 mattreddy3

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Mar 31 '24 18:03 github-actions[bot]

@JuhaszBalint2 - I suspect this is because pins are applied per-user, meaning that when you apply a pin as SYSTEM, the package is only pinned for SYSTEM. When you apply a pin as a user, it is pinned for only that user and not for SYSTEM

Unless you have a specific need for it, I would highly recommend avoiding using the SYSTEM context

Trenly avatar Apr 01 '24 01:04 Trenly

@JuhaszBalint2 - I suspect this is because pins are applied per-user, meaning that when you apply a pin as SYSTEM, the package is only pinned for SYSTEM.

Unless you have a specific need for it, I would highly recommend avoiding using the SYSTEM context

I do have a specific need for it hence my use

I forgot I'd applied the pin script in the user context. Is that why?

JuhaszBalint2 avatar Apr 01 '24 01:04 JuhaszBalint2

I do have a specific need for it hence my use

I forgot I'd applied the pin script in the user context. Is that why?

Yes. If you applied the pin in the user context then the pin only exists for that user.

Can you explain a bit more about your specific need to run as SYSTEM? @denelon is working on documenting what the current behaviors are and understanding what you’re trying to accomplish will help him

Trenly avatar Apr 01 '24 01:04 Trenly

[Policy] Issue-Docs [Policy] Area-User-Interface

Trenly avatar Apr 01 '24 01:04 Trenly

I do have a specific need for it hence my use I forgot I'd applied the pin script in the user context. Is that why?

Yes. If you applied the pin in the user context then the pin only exists for that user.

Can you explain a bit more about your specific need to run as SYSTEM? @denelon is working on documenting what the current behaviors are and understanding what you’re trying to accomplish will help him

Basically I deploy software onto my workstations and upgrade them via winget and chocolatey. In an ideal environment including my homelab, I do NOT want the end-user to be met with UAC prompts or any pop-ups of any sort whatsoever. I want my environments locked down to the max yet still perfectly usable for the optimal end-user experience and security.

JuhaszBalint2 avatar Apr 01 '24 02:04 JuhaszBalint2

[Policy] Issue-Docs [Policy] Area-User-Interface

Btw winget pin add (ApID) --blocking --scope machine isn!'t working. Is there something that will apply the blocking pin as SYSTEM?

JuhaszBalint2 avatar Apr 01 '24 03:04 JuhaszBalint2

Pinning should be managed by an admin for the machine, meaning it shouldn't be per user. Software are installed machine wide after all.

Zulgrib avatar Apr 08 '24 08:04 Zulgrib