Skip to content

Commit aff867f

Browse files
committed
Update to latest vue usage
1 parent 15da94d commit aff867f

File tree

5 files changed

+281
-14
lines changed

5 files changed

+281
-14
lines changed

MyApp/components.d.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
// biome-ignore lint: disable
4+
export {}
5+
6+
/* prettier-ignore */
7+
declare module '@vue/runtime-core' {
8+
export interface GlobalComponents {
9+
Alert: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Alert'];
10+
AlertSuccess: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AlertSuccess'];
11+
ErrorSummary: typeof import('./wwwroot/lib/typings/@servicestack/vue')['ErrorSummary'];
12+
InputDescription: typeof import('./wwwroot/lib/typings/@servicestack/vue')['InputDescription'];
13+
Icon: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Icon'];
14+
Loading: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Loading'];
15+
16+
OutlineButton: typeof import('./wwwroot/lib/typings/@servicestack/vue')['OutlineButton'];
17+
PrimaryButton: typeof import('./wwwroot/lib/typings/@servicestack/vue')['PrimaryButton'];
18+
SecondaryButton: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SecondaryButton'];
19+
TextLink: typeof import('./wwwroot/lib/typings/@servicestack/vue')['TextLink'];
20+
21+
Breadcrumbs: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Breadcrumbs'];
22+
Breadcrumb: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Breadcrumb'];
23+
NavList: typeof import('./wwwroot/lib/typings/@servicestack/vue')['NavList'];
24+
NavListItem: typeof import('./wwwroot/lib/typings/@servicestack/vue')['NavListItem'];
25+
26+
AutoQueryGrid: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoQueryGrid'];
27+
SettingsIcons: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SettingsIcons'];
28+
FilterViews: typeof import('./wwwroot/lib/typings/@servicestack/vue')['FilterViews'];
29+
FilterColumn: typeof import('./wwwroot/lib/typings/@servicestack/vue')['FilterColumn'];
30+
QueryPrefs: typeof import('./wwwroot/lib/typings/@servicestack/vue')['QueryPrefs'];
31+
EnsureAccess: typeof import('./wwwroot/lib/typings/@servicestack/vue')['EnsureAccess'];
32+
EnsureAccessDialog: typeof import('./wwwroot/lib/typings/@servicestack/vue')['EnsureAccessDialog'];
33+
34+
TextInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['TextInput'];
35+
TextareaInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['TextareaInput'];
36+
SelectInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SelectInput'];
37+
CheckboxInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['CheckboxInput'];
38+
TagInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['TagInput'];
39+
FileInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['FileInput'];
40+
Autocomplete: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Autocomplete'];
41+
Combobox: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Combobox'];
42+
DynamicInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['DynamicInput'];
43+
LookupInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['LookupInput'];
44+
45+
AutoFormFields: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoFormFields'];
46+
AutoForm: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoForm'];
47+
AutoCreateForm: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoCreateForm'];
48+
AutoEditForm: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoEditForm'];
49+
AutoViewForm: typeof import('./wwwroot/lib/typings/@servicestack/vue')['AutoViewForm'];
50+
ConfirmDelete: typeof import('./wwwroot/lib/typings/@servicestack/vue')['ConfirmDelete'];
51+
FormLoading: typeof import('./wwwroot/lib/typings/@servicestack/vue')['FormLoading'];
52+
53+
DataGrid: typeof import('./wwwroot/lib/typings/@servicestack/vue')['DataGrid'];
54+
CellFormat: typeof import('./wwwroot/lib/typings/@servicestack/vue')['CellFormat'];
55+
PreviewFormat: typeof import('./wwwroot/lib/typings/@servicestack/vue')['PreviewFormat'];
56+
HtmlFormat: typeof import('./wwwroot/lib/typings/@servicestack/vue')['HtmlFormat'];
57+
MarkupFormat: typeof import('./wwwroot/lib/typings/@servicestack/vue')['MarkupFormat'];
58+
MarkupModel: typeof import('./wwwroot/lib/typings/@servicestack/vue')['MarkupModel'];
59+
60+
CloseButton: typeof import('./wwwroot/lib/typings/@servicestack/vue')['CloseButton'];
61+
SlideOver: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SlideOver'];
62+
ModalDialog: typeof import('./wwwroot/lib/typings/@servicestack/vue')['ModalDialog'];
63+
ModalLookup: typeof import('./wwwroot/lib/typings/@servicestack/vue')['ModalLookup'];
64+
Tabs: typeof import('./wwwroot/lib/typings/@servicestack/vue')['Tabs'];
65+
66+
DarkModeToggle: typeof import('./wwwroot/lib/typings/@servicestack/vue')['DarkModeToggle'];
67+
SignIn: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SignIn'];
68+
MarkdownInput: typeof import('./wwwroot/lib/typings/@servicestack/vue')['MarkdownInput'];
69+
SidebarLayout: typeof import('./wwwroot/lib/typings/@servicestack/vue')['SidebarLayout'];
70+
}
71+
}

MyApp/tsconfig.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@
55
"baseUrl": "./",
66
"typeRoots": ["./wwwroot/lib/typings"],
77
"experimentalDecorators": true,
8+
"allowJs": true,
9+
"noEmit": true,
10+
"lib": [
11+
"ES2020",
12+
"DOM",
13+
"DOM.Iterable"
14+
],
815
"paths": {
9-
"*": [
10-
"./wwwroot/lib/*",
11-
"./wwwroot/lib/typings/*"
12-
],
13-
"vue": [ "./wwwroot/lib/typings/vue/index.d.ts" ],
14-
"@servicestack/client": [ "./wwwroot/lib/typings/@servicestack/client/index.d.ts" ],
15-
"@servicestack/vue": [ "./wwwroot/lib/typings/@servicestack/vue/index.d.ts" ]
16+
"*": [
17+
"./wwwroot/lib/*",
18+
"./wwwroot/lib/typings/*"
19+
],
20+
"vue": [ "./wwwroot/lib/typings/vue/index.d.ts" ],
21+
"@servicestack/client": [ "./wwwroot/lib/typings/@servicestack/client/index.d.ts" ],
22+
"@servicestack/vue": [ "./wwwroot/lib/typings/@servicestack/vue/index.d.ts" ]
1623
}
1724
},
25+
"include": [
26+
"./wwwroot/**/*",
27+
"./components.d.ts"
28+
],
1829
"exclude": [
1930
"node_modules"
2031
]

MyApp/wwwroot/pages/Account/Manage/EnableAuthenticator.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addScript, $1 } from "@servicestack/client"
2-
const loadJs = addScript('lib/js/qrcode.min.js')
2+
const loadJs = addScript('../../../lib/js/qrcode.min.js')
33

44
export default {
55
async load() {

MyApp/wwwroot/pages/Account/Manage/ManageUserApiKeys.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ref, computed, onMounted, inject } from "vue"
1+
import { ref, computed, onMounted } from "vue"
22
import { ApiResult, toDate } from "@servicestack/client"
3-
import { useClient, useUtils, useFormatters, useMetadata, css } from "@servicestack/vue"
4-
import { QueryUserApiKeys, CreateUserApiKey, UpdateUserApiKey, DeleteUserApiKey } from "./dtos.mjs"
3+
import { useClient, useUtils, useFormatters, css } from "@servicestack/vue"
4+
import { QueryUserApiKeys, CreateUserApiKey, UpdateUserApiKey, DeleteUserApiKey } from "./apikeys-apis.mjs"
55

66
function arraysAreEqual(a, b) {
77
if (!a || !b) return false
@@ -11,7 +11,7 @@ function arraysAreEqual(a, b) {
1111
const CopyIcon = {
1212
template:`
1313
<div @click="copy(text)">
14-
<div class="cursor-pointer select-none p-1 rounded-md border block border-gray-200 bg-white hover:bg-gray-50">
14+
<div class="cursor-pointer select-none p-1 rounded-md border block border-gray-200 dark:border-gray-700 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900">
1515
<svg v-if="copied" class="w-6 h-6 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>
1616
<svg v-else xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-gray-500" viewBox="0 0 24 24"><g fill="none"><path d="M8 5H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1M8 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M8 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m0 0h2a2 2 0 0 1 2 2v3m2 4H10m0 0l3-3m-3 3l3 3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g></svg>
1717
</div>
@@ -101,7 +101,7 @@ const CreateApiKeyForm = {
101101
</div>
102102
</div>
103103
</div>
104-
<div class="px-4 py-3 bg-gray-50 text-right sm:px-6 flex justify-between">
104+
<div class="px-4 py-3 bg-gray-50 dark:bg-gray-900 text-right sm:px-6 flex justify-between">
105105
<div>
106106
<SecondaryButton @click="$emit('done')">Cancel</SecondaryButton>
107107
</div>
@@ -220,7 +220,7 @@ const EditApiKeyForm = {
220220
</div>
221221
</div>
222222
</div>
223-
<div class="px-4 py-3 bg-gray-50 text-right sm:px-6 flex justify-between">
223+
<div class="px-4 py-3 bg-gray-50 dark:bg-gray-900 text-right sm:px-6 flex justify-between">
224224
<div>
225225
<ConfirmDelete @delete="submitDelete" />
226226
</div>
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/* Options:
2+
Date: 2024-06-06 02:20:36
3+
Version: 8.23
4+
Tip: To override a DTO option, remove "//" prefix before updating
5+
BaseUrl: https://localhost:5001
6+
7+
//AddServiceStackTypes: True
8+
//AddDocAnnotations: True
9+
//AddDescriptionAsComments: True
10+
IncludeTypes: QueryUserApiKeys.*,CreateUserApiKey.*,UpdateUserApiKey.*,DeleteUserApiKey.*
11+
//ExcludeTypes:
12+
//DefaultImports:
13+
*/
14+
15+
"use strict";
16+
export class ResponseError {
17+
/** @param {{errorCode?:string,fieldName?:string,message?:string,meta?:{ [index: string]: string; }}} [init] */
18+
constructor(init) { Object.assign(this, init) }
19+
/** @type {string} */
20+
errorCode;
21+
/** @type {string} */
22+
fieldName;
23+
/** @type {string} */
24+
message;
25+
/** @type {{ [index: string]: string; }} */
26+
meta;
27+
}
28+
export class ResponseStatus {
29+
/** @param {{errorCode?:string,message?:string,stackTrace?:string,errors?:ResponseError[],meta?:{ [index: string]: string; }}} [init] */
30+
constructor(init) { Object.assign(this, init) }
31+
/** @type {string} */
32+
errorCode;
33+
/** @type {string} */
34+
message;
35+
/** @type {string} */
36+
stackTrace;
37+
/** @type {ResponseError[]} */
38+
errors;
39+
/** @type {{ [index: string]: string; }} */
40+
meta;
41+
}
42+
export class PartialApiKey {
43+
/** @param {{id?:number,name?:string,userId?:string,userName?:string,visibleKey?:string,environment?:string,createdDate?:string,expiryDate?:string,cancelledDate?:string,lastUsedDate?:string,scopes?:string[],features?:string[],restrictTo?:string[],notes?:string,refId?:number,refIdStr?:string,meta?:{ [index: string]: string; },active?:boolean}} [init] */
44+
constructor(init) { Object.assign(this, init) }
45+
/** @type {number} */
46+
id;
47+
/** @type {string} */
48+
name;
49+
/** @type {string} */
50+
userId;
51+
/** @type {string} */
52+
userName;
53+
/** @type {string} */
54+
visibleKey;
55+
/** @type {string} */
56+
environment;
57+
/** @type {string} */
58+
createdDate;
59+
/** @type {?string} */
60+
expiryDate;
61+
/** @type {?string} */
62+
cancelledDate;
63+
/** @type {?string} */
64+
lastUsedDate;
65+
/** @type {string[]} */
66+
scopes;
67+
/** @type {string[]} */
68+
features;
69+
/** @type {string[]} */
70+
restrictTo;
71+
/** @type {string} */
72+
notes;
73+
/** @type {?number} */
74+
refId;
75+
/** @type {string} */
76+
refIdStr;
77+
/** @type {{ [index: string]: string; }} */
78+
meta;
79+
/** @type {boolean} */
80+
active;
81+
}
82+
export class UserApiKeysResponse {
83+
/** @param {{results?:PartialApiKey[],responseStatus?:ResponseStatus}} [init] */
84+
constructor(init) { Object.assign(this, init) }
85+
/** @type {PartialApiKey[]} */
86+
results;
87+
/** @type {ResponseStatus} */
88+
responseStatus;
89+
}
90+
export class UserApiKeyResponse {
91+
/** @param {{result?:string,responseStatus?:ResponseStatus}} [init] */
92+
constructor(init) { Object.assign(this, init) }
93+
/** @type {string} */
94+
result;
95+
/** @type {ResponseStatus} */
96+
responseStatus;
97+
}
98+
export class EmptyResponse {
99+
/** @param {{responseStatus?:ResponseStatus}} [init] */
100+
constructor(init) { Object.assign(this, init) }
101+
/** @type {ResponseStatus} */
102+
responseStatus;
103+
}
104+
export class QueryUserApiKeys {
105+
/** @param {{id?:number,search?:string,orderBy?:string,skip?:number,take?:number}} [init] */
106+
constructor(init) { Object.assign(this, init) }
107+
/** @type {?number} */
108+
id;
109+
/** @type {string} */
110+
search;
111+
/** @type {string} */
112+
orderBy;
113+
/** @type {?number} */
114+
skip;
115+
/** @type {?number} */
116+
take;
117+
getTypeName() { return 'QueryUserApiKeys' }
118+
getMethod() { return 'GET' }
119+
createResponse() { return new UserApiKeysResponse() }
120+
}
121+
export class CreateUserApiKey {
122+
/** @param {{name?:string,scopes?:string[],features?:string[],restrictTo?:string[],expiryDate?:string,notes?:string,refId?:number,refIdStr?:string,meta?:{ [index: string]: string; }}} [init] */
123+
constructor(init) { Object.assign(this, init) }
124+
/** @type {string} */
125+
name;
126+
/** @type {string[]} */
127+
scopes;
128+
/** @type {string[]} */
129+
features;
130+
/** @type {string[]} */
131+
restrictTo;
132+
/** @type {?string} */
133+
expiryDate;
134+
/** @type {string} */
135+
notes;
136+
/** @type {?number} */
137+
refId;
138+
/** @type {string} */
139+
refIdStr;
140+
/** @type {{ [index: string]: string; }} */
141+
meta;
142+
getTypeName() { return 'CreateUserApiKey' }
143+
getMethod() { return 'POST' }
144+
createResponse() { return new UserApiKeyResponse() }
145+
}
146+
export class UpdateUserApiKey {
147+
/** @param {{id?:number,name?:string,scopes?:string[],features?:string[],restrictTo?:string[],expiryDate?:string,cancelledDate?:string,notes?:string,refId?:number,refIdStr?:string,meta?:{ [index: string]: string; },reset?:string[]}} [init] */
148+
constructor(init) { Object.assign(this, init) }
149+
/** @type {number} */
150+
id;
151+
/** @type {string} */
152+
name;
153+
/** @type {string[]} */
154+
scopes;
155+
/** @type {string[]} */
156+
features;
157+
/** @type {string[]} */
158+
restrictTo;
159+
/** @type {?string} */
160+
expiryDate;
161+
/** @type {?string} */
162+
cancelledDate;
163+
/** @type {string} */
164+
notes;
165+
/** @type {?number} */
166+
refId;
167+
/** @type {string} */
168+
refIdStr;
169+
/** @type {{ [index: string]: string; }} */
170+
meta;
171+
/** @type {string[]} */
172+
reset;
173+
getTypeName() { return 'UpdateUserApiKey' }
174+
getMethod() { return 'PATCH' }
175+
createResponse() { return new EmptyResponse() }
176+
}
177+
export class DeleteUserApiKey {
178+
/** @param {{id?:number}} [init] */
179+
constructor(init) { Object.assign(this, init) }
180+
/** @type {?number} */
181+
id;
182+
getTypeName() { return 'DeleteUserApiKey' }
183+
getMethod() { return 'DELETE' }
184+
createResponse() { return new EmptyResponse() }
185+
}

0 commit comments

Comments
 (0)