58ca4e68db
- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics) - Rust analytics service with parallel report generation - C runtime with POSIX shared memory IPC - PostgreSQL schema with 30+ tables, full migrations - Redis cache, sessions, pub/sub - Kafka event streaming with Zookeeper - WebSocket hub for real-time updates - Automation engine with cron jobs, workflows, event triggers - JWT authentication, multi-tenant from start - Docker Compose with all services - Nginx reverse proxy with rate limiting - Integration tests passing - Feature gap analysis against Fortnox/Odoo/Visma Refs: BOC-001
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
'use strict';
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.OAuth = void 0;
|
|
const StripeResource_js_1 = require("../StripeResource.js");
|
|
const utils_js_1 = require("../utils.js");
|
|
const stripeMethod = StripeResource_js_1.StripeResource.method;
|
|
const oAuthHost = 'connect.stripe.com';
|
|
exports.OAuth = StripeResource_js_1.StripeResource.extend({
|
|
basePath: '/',
|
|
authorizeUrl(params, options) {
|
|
params = params || {};
|
|
options = options || {};
|
|
let path = 'oauth/authorize';
|
|
// For Express accounts, the path changes
|
|
if (options.express) {
|
|
path = `express/${path}`;
|
|
}
|
|
if (!params.response_type) {
|
|
params.response_type = 'code';
|
|
}
|
|
if (!params.client_id) {
|
|
params.client_id = this._stripe.getClientId();
|
|
}
|
|
if (!params.scope) {
|
|
params.scope = 'read_write';
|
|
}
|
|
return `https://${oAuthHost}/${path}?${(0, utils_js_1.stringifyRequestData)(params)}`;
|
|
},
|
|
token: stripeMethod({
|
|
method: 'POST',
|
|
path: 'oauth/token',
|
|
host: oAuthHost,
|
|
}),
|
|
deauthorize(spec, ...args) {
|
|
if (!spec.client_id) {
|
|
spec.client_id = this._stripe.getClientId();
|
|
}
|
|
return stripeMethod({
|
|
method: 'POST',
|
|
path: 'oauth/deauthorize',
|
|
host: oAuthHost,
|
|
}).apply(this, [spec, ...args]);
|
|
},
|
|
});
|