okai 0.0.44 → 0.0.46

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
@@ -60,7 +60,7 @@ export const IconMap = {
60
60
  /** Admin */
61
61
  Dashboard: P + `viewBox='0 0 24 24' fill='none' stroke-width='1.5' stroke='currentColor'><path stroke-linecap='round' stroke-linejoin='round' d='M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25' /></svg>`,
62
62
  Stats: S(`0 0 24 24`, `<path fill='currentColor' d='M8.143 15.857H5.57V9.43h2.572v6.428zm5.143 0h-2.572V3h2.572v12.857zm5.142 0h-2.571v-9h2.571v9z'/><path fill='currentColor' fill-rule='evenodd' d='M21 20.714H3v-2h18v2z' clip-rule='evenodd'/>`),
63
- Logs: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 12h8m-8 6h8M13 6h8M3 12h1m-1 6h1M3 6h1m4 6h1m-1 6h1M8 6h1'/>`),
63
+ Log: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 12h8m-8 6h8M13 6h8M3 12h1m-1 6h1M3 6h1m4 6h1m-1 6h1M8 6h1'/>`),
64
64
  Project: S(`0 0 24 24`, `<circle cx='12' cy='6' r='1' fill='currentColor'/><path fill='currentColor' d='M6 17h12v2H6zm4-5.17l2.792 2.794l3.932-3.935L18 12V8h-4l1.31 1.275l-2.519 2.519L10 9l-4 4l1.414 1.414z'/><path fill='currentColor' d='M19 3h-3.298a5 5 0 0 0-.32-.425l-.01-.012a4.43 4.43 0 0 0-2.89-1.518a2.6 2.6 0 0 0-.964 0a4.43 4.43 0 0 0-2.89 1.518l-.01.012a5 5 0 0 0-.32.424V3H5a3.003 3.003 0 0 0-3 3v14a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3V6a3.003 3.003 0 0 0-3-3m1 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h4.55a2.5 2.5 0 0 1 4.9 0H19a1 1 0 0 1 1 1Z'/>`),
65
65
  Task: S(`0 0 32 32`, `<path fill='currentColor' d='M10.293 5.293L7 8.586L5.707 7.293L4.293 8.707L7 11.414l4.707-4.707zM14 7v2h14V7zm0 8v2h14v-2zm0 8v2h14v-2z'/>`),
66
66
  /** Security */
@@ -137,6 +137,7 @@ export const IconMap = {
137
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'/>`),
138
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'/>`),
139
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'/>`),
140
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'/>`),
141
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'/>`),
142
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'/>`),
@@ -161,6 +162,7 @@ export const IconMap = {
161
162
  Ticket: S('0 0 24 24', `<path fill='currentColor' d='M4 4a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2a2 2 0 0 1-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2zm0 2h16v2.54c-1.24.71-2 2.03-2 3.46s.76 2.75 2 3.46V18H4v-2.54c1.24-.71 2-2.03 2-3.46s-.76-2.75-2-3.46z'/>`),
162
163
  Favorite: S('0 0 24 24', `<path fill='currentColor' d='M12 2.5a1 1 0 0 1 .894.553l2.58 5.158l5.67.824a1 1 0 0 1 .554 1.706l-4.127 4.024l.928 5.674a1 1 0 0 1-1.455 1.044L12 18.807l-5.044 2.676a1 1 0 0 1-1.455-1.044l.928-5.674l-4.127-4.024a1 1 0 0 1 .554-1.706l5.67-.824l2.58-5.158A1 1 0 0 1 12 2.5m0 3.236l-1.918 3.836a1 1 0 0 1-.75.543l-4.184.608l3.05 2.973a1 1 0 0 1 .289.878L7.8 18.771l3.731-1.98a1 1 0 0 1 .938 0l3.731 1.98l-.687-4.197a1 1 0 0 1 .289-.877l3.05-2.974l-4.183-.608a1 1 0 0 1-.75-.543z'/>`),
163
164
  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'/>`),
165
+ Inbox: S('0 0 24 24', `<path fill='currentColor' d='M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14v-3h-3q-.75.95-1.787 1.475T12 18t-2.212-.525T8 16H5zm7-3q.95 0 1.725-.55T14.8 14H19V5H5v9h4.2q.3.9 1.075 1.45T12 16m-7 3h14z'/>`),
164
166
  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'/>`),
165
167
  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'/>`),
166
168
  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'/>`),
@@ -188,42 +190,66 @@ export const IconMap = {
188
190
  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'/>`),
189
191
  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'/>`),
190
192
  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'/>`),
193
+ 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'/>`),
194
+ 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'/>`),
195
+ 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'/>`),
196
+ 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'/>`),
197
+ 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>`),
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'/>`),
201
+ Column: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 5v14M9 5v14M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1'/>`),
202
+ Dock: S(`0 0 24 24`, `<path fill='currentColor' d='M12.707 3.293a1 1 0 0 0-1.414 0l-3.5 3.5a1 1 0 0 0 1.414 1.414L11 6.414V15a1 1 0 1 0 2 0V6.414l1.793 1.793a1 1 0 1 0 1.414-1.414zM4 12.75a.75.75 0 0 1 .75-.75H9a1 1 0 1 0 0-2H4.75A2.75 2.75 0 0 0 2 12.75v4.5A2.75 2.75 0 0 0 4.75 20h14.5A2.75 2.75 0 0 0 22 17.25v-4.5A2.75 2.75 0 0 0 19.25 10H15a1 1 0 1 0 0 2h4.25a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75H4.75a.75.75 0 0 1-.75-.75z'/>`),
203
+ Match: S(`0 0 24 24`, `<path fill='currentColor' d='M9 19.4q-2.025-.8-3.338-2.512T4.076 13H6.1q.225 1.325.975 2.425T9 17.2zm2 2.6v-9h4.5l1 1.5H22V22zM2 11V2h4.5l1 1.5H13V11zm16 1q0-1.625-.8-3.012T15 6.8V4.6q2.275.925 3.638 2.938T20 12z'/>`),
204
+ Education: S(`0 0 16 16`, `<path fill='none' stroke='currentColor' d='M12.5 6v5.5s-2.926 1-4.5 1s-4.5-1-4.5-1V6M14 5L8 2.5L2 5l6 3zm0 0v4.5' stroke-width='1'/>`),
205
+ Contract: S(`0 0 24 24`, `<path fill='currentColor' d='M11.846 21H6q-.846 0-1.423-.577T4 19v-2.77h3V3h13v6.577l-1 1V4H8v12.23h5.346l-1.5 1.5zm2.385 0v-2.21l5.96-5.934l2.184 2.21L16.441 21zm-4.846-9.846v-1h8.23v1zm0-2.77v-1h8.23v1zm10.806 7.632l.925-.956l-.925-.944l-.95.95z'/>`),
206
+ Agent: S(`0 0 24 24`, `<circle cx='9' cy='13' r='1' fill='currentColor'/><circle cx='15' cy='13' r='1' fill='currentColor'/><path fill='currentColor' d='M18 11.03A6.04 6.04 0 0 0 12.05 6c-3.03 0-6.29 2.51-6.03 6.45a8.07 8.07 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47'/><path fill='currentColor' d='M20.99 12c-.11-5.37-4.31-9-8.99-9c-4.61 0-8.85 3.53-8.99 9H2v6h3v-5.81c0-3.83 2.95-7.18 6.78-7.29a7.007 7.007 0 0 1 7.22 7V19h-8v2h10v-3h1v-6z'/>`),
207
+ Key: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-width='2' d='M10 13v3h3v3h3v2l2 2h5v-4L12.74 8.74C12.91 8.19 13 7.6 13 7c0-3.31-2.69-6-6-6S1 3.69 1 7a6.005 6.005 0 0 0 8.47 5.47zM6 7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z'/>`),
208
+ Complaint: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.996 9.013h.008m0-2.004V4.505M22 6.792c0 2.646-2.24 4.792-5.004 4.792q-.488 0-.968-.09c-.23-.043-.344-.064-.425-.052c-.08.012-.194.072-.42.194a3.25 3.25 0 0 1-2.114.329c.274-.338.46-.743.543-1.177c.05-.265-.074-.523-.26-.712a4.67 4.67 0 0 1-1.36-3.284c0-2.646 2.24-4.792 5.004-4.792S22 4.146 22 6.792M7.502 22H4.718c-.323 0-.648-.046-.945-.173c-.966-.415-1.457-.964-1.685-1.307a.54.54 0 0 1 .03-.631c1.12-1.488 3.716-2.386 5.384-2.386M7.507 22h2.783c.324 0 .648-.046.945-.173c.967-.415 1.457-.964 1.686-1.307a.54.54 0 0 0-.03-.631c-1.12-1.488-3.716-2.386-5.384-2.386m2.778-5.214a2.776 2.776 0 0 1-2.778 2.772a2.776 2.776 0 0 1-2.78-2.772a2.776 2.776 0 0 1 2.78-2.773a2.776 2.776 0 0 1 2.778 2.773' color='currentColor'/>`),
209
+ Cart: S(`0 0 24 24`, `<g fill='none'><circle cx='7.5' cy='18.5' r='1.5' fill='currentColor'/><circle cx='16.5' cy='18.5' r='1.5' fill='currentColor'/><path stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 5h2l.6 3m0 0L7 15h10l2-7z'/></g>`),
210
+ Genre: S(`0 0 24 24`, `<path fill='currentColor' d='M10 18q1.25 0 2.125-.875T13 15V8h3V6h-4.5v6.4q-.35-.2-.725-.3T10 12q-1.25 0-2.125.875T7 15t.875 2.125T10 18m2 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22'/>`),
211
+ Signature: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M22 12.634c-4 3.512-4.572-2.013-6.65-1.617c-2.35.447-3.85 5.428-2.35 5.428s-.5-5.945-2.5-3.89s-2.64 4.74-4.265 2.748C-1.5 5.813 5-1.15 8.163 3.457C10.165 6.373 6.5 16.977 2 22m7-1h10' color='currentColor'/>`),
191
212
  /** Actions */
192
213
  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'/>`),
193
214
  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'/>`),
215
+ Paginate: S(`0 0 24 24`, `<path fill='currentColor' d='m7 18l-1.4-1.4l4.6-4.6l-4.6-4.6L7 6l6 6zm9 0V6h2v12z'/>`),
194
216
  };
195
217
  export const IconGroups = {
196
218
  User: ['AppUser', 'Author'],
197
- Contact: ['Customer', 'Client', 'Manager', 'Employee', 'Applicant', 'Candidate', 'Staff'],
198
- Company: ['Organization', 'Conference', 'City'],
219
+ Contact: ['Customer', 'Client', 'Manager', 'Employee', 'Applicant', 'Candidate', 'Staff', 'Counselor'],
220
+ Guest: ['Individual', 'Person', 'Single'],
221
+ Anon: ['Counterparty', 'Personal', 'Participant'],
222
+ Company: ['Organization', 'Conference', 'City', 'Warehouse', 'Vendor'],
199
223
  Account: ['Profile'],
200
224
  Team: ['Collab', 'Collaboration', 'Role'],
225
+ Signup: ['Survey', 'Questionnaire', 'Agreement', 'Registration'],
201
226
  Region: ['Country', 'State', 'Province', 'Capital'],
202
- Lock: ['Security', 'Padlock', 'Secure', 'Permission'],
227
+ Lock: ['Security', 'Padlock', 'Secure', 'Permission', 'Auth'],
203
228
  Location: ['Address', 'JobLocation'],
204
- Time: ['TimeSlot', 'DateRange'],
205
- Feature: ['Amenity'],
206
- Application: ['JobApplication'],
229
+ Time: ['TimeSlot', 'DateRange', 'Shift', 'TourDate'],
230
+ Feature: ['Amenity', 'Claim'],
231
+ Application: ['JobApplication', 'Patient', 'Resume'],
207
232
  Project: ['Campaign'],
208
- Listing: ['List', 'JobListing'],
233
+ Listing: ['List', 'JobListing', 'Attribute', 'Set'],
209
234
  Check: ['Require'],
210
235
  Screening: ['PhoneScreen'],
211
236
  Interview: ['Communication'],
212
237
  Artifact: ['Media', 'Image', 'Photo', 'Picture'],
213
- Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability'],
238
+ Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability', 'Calendar'],
239
+ Room: ['Meeting', 'Conference'],
214
240
  Product: ['Sku', 'Item', 'Restock', 'Stock'],
215
241
  Order: ['Invoice'],
216
242
  LineItem: ['InvoiceItem'],
217
243
  Opportunity: ['Lead', 'Deal'],
218
- Connect: ['Interaction', 'Api'],
219
- Conversion: ['Convert'],
244
+ Connect: ['Interaction', 'Api', 'Connection'],
245
+ Conversion: ['Convert', 'Trade'],
220
246
  Expense: ['Cost', 'Price', 'Amount', 'Salary', 'Bill'],
221
247
  Approve: ['Approval'],
222
248
  Refund: ['Return', 'Reimburse'],
223
249
  Library: ['Module'],
224
- Page: ['Article', 'Document'],
250
+ Page: ['Article', 'Document', 'Recipe', 'Info', 'Quote'],
225
251
  Policy: ['Privacy', 'CompanyPolicy'],
226
- Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward'],
252
+ Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward', 'Discount', 'Donation', 'GiftCard', 'Testimony', 'Testimonial'],
227
253
  Deduct: ['Deduction'],
228
254
  Tax: ['Taxes'],
229
255
  Tag: ['Label'],
@@ -235,20 +261,20 @@ export const IconGroups = {
235
261
  HtmlFormat: ['RichHtml'],
236
262
  Alert: ['Notification'],
237
263
  Enroll: ['Enrollment', 'Lesson', 'Access'],
238
- Actual: ['Request'],
264
+ Actual: ['Request', 'Position'],
239
265
  Pay: ['Paystub'],
240
266
  Post: ['Posting'],
241
267
  Content: ['Website', 'Blog', 'Template', 'LandingPage', 'Portal', 'Workspace', 'Layout'],
242
268
  Menu: ['Nav', 'Form', 'MenuList', 'Section'],
243
269
  Skill: ['Qualification', 'Certification', 'Experience', 'Training', 'Requirement', 'Bid'],
244
- Analytics: ['Level', 'Metric', 'Kpi', 'Goal', 'Objective', 'Chart', 'Finance', 'Analysis'],
270
+ Analytics: ['Level', 'Metric', 'Kpi', 'Goal', 'Objective', 'Chart', 'Finance', 'Analysis', 'Financial', 'Nasdaq', 'Dow', 'Asx', 'Ndx', 'Snp', 'Nikkei'],
245
271
  Review: ['Audit', 'Status'],
246
272
  Comment: ['Feedback'],
247
273
  Vote: ['Rating', 'Rank', 'Score', 'Priority'],
248
274
  Favorite: ['Bookmark', 'Star', 'Gig'],
249
- Logs: ['Detail', 'Details', 'History', 'Log', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
275
+ Log: ['Detail', 'Details', 'History', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
250
276
  PlainText: ['Field'],
251
- Ship: ['Shipment'],
277
+ Ship: ['Shipment', 'Boat', 'Cargo'],
252
278
  Setting: ['Adjustment', 'Config', 'Configuration', 'Setup', 'Option'],
253
279
  Activity: ['Movement'],
254
280
  Attachment: ['File'],
@@ -258,17 +284,33 @@ export const IconGroups = {
258
284
  Channel: ['Stream', 'Broadcast', 'Feed', 'Session'],
259
285
  Search: ['Filter', 'Lookup', 'Query', 'Match'],
260
286
  Save: ['Saved', 'Archive', 'Backup', 'Download', 'Export'],
261
- Chip: ['Hardware'],
262
- Output: ['Response'],
263
- Range: ['Span', 'Exchange'],
287
+ Chip: ['Hardware', 'System'],
288
+ Output: ['Response', 'Value'],
289
+ Range: ['Span', 'Exchange', 'Sync', 'Transfer'],
264
290
  Translate: ['Translation', 'Localization', 'Language'],
265
291
  Portfolio: ['Holding'],
266
292
  Tool: ['Maintenance', 'Support', 'Equipment', 'Build', 'Inverter'],
267
293
  Watch: ['Sight', 'Sighting', 'View', 'Watchlist'],
268
294
  Animal: ['Wildlife', 'Pet', 'Zoo'],
269
295
  Step: ['Progress', 'Stage', 'Phase', 'Milestone'],
270
- Mix: ['Blend', 'Combine', 'Merge', 'Mixture'],
271
- Hotel: ['Venue'],
296
+ Mix: ['Blend', 'Combine', 'Merge', 'Mixture', 'Variant', 'Integration'],
297
+ Hotel: ['Venue', 'Accommodation'],
298
+ Coupon: ['Tour', 'Promo', 'Promotion', 'Voucher'],
299
+ B: ['Brand'],
300
+ Kid: ['Kindergarten', 'Child', 'Children'],
301
+ Card: ['Rectangle'],
302
+ Match: ['Matched', 'Matching'],
303
+ Source: ['Ingredient', 'Material'],
304
+ Course: ['Class', 'Classroom', 'Lesson', 'Training', 'Curriculum', 'Scholar', 'Professor', 'Teacher'],
305
+ Education: ['School', 'University', 'College', 'Institution', 'Academy', 'Study', 'Learning', 'Knowledge', 'Research', 'Science', 'Student', 'Pupil', 'Learner', 'Graduate', 'Alumni', 'Degree', 'Diploma', 'Certificate', 'Credential', 'Qualification', 'Syllabus'],
306
+ Quiz: ['Inquiry'],
307
+ Answer: ['Chat'],
308
+ Key: ['License', 'Token'],
309
+ Agent: ['Tenant'],
310
+ Paginate: ['Pagination'],
311
+ Supplier: ['Delivery'],
312
+ Cart: ['Shopping'],
313
+ Genre: ['Category', 'Music'],
272
314
  };
273
315
  export const Icons = withAliases(IconMap, IconGroups);
274
316
  const IconKeys = Object.keys(Icons).sort((a, b) => b.length - a.length);
package/dist/ts-once.js CHANGED
@@ -166,7 +166,7 @@ export function addCustomInputs(cls) {
166
166
  "price", "cost", "total", "salary", "balance", "tax", "fee"
167
167
  ];
168
168
  for (const prop of cls.properties ?? []) {
169
- if (currencyTypeProps.some(x => prop.name.toLowerCase().includes(x))) {
169
+ if (currencyTypeProps.some(x => prop.name.toLowerCase().includes(x)) && (prop.type === 'number' || prop.type === 'decimal' || prop.type === 'double')) {
170
170
  if (!prop.annotations)
171
171
  prop.annotations = [];
172
172
  prop.annotations.push({
package/dist/ts-parser.js CHANGED
@@ -1,4 +1,4 @@
1
- import { lastLeftPart, lastRightPart, leftPart, rightPart, trimEnd, trimStart } from "./utils.js";
1
+ import { lastLeftPart, lastRightPart, leftPart, parseJsObject, rightPart, trimEnd, trimStart } from "./utils.js";
2
2
  export class TypeScriptParser {
3
3
  static CONFIG_TYPE_PATTERN = /export\s+type\s+Config\s*=\s*{([^}]+)}/;
4
4
  static CONFIG_PROPERTY_PATTERN = /(\w+)\s*:\s*("[^"]*"|'[^']*')/g;
@@ -352,7 +352,9 @@ export class TypeScriptParser {
352
352
  this.classes = [];
353
353
  this.interfaces = [];
354
354
  this.enums = [];
355
- const src = removeMultilineComments(sourceCode);
355
+ let src = sourceCode;
356
+ src = convertJsDocComments(src);
357
+ src = removeMultilineComments(src);
356
358
  // const src = sourceCode
357
359
  this.parseConfigType(src);
358
360
  this.parseDefaultExport(src);
@@ -390,8 +392,7 @@ export function parseAnnotation(annotation) {
390
392
  // Parse each argument
391
393
  const parsedArgs = rawArgs.map(arg => {
392
394
  if (arg.startsWith('{')) {
393
- // Parse object literals
394
- return (new Function(`return ${arg}`))();
395
+ return parseJsObject(arg);
395
396
  }
396
397
  else if (arg.startsWith('"') || arg.startsWith("'") || arg.startsWith("`")) {
397
398
  // Parse strings
@@ -416,6 +417,7 @@ export function parseAnnotation(annotation) {
416
417
  return to;
417
418
  }
418
419
  catch (e) {
420
+ console.log('Failed to parse annotation:', e);
419
421
  return null;
420
422
  }
421
423
  }
@@ -563,3 +565,42 @@ export function removeMultilineComments(src) {
563
565
  }
564
566
  return result;
565
567
  }
568
+ export function convertJsDocComments(src) {
569
+ if (!src || !src.includes('/*')) {
570
+ return src;
571
+ }
572
+ let result = src;
573
+ // Convert multi-line JSDoc block comments (/**...*/)
574
+ result = result.replace(/\/\*\*[\s\n]+(\s*\*[\s\n]+.*?[\s\n]+)*?\s*\*\//gs, (match, _, offset) => {
575
+ // Find the indentation level of the line that contains or follows the comment
576
+ const lines = src.substring(0, offset + match.length).split('\n');
577
+ const commentEndLineIndex = lines.length - 1;
578
+ const nextLineIndex = commentEndLineIndex + 1;
579
+ // Try to find the indentation from the line following the comment
580
+ let indent = '';
581
+ if (nextLineIndex < src.split('\n').length) {
582
+ const nextLine = src.split('\n')[nextLineIndex];
583
+ const nextLineIndent = nextLine.match(/^(\s*)/)?.[1] || '';
584
+ indent = nextLineIndent;
585
+ }
586
+ else {
587
+ // Fallback to the first non-empty line in the comment
588
+ const firstLine = match.split('\n').find(line => line.trim() !== '');
589
+ indent = firstLine?.match(/^(\s*)/)?.[1] || '';
590
+ }
591
+ // Process each line of the comment, ensuring consistent indentation for all lines
592
+ const commentLines = match.split('\n')
593
+ .slice(1, -1) // Remove first (/**) and last (*/) lines
594
+ .map(line => {
595
+ // Remove * prefix from each line and convert to // comment
596
+ const content = line.replace(/^\s*\*\s?/, '').trimEnd();
597
+ return content.length > 0 ? `${indent}// ${content}` : `${indent}//`;
598
+ });
599
+ return commentLines.join('\n');
600
+ });
601
+ // Convert single-line JSDoc comments (/** ... */)
602
+ result = result.replace(/\/\*\*\s+(.*?)\s+\*\//g, '// $1');
603
+ // Convert inline JSDoc comments after statements
604
+ result = result.replace(/(.+?)\s+\/\*\*\s+(.*?)\s+\*\//g, '$1 // $2');
605
+ return result;
606
+ }
package/dist/utils.js CHANGED
@@ -278,3 +278,145 @@ export function withAliases(icons, aliases) {
278
278
  });
279
279
  return result;
280
280
  }
281
+ export function isCloudflareWorker() {
282
+ // Use a safe approach that works at both build and runtime
283
+ // Check for Worker-specific globals without directly referencing types
284
+ // that would cause build errors
285
+ const hasWorkerAPIs = typeof self !== 'undefined' &&
286
+ typeof caches !== 'undefined' &&
287
+ typeof addEventListener !== 'undefined' &&
288
+ 'fetch' in self;
289
+ // Check for Node-specific features safely
290
+ const hasNodeFeatures = () => {
291
+ try {
292
+ // Check for global object without direct reference
293
+ return typeof globalThis !== 'undefined' &&
294
+ // Check for process without direct reference that would error in CF
295
+ !!globalThis.process;
296
+ }
297
+ catch {
298
+ return false;
299
+ }
300
+ };
301
+ // Check for service worker context safely
302
+ const isServiceWorkerContext = () => {
303
+ try {
304
+ return typeof self !== 'undefined' &&
305
+ self.constructor.name === 'ServiceWorkerGlobalScope';
306
+ }
307
+ catch {
308
+ return false;
309
+ }
310
+ };
311
+ // Return true if we have Worker indicators and don't have Node indicators
312
+ return hasWorkerAPIs && isServiceWorkerContext() && !hasNodeFeatures();
313
+ }
314
+ export function parseJsObject(js) {
315
+ if (isCloudflareWorker()) {
316
+ return safeJsObject(js);
317
+ }
318
+ // Parse object literals
319
+ try {
320
+ return (new Function(`return ${js}`))();
321
+ }
322
+ catch (e) {
323
+ // Cloudflare workers don't support eval or new Function
324
+ return safeJsObject(js);
325
+ }
326
+ }
327
+ export function safeJsObject(jsStr) {
328
+ let result = '';
329
+ let i = 0;
330
+ // State tracking
331
+ let inString = false;
332
+ let quoteType = null; // ' or "
333
+ let depth = 0;
334
+ const peek = (n = 1) => i + n < jsStr.length ? jsStr[i + n] : '';
335
+ while (i < jsStr.length) {
336
+ const char = jsStr[i];
337
+ const nextChar = peek();
338
+ const prevChar = i > 0 ? jsStr[i - 1] : '';
339
+ // Handle string boundaries
340
+ if ((char === '"' || char === "'") && prevChar !== '\\') {
341
+ if (!inString) {
342
+ // Starting a string
343
+ inString = true;
344
+ quoteType = char;
345
+ result += '"'; // Always use double quotes for JSON
346
+ }
347
+ else if (char === quoteType) {
348
+ // Ending a string
349
+ inString = false;
350
+ quoteType = null;
351
+ result += '"';
352
+ }
353
+ else {
354
+ // A quote character inside a string of a different type
355
+ result += char;
356
+ }
357
+ i++;
358
+ continue;
359
+ }
360
+ // Handle escaped characters in strings
361
+ if (inString && char === '\\') {
362
+ if (nextChar === quoteType) {
363
+ // Convert escaped quote to JSON format
364
+ result += '\\"';
365
+ i += 2;
366
+ continue;
367
+ }
368
+ else {
369
+ // Pass through other escape sequences
370
+ result += char;
371
+ i++;
372
+ continue;
373
+ }
374
+ }
375
+ // When not in a string, handle object/array syntax
376
+ if (!inString) {
377
+ // Track nesting depth
378
+ if (char === '{' || char === '[') {
379
+ depth++;
380
+ result += char;
381
+ i++;
382
+ continue;
383
+ }
384
+ else if (char === '}' || char === ']') {
385
+ depth--;
386
+ result += char;
387
+ i++;
388
+ continue;
389
+ }
390
+ // Handle property keys - match unquoted keys followed by colon
391
+ if (depth > 0 && /[a-zA-Z0-9_$]/.test(char)) {
392
+ let keyBuffer = '';
393
+ let j = i;
394
+ // Collect the potential key name
395
+ while (j < jsStr.length && /[a-zA-Z0-9_$]/.test(jsStr[j])) {
396
+ keyBuffer += jsStr[j];
397
+ j++;
398
+ }
399
+ // Skip whitespace
400
+ let k = j;
401
+ while (k < jsStr.length && /\s/.test(jsStr[k]))
402
+ k++;
403
+ // If followed by a colon, it's a property key
404
+ if (k < jsStr.length && jsStr[k] === ':') {
405
+ result += `"${keyBuffer}"`; // Add quoted key to result
406
+ i = k; // Move to the colon position
407
+ continue;
408
+ }
409
+ }
410
+ }
411
+ // Default: add character to result
412
+ result += char;
413
+ i++;
414
+ }
415
+ // Validate and return
416
+ try {
417
+ return JSON.parse(result);
418
+ }
419
+ catch (e) {
420
+ throw new Error(`Failed to produce valid JSON: ${e.message}`);
421
+ }
422
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.44",
4
+ "version": "0.0.46",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",