Skip to content

Commit

Permalink
log fetch failed error trying to get more info
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaster committed Sep 6, 2024
1 parent cea6b27 commit 9321de4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/sdk-codegen-scripts/src/exampleMiner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const getRemoteHttpOrigin = () => {
/** Permalink paths should not have the `.git` ending for a repo */
export const getPermalinkRoot = () => {
let root = getRemoteHttpOrigin();
if (root.endsWith('.git')) root = root.substr(0, root.length - 4);
if (root.endsWith('.git')) root = root.substring(0, root.length - 4);
return root;
};

Expand Down Expand Up @@ -270,7 +270,7 @@ export class MarkdownMiner implements IDocMine {
*/
sourcerer(sourceFileName: string, linkFile: string) {
linkFile = this.stripSearch(linkFile);
if (linkFile.startsWith('/')) return linkFile.substr(1);
if (linkFile.startsWith('/')) return linkFile.substring(1);
const base = path.dirname(sourceFileName);
return path.join(base, '/', linkFile);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-codegen/src/sdkModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ export class ApiModel implements ISymbolTable, IApiModel {

if (typeof schema === 'string') {
if (schema.indexOf('/requestBodies/') < 0)
return this.types[schema.substr(schema.lastIndexOf('/') + 1)];
return this.types[schema.substring(schema.lastIndexOf('/') + 1)];
// dereference the request strBody schema reference
const deref = this.jsonPath(schema);
if (deref) {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-codegen/src/specConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const getSpecsFromVersions = async (
while (items[specKey]) {
if (frag <= max) {
// More than one spec for this version
specKey = `${v.version}${v.status?.substr(0, frag)}`;
specKey = `${v.version}${v.status?.substring(0, frag)}`;
} else {
specKey = `${v.version}${v.status}${frag}`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-codegen/src/typescript.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ ${indent}})`;
declareInterface(indent: string, method: IMethod): string {
let sig = this.methodSignature(indent, method).trimRight();
sig = sig.replace(/^\s*async /gm, '');
sig = sig.substr(0, sig.length - 2);
sig = sig.substring(0, sig.length - 2);
return `${sig}\n`;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/sdk-node/test/methods.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ describe('LookerNodeSDK', () => {
expect(cached).not.toEqual('{}');
} catch (e: any) {
failed = e.message;
console.debug({ e });
}
expect(failed).toEqual('');
}
Expand All @@ -909,7 +910,7 @@ describe('LookerNodeSDK', () => {
describe('Dashboard endpoints', () => {
const getQueryId = (qhash: { [id: string]: IQuery }, id: any) => {
if (!id) return id;
if (id.startsWith('#')) id = id.substr(1);
if (id.startsWith('#')) id = id.substring(1);
else return id;
const result = qhash[id];
if (result) return result.id;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-rtl/src/errorDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class ErrorDoc implements IErrorDoc {
}

specPath(path: string): string {
const result = path.replace(/:\w+/g, found => `{${found.substr(1)}}`);
const result = path.replace(/:\w+/g, found => `{${found.substring(1)}}`);
return result;
}

Expand Down

0 comments on commit 9321de4

Please sign in to comment.