template-saas/apps/backend/node_modules/stripe/cjs/resources/OAuth.js
rckrdmrd 50a821a415
Some checks failed
CI / Backend CI (push) Has been cancelled
CI / Frontend CI (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / CI Summary (push) Has been cancelled
[SIMCO-V38] feat: Actualizar a SIMCO v3.8.0
- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8
- Actualizaciones de configuracion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 08:53:08 -06:00

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.queryStringifyRequestData)(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]);
},
});