@flowerforce/flowerbase 1.1.2-beta.2 → 1.1.2-beta.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/features/functions/controller.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,kBAkGjC,CAAA"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/features/functions/controller.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,kBAsGjC,CAAA"}
@@ -83,7 +83,11 @@ const functionsController = (app_1, _a) => __awaiter(void 0, [app_1, _a], void 0
83
83
  .watch([], { fullDocument: 'whenAvailable' });
84
84
  res.header('Content-Type', 'text/event-stream');
85
85
  res.header('Cache-Control', 'no-cache');
86
+ res.header("content-encoding", "gzip");
86
87
  res.header('Connection', 'keep-alive');
88
+ res.header("access-control-allow-credentials", true);
89
+ res.header("access-control-allow-origin", "*");
90
+ res.header("access-control-allow-headers", "X-Stitch-Location, X-Baas-Location, Location");
87
91
  res.raw.flushHeaders();
88
92
  changeStream.on('change', (change) => {
89
93
  res.raw.write(`data: ${JSON.stringify(change)}\n\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AActB,cAAc,SAAS,CAAA;AAEvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,EAC/B,SAAS,EACT,IAAI,EACJ,SAAqC,EACrC,IAA0B,EAC1B,UAAuC,EACxC,EAAE,gBAAgB,iBAwElB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AActB,cAAc,SAAS,CAAA;AAEvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,EAC/B,SAAS,EACT,IAA0B,EAC1B,SAAqC,EACrC,IAA0B,EAC1B,UAAuC,EACxC,EAAE,gBAAgB,iBAwElB"}
package/dist/index.js CHANGED
@@ -73,7 +73,7 @@ __exportStar(require("./model"), exports);
73
73
  * @param mongodbUrl -> the database connection string
74
74
  */
75
75
  function initialize(_a) {
76
- return __awaiter(this, arguments, void 0, function* ({ projectId, host, jwtSecret = constants_1.DEFAULT_CONFIG.JWT_SECRET, port = constants_1.DEFAULT_CONFIG.PORT, mongodbUrl = constants_1.DEFAULT_CONFIG.MONGODB_URL }) {
76
+ return __awaiter(this, arguments, void 0, function* ({ projectId, host = constants_1.DEFAULT_CONFIG.HOST, jwtSecret = constants_1.DEFAULT_CONFIG.JWT_SECRET, port = constants_1.DEFAULT_CONFIG.PORT, mongodbUrl = constants_1.DEFAULT_CONFIG.MONGODB_URL }) {
77
77
  var _b;
78
78
  const fastify = (0, fastify_1.default)({
79
79
  logger: !!constants_1.DEFAULT_CONFIG.ENABLE_LOGGER
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowerforce/flowerbase",
3
- "version": "1.1.2-beta.2",
3
+ "version": "1.1.2-beta.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -100,7 +100,11 @@ export const functionsController: FunctionController = async (
100
100
 
101
101
  res.header('Content-Type', 'text/event-stream')
102
102
  res.header('Cache-Control', 'no-cache')
103
+ res.header("content-encoding", "gzip")
103
104
  res.header('Connection', 'keep-alive')
105
+ res.header("access-control-allow-credentials", true)
106
+ res.header("access-control-allow-origin", "*")
107
+ res.header("access-control-allow-headers", "X-Stitch-Location, X-Baas-Location, Location")
104
108
  res.raw.flushHeaders()
105
109
 
106
110
  changeStream.on('change', (change) => {
package/src/index.ts CHANGED
@@ -32,7 +32,7 @@ export type InitializeConfig = {
32
32
  */
33
33
  export async function initialize({
34
34
  projectId,
35
- host,
35
+ host = DEFAULT_CONFIG.HOST,
36
36
  jwtSecret = DEFAULT_CONFIG.JWT_SECRET,
37
37
  port = DEFAULT_CONFIG.PORT,
38
38
  mongodbUrl = DEFAULT_CONFIG.MONGODB_URL