@port-labs/jq-node-bindings 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.editorconfig +5 -0
  2. package/.jshintignore +1 -0
  3. package/.jshintrc +23 -0
  4. package/binding.gyp +56 -0
  5. package/configure +26 -0
  6. package/deps/jq/.gitattributes +2 -0
  7. package/deps/jq/.travis.yml +53 -0
  8. package/deps/jq/AUTHORS +73 -0
  9. package/deps/jq/COPYING +70 -0
  10. package/deps/jq/ChangeLog +1349 -0
  11. package/deps/jq/Makefile.am +198 -0
  12. package/deps/jq/NEWS +88 -0
  13. package/deps/jq/README.md +64 -0
  14. package/deps/jq/builtin.c +1684 -0
  15. package/deps/jq/builtin.h +10 -0
  16. package/deps/jq/bytecode.c +161 -0
  17. package/deps/jq/bytecode.h +92 -0
  18. package/deps/jq/compile-ios.sh +102 -0
  19. package/deps/jq/compile.c +1210 -0
  20. package/deps/jq/compile.h +101 -0
  21. package/deps/jq/config/m4/check-math-func.m4 +4 -0
  22. package/deps/jq/config/m4/find-func-no-libs.m4 +8 -0
  23. package/deps/jq/config/m4/find-func-no-libs2.m4 +62 -0
  24. package/deps/jq/config/m4/find-func.m4 +9 -0
  25. package/deps/jq/config/m4/misc.m4 +3 -0
  26. package/deps/jq/configure.ac +221 -0
  27. package/deps/jq/docs/Gemfile +7 -0
  28. package/deps/jq/docs/Gemfile.lock +63 -0
  29. package/deps/jq/docs/README.md +25 -0
  30. package/deps/jq/docs/Rakefile +145 -0
  31. package/deps/jq/docs/content/1.tutorial/default.yml +327 -0
  32. package/deps/jq/docs/content/2.download/default.yml +117 -0
  33. package/deps/jq/docs/content/3.manual/manual.yml +2878 -0
  34. package/deps/jq/docs/content/3.manual/v1.3/manual.yml +1270 -0
  35. package/deps/jq/docs/content/3.manual/v1.4/manual.yml +1672 -0
  36. package/deps/jq/docs/content/index/index.yml +51 -0
  37. package/deps/jq/docs/default_manpage.md +22 -0
  38. package/deps/jq/docs/public/.htaccess +28 -0
  39. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +1058 -0
  40. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
  41. package/deps/jq/docs/public/bootstrap/css/bootstrap.css +5224 -0
  42. package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +9 -0
  43. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
  44. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
  45. package/deps/jq/docs/public/bootstrap/js/bootstrap.js +2027 -0
  46. package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +6 -0
  47. package/deps/jq/docs/public/css/base.scss +99 -0
  48. package/deps/jq/docs/public/jq.png +0 -0
  49. package/deps/jq/docs/public/robots.txt +2 -0
  50. package/deps/jq/docs/site.yml +18 -0
  51. package/deps/jq/docs/templates/default.liquid +34 -0
  52. package/deps/jq/docs/templates/index.liquid +60 -0
  53. package/deps/jq/docs/templates/manual.liquid +122 -0
  54. package/deps/jq/docs/templates/shared/_footer.liquid +5 -0
  55. package/deps/jq/docs/templates/shared/_head.liquid +12 -0
  56. package/deps/jq/docs/templates/shared/_header.liquid +26 -0
  57. package/deps/jq/exec_stack.h +112 -0
  58. package/deps/jq/execute.c +1155 -0
  59. package/deps/jq/inject_errors.c +112 -0
  60. package/deps/jq/jq.1.default +39 -0
  61. package/deps/jq/jq.1.prebuilt +3075 -0
  62. package/deps/jq/jq.h +60 -0
  63. package/deps/jq/jq.spec +70 -0
  64. package/deps/jq/jq_parser.h +9 -0
  65. package/deps/jq/jq_test.c +346 -0
  66. package/deps/jq/jv.c +1333 -0
  67. package/deps/jq/jv.h +240 -0
  68. package/deps/jq/jv_alloc.c +179 -0
  69. package/deps/jq/jv_alloc.h +27 -0
  70. package/deps/jq/jv_aux.c +619 -0
  71. package/deps/jq/jv_dtoa.c +4275 -0
  72. package/deps/jq/jv_dtoa.h +22 -0
  73. package/deps/jq/jv_file.c +49 -0
  74. package/deps/jq/jv_parse.c +852 -0
  75. package/deps/jq/jv_print.c +348 -0
  76. package/deps/jq/jv_unicode.c +96 -0
  77. package/deps/jq/jv_unicode.h +11 -0
  78. package/deps/jq/jv_utf8_tables.h +37 -0
  79. package/deps/jq/lexer.c +2442 -0
  80. package/deps/jq/lexer.h +362 -0
  81. package/deps/jq/lexer.l +184 -0
  82. package/deps/jq/libm.h +160 -0
  83. package/deps/jq/linker.c +393 -0
  84. package/deps/jq/linker.h +7 -0
  85. package/deps/jq/locfile.c +91 -0
  86. package/deps/jq/locfile.h +29 -0
  87. package/deps/jq/m4/ax_compare_version.m4 +177 -0
  88. package/deps/jq/m4/ax_prog_bison_version.m4 +68 -0
  89. package/deps/jq/main.c +566 -0
  90. package/deps/jq/opcode_list.h +44 -0
  91. package/deps/jq/parser.c +3914 -0
  92. package/deps/jq/parser.h +193 -0
  93. package/deps/jq/parser.y +923 -0
  94. package/deps/jq/scripts/crosscompile +42 -0
  95. package/deps/jq/scripts/gen_utf8_tables.py +32 -0
  96. package/deps/jq/scripts/version +5 -0
  97. package/deps/jq/setup.sh +33 -0
  98. package/deps/jq/tests/jq.test +1235 -0
  99. package/deps/jq/tests/jqtest +5 -0
  100. package/deps/jq/tests/mantest +7 -0
  101. package/deps/jq/tests/modules/.jq +5 -0
  102. package/deps/jq/tests/modules/a.jq +2 -0
  103. package/deps/jq/tests/modules/b/b.jq +2 -0
  104. package/deps/jq/tests/modules/c/c.jq +16 -0
  105. package/deps/jq/tests/modules/c/d.jq +1 -0
  106. package/deps/jq/tests/modules/data.json +4 -0
  107. package/deps/jq/tests/modules/lib/jq/e/e.jq +1 -0
  108. package/deps/jq/tests/modules/lib/jq/f.jq +1 -0
  109. package/deps/jq/tests/modules/syntaxerror/syntaxerror.jq +1 -0
  110. package/deps/jq/tests/modules/test_bind_order.jq +4 -0
  111. package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
  112. package/deps/jq/tests/modules/test_bind_order1.jq +2 -0
  113. package/deps/jq/tests/modules/test_bind_order2.jq +2 -0
  114. package/deps/jq/tests/onig.supp +21 -0
  115. package/deps/jq/tests/onig.test +85 -0
  116. package/deps/jq/tests/onigtest +5 -0
  117. package/deps/jq/tests/setup +36 -0
  118. package/deps/jq/tests/shtest +205 -0
  119. package/deps/jq/tests/torture/input0.json +7 -0
  120. package/deps/jq/util.c +462 -0
  121. package/deps/jq/util.h +64 -0
  122. package/deps/jq.gyp +35 -0
  123. package/index.d.ts +3 -0
  124. package/jest.config.js +10 -0
  125. package/lib/index.js +14 -0
  126. package/package.json +48 -0
  127. package/reports/jest-port-api.xml +35 -0
  128. package/src/binding.cc +177 -0
  129. package/src/binding.h +13 -0
  130. package/test/santiy.test.js +122 -0
  131. package/util/configure.js +27 -0
@@ -0,0 +1,198 @@
1
+
2
+ ### C source files to be built and distributed.
3
+
4
+ LIBJQ_INCS = jq_parser.h builtin.h bytecode.h compile.h exec_stack.h \
5
+ libm.h jv_alloc.h jv_dtoa.h jv_unicode.h locfile.h \
6
+ opcode_list.h parser.y jv_utf8_tables.h lexer.l util.h linker.h
7
+
8
+ LIBJQ_SRC = locfile.c bytecode.c compile.c execute.c builtin.c jv.c \
9
+ jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c jv_aux.c jv_file.c \
10
+ jv_alloc.c jq_test.c util.c linker.c ${LIBJQ_INCS}
11
+
12
+ ### C build options
13
+
14
+ AM_CFLAGS = -Wextra -Wall -Wno-missing-field-initializers \
15
+ -Wno-unused-parameter -Wno-unused-function
16
+
17
+ ACLOCAL_AMFLAGS = -I config/m4
18
+
19
+ ### Generating the lexer and parser
20
+
21
+ # While there is some autoconf macro support for lex/flex, it doesn't support
22
+ # header file creation so we'll use good old make
23
+ if MAINTAINER_MODE
24
+ BUILT_SOURCES = lexer.h lexer.c parser.h parser.c version.h
25
+ lexer.c: lexer.l
26
+ $(AM_V_LEX) flex -o lexer.c --header-file=lexer.h $<
27
+ lexer.h: lexer.c
28
+ else
29
+ BUILT_SOURCES =
30
+ .y.c:
31
+ $(AM_V_YACC) echo "NOT building parser.c!"
32
+ .l.c:
33
+ $(AM_V_LEX) echo "NOT building lexer.c!"
34
+ endif
35
+
36
+ # Tell YACC (bison) autoconf macros that you want a header file created.
37
+ # If the --warnings=all fails, you probably have an old version of bison
38
+ # OSX ships an old bison, so update with homebrew or macports
39
+ AM_YFLAGS = --warnings=all -d
40
+
41
+ ### libjq
42
+
43
+ lib_LTLIBRARIES = libjq.la
44
+ libjq_la_SOURCES = ${LIBJQ_SRC}
45
+ libjq_la_LIBADD = -lm
46
+ libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0
47
+
48
+ include_HEADERS = jv.h jq.h
49
+
50
+ ### Running tests under Valgrind
51
+
52
+ if ENABLE_VALGRIND
53
+ NO_VALGRIND =
54
+ else
55
+ NO_VALGRIND = 1
56
+ endif
57
+
58
+ ### Code coverage with gcov
59
+
60
+ if ENABLE_GCOV
61
+ AM_CFLAGS += --coverage --no-inline
62
+ endif
63
+
64
+ ### Error injection for testing
65
+
66
+ if ENABLE_ERROR_INJECTION
67
+ lib_LTLIBRARIES += libinject_errors.la
68
+ libinject_errors_la_SOURCES = inject_errors.c
69
+ libinject_errors_la_LIBADD = -ldl
70
+ libinject_errors_la_LDFLAGS = -module
71
+ endif
72
+
73
+ ### Building the jq binary
74
+
75
+ # Remake the version.h header file if, and only if, the git ID has changed
76
+ .PHONY: .FORCE
77
+ .FORCE:
78
+ generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\#define JQ_VERSION \"&\"/'`"
79
+ .remake-version-h: .FORCE
80
+ @ $(generate_ver); test "x`cat version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h
81
+ version.h: .remake-version-h
82
+ $(AM_V_GEN) $(generate_ver); echo "$$ver" > $@
83
+ main.c: version.h
84
+
85
+ bin_PROGRAMS = jq
86
+ jq_SOURCES = main.c version.h
87
+ jq_LDFLAGS = -static-libtool-libs
88
+ jq_LDADD = libjq.la -lm
89
+
90
+ if ENABLE_ALL_STATIC
91
+ jq_LDFLAGS += -all-static
92
+ endif
93
+
94
+ ### Tests (make check)
95
+
96
+ TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest
97
+ TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)
98
+
99
+
100
+ ### Building the manpage
101
+
102
+ # If ENABLE_DOCS is not set, just copy jq.1.default to jq.1
103
+ # The real_docs target succeeds (possibly after building jq.1) only if ENABLE_DOCS is set
104
+ # Thus, making "dist" depend on "real_docs" ensures that we never build a tarball with
105
+ # a stub manpage.
106
+
107
+ man_MANS = jq.1
108
+ .PHONY: real_docs
109
+ if ENABLE_DOCS
110
+ jq.1: $(srcdir)/docs/content/3.manual/manual.yml
111
+ $(AM_V_GEN) ( cd ${abs_srcdir}/docs; '$(BUNDLER)' exec rake manpage ) > $@ || { rm -f $@; false; }
112
+ jq.1.prebuilt: jq.1
113
+ $(AM_V_GEN) cp $^ $@ || { rm -f $@; false; }
114
+ jq.1.default: $(srcdir)/docs/default_manpage.md
115
+ $(AM_V_GEN) ( cd ${abs_srcdir}/docs; '$(BUNDLER)' exec rake manpage_default ) > $@ || { rm -f $@; false; }
116
+ real_docs: jq.1 jq.1.prebuilt
117
+ @if cmp jq.1 $(srcdir)/jq.1.default > /dev/null; then\
118
+ rm -f jq.1; $(MAKE) $(AM_MAKEFLAGS) jq.1;\
119
+ fi
120
+ else
121
+ jq.1: $(srcdir)/jq.1.prebuilt
122
+ $(AM_V_GEN) cp $^ $@
123
+ real_docs:
124
+ @echo "Ruby dependencies not found, cannot build manpage." > /dev/stderr
125
+ @echo "Follow the instructions in docs/README.md to install them" > /dev/stderr
126
+ @echo "and then rerun ./configure" > /dev/stderr
127
+ @echo "A pre-built, possibly out-of-date manpage used." > /dev/stderr
128
+ false
129
+ endif
130
+
131
+
132
+ ### Packaging
133
+
134
+ docs/site.yml: configure.ac
135
+ sed 's/^jq_version: .*/jq_version: "$(VERSION)"/' $@ > $@.new
136
+ mv $@.new $@
137
+
138
+ install-binaries: $(BUILT_SOURCES)
139
+ $(MAKE) $(AM_MAKEFLAGS) install-exec
140
+
141
+ # Ensure "make dist" fails when we can't build the real manpage
142
+ dist-hook: real_docs
143
+
144
+ DOC_FILES = docs/content docs/public docs/templates docs/site.yml \
145
+ docs/Gemfile docs/Gemfile.lock docs/Rakefile docs/README.md \
146
+ docs/default_manpage.md jq.1.default
147
+
148
+ # setup is only used by distribution developers, not package developers.
149
+ # Still, as a matter of allowing patching, its not a bad idea to distribute
150
+ # the developer setup script in the tarball.
151
+ EXTRA_DIST = $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER) jq.spec \
152
+ $(DOC_FILES) scripts/version parser.h parser.c lexer.h \
153
+ lexer.c tests/onig.supp tests/torture/input0.json \
154
+ tests/modules/.jq tests/modules/a.jq tests/modules/b/b.jq \
155
+ tests/modules/c/c.jq tests/modules/c/d.jq \
156
+ tests/modules/lib/jq/e/e.jq tests/modules/lib/jq/f.jq \
157
+ tests/setup tests/jq.test tests/onig.test \
158
+ tests/modules/data.json \
159
+ tests/modules/syntaxerror/syntaxerror.jq \
160
+ tests/modules/test_bind_order.jq \
161
+ tests/modules/test_bind_order0.jq \
162
+ tests/modules/test_bind_order1.jq \
163
+ tests/modules/test_bind_order2.jq \
164
+ jq.1.prebuilt
165
+
166
+
167
+ # README.md is expected in Github projects, good stuff in it, so we'll
168
+ # distribute it and install it with the package in the doc directory.
169
+ docdir = ${datadir}/doc/${PACKAGE}
170
+ dist_doc_DATA = README.md COPYING AUTHORS README
171
+
172
+ RELEASE ?= 1
173
+ rpm: dist jq.spec
174
+ @echo "Packaging jq as an RPM ..."
175
+ mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SPECS
176
+ cp jq-$(VERSION).tar.gz rpm/SOURCES/
177
+ rpmbuild -tb --define "_topdir ${PWD}/rpm" --define "_prefix /usr" --define "myver $(VERSION)" --define "myrel ${RELEASE}" rpm/SOURCES/jq-$(VERSION).tar.gz
178
+ find rpm/RPMS/ -name "*.rpm" -exec mv {} ./ \;
179
+ rm -rf rpm
180
+
181
+ dist-clean-local:
182
+ rm -f ${BUILT_SOURCES}
183
+
184
+ # Not sure why this doesn't get cleaned up automatically, guess
185
+ # automake used to man pages which are hand coded?
186
+ # 'make clean' doesn't delete the manpage if it can't be rebuilt
187
+ clean-local-docs:
188
+ if ENABLE_DOCS
189
+ rm -f jq.1
190
+ endif
191
+
192
+ clean-local-gcov:
193
+ rm -f *.gcno *.gcda *.gcov
194
+
195
+ clean-local: clean-local-docs clean-local-gcov
196
+ rm -f version.h .remake-version-h
197
+
198
+ .PHONY: clean-local-docs clean-local-gcov
package/deps/jq/NEWS ADDED
@@ -0,0 +1,88 @@
1
+
2
+ Release history
3
+
4
+ * jq version 1.0 was released on Sun Oct 21 2012
5
+ * jq version 1.1 was released on Sun Oct 21 2012
6
+ * jq version 1.2 was released on Thu Dec 20 2012
7
+ * jq version 1.3 was released on Sun May 19 2013
8
+ * jq version 1.4 was released on Mon Jun 9 2014
9
+
10
+ New features in 1.5 since 1.4:
11
+
12
+ - regular expressions (with Oniguruma)
13
+
14
+ - a library/module system
15
+
16
+ - many new builtins
17
+
18
+ - datetime builtins
19
+ - math builtins
20
+ - regexp-related builtins
21
+ - stream-related builtins (e.g., all/1, any/1)
22
+ - minimal I/O builtins (`inputs`, `debug`)
23
+
24
+ - new syntactic features, including:
25
+
26
+ - destructuring (`. as [$first, $second] | ...`)
27
+ - try/catch, generalized `?` operator, and label/break
28
+ - `foreach`
29
+ - multiple definitions of a function with different numbers of
30
+ arguments
31
+
32
+ - command-line arguments
33
+
34
+ - --join-lines / -j for raw output
35
+ - --argjson and --slurpfile
36
+ - --tab and --indent
37
+ - --stream (streaming JSON parser)
38
+ - --seq (RFC7464 JSON text sequence)
39
+ - --run-tests improvements
40
+
41
+ - optimizations:
42
+
43
+ - tail-call optimization
44
+ - reduce and foreach no longer leak a reference to .
45
+
46
+ New features in 1.4 since 1.3:
47
+
48
+ - command-line arguments
49
+
50
+ - jq --arg-file variable file
51
+ - jq --unbuffered
52
+ - jq -e / --exit-status (set exit status based on outputs)
53
+ - jq -S / --sort-keys (now jq no longer sorts object keys by
54
+ default
55
+
56
+ - syntax
57
+
58
+ - .. -> like // in XPath (recursive traversal)
59
+ - question mark (e.g., .a?) to suppress errors
60
+ - ."foo" syntax (equivalent to .["foo"])
61
+ - better error handling for .foo
62
+ - added % operator (modulo)
63
+ - allow negation without requiring extra parenthesis
64
+ - more function arguments (up to six)
65
+
66
+ - filters:
67
+
68
+ - any, all
69
+ - iterables, arrays, objects, scalars, nulls, booleans, numbers,
70
+ strings, values
71
+
72
+ - string built-ins:
73
+
74
+ - split
75
+ - join (join an array of strings with a given separator string)
76
+ - ltrimstr, rtrimstr
77
+ - startswith, endswith
78
+ - explode, implode
79
+ - fromjson, tojson
80
+ - index, rindex, indices
81
+
82
+ - math functions
83
+
84
+ - floor, sqrt, cbrt, etetera (depends on what's available from libm)
85
+
86
+ - libjq -- a C API interface to jq's JSON representation and for
87
+ running jq programs from C applications
88
+
@@ -0,0 +1,64 @@
1
+ jq
2
+ ==
3
+
4
+ jq is a command-line JSON processor.
5
+
6
+ If you want to learn to use jq, read the documentation at
7
+ [https://stedolan.github.io/jq](https://stedolan.github.io/jq). This
8
+ documentation is generated from the docs/ folder of this repository.
9
+ You can also try it online at [jqplay.org](https://jqplay.org).
10
+
11
+ If you want to hack on jq, feel free, but be warned that its internals
12
+ are not well-documented at the moment. Bring a hard hat and a
13
+ shovel. Also, read the wiki: https://github.com/stedolan/jq/wiki
14
+
15
+ Source tarball and built executable releases can be found on the
16
+ homepage and on the github release page, https://github.com/stedolan/jq/releases
17
+
18
+ If you're building directly from the latest git, you'll need flex,
19
+ bison (3.0 or newer), libtool, make, and autoconf installed. To get
20
+ regexp support you'll also need to install Oniguruma (note that jq's
21
+ tests require regexp support to pass). To build, run:
22
+
23
+ autoreconf -i # if building from git
24
+ ./configure
25
+ make -j8
26
+ make check
27
+
28
+ To build without bison or flex, add `--disable-maintainer-mode` to the
29
+ ./configure invocation:
30
+
31
+ ./configure --disable-maintainer-mode
32
+
33
+ (Developers must not use `--disable-maintainer-mode`, not when making
34
+ changes to the jq parser and/or lexer.)
35
+
36
+ To build a statically linked version of jq, run:
37
+
38
+ make LDFLAGS=-all-static
39
+
40
+ After make finishes, you'll be able to use `./jq`. You can also
41
+ install it using:
42
+
43
+ sudo make install
44
+
45
+ If you're not using the latest git version but instead building a
46
+ released tarball (available on the website), then you won't need to
47
+ run `autoreconf` (and shouldn't), and you won't need flex or bison.
48
+
49
+ To cross-compile for OS X and Windows, see docs/Rakefile's build task
50
+ and scripts/crosscompile. You'll need a cross-compilation environment,
51
+ such as Mingw for cross-compiling for Windows.
52
+
53
+ Cross-compilation requires a clean workspace, then:
54
+
55
+ # git clean ...
56
+ autoreconf -i
57
+ ./configure
58
+ make distclean
59
+ scripts/crosscompile <name-of-build> <configure-options>
60
+
61
+ Use the --host= and --target= ./configure options to select a
62
+ cross-compilation environment. See also the wiki.
63
+
64
+ Send questions to https://stackoverflow.com/questions/tagged/jq or to the #jq channel (http://irc.lc/freenode/%23jq/) on Freenode (https://webchat.freenode.net/).