@arrirpc/codegen-dart 0.49.0 → 0.50.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +1114 -914
- package/dist/index.d.cts +26 -38
- package/dist/index.d.mts +26 -38
- package/dist/index.d.ts +26 -38
- package/dist/index.mjs +1121 -919
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
@@ -1,48 +1,36 @@
|
|
1
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
2
|
-
import {
|
2
|
+
import { AppDefinition, Schema } from '@arrirpc/codegen-utils';
|
3
3
|
|
4
|
-
interface
|
4
|
+
interface CodegenContext {
|
5
5
|
clientName: string;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
versionNumber: string;
|
6
|
+
modelPrefix: string;
|
7
|
+
generatedTypes: string[];
|
8
|
+
instancePath: string;
|
9
|
+
schemaPath: string;
|
10
|
+
clientVersion?: string;
|
11
|
+
isOptional?: boolean;
|
12
|
+
discriminatorParentId?: string;
|
13
|
+
discriminatorValue?: string;
|
14
|
+
discriminatorKey?: string;
|
16
15
|
}
|
17
|
-
declare function dartServiceFromDefinition(name: string, def: ServiceDefinition, opts: ServiceOptions): string;
|
18
|
-
declare function dartRpcFromDefinition(key: string, def: RpcDefinition, opts: DartClientGeneratorOptions): string;
|
19
|
-
declare function dartHttpRpcFromSchema(key: string, def: HttpRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
20
|
-
declare function dartWsRpcFromSchema(key: string, def: WsRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
21
|
-
declare function dartTypeFromJtdSchema(
|
22
|
-
/**
|
23
|
-
* location in the tree i.e User.reviews.id
|
24
|
-
*/
|
25
|
-
nodePath: string, def: Schema, additionalOptions: ConversionAdditionalOptions): DartProperty;
|
26
|
-
declare function dartClassFromJtdSchema(nodePath: string, def: SchemaFormProperties, additionalOptions: ConversionAdditionalOptions & {
|
27
|
-
isException?: boolean;
|
28
|
-
discriminatorOptions?: {
|
29
|
-
discriminatorKey: string;
|
30
|
-
discriminatorValue: string;
|
31
|
-
discriminatorParentClassName: string;
|
32
|
-
};
|
33
|
-
}): DartProperty;
|
34
16
|
interface DartProperty {
|
35
17
|
typeName: string;
|
36
|
-
|
37
|
-
constructorTemplate: string;
|
38
|
-
fromJsonTemplate: (input: string) => string;
|
39
|
-
toJsonTemplate: (input: string) => string;
|
18
|
+
isNullable: boolean;
|
40
19
|
content: string;
|
20
|
+
defaultValue: string;
|
21
|
+
fromJson: (input: string, key?: string) => string;
|
22
|
+
toJson: (input: string, target: string, key: string) => string;
|
23
|
+
toQueryString: (input: string, target: string, key: string) => string;
|
41
24
|
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
25
|
+
|
26
|
+
interface DartClientGeneratorOptions {
|
27
|
+
outputFile: string;
|
28
|
+
clientName?: string;
|
29
|
+
modelPrefix?: string;
|
30
|
+
format?: boolean;
|
46
31
|
}
|
32
|
+
declare const dartClientGenerator: _arrirpc_codegen_utils.ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
33
|
+
declare function createDartClient(def: AppDefinition, options: DartClientGeneratorOptions): string;
|
34
|
+
declare function dartTypeFromSchema(schema: Schema, context: CodegenContext): DartProperty;
|
47
35
|
|
48
|
-
export {
|
36
|
+
export { type DartClientGeneratorOptions, createDartClient, dartClientGenerator, dartTypeFromSchema };
|
package/dist/index.d.mts
CHANGED
@@ -1,48 +1,36 @@
|
|
1
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
2
|
-
import {
|
2
|
+
import { AppDefinition, Schema } from '@arrirpc/codegen-utils';
|
3
3
|
|
4
|
-
interface
|
4
|
+
interface CodegenContext {
|
5
5
|
clientName: string;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
versionNumber: string;
|
6
|
+
modelPrefix: string;
|
7
|
+
generatedTypes: string[];
|
8
|
+
instancePath: string;
|
9
|
+
schemaPath: string;
|
10
|
+
clientVersion?: string;
|
11
|
+
isOptional?: boolean;
|
12
|
+
discriminatorParentId?: string;
|
13
|
+
discriminatorValue?: string;
|
14
|
+
discriminatorKey?: string;
|
16
15
|
}
|
17
|
-
declare function dartServiceFromDefinition(name: string, def: ServiceDefinition, opts: ServiceOptions): string;
|
18
|
-
declare function dartRpcFromDefinition(key: string, def: RpcDefinition, opts: DartClientGeneratorOptions): string;
|
19
|
-
declare function dartHttpRpcFromSchema(key: string, def: HttpRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
20
|
-
declare function dartWsRpcFromSchema(key: string, def: WsRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
21
|
-
declare function dartTypeFromJtdSchema(
|
22
|
-
/**
|
23
|
-
* location in the tree i.e User.reviews.id
|
24
|
-
*/
|
25
|
-
nodePath: string, def: Schema, additionalOptions: ConversionAdditionalOptions): DartProperty;
|
26
|
-
declare function dartClassFromJtdSchema(nodePath: string, def: SchemaFormProperties, additionalOptions: ConversionAdditionalOptions & {
|
27
|
-
isException?: boolean;
|
28
|
-
discriminatorOptions?: {
|
29
|
-
discriminatorKey: string;
|
30
|
-
discriminatorValue: string;
|
31
|
-
discriminatorParentClassName: string;
|
32
|
-
};
|
33
|
-
}): DartProperty;
|
34
16
|
interface DartProperty {
|
35
17
|
typeName: string;
|
36
|
-
|
37
|
-
constructorTemplate: string;
|
38
|
-
fromJsonTemplate: (input: string) => string;
|
39
|
-
toJsonTemplate: (input: string) => string;
|
18
|
+
isNullable: boolean;
|
40
19
|
content: string;
|
20
|
+
defaultValue: string;
|
21
|
+
fromJson: (input: string, key?: string) => string;
|
22
|
+
toJson: (input: string, target: string, key: string) => string;
|
23
|
+
toQueryString: (input: string, target: string, key: string) => string;
|
41
24
|
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
25
|
+
|
26
|
+
interface DartClientGeneratorOptions {
|
27
|
+
outputFile: string;
|
28
|
+
clientName?: string;
|
29
|
+
modelPrefix?: string;
|
30
|
+
format?: boolean;
|
46
31
|
}
|
32
|
+
declare const dartClientGenerator: _arrirpc_codegen_utils.ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
33
|
+
declare function createDartClient(def: AppDefinition, options: DartClientGeneratorOptions): string;
|
34
|
+
declare function dartTypeFromSchema(schema: Schema, context: CodegenContext): DartProperty;
|
47
35
|
|
48
|
-
export {
|
36
|
+
export { type DartClientGeneratorOptions, createDartClient, dartClientGenerator, dartTypeFromSchema };
|
package/dist/index.d.ts
CHANGED
@@ -1,48 +1,36 @@
|
|
1
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
2
|
-
import {
|
2
|
+
import { AppDefinition, Schema } from '@arrirpc/codegen-utils';
|
3
3
|
|
4
|
-
interface
|
4
|
+
interface CodegenContext {
|
5
5
|
clientName: string;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
versionNumber: string;
|
6
|
+
modelPrefix: string;
|
7
|
+
generatedTypes: string[];
|
8
|
+
instancePath: string;
|
9
|
+
schemaPath: string;
|
10
|
+
clientVersion?: string;
|
11
|
+
isOptional?: boolean;
|
12
|
+
discriminatorParentId?: string;
|
13
|
+
discriminatorValue?: string;
|
14
|
+
discriminatorKey?: string;
|
16
15
|
}
|
17
|
-
declare function dartServiceFromDefinition(name: string, def: ServiceDefinition, opts: ServiceOptions): string;
|
18
|
-
declare function dartRpcFromDefinition(key: string, def: RpcDefinition, opts: DartClientGeneratorOptions): string;
|
19
|
-
declare function dartHttpRpcFromSchema(key: string, def: HttpRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
20
|
-
declare function dartWsRpcFromSchema(key: string, def: WsRpcDefinition, _opts: DartClientGeneratorOptions): string;
|
21
|
-
declare function dartTypeFromJtdSchema(
|
22
|
-
/**
|
23
|
-
* location in the tree i.e User.reviews.id
|
24
|
-
*/
|
25
|
-
nodePath: string, def: Schema, additionalOptions: ConversionAdditionalOptions): DartProperty;
|
26
|
-
declare function dartClassFromJtdSchema(nodePath: string, def: SchemaFormProperties, additionalOptions: ConversionAdditionalOptions & {
|
27
|
-
isException?: boolean;
|
28
|
-
discriminatorOptions?: {
|
29
|
-
discriminatorKey: string;
|
30
|
-
discriminatorValue: string;
|
31
|
-
discriminatorParentClassName: string;
|
32
|
-
};
|
33
|
-
}): DartProperty;
|
34
16
|
interface DartProperty {
|
35
17
|
typeName: string;
|
36
|
-
|
37
|
-
constructorTemplate: string;
|
38
|
-
fromJsonTemplate: (input: string) => string;
|
39
|
-
toJsonTemplate: (input: string) => string;
|
18
|
+
isNullable: boolean;
|
40
19
|
content: string;
|
20
|
+
defaultValue: string;
|
21
|
+
fromJson: (input: string, key?: string) => string;
|
22
|
+
toJson: (input: string, target: string, key: string) => string;
|
23
|
+
toQueryString: (input: string, target: string, key: string) => string;
|
41
24
|
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
25
|
+
|
26
|
+
interface DartClientGeneratorOptions {
|
27
|
+
outputFile: string;
|
28
|
+
clientName?: string;
|
29
|
+
modelPrefix?: string;
|
30
|
+
format?: boolean;
|
46
31
|
}
|
32
|
+
declare const dartClientGenerator: _arrirpc_codegen_utils.ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
33
|
+
declare function createDartClient(def: AppDefinition, options: DartClientGeneratorOptions): string;
|
34
|
+
declare function dartTypeFromSchema(schema: Schema, context: CodegenContext): DartProperty;
|
47
35
|
|
48
|
-
export {
|
36
|
+
export { type DartClientGeneratorOptions, createDartClient, dartClientGenerator, dartTypeFromSchema };
|