@@ -4,11 +4,6 @@ let OpenApi = require('../dist/index').default;
44const scopes = [
55 "GET:ws.ufficiopostale.com/raccomandate" ,
66 "GET:imprese.altravia.com/autocomplete" ,
7- // "GET:test.imprese.altravia.com/base",
8- // "GET:imprese.altravia.com/advance",
9- // "GET:imprese.altravia.com/pec",
10- // "GET:imprese.altravia.com/autocomplete",
11- // "GET:imprese.altravia.com/closed",
127 "*:imprese.altravia.com/*" ,
138 "GET:comuni.openapi.it/cap" ,
149 "GET:comuni.openapi.it/istat" ,
@@ -29,7 +24,7 @@ const scopes = [
2924 "POST:ws.marchetemporali.com/verifica" ,
3025 "POST:ws.marchetemporali.com/analisi" ,
3126 'imprese.altravia.com' ,
32- // 'pa.openapi.it',
27+ 'pa.openapi.it' ,
3328] ;
3429
3530// test('init', async function() {
@@ -39,13 +34,13 @@ const scopes = [
3934// expect(typeof token === 'string').toBeTruthy()
4035// })
4136
42- test ( 'initWithString' , async function ( ) {
37+ // test('initWithString', async function() {
4338
44- let client = await OpenApi . init ( 'production' , process . env . OPENAPI_USERNAME , process . env . API_KEY ) ;
45- const token = await client . generateToken ( 'imprese.altravia.com' ) ;
46- expect ( typeof token === 'string' ) . toBeTruthy ( )
47- console . log ( client . scopes ) ;
48- } )
39+ // let client = await OpenApi.init('production', process.env.OPENAPI_USERNAME, process.env.API_KEY);
40+ // const token = await client.generateToken('imprese.altravia.com');
41+ // expect(typeof token === 'string').toBeTruthy()
42+ // console.log(client.scopes);
43+ // })
4944
5045// test('initWithToken', async function() {
5146// let client = await OpenApi.init('test', process.env.OPENAPI_USERNAME, process.env.API_KEY, process.env.TOKEN);
@@ -102,22 +97,30 @@ test('initWithString', async function() {
10297// })
10398
10499// test('testImprese', async function() {
105- // let client = await OpenApi.init('test', process.env.OPENAPI_USERNAME, process.env.API_KEY, process.env.TOKEN);
106-
100+ // let client = await OpenApi.init('production', process.env.OPENAPI_USERNAME, process.env.API_KEY, process.env.TOKEN);
101+ // console.log(JSON.stringify(client.scopes, null, 2));
102+
107103// const piva = await client.imprese.getByPartitaIva('12485671007')
108104// expect(piva).toBeDefined();
109105// console.log(piva);
110106
111107// const pivaAvd = await client.imprese.getAdvancedByPartitaIva('12485671007')
112108// expect(pivaAvd).toBeDefined();
109+
113110// const pec = await client.imprese.getPec('12485671007')
114111// expect(pec).toBeDefined();
115112// console.log(pec);
116113
117- // const imprese = await client.imprese.search({ provincia: 'RM' })
118-
119- // expect(imprese).toBeDefined();
114+ // const imprese = await client.imprese.search({ provincia: 'RM' })
115+ // expect(imprese).toBeDefined();
120116// console.log(imprese);
117+
118+ // const auto = await client.imprese.autocomplete('pizzeria')
119+ // expect(auto).toBeDefined()
120+ // console.log(auto);
121+
122+ // const fg = await client.imprese.listFormeGiuridiche()
123+ // expect(fg).toBeDefined()
121124// })
122125
123126// test('testPa', async function() {
0 commit comments