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.
53 lines
1.8 KiB
JavaScript
53 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
const makeSchema = require('../utils/makeSchema');
|
|
|
|
const FunctionSchema = require('./FunctionSchema');
|
|
const RedirectRequestSchema = require('./RedirectRequestSchema');
|
|
const RequestSchema = require('./RequestSchema');
|
|
|
|
module.exports = makeSchema(
|
|
{
|
|
id: '/AuthenticationOAuth1ConfigSchema',
|
|
description: 'Config for OAuth1 authentication.',
|
|
type: 'object',
|
|
required: ['getRequestToken', 'authorizeUrl', 'getAccessToken'],
|
|
properties: {
|
|
getRequestToken: {
|
|
description:
|
|
'Define where Zapier will acquire a request token which is used for the rest of the three legged authentication process.',
|
|
oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }],
|
|
},
|
|
authorizeUrl: {
|
|
description:
|
|
'Define where Zapier will redirect the user to authorize our app. Typically, you should append an `oauth_token` querystring parameter to the request.',
|
|
oneOf: [
|
|
{ $ref: RedirectRequestSchema.id },
|
|
{ $ref: FunctionSchema.id },
|
|
],
|
|
},
|
|
getAccessToken: {
|
|
description: 'Define how Zapier fetches an access token from the API',
|
|
oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }],
|
|
},
|
|
},
|
|
additionalProperties: false,
|
|
examples: [
|
|
{
|
|
getRequestToken: { require: 'some/path/to/file.js' },
|
|
authorizeUrl: { require: 'some/path/to/file2.js' },
|
|
getAccessToken: { require: 'some/path/to/file3.js' },
|
|
},
|
|
],
|
|
antiExamples: [
|
|
{
|
|
example: {
|
|
getRequestToken: { require: 'some/path/to/file.js' },
|
|
authorizeUrl: { require: 'some/path/to/file2.js' },
|
|
},
|
|
reason: 'Missing required key.',
|
|
},
|
|
],
|
|
},
|
|
[FunctionSchema, RedirectRequestSchema, RequestSchema],
|
|
);
|