Milestone 0: import zappier billing, Verae middleware, and Zapier research

Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
This commit is contained in:
George Lambert 2026-09-09 02:37:36 -04:00
commit b4150c8250
1364 changed files with 6814366 additions and 0 deletions

View file

@ -0,0 +1,75 @@
require('should');
const zapier = require('zapier-platform-core');
const testUtils = require('./test-utils');
const App = require('../index');
const appTester = zapier.createAppTester(App);
describe('Authentication', () => {
before(testUtils.globalBeforeSetup);
it('should refresh auth', (done) => {
const bundle = {
authData: {
access_token: process.env.ACCESS_TOKEN,
refresh_token: process.env.REFRESH_TOKEN,
accountType: 'personal',
},
};
appTester(App.authentication.oauth2Config.refreshAccessToken, bundle)
.then((result) => {
result.should.have.property('access_token');
result.should.have.property('refresh_token');
done();
})
.catch(done);
});
it('should test auth', (done) => {
const bundle = {
authData: {
access_token: process.env.ACCESS_TOKEN,
refresh_token: process.env.REFRESH_TOKEN,
accountType: 'personal',
},
inputData: {
accountType: 'personal',
},
};
appTester(App.authentication.test, bundle)
.then((result) => {
result.should.have.property('userPrincipalName');
done();
})
.catch(done);
});
it('should generate an authorize URL', (done) => {
const bundle = {
// When an app runs on zapier.com, these will be generated by Zapier and
// passed to your app in the bundle. For the purpose of this test, we
// create a bundle with dummy values to ensure our function works.
inputData: {
state: '4444',
redirect_uri: 'https://zapier.com/',
accountType: 'personal',
},
environment: {
CLIENT_ID: '1234',
CLIENT_SECRET: 'asdf',
},
};
appTester(App.authentication.oauth2Config.authorizeUrl, bundle)
.then((authorizeUrl) => {
authorizeUrl.should.eql(
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=1234&redirect_uri=http%3A%2F%2Fzapier.com%2F&response_type=code&state=4444',
);
done();
})
.catch(done);
});
});