Coder Social home page Coder Social logo

sn-filesync's Introduction

– this website is currently meditating - thus the clear mind/page

To enhance your calm, try reading some of these quotes:

"What increases with knowledge? You learn how little you know. We thrive not when we have done it all but when we have more to do!" #success

"Being aware of a single shortcoming within yourself is far more useful than being aware of a thousand in someone else." — Dalai Lama

"What the caterpillar calls the end, the rest of the world calls a butterfly." — Lao Tzu

"You take your life in your own hands, and what happens? A terrible thing, no one to blame." — Erica Jong

sn-filesync's People

Contributors

dwightgunning avatar dynamicdan avatar echo3toecho7 avatar johncaruso avatar lukasknizek avatar reedowens avatar robra 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

sn-filesync's Issues

preLoadList files doesn't honor subDirPattern settings in folders

Thanks for this useful tool!

The issue is, for example, if there's a business_rules rule.js, with subDirPattern: collection/when, it would land at buiness_rules/table_name/after/rule.js if it's downloaded by search. However if it's included the in preLoadList, the file would end up at buiness_rules/rule.js. It wouldn't keep the same final downloaded folder file structures.

As a results of these, if I share a exported settings.json to other people, the resulting workspace folder would look quite different from mine which generated the settings.

filesync on Windows OS

Hi,
I setup the filesync accordingly (instance, user/pass, directories). Now when I create an empty file and wait for the filesync mechansim to grab the content from the instance I get the following error:

C:tmp\filesync\app\src\snc-client.js:25
            if (res.statusCode !== 200) {
                   ^
TypeError: Cannot read property 'statusCode' of null
    at validateResponse (C:tmp\filesync\app\src\snc-client.js:25:20)
    at handleResponse (C:tmp\filesync\app\src\snc-client.js:69:23)
    at parseResponse (C:tmp\filesync\app\node_modules\restify\lib\clients\json_client.js:84:17)
    at ClientRequest.parseResponse (C:tmp\filesync\app\node_modules\restify\lib\clients\string_client.js:186:25)
    at ClientRequest.g (events.js:192:14)
    at ClientRequest.EventEmitter.emit (events.js:99:17)
    at C:tmp\filesync\app\node_modules\restify\lib\clients\http_client.js:150:37
    at process.startup.processNextTick.process._tickCallback (node.js:245:9)

Duplicate records may be downloaded for extended tables

If both catalog client scripts and client scripts are being synced then it's possible that the same catalog client script record will be downloaded for both tables. There is true for any extended table concept. In this case one could just sync the client scripts table and not the catalog client scripts table to avoid the issue.

TODO: Make use of the sys_class_name column to distinguish such cases.

Pulling updates from server

Dan,

What an awesome solution! This answers a lot of the pro-code development challenges my team has had. Thank you!

One thing I am wondering, the watcher does a great job detecting changes on the server and telling me that my local version is out of sync. Is there a way to pull the changes to the single file down without doing a full --resync?

--resync overrides additional fields when js is first field for table

Hello. The is problem (or may be it just not documented?).

For example i want to get ui_actions script & condition
If set up config like this:
"ui_actions": { "table": "sys_ui_action", "key": "name", "fields": { "js": "script", "condition.js": "condition" }, "subDirPattern": "table/client_<client>", "_custom": true },
on next --resync all *.condition.js files' content is overridden with content of UI action script. For example if i had 'Move Equipment.condition.js' and 'Move Equipment.js' both of them will have code of 'Move Equipment.js'.

Putting js field as last field solves the problem. So
"ui_actions": { "table": "sys_ui_action", "key": "name", "fields": { "condition.js": "condition", "js": "script" }, "subDirPattern": "table/client_<client>", "_custom": true }, + --resync will get everything back to normal.

Allow generating a preLoad list from existing records (to help ramp-up new devs)

When a dev leaves or completes a project it would be really nice to provide a config file for next dev so that they simply start up FileSync and then have the same set of records automatically downloaded.

This would greatly help with maintainability and handover of a project!

Would be a simple case of examining the existing files/records that have been downloaded and building a JSON config file with the correct "folders" and "preLoad" definitions. Eg.

./node-darwin --export-setup ~/Desktop/cms.records.config.json

Syncing empty fields may cause human and system sync confusion

If a ui action has no content in the script field then the download will be "" or 0 bytes. The system will think it hasn't been downloaded and try and request each time you start the tool.

There is no known work around other than being a smarter user... Why are they downloaded scripts of 0 bytes?... add something once downloaded and the problem is gone!

SOLUTION 1:

Potentially we can resolve this issue by saving "sync data" that the last downloaded remote version was 0 bytes and therefore ignore the file during startup. We would need to reset the sync data for this file if the record changed on the server to have content. We would then always check for special sync data before trying to download a record for the first time.

SOLUTION 2:

Check the timestamp when the 0 bytes file was created. If the time is more than 5 seconds in the past then assume that it has already been processed and the record should stay as 0 bytes. Potentially delete the local 0 bytes file to save on processing checks OR simply rename to signify that it has been skipped: "MyEmptyScript.js" => "__MyEmptyScript.js" and then ignore files starting with "__".

config option "ignoreList" is seemingly ignored

I have added the following to my config file:

"ignoreList": ["*.todo"]

But I still get this in the console when I start the app:

13:34:07 - warn: File cannot be tracked because it is not valid: /Users/matt/Work/sn-scripts/todo.todo

I have also tried the following to no avail:

"ignoreList": ["./*.todo"]
"ignoreList": ["/.*\\.todo/"]
"ignoreList": "*.todo"

The readme states the default value for this property is /[\/\\]\./. I assumed that overriding it would stop this default ignore from working, but if I create ".filename" then this does appear to be ignored. This leads me to believe the property from my config file is maybe being ignored.

Domain Separation: the domain chosen in the browser is ignored (due to session based setting)

If you are using domain separation then the records will only ever be updated based on the users domain.

If you change the domain in the web browser then it is only set per session and not per user. There is no workaround other than using the standard ServiceNow interface to do changes to records that need to be in a different domain than the current user.

2 proposals:

  1. Save the domain information in a meta file when the record is first downloaded. Use this information to always set the domain field for the record correctly.
  2. Let the user specify the domain via a comment like /* DOMAIN MUST BE: global */ in the file. Would help future users to ensure they do not edit the file in the wrong domain.

Perhaps both proposals should be implemented as domain separation can be problematic to debug.


When we download a file we have the full sys_domain details that can be used to update the record correctly. The domain data looks like this:

sys_domain: '86799cc40f943100308a0eece1050e77',
sys_domain_path: '!!!/!!$/',

OR

sys_domain: 'global',
sys_domain_path: '/',

In any case, these 2 properties could be stored somewhere. In the file is not so ideal because we need to pollute someones code/xhtml block. Saving in a .meta dir would be ok but makes for more files. We should instead extend the existing .sync concept and save out JSON files like this:

{
  syncHash: "231234827398472937492sadsasdas12",
  sys_domain: '86799cc40f943100308a0eece1050e77',
  sys_domain_path: '!!!/!!$/',
  sys_updated_on: '2015-03-25 11:26:57',
  sys_updated_by: 'joe.blogs',
  sys_scope: 'global',
  sys_id: 'd31951010f8b7100f5a07f5ce1050ec9',
}

Meaning of records_per_search

Hi,
I'd like to ask why one would want to limit the number of records in a search? (the records_per_search option)
If the reason is performance, ServiceNow supports pagination (you can download e.g. 100 rows and then continue with next 100 rows; the server sends the URL for the next page in response headers).

Or is there any other reason?

Thanks

Upgrade to use standard npm/node package setup

Hi Dan,

I wanted to start a dialogue with you, to gauge your interest regarding some changes to filesync. I've created a fork to experiment with some updates, many of which may be aligned with your roadmap for the project, but also contains some opinionated changes which, I admit, may not at all align.

In brief, I wanted to do away with dedicated binaries and custom shell scripts, to be able to run with my locally installed version of node (currently Node.js 0.12), and lastly make configs a little easier to use (incorporating patterns I've seen from config-handling in other command-line tools).

At your convenience, please review this fork and let me know if you might be interested in a PR containing any of these changes. Though arguably necessary, the restructuring done in my fork is in many ways quite radical. I figured some experimentation and posting an issue here was more appropriate than simply sending a pull request.

Tangentially related, I'm curious if you have a test script or perhaps other steps you personally take, in addition to utilizing the --test flag, to determine if a milestone is suitable for release. The changes I've made pass all the tests invoked by --test, but I'm skeptical that those alone can uncover any regressions or new bugs I may have introduced.

Thanks,
-Karim

Allow using sys_ids to match records and ensure future proof.

The system currently relies on a "search" style query returning the correct result by checking the table and a field value to find the correct record. In the case of UI actions "Save" is a common name and there are not really any other reasonable fields other than "action_name" to use (which is still not unique). The same can be true when having multiple CMS themes with stylesheets named like "layout".

This has not proven to be a destructive issue because the developer will know if they have the correct record or not and once a record is saved, the hash of the contents is always used to compare records therefore avoiding overwrite of other instance records with the same name.

SOLUTION 1.
Allow files to be named in the format "sys_id_25928b23377375002cfb696043990e62.js" so that it is guaranteed we have a unique record. Optionally allow other descriptive text to be added to the name like "sys_id_25928b23377375002cfb696043990e62_save button.js".

SOLUTION 2.
Save the actual sys_id in the ./sync_data/ cache to reduce human error. If the file is named like "sys_id_save_btn.js" then the record "save_btn" is downloaded via query search but subsequent requests are made via the sys_id that is saved with the other meta data. This ensures that the user checks the resulting download the first time but doesn't need to worry about future records that might also be named "save_btn".

SOLUTION 3.
To make the first run fool proof, enforce file naming like "sys_id_25928b23377375002cfb696043990e62_save_btn.js" and then rename the file (and cache data to match) as "sys_id_save_btn.js". This approach may cause potential editor app confusion.

Issue with setup

Not sure if an issue is the best place for this, but I finally have a bit of time to look into getting filesync running and am having issues with the sync.

I've tried this in our company instance and on a developer instance with multiple machines. Here is the command line output. Any suggestions on what i might be missing? One thing I noticed is the sys_id is blank, but i'm erroring out when getting records as well.

`21:51:48 - info: Potentially syncing changed file to instance /Users/username/sn-filesync/instance/records/script_includes/TaskStateUtilExt.js
21:51:48 - warn: --------- meta data file not yet existing ---------------
21:51:48 - warn: File in question: /Users/username/sn-filesync/instance/records/.sync_data/script_includes/TaskStateUtilExt.js
21:51:48 - warn: --------- meta data file not yet existing ---------------
21:51:48 - warn: File in question: /Users/username/sn-filesync/instance/records/.sync_data/script_includes/TaskStateUtilExt.js
21:51:48 - warn: --------- sync data not yet existing ---------------
21:51:48 - info: Comparing remote version with previous local version...
21:51:48 - debug: snc-client send() path: /sys_script_include.do?JSONv2=&sysparm_record_count=1&sysparm_action=getRecords&displayvalue=true&sysparm_query=name%3DTaskStateUtilExt%5Esys_class_name%3Dsys_script_include
21:51:48 - debug: -------------------------------------------------------
21:51:48 - debug:

<title>Redirecting</title> <script> window.location.href = 'http://gen.xyz/register?aid=99999&domain=' + window.location.hostname; </script>

21:51:48 - debug: ------------------------------------------------------- 21:51:48 - debug: "\n\n\n\t\n\t<title>Redirecting</title>\n\t<script>\n\t\twindow.location.href = 'http://gen.xyz/register?aid=99999&domain=' + window.location.hostname;\n\t</script>\n\n\n

\n\n" 21:51:48 - warn: --------- meta data file not yet existing --------------- 21:51:48 - warn: File in question: /Users/username/sn-filesync/instance/records/.sync_data/script_includes/TaskStateUtilExt.js notifying with code: -500 21:51:48 - error: Error: Response missing "records" key: "\n\n\n\t\n\t<title>Redirecting</title>\n\t<script>\n\t\twindow.location.href = 'http://gen.xyz/register?aid=99999&domain=' + window.location.hostname;\n\t</script>\n\n\n

\n\n" Check server logs. at validateResponse (/Users/username/sn-filesync/lib/snc-client.js:112:24) at Request.handleResponse (/Users/username/sn-filesync/lib/snc-client.js:147:27) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.mixin._fireSuccess (/Users/username/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:247:10) at /Users/username/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:179:20 at IncomingMessage.parsers.auto (/Users/username/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:416:7) at Request.mixin._encode (/Users/username/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:216:29) at /Users/username/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:175:16 at Gunzip.onEnd (zlib.js:227:5) 21:51:48 - error: handleError context: { table: 'sys_script_include', field: 'script', query: 'name=TaskStateUtilExt', sys_id: false, payload: { script: 'var TaskStateUtilExt = Class.create();\nTaskStateUtilExt.prototype = Object.extendsObject(TaskStateUtil, {\n\tATTR_WORKING_STATES : "working_states",\n\tATTR_IDLE_STATES: "idle_states",\n\tgetIdleStates : function() {\n\t\tvar attribute = this.stateElement\n\n\t\t.getAttribute(this.ATTR_IDLE_STATES);\n\n\t\tif (!attribute)\n\t\t\treturn;\n\n\n\t\tvar states = attribute.split(";");\n\t\tthis.idleStates = states;\n\t},\n\tgetWorkingStates : function() {\n\t\tvar attribute = this.stateElement\n\t\t.getAttribute(this.ATTR_WORKING_STATES);\n\n\t\tif (!attribute)\n\t\t\treturn;\n\n\t\tvar states = attribute.split(";");\n\t\tthis.workingStates = states;\n\t},\n\tisIdleState : function(state) {\n\t state = state + "";\n var arrUtil = new ArrayUtil();\n if (arrUtil.contains(this.idleStates, state))\n return true;\n\n return false;\n\t},\n\n\ttype: \'TaskStateUtilExt\'\n\n});\n\n//test1234567\n' } } 21:51:48 - warn: --------- meta data file not yet existing --------------- 21:51:48 - warn: File in question: /Users/username/sn-filesync/instance/records/.sync_data/script_includes/TaskStateUtilExt.js notifying with code: -3 21:51:48 - warn: Instance record is not in sync with local env ("TaskStateUtilExt"). 21:51:48 - error: Could not send file: /Users/username/sn-filesync/instance/records/script_includes/TaskStateUtilExt.js`

Additional details on notifications

I'd find it very helpful if the sync notifications showed which instance the file got synced to. Even better if it could also show the updateset that the change gets recorded in.

Resync issue on windows

Hello dynamicdan,

I found an issue on windows running resync command(node.exe src\app --resync).
I am still getting error: 'Failed to find root folder.'
Issue is in src\file-record.js in method getRoot.
I found cause of the problem: path.dirname(this.filePath) returns path with '/' and in config is '' in filepath.
I rewrote the method to:
method.getRoot = function () {
// cache
if (this.rootDir) return this.rootDir;

var root = path.dirname(this.filePath).replace(/\//g, "\\");//issue
while (!this.config.roots[root]) {
    var up = path.dirname(root).replace(/\//g, "\\");//issue

    if (root === up) throw new Error('Failed to find root folder.');
    root = up;
}

return root;

};
I didn't want to make an commit, because I don't fully understand node.js and don't know what is affected in solution. Could you please test this fix on mac? On windows it looks like it works. Files are resynced.

And also for the future. It would be nice to have flag in config 'resyncOnStart' and it would only resynced files from server which are newer than local ones.(I think this check is already on conflict resolution)

Thanks,
Jakub

Problem with files with _task in file name

Dan,

I created a new scss partial on my instance and when I try and create it locally and sync, I get an error. It appears like the code is adding an extra _ underscore to the filename

screen shot 2015-12-19 at 4 28 38 pm

Visual Studio: Local file sometimes overwritten during sync (atomic save)

When using sn-filesync on windows 10 with vscode sometimes it happens that sn-filesync will pull the file from service-now instead of pushing it on save. It seems like sn-filesync assumes the file is empty during save and pulls it from the instance. Apparently you can't even Ctrl+Z to get back your changes, so you have data loss which is pretty annoying. Maybe I can provide a fix, currently looking into this issue. Anybody else can reproduce this behavior?

Mass Commit

If I were able to commit all files from the local machine at once, or track which files have been modified since being synced down from the server and only commit those files, that would be a nice functionality to have, being able to mass commit, and run the same command that runs when a file is saved on multiple files at the same time.

This would also accomplish the "offline" functionality mentioned in the roadmap as a possibly nice enhancement, and I suppose that I am used to having this functionality having used a plugin that fills a similar need for Salesforce called MavensMate. It just gives you the ability to have your edits be in lock step with the server (ServiceNow), or to be able to locally save your files many times before you decide you are ready for committing those changes up to the server. There is also an option to configure if you would like your "save" commands to automatically initiate the "commit" command up to the server, if this helps from a system-design reference. Thank you so much for all of the pioneering work you have done to expose ServiceNow to the IDE, I really appreciate it, and appreciate you sharing it. Thank you

Passwords in config file are not being encrypted

The passwords in my app.config.json file remain in plain text format after FileSync is run. The command window displays the 'Configuration: credentials encoded.' but this doesn't seem to be happening.

Proxy Support

Any suggestion on getting filesync to work through a proxy? Our company uses websense endpoint which isn't playing nice with the SSL.

Randomly quitting on me

Dan,

Every once in awhile, I'll save a file and not see the growl notification. I switch back to my terminal and see

17:25:44 - info: Local has no changes or remote in sync; no need for push/send.

/Users/aj.siegel/Downloads/filesync-master/app/src/file-record.js:128
            callback(true);
            ^
TypeError: undefined is not a function
    at method._saveMeta (/Users/aj.siegel/Downloads/filesync-master/app/src/file-record.js:128:13)
    at /Users/aj.siegel/Downloads/filesync-master/app/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:102:5
    at Object.oncomplete (evalmachine.<anonymous>:297:15)

Not sure what my be causing this, what other info can I provide you?

I am running CodeKit in the background handling minification, sass->css.

Thanks

Same named files are overridden from a different File Record

Hi @dynamicdan,

Thank you for making and maintaining this very useful tool.

I'm running into a weird issue, I have the following (simplified) folder records:

└───ui_actions
    ├───table1
    │   └───client_true
    │       └───process.js  # (file 1)
    └───table2
        └───client_true
            └───process.js  # (file 2)

There are 2 same named UI Actions that's associated with 2 different tables. When a --resync is done. file 1 would be override with the content of file 2. This can be fixed by a pull-down of only file 1 again.

  • .\app.js --download --search sys_ui_action_<file_1_sys_id>

Read me is missing info

Can you please update the read me info for this repo to show how to download all files from an instance. You talk about doing a system wide search for code issues in your Tips section of search. But do not provide the information or command to be able to pull everything down across all tables.

Changing network connection requires restart

If you work on a laptop and utilise say a 3G connection via your phone and then later switch to WiFi then the script won't work. Restarting the script kicks it back into life.

This may simply mean a "connection reset" is required. This can potentially be looked up with some low level node/system code?

Initial Synchronize with files

Im trying to do an initial sync of the instance, but only makes the folders structure

i tried also search:
"all": {
"table": "sp_widget",
"download": true,
"fullRecord": true,
}

but how to put multiple tables

also looking for subdirparttern to save the html, css, and js of each record in a subfolder of the table folder but dont understand how

Record with multiple scripts/css/xml does not download with search/download

I have a custom record that has 3 scripts. I can setup the config file to handle each and they work separately however when using --search and --download, they are not all created. Only one will be created.

Touching the appropriate files that were not created will cause the sync to happen correctly, there is just no way for the --search --download to do it for the user.

Cant sync tests

I'm trying to sync Tests files but cant find the way.
I've create add to my configuration file this:

...
"folders": {
      "tests": {
            "table": "sys_atf_test",
            "key": "name",
            "fields": {
                "js": "script"
            }
        },
.....

It recognize the tests files but it doesn't download any of them, just write a log like this:

12:34:39 - warn: Found but will ignore to protected record: C:/projects/servicenow/testsSync/src/tests/ .... DummyTest.js

I have no protection policy configured in Service Now, and I've tried changing the protection policy from "None", to "Read-only" and to "Protected" but it doesn't work with any of them.

Any idea what is the issue?

osx-notifier crash

Hey mate, FileSync regularly crashes when syncing a newly created record. I'm running OSX Yosemite. The following was outputted to the command window after syncing a Style Sheet record:

10:29:04 - info: Files left in queue: 0
execFile(/Users/joellignier/Desktop/filesync/node_modules/osx-notifier/osx/terminal-notifier-info.app/Contents/MacOS/terminal-notifier)
terminal-notifier (1.5.0) is a command-line tool to send OS X User Notifications.

Usage: terminal-notifier -[message|list|remove] [VALUE|ID|ID] [options]

Either of these is required:

   -message VALUE     The notification message.
   -remove ID         Removes a notification with the specified ‘group’ ID.
   -list ID           If the specified ‘group’ ID exists show when it was delivered,
                      or use ‘ALL’ as ID to see all notifications.
                      The output is a tab-separated list.

Optional:

   -title VALUE       The notification title. Defaults to ‘Terminal’.
   -subtitle VALUE    The notification subtitle.
   -group ID          A string which identifies the group the notifications belong to.
                      Old notifications with the same ID will be removed.
   -activate ID       The bundle identifier of the application to activate when the user clicks the notification.
   -open URL          The URL of a resource to open when the user clicks the notification.
   -execute COMMAND   A shell command to perform when the user clicks the notification.

When the user activates a notification, the results are logged to the system logs.
Use Console.app to view these logs.

/Users/joellignier/Desktop/filesync/node_modules/osx-notifier/index.js:41
throw err;
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:548:15)
at ChildProcess.EventEmitter.emit (events.js:99:17)
at maybeClose (child_process.js:646:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:823:11)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.destroyed (net.js:358:10)
at process.startup.processNextTick.process._tickCallback (node.js:245:9)
logout

[Process completed]

Error: 401 - Unauthorized - Check credentials.

I have checked 5 times the credentials in the appconfig, and in the servicenow instance i can connect without problem with the instance.

On other instances it works perfectly but not in this one, any ideas?

17:33:49 - info: ERROR in query or response.
17:33:49 - info:  Error: 401 - Unauthorized - Check credentials.
    at validateResponse (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/lib/snc-client.js:98:24)
    at Request.handleResponse (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/lib/snc-client.js:146:27)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.mixin._fireSuccess (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:247:10)
    at /mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:179:20
    at IncomingMessage.parsers.auto (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:416:7)
    at Request.mixin._encode (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:216:29)
    at /mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:175:16
    at Request.mixin._decode (/mnt/c/Users/Carlos Boney/Documents/sn-filesync/node_modules/@mishguru/restler/lib/restler.js:191:7)

Files sync but can't push.

Trying to sync my demo instance and it pulls all the records but I'm unable to sync my changes back to the server.

It says it's watching for changes.

16:46:41 - info: *********** Watching for changes ***********
16:46:41 - info: Created folders required for syncing records

Not sure if I setup my configuration wrong.

Any thoughts?

Edit: I am using the 'Geneva' release of ServiceNow.

Edit #2: Finally got it working, I had to delete my original config file. However, I get a

12:59:05 - warn: No map

Not sure what this means? my folder structure is there.

Getting 302 - Moved Temporarily

Error: 302 - Moved Temporarily - Verify JSON Web Service plugin is activated.]

I'm on Madrid for ServiceNow, but the JSON Web Service plugin isn't available on my instance. Is there a workaround for this?

Similar quitting issues

Dan,

I'll start brushing up on my node skills and troubleshooting these myself, but until then, I'll share what I find with you.

17:02:02 - debug: -------------------------------------------------------
17:02:02 - info: Received: 
{ table: 'sys_ui_page',
  field: 'html',
  query: 'name=don_cod' }
17:02:02 - debug: Saving meta/hash data for file: /Users/aj.siegel/sites/fs-cod/ui_pages/don_cod.xhtml
17:02:02 - info: Local has no changes or remote in sync; no need for push/send.

/Users/aj.siegel/.Trash/filesync-master/app/src/file-record.js:128
            callback(true);
            ^
TypeError: undefined is not a function
    at method._saveMeta (/Users/aj.siegel/.Trash/filesync-master/app/src/file-record.js:128:13)
    at /Users/aj.siegel/.Trash/filesync-master/app/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:102:5
    at Object.oncomplete (evalmachine.<anonymous>:297:15)

Push file to instance with predefined Update Set

It would be helpful to have the option to force a specific update set per file when pushing a file to the instance.

I can imagine to specify this by adding a comment to the file in the first line that contains the sysId of the Update Set or the clear name.

When pushing to the instance, this first line could be parsed out to not be visible in the instance.
On the other hand when pulling a file from the instance, a check is done against the local file to add the comment again to the file after download.

I feel able to implement it myself, but first i want to verify the approach.

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.