Convert rocketchat-oauth2-server-config to main module structure (#12773)

pull/12828/head
Marcos Spessatto Defendi 7 years ago committed by Rodrigo Nascimento
parent fc297877d8
commit df054a459e
  1. 3
      packages/rocketchat-oauth2-server-config/admin/client/collection.js
  2. 3
      packages/rocketchat-oauth2-server-config/client/admin/collection.js
  3. 1
      packages/rocketchat-oauth2-server-config/client/admin/route.js
  4. 2
      packages/rocketchat-oauth2-server-config/client/admin/startup.js
  5. 0
      packages/rocketchat-oauth2-server-config/client/admin/views/oauthApp.html
  6. 5
      packages/rocketchat-oauth2-server-config/client/admin/views/oauthApp.js
  7. 0
      packages/rocketchat-oauth2-server-config/client/admin/views/oauthApps.html
  8. 3
      packages/rocketchat-oauth2-server-config/client/admin/views/oauthApps.js
  9. 9
      packages/rocketchat-oauth2-server-config/client/index.js
  10. 0
      packages/rocketchat-oauth2-server-config/client/oauth/oauth2-client.html
  11. 3
      packages/rocketchat-oauth2-server-config/client/oauth/oauth2-client.js
  12. 0
      packages/rocketchat-oauth2-server-config/client/oauth/stylesheets/oauth2.css
  13. 57
      packages/rocketchat-oauth2-server-config/package.js
  14. 1
      packages/rocketchat-oauth2-server-config/server/admin/methods/addOAuthApp.js
  15. 1
      packages/rocketchat-oauth2-server-config/server/admin/methods/deleteOAuthApp.js
  16. 1
      packages/rocketchat-oauth2-server-config/server/admin/methods/updateOAuthApp.js
  17. 1
      packages/rocketchat-oauth2-server-config/server/admin/publications/oauthApps.js
  18. 7
      packages/rocketchat-oauth2-server-config/server/index.js
  19. 2
      packages/rocketchat-oauth2-server-config/server/models/OAuthApps.js
  20. 2
      packages/rocketchat-oauth2-server-config/server/oauth/default-services.js
  21. 3
      packages/rocketchat-oauth2-server-config/server/oauth/oauth2-server.js

@ -1,3 +0,0 @@
import { Mongo } from 'meteor/mongo';
this.ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps');

@ -0,0 +1,3 @@
import { Mongo } from 'meteor/mongo';
export const ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps');

@ -1,5 +1,6 @@
import { FlowRouter } from 'meteor/kadira:flow-router' ;
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import { t } from 'meteor/rocketchat:ui';
FlowRouter.route('/admin/oauth-apps', {
name: 'admin-oauth-apps',

@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';
RocketChat.AdminBox.addOption({
href: 'admin-oauth-apps',
i18nLabel: 'OAuth Apps',

@ -1,10 +1,11 @@
/* globals ChatOAuthApps */
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat, handleError } from 'meteor/rocketchat:lib';
import { t, modal } from 'meteor/rocketchat:ui';
import { ChatOAuthApps } from '../collection';
import toastr from 'toastr';
Template.oauthApp.onCreated(function() {

@ -1,5 +1,6 @@
/* globals ChatOAuthApps */
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { ChatOAuthApps } from '../collection';
import moment from 'moment';
Template.oauthApps.onCreated(function() {

@ -0,0 +1,9 @@
import './oauth/stylesheets/oauth2.css';
import './oauth/oauth2-client.html';
import './oauth/oauth2-client';
import './admin/startup';
import './admin/route';
import './admin/views/oauthApp.html';
import './admin/views/oauthApp';
import './admin/views/oauthApps.html';
import './admin/views/oauthApps';

@ -1,9 +1,8 @@
// @ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps'
/* globals ChatOAuthApps */
import { Meteor } from 'meteor/meteor';
import { FlowRouter } from 'meteor/kadira:flow-router' ;
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import { Template } from 'meteor/templating';
import { ChatOAuthApps } from '../admin/collection';
FlowRouter.route('/oauth/authorize', {
action(params, queryParams) {

@ -5,47 +5,18 @@ Package.describe({
});
Package.onUse(function(api) {
api.use('webapp');
api.use('mongo');
api.use('ecmascript');
api.use('rocketchat:lib');
api.use('rocketchat:api');
api.use('rocketchat:theme');
api.use('rocketchat:oauth2-server');
api.use('templating', 'client');
api.use('kadira:flow-router', 'client');
api.use('kadira:blaze-layout', 'client');
// // General //
// Server
api.addFiles('server/models/OAuthApps.js', 'server');
// // OAuth //
// Server
api.addFiles('oauth/server/oauth2-server.js', 'server');
api.addFiles('oauth/server/default-services.js', 'server');
api.addFiles('oauth/client/stylesheets/oauth2.css', 'client');
// Client
api.addFiles('oauth/client/oauth2-client.html', 'client');
api.addFiles('oauth/client/oauth2-client.js', 'client');
// // Admin //
// Client
api.addFiles('admin/client/startup.js', 'client');
api.addFiles('admin/client/collection.js', 'client');
api.addFiles('admin/client/route.js', 'client');
api.addFiles('admin/client/views/oauthApp.html', 'client');
api.addFiles('admin/client/views/oauthApp.js', 'client');
api.addFiles('admin/client/views/oauthApps.html', 'client');
api.addFiles('admin/client/views/oauthApps.js', 'client');
// Server
api.addFiles('admin/server/publications/oauthApps.js', 'server');
api.addFiles('admin/server/methods/addOAuthApp.js', 'server');
api.addFiles('admin/server/methods/updateOAuthApp.js', 'server');
api.addFiles('admin/server/methods/deleteOAuthApp.js', 'server');
api.use([
'ecmascript',
'webapp',
'mongo',
'rocketchat:lib',
'rocketchat:api',
'rocketchat:theme',
'rocketchat:oauth2-server',
'templating',
'kadira:flow-router',
'kadira:blaze-layout',
]);
api.mainModule('client/index.js', 'client');
api.mainModule('server/index.js', 'server');
});

@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { RocketChat } from 'meteor/rocketchat:lib';
import _ from 'underscore';
Meteor.methods({

@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
Meteor.methods({
deleteOAuthApp(applicationId) {

@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import _ from 'underscore';
Meteor.methods({

@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
Meteor.publish('oauthApps', function() {
if (!this.userId) {

@ -0,0 +1,7 @@
import './models/OAuthApps';
import './oauth/oauth2-server';
import './oauth/default-services';
import './admin/publications/oauthApps';
import './admin/methods/addOAuthApp';
import './admin/methods/updateOAuthApp';
import './admin/methods/deleteOAuthApp';

@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';
RocketChat.models.OAuthApps = new class extends RocketChat.models._Base {
constructor() {
super('oauth_apps');

@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';
if (!RocketChat.models.OAuthApps.findOne('zapier')) {
RocketChat.models.OAuthApps.insert({
_id: 'zapier',

@ -1,6 +1,7 @@
/* global OAuth2Server */
import { Meteor } from 'meteor/meteor';
import { WebApp } from 'meteor/webapp';
import { RocketChat } from 'meteor/rocketchat:lib';
import { OAuth2Server } from 'meteor/rocketchat:oauth2-server';
const oauth2server = new OAuth2Server({
accessTokensCollectionName: 'rocketchat_oauth_access_tokens',
Loading…
Cancel
Save