Skip to content

Commit 4d1059d

Browse files
committed
fix: aggiornamento assets\src\js\wacom\modules\protobufjs alla versione 7.2.4 per vulnerabilità CVE-2023-36665
1 parent efe4a6d commit 4d1059d

66 files changed

Lines changed: 509 additions & 4640 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/src/js/wacom/modules/protobufjs/CHANGELOG.md

Lines changed: 0 additions & 1027 deletions
This file was deleted.

assets/src/js/wacom/modules/protobufjs/README.md

Lines changed: 15 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ Contents
2727
* [Using services](#using-services)
2828
* [Usage with TypeScript](#usage-with-typescript)<br />
2929

30-
* [Command line](#command-line)<br />
31-
How to use the command line utility.
32-
33-
* [pbjs for JavaScript](#pbjs-for-javascript)
34-
* [pbts for TypeScript](#pbts-for-typescript)
35-
* [Reflection vs. static code](#reflection-vs-static-code)
36-
* [Command line API](#command-line-api)<br />
37-
3830
* [Additional documentation](#additional-documentation)<br />
3931
A list of available documentation resources.
4032

@@ -60,31 +52,37 @@ $> npm install protobufjs [--save --save-prefix=~]
6052
var protobuf = require("protobufjs");
6153
```
6254

55+
The command line utility lives in the protobufjs-cli package and must be installed separately:
56+
57+
```
58+
$> npm install protobufjs-cli [--save --save-prefix=~]
59+
```
60+
6361
**Note** that this library's versioning scheme is not semver-compatible for historical reasons. For guaranteed backward compatibility, always depend on `~6.A.B` instead of `^6.A.B` (hence the `--save-prefix` above).
6462

6563
### Browsers
6664

6765
Development:
6866

6967
```
70-
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.js"></script>
68+
<script src="//cdn.jsdelivr.net/npm/protobufjs@7.X.X/dist/protobuf.js"></script>
7169
```
7270

7371
Production:
7472

7573
```
76-
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.min.js"></script>
74+
<script src="//cdn.jsdelivr.net/npm/protobufjs@7.X.X/dist/protobuf.min.js"></script>
7775
```
7876

79-
**Remember** to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
77+
**Remember** to replace the version tag with the exact [release](https://github.com/protobufjs/protobuf.js/tags) your project depends upon.
8078

8179
The library supports CommonJS and AMD loaders and also exports globally as `protobuf`.
8280

8381
### Distributions
8482

8583
Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality:
8684

87-
* When working with JSON descriptors (i.e. generated by [pbjs](#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is:
85+
* When working with JSON descriptors (i.e. generated by [pbjs](cli/README.md#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is:
8886

8987
```js
9088
var protobuf = require("protobufjs/light");
@@ -96,9 +94,11 @@ Where bundle size is a factor, there are additional stripped-down versions of th
9694
var protobuf = require("protobufjs/minimal");
9795
```
9896

99-
[dist-full]: https://github.com/dcodeIO/protobuf.js/tree/master/dist
100-
[dist-light]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/light
101-
[dist-minimal]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/minimal
97+
| Distribution | Location
98+
|------------|-----------------------------------
99+
| Full | <https://cdn.jsdelivr.net/npm/protobufjs/dist/>
100+
| Light | <https://cdn.jsdelivr.net/npm/protobufjs/dist/light/>
101+
| Minimal | <https://cdn.jsdelivr.net/npm/protobufjs/dist/minimal/>
102102

103103
Usage
104104
-----
@@ -597,171 +597,6 @@ Other notes:
597597

598598
**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well.
599599

600-
Command line
601-
------------
602-
603-
**Note** that moving the CLI to [its own package](./cli) is a work in progress. At the moment, it's still part of the main package.
604-
605-
The command line interface (CLI) can be used to translate between file formats and to generate static code as well as TypeScript definitions.
606-
607-
### pbjs for JavaScript
608-
609-
```
610-
Translates between file formats and generates static code.
611-
612-
-t, --target Specifies the target format. Also accepts a path to require a custom target.
613-
614-
json JSON representation
615-
json-module JSON representation as a module
616-
proto2 Protocol Buffers, Version 2
617-
proto3 Protocol Buffers, Version 3
618-
static Static code without reflection (non-functional on its own)
619-
static-module Static code without reflection as a module
620-
621-
-p, --path Adds a directory to the include path.
622-
623-
-o, --out Saves to a file instead of writing to stdout.
624-
625-
--sparse Exports only those types referenced from a main file (experimental).
626-
627-
Module targets only:
628-
629-
-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.
630-
631-
default Default wrapper supporting both CommonJS and AMD
632-
commonjs CommonJS wrapper
633-
amd AMD wrapper
634-
es6 ES6 wrapper (implies --es6)
635-
closure A closure adding to protobuf.roots where protobuf is a global
636-
637-
-r, --root Specifies an alternative protobuf.roots name.
638-
639-
-l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:
640-
641-
eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins
642-
643-
--es6 Enables ES6 syntax (const/let instead of var)
644-
645-
Proto sources only:
646-
647-
--keep-case Keeps field casing instead of converting to camel case.
648-
649-
Static targets only:
650-
651-
--no-create Does not generate create functions used for reflection compatibility.
652-
--no-encode Does not generate encode functions.
653-
--no-decode Does not generate decode functions.
654-
--no-verify Does not generate verify functions.
655-
--no-convert Does not generate convert functions like from/toObject
656-
--no-delimited Does not generate delimited encode/decode functions.
657-
--no-beautify Does not beautify generated code.
658-
--no-comments Does not output any JSDoc comments.
659-
660-
--force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.
661-
--force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.
662-
--force-message Enforces the use of message instances instead of plain objects.
663-
664-
usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] -
665-
```
666-
667-
For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library):
668-
669-
```
670-
$> pbjs -t json file1.proto file2.proto > bundle.json
671-
```
672-
673-
Now, either include this file in your final bundle:
674-
675-
```js
676-
var root = protobuf.Root.fromJSON(require("./bundle.json"));
677-
```
678-
679-
or load it the usual way:
680-
681-
```js
682-
protobuf.load("bundle.json", function(err, root) {
683-
...
684-
});
685-
```
686-
687-
Generated static code, on the other hand, works with just the **minimal** library. For example
688-
689-
```
690-
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
691-
```
692-
693-
will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`.
694-
695-
**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code.
696-
697-
698-
### pbts for TypeScript
699-
700-
```
701-
Generates TypeScript definitions from annotated JavaScript files.
702-
703-
-o, --out Saves to a file instead of writing to stdout.
704-
705-
-g, --global Name of the global object in browser environments, if any.
706-
707-
--no-comments Does not output any JSDoc comments.
708-
709-
Internal flags:
710-
711-
-n, --name Wraps everything in a module of the specified name.
712-
713-
-m, --main Whether building the main library without any imports.
714-
715-
usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] -
716-
```
717-
718-
Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`:
719-
720-
```
721-
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
722-
$> pbts -o compiled.d.ts compiled.js
723-
```
724-
725-
Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met:
726-
727-
1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor.
728-
2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`).
729-
730-
For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code:
731-
732-
```
733-
$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto
734-
$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -
735-
```
736-
737-
### Reflection vs. static code
738-
739-
While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared.
740-
741-
Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library.
742-
743-
There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.
744-
745-
| Source | Library | Advantages | Tradeoffs
746-
|--------|---------|------------|-----------
747-
| .proto | full | Easily editable<br />Interoperability with other libraries<br />No compile step | Some parsing and possibly network overhead
748-
| JSON | light | Easily editable<br />No parsing overhead<br />Single bundle (no network overhead) | protobuf.js specific<br />Has a compile step
749-
| static | minimal | Works where `eval` access is restricted<br />Fully documented<br />Small footprint for small protos | Can be hard to edit<br />No reflection<br />Has a compile step
750-
751-
### Command line API
752-
753-
Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions:
754-
755-
```js
756-
var pbjs = require("protobufjs/cli/pbjs"); // or require("protobufjs/cli").pbjs / .pbts
757-
758-
pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) {
759-
if (err)
760-
throw err;
761-
// do something with output
762-
});
763-
```
764-
765600
Additional documentation
766601
------------------------
767602

assets/src/js/wacom/modules/protobufjs/bin/pbjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

assets/src/js/wacom/modules/protobufjs/bin/pbts

Lines changed: 0 additions & 6 deletions
This file was deleted.

assets/src/js/wacom/modules/protobufjs/cli/LICENSE

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)