@workos/oagen 0.27.0 → 0.28.1
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 +110 -11
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/index.mjs +37 -1
- package/dist/compat/index.mjs.map +1 -1
- package/dist/{diff-B9wlNAVX.mjs → diff-DqnHHXvr.mjs} +112 -13
- package/dist/diff-DqnHHXvr.mjs.map +1 -0
- package/dist/index.d.mts +27 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/verify/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/diff-B9wlNAVX.mjs.map +0 -1
package/dist/compat/index.mjs
CHANGED
|
@@ -4592,7 +4592,7 @@ function walkElixirFiles(dir) {
|
|
|
4592
4592
|
*/
|
|
4593
4593
|
function stripCommentsAndHeredocs(source) {
|
|
4594
4594
|
let result = source.replace(/"""[\s\S]*?"""/g, "\"\"\"\"\"\"");
|
|
4595
|
-
result = result.replace(/#[^\n]*/g, "");
|
|
4595
|
+
result = result.replace(/#(?!\{)[^\n]*/g, "");
|
|
4596
4596
|
return result;
|
|
4597
4597
|
}
|
|
4598
4598
|
/**
|
|
@@ -4772,6 +4772,24 @@ function extractTypeSpecs(modules, sourceFile) {
|
|
|
4772
4772
|
}
|
|
4773
4773
|
return specs;
|
|
4774
4774
|
}
|
|
4775
|
+
/** Named escapes Elixir recognizes inside double-quoted strings/atoms. */
|
|
4776
|
+
const ELIXIR_STRING_ESCAPES = {
|
|
4777
|
+
"0": "\0",
|
|
4778
|
+
a: "\x07",
|
|
4779
|
+
b: "\b",
|
|
4780
|
+
d: "",
|
|
4781
|
+
e: "\x1B",
|
|
4782
|
+
f: "\f",
|
|
4783
|
+
n: "\n",
|
|
4784
|
+
r: "\r",
|
|
4785
|
+
s: " ",
|
|
4786
|
+
t: " ",
|
|
4787
|
+
v: "\v"
|
|
4788
|
+
};
|
|
4789
|
+
/** Undo backslash escapes inside a double-quoted Elixir string/atom. */
|
|
4790
|
+
function unescapeElixirString(s) {
|
|
4791
|
+
return s.replace(/\\(.)/g, (_, ch) => ELIXIR_STRING_ESCAPES[ch] ?? ch);
|
|
4792
|
+
}
|
|
4775
4793
|
function extractEnumModules(modules, sourceFile) {
|
|
4776
4794
|
const enumModules = [];
|
|
4777
4795
|
for (const { name: moduleName, body: moduleBody } of modules) {
|
|
@@ -4786,6 +4804,24 @@ function extractEnumModules(modules, sourceFile) {
|
|
|
4786
4804
|
if (funcName === "values") continue;
|
|
4787
4805
|
members[funcName] = funcValue;
|
|
4788
4806
|
}
|
|
4807
|
+
const hadNamedMembers = Object.keys(members).length > 0;
|
|
4808
|
+
const valuesList = moduleBody.match(/def\s+values,\s*do:\s*\[((?:"(?:[^"\\]|\\.)*"|[^\]"])*)\]/);
|
|
4809
|
+
if (valuesList) {
|
|
4810
|
+
const tokenRegex = /:"((?:[^"\\]|\\.)*)"|:([a-zA-Z_][a-zA-Z0-9_@]*[?!]?)|"((?:[^"\\]|\\.)*)"|(-?\d+(?:\.\d+)?)/g;
|
|
4811
|
+
let token;
|
|
4812
|
+
while ((token = tokenRegex.exec(valuesList[1])) !== null) {
|
|
4813
|
+
if (!(token[1] != null || token[2] != null) && hadNamedMembers) continue;
|
|
4814
|
+
const text = token[1] ?? token[2] ?? token[3] ?? token[4];
|
|
4815
|
+
const name = token[2] ?? unescapeElixirString(text);
|
|
4816
|
+
if (!(name in members)) members[name] = unescapeElixirString(text);
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4819
|
+
const dumpRegex = /def\s+dump\(:(?:"((?:[^"\\]|\\.)*)"|([a-zA-Z_][a-zA-Z0-9_@]*[?!]?))\),\s*do:\s*"((?:[^"\\]|\\.)*)"/g;
|
|
4820
|
+
let dumpMatch;
|
|
4821
|
+
while ((dumpMatch = dumpRegex.exec(moduleBody)) !== null) {
|
|
4822
|
+
const atomName = dumpMatch[1] != null ? unescapeElixirString(dumpMatch[1]) : dumpMatch[2];
|
|
4823
|
+
if (atomName in members) members[atomName] = unescapeElixirString(dumpMatch[3]);
|
|
4824
|
+
}
|
|
4789
4825
|
if (Object.keys(members).length > 0) enumModules.push({
|
|
4790
4826
|
moduleName,
|
|
4791
4827
|
members,
|