Giter Site home page Giter Site logo

apex-publish-static-files's Introduction

APEX Publish Static Files

npm Build Status Dependency Status XO code style

Uploads all files from a local directory or a single file to Oracle APEX. Destination can be:

  • Application Static Files
  • Workspace Static Files
  • Theme Files
  • Plugin Files

Requirements

Install

npm install apex-publish-static-files

Usage

var publisher = require('apex-publish-static-files');

// If connecting to OCI (Oracle cloud) need to specify location of Oracle Wallet
process.env['TNS_ADMIN'] = '/Users/vmorneau/oracle/wallets/atp01';

publisher.publish({
    libDir: "/Users/vmorneau/Oracle/instantclient_19_8",
	username: "vmorneau",
	password: "xxxxxx",
	connectionString: "localhost:1521/servicename",
    directory: "/Users/vmorneau/Documents/project/www",
    appID: 111
});

Options

Name Type Default Description
libDir string Path to Oracle Instant Client (example: /Users/vmorneau/Oracle/instantclient_19_8)
username string Database user
password string Database password
connectionString string Database connection string
directory string Local directory that contains the files or file path
appID numeric Application ID to export the files to
destination string Determines where the files should be uploaded in APEX (choices: application, workspace, theme, plugin)

Methods

Name Type Description
publish function Publishes the files to APEX

Changelog

See changelog.

License

MIT © Vincent Morneau

apex-publish-static-files's People

Contributors

martindsouza avatar tim-lawson avatar tschf avatar vincentmorneau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

apex-publish-static-files's Issues

mimeType check of .js files return null

Hello.

When executing the check of mime type of a .js file, it's returned null.
This happen at this line:

var mimeType = java.nio.file.Files.probeContentType(java.nio.file.Files.createTempFile("dummy", extension));

So, with the new condition to validate mimeType, none of my js files are being uploaded anymore.

The line of the if that verify the mimeType:

Is this a bug? Or it should work like this?

Thanks in advance.

Option to publish a single file rather than all files in a directory

Hi,

Firstly, thank you for your work on this to date. I work in a relatively large team of APEX developers and am looking at improvements to our workflow. To this end, I have begun work on a VSCode extension similar to @tschf's odb-task that uses this package to publish static files.

One thing I noted was that it would be valuable to have the option to publish a single file rather than all files in a directory. Publishing all files at once has two drawbacks:

  • Increased upload time
  • May overwrite other developers' changes

I am not familiar with Java Node but I think a straightforward change to distUpload.js would make this possible.

Thanks!

support plugin path

using

wwv_flow_api.create_plugin_file (
                    p_flow_id      => :FB_FLOW_ID,
                    p_plugin_id    => :P4430_PLUGIN_ID,
                    p_file_name    => wwv_flow_file_api.get_file_name(:P4430_DIRECTORY, l_zip_files(i)),
                    p_mime_type    => wwv_flow_file_api.get_mime_type(l_zip_files(i)),
                    p_file_charset => :P4430_FILE_CHARSET,
                    p_file_content => l_blob );

Security issue

Hello,

As a member of the Node.js Security WG
I would like to draw your attention to a security report that has been made regarding this package.

I have made attempts to contact the person identified as a maintainer of this package but did not get any answer. What is the best way to reach someone with commit rights over this repo and hopefully npm publishing rights as well, in order to invite them to privately discuss the issue on the HackerOne platform and provide a resolution?

Thanks,
Liran

References:

Allow SSH

as an option to connect with more options:

  • os_user
  • ssh_private_file_path
  • localPort
  • Remotehost
  • RemotePort

Command line runner

Might be a nice addition to supply a runnable command for the command line.

I created a fork earlier on to give this a go. I took example from another project (http-server), So that when I install (globally), it creates as link as per:

npm install -g
/home/trent/.npm_modules/bin/afpub -> /home/trent/.npm_modules/lib/node_modules/apex-publish-static-files/bin/apex-publish-static-files

Then gives me a runnable program:

trent@birroth:~/Projects/apex-publish-static-files$ type -a afpub
afpub is /home/trent/.npm_modules/bin/afpub

(The only thing I'm unsure of, is how this behaves on Windows, as the script (and the project I copied from) seems more designed for unix systems)

I called the exe afpub just so the name isn't so long.

Sample:

trent@birroth:/tmp$ afpub --connectString vmtest/vmtest@//192.168.0.182/xe --sqlclPath sql --directory /tmp/vm2 --appID 100
Uploading to Shared Components - Application Static Files...

SQLcl: Release 4.2.0 Production on Tue Feb 28 22:20:12 2017

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Uploading: /tmp/vm2/test2.txt
Uploading: /tmp/vm2/test.txt

SQL> 
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Files were uploaded successfully.

Anyway, I didn't log a PR incase you didn't want to add an exe; or so you can take my example to introduce your own implementation.

P.s. You're always coming out with some nice projects - this one included. Nice work. 👍

Help for a node/js beginner

Hi Vincent,

I've found your tool very interesting for developing a .xlsx template of AOP and uploading it quickly to "Shared Components\Static Application Files", but I'm not very experienced with node and npm and don't know how to make it work.

Could you please provide more details?

So far:

  1. mkdir e:\oracle\apex-publish-static-files
  2. cd e:\oracle\apex-publish-static-files
  3. npm install apex-publish-static-files
  4. mkdir e:\oracle\apex-publish-static-files\upload-files
  5. Copy my .xlsx template to e:\oracle\apex-publish-static-files\upload-files
  6. Create a file "run.js":

var publisher = require('apex-publish-static-files');

publisher.publish({
connectString: "pjm/xxxxxx@//myhost:1521/pdbapex",
directory: "E:/oracle/apex-publish-static-files/upload-files",
appID: 200
});

  1. execute it:
    node run.js

E:\oracle\apex-publish-static-files>node run.js
Uploading to 200 - Application Static Files...

SQLcl: Versi�n 19.1 Production en lun jul 06 17:52:56 2020

Copyright (c) 1982, 2020, Oracle. Todos los derechos reservados.

Conectado a:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Executing login.sql
Could not load file: &DIST_UPLOAD.

PJM@//myhost:1521/pdbapex>
Desconectado de Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Files were uploaded successfully.

Thanks,
Jose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.