prostgles-server 4.2.179 → 4.2.180

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 (212) hide show
  1. package/.vscode/settings.json +10 -1
  2. package/dist/DboBuilder/TableHandler/DataValidator.d.ts +1 -1
  3. package/dist/DboBuilder/TableHandler/DataValidator.d.ts.map +1 -1
  4. package/dist/DboBuilder/TableHandler/DataValidator.js +4 -4
  5. package/dist/DboBuilder/TableHandler/DataValidator.js.map +1 -1
  6. package/dist/DboBuilder/TableHandler/TableHandler.d.ts +1 -1
  7. package/dist/DboBuilder/TableHandler/TableHandler.d.ts.map +1 -1
  8. package/dist/DboBuilder/TableHandler/insert.js +3 -3
  9. package/dist/DboBuilder/TableHandler/insert.js.map +1 -1
  10. package/dist/DboBuilder/TableHandler/update.d.ts.map +1 -1
  11. package/dist/DboBuilder/TableHandler/update.js +45 -19
  12. package/dist/DboBuilder/TableHandler/update.js.map +1 -1
  13. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +1 -1
  14. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts.map +1 -1
  15. package/dist/DboBuilder/ViewHandler/ViewHandler.js +2 -2
  16. package/dist/DboBuilder/ViewHandler/ViewHandler.js.map +1 -1
  17. package/dist/DboBuilder/parseUpdateRules.js +1 -1
  18. package/dist/DboBuilder/parseUpdateRules.js.map +1 -1
  19. package/dist/Prostgles.d.ts +2 -2
  20. package/dist/Prostgles.d.ts.map +1 -1
  21. package/dist/Prostgles.js +118 -54
  22. package/dist/Prostgles.js.map +1 -1
  23. package/dist/ProstglesTypes.d.ts +77 -23
  24. package/dist/ProstglesTypes.d.ts.map +1 -1
  25. package/dist/ProstglesTypes.js.map +1 -1
  26. package/dist/SyncReplication.js +2 -2
  27. package/dist/SyncReplication.js.map +1 -1
  28. package/dist/initProstgles.d.ts +9 -2
  29. package/dist/initProstgles.d.ts.map +1 -1
  30. package/dist/initProstgles.js +65 -57
  31. package/dist/initProstgles.js.map +1 -1
  32. package/dist/utils.d.ts.map +1 -1
  33. package/dist/utils.js.map +1 -1
  34. package/documentation/CLIENT.md +542 -0
  35. package/documentation/SERVER.md +104 -0
  36. package/documentation/utils/clientTypes.ts +8436 -0
  37. package/documentation/utils/dist/clientTypes.d.ts +7705 -0
  38. package/documentation/utils/dist/clientTypes.d.ts.map +1 -0
  39. package/documentation/utils/dist/clientTypes.js +8438 -0
  40. package/documentation/utils/dist/definitions.d.ts +7705 -0
  41. package/documentation/utils/dist/definitions.d.ts.map +1 -0
  42. package/documentation/utils/dist/definitions.js +8438 -0
  43. package/documentation/utils/dist/generateClientDocs.d.ts +3 -0
  44. package/documentation/utils/dist/generateClientDocs.d.ts.map +1 -0
  45. package/documentation/utils/dist/generateClientDocs.js +115 -0
  46. package/documentation/utils/dist/generateDocs.d.ts +2 -0
  47. package/documentation/utils/dist/generateDocs.d.ts.map +1 -0
  48. package/documentation/utils/dist/generateDocs.js +6 -0
  49. package/documentation/utils/dist/generateMarkdown.d.ts +2 -0
  50. package/documentation/utils/dist/generateMarkdown.d.ts.map +1 -0
  51. package/documentation/utils/dist/generateMarkdown.js +68 -0
  52. package/documentation/utils/dist/generateServerDocs.d.ts +2 -0
  53. package/documentation/utils/dist/generateServerDocs.d.ts.map +1 -0
  54. package/documentation/utils/dist/generateServerDocs.js +80 -0
  55. package/documentation/utils/dist/getResolvedTypes.d.ts +15 -0
  56. package/documentation/utils/dist/getResolvedTypes.d.ts.map +1 -0
  57. package/documentation/utils/dist/getResolvedTypes.js +29 -0
  58. package/documentation/utils/dist/getSerializableType.d.ts +69 -0
  59. package/documentation/utils/dist/getSerializableType.d.ts.map +1 -0
  60. package/documentation/utils/dist/getSerializableType.js +273 -0
  61. package/documentation/utils/dist/getSymbolComments.d.ts +11 -0
  62. package/documentation/utils/dist/getSymbolComments.d.ts.map +1 -0
  63. package/documentation/utils/dist/getSymbolComments.js +60 -0
  64. package/documentation/utils/dist/loadTsFile.d.ts +7 -0
  65. package/documentation/utils/dist/loadTsFile.d.ts.map +1 -0
  66. package/documentation/utils/dist/loadTsFile.js +33 -0
  67. package/documentation/utils/dist/moduleResolver.d.ts +9 -0
  68. package/documentation/utils/dist/moduleResolver.d.ts.map +1 -0
  69. package/documentation/utils/dist/moduleResolver.js +27 -0
  70. package/documentation/utils/dist/serverTypes.d.ts +307 -0
  71. package/documentation/utils/dist/serverTypes.d.ts.map +1 -0
  72. package/documentation/utils/dist/serverTypes.js +347 -0
  73. package/documentation/utils/generateClientDocs.ts +142 -0
  74. package/documentation/utils/generateDocs.ts +4 -0
  75. package/documentation/utils/generateServerDocs.ts +82 -0
  76. package/documentation/utils/getResolvedTypes.ts +45 -0
  77. package/documentation/utils/getSerializableType.ts +479 -0
  78. package/documentation/utils/loadTsFile.ts +45 -0
  79. package/documentation/utils/moduleResolver.ts +31 -0
  80. package/documentation/utils/node_modules/.package-lock.json +67 -0
  81. package/documentation/utils/node_modules/@types/node/LICENSE +21 -0
  82. package/documentation/utils/node_modules/@types/node/README.md +15 -0
  83. package/documentation/utils/node_modules/@types/node/assert/strict.d.ts +8 -0
  84. package/documentation/utils/node_modules/@types/node/assert.d.ts +1040 -0
  85. package/documentation/utils/node_modules/@types/node/async_hooks.d.ts +541 -0
  86. package/documentation/utils/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  87. package/documentation/utils/node_modules/@types/node/buffer.d.ts +1934 -0
  88. package/documentation/utils/node_modules/@types/node/child_process.d.ts +1548 -0
  89. package/documentation/utils/node_modules/@types/node/cluster.d.ts +578 -0
  90. package/documentation/utils/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  91. package/documentation/utils/node_modules/@types/node/compatibility/index.d.ts +9 -0
  92. package/documentation/utils/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  93. package/documentation/utils/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  94. package/documentation/utils/node_modules/@types/node/console.d.ts +452 -0
  95. package/documentation/utils/node_modules/@types/node/constants.d.ts +19 -0
  96. package/documentation/utils/node_modules/@types/node/crypto.d.ts +4519 -0
  97. package/documentation/utils/node_modules/@types/node/dgram.d.ts +596 -0
  98. package/documentation/utils/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  99. package/documentation/utils/node_modules/@types/node/dns/promises.d.ts +477 -0
  100. package/documentation/utils/node_modules/@types/node/dns.d.ts +864 -0
  101. package/documentation/utils/node_modules/@types/node/dom-events.d.ts +124 -0
  102. package/documentation/utils/node_modules/@types/node/domain.d.ts +170 -0
  103. package/documentation/utils/node_modules/@types/node/events.d.ts +931 -0
  104. package/documentation/utils/node_modules/@types/node/fs/promises.d.ts +1245 -0
  105. package/documentation/utils/node_modules/@types/node/fs.d.ts +4317 -0
  106. package/documentation/utils/node_modules/@types/node/globals.d.ts +468 -0
  107. package/documentation/utils/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  108. package/documentation/utils/node_modules/@types/node/http.d.ts +1944 -0
  109. package/documentation/utils/node_modules/@types/node/http2.d.ts +2555 -0
  110. package/documentation/utils/node_modules/@types/node/https.d.ts +544 -0
  111. package/documentation/utils/node_modules/@types/node/index.d.ts +91 -0
  112. package/documentation/utils/node_modules/@types/node/inspector.d.ts +3696 -0
  113. package/documentation/utils/node_modules/@types/node/module.d.ts +315 -0
  114. package/documentation/utils/node_modules/@types/node/net.d.ts +1005 -0
  115. package/documentation/utils/node_modules/@types/node/os.d.ts +495 -0
  116. package/documentation/utils/node_modules/@types/node/package.json +220 -0
  117. package/documentation/utils/node_modules/@types/node/path.d.ts +200 -0
  118. package/documentation/utils/node_modules/@types/node/perf_hooks.d.ts +934 -0
  119. package/documentation/utils/node_modules/@types/node/process.d.ts +1879 -0
  120. package/documentation/utils/node_modules/@types/node/punycode.d.ts +117 -0
  121. package/documentation/utils/node_modules/@types/node/querystring.d.ts +153 -0
  122. package/documentation/utils/node_modules/@types/node/readline/promises.d.ts +162 -0
  123. package/documentation/utils/node_modules/@types/node/readline.d.ts +589 -0
  124. package/documentation/utils/node_modules/@types/node/repl.d.ts +430 -0
  125. package/documentation/utils/node_modules/@types/node/sea.d.ts +153 -0
  126. package/documentation/utils/node_modules/@types/node/stream/consumers.d.ts +12 -0
  127. package/documentation/utils/node_modules/@types/node/stream/promises.d.ts +90 -0
  128. package/documentation/utils/node_modules/@types/node/stream/web.d.ts +524 -0
  129. package/documentation/utils/node_modules/@types/node/stream.d.ts +1726 -0
  130. package/documentation/utils/node_modules/@types/node/string_decoder.d.ts +67 -0
  131. package/documentation/utils/node_modules/@types/node/test.d.ts +1938 -0
  132. package/documentation/utils/node_modules/@types/node/timers/promises.d.ts +97 -0
  133. package/documentation/utils/node_modules/@types/node/timers.d.ts +240 -0
  134. package/documentation/utils/node_modules/@types/node/tls.d.ts +1217 -0
  135. package/documentation/utils/node_modules/@types/node/trace_events.d.ts +197 -0
  136. package/documentation/utils/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  137. package/documentation/utils/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  138. package/documentation/utils/node_modules/@types/node/ts5.6/index.d.ts +91 -0
  139. package/documentation/utils/node_modules/@types/node/tty.d.ts +208 -0
  140. package/documentation/utils/node_modules/@types/node/url.d.ts +955 -0
  141. package/documentation/utils/node_modules/@types/node/util.d.ts +2306 -0
  142. package/documentation/utils/node_modules/@types/node/v8.d.ts +808 -0
  143. package/documentation/utils/node_modules/@types/node/vm.d.ts +922 -0
  144. package/documentation/utils/node_modules/@types/node/wasi.d.ts +181 -0
  145. package/documentation/utils/node_modules/@types/node/worker_threads.d.ts +694 -0
  146. package/documentation/utils/node_modules/@types/node/zlib.d.ts +539 -0
  147. package/documentation/utils/node_modules/undici-types/LICENSE +21 -0
  148. package/documentation/utils/node_modules/undici-types/README.md +6 -0
  149. package/documentation/utils/node_modules/undici-types/agent.d.ts +31 -0
  150. package/documentation/utils/node_modules/undici-types/api.d.ts +43 -0
  151. package/documentation/utils/node_modules/undici-types/balanced-pool.d.ts +29 -0
  152. package/documentation/utils/node_modules/undici-types/cache.d.ts +36 -0
  153. package/documentation/utils/node_modules/undici-types/client.d.ts +108 -0
  154. package/documentation/utils/node_modules/undici-types/connector.d.ts +34 -0
  155. package/documentation/utils/node_modules/undici-types/content-type.d.ts +21 -0
  156. package/documentation/utils/node_modules/undici-types/cookies.d.ts +28 -0
  157. package/documentation/utils/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  158. package/documentation/utils/node_modules/undici-types/dispatcher.d.ts +255 -0
  159. package/documentation/utils/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  160. package/documentation/utils/node_modules/undici-types/errors.d.ts +149 -0
  161. package/documentation/utils/node_modules/undici-types/eventsource.d.ts +63 -0
  162. package/documentation/utils/node_modules/undici-types/fetch.d.ts +209 -0
  163. package/documentation/utils/node_modules/undici-types/file.d.ts +39 -0
  164. package/documentation/utils/node_modules/undici-types/filereader.d.ts +54 -0
  165. package/documentation/utils/node_modules/undici-types/formdata.d.ts +108 -0
  166. package/documentation/utils/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  167. package/documentation/utils/node_modules/undici-types/global-origin.d.ts +7 -0
  168. package/documentation/utils/node_modules/undici-types/handlers.d.ts +15 -0
  169. package/documentation/utils/node_modules/undici-types/header.d.ts +4 -0
  170. package/documentation/utils/node_modules/undici-types/index.d.ts +71 -0
  171. package/documentation/utils/node_modules/undici-types/interceptors.d.ts +15 -0
  172. package/documentation/utils/node_modules/undici-types/mock-agent.d.ts +50 -0
  173. package/documentation/utils/node_modules/undici-types/mock-client.d.ts +25 -0
  174. package/documentation/utils/node_modules/undici-types/mock-errors.d.ts +12 -0
  175. package/documentation/utils/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  176. package/documentation/utils/node_modules/undici-types/mock-pool.d.ts +25 -0
  177. package/documentation/utils/node_modules/undici-types/package.json +55 -0
  178. package/documentation/utils/node_modules/undici-types/patch.d.ts +71 -0
  179. package/documentation/utils/node_modules/undici-types/pool-stats.d.ts +19 -0
  180. package/documentation/utils/node_modules/undici-types/pool.d.ts +39 -0
  181. package/documentation/utils/node_modules/undici-types/proxy-agent.d.ts +28 -0
  182. package/documentation/utils/node_modules/undici-types/readable.d.ts +60 -0
  183. package/documentation/utils/node_modules/undici-types/retry-agent.d.ts +8 -0
  184. package/documentation/utils/node_modules/undici-types/retry-handler.d.ts +116 -0
  185. package/documentation/utils/node_modules/undici-types/util.d.ts +18 -0
  186. package/documentation/utils/node_modules/undici-types/webidl.d.ts +222 -0
  187. package/documentation/utils/node_modules/undici-types/websocket.d.ts +152 -0
  188. package/documentation/utils/package-lock.json +75 -0
  189. package/documentation/utils/package.json +14 -0
  190. package/documentation/utils/serverTypes.ts +345 -0
  191. package/documentation/utils/tsconfig.json +28 -0
  192. package/examples/full-example-typescript/DBoGenerated.d.ts +2 -2
  193. package/examples/full-example-typescript/DBoGenerated.ts +2 -2
  194. package/examples/full-example-typescript/index.ts +39 -45
  195. package/examples/full-example-vanilla/index.js +51 -53
  196. package/examples/server/typescript/index.ts +24 -30
  197. package/lib/DboBuilder/TableHandler/DataValidator.ts +5 -5
  198. package/lib/DboBuilder/TableHandler/TableHandler.ts +1 -1
  199. package/lib/DboBuilder/TableHandler/insert.ts +3 -3
  200. package/lib/DboBuilder/TableHandler/update.ts +106 -48
  201. package/lib/DboBuilder/ViewHandler/ViewHandler.ts +2 -2
  202. package/lib/DboBuilder/parseUpdateRules.ts +1 -1
  203. package/lib/Prostgles.ts +209 -143
  204. package/lib/ProstglesTypes.ts +130 -51
  205. package/lib/SyncReplication.ts +2 -2
  206. package/lib/initProstgles.ts +145 -111
  207. package/lib/utils.ts +4 -5
  208. package/package.json +3 -2
  209. package/examples/server/typescript/index.d.ts +0 -2
  210. package/examples/server/typescript/index.d.ts.map +0 -1
  211. package/examples/server/typescript/index.js +0 -54
  212. package/examples/server/typescript/index.js.map +0 -1
@@ -0,0 +1,307 @@
1
+ export declare const definitions: [{
2
+ readonly type: "object";
3
+ readonly alias: "ProstglesInitOptions<S, SUser>";
4
+ readonly aliasSymbolescapedName: "ProstglesInitOptions";
5
+ readonly comments: "";
6
+ readonly properties: {
7
+ readonly dbConnection: {
8
+ readonly type: "union";
9
+ readonly alias: "DbConnection";
10
+ readonly aliasSymbolescapedName: "DbConnection";
11
+ readonly comments: "Database connection details";
12
+ readonly types: [{
13
+ readonly type: "primitive";
14
+ readonly alias: "string";
15
+ readonly subType: "string";
16
+ }, {
17
+ readonly type: "reference";
18
+ readonly alias: "IConnectionParameters<IClient>";
19
+ }];
20
+ readonly optional: false;
21
+ };
22
+ readonly onReady: {
23
+ readonly type: "function";
24
+ readonly alias: "OnReadyCallback<S>";
25
+ readonly aliasSymbolescapedName: "OnReadyCallback";
26
+ readonly arguments: [{
27
+ readonly name: "params";
28
+ readonly optional: false;
29
+ readonly type: "reference";
30
+ readonly alias: "OnReadyParams<S>";
31
+ readonly aliasSymbolescapedName: "OnReadyParams";
32
+ readonly comments: "";
33
+ }];
34
+ readonly returnType: {
35
+ readonly type: "primitive";
36
+ readonly alias: "any";
37
+ readonly subType: "any";
38
+ };
39
+ readonly optional: false;
40
+ readonly comments: "Called when the prostgles server is ready to accept connections.\nIt waits for auth, tableConfig and other async configurations to complete before executing";
41
+ };
42
+ readonly dbOptions: {
43
+ readonly type: "reference";
44
+ readonly alias: "IDefaults";
45
+ readonly optional: true;
46
+ };
47
+ readonly tsGeneratedTypesDir: {
48
+ readonly type: "reference";
49
+ readonly alias: "string | undefined";
50
+ readonly comments: "If defined then a `DBSchemaGenerated.d.ts` file will be created in the provided directory.\nThis file exports a `DBSchemaGenerated` type which contains types for the database tables and\ncan be used as a generic type input for the prostgles instances to ensure type safety";
51
+ readonly optional: true;
52
+ };
53
+ readonly disableRealtime: {
54
+ readonly type: "reference";
55
+ readonly alias: "boolean | undefined";
56
+ readonly comments: "If true then schema watch, subscriptions and syncs will be disabled.\nNo `prostgles` schema will be created which is needed for the realtime features.\nThis is useful when you want to connect to a database and prevent any changes to the schema";
57
+ readonly optional: true;
58
+ };
59
+ readonly io: {
60
+ readonly type: "reference";
61
+ readonly alias: "Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>";
62
+ readonly comments: "Socket.IO server instance object";
63
+ readonly optional: true;
64
+ };
65
+ readonly publish: {
66
+ readonly type: "union";
67
+ readonly alias: "Publish<S, SUser> | undefined";
68
+ readonly types: [{
69
+ readonly type: "primitive";
70
+ readonly alias: "undefined";
71
+ readonly subType: "undefined";
72
+ }, {
73
+ readonly type: "primitive";
74
+ readonly alias: "null";
75
+ readonly subType: "null";
76
+ }, {
77
+ readonly type: "reference";
78
+ readonly alias: "\"*\"";
79
+ }, {
80
+ readonly type: "primitive";
81
+ readonly alias: "PublishFullyTyped<S>";
82
+ readonly aliasSymbolescapedName: "PublishFullyTyped";
83
+ readonly subType: "any";
84
+ }, {
85
+ readonly type: "reference";
86
+ readonly alias: "(params: PublishParams<S, SUser>) => Awaitable<PublishedResult<S>>";
87
+ }, {
88
+ readonly type: "primitive";
89
+ readonly alias: "false";
90
+ readonly subType: "boolean";
91
+ }];
92
+ readonly optional: true;
93
+ readonly comments: "Data access rules applied to clients.\nBy default, nothing is allowed.";
94
+ };
95
+ readonly testRulesOnConnect: {
96
+ readonly type: "reference";
97
+ readonly alias: "boolean | undefined";
98
+ readonly comments: "If true then will test all table methods on each socket connect.\nNot recommended for production";
99
+ readonly optional: true;
100
+ };
101
+ readonly publishMethods: {
102
+ readonly type: "reference";
103
+ readonly alias: "PublishMethods<S, SUser>";
104
+ readonly aliasSymbolescapedName: "PublishMethods";
105
+ readonly comments: "Custom methods that can be called from the client";
106
+ readonly optional: true;
107
+ };
108
+ readonly publishRawSQL: {
109
+ readonly type: "reference";
110
+ readonly alias: "(params: PublishParams<S, SUser>) => boolean | \"*\" | Promise<boolean | \"*\">";
111
+ readonly comments: "If defined and resolves to true then the connected client can run SQL queries";
112
+ readonly optional: true;
113
+ };
114
+ readonly joins: {
115
+ readonly type: "union";
116
+ readonly alias: "Joins | undefined";
117
+ readonly types: [{
118
+ readonly type: "primitive";
119
+ readonly alias: "undefined";
120
+ readonly subType: "undefined";
121
+ }, {
122
+ readonly type: "reference";
123
+ readonly alias: "Join[]";
124
+ }, {
125
+ readonly type: "reference";
126
+ readonly alias: "\"inferred\"";
127
+ }];
128
+ readonly optional: true;
129
+ readonly comments: "Allows defining joins between tables:\n - `infered` - uses the foreign keys to infer the joins\n - `Join[]` - specifies the joins manually";
130
+ };
131
+ readonly schema: {
132
+ readonly type: "union";
133
+ readonly alias: "Record<string, 1> | Record<string, 0> | undefined";
134
+ readonly types: [{
135
+ readonly type: "primitive";
136
+ readonly alias: "undefined";
137
+ readonly subType: "undefined";
138
+ }, {
139
+ readonly type: "reference";
140
+ readonly alias: "Record<string, 1>";
141
+ readonly aliasSymbolescapedName: "Record";
142
+ readonly comments: "Construct a type with a set of properties K of type T";
143
+ }, {
144
+ readonly type: "reference";
145
+ readonly alias: "Record<string, 0>";
146
+ readonly aliasSymbolescapedName: "Record";
147
+ readonly comments: "Construct a type with a set of properties K of type T";
148
+ }];
149
+ readonly optional: true;
150
+ readonly comments: "If defined then the specified schemas are included/excluded from the prostgles schema.\nBy default the `public` schema is included.";
151
+ };
152
+ readonly sqlFilePath: {
153
+ readonly type: "reference";
154
+ readonly alias: "string | undefined";
155
+ readonly comments: "Path to a SQL file that will be executed on startup (but before onReady)";
156
+ readonly optional: true;
157
+ };
158
+ readonly transactions: {
159
+ readonly type: "union";
160
+ readonly alias: "string | boolean | undefined";
161
+ readonly types: [{
162
+ readonly type: "primitive";
163
+ readonly alias: "undefined";
164
+ readonly subType: "undefined";
165
+ }, {
166
+ readonly type: "primitive";
167
+ readonly alias: "string";
168
+ readonly subType: "string";
169
+ }, {
170
+ readonly type: "primitive";
171
+ readonly alias: "false";
172
+ readonly subType: "boolean";
173
+ }];
174
+ readonly optional: true;
175
+ };
176
+ readonly wsChannelNamePrefix: {
177
+ readonly type: "reference";
178
+ readonly alias: "string | undefined";
179
+ readonly optional: true;
180
+ };
181
+ readonly onSocketConnect: {
182
+ readonly type: "reference";
183
+ readonly alias: "(args: AuthRequestParams<S, SUser> & { socket: PRGLIOSocket; }) => void | Promise<void>";
184
+ readonly comments: "Called when a socket connects\nUse for connection verification. Will disconnect socket on any errors";
185
+ readonly optional: true;
186
+ };
187
+ readonly onSocketDisconnect: {
188
+ readonly type: "reference";
189
+ readonly alias: "(args: AuthRequestParams<S, SUser> & { socket: PRGLIOSocket; }) => void | Promise<void>";
190
+ readonly comments: "Called when a socket disconnects";
191
+ readonly optional: true;
192
+ };
193
+ readonly auth: {
194
+ readonly type: "reference";
195
+ readonly alias: "Auth<S, SUser>";
196
+ readonly aliasSymbolescapedName: "Auth";
197
+ readonly comments: "Auth configuration.\nSupports email and OAuth strategies";
198
+ readonly optional: true;
199
+ };
200
+ readonly DEBUG_MODE: {
201
+ readonly type: "reference";
202
+ readonly alias: "boolean | undefined";
203
+ readonly optional: true;
204
+ };
205
+ readonly onQuery: {
206
+ readonly type: "reference";
207
+ readonly alias: "(error: any, ctx: IEventContext<IClient>) => void";
208
+ readonly comments: "Callback called when a query is executed.\nUseful for logging or debugging";
209
+ readonly optional: true;
210
+ };
211
+ readonly watchSchemaType: {
212
+ readonly type: "union";
213
+ readonly alias: "\"DDL_trigger\" | \"prostgles_queries\" | undefined";
214
+ readonly types: [{
215
+ readonly type: "primitive";
216
+ readonly alias: "undefined";
217
+ readonly subType: "undefined";
218
+ }, {
219
+ readonly type: "reference";
220
+ readonly alias: "\"DDL_trigger\"";
221
+ }, {
222
+ readonly type: "reference";
223
+ readonly alias: "\"prostgles_queries\"";
224
+ }];
225
+ readonly optional: true;
226
+ };
227
+ readonly watchSchema: {
228
+ readonly type: "union";
229
+ readonly alias: "boolean | EventTriggerTagFilter | \"hotReloadMode\" | OnSchemaChangeCallback | undefined";
230
+ readonly types: [{
231
+ readonly type: "primitive";
232
+ readonly alias: "undefined";
233
+ readonly subType: "undefined";
234
+ }, {
235
+ readonly type: "reference";
236
+ readonly alias: "\"*\"";
237
+ }, {
238
+ readonly type: "reference";
239
+ readonly alias: "Partial<Record<\"ALTER AGGREGATE\" | \"ALTER COLLATION\" | \"ALTER CONVERSION\" | \"ALTER DOMAIN\" | \"ALTER DEFAULT PRIVILEGES\" | \"ALTER EXTENSION\" | \"ALTER FOREIGN DATA WRAPPER\" | \"ALTER FOREIGN TABLE\" | ... 102 more ... | \"SELECT INTO\", 1>>";
240
+ readonly aliasSymbolescapedName: "Partial";
241
+ readonly comments: "Make all properties in T optional";
242
+ }, {
243
+ readonly type: "reference";
244
+ readonly alias: "Partial<Record<\"ALTER AGGREGATE\" | \"ALTER COLLATION\" | \"ALTER CONVERSION\" | \"ALTER DOMAIN\" | \"ALTER DEFAULT PRIVILEGES\" | \"ALTER EXTENSION\" | \"ALTER FOREIGN DATA WRAPPER\" | \"ALTER FOREIGN TABLE\" | ... 102 more ... | \"SELECT INTO\", 0>>";
245
+ readonly aliasSymbolescapedName: "Partial";
246
+ readonly comments: "Make all properties in T optional";
247
+ }, {
248
+ readonly type: "reference";
249
+ readonly alias: "\"hotReloadMode\"";
250
+ }, {
251
+ readonly type: "reference";
252
+ readonly alias: "OnSchemaChangeCallback";
253
+ readonly aliasSymbolescapedName: "OnSchemaChangeCallback";
254
+ }, {
255
+ readonly type: "primitive";
256
+ readonly alias: "false";
257
+ readonly subType: "boolean";
258
+ }];
259
+ readonly optional: true;
260
+ readonly comments: "If truthy then DBSchemaGenerated.d.ts will be updated\nand \"onReady\" will be called with new schema on both client and server";
261
+ };
262
+ readonly keywords: {
263
+ readonly type: "reference";
264
+ readonly alias: "Keywords";
265
+ readonly aliasSymbolescapedName: "Keywords";
266
+ readonly optional: true;
267
+ };
268
+ readonly onNotice: {
269
+ readonly type: "reference";
270
+ readonly alias: "(notice: AnyObject, message?: string | undefined) => void";
271
+ readonly optional: true;
272
+ };
273
+ readonly fileTable: {
274
+ readonly type: "reference";
275
+ readonly alias: "FileTableConfig";
276
+ readonly aliasSymbolescapedName: "FileTableConfig";
277
+ readonly comments: "Enables file storage and serving.\nCurrently supports saving files locally or to AWS S3";
278
+ readonly optional: true;
279
+ };
280
+ readonly restApi: {
281
+ readonly type: "reference";
282
+ readonly alias: "RestApiConfig";
283
+ readonly aliasSymbolescapedName: "RestApiConfig";
284
+ readonly comments: "Rest API configuration.\nThe REST API allows interacting with the database similarly to the socket connection\nwith the exception of subscriptions and realtime features";
285
+ readonly optional: true;
286
+ };
287
+ readonly tableConfig: {
288
+ readonly type: "reference";
289
+ readonly alias: "TableConfig";
290
+ readonly aliasSymbolescapedName: "TableConfig";
291
+ readonly comments: "A simple way of defining tables through a JSON-schema like object.\nAllowes adding runtime JSONB validation and type safety.\nShould be used with caution because it tends to revert any changes\nmade to the database schema through SQL queries";
292
+ readonly optional: true;
293
+ };
294
+ readonly tableConfigMigrations: {
295
+ readonly type: "reference";
296
+ readonly alias: "{ silentFail?: boolean | undefined; version: number; versionTableName?: string | undefined; onMigrate: (args: { db: DB; oldVersion: number | undefined; getConstraints: (table: string, column?: string | undefined, types?: (\"c\" | ... 2 more ... | \"f\")[] | undefined) => Promise<...>; }) => void; }";
297
+ readonly optional: true;
298
+ };
299
+ readonly onLog: {
300
+ readonly type: "reference";
301
+ readonly alias: "(evt: EventInfo) => Promise<void>";
302
+ readonly comments: "Usefull for logging or debugging";
303
+ readonly optional: true;
304
+ };
305
+ };
306
+ }];
307
+ //# sourceMappingURL=serverTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverTypes.d.ts","sourceRoot":"","sources":["../serverTypes.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuVM,CAAC"}
@@ -0,0 +1,347 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.definitions = void 0;
4
+ exports.definitions = [
5
+ {
6
+ "type": "object",
7
+ "alias": "ProstglesInitOptions<S, SUser>",
8
+ "aliasSymbolescapedName": "ProstglesInitOptions",
9
+ "comments": "",
10
+ "properties": {
11
+ "dbConnection": {
12
+ "type": "union",
13
+ "alias": "DbConnection",
14
+ "aliasSymbolescapedName": "DbConnection",
15
+ "comments": "Database connection details",
16
+ "types": [
17
+ {
18
+ "type": "primitive",
19
+ "alias": "string",
20
+ "subType": "string"
21
+ },
22
+ {
23
+ "type": "reference",
24
+ "alias": "IConnectionParameters<IClient>"
25
+ }
26
+ ],
27
+ "optional": false
28
+ },
29
+ "onReady": {
30
+ "type": "function",
31
+ "alias": "OnReadyCallback<S>",
32
+ "aliasSymbolescapedName": "OnReadyCallback",
33
+ "arguments": [
34
+ {
35
+ "name": "params",
36
+ "optional": false,
37
+ "type": "reference",
38
+ "alias": "OnReadyParams<S>",
39
+ "aliasSymbolescapedName": "OnReadyParams",
40
+ "comments": ""
41
+ }
42
+ ],
43
+ "returnType": {
44
+ "type": "primitive",
45
+ "alias": "any",
46
+ "subType": "any"
47
+ },
48
+ "optional": false,
49
+ "comments": "Called when the prostgles server is ready to accept connections.\nIt waits for auth, tableConfig and other async configurations to complete before executing"
50
+ },
51
+ "dbOptions": {
52
+ "type": "reference",
53
+ "alias": "IDefaults",
54
+ "optional": true
55
+ },
56
+ "tsGeneratedTypesDir": {
57
+ "type": "reference",
58
+ "alias": "string | undefined",
59
+ "comments": "If defined then a `DBSchemaGenerated.d.ts` file will be created in the provided directory.\nThis file exports a `DBSchemaGenerated` type which contains types for the database tables and\ncan be used as a generic type input for the prostgles instances to ensure type safety",
60
+ "optional": true
61
+ },
62
+ "disableRealtime": {
63
+ "type": "reference",
64
+ "alias": "boolean | undefined",
65
+ "comments": "If true then schema watch, subscriptions and syncs will be disabled.\nNo `prostgles` schema will be created which is needed for the realtime features.\nThis is useful when you want to connect to a database and prevent any changes to the schema",
66
+ "optional": true
67
+ },
68
+ "io": {
69
+ "type": "reference",
70
+ "alias": "Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>",
71
+ "comments": "Socket.IO server instance object",
72
+ "optional": true
73
+ },
74
+ "publish": {
75
+ "type": "union",
76
+ "alias": "Publish<S, SUser> | undefined",
77
+ "types": [
78
+ {
79
+ "type": "primitive",
80
+ "alias": "undefined",
81
+ "subType": "undefined"
82
+ },
83
+ {
84
+ "type": "primitive",
85
+ "alias": "null",
86
+ "subType": "null"
87
+ },
88
+ {
89
+ "type": "reference",
90
+ "alias": "\"*\""
91
+ },
92
+ {
93
+ "type": "primitive",
94
+ "alias": "PublishFullyTyped<S>",
95
+ "aliasSymbolescapedName": "PublishFullyTyped",
96
+ "subType": "any"
97
+ },
98
+ {
99
+ "type": "reference",
100
+ "alias": "(params: PublishParams<S, SUser>) => Awaitable<PublishedResult<S>>"
101
+ },
102
+ {
103
+ "type": "primitive",
104
+ "alias": "false",
105
+ "subType": "boolean"
106
+ }
107
+ ],
108
+ "optional": true,
109
+ "comments": "Data access rules applied to clients.\nBy default, nothing is allowed."
110
+ },
111
+ "testRulesOnConnect": {
112
+ "type": "reference",
113
+ "alias": "boolean | undefined",
114
+ "comments": "If true then will test all table methods on each socket connect.\nNot recommended for production",
115
+ "optional": true
116
+ },
117
+ "publishMethods": {
118
+ "type": "reference",
119
+ "alias": "PublishMethods<S, SUser>",
120
+ "aliasSymbolescapedName": "PublishMethods",
121
+ "comments": "Custom methods that can be called from the client",
122
+ "optional": true
123
+ },
124
+ "publishRawSQL": {
125
+ "type": "reference",
126
+ "alias": "(params: PublishParams<S, SUser>) => boolean | \"*\" | Promise<boolean | \"*\">",
127
+ "comments": "If defined and resolves to true then the connected client can run SQL queries",
128
+ "optional": true
129
+ },
130
+ "joins": {
131
+ "type": "union",
132
+ "alias": "Joins | undefined",
133
+ "types": [
134
+ {
135
+ "type": "primitive",
136
+ "alias": "undefined",
137
+ "subType": "undefined"
138
+ },
139
+ {
140
+ "type": "reference",
141
+ "alias": "Join[]"
142
+ },
143
+ {
144
+ "type": "reference",
145
+ "alias": "\"inferred\""
146
+ }
147
+ ],
148
+ "optional": true,
149
+ "comments": "Allows defining joins between tables:\n - `infered` - uses the foreign keys to infer the joins\n - `Join[]` - specifies the joins manually"
150
+ },
151
+ "schema": {
152
+ "type": "union",
153
+ "alias": "Record<string, 1> | Record<string, 0> | undefined",
154
+ "types": [
155
+ {
156
+ "type": "primitive",
157
+ "alias": "undefined",
158
+ "subType": "undefined"
159
+ },
160
+ {
161
+ "type": "reference",
162
+ "alias": "Record<string, 1>",
163
+ "aliasSymbolescapedName": "Record",
164
+ "comments": "Construct a type with a set of properties K of type T"
165
+ },
166
+ {
167
+ "type": "reference",
168
+ "alias": "Record<string, 0>",
169
+ "aliasSymbolescapedName": "Record",
170
+ "comments": "Construct a type with a set of properties K of type T"
171
+ }
172
+ ],
173
+ "optional": true,
174
+ "comments": "If defined then the specified schemas are included/excluded from the prostgles schema.\nBy default the `public` schema is included."
175
+ },
176
+ "sqlFilePath": {
177
+ "type": "reference",
178
+ "alias": "string | undefined",
179
+ "comments": "Path to a SQL file that will be executed on startup (but before onReady)",
180
+ "optional": true
181
+ },
182
+ "transactions": {
183
+ "type": "union",
184
+ "alias": "string | boolean | undefined",
185
+ "types": [
186
+ {
187
+ "type": "primitive",
188
+ "alias": "undefined",
189
+ "subType": "undefined"
190
+ },
191
+ {
192
+ "type": "primitive",
193
+ "alias": "string",
194
+ "subType": "string"
195
+ },
196
+ {
197
+ "type": "primitive",
198
+ "alias": "false",
199
+ "subType": "boolean"
200
+ }
201
+ ],
202
+ "optional": true
203
+ },
204
+ "wsChannelNamePrefix": {
205
+ "type": "reference",
206
+ "alias": "string | undefined",
207
+ "optional": true
208
+ },
209
+ "onSocketConnect": {
210
+ "type": "reference",
211
+ "alias": "(args: AuthRequestParams<S, SUser> & { socket: PRGLIOSocket; }) => void | Promise<void>",
212
+ "comments": "Called when a socket connects\nUse for connection verification. Will disconnect socket on any errors",
213
+ "optional": true
214
+ },
215
+ "onSocketDisconnect": {
216
+ "type": "reference",
217
+ "alias": "(args: AuthRequestParams<S, SUser> & { socket: PRGLIOSocket; }) => void | Promise<void>",
218
+ "comments": "Called when a socket disconnects",
219
+ "optional": true
220
+ },
221
+ "auth": {
222
+ "type": "reference",
223
+ "alias": "Auth<S, SUser>",
224
+ "aliasSymbolescapedName": "Auth",
225
+ "comments": "Auth configuration.\nSupports email and OAuth strategies",
226
+ "optional": true
227
+ },
228
+ "DEBUG_MODE": {
229
+ "type": "reference",
230
+ "alias": "boolean | undefined",
231
+ "optional": true
232
+ },
233
+ "onQuery": {
234
+ "type": "reference",
235
+ "alias": "(error: any, ctx: IEventContext<IClient>) => void",
236
+ "comments": "Callback called when a query is executed.\nUseful for logging or debugging",
237
+ "optional": true
238
+ },
239
+ "watchSchemaType": {
240
+ "type": "union",
241
+ "alias": "\"DDL_trigger\" | \"prostgles_queries\" | undefined",
242
+ "types": [
243
+ {
244
+ "type": "primitive",
245
+ "alias": "undefined",
246
+ "subType": "undefined"
247
+ },
248
+ {
249
+ "type": "reference",
250
+ "alias": "\"DDL_trigger\""
251
+ },
252
+ {
253
+ "type": "reference",
254
+ "alias": "\"prostgles_queries\""
255
+ }
256
+ ],
257
+ "optional": true
258
+ },
259
+ "watchSchema": {
260
+ "type": "union",
261
+ "alias": "boolean | EventTriggerTagFilter | \"hotReloadMode\" | OnSchemaChangeCallback | undefined",
262
+ "types": [
263
+ {
264
+ "type": "primitive",
265
+ "alias": "undefined",
266
+ "subType": "undefined"
267
+ },
268
+ {
269
+ "type": "reference",
270
+ "alias": "\"*\""
271
+ },
272
+ {
273
+ "type": "reference",
274
+ "alias": "Partial<Record<\"ALTER AGGREGATE\" | \"ALTER COLLATION\" | \"ALTER CONVERSION\" | \"ALTER DOMAIN\" | \"ALTER DEFAULT PRIVILEGES\" | \"ALTER EXTENSION\" | \"ALTER FOREIGN DATA WRAPPER\" | \"ALTER FOREIGN TABLE\" | ... 102 more ... | \"SELECT INTO\", 1>>",
275
+ "aliasSymbolescapedName": "Partial",
276
+ "comments": "Make all properties in T optional"
277
+ },
278
+ {
279
+ "type": "reference",
280
+ "alias": "Partial<Record<\"ALTER AGGREGATE\" | \"ALTER COLLATION\" | \"ALTER CONVERSION\" | \"ALTER DOMAIN\" | \"ALTER DEFAULT PRIVILEGES\" | \"ALTER EXTENSION\" | \"ALTER FOREIGN DATA WRAPPER\" | \"ALTER FOREIGN TABLE\" | ... 102 more ... | \"SELECT INTO\", 0>>",
281
+ "aliasSymbolescapedName": "Partial",
282
+ "comments": "Make all properties in T optional"
283
+ },
284
+ {
285
+ "type": "reference",
286
+ "alias": "\"hotReloadMode\""
287
+ },
288
+ {
289
+ "type": "reference",
290
+ "alias": "OnSchemaChangeCallback",
291
+ "aliasSymbolescapedName": "OnSchemaChangeCallback"
292
+ },
293
+ {
294
+ "type": "primitive",
295
+ "alias": "false",
296
+ "subType": "boolean"
297
+ }
298
+ ],
299
+ "optional": true,
300
+ "comments": "If truthy then DBSchemaGenerated.d.ts will be updated\nand \"onReady\" will be called with new schema on both client and server"
301
+ },
302
+ "keywords": {
303
+ "type": "reference",
304
+ "alias": "Keywords",
305
+ "aliasSymbolescapedName": "Keywords",
306
+ "optional": true
307
+ },
308
+ "onNotice": {
309
+ "type": "reference",
310
+ "alias": "(notice: AnyObject, message?: string | undefined) => void",
311
+ "optional": true
312
+ },
313
+ "fileTable": {
314
+ "type": "reference",
315
+ "alias": "FileTableConfig",
316
+ "aliasSymbolescapedName": "FileTableConfig",
317
+ "comments": "Enables file storage and serving.\nCurrently supports saving files locally or to AWS S3",
318
+ "optional": true
319
+ },
320
+ "restApi": {
321
+ "type": "reference",
322
+ "alias": "RestApiConfig",
323
+ "aliasSymbolescapedName": "RestApiConfig",
324
+ "comments": "Rest API configuration.\nThe REST API allows interacting with the database similarly to the socket connection\nwith the exception of subscriptions and realtime features",
325
+ "optional": true
326
+ },
327
+ "tableConfig": {
328
+ "type": "reference",
329
+ "alias": "TableConfig",
330
+ "aliasSymbolescapedName": "TableConfig",
331
+ "comments": "A simple way of defining tables through a JSON-schema like object.\nAllowes adding runtime JSONB validation and type safety.\nShould be used with caution because it tends to revert any changes\nmade to the database schema through SQL queries",
332
+ "optional": true
333
+ },
334
+ "tableConfigMigrations": {
335
+ "type": "reference",
336
+ "alias": "{ silentFail?: boolean | undefined; version: number; versionTableName?: string | undefined; onMigrate: (args: { db: DB; oldVersion: number | undefined; getConstraints: (table: string, column?: string | undefined, types?: (\"c\" | ... 2 more ... | \"f\")[] | undefined) => Promise<...>; }) => void; }",
337
+ "optional": true
338
+ },
339
+ "onLog": {
340
+ "type": "reference",
341
+ "alias": "(evt: EventInfo) => Promise<void>",
342
+ "comments": "Usefull for logging or debugging",
343
+ "optional": true
344
+ }
345
+ }
346
+ }
347
+ ];