Skip to content

Commit

Permalink
Merge pull request #8 from liblaber/v1.0.0-1711112683079
Browse files Browse the repository at this point in the history
liblab SDK update v1.0.0
  • Loading branch information
david-liblab authored Mar 22, 2024
2 parents 57e4ed7 + 95abfb4 commit 9a38660
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"liblabVersion": "1.1.41",
"date": "2024-03-22T01:26:44.451Z",
"date": "2024-03-22T13:04:28.295Z",
"config": {
"authentication": {
"access": {
Expand All @@ -12,7 +12,7 @@
"inputFileName": "/tmp/resources/spec/open-api-spec.json",
"environmentVariables": [],
"fileOutput": "/tmp",
"tempDir": "/tmp/liblab-codegen-1.1.41-5yIktV",
"tempDir": "/tmp/liblab-codegen-1.1.41-RUQ6PG",
"inferServiceNames": false,
"httpLibrary": {
"name": "axios",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ import { Petstoresdk } from '@dworg/dwjs';
const sdk = new Petstoresdk({ accessToken: process.env.PETSTORESDK_ACCESS_TOKEN });

(async () => {
const input = {"id":-68604335,"name":"name","tag":"tag"};
const input = {"id":-67521967,"name":"name","tag":"tag"};
const result = await sdk.pets
.createPets(input);
console.log(result);
Expand Down Expand Up @@ -155,7 +155,7 @@ const sdk = new Petstoresdk({ accessToken: process.env.PETSTORESDK_ACCESS_TOKEN

(async () => {
const result = await sdk.pets
.listPets({ limit: -13360770 });
.listPets({ limit: -47508293 });
console.log(result);
})();

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { Petstoresdk } from '@dworg/dwjs';
const sdk = new Petstoresdk({ accessToken: process.env.PETSTORESDK_ACCESS_TOKEN });

(async () => {
const input = {"id":-68604335,"name":"name","tag":"tag"};
const input = {"id":-67521967,"name":"name","tag":"tag"};
const result = await sdk.pets
.createPets(input);
console.log(result);
Expand Down Expand Up @@ -79,7 +79,7 @@ const sdk = new Petstoresdk({ accessToken: process.env.PETSTORESDK_ACCESS_TOKEN

(async () => {
const result = await sdk.pets
.listPets({ limit: -13360770 });
.listPets({ limit: -47508293 });
console.log(result);
})();

Expand Down
14 changes: 7 additions & 7 deletions test/services/pets/Pets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe('test Pets', () => {
describe('test listPets', () => {
test('test api call', () => {
const scope = nock('http://petstore.swagger.io/v1')
.get('/pets?limit=3')
.get('/pets?limit=9')
.reply(200, { data: {} });
return sdk.pets.listPets({ limit: 3 }).then((r: any) => expect(r.data).toEqual({}));
return sdk.pets.listPets({ limit: 9 }).then((r: any) => expect(r.data).toEqual({}));
});
});

Expand All @@ -38,23 +38,23 @@ describe('test Pets', () => {
describe('test showPetById', () => {
test('test api call', () => {
const scope = nock('http://petstore.swagger.io/v1')
.get('/pets/cumque')
.get('/pets/labore')
.reply(200, { data: {} });
return sdk.pets.showPetById('cumque').then((r: any) => expect(r.data).toEqual({}));
return sdk.pets.showPetById('labore').then((r: any) => expect(r.data).toEqual({}));
});

test('test will throw error if required fields missing', () => {
const scope = nock('http://petstore.swagger.io/v1')
.get('/pets/ipsa')
.get('/pets/voluptate')
.reply(200, { data: {} });
return expect(async () => await sdk.pets.showPetById()).rejects.toThrow();
});

test('test will throw error on a non-200 response', () => {
const scope = nock('http://petstore.swagger.io/v1')
.get('/pets/necessitatibus')
.get('/pets/quam')
.reply(404, { data: {} });
return expect(async () => await sdk.pets.showPetById('necessitatibus')).rejects.toThrow();
return expect(async () => await sdk.pets.showPetById('quam')).rejects.toThrow();
});
});
});

0 comments on commit 9a38660

Please sign in to comment.