rxdb-server 15.4.3

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 (82) hide show
  1. package/LICENSE.txt +555 -0
  2. package/README.md +7 -0
  3. package/dist/cjs/index.js +10 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/plugins/client-rest/index.js +86 -0
  6. package/dist/cjs/plugins/client-rest/index.js.map +1 -0
  7. package/dist/cjs/plugins/client-rest/utils.js +19 -0
  8. package/dist/cjs/plugins/client-rest/utils.js.map +1 -0
  9. package/dist/cjs/plugins/replication-server/helpers.js +38 -0
  10. package/dist/cjs/plugins/replication-server/helpers.js.map +1 -0
  11. package/dist/cjs/plugins/replication-server/index.js +169 -0
  12. package/dist/cjs/plugins/replication-server/index.js.map +1 -0
  13. package/dist/cjs/plugins/replication-server/types.js +2 -0
  14. package/dist/cjs/plugins/replication-server/types.js.map +1 -0
  15. package/dist/cjs/plugins/server/endpoint-replication.js +162 -0
  16. package/dist/cjs/plugins/server/endpoint-replication.js.map +1 -0
  17. package/dist/cjs/plugins/server/endpoint-rest.js +219 -0
  18. package/dist/cjs/plugins/server/endpoint-rest.js.map +1 -0
  19. package/dist/cjs/plugins/server/helper.js +173 -0
  20. package/dist/cjs/plugins/server/helper.js.map +1 -0
  21. package/dist/cjs/plugins/server/index.js +84 -0
  22. package/dist/cjs/plugins/server/index.js.map +1 -0
  23. package/dist/cjs/plugins/server/rx-server.js +51 -0
  24. package/dist/cjs/plugins/server/rx-server.js.map +1 -0
  25. package/dist/cjs/plugins/server/types.js +37 -0
  26. package/dist/cjs/plugins/server/types.js.map +1 -0
  27. package/dist/esm/index.js +4 -0
  28. package/dist/esm/index.js.map +1 -0
  29. package/dist/esm/package.json +1 -0
  30. package/dist/esm/plugins/client-rest/index.js +64 -0
  31. package/dist/esm/plugins/client-rest/index.js.map +1 -0
  32. package/dist/esm/plugins/client-rest/utils.js +13 -0
  33. package/dist/esm/plugins/client-rest/utils.js.map +1 -0
  34. package/dist/esm/plugins/replication-server/helpers.js +32 -0
  35. package/dist/esm/plugins/replication-server/helpers.js.map +1 -0
  36. package/dist/esm/plugins/replication-server/index.js +146 -0
  37. package/dist/esm/plugins/replication-server/index.js.map +1 -0
  38. package/dist/esm/plugins/replication-server/types.js +3 -0
  39. package/dist/esm/plugins/replication-server/types.js.map +1 -0
  40. package/dist/esm/plugins/server/endpoint-replication.js +156 -0
  41. package/dist/esm/plugins/server/endpoint-replication.js.map +1 -0
  42. package/dist/esm/plugins/server/endpoint-rest.js +213 -0
  43. package/dist/esm/plugins/server/endpoint-rest.js.map +1 -0
  44. package/dist/esm/plugins/server/helper.js +157 -0
  45. package/dist/esm/plugins/server/helper.js.map +1 -0
  46. package/dist/esm/plugins/server/index.js +30 -0
  47. package/dist/esm/plugins/server/index.js.map +1 -0
  48. package/dist/esm/plugins/server/rx-server.js +45 -0
  49. package/dist/esm/plugins/server/rx-server.js.map +1 -0
  50. package/dist/esm/plugins/server/types.js +37 -0
  51. package/dist/esm/plugins/server/types.js.map +1 -0
  52. package/dist/types/index.d.ts +1 -0
  53. package/dist/types/plugins/client-rest/index.d.ts +22 -0
  54. package/dist/types/plugins/client-rest/utils.d.ts +2 -0
  55. package/dist/types/plugins/replication-server/helpers.d.ts +2 -0
  56. package/dist/types/plugins/replication-server/index.d.ts +21 -0
  57. package/dist/types/plugins/replication-server/types.d.ts +17 -0
  58. package/dist/types/plugins/server/endpoint-replication.d.ts +20 -0
  59. package/dist/types/plugins/server/endpoint-rest.d.ts +16 -0
  60. package/dist/types/plugins/server/helper.d.ts +23 -0
  61. package/dist/types/plugins/server/index.d.ts +7 -0
  62. package/dist/types/plugins/server/rx-server.d.ts +44 -0
  63. package/dist/types/plugins/server/types.d.ts +66 -0
  64. package/package.json +139 -0
  65. package/plugins/client-rest/index.cjs +2 -0
  66. package/plugins/client-rest/index.d.cts +1 -0
  67. package/plugins/client-rest/index.d.mts +1 -0
  68. package/plugins/client-rest/index.mjs +1 -0
  69. package/plugins/client-rest/index.ts +1 -0
  70. package/plugins/client-rest/package.json +18 -0
  71. package/plugins/replication-server/index.cjs +2 -0
  72. package/plugins/replication-server/index.d.cts +1 -0
  73. package/plugins/replication-server/index.d.mts +1 -0
  74. package/plugins/replication-server/index.mjs +1 -0
  75. package/plugins/replication-server/index.ts +1 -0
  76. package/plugins/replication-server/package.json +18 -0
  77. package/plugins/server/index.cjs +2 -0
  78. package/plugins/server/index.d.cts +1 -0
  79. package/plugins/server/index.d.mts +1 -0
  80. package/plugins/server/index.mjs +1 -0
  81. package/plugins/server/index.ts +1 -0
  82. package/plugins/server/package.json +18 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,555 @@
1
+ Server Side Public License
2
+ VERSION 1, OCTOBER 16, 2018
3
+
4
+ Everyone is permitted to copy and distribute verbatim copies of this
5
+ license document, but changing it is not allowed.
6
+
7
+ TERMS AND CONDITIONS
8
+
9
+ 0. Definitions.
10
+
11
+ “This License” refers to Server Side Public License.
12
+
13
+ “Copyright” also means copyright-like laws that apply to other kinds of
14
+ works, such as semiconductor masks.
15
+
16
+ “The Program” refers to any copyrightable work licensed under this
17
+ License. Each licensee is addressed as “you”. “Licensees” and
18
+ “recipients” may be individuals or organizations.
19
+
20
+ To “modify” a work means to copy from or adapt all or part of the work in
21
+ a fashion requiring copyright permission, other than the making of an
22
+ exact copy. The resulting work is called a “modified version” of the
23
+ earlier work or a work “based on” the earlier work.
24
+
25
+ A “covered work” means either the unmodified Program or a work based on
26
+ the Program.
27
+
28
+ To “propagate” a work means to do anything with it that, without
29
+ permission, would make you directly or secondarily liable for
30
+ infringement under applicable copyright law, except executing it on a
31
+ computer or modifying a private copy. Propagation includes copying,
32
+ distribution (with or without modification), making available to the
33
+ public, and in some countries other activities as well.
34
+
35
+ To “convey” a work means any kind of propagation that enables other
36
+ parties to make or receive copies. Mere interaction with a user through a
37
+ computer network, with no transfer of a copy, is not conveying.
38
+
39
+ An interactive user interface displays “Appropriate Legal Notices” to the
40
+ extent that it includes a convenient and prominently visible feature that
41
+ (1) displays an appropriate copyright notice, and (2) tells the user that
42
+ there is no warranty for the work (except to the extent that warranties
43
+ are provided), that licensees may convey the work under this License, and
44
+ how to view a copy of this License. If the interface presents a list of
45
+ user commands or options, such as a menu, a prominent item in the list
46
+ meets this criterion.
47
+
48
+ 1. Source Code.
49
+
50
+ The “source code” for a work means the preferred form of the work for
51
+ making modifications to it. “Object code” means any non-source form of a
52
+ work.
53
+
54
+ A “Standard Interface” means an interface that either is an official
55
+ standard defined by a recognized standards body, or, in the case of
56
+ interfaces specified for a particular programming language, one that is
57
+ widely used among developers working in that language. The “System
58
+ Libraries” of an executable work include anything, other than the work as
59
+ a whole, that (a) is included in the normal form of packaging a Major
60
+ Component, but which is not part of that Major Component, and (b) serves
61
+ only to enable use of the work with that Major Component, or to implement
62
+ a Standard Interface for which an implementation is available to the
63
+ public in source code form. A “Major Component”, in this context, means a
64
+ major essential component (kernel, window system, and so on) of the
65
+ specific operating system (if any) on which the executable work runs, or
66
+ a compiler used to produce the work, or an object code interpreter used
67
+ to run it.
68
+
69
+ The “Corresponding Source” for a work in object code form means all the
70
+ source code needed to generate, install, and (for an executable work) run
71
+ the object code and to modify the work, including scripts to control
72
+ those activities. However, it does not include the work's System
73
+ Libraries, or general-purpose tools or generally available free programs
74
+ which are used unmodified in performing those activities but which are
75
+ not part of the work. For example, Corresponding Source includes
76
+ interface definition files associated with source files for the work, and
77
+ the source code for shared libraries and dynamically linked subprograms
78
+ that the work is specifically designed to require, such as by intimate
79
+ data communication or control flow between those subprograms and other
80
+ parts of the work.
81
+
82
+ The Corresponding Source need not include anything that users can
83
+ regenerate automatically from other parts of the Corresponding Source.
84
+
85
+ The Corresponding Source for a work in source code form is that same work.
86
+
87
+ 2. Basic Permissions.
88
+
89
+ All rights granted under this License are granted for the term of
90
+ copyright on the Program, and are irrevocable provided the stated
91
+ conditions are met. This License explicitly affirms your unlimited
92
+ permission to run the unmodified Program, subject to section 13. The
93
+ output from running a covered work is covered by this License only if the
94
+ output, given its content, constitutes a covered work. This License
95
+ acknowledges your rights of fair use or other equivalent, as provided by
96
+ copyright law. Subject to section 13, you may make, run and propagate
97
+ covered works that you do not convey, without conditions so long as your
98
+ license otherwise remains in force. You may convey covered works to
99
+ others for the sole purpose of having them make modifications exclusively
100
+ for you, or provide you with facilities for running those works, provided
101
+ that you comply with the terms of this License in conveying all
102
+ material for which you do not control copyright. Those thus making or
103
+ running the covered works for you must do so exclusively on your
104
+ behalf, under your direction and control, on terms that prohibit them
105
+ from making any copies of your copyrighted material outside their
106
+ relationship with you.
107
+
108
+ Conveying under any other circumstances is permitted solely under the
109
+ conditions stated below. Sublicensing is not allowed; section 10 makes it
110
+ unnecessary.
111
+
112
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
113
+
114
+ No covered work shall be deemed part of an effective technological
115
+ measure under any applicable law fulfilling obligations under article 11
116
+ of the WIPO copyright treaty adopted on 20 December 1996, or similar laws
117
+ prohibiting or restricting circumvention of such measures.
118
+
119
+ When you convey a covered work, you waive any legal power to forbid
120
+ circumvention of technological measures to the extent such circumvention is
121
+ effected by exercising rights under this License with respect to the
122
+ covered work, and you disclaim any intention to limit operation or
123
+ modification of the work as a means of enforcing, against the work's users,
124
+ your or third parties' legal rights to forbid circumvention of
125
+ technological measures.
126
+
127
+ 4. Conveying Verbatim Copies.
128
+
129
+ You may convey verbatim copies of the Program's source code as you
130
+ receive it, in any medium, provided that you conspicuously and
131
+ appropriately publish on each copy an appropriate copyright notice; keep
132
+ intact all notices stating that this License and any non-permissive terms
133
+ added in accord with section 7 apply to the code; keep intact all notices
134
+ of the absence of any warranty; and give all recipients a copy of this
135
+ License along with the Program. You may charge any price or no price for
136
+ each copy that you convey, and you may offer support or warranty
137
+ protection for a fee.
138
+
139
+ 5. Conveying Modified Source Versions.
140
+
141
+ You may convey a work based on the Program, or the modifications to
142
+ produce it from the Program, in the form of source code under the terms
143
+ of section 4, provided that you also meet all of these conditions:
144
+
145
+ a) The work must carry prominent notices stating that you modified it,
146
+ and giving a relevant date.
147
+
148
+ b) The work must carry prominent notices stating that it is released
149
+ under this License and any conditions added under section 7. This
150
+ requirement modifies the requirement in section 4 to “keep intact all
151
+ notices”.
152
+
153
+ c) You must license the entire work, as a whole, under this License to
154
+ anyone who comes into possession of a copy. This License will therefore
155
+ apply, along with any applicable section 7 additional terms, to the
156
+ whole of the work, and all its parts, regardless of how they are
157
+ packaged. This License gives no permission to license the work in any
158
+ other way, but it does not invalidate such permission if you have
159
+ separately received it.
160
+
161
+ d) If the work has interactive user interfaces, each must display
162
+ Appropriate Legal Notices; however, if the Program has interactive
163
+ interfaces that do not display Appropriate Legal Notices, your work
164
+ need not make them do so.
165
+
166
+ A compilation of a covered work with other separate and independent
167
+ works, which are not by their nature extensions of the covered work, and
168
+ which are not combined with it such as to form a larger program, in or on
169
+ a volume of a storage or distribution medium, is called an “aggregate” if
170
+ the compilation and its resulting copyright are not used to limit the
171
+ access or legal rights of the compilation's users beyond what the
172
+ individual works permit. Inclusion of a covered work in an aggregate does
173
+ not cause this License to apply to the other parts of the aggregate.
174
+
175
+ 6. Conveying Non-Source Forms.
176
+
177
+ You may convey a covered work in object code form under the terms of
178
+ sections 4 and 5, provided that you also convey the machine-readable
179
+ Corresponding Source under the terms of this License, in one of these
180
+ ways:
181
+
182
+ a) Convey the object code in, or embodied in, a physical product
183
+ (including a physical distribution medium), accompanied by the
184
+ Corresponding Source fixed on a durable physical medium customarily
185
+ used for software interchange.
186
+
187
+ b) Convey the object code in, or embodied in, a physical product
188
+ (including a physical distribution medium), accompanied by a written
189
+ offer, valid for at least three years and valid for as long as you
190
+ offer spare parts or customer support for that product model, to give
191
+ anyone who possesses the object code either (1) a copy of the
192
+ Corresponding Source for all the software in the product that is
193
+ covered by this License, on a durable physical medium customarily used
194
+ for software interchange, for a price no more than your reasonable cost
195
+ of physically performing this conveying of source, or (2) access to
196
+ copy the Corresponding Source from a network server at no charge.
197
+
198
+ c) Convey individual copies of the object code with a copy of the
199
+ written offer to provide the Corresponding Source. This alternative is
200
+ allowed only occasionally and noncommercially, and only if you received
201
+ the object code with such an offer, in accord with subsection 6b.
202
+
203
+ d) Convey the object code by offering access from a designated place
204
+ (gratis or for a charge), and offer equivalent access to the
205
+ Corresponding Source in the same way through the same place at no
206
+ further charge. You need not require recipients to copy the
207
+ Corresponding Source along with the object code. If the place to copy
208
+ the object code is a network server, the Corresponding Source may be on
209
+ a different server (operated by you or a third party) that supports
210
+ equivalent copying facilities, provided you maintain clear directions
211
+ next to the object code saying where to find the Corresponding Source.
212
+ Regardless of what server hosts the Corresponding Source, you remain
213
+ obligated to ensure that it is available for as long as needed to
214
+ satisfy these requirements.
215
+
216
+ e) Convey the object code using peer-to-peer transmission, provided you
217
+ inform other peers where the object code and Corresponding Source of
218
+ the work are being offered to the general public at no charge under
219
+ subsection 6d.
220
+
221
+ A separable portion of the object code, whose source code is excluded
222
+ from the Corresponding Source as a System Library, need not be included
223
+ in conveying the object code work.
224
+
225
+ A “User Product” is either (1) a “consumer product”, which means any
226
+ tangible personal property which is normally used for personal, family,
227
+ or household purposes, or (2) anything designed or sold for incorporation
228
+ into a dwelling. In determining whether a product is a consumer product,
229
+ doubtful cases shall be resolved in favor of coverage. For a particular
230
+ product received by a particular user, “normally used” refers to a
231
+ typical or common use of that class of product, regardless of the status
232
+ of the particular user or of the way in which the particular user
233
+ actually uses, or expects or is expected to use, the product. A product
234
+ is a consumer product regardless of whether the product has substantial
235
+ commercial, industrial or non-consumer uses, unless such uses represent
236
+ the only significant mode of use of the product.
237
+
238
+ “Installation Information” for a User Product means any methods,
239
+ procedures, authorization keys, or other information required to install
240
+ and execute modified versions of a covered work in that User Product from
241
+ a modified version of its Corresponding Source. The information must
242
+ suffice to ensure that the continued functioning of the modified object
243
+ code is in no case prevented or interfered with solely because
244
+ modification has been made.
245
+
246
+ If you convey an object code work under this section in, or with, or
247
+ specifically for use in, a User Product, and the conveying occurs as part
248
+ of a transaction in which the right of possession and use of the User
249
+ Product is transferred to the recipient in perpetuity or for a fixed term
250
+ (regardless of how the transaction is characterized), the Corresponding
251
+ Source conveyed under this section must be accompanied by the
252
+ Installation Information. But this requirement does not apply if neither
253
+ you nor any third party retains the ability to install modified object
254
+ code on the User Product (for example, the work has been installed in
255
+ ROM).
256
+
257
+ The requirement to provide Installation Information does not include a
258
+ requirement to continue to provide support service, warranty, or updates
259
+ for a work that has been modified or installed by the recipient, or for
260
+ the User Product in which it has been modified or installed. Access
261
+ to a network may be denied when the modification itself materially
262
+ and adversely affects the operation of the network or violates the
263
+ rules and protocols for communication across the network.
264
+
265
+ Corresponding Source conveyed, and Installation Information provided, in
266
+ accord with this section must be in a format that is publicly documented
267
+ (and with an implementation available to the public in source code form),
268
+ and must require no special password or key for unpacking, reading or
269
+ copying.
270
+
271
+ 7. Additional Terms.
272
+
273
+ “Additional permissions” are terms that supplement the terms of this
274
+ License by making exceptions from one or more of its conditions.
275
+ Additional permissions that are applicable to the entire Program shall be
276
+ treated as though they were included in this License, to the extent that
277
+ they are valid under applicable law. If additional permissions apply only
278
+ to part of the Program, that part may be used separately under those
279
+ permissions, but the entire Program remains governed by this License
280
+ without regard to the additional permissions. When you convey a copy of
281
+ a covered work, you may at your option remove any additional permissions
282
+ from that copy, or from any part of it. (Additional permissions may be
283
+ written to require their own removal in certain cases when you modify the
284
+ work.) You may place additional permissions on material, added by you to
285
+ a covered work, for which you have or can give appropriate copyright
286
+ permission.
287
+
288
+ Notwithstanding any other provision of this License, for material you add
289
+ to a covered work, you may (if authorized by the copyright holders of
290
+ that material) supplement the terms of this License with terms:
291
+
292
+ a) Disclaiming warranty or limiting liability differently from the
293
+ terms of sections 15 and 16 of this License; or
294
+
295
+ b) Requiring preservation of specified reasonable legal notices or
296
+ author attributions in that material or in the Appropriate Legal
297
+ Notices displayed by works containing it; or
298
+
299
+ c) Prohibiting misrepresentation of the origin of that material, or
300
+ requiring that modified versions of such material be marked in
301
+ reasonable ways as different from the original version; or
302
+
303
+ d) Limiting the use for publicity purposes of names of licensors or
304
+ authors of the material; or
305
+
306
+ e) Declining to grant rights under trademark law for use of some trade
307
+ names, trademarks, or service marks; or
308
+
309
+ f) Requiring indemnification of licensors and authors of that material
310
+ by anyone who conveys the material (or modified versions of it) with
311
+ contractual assumptions of liability to the recipient, for any
312
+ liability that these contractual assumptions directly impose on those
313
+ licensors and authors.
314
+
315
+ All other non-permissive additional terms are considered “further
316
+ restrictions” within the meaning of section 10. If the Program as you
317
+ received it, or any part of it, contains a notice stating that it is
318
+ governed by this License along with a term that is a further restriction,
319
+ you may remove that term. If a license document contains a further
320
+ restriction but permits relicensing or conveying under this License, you
321
+ may add to a covered work material governed by the terms of that license
322
+ document, provided that the further restriction does not survive such
323
+ relicensing or conveying.
324
+
325
+ If you add terms to a covered work in accord with this section, you must
326
+ place, in the relevant source files, a statement of the additional terms
327
+ that apply to those files, or a notice indicating where to find the
328
+ applicable terms. Additional terms, permissive or non-permissive, may be
329
+ stated in the form of a separately written license, or stated as
330
+ exceptions; the above requirements apply either way.
331
+
332
+ 8. Termination.
333
+
334
+ You may not propagate or modify a covered work except as expressly
335
+ provided under this License. Any attempt otherwise to propagate or modify
336
+ it is void, and will automatically terminate your rights under this
337
+ License (including any patent licenses granted under the third paragraph
338
+ of section 11).
339
+
340
+ However, if you cease all violation of this License, then your license
341
+ from a particular copyright holder is reinstated (a) provisionally,
342
+ unless and until the copyright holder explicitly and finally terminates
343
+ your license, and (b) permanently, if the copyright holder fails to
344
+ notify you of the violation by some reasonable means prior to 60 days
345
+ after the cessation.
346
+
347
+ Moreover, your license from a particular copyright holder is reinstated
348
+ permanently if the copyright holder notifies you of the violation by some
349
+ reasonable means, this is the first time you have received notice of
350
+ violation of this License (for any work) from that copyright holder, and
351
+ you cure the violation prior to 30 days after your receipt of the notice.
352
+
353
+ Termination of your rights under this section does not terminate the
354
+ licenses of parties who have received copies or rights from you under
355
+ this License. If your rights have been terminated and not permanently
356
+ reinstated, you do not qualify to receive new licenses for the same
357
+ material under section 10.
358
+
359
+ 9. Acceptance Not Required for Having Copies.
360
+
361
+ You are not required to accept this License in order to receive or run a
362
+ copy of the Program. Ancillary propagation of a covered work occurring
363
+ solely as a consequence of using peer-to-peer transmission to receive a
364
+ copy likewise does not require acceptance. However, nothing other than
365
+ this License grants you permission to propagate or modify any covered
366
+ work. These actions infringe copyright if you do not accept this License.
367
+ Therefore, by modifying or propagating a covered work, you indicate your
368
+ acceptance of this License to do so.
369
+
370
+ 10. Automatic Licensing of Downstream Recipients.
371
+
372
+ Each time you convey a covered work, the recipient automatically receives
373
+ a license from the original licensors, to run, modify and propagate that
374
+ work, subject to this License. You are not responsible for enforcing
375
+ compliance by third parties with this License.
376
+
377
+ An “entity transaction” is a transaction transferring control of an
378
+ organization, or substantially all assets of one, or subdividing an
379
+ organization, or merging organizations. If propagation of a covered work
380
+ results from an entity transaction, each party to that transaction who
381
+ receives a copy of the work also receives whatever licenses to the work
382
+ the party's predecessor in interest had or could give under the previous
383
+ paragraph, plus a right to possession of the Corresponding Source of the
384
+ work from the predecessor in interest, if the predecessor has it or can
385
+ get it with reasonable efforts.
386
+
387
+ You may not impose any further restrictions on the exercise of the rights
388
+ granted or affirmed under this License. For example, you may not impose a
389
+ license fee, royalty, or other charge for exercise of rights granted
390
+ under this License, and you may not initiate litigation (including a
391
+ cross-claim or counterclaim in a lawsuit) alleging that any patent claim
392
+ is infringed by making, using, selling, offering for sale, or importing
393
+ the Program or any portion of it.
394
+
395
+ 11. Patents.
396
+
397
+ A “contributor” is a copyright holder who authorizes use under this
398
+ License of the Program or a work on which the Program is based. The work
399
+ thus licensed is called the contributor's “contributor version”.
400
+
401
+ A contributor's “essential patent claims” are all patent claims owned or
402
+ controlled by the contributor, whether already acquired or hereafter
403
+ acquired, that would be infringed by some manner, permitted by this
404
+ License, of making, using, or selling its contributor version, but do not
405
+ include claims that would be infringed only as a consequence of further
406
+ modification of the contributor version. For purposes of this definition,
407
+ “control” includes the right to grant patent sublicenses in a manner
408
+ consistent with the requirements of this License.
409
+
410
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
411
+ patent license under the contributor's essential patent claims, to make,
412
+ use, sell, offer for sale, import and otherwise run, modify and propagate
413
+ the contents of its contributor version.
414
+
415
+ In the following three paragraphs, a “patent license” is any express
416
+ agreement or commitment, however denominated, not to enforce a patent
417
+ (such as an express permission to practice a patent or covenant not to
418
+ sue for patent infringement). To “grant” such a patent license to a party
419
+ means to make such an agreement or commitment not to enforce a patent
420
+ against the party.
421
+
422
+ If you convey a covered work, knowingly relying on a patent license, and
423
+ the Corresponding Source of the work is not available for anyone to copy,
424
+ free of charge and under the terms of this License, through a publicly
425
+ available network server or other readily accessible means, then you must
426
+ either (1) cause the Corresponding Source to be so available, or (2)
427
+ arrange to deprive yourself of the benefit of the patent license for this
428
+ particular work, or (3) arrange, in a manner consistent with the
429
+ requirements of this License, to extend the patent license to downstream
430
+ recipients. “Knowingly relying” means you have actual knowledge that, but
431
+ for the patent license, your conveying the covered work in a country, or
432
+ your recipient's use of the covered work in a country, would infringe
433
+ one or more identifiable patents in that country that you have reason
434
+ to believe are valid.
435
+
436
+ If, pursuant to or in connection with a single transaction or
437
+ arrangement, you convey, or propagate by procuring conveyance of, a
438
+ covered work, and grant a patent license to some of the parties receiving
439
+ the covered work authorizing them to use, propagate, modify or convey a
440
+ specific copy of the covered work, then the patent license you grant is
441
+ automatically extended to all recipients of the covered work and works
442
+ based on it.
443
+
444
+ A patent license is “discriminatory” if it does not include within the
445
+ scope of its coverage, prohibits the exercise of, or is conditioned on
446
+ the non-exercise of one or more of the rights that are specifically
447
+ granted under this License. You may not convey a covered work if you are
448
+ a party to an arrangement with a third party that is in the business of
449
+ distributing software, under which you make payment to the third party
450
+ based on the extent of your activity of conveying the work, and under
451
+ which the third party grants, to any of the parties who would receive the
452
+ covered work from you, a discriminatory patent license (a) in connection
453
+ with copies of the covered work conveyed by you (or copies made from
454
+ those copies), or (b) primarily for and in connection with specific
455
+ products or compilations that contain the covered work, unless you
456
+ entered into that arrangement, or that patent license was granted, prior
457
+ to 28 March 2007.
458
+
459
+ Nothing in this License shall be construed as excluding or limiting any
460
+ implied license or other defenses to infringement that may otherwise be
461
+ available to you under applicable patent law.
462
+
463
+ 12. No Surrender of Others' Freedom.
464
+
465
+ If conditions are imposed on you (whether by court order, agreement or
466
+ otherwise) that contradict the conditions of this License, they do not
467
+ excuse you from the conditions of this License. If you cannot use,
468
+ propagate or convey a covered work so as to satisfy simultaneously your
469
+ obligations under this License and any other pertinent obligations, then
470
+ as a consequence you may not use, propagate or convey it at all. For
471
+ example, if you agree to terms that obligate you to collect a royalty for
472
+ further conveying from those to whom you convey the Program, the only way
473
+ you could satisfy both those terms and this License would be to refrain
474
+ entirely from conveying the Program.
475
+
476
+ 13. Offering the Program as a Service.
477
+
478
+ If you make the functionality of the Program or a modified version
479
+ available to third parties as a service, you must make the Service Source
480
+ Code available via network download to everyone at no charge, under the
481
+ terms of this License. Making the functionality of the Program or
482
+ modified version available to third parties as a service includes,
483
+ without limitation, enabling third parties to interact with the
484
+ functionality of the Program or modified version remotely through a
485
+ computer network, offering a service the value of which entirely or
486
+ primarily derives from the value of the Program or modified version, or
487
+ offering a service that accomplishes for users the primary purpose of the
488
+ Program or modified version.
489
+
490
+ “Service Source Code” means the Corresponding Source for the Program or
491
+ the modified version, and the Corresponding Source for all programs that
492
+ you use to make the Program or modified version available as a service,
493
+ including, without limitation, management software, user interfaces,
494
+ application program interfaces, automation software, monitoring software,
495
+ backup software, storage software and hosting software, all such that a
496
+ user could run an instance of the service using the Service Source Code
497
+ you make available.
498
+
499
+ 14. Revised Versions of this License.
500
+
501
+ RxDB may publish revised and/or new versions of the Server Side
502
+ Public License from time to time. Such new versions will be similar in
503
+ spirit to the present version, but may differ in detail to address new
504
+ problems or concerns.
505
+
506
+ Each version is given a distinguishing version number. If the Program
507
+ specifies that a certain numbered version of the Server Side Public
508
+ License “or any later version” applies to it, you have the option of
509
+ following the terms and conditions either of that numbered version or of
510
+ any later version published by RxDB, Inc. If the Program does not
511
+ specify a version number of the Server Side Public License, you may
512
+ choose any version ever published by RxDB, Inc.
513
+
514
+ If the Program specifies that a proxy can decide which future versions of
515
+ the Server Side Public License can be used, that proxy's public statement
516
+ of acceptance of a version permanently authorizes you to choose that
517
+ version for the Program.
518
+
519
+ Later license versions may give you additional or different permissions.
520
+ However, no additional obligations are imposed on any author or copyright
521
+ holder as a result of your choosing to follow a later version.
522
+
523
+ 15. Disclaimer of Warranty.
524
+
525
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
526
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
527
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
528
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
529
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
530
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
531
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
532
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
533
+
534
+ 16. Limitation of Liability.
535
+
536
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
537
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
538
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
539
+ ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
540
+ THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
541
+ LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
542
+ OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
543
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
544
+ POSSIBILITY OF SUCH DAMAGES.
545
+
546
+ 17. Interpretation of Sections 15 and 16.
547
+
548
+ If the disclaimer of warranty and limitation of liability provided above
549
+ cannot be given local legal effect according to their terms, reviewing
550
+ courts shall apply local law that most closely approximates an absolute
551
+ waiver of all civil liability in connection with the Program, unless a
552
+ warranty or assumption of liability accompanies a copy of the Program in
553
+ return for a fee.
554
+
555
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # RxServer
2
+
3
+ This is the repository for the [RxDB Server plugins](https://rxdb.info/rx-server.html).
4
+
5
+ The code of the server plugins is in a different repository because:
6
+ - It has too many dependencies that you do not want to install if you only use RxDB at the client side.
7
+ - It has a different license [(SSPL)](https://en.wikipedia.org/wiki/Server_Side_Public_License) to prevent large cloud vendors from "stealing" the revenue. [Similar to MongoDB](https://www.mongodb.com/legal/licensing/server-side-public-license/faq)
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.wrongImport = wrongImport;
7
+ function wrongImport() {
8
+ throw new Error('You should never import this file, only the server plugins');
9
+ }
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["wrongImport","Error"],"sources":["../../src/index.ts"],"sourcesContent":["export function wrongImport() {\n throw new Error('You should never import this file, only the server plugins');\n}\n"],"mappings":";;;;;;AAAO,SAASA,WAAWA,CAAA,EAAG;EAC1B,MAAM,IAAIC,KAAK,CAAC,4DAA4D,CAAC;AACjF"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ var _exportNames = {
8
+ RxRestClient: true,
9
+ createRestClient: true
10
+ };
11
+ exports.RxRestClient = void 0;
12
+ exports.createRestClient = createRestClient;
13
+ var _utils = require("./utils.js");
14
+ Object.keys(_utils).forEach(function (key) {
15
+ if (key === "default" || key === "__esModule") return;
16
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
17
+ if (key in exports && exports[key] === _utils[key]) return;
18
+ Object.defineProperty(exports, key, {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _utils[key];
22
+ }
23
+ });
24
+ });
25
+ var _rxjs = require("rxjs");
26
+ var _eventsource = _interopRequireDefault(require("eventsource"));
27
+ var RxRestClient = exports.RxRestClient = /*#__PURE__*/function () {
28
+ function RxRestClient(endpointUrl, headers = {}, eventSource = _eventsource.default) {
29
+ this.endpointUrl = endpointUrl;
30
+ this.headers = headers;
31
+ this.eventSource = eventSource;
32
+ }
33
+ var _proto = RxRestClient.prototype;
34
+ _proto.setHeaders = function setHeaders(headers) {
35
+ this.headers = headers;
36
+ };
37
+ _proto.handleError = function handleError(response) {
38
+ if (response.error) {
39
+ throw new Error('Server returned an error ' + JSON.stringify(response));
40
+ }
41
+ };
42
+ _proto.query = async function query(_query) {
43
+ var response = await (0, _utils.postRequest)(this.endpointUrl + '/query', _query, this.headers);
44
+ this.handleError(response);
45
+ return response;
46
+ };
47
+ _proto.observeQuery = function observeQuery(query) {
48
+ var result = new _rxjs.Subject();
49
+ var queryAsBase64 = btoa(JSON.stringify(query));
50
+ var eventSource = new this.eventSource(this.endpointUrl + '/query/observe?query=' + queryAsBase64, {
51
+ withCredentials: true,
52
+ /**
53
+ * Sending headers is not supported by the Browser EventSource API,
54
+ * only by the npm module we use. In react-native you might have
55
+ * to set another EventSource implementation.
56
+ * @link https://www.npmjs.com/package/eventsource
57
+ */
58
+ headers: this.headers
59
+ });
60
+ eventSource.onmessage = event => {
61
+ var eventData = JSON.parse(event.data);
62
+ result.next(eventData);
63
+ };
64
+ return result.asObservable();
65
+ };
66
+ _proto.get = function get(ids) {
67
+ var response = (0, _utils.postRequest)(this.endpointUrl + '/get', ids, this.headers);
68
+ this.handleError(response);
69
+ return response;
70
+ };
71
+ _proto.set = function set(docs) {
72
+ var response = (0, _utils.postRequest)(this.endpointUrl + '/set', docs, this.headers);
73
+ this.handleError(response);
74
+ return response;
75
+ };
76
+ _proto.delete = function _delete(ids) {
77
+ var response = (0, _utils.postRequest)(this.endpointUrl + '/delete', ids, this.headers);
78
+ this.handleError(response);
79
+ return response;
80
+ };
81
+ return RxRestClient;
82
+ }();
83
+ function createRestClient(endpointUrl, headers, eventSource = _eventsource.default) {
84
+ return new RxRestClient(endpointUrl, headers, eventSource);
85
+ }
86
+ //# sourceMappingURL=index.js.map