okai 0.0.37 → 0.0.39

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/icons.js CHANGED
@@ -154,6 +154,7 @@ export const IconMap = {
154
154
  Refund: S(`0 0 20 20`, `<path fill='currentColor' fill-rule='evenodd' d='M5 2a2 2 0 0 0-2 2v14l3.5-2l3.5 2l3.5-2l3.5 2V4a2 2 0 0 0-2-2zm4.707 3.707a1 1 0 0 0-1.414-1.414l-3 3a1 1 0 0 0 0 1.414l3 3a1 1 0 0 0 1.414-1.414L8.414 9H10a3 3 0 0 1 3 3v1a1 1 0 1 0 2 0v-1a5 5 0 0 0-5-5H8.414z' clip-rule='evenodd'/>`),
155
155
  Play: S(`0 0 24 24`, `<path fill='currentColor' d='M8 5.14v14l11-7z'/>`),
156
156
  Result: S(`0 0 2048 2048`, `<path fill='currentColor' d='M2048 640v640h-768v512H128v128H0V0h128v128h1408v512zM128 256v384h1280V256zm1024 1408v-384H128v384zm768-512V768H128v384z'/>`),
157
+ Auction: S(`0 0 24 24`, `<path fill="currentColor" d="M14.005 20.003v2h-12v-2zM14.59.689l7.778 7.778l-1.414 1.414l-1.061-.353l-2.475 2.475l5.657 5.657l-1.414 1.414l-5.657-5.657l-2.404 2.404l.283 1.132l-1.415 1.414l-7.778-7.778l1.414-1.415l1.132.283l6.293-6.293l-.353-1.06zm.707 3.536l-7.071 7.07l3.535 3.536l7.071-7.07z"/>`),
157
158
  /** CMS */
158
159
  Page: S('0 0 24 24', `<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'><path d='M4 21.4V2.6a.6.6 0 0 1 .6-.6h11.652a.6.6 0 0 1 .424.176l3.148 3.148A.6.6 0 0 1 20 5.75V21.4a.6.6 0 0 1-.6.6H4.6a.6.6 0 0 1-.6-.6M8 10h8m-8 8h8m-8-4h4'/><path d='M16 2v3.4a.6.6 0 0 0 .6.6H20'/></g>`),
159
160
  Tag: S('0 0 24 24', `<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'><path d='M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0-2 0'/><path d='M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592-5.592a2.41 2.41 0 0 0 0-3.408l-7.71-7.71A2 2 0 0 0 11.172 3H6a3 3 0 0 0-3 3'/></g>`),
@@ -173,7 +174,7 @@ export const IconMap = {
173
174
  Email: S('0 0 24 24', `<path fill='currentColor' d='M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0l-8 5l-8-5zm0 12H4V8l8 5l8-5z'/>`),
174
175
  News: S('0 0 20 20', `<path fill='currentColor' d='M3 6c0-1.1.9-2 2-2h8l4-4h2v16h-2l-4-4H5a2 2 0 0 1-2-2H1V6zm8 9v5H8l-1.67-5H5v-2h8v2z'/>`),
175
176
  Search: S('0 0 24 24', `<path fill='currentColor' d='m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3zM9.5 14q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14'/>`),
176
- Save: S('0 0 24 24', `<path fill='currentColor' d='M7 19v-6h10v6h2V7.828L16.172 5H5v14zM4 3h13l4 4v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m5 12v4h6v-4z'/></`),
177
+ Save: S('0 0 24 24', `<path fill='currentColor' d='M7 19v-6h10v6h2V7.828L16.172 5H5v14zM4 3h13l4 4v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m5 12v4h6v-4z'/>`),
177
178
  /** Formatting */
178
179
  PlainText: S(`0 0 256 256`, `<path fill='currentColor' d='M212 56v32a12 12 0 0 1-24 0V68h-48v120h20a12 12 0 0 1 0 24H96a12 12 0 0 1 0-24h20V68H68v20a12 12 0 0 1-24 0V56a12 12 0 0 1 12-12h144a12 12 0 0 1 12 12Z'/>`),
179
180
  Markup: S(`0 0 24 24`, `<path fill='currentColor' d='M10 20q-.425 0-.713-.288T9 19v-5q-2.075 0-3.538-1.463T4 9q0-2.075 1.463-3.538T9 4h8q.425 0 .713.288T18 5q0 .425-.288.713T17 6h-1v13q0 .425-.288.713T15 20q-.425 0-.713-.288T14 19V6h-3v13q0 .425-.288.713T10 20Z'/>`),
@@ -183,6 +184,7 @@ export const IconMap = {
183
184
  Alert: S(`0 0 24 24`, `<path fill='currentColor' d='M12 2L1 21h22M12 6l7.53 13H4.47M11 10v4h2v-4m-2 6v2h2v-2'/>`),
184
185
  Data: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 12v5c0 1.657-2.686 3-6 3s-6-1.343-6-3v-5m12 0V7m0 5c0 1.657-2.686 3-6 3s-6-1.343-6-3m12-5c0-1.657-2.686-3-6-3S6 5.343 6 7m12 0c0 1.657-2.686 3-6 3S6 8.657 6 7m0 5V7'/>`),
185
186
  Tool: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 10h3V7L6.5 3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1-3 3l-6-6a6 6 0 0 1-8-8z'/>`),
187
+ Chip: S('0 0 512 512', `<rect width="352" height="352" x="80" y="80" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" rx="48" ry="48"/><rect width="224" height="224" x="144" y="144" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" rx="16" ry="16"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 80V48m80 32V48M176 80V48m80 416v-32m80 32v-32m-160 32v-32m256-176h32m-32 80h32m-32-160h32M48 256h32m-32 80h32M48 176h32"/>`),
186
188
  /** Actions */
187
189
  Completed: S(`0 0 2048 2048`, `<path fill='currentColor' d='M1024 0q141 0 272 36t244 104t207 160t161 207t103 245t37 272q0 141-36 272t-104 244t-160 207t-207 161t-245 103t-272 37q-141 0-272-36t-244-104t-207-160t-161-207t-103-245t-37-272q0-141 36-272t104-244t160-207t207-161T752 37t272-37m603 685l-136-136l-659 659l-275-275l-136 136l411 411z'/>`),
188
190
  Failed: S(`0 0 2048 2048`, `<path fill='currentColor' d='M1024 0q141 0 272 36t244 104t207 160t161 207t103 245t37 272q0 141-36 272t-104 244t-160 207t-207 161t-245 103t-272 37q-141 0-272-36t-244-104t-207-160t-161-207t-103-245t-37-272q0-141 36-272t104-244t160-207t207-161T752 37t272-37m113 1024l342-342l-113-113l-342 342l-342-342l-113 113l342 342l-342 342l113 113l342-342l342 342l113-113z'/>`),
@@ -233,7 +235,7 @@ export const IconGroups = {
233
235
  Post: ['Posting'],
234
236
  Content: ['Website', 'Blog', 'Template', 'LandingPage', 'Portal', 'Workspace'],
235
237
  Menu: ['Nav', 'Form', 'MenuList'],
236
- Skill: ['Qualification', 'Certification', 'Experience', 'Training', 'Requirement'],
238
+ Skill: ['Qualification', 'Certification', 'Experience', 'Training', 'Requirement', 'Bid'],
237
239
  Analytics: ['Level', 'Metric', 'Kpi', 'Goal', 'Objective'],
238
240
  Review: ['Audit', 'Status'],
239
241
  Comment: ['Feedback'],
@@ -250,6 +252,7 @@ export const IconGroups = {
250
252
  Channel: ['Stream', 'Broadcast', 'Feed', 'Session'],
251
253
  Search: ['Filter', 'Lookup', 'Query', 'Match'],
252
254
  Save: ['Saved', 'Archive', 'Backup', 'Download', 'Export'],
255
+ Chip: ['Hardware'],
253
256
  };
254
257
  export const Icons = withAliases(IconMap, IconGroups);
255
258
  const IconKeys = Object.keys(Icons).sort((a, b) => b.length - a.length);
package/dist/index.js CHANGED
@@ -162,7 +162,7 @@ export async function cli(cmdArgs) {
162
162
  uiMjsDir: "/path/to/MyApp/wwwroot/admin/sections",
163
163
  };
164
164
  fs.writeFileSync('okai.json', JSON.stringify(info, undefined, 2));
165
- console.log(`Added: okai.json`);
165
+ console.log(`Saved: okai.json`);
166
166
  process.exit(0);
167
167
  return;
168
168
  }
@@ -272,7 +272,7 @@ Options:
272
272
  if (command.type == "init" && command.info) {
273
273
  const toApiFile = path.join(info.serviceModelDir, 'api.d.ts');
274
274
  fs.copyFileSync(path.join(import.meta.dirname, 'api.d.ts'), toApiFile);
275
- console.log(`Added: ${toApiFile}`);
275
+ console.log(`Saved: ${toApiFile}`);
276
276
  let model = toPascalCase(leftPart(command.init, '.'));
277
277
  let groupName = plural(model);
278
278
  if (model == groupName) {
@@ -300,7 +300,6 @@ Options:
300
300
  tsdAst,
301
301
  uiFileName,
302
302
  });
303
- command.type = "update"; // let update handle the rest
304
303
  command.tsdFile = groupName + '.d.ts';
305
304
  fs.writeFileSync(path.join(info.serviceModelDir, command.tsdFile), tsdContent, { encoding: 'utf-8' });
306
305
  }
@@ -313,7 +312,7 @@ Options:
313
312
  }
314
313
  const toFile = path.join(info.serviceModelDir, 'api.d.ts');
315
314
  fs.copyFileSync(apiFile, toFile);
316
- console.log(`Added: ${toFile}`);
315
+ console.log(`Saved: ${toFile}`);
317
316
  process.exit(0);
318
317
  }
319
318
  else {
@@ -341,7 +340,7 @@ Options:
341
340
  ? path.join(info.slnDir, trimStart(filePath, '~/'))
342
341
  : path.join(process.cwd(), filePath);
343
342
  }
344
- if (command.type === "update") {
343
+ if (command.type === "update" || (command.type == "init" && command.info)) {
345
344
  let tsdPath = assertTsdPath(command.tsdFile);
346
345
  if (command.verbose)
347
346
  console.log(`Updating: ${tsdPath}...`);
@@ -415,9 +414,15 @@ Options:
415
414
  return;
416
415
  }
417
416
  else {
418
- regenerate(header, tsdContent, 'saved: ');
419
- console.log(`\nLast migration can be rerun with 'npm run rerun:last' or:`);
420
- console.log(`$ dotnet run --AppTasks=migrate.rerun:last`);
417
+ regenerate(header, tsdContent, 'Saved: ');
418
+ if (command.type == "init") {
419
+ console.log(`\nRun 'npm run migrate' to apply the new migration and create the new tables or:`);
420
+ console.log(`$ dotnet run --AppTasks=migrate`);
421
+ }
422
+ else {
423
+ console.log(`\nLast migration can be rerun with 'npm run rerun:last' or:`);
424
+ console.log(`$ dotnet run --AppTasks=migrate.rerun:last`);
425
+ }
421
426
  process.exit(0);
422
427
  }
423
428
  }
package/dist/ts-once.js CHANGED
@@ -45,23 +45,27 @@ export function transformUserRefs(tsAst, info) {
45
45
  prop.type = info.userType;
46
46
  if (!prop.annotations)
47
47
  prop.annotations = [];
48
- const attr = {
49
- name: 'reference',
50
- args: {
51
- selfId: 'createdBy',
52
- refId: 'userName',
53
- }
54
- };
55
- if (info.userLabel)
56
- attr.args.refLabel = info.userLabel;
57
- prop.annotations.push(attr);
48
+ if (!prop.annotations.find(x => x.name === 'reference')) {
49
+ const attr = {
50
+ name: 'reference',
51
+ args: {
52
+ selfId: 'createdBy',
53
+ refId: 'userName',
54
+ }
55
+ };
56
+ if (info.userLabel)
57
+ attr.args.refLabel = info.userLabel;
58
+ prop.annotations.push(attr);
59
+ }
58
60
  }
59
61
  if (prop.type === 'User[]') {
60
62
  if (info.userType) {
61
63
  prop.type = info.userType + '[]';
62
64
  if (!prop.annotations)
63
65
  prop.annotations = [];
64
- prop.annotations.push({ name: 'reference' });
66
+ if (!prop.annotations.find(x => x.name === 'reference')) {
67
+ prop.annotations.push({ name: 'reference' });
68
+ }
65
69
  const idPropType = cls.properties.find(x => x.name.toLowerCase() === 'id')?.type ?? 'number';
66
70
  // Add Many to Many User Table
67
71
  addClasses.push({
package/dist/ui-mjs.js CHANGED
@@ -34,12 +34,24 @@ export class UiMjsGroupGenerator {
34
34
  ` group: "${groupLabel}",`,
35
35
  ` items: {`,
36
36
  ...ast.types.filter(x => !x.isEnum && !x.isInterface && !this.ignore.includes(x.name)).map(x => {
37
+ const template = x.inherits?.name == 'AuditBase' ? [
38
+ `<AutoQueryGrid :type="type"`,
39
+ ` selected-columns="${x.properties.map(x => toCamelCase(x.name)).join(',')}">`,
40
+ ` <template #formfooter="{ form, type, apis, model, id }">`,
41
+ ` <AuditEvents v-if="form === 'edit'" class="mt-4" :key="id" :type="type" :id="id" />`,
42
+ ` </template>`,
43
+ `</AutoQueryGrid>`
44
+ ] : [
45
+ `<AutoQueryGrid :type="type"`,
46
+ ` selected-columns="${x.properties.map(x => toCamelCase(x.name)).join(',')}" />`,
47
+ ];
37
48
  return [
38
49
  ` ${plural(x.name)}: {`,
39
50
  ` type: '${x.name}',`,
40
51
  ` component: {`,
41
- ` template:\`<AutoQueryGrid :type="type"`,
42
- ` selected-columns="${x.properties.map(x => toCamelCase(x.name)).join(',')}" />\`,`,
52
+ ` template:\``,
53
+ ...template.map(x => ` ${x}`),
54
+ ` \`,`,
43
55
  ` },`,
44
56
  ` },`,
45
57
  ].join('\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.37",
4
+ "version": "0.0.39",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",