@based/server 6.8.0 → 6.9.0

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/dist/auth/defaultConfig.d.ts +1 -0
  2. package/dist/auth/defaultConfig.d.ts.map +1 -0
  3. package/dist/auth/index.d.ts +1 -0
  4. package/dist/auth/index.d.ts.map +1 -0
  5. package/dist/auth/parseAuthState.d.ts +1 -0
  6. package/dist/auth/parseAuthState.d.ts.map +1 -0
  7. package/dist/auth/parseJSONAuthState.d.ts +1 -0
  8. package/dist/auth/parseJSONAuthState.d.ts.map +1 -0
  9. package/dist/authorize.d.ts +2 -1
  10. package/dist/authorize.d.ts.map +1 -0
  11. package/dist/channel/cleanup.d.ts +1 -0
  12. package/dist/channel/cleanup.d.ts.map +1 -0
  13. package/dist/channel/create.d.ts +1 -0
  14. package/dist/channel/create.d.ts.map +1 -0
  15. package/dist/channel/destroy.d.ts +1 -0
  16. package/dist/channel/destroy.d.ts.map +1 -0
  17. package/dist/channel/extend.d.ts +1 -0
  18. package/dist/channel/extend.d.ts.map +1 -0
  19. package/dist/channel/get.d.ts +1 -0
  20. package/dist/channel/get.d.ts.map +1 -0
  21. package/dist/channel/index.d.ts +1 -0
  22. package/dist/channel/index.d.ts.map +1 -0
  23. package/dist/channel/start.d.ts +1 -0
  24. package/dist/channel/start.d.ts.map +1 -0
  25. package/dist/channel/subscribe.d.ts +1 -0
  26. package/dist/channel/subscribe.d.ts.map +1 -0
  27. package/dist/channel/types.d.ts +1 -0
  28. package/dist/channel/types.d.ts.map +1 -0
  29. package/dist/channel/unsub.d.ts +1 -0
  30. package/dist/channel/unsub.d.ts.map +1 -0
  31. package/dist/compress.d.ts +1 -0
  32. package/dist/compress.d.ts.map +1 -0
  33. package/dist/createSimpleServer.d.ts +34 -0
  34. package/dist/createSimpleServer.js +197 -0
  35. package/dist/createSimpleServer.js.map +1 -0
  36. package/dist/error/errorTypeHandlers.d.ts +1 -0
  37. package/dist/error/errorTypeHandlers.d.ts.map +1 -0
  38. package/dist/error/index.d.ts +1 -0
  39. package/dist/error/index.d.ts.map +1 -0
  40. package/dist/error/types.d.ts +1 -0
  41. package/dist/error/types.d.ts.map +1 -0
  42. package/dist/functionApi/callFunction.d.ts +1 -0
  43. package/dist/functionApi/callFunction.d.ts.map +1 -0
  44. package/dist/functionApi/channelSubscribe.d.ts +1 -0
  45. package/dist/functionApi/channelSubscribe.d.ts.map +1 -0
  46. package/dist/functionApi/client/channel.d.ts +1 -0
  47. package/dist/functionApi/client/channel.d.ts.map +1 -0
  48. package/dist/functionApi/client/index.d.ts +1 -0
  49. package/dist/functionApi/client/index.d.ts.map +1 -0
  50. package/dist/functionApi/client/query.d.ts +1 -0
  51. package/dist/functionApi/client/query.d.ts.map +1 -0
  52. package/dist/functionApi/get.d.ts +1 -0
  53. package/dist/functionApi/get.d.ts.map +1 -0
  54. package/dist/functionApi/index.d.ts +1 -0
  55. package/dist/functionApi/index.d.ts.map +1 -0
  56. package/dist/functionApi/observe.d.ts +1 -0
  57. package/dist/functionApi/observe.d.ts.map +1 -0
  58. package/dist/functionApi/publish.d.ts +1 -0
  59. package/dist/functionApi/publish.d.ts.map +1 -0
  60. package/dist/functionApi/stream.d.ts +1 -0
  61. package/dist/functionApi/stream.d.ts.map +1 -0
  62. package/dist/functions/genVersion.d.ts +1 -0
  63. package/dist/functions/genVersion.d.ts.map +1 -0
  64. package/dist/functions/index.d.ts +2 -0
  65. package/dist/functions/index.d.ts.map +1 -0
  66. package/dist/functions/index.js +12 -2
  67. package/dist/functions/index.js.map +1 -1
  68. package/dist/functions/timeout.d.ts +1 -0
  69. package/dist/functions/timeout.d.ts.map +1 -0
  70. package/dist/functions/types.d.ts +1 -0
  71. package/dist/functions/types.d.ts.map +1 -0
  72. package/dist/incoming/http/function.d.ts +1 -0
  73. package/dist/incoming/http/function.d.ts.map +1 -0
  74. package/dist/incoming/http/index.d.ts +1 -0
  75. package/dist/incoming/http/index.d.ts.map +1 -0
  76. package/dist/incoming/http/index.js +10 -4
  77. package/dist/incoming/http/index.js.map +1 -1
  78. package/dist/incoming/http/parseQuery.d.ts +1 -0
  79. package/dist/incoming/http/parseQuery.d.ts.map +1 -0
  80. package/dist/incoming/http/publish.d.ts +1 -0
  81. package/dist/incoming/http/publish.d.ts.map +1 -0
  82. package/dist/incoming/http/query.d.ts +1 -0
  83. package/dist/incoming/http/query.d.ts.map +1 -0
  84. package/dist/incoming/http/readBody.d.ts +1 -0
  85. package/dist/incoming/http/readBody.d.ts.map +1 -0
  86. package/dist/incoming/http/streamFunction/getExtension.d.ts +1 -0
  87. package/dist/incoming/http/streamFunction/getExtension.d.ts.map +1 -0
  88. package/dist/incoming/http/streamFunction/index.d.ts +1 -0
  89. package/dist/incoming/http/streamFunction/index.d.ts.map +1 -0
  90. package/dist/incoming/http/streamFunction/multiPart/index.d.ts +1 -0
  91. package/dist/incoming/http/streamFunction/multiPart/index.d.ts.map +1 -0
  92. package/dist/incoming/http/streamFunction/multiPart/readFormData.d.ts +1 -0
  93. package/dist/incoming/http/streamFunction/multiPart/readFormData.d.ts.map +1 -0
  94. package/dist/incoming/http/streamFunction/stream/createStream.d.ts +1 -0
  95. package/dist/incoming/http/streamFunction/stream/createStream.d.ts.map +1 -0
  96. package/dist/incoming/http/streamFunction/stream/index.d.ts +1 -0
  97. package/dist/incoming/http/streamFunction/stream/index.d.ts.map +1 -0
  98. package/dist/incoming/index.d.ts +1 -0
  99. package/dist/incoming/index.d.ts.map +1 -0
  100. package/dist/incoming/upgrade.d.ts +1 -0
  101. package/dist/incoming/upgrade.d.ts.map +1 -0
  102. package/dist/incoming/ws/auth.d.ts +1 -0
  103. package/dist/incoming/ws/auth.d.ts.map +1 -0
  104. package/dist/incoming/ws/channelPublish.d.ts +1 -0
  105. package/dist/incoming/ws/channelPublish.d.ts.map +1 -0
  106. package/dist/incoming/ws/channelSubscribe.d.ts +1 -0
  107. package/dist/incoming/ws/channelSubscribe.d.ts.map +1 -0
  108. package/dist/incoming/ws/function.d.ts +1 -0
  109. package/dist/incoming/ws/function.d.ts.map +1 -0
  110. package/dist/incoming/ws/get.d.ts +1 -0
  111. package/dist/incoming/ws/get.d.ts.map +1 -0
  112. package/dist/incoming/ws/index.d.ts +1 -0
  113. package/dist/incoming/ws/index.d.ts.map +1 -0
  114. package/dist/incoming/ws/observable.d.ts +7 -0
  115. package/dist/incoming/ws/observable.js +91 -0
  116. package/dist/incoming/ws/observable.js.map +1 -0
  117. package/dist/incoming/ws/query.d.ts +1 -0
  118. package/dist/incoming/ws/query.d.ts.map +1 -0
  119. package/dist/incoming/ws/types.d.ts +1 -0
  120. package/dist/incoming/ws/types.d.ts.map +1 -0
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/installFn.d.ts +2 -1
  124. package/dist/installFn.d.ts.map +1 -0
  125. package/dist/ip.d.ts +2 -0
  126. package/dist/ip.js +8 -0
  127. package/dist/ip.js.map +1 -0
  128. package/dist/observable/cleanup.d.ts +2 -0
  129. package/dist/observable/cleanup.js +66 -0
  130. package/dist/observable/cleanup.js.map +1 -0
  131. package/dist/observable/create.d.ts +3 -0
  132. package/dist/observable/create.js +35 -0
  133. package/dist/observable/create.js.map +1 -0
  134. package/dist/observable/destroy.d.ts +4 -0
  135. package/dist/observable/destroy.js +47 -0
  136. package/dist/observable/destroy.js.map +1 -0
  137. package/dist/observable/extendCache.d.ts +2 -0
  138. package/dist/observable/extendCache.js +10 -0
  139. package/dist/observable/extendCache.js.map +1 -0
  140. package/dist/observable/genObservableId.d.ts +1 -0
  141. package/dist/observable/genObservableId.js +12 -0
  142. package/dist/observable/genObservableId.js.map +1 -0
  143. package/dist/observable/get.d.ts +4 -0
  144. package/dist/observable/get.js +15 -0
  145. package/dist/observable/get.js.map +1 -0
  146. package/dist/observable/index.d.ts +10 -0
  147. package/dist/observable/index.js +27 -0
  148. package/dist/observable/index.js.map +1 -0
  149. package/dist/observable/send.d.ts +5 -0
  150. package/dist/observable/send.js +26 -0
  151. package/dist/observable/send.js.map +1 -0
  152. package/dist/observable/start/error.d.ts +3 -0
  153. package/dist/observable/start/error.js +43 -0
  154. package/dist/observable/start/error.js.map +1 -0
  155. package/dist/observable/start/index.d.ts +2 -0
  156. package/dist/observable/start/index.js +56 -0
  157. package/dist/observable/start/index.js.map +1 -0
  158. package/dist/observable/start/update.d.ts +3 -0
  159. package/dist/observable/start/update.js +116 -0
  160. package/dist/observable/start/update.js.map +1 -0
  161. package/dist/observable/subscribe.d.ts +7 -0
  162. package/dist/observable/subscribe.js +47 -0
  163. package/dist/observable/subscribe.js.map +1 -0
  164. package/dist/observable/types.d.ts +25 -0
  165. package/dist/observable/types.js +3 -0
  166. package/dist/observable/types.js.map +1 -0
  167. package/dist/observable/unsub.d.ts +6 -0
  168. package/dist/observable/unsub.js +46 -0
  169. package/dist/observable/unsub.js.map +1 -0
  170. package/dist/protocol.d.ts +1 -0
  171. package/dist/protocol.d.ts.map +1 -0
  172. package/dist/query/cleanup.d.ts +1 -0
  173. package/dist/query/cleanup.d.ts.map +1 -0
  174. package/dist/query/create.d.ts +1 -0
  175. package/dist/query/create.d.ts.map +1 -0
  176. package/dist/query/destroy.d.ts +1 -0
  177. package/dist/query/destroy.d.ts.map +1 -0
  178. package/dist/query/extendCache.d.ts +1 -0
  179. package/dist/query/extendCache.d.ts.map +1 -0
  180. package/dist/query/genObservableId.d.ts +1 -0
  181. package/dist/query/genObservableId.d.ts.map +1 -0
  182. package/dist/query/get.d.ts +1 -0
  183. package/dist/query/get.d.ts.map +1 -0
  184. package/dist/query/index.d.ts +1 -0
  185. package/dist/query/index.d.ts.map +1 -0
  186. package/dist/query/send.d.ts +1 -0
  187. package/dist/query/send.d.ts.map +1 -0
  188. package/dist/query/start/error.d.ts +1 -0
  189. package/dist/query/start/error.d.ts.map +1 -0
  190. package/dist/query/start/index.d.ts +1 -0
  191. package/dist/query/start/index.d.ts.map +1 -0
  192. package/dist/query/start/relay.d.ts +1 -0
  193. package/dist/query/start/relay.d.ts.map +1 -0
  194. package/dist/query/start/update.d.ts +1 -0
  195. package/dist/query/start/update.d.ts.map +1 -0
  196. package/dist/query/subscribe.d.ts +1 -0
  197. package/dist/query/subscribe.d.ts.map +1 -0
  198. package/dist/query/types.d.ts +1 -0
  199. package/dist/query/types.d.ts.map +1 -0
  200. package/dist/query/unsub.d.ts +1 -0
  201. package/dist/query/unsub.d.ts.map +1 -0
  202. package/dist/security.d.ts +1 -0
  203. package/dist/security.d.ts.map +1 -0
  204. package/dist/sendError.d.ts +1 -0
  205. package/dist/sendError.d.ts.map +1 -0
  206. package/dist/sendHttpResponse.d.ts +1 -0
  207. package/dist/sendHttpResponse.d.ts.map +1 -0
  208. package/dist/server.d.ts +1 -0
  209. package/dist/server.d.ts.map +1 -0
  210. package/dist/verifyRoute.d.ts +2 -1
  211. package/dist/verifyRoute.d.ts.map +1 -0
  212. package/package.json +3 -3
@@ -1,3 +1,4 @@
1
1
  import { Authorize, VerifyAuthState } from '@based/functions';
2
2
  export declare const defaultAuthorize: Authorize;
3
3
  export declare const defaultVerifyAuthState: VerifyAuthState;
4
+ //# sourceMappingURL=defaultConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../src/auth/defaultConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAG7D,eAAO,MAAM,gBAAgB,EAAE,SAE9B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,eASpC,CAAA"}
@@ -31,3 +31,4 @@ export declare class BasedAuth {
31
31
  /** Sets the `authState` on the client. */
32
32
  sendAuthState(ctx: Context<WebSocketSession>, authState: AuthState): void;
33
33
  }
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAGhB,SAAS,EACT,mBAAmB,EACnB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B,MAAM,MAAM,UAAU,GAAG;IACvB;sFACkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC,CAAA;AAED,qBAAa,SAAS;IACpB,MAAM,EAAE,WAAW,CAAA;IACnB,mBAAmB,EAAE,mBAAmB,CAAA;IAExC,eAAe,EAAE,eAAe,CAAyB;IACzD,SAAS,EAAE,SAAS,CAAmB;gBAE3B,MAAM,EAAE,WAAW,EAAE,MAAM,GAAE,UAAe;IAKxD,YAAY,CAAC,MAAM,EAAE,UAAU;IAe/B;;OAEG;IACG,cAAc,CAClB,GAAG,EAAE,OAAO,EACZ,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,SAAS,CAAC;IAmCrB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAI7C,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS;IAI1C,0CAA0C;IAC1C,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,SAAS;CAOnE"}
@@ -1,3 +1,4 @@
1
1
  import { AuthState } from '@based/functions';
2
2
  declare const _default: (authState: any) => AuthState;
3
3
  export default _default;
4
+ //# sourceMappingURL=parseAuthState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAuthState.d.ts","sourceRoot":"","sources":["../../src/auth/parseAuthState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;oCA2BjB,GAAG,KAAG,SAAS;AAA1C,wBAcC"}
@@ -1,3 +1,4 @@
1
1
  import { AuthState } from '@based/functions';
2
2
  declare const _default: (authorization: string) => AuthState;
3
3
  export default _default;
4
+ //# sourceMappingURL=parseJSONAuthState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseJSONAuthState.d.ts","sourceRoot":"","sources":["../../src/auth/parseJSONAuthState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;wCAEb,MAAM,KAAG,SAAS;AAAjD,wBAsBC"}
@@ -4,5 +4,6 @@ type ClientSession = HttpSession | WebSocketSession;
4
4
  export type IsAuthorizedHandler<S extends ClientSession = ClientSession, R extends BasedRoute = BasedRoute, P = any> = (route: R, spec: BasedFunctionConfig<R['type']>, server: BasedServer, ctx: Context<S>, payload: P, id?: number, checksum?: number) => void;
5
5
  export type AuthErrorHandler<S extends ClientSession = ClientSession, R extends BasedRoute = BasedRoute, P = any> = (route: R, server: BasedServer, ctx: Context<S>, payload: P, id?: number, checksum?: number, err?: Error) => true | void;
6
6
  export declare const defaultAuthError: AuthErrorHandler;
7
- export declare const authorize: <S extends ClientSession = ClientSession, R extends BasedRoute<import("@based/functions").BasedFunctionTypes, "type" | "name"> = BasedRoute<import("@based/functions").BasedFunctionTypes, "type" | "name">, P = any>(route: R, server: BasedServer, ctx: Context<S>, payload: P, isAuthorized: IsAuthorizedHandler<S, R, P>, id?: number, checksum?: number, isPublic?: boolean, authError?: AuthErrorHandler<S, R, P>) => void;
7
+ export declare const authorize: <S extends ClientSession = ClientSession, R extends BasedRoute<import("@based/functions").BasedFunctionTypes, "name" | "type"> = BasedRoute<import("@based/functions").BasedFunctionTypes, "name" | "type">, P = any>(route: R, server: BasedServer, ctx: Context<S>, payload: P, isAuthorized: IsAuthorizedHandler<S, R, P>, id?: number, checksum?: number, isPublic?: boolean, authError?: AuthErrorHandler<S, R, P>) => void;
8
8
  export {};
9
+ //# sourceMappingURL=authorize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../src/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGtC,OAAO,EACL,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EAEpB,MAAM,kBAAkB,CAAA;AAGzB,KAAK,aAAa,GAAG,WAAW,GAAG,gBAAgB,CAAA;AAEnD,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,aAAa,GAAG,aAAa,EACvC,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,GAAG,GAAG,IACL,CACF,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EACpC,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EACf,OAAO,EAAE,CAAC,EACV,EAAE,CAAC,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,KACd,IAAI,CAAA;AAET,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,aAAa,GAAG,aAAa,EACvC,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,GAAG,GAAG,IACL,CACF,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EACf,OAAO,EAAE,CAAC,EACV,EAAE,CAAC,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,KAAK,KACR,IAAI,GAAG,IAAI,CAAA;AAEhB,eAAO,MAAM,gBAAgB,EAAE,gBA4C9B,CAAA;AAED,eAAO,MAAM,SAAS,0OAMZ,WAAW,gFAId,MAAM,aACA,MAAM,aACP,OAAO,gDAyClB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import { BasedServer } from '../server';
2
2
  export declare const cleanUpChannels: (server: BasedServer) => void;
3
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/channel/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAuBvC,eAAO,MAAM,eAAe,WAAY,WAAW,SA6BlD,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { ActiveChannel } from './types';
3
3
  export declare const createChannel: (server: BasedServer, name: string, id: number, payload: any, noStart?: boolean) => ActiveChannel;
4
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/channel/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAIvC,eAAO,MAAM,aAAa,WAChB,WAAW,QACb,MAAM,MACR,MAAM,WACD,GAAG,YACF,OAAO,KAChB,aA6BF,CAAA"}
@@ -2,3 +2,4 @@ import { BasedServer } from '../server';
2
2
  import { ActiveChannel } from './types';
3
3
  export declare const updateDestroyTimer: (server: BasedServer, channel: ActiveChannel) => void;
4
4
  export declare const destroyChannel: (server: BasedServer, id: number) => void;
5
+ //# sourceMappingURL=destroy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../src/channel/destroy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,eAAO,MAAM,kBAAkB,WACrB,WAAW,WACV,aAAa,SAsBvB,CAAA;AAGD,eAAO,MAAM,cAAc,WAAY,WAAW,MAAM,MAAM,SA4B7D,CAAA"}
@@ -2,3 +2,4 @@ import { ActiveChannel } from './types';
2
2
  import { BasedServer } from '../server';
3
3
  export declare const stopRemoveChannel: (channel: ActiveChannel) => void;
4
4
  export declare const extendChannel: (server: BasedServer, channel: ActiveChannel) => void;
5
+ //# sourceMappingURL=extend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/channel/extend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,eAAO,MAAM,iBAAiB,YAAa,aAAa,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,WAAY,WAAW,WAAW,aAAa,SAIxE,CAAA"}
@@ -2,3 +2,4 @@ import { ActiveChannel } from './types';
2
2
  import { BasedServer } from '../server';
3
3
  export declare const getChannelAndStopRemove: (server: BasedServer, id: number) => ActiveChannel;
4
4
  export declare const hasChannel: (server: BasedServer, id: number) => Boolean;
5
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/channel/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAGvC,eAAO,MAAM,uBAAuB,WAC1B,WAAW,MACf,MAAM,KACT,aAIF,CAAA;AAED,eAAO,MAAM,UAAU,WAAY,WAAW,MAAM,MAAM,KAAG,OAE5D,CAAA"}
@@ -6,3 +6,4 @@ export * from './subscribe';
6
6
  export * from './unsub';
7
7
  export * from './destroy';
8
8
  export * from './extend';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import { BasedServer } from '../server';
2
2
  export declare const startChannel: (server: BasedServer, id: number, fromInstall?: boolean) => void;
3
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/channel/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAwEvC,eAAO,MAAM,YAAY,WACf,WAAW,MACf,MAAM,gBACI,OAAO,SAiGtB,CAAA"}
@@ -2,3 +2,4 @@ import { BasedServer } from '../server';
2
2
  import { WebSocketSession, Context, ChannelMessageFunctionInternal } from '@based/functions';
3
3
  export declare const subscribeChannel: (server: BasedServer, id: number, ctx: Context<WebSocketSession>) => void;
4
4
  export declare const subscribeChannelFunction: (server: BasedServer, id: number, update: ChannelMessageFunctionInternal) => void;
5
+ //# sourceMappingURL=subscribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/channel/subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,8BAA8B,EAC/B,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,gBAAgB,WACnB,WAAW,MACf,MAAM,OACL,QAAQ,gBAAgB,CAAC,SAmB/B,CAAA;AAED,eAAO,MAAM,wBAAwB,WAC3B,WAAW,MACf,MAAM,UACF,8BAA8B,SAYvC,CAAA"}
@@ -12,3 +12,4 @@ export type ActiveChannel = {
12
12
  isDestroyed: boolean;
13
13
  closeFunction?: () => void;
14
14
  };
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/channel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAEjE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,GAAG,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,EAAE,GAAG,CAAC,8BAA8B,CAAC,CAAA;IAC3D,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;CAC3B,CAAA"}
@@ -3,3 +3,4 @@ import { WebSocketSession, Context, ChannelMessageFunction } from '@based/functi
3
3
  export declare const unsubscribeFunction: (server: BasedServer, id: number, update: ChannelMessageFunction) => true | void;
4
4
  export declare const unsubscribeChannel: (server: BasedServer, id: number, ctx: Context<WebSocketSession>) => true | void;
5
5
  export declare const unsubscribeChannelIgnoreClient: (server: BasedServer, id: number, ctx: Context<WebSocketSession>) => void;
6
+ //# sourceMappingURL=unsub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsub.d.ts","sourceRoot":"","sources":["../../src/channel/unsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,sBAAsB,EACvB,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,mBAAmB,WACtB,WAAW,MACf,MAAM,UACF,sBAAsB,KAC7B,IAAI,GAAG,IAYT,CAAA;AAED,eAAO,MAAM,kBAAkB,WACrB,WAAW,MACf,MAAM,OACL,QAAQ,gBAAgB,CAAC,KAC7B,IAAI,GAAG,IAqBT,CAAA;AAED,eAAO,MAAM,8BAA8B,WACjC,WAAW,MACf,MAAM,OACL,QAAQ,gBAAgB,CAAC,SAgB/B,CAAA"}
@@ -3,3 +3,4 @@ export declare const compress: (payload: string | Buffer, encoding?: string) =>
3
3
  payload: Buffer | string;
4
4
  encoding?: string;
5
5
  }>;
6
+ //# sourceMappingURL=compress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../src/compress.ts"],"names":[],"mappings":";AAiBA,eAAO,MAAM,QAAQ,YACV,MAAM,GAAG,MAAM,aACb,MAAM;aACG,MAAM,GAAG,MAAM;eAAa,MAAM;EAkCvD,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { BasedFunctionSpec, BasedQueryFunctionSpec, BasedStreamFunctionSpec, BasedSpec, BasedChannelFunctionSpec } from './functions';
2
+ import { BasedQueryFunction, BasedFunction, BasedChannelFunction, BasedStreamFunction } from '@based/functions';
3
+ import { BasedServer, ServerOptions } from './server';
4
+ export type SimpleServerOptions = {
5
+ install?: (opts: {
6
+ server: BasedServer;
7
+ name: string;
8
+ function?: BasedSpec;
9
+ }) => Promise<null | BasedSpec>;
10
+ uninstall?: (opts: {
11
+ server: BasedServer;
12
+ name: string;
13
+ function: BasedSpec;
14
+ }) => Promise<boolean>;
15
+ functions?: {
16
+ [key: string]: BasedFunction | Partial<BasedFunctionSpec>;
17
+ };
18
+ streams?: {
19
+ [key: string]: BasedStreamFunction | Partial<BasedStreamFunctionSpec>;
20
+ };
21
+ queryFunctions?: {
22
+ [key: string]: BasedQueryFunction | Partial<BasedQueryFunctionSpec>;
23
+ };
24
+ channels?: {
25
+ [key: string]: BasedChannelFunction | Partial<BasedChannelFunctionSpec>;
26
+ };
27
+ silent?: boolean;
28
+ closeAfterIdleTime?: {
29
+ channel: number;
30
+ query: number;
31
+ };
32
+ uninstallAfterIdleTime?: number;
33
+ } & Omit<ServerOptions, 'functions'>;
34
+ export declare function createSimpleServer(props: SimpleServerOptions, sharedSocket?: boolean): Promise<BasedServer>;
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createSimpleServer = void 0;
7
+ const functions_1 = require("./functions");
8
+ const picocolors_1 = __importDefault(require("picocolors"));
9
+ const server_1 = require("./server");
10
+ const utils_1 = require("@saulx/utils");
11
+ async function createSimpleServer(props, sharedSocket) {
12
+ const { functions, queryFunctions, streams, channels } = props;
13
+ const functionStore = {};
14
+ for (const name in functions) {
15
+ if (functions[name]) {
16
+ const fn = functions[name];
17
+ if ((0, functions_1.isSpec)(fn)) {
18
+ functionStore[name] = {
19
+ function: fn.function,
20
+ name,
21
+ checksum: 1,
22
+ maxPayloadSize: 5e4,
23
+ rateLimitTokens: 1,
24
+ ...fn,
25
+ };
26
+ }
27
+ else if (typeof fn === 'function') {
28
+ functionStore[name] = {
29
+ function: fn,
30
+ name,
31
+ checksum: 1,
32
+ maxPayloadSize: 5e4,
33
+ rateLimitTokens: 1,
34
+ };
35
+ }
36
+ else {
37
+ console.error(name, fn, 'Is not a function!');
38
+ }
39
+ }
40
+ }
41
+ for (const name in queryFunctions) {
42
+ if (queryFunctions[name]) {
43
+ const fn = queryFunctions[name];
44
+ if ((0, functions_1.isSpec)(fn)) {
45
+ functionStore[name] = {
46
+ checksum: 1,
47
+ query: true,
48
+ function: fn.function,
49
+ name,
50
+ maxPayloadSize: 5000,
51
+ rateLimitTokens: 1,
52
+ ...fn,
53
+ };
54
+ }
55
+ else if (typeof fn === 'function') {
56
+ functionStore[name] = {
57
+ checksum: 1,
58
+ query: true,
59
+ function: fn,
60
+ name,
61
+ maxPayloadSize: 5000,
62
+ rateLimitTokens: 1,
63
+ };
64
+ }
65
+ else {
66
+ console.error(name, fn, 'Is not a query function!');
67
+ }
68
+ }
69
+ }
70
+ for (const name in streams) {
71
+ if (streams[name]) {
72
+ const fn = streams[name];
73
+ if ((0, functions_1.isSpec)(fn)) {
74
+ functionStore[name] = {
75
+ checksum: 1,
76
+ stream: true,
77
+ function: fn.function,
78
+ name,
79
+ maxPayloadSize: 1e9,
80
+ rateLimitTokens: 10,
81
+ ...fn,
82
+ };
83
+ }
84
+ else if (typeof fn === 'function') {
85
+ functionStore[name] = {
86
+ checksum: 1,
87
+ stream: true,
88
+ function: fn,
89
+ name,
90
+ maxPayloadSize: 1e9,
91
+ rateLimitTokens: 10,
92
+ };
93
+ }
94
+ else {
95
+ console.error(name, fn, 'Is not a stream function!');
96
+ }
97
+ }
98
+ }
99
+ for (const name in channels) {
100
+ if (channels[name]) {
101
+ const fn = channels[name];
102
+ if ((0, functions_1.isSpec)(fn)) {
103
+ functionStore[name] = {
104
+ checksum: 1,
105
+ channel: true,
106
+ function: fn.function,
107
+ publish: fn.publish ||
108
+ ((based, payload, msg, id) => {
109
+ console.warn(' ↓ Publish to channel (no handler defined)', name, payload, msg, id);
110
+ }),
111
+ name,
112
+ maxPayloadSize: 500,
113
+ rateLimitTokens: 1,
114
+ ...fn,
115
+ };
116
+ }
117
+ else if (typeof fn === 'function') {
118
+ functionStore[name] = {
119
+ checksum: 1,
120
+ channel: true,
121
+ publish: (based, payload, msg, id) => {
122
+ console.warn(' ↓ Publish to channel (no handler defined)', name, payload, msg, id);
123
+ },
124
+ function: fn,
125
+ name,
126
+ maxPayloadSize: 500,
127
+ rateLimitTokens: 1,
128
+ };
129
+ }
130
+ else {
131
+ console.error(name, fn, 'Is not a channel function!');
132
+ }
133
+ }
134
+ }
135
+ const properProps = {
136
+ ...props,
137
+ functions: {
138
+ closeAfterIdleTime: props.closeAfterIdleTime,
139
+ uninstallAfterIdleTime: props.uninstallAfterIdleTime || -1,
140
+ uninstall: props.uninstall ||
141
+ (async () => {
142
+ return true;
143
+ }),
144
+ install: props.install ||
145
+ (async ({ name }) => {
146
+ if (functionStore[name]) {
147
+ return functionStore[name];
148
+ }
149
+ else {
150
+ return null;
151
+ }
152
+ }),
153
+ route: ({ path, name }) => {
154
+ // TODO fix typez
155
+ let rootFn;
156
+ if (path) {
157
+ for (const name in functionStore) {
158
+ const fnPath = functionStore[name].path;
159
+ if (fnPath === path) {
160
+ return functionStore[name];
161
+ }
162
+ if (!rootFn && fnPath === '/') {
163
+ rootFn = functionStore[name];
164
+ }
165
+ }
166
+ }
167
+ return functionStore[name] || rootFn || null;
168
+ },
169
+ },
170
+ };
171
+ if (!props.silent) {
172
+ console.info(' ', picocolors_1.default.white('Based-server'), `starting with functions`);
173
+ }
174
+ let longestName = 0;
175
+ for (const name in functionStore) {
176
+ if (name.length > longestName) {
177
+ longestName = name.length;
178
+ }
179
+ }
180
+ for (const name in functionStore) {
181
+ const obs = (0, functions_1.isChannelFunctionSpec)(functionStore[name])
182
+ ? '[channel]'
183
+ : (0, functions_1.isQueryFunctionSpec)(functionStore[name])
184
+ ? '[query]'
185
+ : (0, functions_1.isStreamFunctionSpec)(functionStore[name])
186
+ ? '[stream]'
187
+ : '';
188
+ const pub = functionStore[name].public ? 'public' : 'private';
189
+ if (!props.silent) {
190
+ console.info(' ', picocolors_1.default.white(name), (0, utils_1.padLeft)('', longestName + 2 - name.length, ' '), picocolors_1.default.gray(pub), (0, utils_1.padLeft)('', 8 - pub.length, ' '), picocolors_1.default.green(obs), (0, utils_1.padLeft)('', 14 - obs.length, ' '), functionStore[name].path || '');
191
+ }
192
+ }
193
+ const basedServer = new server_1.BasedServer(properProps);
194
+ return props.port ? basedServer.start(props.port, sharedSocket) : basedServer;
195
+ }
196
+ exports.createSimpleServer = createSimpleServer;
197
+ //# sourceMappingURL=createSimpleServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSimpleServer.js","sourceRoot":"","sources":["../src/createSimpleServer.ts"],"names":[],"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,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;AAC/E,CAAC;AA7ND,gDA6NC"}
@@ -4,3 +4,4 @@ type ErrorType = {
4
4
  };
5
5
  export declare const errorTypeHandlers: ErrorType;
6
6
  export {};
7
+ //# sourceMappingURL=errorTypeHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorTypeHandlers.d.ts","sourceRoot":"","sources":["../../src/error/errorTypeHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,YAAY,EAAE,MAAM,SAAS,CAAA;AAQpE,KAAK,SAAS,GAAG;KACd,CAAC,IAAI,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC;CACvC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,SAkI/B,CAAA"}
@@ -14,3 +14,4 @@ export declare function createErrorData<T extends BasedErrorCode>(code: T, paylo
14
14
  };
15
15
  };
16
16
  export declare function createError<T extends BasedErrorCode>(server: BasedServer, context: Context, code: T, payload: ErrorPayload[T]): BasedErrorData<T>;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EAEf,MAAM,SAAS,CAAA;AAGhB,cAAc,SAAS,CAAA;AAEvB,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EACtD,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;;;;;;;;;;EAsBzB;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,cAAc,EAClD,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,cAAc,CAAC,CAAC,CAAC,CAgBnB"}
@@ -93,3 +93,4 @@ export type BasedErrorData<T extends BasedErrorCode = BasedErrorCode> = {
93
93
  channelId?: number;
94
94
  };
95
95
  export {};
96
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,eAAO,MAAM,WAAW,EAAE,UAIzB,CAAA;AAED,oBAAY,cAAc;IACxB,aAAa,QAAQ;IACrB,sBAAsB,QAAQ;IAC9B,yBAAyB,QAAQ;IACjC,oBAAoB,QAAQ;IAC5B,gBAAgB,QAAQ;IACxB,mBAAmB,QAAQ;IAC3B,sBAAsB,QAAQ;IAC9B,cAAc,QAAQ;IACtB,eAAe,QAAQ;IACvB,aAAa,QAAQ;IACrB,0BAA0B,QAAQ;IAClC,gBAAgB,QAAQ;IACxB,cAAc,QAAQ;IACtB,gBAAgB,QAAQ;IACxB,SAAS,QAAQ;IACjB,8BAA8B,QAAQ;IACtC,kBAAkB,QAAQ;IAC1B,KAAK,QAAQ;CACd;AAED,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,KAAK,GAAG,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,YAAY,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE,KAAK,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,KAAK,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,KAAK,iBAAi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ACvD,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,iBAAiB,CAAA;IAClD,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAA;IACnD,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1C,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,UAAU,CAAA;IACvD,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3C,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,cAAc,IAAI;IACnD,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI;IACtE,KAAK,EAAE,UAAU,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { Context } from '@based/functions';
3
3
  export declare const callFunction: (server: BasedServer, name: string, ctx: Context, payload: any) => Promise<any>;
4
+ //# sourceMappingURL=callFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callFunction.d.ts","sourceRoot":"","sources":["../../src/functionApi/callFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI1C,eAAO,MAAM,YAAY,WACf,WAAW,QACb,MAAM,OACP,OAAO,WACH,GAAG,KACX,QAAQ,GAAG,CA+Cb,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { ChannelMessageFunctionInternal } from '@based/functions';
3
3
  export declare const subscribeChannel: (server: BasedServer, name: string, id: number, payload: any, update: ChannelMessageFunctionInternal) => (() => void);
4
+ //# sourceMappingURL=channelSubscribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channelSubscribe.d.ts","sourceRoot":"","sources":["../../src/functionApi/channelSubscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAWjE,eAAO,MAAM,gBAAgB,WACnB,WAAW,QACb,MAAM,MACR,MAAM,WACD,GAAG,UACJ,8BAA8B,KACrC,CAAC,MAAM,IAAI,CAsDb,CAAA"}
@@ -8,3 +8,4 @@ export declare class BasedChannel extends BasedChannelAbstract {
8
8
  subscribe(onMessage: ChannelMessageFunction, onError?: (err: any) => void): () => void;
9
9
  publish(message: any, ctx?: Context): void;
10
10
  }
11
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/functionApi/client/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,oBAAoB,EACpC,sBAAsB,EACtB,OAAO,EACP,qBAAqB,EACtB,MAAM,kBAAkB,CAAA;AAKzB,qBAAa,YAAa,SAAQ,oBAAoB;IAC7C,OAAO,EAAE,GAAG,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;gBAE9B,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAQ3E,SAAS,CACP,SAAS,EAAE,sBAAsB,EACjC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAC3B,MAAM,IAAI;IAkBb,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAE,OAAkB,GAAG,IAAI;CAUrD"}
@@ -18,3 +18,4 @@ export declare class BasedFunctionClient extends BasedfunctionClientAbstract {
18
18
  sendAuthState(ctx: Context<Session>, authState: AuthState): void;
19
19
  [util.inspect.custom](): string;
20
20
  }
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functionApi/client/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,SAAS,EACT,mBAAmB,IAAI,2BAA2B,EAClD,OAAO,EACP,qBAAqB,EAGrB,kBAAkB,EAClB,OAAO,EACR,MAAM,kBAAkB,CAAA;AAEzB,qBAAa,mBAAoB,SAAQ,2BAA2B;IAClE,MAAM,EAAE,WAAW,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;gBAEvB,MAAM,EAAE,WAAW;IAQ/B,GAAG,CAAC,GAAG,EAAE,OAAO;IAKhB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,GAAE,OAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;IAIxE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,UAAU;IAI9C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,YAAY;IAI5C,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,kBAAkB,EAC9B,GAAG,GAAE,OAAkB,GACtB,OAAO,CAAC,GAAG,CAAC;IAKf,cAAc,CACZ,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EACrB,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,SAAS,CAAC;IAIrB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAW/D,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAOhE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;CAGtB"}
@@ -9,3 +9,4 @@ export declare class BasedQuery extends BasedQueryAbstract {
9
9
  getWhen(condition: (data: any, checksum: number) => boolean): Promise<any>;
10
10
  get(): Promise<any>;
11
11
  }
12
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/functionApi/client/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAG5E,OAAO,EACL,UAAU,IAAI,kBAAkB,EAChC,OAAO,EACP,qBAAqB,EACtB,MAAM,kBAAkB,CAAA;AAEzB,qBAAa,UAAW,SAAQ,kBAAkB;IACzC,KAAK,EAAE,GAAG,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;gBAE9B,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAO3E,SAAS,CACP,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,IAAI;IAWP,OAAO,CACX,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,GAClD,OAAO,CAAC,GAAG,CAAC;IAWT,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAG1B"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { Context } from '@based/functions';
3
3
  export declare const get: (server: BasedServer, name: string, ctx: Context, payload: any) => Promise<any>;
4
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/functionApi/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAqDtD,eAAO,MAAM,GAAG,WACN,WAAW,QACb,MAAM,OACP,OAAO,WACH,GAAG,KACX,QAAQ,GAAG,CA6Cb,CAAA"}
@@ -6,3 +6,4 @@ export * from './observe';
6
6
  export * from './stream';
7
7
  export * from './publish';
8
8
  export * from './channelSubscribe';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functionApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA"}
@@ -2,3 +2,4 @@ import { BasedServer } from '../server';
2
2
  import { Context } from '@based/functions';
3
3
  import { ObservableUpdateFunction, ObserveErrorListener } from '../query';
4
4
  export declare const observe: (server: BasedServer, name: string, ctx: Context, payload: any, update: ObservableUpdateFunction, error: ObserveErrorListener) => (() => void);
5
+ //# sourceMappingURL=observe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../src/functionApi/observe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAIL,wBAAwB,EACxB,oBAAoB,EAGrB,MAAM,UAAU,CAAA;AAGjB,eAAO,MAAM,OAAO,WACV,WAAW,QACb,MAAM,OACP,OAAO,WACH,GAAG,UACJ,wBAAwB,SACzB,oBAAoB,KAC1B,CAAC,MAAM,IAAI,CAkDb,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { Context } from '@based/functions';
3
3
  export declare const publish: (server: BasedServer, name: string, ctx: Context, id: number, payload: any, msg: any) => void;
4
+ //# sourceMappingURL=publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/functionApi/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAK1C,eAAO,MAAM,OAAO,WACV,WAAW,QACb,MAAM,OACP,OAAO,MACR,MAAM,WACD,GAAG,OACP,GAAG,SA0BT,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { BasedServer } from '../server';
2
2
  import { Context, StreamFunctionOpts } from '@based/functions';
3
3
  export declare const streamFunction: (server: BasedServer, name: string, ctx: Context, streamOpts: StreamFunctionOpts) => Promise<any>;
4
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/functionApi/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EACL,OAAO,EAGP,kBAAkB,EAEnB,MAAM,kBAAkB,CAAA;AAiBzB,eAAO,MAAM,cAAc,WACjB,WAAW,QACb,MAAM,OACP,OAAO,cACA,kBAAkB,KAC7B,QAAQ,GAAG,CAiEb,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import { BasedFunctionConfig } from '@based/functions';
2
2
  export declare const genVersion: (spec: BasedFunctionConfig) => number;
3
+ //# sourceMappingURL=genVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genVersion.d.ts","sourceRoot":"","sources":["../../src/functions/genVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,kBAAkB,CAAA;AAG7E,eAAO,MAAM,UAAU,SAAU,mBAAmB,KAAG,MAmBtD,CAAA"}
@@ -38,6 +38,7 @@ export declare class BasedFunctions {
38
38
  addRoutes(routes: BasedRoutes): void;
39
39
  completeSpec(spec: Optional<BasedFunctionConfig, 'name'>, name?: string): null | BasedFunctionConfigComplete;
40
40
  completeRoute(route: Optional<BasedRoute, 'name'>, name?: string): null | BasedRouteComplete;
41
+ removeRoute(name: string): Promise<boolean>;
41
42
  updateRoute(route: BasedRouteComplete, name?: string): null | (BasedRoute & {
42
43
  maxPayloadSize: number;
43
44
  rateLimitTokens: number;
@@ -51,3 +52,4 @@ export declare class BasedFunctions {
51
52
  getFromStore(name: string): BasedFunctionConfigComplete | null;
52
53
  remove(name: string): boolean;
53
54
  }
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EAEX,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AAEz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