@workos/oagen 0.5.0 → 0.7.0
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/cli/index.mjs +580 -34
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/index.d.mts +1 -1
- package/dist/compat/index.mjs +21 -3
- package/dist/compat/index.mjs.map +1 -1
- package/dist/{diff-CSy3g-Bq.mjs → diff-BYadQQV7.mjs} +353 -30
- package/dist/diff-BYadQQV7.mjs.map +1 -0
- package/dist/index.d.mts +42 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +227 -4
- package/dist/index.mjs.map +1 -1
- package/dist/scripts/smoke/baseline.mjs +225 -3
- package/dist/scripts/smoke/baseline.mjs.map +1 -1
- package/dist/smoke.d.mts +33 -0
- package/dist/smoke.d.mts.map +1 -1
- package/dist/smoke.mjs +225 -3
- package/dist/smoke.mjs.map +1 -1
- package/dist/tree-sitter-C53w_0WE.mjs.map +1 -1
- package/dist/{types-D84LjrVG.d.mts → types-DJMbCtIO.d.mts} +40 -2
- package/dist/types-DJMbCtIO.d.mts.map +1 -0
- package/dist/verify/index.d.mts +1 -1
- package/dist/verify/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/diff-CSy3g-Bq.mjs.map +0 -1
- package/dist/types-D84LjrVG.d.mts.map +0 -1
package/dist/compat/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ApiClass, Q as Addition, at as ApiProperty, ct as DiffResult, dt as MethodOverlay, et as ApiEnum, ft as OverlayLookup, ht as ViolationSeverity, it as ApiParam, lt as Extractor, mt as ViolationCategory, nt as ApiInterface, ot as ApiSurface, pt as Violation, rt as ApiMethod, st as ApiTypeAlias, t as ApiSpec, tt as ApiField, ut as LanguageHints } from "../types-DJMbCtIO.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/extractor-registry.d.ts
|
|
4
4
|
declare function registerExtractor(extractor: Extractor): void;
|
package/dist/compat/index.mjs
CHANGED
|
@@ -164,11 +164,19 @@ function extractClass(sym, checker) {
|
|
|
164
164
|
const methods = {};
|
|
165
165
|
const properties = {};
|
|
166
166
|
const constructorParams = [];
|
|
167
|
+
let deprecationMessage;
|
|
167
168
|
const declarations = sym.getDeclarations();
|
|
168
169
|
if (declarations) {
|
|
169
170
|
for (const decl of declarations) if (ts.isClassDeclaration(decl)) {
|
|
171
|
+
const deprecatedTag = ts.getJSDocDeprecatedTag(decl);
|
|
172
|
+
if (deprecatedTag) {
|
|
173
|
+
const comment = deprecatedTag.comment;
|
|
174
|
+
if (typeof comment === "string") deprecationMessage = comment.trim() || "";
|
|
175
|
+
else if (Array.isArray(comment)) deprecationMessage = comment.map((c) => c.text).join("").trim() || "";
|
|
176
|
+
else deprecationMessage = "";
|
|
177
|
+
}
|
|
170
178
|
for (const member of decl.members) if (ts.isConstructorDeclaration(member)) for (const param of member.parameters) {
|
|
171
|
-
const paramName = param.name.getText();
|
|
179
|
+
const paramName = extractParameterName(param, param.name.getText());
|
|
172
180
|
const paramType = param.type ? checker.typeToString(checker.getTypeFromTypeNode(param.type)) : "any";
|
|
173
181
|
constructorParams.push({
|
|
174
182
|
name: paramName,
|
|
@@ -210,7 +218,8 @@ function extractClass(sym, checker) {
|
|
|
210
218
|
name: sym.name,
|
|
211
219
|
methods: sortRecord(methods),
|
|
212
220
|
properties: sortRecord(properties),
|
|
213
|
-
constructorParams
|
|
221
|
+
constructorParams,
|
|
222
|
+
...deprecationMessage !== void 0 && { deprecationMessage }
|
|
214
223
|
};
|
|
215
224
|
}
|
|
216
225
|
function extractParam(sym, checker) {
|
|
@@ -218,11 +227,20 @@ function extractParam(sym, checker) {
|
|
|
218
227
|
const isOptional = decl && ts.isParameter(decl) ? !!decl.questionToken || !!decl.initializer : false;
|
|
219
228
|
const type = checker.getTypeOfSymbolAtLocation(sym, decl);
|
|
220
229
|
return {
|
|
221
|
-
name: sym.name,
|
|
230
|
+
name: extractParameterName(decl, sym.name),
|
|
222
231
|
type: checker.typeToString(type),
|
|
223
232
|
optional: isOptional
|
|
224
233
|
};
|
|
225
234
|
}
|
|
235
|
+
function extractParameterName(decl, fallback) {
|
|
236
|
+
if (!decl || !ts.isParameter(decl)) return fallback;
|
|
237
|
+
if (ts.isIdentifier(decl.name)) return decl.name.text;
|
|
238
|
+
const index = decl.parent.parameters?.indexOf(decl) ?? -1;
|
|
239
|
+
const suffix = index > 0 ? String(index) : "";
|
|
240
|
+
if (ts.isObjectBindingPattern(decl.name)) return `options${suffix}`;
|
|
241
|
+
if (ts.isArrayBindingPattern(decl.name)) return `args${suffix}`;
|
|
242
|
+
return fallback;
|
|
243
|
+
}
|
|
226
244
|
function extractInterface(sym, checker) {
|
|
227
245
|
const type = checker.getDeclaredTypeOfSymbol(sym);
|
|
228
246
|
const fields = {};
|