Socket
Socket
Sign inDemoInstall

@cocreate/instagram

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cocreate/instagram - npm Package Compare versions

Comparing version 1.4.29 to 1.5.0

14

CHANGELOG.md

@@ -0,1 +1,15 @@

# [1.5.0](https://github.com/CoCreate-app/CoCreate-instagram/compare/v1.4.29...v1.5.0) (2023-08-16)
### Bug Fixes
* crud attributes renamed ([059f7cc](https://github.com/CoCreate-app/CoCreate-instagram/commit/059f7cca22b2b8781f0ef30262be3e1fdb8661ba))
* replace -target -selector ([2cd4593](https://github.com/CoCreate-app/CoCreate-instagram/commit/2cd45939ecaabcb0eba494b3e0b788b7669d5574))
* webpack.config and package.json make use of mode=production instead of process.env ([30dcf56](https://github.com/CoCreate-app/CoCreate-instagram/commit/30dcf5672e9ee204a23151d78a6635bc332ba6ad))
### Features
* name attribute and variable renamed to key ([e3200db](https://github.com/CoCreate-app/CoCreate-instagram/commit/e3200db516ccf50ec4cd22ac4f44038dbed4d006))
## [1.4.29](https://github.com/CoCreate-app/CoCreate-instagram/compare/v1.4.28...v1.4.29) (2023-06-14)

@@ -2,0 +16,0 @@

4

CoCreate.config.js

@@ -7,4 +7,4 @@ module.exports = {

{
"collection": "files",
"document": {
"array": "files",
"object": {
"_id": "60283ed971064611a678a1ab",

@@ -11,0 +11,0 @@ "name": "index.html",

{
"name": "@cocreate/instagram",
"version": "1.4.29",
"version": "1.5.0",
"description": "A simple instagram component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",

@@ -28,3 +28,3 @@ "keywords": [

"start": "npx webpack --config webpack.config.js",
"build": "NODE_ENV=production npx webpack --config webpack.config.js",
"build": "npx webpack --mode=production --config webpack.config.js",
"dev": "npx webpack --config webpack.config.js --watch",

@@ -62,4 +62,4 @@ "postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""

"dependencies": {
"@cocreate/api": "^1.10.30"
"@cocreate/api": "^1.10.31"
}
}

@@ -6,71 +6,71 @@ 'use strict'

class CoCreateInstagram {
constructor(wsManager) {
this.wsManager = wsManager;
this.name = "instagram";
this.init();
}
constructor(wsManager) {
this.wsManager = wsManager;
this.name = "instagram";
this.init();
}
init() {
if (this.wsManager) {
this.wsManager.on(this.name, (socket, data) => this.sendinstagram(socket, data));
}
}
init() {
if (this.wsManager) {
this.wsManager.on(this.name, (socket, data) => this.sendinstagram(socket, data));
}
}
async sendinstagram(socket, data) {
let params = data['data'];
let environment;
let action = data['action'];
try {
let org = await api.getOrg(data, this.name);
if (params.environment){
environment = params['environment'];
delete params['environment'];
} else {
environment = org.apis[this.name].environment;
}
let key = org.apis[this.name][environment];
// twitter = require('stripe')(key);
} catch (e) {
console.log(this.name + " : Error Connect to api", e)
}
try {
let response
switch (action) {
case 'getUserProfile':
response = this.getUserProfile(socket, action, params);
break;
}
this.wsManager.send(socket, this.name, { action, response })
} catch (error) {
this.handleError(socket, action, error)
}
}
async sendinstagram(socket, data) {
let params = data['data'];
let environment;
let action = data['action'];
try {
let org = await api.getOrg(data, this.name);
if (params.environment) {
environment = params['environment'];
delete params['environment'];
} else {
environment = org.apis[this.name].environment;
}
async getUserProfile(socket, action, params) {
try {
let key = org.apis[this.name][environment];
// twitter = require('stripe')(key);
} catch (e) {
console.log(this.name + " : Error Connect to api", e)
}
const response = {
'object': 'list',
'data': 'testing success',
};
try {
let response
switch (action) {
case 'getUserProfile':
response = this.getUserProfile(socket, action, params);
break;
}
this.wsManager.send(socket, { method: this.name, action, response })
} catch (error) {
this.handleError(socket, action, error)
}
}
api.send_response(this.wsManager, socket, { "action": action, "response": response }, this.name);
} catch (error) {
this.handleError(socket, action, error)
}
}
handleError(socket, action, error) {
const response = {
'object': 'error',
'data': error.message || error,
};
this.wsManager.send(socket, this.name, { action, response })
}
async getUserProfile(socket, action, params) {
try {
const response = {
'object': 'list',
'data': 'testing success',
};
api.send_response(this.wsManager, socket, { "action": action, "response": response }, this.name);
} catch (error) {
this.handleError(socket, action, error)
}
}
handleError(socket, action, error) {
const response = {
'object': 'error',
'data': error.message || error,
};
this.wsManager.send(socket, { method: this.name, action, response })
}
}//end Class
module.exports = CoCreateInstagram;
const path = require("path")
const TerserPlugin = require("terser-webpack-plugin")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
let isProduction = process.env.NODE_ENV === "production"
const { CleanWebpackPlugin } = require("clean-webpack-plugin")
module.exports = {
entry: {
"CoCreate-instagram": "./src/index.js",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: isProduction ? "[name].min.js" : "[name].js",
libraryTarget: "umd",
libraryExport: "default",
library: ["CoCreate", "instagram"],
globalObject: "this",
},
module.exports = (env, argv) => {
let isProduction = false
if (argv.mode === 'production')
isProduction = true
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
}),
],
// Default mode for Webpack is production.
// Depending on mode Webpack will apply different things
// on final bundle. For now we don't need production's JavaScript
// minifying and other thing so let's set mode to development
mode: isProduction ? "production" : "development",
module: {
rules: [
{
test: /.js$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
plugins: ["@babel/plugin-transform-modules-commonjs"],
},
const config = {
entry: {
"CoCreate-instagram": "./src/index.js",
},
},
{
test: /.css$/i,
use: [
{ loader: "style-loader", options: { injectType: "linkTag" } },
"file-loader",
output: {
path: path.resolve(__dirname, "dist"),
filename: isProduction ? "[name].min.js" : "[name].js",
libraryTarget: "umd",
libraryExport: "default",
library: ["CoCreate", "instagram"],
globalObject: "this",
},
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
}),
],
},
],
},
// Default mode for Webpack is production.
// Depending on mode Webpack will apply different things
// on final bundle. For now we don't need production's JavaScript
// minifying and other thing so let's set mode to development
mode: isProduction ? "production" : "development",
module: {
rules: [
{
test: /.js$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
plugins: ["@babel/plugin-transform-modules-commonjs"],
},
},
},
{
test: /.css$/i,
use: [
{ loader: "style-loader", options: { injectType: "linkTag" } },
"file-loader",
],
},
],
},
// add source map
...(isProduction ? {} : { devtool: "eval-source-map" }),
// add source map
...(isProduction ? {} : { devtool: "eval-source-map" }),
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
// cache: true,
parallel: true,
// sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
// extractComments: 'all',
compress: {
drop_console: true,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
// cache: true,
parallel: true,
// sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
// extractComments: 'all',
compress: {
drop_console: true,
},
},
}),
],
splitChunks: {
chunks: "all",
minSize: 200,
// maxSize: 99999,
//minChunks: 1,
cacheGroups: {
defaultVendors: false,
},
},
},
}),
],
splitChunks: {
chunks: "all",
minSize: 200,
// maxSize: 99999,
//minChunks: 1,
cacheGroups: {
defaultVendors: false,
},
},
},
}
}
return config
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc