indirectus's People
indirectus's Issues
Feature request : --output for output file path
Hello,
Just a feature request to add the output file of the generated type file and either with it don't keep the json file or delete if after conversion.
Thanks
Field generated as unknown
I don't know if it's still WIP of if there is an issue but all my field are marked as unknown;
export interface ExtraDirectusUser {
private_key: Optional<
UnknownType<{
schema: {
raw: {
collection: "directus_users";
field: "private_key";
type: "string";
schema: {
name: "private_key";
table: "directus_users";
data_type: "varchar";
default_value: null;
max_length: 255;
numeric_precision: null;
numeric_scale: null;
is_generated: false;
generation_expression: null;
is_nullable: true;
is_unique: false;
is_primary_key: false;
has_auto_increment: false;
foreign_key_column: null;
foreign_key_table: null;
};
meta: {
id: 40;
collection: "directus_users";
field: "private_key";
special: null;
interface: "input";
options: null;
display: null;
display_options: null;
readonly: false;
hidden: false;
sort: 1;
width: "half";
translations: null;
note: null;
conditions: null;
required: false;
group: null;
validation: null;
validation_message: null;
};
};
raw_relation: null;
};
meta: {
id: 40;
collection: "directus_users";
field: "private_key";
special: null;
interface: "input";
options: null;
display: null;
display_options: null;
readonly: false;
hidden: false;
sort: 1;
width: "half";
translations: null;
note: null;
conditions: null;
required: false;
group: null;
validation: null;
validation_message: null;
};
}>
>;
...
{
"collection": "directus_users",
"field": "private_key",
"type": "string",
"schema": {
"name": "private_key",
"table": "directus_users",
"data_type": "varchar",
"default_value": null,
"max_length": 255,
"numeric_precision": null,
"numeric_scale": null,
"is_generated": false,
"generation_expression": null,
"is_nullable": true,
"is_unique": false,
"is_primary_key": false,
"has_auto_increment": false,
"foreign_key_column": null,
"foreign_key_table": null
},
"meta": {
"id": 40,
"collection": "directus_users",
"field": "private_key",
"special": null,
"interface": "input",
"options": null,
"display": null,
"display_options": null,
"readonly": false,
"hidden": false,
"sort": 1,
"width": "half",
"translations": null,
"note": null,
"conditions": null,
"required": false,
"group": null,
"validation": null,
"validation_message": null
}
},
Thanks for your help
Bug: types for v11 does not work
Description of the bug
the system types does not work for the v11 instance
Steps To Reproduce
No response
Additional Information
No response
Bug: Decimal fields are typed as "number" when in reality a formatted string is returned
Description of the bug
When a field in directus is set to type "decimal" (for finances for example), the generated types say the response is a number, when in reality it is a formatted string, such as "100.00"
Steps To Reproduce
No response
Additional Information
No response
TypeError: Cannot read properties of null (reading 'one_collection')
In https://github.com/linefusion/indirectus/blob/main/packages/cli/types/relationships.ts at line 117
when you have field = public_favicon
and collection = directus_settings
throw error Cannot read properties of null (reading 'one_collection')
to quick fix you need to add if (relationship.collection === collection && relationship.field === field && relationship.field !== 'public_favicon')
directus:10.7.0
Bug: types safety does not work when using instance.createUser()
Description of the bug
when using the instance created by createTypesClient the function createUser does not have the same type safety as if i do DirectusSDKcreateUser()
type collections = {
directus_users: {
namteste: Types.Optional<Types.String>
}[]
}
const directus = createTypedClient('http://localhost:8055')
directus.createUser({
test: 'test', <- error: Object literal may only specify known properties, and 'test' does not exist in type X
})
directus.request(
DirectusSDK.createUser({
test: 'test', <- no error
})
)
Steps To Reproduce
- create a new field inside the collection user like test: string
- generate the client.ts
- use the createTypedClient to generate a new instanceOfDirectus with the custom function
- use the function instance.createUser and see that the property test is not infered as a property required in createUser
- however: when using the request cunction i have the infered type (directus.request(DirectusDSK.createUser({test: 'test'}))<- no error)
Additional Information
No response
Bug: `--fetch` effect should be the default one?
Description of the bug
I find it confusing a bit that the cached schema is playing a role in the final client.ts
generation.
I continuously tried to regen each time not knowing why it did not change, so I figured out I have to use the --fetch
command.
I think the effect of the --fetch
flag should be the default and possibly introduce a --with-cache
flag to use the cache instead if needed?
Steps To Reproduce
No response
Additional Information
No response
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.