@pbvision/cloud-run-service 0.0.11 → 0.0.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pbvision/cloud-run-service",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "fastify-firestore-service Web Framework on Cloud Run",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { makeService, runService } from './main.js'
2
2
  import { enqueueCloudTask } from './tasks.js'
3
- import * as utils from './utils.js'
3
+ import { isCloud, isDev, isProd, isLocalhost, isUnitTesting } from './utils.js'
4
4
 
5
5
  export {
6
6
  enqueueCloudTask,
7
7
  makeService, // for use with unit testing
8
8
  runService,
9
- utils
9
+
10
+ isCloud, isDev, isProd, isLocalhost, isUnitTesting
10
11
  }
@@ -6,7 +6,7 @@ import { API, DatabaseAPI } from '@pbvision/fastify-firestore-service'
6
6
  import db from '@pbvision/firestore-orm'
7
7
  import S from '@pbvision/schema'
8
8
 
9
- import { isUnitTesting, now } from './utils.js'
9
+ import { isUnitTesting } from './utils.js'
10
10
 
11
11
  class Test extends db.Model {
12
12
  static KEY = { id: S.str }
@@ -24,7 +24,7 @@ export class TestAPI extends DatabaseAPI {
24
24
  async computeResponse () {
25
25
  const doesNotExist = await this.tx.get(Test, 'abc')
26
26
  assert(doesNotExist === undefined)
27
- return { epoch: now() }
27
+ return { epoch: Math.floor(new Date().getTime() / 1000) }
28
28
  }
29
29
  }
30
30
 
package/src/utils.js CHANGED
@@ -42,5 +42,3 @@ export function getServiceHost (serviceName) {
42
42
  return serviceName + process.env.CLOUD_RUN_HOSTNAME_SUFFIX
43
43
  }
44
44
  }
45
-
46
- export const now = () => Math.floor(new Date().getTime() / 1000)