arri 0.0.2 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/acorn.cjs +18 -0
- package/dist/chunks/acorn.mjs +15 -0
- package/dist/chunks/angular.cjs +7 -0
- package/dist/chunks/angular.mjs +4 -0
- package/dist/chunks/babel.cjs +21 -0
- package/dist/chunks/babel.mjs +18 -0
- package/dist/chunks/estree.cjs +42 -0
- package/dist/chunks/estree.mjs +37 -0
- package/dist/chunks/flow.cjs +26 -0
- package/dist/chunks/flow.mjs +23 -0
- package/dist/chunks/glimmer.cjs +37 -0
- package/dist/chunks/glimmer.mjs +32 -0
- package/dist/chunks/graphql.cjs +37 -0
- package/dist/chunks/graphql.mjs +31 -0
- package/dist/chunks/html.cjs +27 -0
- package/dist/chunks/html.mjs +21 -0
- package/dist/chunks/markdown.cjs +67 -0
- package/dist/chunks/markdown.mjs +61 -0
- package/dist/chunks/meriyah.cjs +10 -0
- package/dist/chunks/meriyah.mjs +7 -0
- package/dist/chunks/postcss.cjs +60 -0
- package/dist/chunks/postcss.mjs +54 -0
- package/dist/chunks/typescript.cjs +30 -0
- package/dist/chunks/typescript.mjs +27 -0
- package/dist/chunks/yaml.cjs +169 -0
- package/dist/chunks/yaml.mjs +163 -0
- package/dist/codegen/index.cjs +29866 -0
- package/dist/codegen/index.d.cts +60 -0
- package/dist/codegen/index.d.mts +60 -0
- package/dist/codegen/index.d.ts +60 -0
- package/dist/codegen/index.mjs +29837 -0
- package/dist/index.cjs +21 -4424
- package/dist/index.d.cts +20 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.ts +18 -39
- package/dist/index.mjs +1 -4417
- package/dist/shared/arri.215ad025.mjs +8482 -0
- package/dist/shared/arri.c20aaf19.d.cts +148 -0
- package/dist/shared/arri.c20aaf19.d.mts +148 -0
- package/dist/shared/arri.c20aaf19.d.ts +148 -0
- package/dist/shared/arri.e2731572.cjs +8509 -0
- package/package.json +27 -19
- package/dist/chunks/index.cjs +0 -9499
- package/dist/chunks/index.mjs +0 -9477
- package/dist/cli.cjs +0 -29556
- package/dist/cli.d.ts +0 -2
- package/dist/cli.mjs +0 -29514
- package/dist/shared/arri.6ae90bdf.mjs +0 -181
- package/dist/shared/arri.8d738145.cjs +0 -185
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { B as ApplicationDefinition, S as ServiceDefinition, P as ProcedureDefinition, J as JsonSchemaObject } from '../shared/arri.c20aaf19.cjs';
|
|
2
|
+
import '@sinclair/typebox';
|
|
3
|
+
import 'h3';
|
|
4
|
+
|
|
5
|
+
interface ClientGenerator<TOptions extends Record<string, any> | undefined> {
|
|
6
|
+
generator: (def: ApplicationDefinition) => any;
|
|
7
|
+
options: TOptions;
|
|
8
|
+
}
|
|
9
|
+
type ClientGeneratorPlugin<TOptions extends Record<string, any> | undefined> = (options: TOptions) => ClientGenerator<TOptions>;
|
|
10
|
+
declare function defineClientGeneratorPlugin<TOptions extends Record<string, any> | undefined>(plugin: ClientGeneratorPlugin<TOptions>): ClientGeneratorPlugin<TOptions>;
|
|
11
|
+
|
|
12
|
+
interface TypescriptClientGeneratorOptions {
|
|
13
|
+
name: string;
|
|
14
|
+
outputFile: string;
|
|
15
|
+
}
|
|
16
|
+
declare const typescriptClientGenerator: ClientGeneratorPlugin<TypescriptClientGeneratorOptions>;
|
|
17
|
+
declare function createTypescriptClient(def: ApplicationDefinition, prefix?: string): Promise<string>;
|
|
18
|
+
declare function tsServiceFromServiceDefinition(name: string, def: ServiceDefinition): string;
|
|
19
|
+
declare function tsRpcFromProcedureDefinition(name: string, def: ProcedureDefinition): string;
|
|
20
|
+
declare function tsModelFromDefinition(name: string, def: JsonSchemaObject): string;
|
|
21
|
+
|
|
22
|
+
interface DartClientGeneratorOptions {
|
|
23
|
+
clientName: string;
|
|
24
|
+
outputFile: string;
|
|
25
|
+
}
|
|
26
|
+
declare const dartClientGenerator: ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
|
27
|
+
declare function createDartClient(appDef: ApplicationDefinition, prefix?: string): string;
|
|
28
|
+
declare function dartServiceFromServiceDefinition(name: string, def: ServiceDefinition, prefix?: string): string;
|
|
29
|
+
declare function dartModelFromJsonSchema(name: string, schema: JsonSchemaObject): string;
|
|
30
|
+
declare function dartPropertyTypeFromSchema(objectName: string, propertyName: string, schema: JsonSchemaObject): [DartType | string, string[] | undefined];
|
|
31
|
+
declare function dartParsedJsonField(fieldName: string, dartType: string): string;
|
|
32
|
+
declare const dartTypeMap: {
|
|
33
|
+
readonly integer: "int";
|
|
34
|
+
readonly bigint: "int";
|
|
35
|
+
readonly number: "double";
|
|
36
|
+
readonly string: "String";
|
|
37
|
+
readonly boolean: "bool";
|
|
38
|
+
readonly null: "null";
|
|
39
|
+
readonly Date: "DateTime";
|
|
40
|
+
readonly object: undefined;
|
|
41
|
+
readonly list: undefined;
|
|
42
|
+
readonly undefined: undefined;
|
|
43
|
+
readonly array: undefined;
|
|
44
|
+
readonly Uint8Array: "Uint8List";
|
|
45
|
+
};
|
|
46
|
+
interface DartMappedType {
|
|
47
|
+
classBody?: string;
|
|
48
|
+
fromJsonBody: (jsonKey: string, fallback: string) => string;
|
|
49
|
+
toJsonBody: (key: string, isNullable?: boolean) => string;
|
|
50
|
+
}
|
|
51
|
+
declare const transformers: Record<DartType, DartMappedType>;
|
|
52
|
+
declare const classTransformer: (typename: string, nullable: boolean) => DartMappedType;
|
|
53
|
+
declare const classListTransformer: (typename: string) => DartMappedType;
|
|
54
|
+
type DartBaseType = Exclude<(typeof dartTypeMap)[keyof typeof dartTypeMap], undefined>;
|
|
55
|
+
type DartType = DartBaseType | `List<${DartBaseType}>`;
|
|
56
|
+
type DartTypeWithNullables = DartType | Exclude<`${DartType}?`, "null?">;
|
|
57
|
+
declare function isDartType(input: any): input is DartType;
|
|
58
|
+
declare function isDartTypeWithNullables(input: any): input is DartTypeWithNullables;
|
|
59
|
+
|
|
60
|
+
export { type ClientGenerator, type ClientGeneratorPlugin, type DartBaseType, type DartClientGeneratorOptions, type DartType, type DartTypeWithNullables, classListTransformer, classTransformer, createDartClient, createTypescriptClient, dartClientGenerator, dartModelFromJsonSchema, dartParsedJsonField, dartPropertyTypeFromSchema, dartServiceFromServiceDefinition, defineClientGeneratorPlugin, isDartType, isDartTypeWithNullables, transformers, tsModelFromDefinition, tsRpcFromProcedureDefinition, tsServiceFromServiceDefinition, typescriptClientGenerator };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { B as ApplicationDefinition, S as ServiceDefinition, P as ProcedureDefinition, J as JsonSchemaObject } from '../shared/arri.c20aaf19.mjs';
|
|
2
|
+
import '@sinclair/typebox';
|
|
3
|
+
import 'h3';
|
|
4
|
+
|
|
5
|
+
interface ClientGenerator<TOptions extends Record<string, any> | undefined> {
|
|
6
|
+
generator: (def: ApplicationDefinition) => any;
|
|
7
|
+
options: TOptions;
|
|
8
|
+
}
|
|
9
|
+
type ClientGeneratorPlugin<TOptions extends Record<string, any> | undefined> = (options: TOptions) => ClientGenerator<TOptions>;
|
|
10
|
+
declare function defineClientGeneratorPlugin<TOptions extends Record<string, any> | undefined>(plugin: ClientGeneratorPlugin<TOptions>): ClientGeneratorPlugin<TOptions>;
|
|
11
|
+
|
|
12
|
+
interface TypescriptClientGeneratorOptions {
|
|
13
|
+
name: string;
|
|
14
|
+
outputFile: string;
|
|
15
|
+
}
|
|
16
|
+
declare const typescriptClientGenerator: ClientGeneratorPlugin<TypescriptClientGeneratorOptions>;
|
|
17
|
+
declare function createTypescriptClient(def: ApplicationDefinition, prefix?: string): Promise<string>;
|
|
18
|
+
declare function tsServiceFromServiceDefinition(name: string, def: ServiceDefinition): string;
|
|
19
|
+
declare function tsRpcFromProcedureDefinition(name: string, def: ProcedureDefinition): string;
|
|
20
|
+
declare function tsModelFromDefinition(name: string, def: JsonSchemaObject): string;
|
|
21
|
+
|
|
22
|
+
interface DartClientGeneratorOptions {
|
|
23
|
+
clientName: string;
|
|
24
|
+
outputFile: string;
|
|
25
|
+
}
|
|
26
|
+
declare const dartClientGenerator: ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
|
27
|
+
declare function createDartClient(appDef: ApplicationDefinition, prefix?: string): string;
|
|
28
|
+
declare function dartServiceFromServiceDefinition(name: string, def: ServiceDefinition, prefix?: string): string;
|
|
29
|
+
declare function dartModelFromJsonSchema(name: string, schema: JsonSchemaObject): string;
|
|
30
|
+
declare function dartPropertyTypeFromSchema(objectName: string, propertyName: string, schema: JsonSchemaObject): [DartType | string, string[] | undefined];
|
|
31
|
+
declare function dartParsedJsonField(fieldName: string, dartType: string): string;
|
|
32
|
+
declare const dartTypeMap: {
|
|
33
|
+
readonly integer: "int";
|
|
34
|
+
readonly bigint: "int";
|
|
35
|
+
readonly number: "double";
|
|
36
|
+
readonly string: "String";
|
|
37
|
+
readonly boolean: "bool";
|
|
38
|
+
readonly null: "null";
|
|
39
|
+
readonly Date: "DateTime";
|
|
40
|
+
readonly object: undefined;
|
|
41
|
+
readonly list: undefined;
|
|
42
|
+
readonly undefined: undefined;
|
|
43
|
+
readonly array: undefined;
|
|
44
|
+
readonly Uint8Array: "Uint8List";
|
|
45
|
+
};
|
|
46
|
+
interface DartMappedType {
|
|
47
|
+
classBody?: string;
|
|
48
|
+
fromJsonBody: (jsonKey: string, fallback: string) => string;
|
|
49
|
+
toJsonBody: (key: string, isNullable?: boolean) => string;
|
|
50
|
+
}
|
|
51
|
+
declare const transformers: Record<DartType, DartMappedType>;
|
|
52
|
+
declare const classTransformer: (typename: string, nullable: boolean) => DartMappedType;
|
|
53
|
+
declare const classListTransformer: (typename: string) => DartMappedType;
|
|
54
|
+
type DartBaseType = Exclude<(typeof dartTypeMap)[keyof typeof dartTypeMap], undefined>;
|
|
55
|
+
type DartType = DartBaseType | `List<${DartBaseType}>`;
|
|
56
|
+
type DartTypeWithNullables = DartType | Exclude<`${DartType}?`, "null?">;
|
|
57
|
+
declare function isDartType(input: any): input is DartType;
|
|
58
|
+
declare function isDartTypeWithNullables(input: any): input is DartTypeWithNullables;
|
|
59
|
+
|
|
60
|
+
export { type ClientGenerator, type ClientGeneratorPlugin, type DartBaseType, type DartClientGeneratorOptions, type DartType, type DartTypeWithNullables, classListTransformer, classTransformer, createDartClient, createTypescriptClient, dartClientGenerator, dartModelFromJsonSchema, dartParsedJsonField, dartPropertyTypeFromSchema, dartServiceFromServiceDefinition, defineClientGeneratorPlugin, isDartType, isDartTypeWithNullables, transformers, tsModelFromDefinition, tsRpcFromProcedureDefinition, tsServiceFromServiceDefinition, typescriptClientGenerator };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { B as ApplicationDefinition, S as ServiceDefinition, P as ProcedureDefinition, J as JsonSchemaObject } from '../shared/arri.c20aaf19.js';
|
|
2
|
+
import '@sinclair/typebox';
|
|
3
|
+
import 'h3';
|
|
4
|
+
|
|
5
|
+
interface ClientGenerator<TOptions extends Record<string, any> | undefined> {
|
|
6
|
+
generator: (def: ApplicationDefinition) => any;
|
|
7
|
+
options: TOptions;
|
|
8
|
+
}
|
|
9
|
+
type ClientGeneratorPlugin<TOptions extends Record<string, any> | undefined> = (options: TOptions) => ClientGenerator<TOptions>;
|
|
10
|
+
declare function defineClientGeneratorPlugin<TOptions extends Record<string, any> | undefined>(plugin: ClientGeneratorPlugin<TOptions>): ClientGeneratorPlugin<TOptions>;
|
|
11
|
+
|
|
12
|
+
interface TypescriptClientGeneratorOptions {
|
|
13
|
+
name: string;
|
|
14
|
+
outputFile: string;
|
|
15
|
+
}
|
|
16
|
+
declare const typescriptClientGenerator: ClientGeneratorPlugin<TypescriptClientGeneratorOptions>;
|
|
17
|
+
declare function createTypescriptClient(def: ApplicationDefinition, prefix?: string): Promise<string>;
|
|
18
|
+
declare function tsServiceFromServiceDefinition(name: string, def: ServiceDefinition): string;
|
|
19
|
+
declare function tsRpcFromProcedureDefinition(name: string, def: ProcedureDefinition): string;
|
|
20
|
+
declare function tsModelFromDefinition(name: string, def: JsonSchemaObject): string;
|
|
21
|
+
|
|
22
|
+
interface DartClientGeneratorOptions {
|
|
23
|
+
clientName: string;
|
|
24
|
+
outputFile: string;
|
|
25
|
+
}
|
|
26
|
+
declare const dartClientGenerator: ClientGeneratorPlugin<DartClientGeneratorOptions>;
|
|
27
|
+
declare function createDartClient(appDef: ApplicationDefinition, prefix?: string): string;
|
|
28
|
+
declare function dartServiceFromServiceDefinition(name: string, def: ServiceDefinition, prefix?: string): string;
|
|
29
|
+
declare function dartModelFromJsonSchema(name: string, schema: JsonSchemaObject): string;
|
|
30
|
+
declare function dartPropertyTypeFromSchema(objectName: string, propertyName: string, schema: JsonSchemaObject): [DartType | string, string[] | undefined];
|
|
31
|
+
declare function dartParsedJsonField(fieldName: string, dartType: string): string;
|
|
32
|
+
declare const dartTypeMap: {
|
|
33
|
+
readonly integer: "int";
|
|
34
|
+
readonly bigint: "int";
|
|
35
|
+
readonly number: "double";
|
|
36
|
+
readonly string: "String";
|
|
37
|
+
readonly boolean: "bool";
|
|
38
|
+
readonly null: "null";
|
|
39
|
+
readonly Date: "DateTime";
|
|
40
|
+
readonly object: undefined;
|
|
41
|
+
readonly list: undefined;
|
|
42
|
+
readonly undefined: undefined;
|
|
43
|
+
readonly array: undefined;
|
|
44
|
+
readonly Uint8Array: "Uint8List";
|
|
45
|
+
};
|
|
46
|
+
interface DartMappedType {
|
|
47
|
+
classBody?: string;
|
|
48
|
+
fromJsonBody: (jsonKey: string, fallback: string) => string;
|
|
49
|
+
toJsonBody: (key: string, isNullable?: boolean) => string;
|
|
50
|
+
}
|
|
51
|
+
declare const transformers: Record<DartType, DartMappedType>;
|
|
52
|
+
declare const classTransformer: (typename: string, nullable: boolean) => DartMappedType;
|
|
53
|
+
declare const classListTransformer: (typename: string) => DartMappedType;
|
|
54
|
+
type DartBaseType = Exclude<(typeof dartTypeMap)[keyof typeof dartTypeMap], undefined>;
|
|
55
|
+
type DartType = DartBaseType | `List<${DartBaseType}>`;
|
|
56
|
+
type DartTypeWithNullables = DartType | Exclude<`${DartType}?`, "null?">;
|
|
57
|
+
declare function isDartType(input: any): input is DartType;
|
|
58
|
+
declare function isDartTypeWithNullables(input: any): input is DartTypeWithNullables;
|
|
59
|
+
|
|
60
|
+
export { type ClientGenerator, type ClientGeneratorPlugin, type DartBaseType, type DartClientGeneratorOptions, type DartType, type DartTypeWithNullables, classListTransformer, classTransformer, createDartClient, createTypescriptClient, dartClientGenerator, dartModelFromJsonSchema, dartParsedJsonField, dartPropertyTypeFromSchema, dartServiceFromServiceDefinition, defineClientGeneratorPlugin, isDartType, isDartTypeWithNullables, transformers, tsModelFromDefinition, tsRpcFromProcedureDefinition, tsServiceFromServiceDefinition, typescriptClientGenerator };
|