okai 0.0.43 → 0.0.45

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/cs-apis.js CHANGED
@@ -54,7 +54,7 @@ export class CSharpApiGenerator extends CSharpGenerator {
54
54
  }
55
55
  }
56
56
  for (const attr of this.sortAttributes(attrs)) {
57
- sb.push(this.toAttribtue(attr));
57
+ sb.push(this.toAttribute(attr));
58
58
  }
59
59
  sb.push(clsDef);
60
60
  sb.push('{');
@@ -74,7 +74,7 @@ export class CSharpApiGenerator extends CSharpGenerator {
74
74
  }
75
75
  }
76
76
  for (const attr of this.sortAttributes(attrs)) {
77
- const def = this.toAttribtue(attr);
77
+ const def = this.toAttribute(attr);
78
78
  sb.push(` ${def}`);
79
79
  }
80
80
  const propType = { name: prop.type, namespace: prop.namespace, genericArgs: prop.genericArgs };
package/dist/cs-gen.js CHANGED
@@ -57,7 +57,7 @@ export class CSharpGenerator {
57
57
  });
58
58
  return to;
59
59
  }
60
- toAttribtue(attr) {
60
+ toAttribute(attr) {
61
61
  let body = '';
62
62
  if (attr.constructorArgs?.length) {
63
63
  for (const arg of attr.constructorArgs) {
@@ -105,7 +105,7 @@ export class CSharpGenerator {
105
105
  for (const attr of this.sortAttributes(cls.attributes ?? [])) {
106
106
  if (opt?.hideAttrs?.includes(attr.name.toLowerCase()))
107
107
  continue;
108
- const def = this.toAttribtue(attr);
108
+ const def = this.toAttribute(attr);
109
109
  sb.push(`${def}`);
110
110
  }
111
111
  sb.push(clsDef);
@@ -120,7 +120,9 @@ export class CSharpGenerator {
120
120
  sb.push(` /// </summary>`);
121
121
  }
122
122
  for (const attr of this.sortAttributes(prop.attributes ?? [])) {
123
- const def = this.toAttribtue(attr);
123
+ if (opt?.hideAttrs?.includes(attr.name.toLowerCase()))
124
+ continue;
125
+ const def = this.toAttribute(attr);
124
126
  sb.push(` ${def}`);
125
127
  }
126
128
  const propType = this.toType(prop.type, prop.genericArgs, prop.namespace);
@@ -13,7 +13,7 @@ export class CSharpMigrationGenerator extends CSharpGenerator {
13
13
  const ignoreTables = ['User'];
14
14
  // props with [Reference] attribute don't need to be included in the migration (ignore to avoid missing references e.g. User)
15
15
  const ignoreProp = (prop) => prop.attributes?.some(x => x.name === 'Reference');
16
- const hideAttrs = ['description', 'icon'];
16
+ const hideAttrs = ['description', 'icon', 'ref'];
17
17
  const opt = { hideAttrs, ignoreProp };
18
18
  const genTypes = ast.types.filter(t => !t.isEnum &&
19
19
  !t.isInterface &&
package/dist/icons.js CHANGED
@@ -1,4 +1,4 @@
1
- import { splitCase } from './utils.js';
1
+ import { splitCase, withAliases } from './utils.js';
2
2
  export function getIcon(type) {
3
3
  const words = splitCase(type).split(' ');
4
4
  const candidates = generateCombinations(words).map(x => x.toLowerCase());
@@ -41,18 +41,6 @@ export function generateCombinations(words) {
41
41
  });
42
42
  return ret;
43
43
  }
44
- function withAliases(icons, aliases) {
45
- const result = {};
46
- Object.keys(icons).forEach(name => {
47
- result[name.toLowerCase()] = icons[name].replaceAll('"', `'`);
48
- });
49
- Object.keys(aliases).forEach(name => {
50
- for (const alias of aliases[name]) {
51
- result[alias.toLowerCase()] = icons[name].replaceAll('"', `'`);
52
- }
53
- });
54
- return result;
55
- }
56
44
  const P = `<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' `;
57
45
  function S(viewbox, body) {
58
46
  return P + `viewBox='${viewbox}'>${body}</svg>`;
@@ -149,6 +137,7 @@ export const IconMap = {
149
137
  Subscription: S(`0 0 24 24`, `<path fill='currentColor' d='M12.525 4H5.25l-.184.005A3.25 3.25 0 0 0 2 7.25v9.5l.005.184A3.25 3.25 0 0 0 5.25 20h13.5l.184-.005A3.25 3.25 0 0 0 22 16.75V9.332a1.743 1.743 0 0 1-.75.168h-.75v7.25l-.006.143A1.75 1.75 0 0 1 18.75 18.5H5.25l-.144-.006A1.75 1.75 0 0 1 3.5 16.75V9.374l8.15 4.29l.097.042a.75.75 0 0 0 .602-.042L20.26 9.5h-3.22L12 12.152L3.5 7.68v-.43l.006-.144A1.75 1.75 0 0 1 5.25 5.5h6.768a1.745 1.745 0 0 1 .508-1.5Zm8.725-2a.75.75 0 1 1 0 1.5h-7.5a.747.747 0 0 1-.75-.75a.75.75 0 0 1 .75-.75h7.5Zm0 2.5a.75.75 0 1 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h7.5ZM13 7.75a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1-.75-.75Z'/>`),
150
138
  Newsletter: S(`0 0 20 20`, `<path fill='currentColor' d='M16 2h4v15a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V0h16v2zm0 2v13a1 1 0 0 0 1 1a1 1 0 0 0 1-1V4h-2zM2 2v15a1 1 0 0 0 1 1h11.17a2.98 2.98 0 0 1-.17-1V2H2zm2 8h8v2H4v-2zm0 4h8v2H4v-2zM4 4h8v4H4V4z'/>`),
151
139
  Expense: S(`0 0 24 24`, `<path fill='currentColor' d='M7 15h2c0 1.08 1.37 2 3 2s3-.92 3-2c0-1.1-1.04-1.5-3.24-2.03C9.64 12.44 7 11.78 7 9c0-1.79 1.47-3.31 3.5-3.82V3h3v2.18C15.53 5.69 17 7.21 17 9h-2c0-1.08-1.37-2-3-2s-3 .92-3 2c0 1.1 1.04 1.5 3.24 2.03C14.36 11.56 17 12.22 17 15c0 1.79-1.47 3.31-3.5 3.82V21h-3v-2.18C8.47 18.31 7 16.79 7 15'/>`),
140
+ Currency: S(`0 0 24 24`, `<path fill='currentColor' d='M13.92 11H18v2h-5v2h5v2h-5v4h-2v-4H6v-2h5v-2H6v-2h4.08L5 3h2.37L12 10.29L16.63 3H19z'/>`),
152
141
  Approve: S(`0 0 24 24`, `<path fill='currentColor' d='m23 12l-2.44-2.78l.34-3.68l-3.61-.82l-1.89-3.18L12 3L8.6 1.54L6.71 4.72l-3.61.81l.34 3.68L1 12l2.44 2.78l-.34 3.69l3.61.82l1.89 3.18L12 21l3.4 1.46l1.89-3.18l3.61-.82l-.34-3.68zm-13 5l-4-4l1.41-1.41L10 14.17l6.59-6.59L18 9z'/>`),
153
142
  Actual: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-width='2' d='M9 15v3c0 .943 0 1.414-.293 1.707S7.943 20 7 20H6c-.943 0-1.414 0-1.707-.293S4 18.943 4 18v-1c0-.943 0-1.414.293-1.707S5.057 15 6 15zm6-11h5v5m0-5L9 15'/>`),
154
143
  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'/>`),
@@ -199,6 +188,16 @@ export const IconMap = {
199
188
  Step: S(`0 0 24 24`, `<path fill='currentColor' d='M19 15q-1.275 0-2.137-.862T16 12t.863-2.137T19 9t2.138.863T22 12t-.862 2.138T19 15M9 17l-1.4-1.425L10.175 13H2v-2h8.175L7.6 8.4L9 7l5 5z'/>`),
200
189
  Animal: S(`0 0 20 20`, `<path fill='currentColor' d='M5.5 4.25c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25s-.826 2.25-2 2.25s-2-1.082-2-2.25M3 4.5c-1.174 0-2 1.082-2 2.25S1.826 9 3 9s2-1.082 2-2.25S4.174 4.5 3 4.5m12 2.25c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25S18.174 9 17 9s-2-1.082-2-2.25m-4.5-2.5c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25s-.826 2.25-2 2.25s-2-1.082-2-2.25M4 14a6 6 0 0 1 12 0c0 .986-.504 1.753-1.21 2.255c-.697.495-1.601.745-2.485.745h-4.61c-.884 0-1.788-.25-2.484-.745C4.504 15.753 4 14.986 4 14'/>`),
201
190
  Mix: S(`0 0 512 512`, `<path fill='currentColor' fill-rule='evenodd' d='m269.264 271.083l70.256 70.25l56.966-.001l-27.57-27.58l30.17-30.17l79.084 79.084l-79.085 79.085l-30.17-30.17L396.487 384H321.83l-82.745-82.74zM399.085 70.248l79.085 79.085l-79.085 79.085l-30.17-30.17l27.572-27.582H339.52L126.17 384H42.667v-42.667h65.813L321.83 128l74.657-.001l-27.572-27.581zM126.17 128l82.745 82.739l-30.179 30.177l-70.256-70.25H42.667V128z'/>`),
191
+ Solar: S(`0 0 24 24`, `<path fill='currentColor' d='M3.33 16H11v-3H4zM13 16h7.67L20 13h-7zm8.11 2H13v4h9zM2 22h9v-4H2.89zm9-14h2v3h-2zm4.76-.79l1.42-1.42l2.12 2.12l-1.41 1.42zm-11.05.7l2.12-2.12l1.41 1.42l-2.12 2.12zM3 2h3v2H3zm15 0h3v2h-3zm-6 5c2.76 0 5-2.24 5-5H7c0 2.76 2.24 5 5 5'/>`),
192
+ Phone: S(`0 0 24 24`, `<path fill='currentColor' d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24c1.12.37 2.33.57 3.57.57c.55 0 1 .45 1 1V20c0 .55-.45 1-1 1c-9.39 0-17-7.61-17-17c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1c0 1.25.2 2.45.57 3.57c.11.35.03.74-.25 1.02z'/>`),
193
+ B: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5 3l4 1.5v12l6-2.5l-2-1l-1-4l7 2.5V16L9 21l-4-2z'/>`),
194
+ Rack: S(`0 0 36 36`, `<path fill='currentColor' d='M2 22h32v-8H2Zm8-5h14v2H10Zm-4 0h2v2H6Z' class='clr-i-solid clr-i-solid-path-1'/><path fill='currentColor' d='M32 4H4a2 2 0 0 0-2 2v6h32V6a2 2 0 0 0-2-2M8 9H6V7h2Zm16 0H10V7h14Z' class='clr-i-solid clr-i-solid-path-2'/><path fill='currentColor' d='M2 30a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-6H2Zm8-3h14v2H10Zm-4 0h2v2H6Z' class='clr-i-solid clr-i-solid-path-3'/><path fill='none' d='M0 0h36v36H0z'/>`),
195
+ Sample: S(`0 0 256 256`, `<path fill='currentColor' d='M224 67.3a35.8 35.8 0 0 0-11.26-25.66c-14-13.28-36.72-12.78-50.62 1.13L138.8 66.2a24 24 0 0 0-33.14.77l-5 5a16 16 0 0 0 0 22.64l2 2.06l-51 51a39.75 39.75 0 0 0-10.53 38l-8 18.41A13.65 13.65 0 0 0 36 219.29a15.9 15.9 0 0 0 17.71 3.36L71.24 215a39.9 39.9 0 0 0 37.05-10.75l51-51l2.06 2.06a16 16 0 0 0 22.62 0l5-5a24 24 0 0 0 .74-33.18l23.75-23.87A35.75 35.75 0 0 0 224 67.3M138 152H70.07l44-44l33.94 34Z'/>`),
196
+ Kid: S(`0 0 24 24`, `<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' color='currentColor'><circle cx='12' cy='12' r='10'/><path d='M14 5.738s-1.115.5-1.898.119c-.956-.466-1.903-2.41-.01-3.857M8.009 9H8m8 0h-.009M8 15a5 5 0 0 0 4 2a5 5 0 0 0 4-2'/></g>`),
197
+ Class: S(`0 0 24 24`, `<g fill='currentColor'><path d='M3 3h18v4.385h-2V5H5v9h4.333v2H3z'/><path d='M12.684 10.287C13.558 11.212 14.303 12 16 12h2a2 2 0 0 1 2 2v1a2 2 0 0 1-1 1.732V22h-3v-8c-2.617 0-3.956-1.45-4.84-2.405a14 14 0 0 0-.367-.388l1.414-1.414q.249.25.477.494M19 9.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0'/></g>`),
198
+ Doctor: S(`0 0 24 24`, `<path fill='currentColor' d='M14.84 16.26C17.86 16.83 20 18.29 20 20v2H4v-2c0-1.71 2.14-3.17 5.16-3.74L12 21zM8 8h8v2a4 4 0 0 1-4 4a4 4 0 0 1-4-4zm0-1l.41-4.1a1 1 0 0 1 1-.9h5.19c.51 0 .94.39.99.9L16 7zm4-4h-1v1h-1v1h1v1h1V5h1V4h-1z'/>`),
199
+ Prescription: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 19V3h4.5a4.5 4.5 0 1 1 0 9H6m13 9l-9-9m3 9l6-6'/>`),
200
+ Card: S(`0 0 24 24`, `<path fill='currentColor' d='M2 4h20v16H2zm18 14V6H4v12z'/>`),
202
201
  /** Actions */
203
202
  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'/>`),
204
203
  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'/>`),
@@ -206,34 +205,36 @@ export const IconMap = {
206
205
  export const IconGroups = {
207
206
  User: ['AppUser', 'Author'],
208
207
  Contact: ['Customer', 'Client', 'Manager', 'Employee', 'Applicant', 'Candidate', 'Staff'],
208
+ Anon: ['Student'],
209
209
  Company: ['Organization', 'Conference', 'City'],
210
210
  Account: ['Profile'],
211
211
  Team: ['Collab', 'Collaboration', 'Role'],
212
212
  Region: ['Country', 'State', 'Province', 'Capital'],
213
- Lock: ['Security', 'Padlock', 'Secure'],
213
+ Lock: ['Security', 'Padlock', 'Secure', 'Permission'],
214
214
  Location: ['Address', 'JobLocation'],
215
215
  Time: ['TimeSlot', 'DateRange'],
216
216
  Feature: ['Amenity'],
217
- Application: ['JobApplication'],
217
+ Application: ['JobApplication', 'Patient'],
218
218
  Project: ['Campaign'],
219
- Listing: ['List', 'JobListing'],
219
+ Listing: ['List', 'JobListing', 'Attribute', 'Set'],
220
220
  Check: ['Require'],
221
221
  Screening: ['PhoneScreen'],
222
+ Interview: ['Communication'],
222
223
  Artifact: ['Media', 'Image', 'Photo', 'Picture'],
223
- Booking: ['Appointment', 'Reservation', 'Schedule'],
224
+ Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability'],
224
225
  Product: ['Sku', 'Item', 'Restock', 'Stock'],
225
226
  Order: ['Invoice'],
226
227
  LineItem: ['InvoiceItem'],
227
228
  Opportunity: ['Lead', 'Deal'],
228
- Connect: ['Interaction', 'Api'],
229
- Conversion: ['Convert'],
230
- Expense: ['Cost', 'Price', 'Amount', 'Salary'],
229
+ Connect: ['Interaction', 'Api', 'Connection'],
230
+ Conversion: ['Convert', 'Trade'],
231
+ Expense: ['Cost', 'Price', 'Amount', 'Salary', 'Bill'],
231
232
  Approve: ['Approval'],
232
233
  Refund: ['Return', 'Reimburse'],
233
234
  Library: ['Module'],
234
235
  Page: ['Article', 'Document'],
235
236
  Policy: ['Privacy', 'CompanyPolicy'],
236
- Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward'],
237
+ Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward', 'Discount'],
237
238
  Deduct: ['Deduction'],
238
239
  Tax: ['Taxes'],
239
240
  Tag: ['Label'],
@@ -255,7 +256,7 @@ export const IconGroups = {
255
256
  Review: ['Audit', 'Status'],
256
257
  Comment: ['Feedback'],
257
258
  Vote: ['Rating', 'Rank', 'Score', 'Priority'],
258
- Favorite: ['Bookmark', 'Star'],
259
+ Favorite: ['Bookmark', 'Star', 'Gig'],
259
260
  Logs: ['Detail', 'Details', 'History', 'Log', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
260
261
  PlainText: ['Field'],
261
262
  Ship: ['Shipment'],
@@ -264,19 +265,25 @@ export const IconGroups = {
264
265
  Attachment: ['File'],
265
266
  News: ['Announcement'],
266
267
  Data: ['Database'],
268
+ Sales: ['Merchant'],
267
269
  Channel: ['Stream', 'Broadcast', 'Feed', 'Session'],
268
270
  Search: ['Filter', 'Lookup', 'Query', 'Match'],
269
271
  Save: ['Saved', 'Archive', 'Backup', 'Download', 'Export'],
270
- Chip: ['Hardware'],
271
- Output: ['Response'],
272
- Range: ['Span', 'Exchange'],
272
+ Chip: ['Hardware', 'System'],
273
+ Output: ['Response', 'Value'],
274
+ Range: ['Span', 'Exchange', 'Sync', 'Transfer'],
273
275
  Translate: ['Translation', 'Localization', 'Language'],
274
276
  Portfolio: ['Holding'],
275
- Tool: ['Maintenance', 'Support', 'Equipment', 'Build'],
277
+ Tool: ['Maintenance', 'Support', 'Equipment', 'Build', 'Inverter'],
276
278
  Watch: ['Sight', 'Sighting', 'View', 'Watchlist'],
277
279
  Animal: ['Wildlife', 'Pet', 'Zoo'],
278
280
  Step: ['Progress', 'Stage', 'Phase', 'Milestone'],
279
- Mix: ['Blend', 'Combine', 'Merge', 'Mixture'],
281
+ Mix: ['Blend', 'Combine', 'Merge', 'Mixture', 'Variant', 'Integration'],
282
+ Hotel: ['Venue'],
283
+ B: ['Brand'],
284
+ Kid: ['Kindergarten', 'Child', 'Children'],
285
+ Class: ['Course', 'Lesson', 'Training', 'Classroom', 'Curriculum'],
286
+ Card: ['Rectangle'],
280
287
  };
281
288
  export const Icons = withAliases(IconMap, IconGroups);
282
289
  const IconKeys = Object.keys(Icons).sort((a, b) => b.length - a.length);
package/dist/utils.js CHANGED
@@ -266,3 +266,15 @@ export function isBinary(contentType) {
266
266
  || contentType.endsWith('octet-stream')
267
267
  || contentType.endsWith('compressed'));
268
268
  }
269
+ export function withAliases(icons, aliases) {
270
+ const result = {};
271
+ Object.keys(icons).forEach(name => {
272
+ result[name.toLowerCase()] = icons[name].replaceAll('"', `'`);
273
+ });
274
+ Object.keys(aliases).forEach(name => {
275
+ for (const alias of aliases[name]) {
276
+ result[alias.toLowerCase()] = icons[name].replaceAll('"', `'`);
277
+ }
278
+ });
279
+ return result;
280
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.43",
4
+ "version": "0.0.45",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",