-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdtos.ts
337 lines (281 loc) · 9.24 KB
/
dtos.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/* Options:
Date: 2021-02-25 19:01:55
Version: 5.105
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://localhost:5002
//GlobalNamespace:
//MakePropertiesOptional: False
//AddServiceStackTypes: True
//AddResponseStatus: False
//AddImplicitVersion:
//AddDescriptionAsComments: True
//IncludeTypes:
//ExcludeTypes:
//DefaultImports:
*/
export interface IReturn<T>
{
createResponse(): T;
}
export interface IReturnVoid
{
createResponse(): void;
}
// @DataContract
export class ResponseError
{
// @DataMember(Order=1)
public errorCode: string;
// @DataMember(Order=2)
public fieldName: string;
// @DataMember(Order=3)
public message: string;
// @DataMember(Order=4)
public meta: { [index: string]: string; };
public constructor(init?: Partial<ResponseError>) { (Object as any).assign(this, init); }
}
// @DataContract
export class ResponseStatus
{
// @DataMember(Order=1)
public errorCode: string;
// @DataMember(Order=2)
public message: string;
// @DataMember(Order=3)
public stackTrace: string;
// @DataMember(Order=4)
public errors: ResponseError[];
// @DataMember(Order=5)
public meta: { [index: string]: string; };
public constructor(init?: Partial<ResponseStatus>) { (Object as any).assign(this, init); }
}
export class MetadataTypesConfig
{
public baseUrl: string;
public usePath: string;
public makePartial: boolean;
public makeVirtual: boolean;
public makeInternal: boolean;
public baseClass: string;
public package: string;
public addReturnMarker: boolean;
public addDescriptionAsComments: boolean;
public addDataContractAttributes: boolean;
public addIndexesToDataMembers: boolean;
public addGeneratedCodeAttributes: boolean;
public addImplicitVersion?: number;
public addResponseStatus: boolean;
public addServiceStackTypes: boolean;
public addModelExtensions: boolean;
public addPropertyAccessors: boolean;
public excludeGenericBaseTypes: boolean;
public settersReturnThis: boolean;
public makePropertiesOptional: boolean;
public exportAsTypes: boolean;
public excludeImplementedInterfaces: boolean;
public addDefaultXmlNamespace: string;
public makeDataContractsExtensible: boolean;
public initializeCollections: boolean;
public addNamespaces: string[];
public defaultNamespaces: string[];
public defaultImports: string[];
public includeTypes: string[];
public excludeTypes: string[];
public treatTypesAsStrings: string[];
public exportValueTypes: boolean;
public globalNamespace: string;
public excludeNamespace: boolean;
public ignoreTypes: string[];
public exportTypes: string[];
public exportAttributes: string[];
public ignoreTypesInNamespaces: string[];
public constructor(init?: Partial<MetadataTypesConfig>) { (Object as any).assign(this, init); }
}
export class MetadataTypeName
{
public name: string;
public namespace: string;
public genericArgs: string[];
public constructor(init?: Partial<MetadataTypeName>) { (Object as any).assign(this, init); }
}
export class MetadataDataContract
{
public name: string;
public namespace: string;
public constructor(init?: Partial<MetadataDataContract>) { (Object as any).assign(this, init); }
}
export class MetadataDataMember
{
public name: string;
public order?: number;
public isRequired?: boolean;
public emitDefaultValue?: boolean;
public constructor(init?: Partial<MetadataDataMember>) { (Object as any).assign(this, init); }
}
export class MetadataAttribute
{
public name: string;
public constructorArgs: MetadataPropertyType[];
public args: MetadataPropertyType[];
public constructor(init?: Partial<MetadataAttribute>) { (Object as any).assign(this, init); }
}
export class MetadataPropertyType
{
public name: string;
public type: string;
public isValueType?: boolean;
public isSystemType?: boolean;
public isEnum?: boolean;
public isPrimaryKey?: boolean;
public typeNamespace: string;
public genericArgs: string[];
public value: string;
public description: string;
public dataMember: MetadataDataMember;
public readOnly?: boolean;
public paramType: string;
public displayType: string;
public isRequired?: boolean;
public allowableValues: string[];
public allowableMin?: number;
public allowableMax?: number;
public attributes: MetadataAttribute[];
public constructor(init?: Partial<MetadataPropertyType>) { (Object as any).assign(this, init); }
}
export class MetadataType
{
public name: string;
public namespace: string;
public genericArgs: string[];
public inherits: MetadataTypeName;
public implements: MetadataTypeName[];
public displayType: string;
public description: string;
public isNested?: boolean;
public isEnum?: boolean;
public isEnumInt?: boolean;
public isInterface?: boolean;
public isAbstract?: boolean;
public dataContract: MetadataDataContract;
public properties: MetadataPropertyType[];
public attributes: MetadataAttribute[];
public innerTypes: MetadataTypeName[];
public enumNames: string[];
public enumValues: string[];
public enumMemberValues: string[];
public enumDescriptions: string[];
public meta: { [index: string]: string; };
public constructor(init?: Partial<MetadataType>) { (Object as any).assign(this, init); }
}
export class MetadataRoute
{
public path: string;
public verbs: string;
public notes: string;
public summary: string;
public constructor(init?: Partial<MetadataRoute>) { (Object as any).assign(this, init); }
}
export class MetadataOperationType
{
public request: MetadataType;
public response: MetadataType;
public actions: string[];
public returnsVoid: boolean;
public returnType: MetadataTypeName;
public routes: MetadataRoute[];
public dataModel: MetadataTypeName;
public viewModel: MetadataTypeName;
public requiresAuth: boolean;
public requiredRoles: string[];
public requiresAnyRole: string[];
public requiredPermissions: string[];
public requiresAnyPermission: string[];
public tags: string[];
public constructor(init?: Partial<MetadataOperationType>) { (Object as any).assign(this, init); }
}
export class MetadataTypes
{
public config: MetadataTypesConfig;
public namespaces: string[];
public types: MetadataType[];
public operations: MetadataOperationType[];
public constructor(init?: Partial<MetadataTypes>) { (Object as any).assign(this, init); }
}
export class GetSiteInfoLanguagesResponse
{
public baseUrl: string;
public slug: string;
public languages: { [index: string]: string; };
public responseStatus: ResponseStatus;
public constructor(init?: Partial<GetSiteInfoLanguagesResponse>) { (Object as any).assign(this, init); }
}
export class SiteMetaResponse
{
public api: MetadataTypes;
public responseStatus: ResponseStatus;
public constructor(init?: Partial<SiteMetaResponse>) { (Object as any).assign(this, init); }
}
// @Route("/sites")
// @Route("/sites/{Slug}/languages")
export class GetSiteInfoLanguages implements IReturn<GetSiteInfoLanguagesResponse>
{
public baseUrl: string;
public slug: string;
public constructor(init?: Partial<GetSiteInfoLanguages>) { (Object as any).assign(this, init); }
public createResponse() { return new GetSiteInfoLanguagesResponse(); }
public getTypeName() { return 'GetSiteInfoLanguages'; }
}
// @DataContract
export class SiteInvoke implements IReturn<string>
{
// @DataMember(Order=1)
public slug: string;
// @DataMember(Order=2)
public request: string;
// @DataMember(Order=3)
public args: string[];
public constructor(init?: Partial<SiteInvoke>) { (Object as any).assign(this, init); }
public createResponse() { return ''; }
public getTypeName() { return 'SiteInvoke'; }
}
// @DataContract
export class SiteProxy implements IReturn<Uint8Array>
{
// @DataMember(Order=1)
public slug: string;
// @DataMember(Order=2)
public request: string;
// @DataMember(Order=3)
public query: string[];
public constructor(init?: Partial<SiteProxy>) { (Object as any).assign(this, init); }
public createResponse() { return new Uint8Array(0); }
public getTypeName() { return 'SiteProxy'; }
}
// @Route("/gists")
// @Route("/gists/{Slug}/{Lang}")
// @Route("/gists/{Slug}/{Lang}/{IncludeTypes}")
export class GistRef
{
public slug: string;
public lang: string;
public includeTypes: string;
public noCache?: boolean;
public constructor(init?: Partial<GistRef>) { (Object as any).assign(this, init); }
}
// @Route("/gists/files/{Slug}/{Lang}/{File}")
export class GistRefFile
{
public slug: string;
public lang: string;
public file: string;
public constructor(init?: Partial<GistRefFile>) { (Object as any).assign(this, init); }
}
// @Route("/sites/{Slug}/meta")
export class SiteMeta implements IReturn<SiteMetaResponse>
{
public slug: string;
public noCache?: boolean;
public constructor(init?: Partial<SiteMeta>) { (Object as any).assign(this, init); }
public createResponse() { return new SiteMetaResponse(); }
public getTypeName() { return 'SiteMeta'; }
}