@teamkeel/functions-runtime 0.236.3 → 0.237.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.
@@ -7,7 +7,7 @@ const {
7
7
  // Generic handler function that is agnostic to runtime environment (local or lambda)
8
8
  // to execute a custom function based on the contents of a jsonrpc-2.0 payload object.
9
9
  // To read more about jsonrpc request and response shapes, please read https://www.jsonrpc.org/specification
10
- export async function handleRequest(request, config) {
10
+ async function handleRequest(request, config) {
11
11
  const { createFunctionAPI, functions } = config;
12
12
 
13
13
  if (!(request.method in functions)) {
@@ -50,3 +50,5 @@ export async function handleRequest(request, config) {
50
50
  );
51
51
  }
52
52
  }
53
+
54
+ module.exports.handleRequest = handleRequest;
package/src/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ // This file doesn't contain types describing this package, rather it contains generic types
2
+ // that are used by the generated @teamkeel/sdk package.
3
+
1
4
  export type IDWhereCondition = {
2
5
  equals?: string;
3
6
  oneOf?: string[];
@@ -26,10 +29,26 @@ export type NumberWhereCondition = {
26
29
  notEquals?: number;
27
30
  };
28
31
 
32
+ // Date database API
29
33
  export type DateWhereCondition = {
30
- equals?: Date;
31
- before?: Date;
32
- onOrBefore?: Date;
33
- after?: Date;
34
- onOrAfter?: Date;
34
+ equals?: Date | string;
35
+ before?: Date | string;
36
+ onOrBefore?: Date | string;
37
+ after?: Date | string;
38
+ onOrAfter?: Date | string;
39
+ };
40
+
41
+ // Date query input
42
+ export type DateQueryInput = {
43
+ equals?: string;
44
+ before?: string;
45
+ onOrBefore?: string;
46
+ after?: string;
47
+ onOrAfter?: string;
48
+ };
49
+
50
+ // Timestamp query input
51
+ export type TimestampQueryInput = {
52
+ before: string;
53
+ after: string;
35
54
  };
package/src/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  const { ModelAPI } = require("./ModelAPI");
2
2
  const { handleRequest } = require("./handleRequest");
3
+ const KSUID = require("ksuid");
3
4
  const { getDatabase } = require("./database");
4
5
 
5
6
  module.exports = {
6
7
  ModelAPI,
7
8
  handleRequest,
8
9
  getDatabase,
10
+ ksuid() {
11
+ return KSUID.randomSync().string;
12
+ },
9
13
  };