firebase-functions 3.16.0 → 3.18.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 (47) hide show
  1. package/lib/bin/firebase-functions.d.ts +2 -0
  2. package/lib/bin/firebase-functions.js +48 -0
  3. package/lib/cloud-functions.d.ts +15 -8
  4. package/lib/cloud-functions.js +63 -2
  5. package/lib/common/encoding.js +6 -0
  6. package/lib/common/providers/https.d.ts +49 -10
  7. package/lib/common/providers/https.js +114 -57
  8. package/lib/common/providers/identity.d.ts +29 -0
  9. package/lib/common/providers/identity.js +96 -0
  10. package/lib/function-builder.d.ts +7 -1
  11. package/lib/function-builder.js +15 -0
  12. package/lib/function-configuration.d.ts +1 -0
  13. package/lib/handler-builder.d.ts +19 -15
  14. package/lib/handler-builder.js +32 -15
  15. package/lib/providers/auth.d.ts +2 -21
  16. package/lib/providers/auth.js +5 -66
  17. package/lib/providers/database.js +2 -1
  18. package/lib/providers/https.d.ts +44 -2
  19. package/lib/providers/https.js +61 -1
  20. package/lib/runtime/loader.d.ts +1 -0
  21. package/lib/runtime/loader.js +101 -0
  22. package/lib/runtime/manifest.d.ts +59 -0
  23. package/lib/runtime/manifest.js +2 -0
  24. package/lib/v2/core.d.ts +10 -3
  25. package/lib/v2/index.d.ts +2 -1
  26. package/lib/v2/index.js +3 -1
  27. package/lib/v2/options.d.ts +1 -1
  28. package/lib/v2/options.js +47 -9
  29. package/lib/v2/params/types.d.ts +2 -1
  30. package/lib/v2/params/types.js +2 -0
  31. package/lib/v2/providers/alerts/alerts.d.ts +36 -0
  32. package/lib/v2/providers/alerts/alerts.js +72 -0
  33. package/lib/v2/providers/alerts/appDistribution.d.ts +35 -0
  34. package/lib/v2/providers/alerts/appDistribution.js +39 -0
  35. package/lib/v2/providers/alerts/billing.d.ts +38 -0
  36. package/lib/v2/providers/alerts/billing.js +30 -0
  37. package/lib/v2/providers/alerts/crashlytics.d.ts +123 -0
  38. package/lib/v2/providers/alerts/crashlytics.js +74 -0
  39. package/lib/v2/providers/alerts/index.d.ts +5 -0
  40. package/lib/v2/providers/alerts/index.js +20 -0
  41. package/lib/v2/providers/https.d.ts +23 -3
  42. package/lib/v2/providers/https.js +71 -2
  43. package/lib/v2/providers/pubsub.d.ts +1 -1
  44. package/lib/v2/providers/pubsub.js +19 -4
  45. package/lib/v2/providers/storage.d.ts +1 -1
  46. package/lib/v2/providers/storage.js +32 -5
  47. package/package.json +27 -4
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOptsAndApp = exports.onOperation = exports.onNewAnrIssuePublished = exports.onVelocityAlertPublished = exports.onStabilityDigestPublished = exports.onRegressionAlertPublished = exports.onNewNonfatalIssuePublished = exports.onNewFatalIssuePublished = exports.newAnrIssueAlert = exports.velocityAlert = exports.stabilityDigestAlert = exports.regressionAlert = exports.newNonfatalIssueAlert = exports.newFatalIssueAlert = void 0;
4
+ const _1 = require(".");
5
+ /** @internal */
6
+ exports.newFatalIssueAlert = 'crashlytics.newFatalIssue';
7
+ /** @internal */
8
+ exports.newNonfatalIssueAlert = 'crashlytics.newNonfatalIssue';
9
+ /** @internal */
10
+ exports.regressionAlert = 'crashlytics.regression';
11
+ /** @internal */
12
+ exports.stabilityDigestAlert = 'crashlytics.stabilityDigest';
13
+ /** @internal */
14
+ exports.velocityAlert = 'crashlytics.velocity';
15
+ /** @internal */
16
+ exports.newAnrIssueAlert = 'crashlytics.newAnrIssue';
17
+ function onNewFatalIssuePublished(appIdOrOptsOrHandler, handler) {
18
+ return onOperation(exports.newFatalIssueAlert, appIdOrOptsOrHandler, handler);
19
+ }
20
+ exports.onNewFatalIssuePublished = onNewFatalIssuePublished;
21
+ function onNewNonfatalIssuePublished(appIdOrOptsOrHandler, handler) {
22
+ return onOperation(exports.newNonfatalIssueAlert, appIdOrOptsOrHandler, handler);
23
+ }
24
+ exports.onNewNonfatalIssuePublished = onNewNonfatalIssuePublished;
25
+ function onRegressionAlertPublished(appIdOrOptsOrHandler, handler) {
26
+ return onOperation(exports.regressionAlert, appIdOrOptsOrHandler, handler);
27
+ }
28
+ exports.onRegressionAlertPublished = onRegressionAlertPublished;
29
+ function onStabilityDigestPublished(appIdOrOptsOrHandler, handler) {
30
+ return onOperation(exports.stabilityDigestAlert, appIdOrOptsOrHandler, handler);
31
+ }
32
+ exports.onStabilityDigestPublished = onStabilityDigestPublished;
33
+ function onVelocityAlertPublished(appIdOrOptsOrHandler, handler) {
34
+ return onOperation(exports.velocityAlert, appIdOrOptsOrHandler, handler);
35
+ }
36
+ exports.onVelocityAlertPublished = onVelocityAlertPublished;
37
+ function onNewAnrIssuePublished(appIdOrOptsOrHandler, handler) {
38
+ return onOperation(exports.newAnrIssueAlert, appIdOrOptsOrHandler, handler);
39
+ }
40
+ exports.onNewAnrIssuePublished = onNewAnrIssuePublished;
41
+ /** @internal */
42
+ function onOperation(alertType, appIdOrOptsOrHandler, handler) {
43
+ if (typeof appIdOrOptsOrHandler === 'function') {
44
+ handler = appIdOrOptsOrHandler;
45
+ appIdOrOptsOrHandler = {};
46
+ }
47
+ const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
48
+ const func = (raw) => {
49
+ return handler(raw);
50
+ };
51
+ func.run = handler;
52
+ func.__endpoint = (0, _1.getEndpointAnnotation)(opts, alertType, appId);
53
+ return func;
54
+ }
55
+ exports.onOperation = onOperation;
56
+ /**
57
+ * @internal
58
+ * Helper function to parse the function opts and appId.
59
+ */
60
+ function getOptsAndApp(appIdOrOpts) {
61
+ let opts;
62
+ let appId;
63
+ if (typeof appIdOrOpts === 'string') {
64
+ opts = {};
65
+ appId = appIdOrOpts;
66
+ }
67
+ else {
68
+ appId = appIdOrOpts.appId;
69
+ opts = { ...appIdOrOpts };
70
+ delete opts.appId;
71
+ }
72
+ return [opts, appId];
73
+ }
74
+ exports.getOptsAndApp = getOptsAndApp;
@@ -0,0 +1,5 @@
1
+ import * as appDistribution from './appDistribution';
2
+ import * as billing from './billing';
3
+ import * as crashlytics from './crashlytics';
4
+ export { appDistribution, billing, crashlytics };
5
+ export * from './alerts';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.crashlytics = exports.billing = exports.appDistribution = void 0;
14
+ const appDistribution = require("./appDistribution");
15
+ exports.appDistribution = appDistribution;
16
+ const billing = require("./billing");
17
+ exports.billing = billing;
18
+ const crashlytics = require("./crashlytics");
19
+ exports.crashlytics = crashlytics;
20
+ __exportStar(require("./alerts"), exports);
@@ -1,18 +1,38 @@
1
1
  import * as express from 'express';
2
- import { CallableRequest, FunctionsErrorCode, HttpsError, Request } from '../../common/providers/https';
3
2
  import * as options from '../options';
4
- export { Request, CallableRequest, FunctionsErrorCode, HttpsError };
3
+ import { CallableRequest, FunctionsErrorCode, HttpsError, Request, TaskRateLimits, TaskRequest, TaskRetryConfig } from '../../common/providers/https';
4
+ import { ManifestEndpoint } from '../../runtime/manifest';
5
+ export { Request, CallableRequest, FunctionsErrorCode, HttpsError, TaskRateLimits, TaskRequest, TaskRetryConfig as TaskRetryPolicy, };
5
6
  export interface HttpsOptions extends Omit<options.GlobalOptions, 'region'> {
6
7
  region?: options.SupportedRegion | string | Array<options.SupportedRegion | string>;
7
8
  cors?: string | boolean | RegExp | Array<string | RegExp>;
8
9
  }
10
+ export interface TaskQueueOptions extends options.GlobalOptions {
11
+ retryConfig?: TaskRetryConfig;
12
+ rateLimits?: TaskRateLimits;
13
+ /**
14
+ * Who can enqueue tasks for this function.
15
+ * If left unspecified, only service accounts which have
16
+ * roles/cloudtasks.enqueuer and roles/cloudfunctions.invoker
17
+ * will have permissions.
18
+ */
19
+ invoker?: 'private' | string | string[];
20
+ }
9
21
  export declare type HttpsFunction = ((req: Request, res: express.Response) => void | Promise<void>) & {
10
- __trigger: unknown;
22
+ __trigger?: unknown;
23
+ __endpoint: ManifestEndpoint;
11
24
  };
12
25
  export interface CallableFunction<T, Return> extends HttpsFunction {
13
26
  run(data: CallableRequest<T>): Return;
14
27
  }
28
+ export interface TaskQueueFunction<T = any> extends HttpsFunction {
29
+ run(data: TaskRequest<T>): void | Promise<void>;
30
+ }
15
31
  export declare function onRequest(opts: HttpsOptions, handler: (request: Request, response: express.Response) => void | Promise<void>): HttpsFunction;
16
32
  export declare function onRequest(handler: (request: Request, response: express.Response) => void | Promise<void>): HttpsFunction;
17
33
  export declare function onCall<T = any, Return = any | Promise<any>>(opts: HttpsOptions, handler: (request: CallableRequest<T>) => Return): CallableFunction<T, Return>;
18
34
  export declare function onCall<T = any, Return = any | Promise<any>>(handler: (request: CallableRequest<T>) => Return): CallableFunction<T, Return>;
35
+ /** Handle a request sent to a Cloud Tasks queue. */
36
+ export declare function onTaskDispatched<Args = any>(handler: (request: TaskRequest<Args>) => void | Promise<void>): TaskQueueFunction<Args>;
37
+ /** Handle a request sent to a Cloud Tasks queue. */
38
+ export declare function onTaskDispatched<Args = any>(options: TaskQueueOptions, handler: (request: TaskRequest<Args>) => void | Promise<void>): TaskQueueFunction<Args>;
@@ -21,12 +21,12 @@
21
21
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  // SOFTWARE.
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.onCall = exports.onRequest = exports.HttpsError = void 0;
24
+ exports.onTaskDispatched = exports.onCall = exports.onRequest = exports.HttpsError = void 0;
25
25
  const cors = require("cors");
26
26
  const encoding_1 = require("../../common/encoding");
27
+ const options = require("../options");
27
28
  const https_1 = require("../../common/providers/https");
28
29
  Object.defineProperty(exports, "HttpsError", { enumerable: true, get: function () { return https_1.HttpsError; } });
29
- const options = require("../options");
30
30
  function onRequest(optsOrHandler, handler) {
31
31
  let opts;
32
32
  if (arguments.length === 1) {
@@ -72,6 +72,22 @@ function onRequest(optsOrHandler, handler) {
72
72
  return trigger;
73
73
  },
74
74
  });
75
+ const baseOpts = options.optionsToEndpoint(options.getGlobalOptions());
76
+ // global options calls region a scalar and https allows it to be an array,
77
+ // but optionsToTriggerAnnotations handles both cases.
78
+ const specificOpts = options.optionsToEndpoint(opts);
79
+ const endpoint = {
80
+ platform: 'gcfv2',
81
+ ...baseOpts,
82
+ ...specificOpts,
83
+ labels: {
84
+ ...baseOpts === null || baseOpts === void 0 ? void 0 : baseOpts.labels,
85
+ ...specificOpts === null || specificOpts === void 0 ? void 0 : specificOpts.labels,
86
+ },
87
+ httpsTrigger: {},
88
+ };
89
+ (0, encoding_1.convertIfPresent)(endpoint.httpsTrigger, opts, 'invoker', 'invoker', encoding_1.convertInvoker);
90
+ handler.__endpoint = endpoint;
75
91
  return handler;
76
92
  }
77
93
  exports.onRequest = onRequest;
@@ -113,7 +129,60 @@ function onCall(optsOrHandler, handler) {
113
129
  };
114
130
  },
115
131
  });
132
+ const baseOpts = options.optionsToEndpoint(options.getGlobalOptions());
133
+ // global options calls region a scalar and https allows it to be an array,
134
+ // but optionsToManifestEndpoint handles both cases.
135
+ const specificOpts = options.optionsToEndpoint(opts);
136
+ func.__endpoint = {
137
+ platform: 'gcfv2',
138
+ ...baseOpts,
139
+ ...specificOpts,
140
+ labels: {
141
+ ...baseOpts === null || baseOpts === void 0 ? void 0 : baseOpts.labels,
142
+ ...specificOpts === null || specificOpts === void 0 ? void 0 : specificOpts.labels,
143
+ },
144
+ callableTrigger: {},
145
+ };
116
146
  func.run = handler;
117
147
  return func;
118
148
  }
119
149
  exports.onCall = onCall;
150
+ function onTaskDispatched(optsOrHandler, handler) {
151
+ let opts;
152
+ if (arguments.length == 1) {
153
+ opts = {};
154
+ handler = optsOrHandler;
155
+ }
156
+ else {
157
+ opts = optsOrHandler;
158
+ }
159
+ // onEnqueueHandler sniffs the function length to determine which API to present.
160
+ // fix the length to prevent api versions from being mismatched.
161
+ const fixedLen = (req) => handler(req);
162
+ const func = (0, https_1.onDispatchHandler)(fixedLen);
163
+ Object.defineProperty(func, '__trigger', {
164
+ get: () => {
165
+ const baseOpts = options.optionsToTriggerAnnotations(options.getGlobalOptions());
166
+ // global options calls region a scalar and https allows it to be an array,
167
+ // but optionsToTriggerAnnotations handles both cases.
168
+ const specificOpts = options.optionsToTriggerAnnotations(opts);
169
+ const taskQueueTrigger = {};
170
+ (0, encoding_1.copyIfPresent)(taskQueueTrigger, opts, 'retryConfig', 'rateLimits');
171
+ (0, encoding_1.convertIfPresent)(taskQueueTrigger, opts, 'invoker', 'invoker', encoding_1.convertInvoker);
172
+ return {
173
+ apiVersion: 2,
174
+ platform: 'gcfv2',
175
+ ...baseOpts,
176
+ ...specificOpts,
177
+ labels: {
178
+ ...baseOpts === null || baseOpts === void 0 ? void 0 : baseOpts.labels,
179
+ ...specificOpts === null || specificOpts === void 0 ? void 0 : specificOpts.labels,
180
+ },
181
+ taskQueueTrigger,
182
+ };
183
+ },
184
+ });
185
+ func.run = handler;
186
+ return func;
187
+ }
188
+ exports.onTaskDispatched = onTaskDispatched;
@@ -1,5 +1,5 @@
1
- import { CloudEvent, CloudFunction } from '../core';
2
1
  import * as options from '../options';
2
+ import { CloudEvent, CloudFunction } from '../core';
3
3
  /**
4
4
  * Interface representing a Google Cloud Pub/Sub message.
5
5
  *
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.onMessagePublished = exports.Message = void 0;
4
4
  const options = require("../options");
5
+ const encoding_1 = require("../../common/encoding");
5
6
  /**
6
7
  * Interface representing a Google Cloud Pub/Sub message.
7
8
  *
@@ -69,10 +70,6 @@ function onMessagePublished(topicOrOptions, handler) {
69
70
  return handler(raw);
70
71
  };
71
72
  func.run = handler;
72
- // TypeScript doesn't recongize defineProperty as adding a property and complains
73
- // that __trigger doesn't exist. We can either cast to any and lose all type safety
74
- // or we can just assign a meaningless value before calling defineProperty.
75
- func.__trigger = 'silence the transpiler';
76
73
  Object.defineProperty(func, '__trigger', {
77
74
  get: () => {
78
75
  const baseOpts = options.optionsToTriggerAnnotations(options.getGlobalOptions());
@@ -95,6 +92,24 @@ function onMessagePublished(topicOrOptions, handler) {
95
92
  };
96
93
  },
97
94
  });
95
+ const baseOpts = options.optionsToEndpoint(options.getGlobalOptions());
96
+ const specificOpts = options.optionsToEndpoint(opts);
97
+ const endpoint = {
98
+ platform: 'gcfv2',
99
+ ...baseOpts,
100
+ ...specificOpts,
101
+ labels: {
102
+ ...baseOpts === null || baseOpts === void 0 ? void 0 : baseOpts.labels,
103
+ ...specificOpts === null || specificOpts === void 0 ? void 0 : specificOpts.labels,
104
+ },
105
+ eventTrigger: {
106
+ eventType: 'google.cloud.pubsub.topic.v1.messagePublished',
107
+ eventFilters: { topic },
108
+ retry: false,
109
+ },
110
+ };
111
+ (0, encoding_1.copyIfPresent)(endpoint.eventTrigger, opts, 'retry', 'retry');
112
+ func.__endpoint = endpoint;
98
113
  return func;
99
114
  }
100
115
  exports.onMessagePublished = onMessagePublished;
@@ -1,5 +1,5 @@
1
- import { CloudEvent, CloudFunction } from '../core';
2
1
  import * as options from '../options';
2
+ import { CloudEvent, CloudFunction } from '../core';
3
3
  /**
4
4
  * An object within Google Cloud Storage.
5
5
  * Ref: https://github.com/googleapis/google-cloudevents-nodejs/blob/main/cloud/storage/v1/StorageObjectData.ts
@@ -22,8 +22,9 @@
22
22
  // SOFTWARE.
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.getOptsAndBucket = exports.onOperation = exports.onObjectMetadataUpdated = exports.onObjectDeleted = exports.onObjectFinalized = exports.onObjectArchived = exports.metadataUpdatedEvent = exports.deletedEvent = exports.finalizedEvent = exports.archivedEvent = void 0;
25
- const config_1 = require("../../config");
26
25
  const options = require("../options");
26
+ const config_1 = require("../../config");
27
+ const encoding_1 = require("../../common/encoding");
27
28
  /** @internal */
28
29
  exports.archivedEvent = 'google.cloud.storage.object.v1.archived';
29
30
  /** @internal */
@@ -59,10 +60,6 @@ function onOperation(eventType, bucketOrOptsOrHandler, handler) {
59
60
  return handler(raw);
60
61
  };
61
62
  func.run = handler;
62
- // TypeScript doesn't recongize defineProperty as adding a property and complains
63
- // that __trigger doesn't exist. We can either cast to any and lose all type safety
64
- // or we can just assign a meaningless value before calling defineProperty.
65
- func.__trigger = 'silence the transpiler';
66
63
  Object.defineProperty(func, '__trigger', {
67
64
  get: () => {
68
65
  const baseOpts = options.optionsToTriggerAnnotations(options.getGlobalOptions());
@@ -82,6 +79,36 @@ function onOperation(eventType, bucketOrOptsOrHandler, handler) {
82
79
  };
83
80
  },
84
81
  });
82
+ // TypeScript doesn't recognize defineProperty as adding a property and complains
83
+ // that __endpoint doesn't exist. We can either cast to any and lose all type safety
84
+ // or we can just assign a meaningless value before calling defineProperty.
85
+ func.__endpoint = {};
86
+ // SDK may attempt to read FIREBASE_CONFIG env var to fetch the default bucket name.
87
+ // To prevent runtime errors when FIREBASE_CONFIG env var is missing, we use getters.
88
+ Object.defineProperty(func, '__endpoint', {
89
+ get: () => {
90
+ const baseOpts = options.optionsToEndpoint(options.getGlobalOptions());
91
+ const specificOpts = options.optionsToEndpoint(opts);
92
+ const endpoint = {
93
+ platform: 'gcfv2',
94
+ ...baseOpts,
95
+ ...specificOpts,
96
+ labels: {
97
+ ...baseOpts === null || baseOpts === void 0 ? void 0 : baseOpts.labels,
98
+ ...specificOpts === null || specificOpts === void 0 ? void 0 : specificOpts.labels,
99
+ },
100
+ eventTrigger: {
101
+ eventType,
102
+ eventFilters: {
103
+ bucket,
104
+ },
105
+ retry: false,
106
+ },
107
+ };
108
+ (0, encoding_1.copyIfPresent)(endpoint.eventTrigger, opts, 'retry', 'retry');
109
+ return endpoint;
110
+ },
111
+ });
85
112
  return func;
86
113
  }
87
114
  exports.onOperation = onOperation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-functions",
3
- "version": "3.16.0",
3
+ "version": "3.18.0",
4
4
  "description": "Firebase SDK for Cloud Functions",
5
5
  "keywords": [
6
6
  "firebase",
@@ -22,6 +22,9 @@
22
22
  "lib"
23
23
  ],
24
24
  "main": "lib/index.js",
25
+ "bin": {
26
+ "firebase-functions": "./lib/bin/firebase-functions.js"
27
+ },
25
28
  "types": "lib/index.d.ts",
26
29
  "exports": {
27
30
  ".": "./lib/index.js",
@@ -54,7 +57,11 @@
54
57
  "./v2/https": "./lib/v2/providers/https.js",
55
58
  "./v2/params": "./lib/v2/params/index.js",
56
59
  "./v2/pubsub": "./lib/v2/providers/pubsub.js",
57
- "./v2/storage": "./lib/v2/providers/storage.js"
60
+ "./v2/storage": "./lib/v2/providers/storage.js",
61
+ "./v2/alerts": "./lib/v2/providers/alerts/index.js",
62
+ "./v2/alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js",
63
+ "./v2/alerts/billing": "./lib/v2/providers/alerts/billing.js",
64
+ "./v2/alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js"
58
65
  },
59
66
  "typesVersions": {
60
67
  "*": {
@@ -114,6 +121,18 @@
114
121
  ],
115
122
  "v2/storage": [
116
123
  "lib/v2/providers/storage"
124
+ ],
125
+ "v2/alerts": [
126
+ "lib/v2/providers/alerts"
127
+ ],
128
+ "v2/alerts/appDistribution": [
129
+ "lib/v2/providers/alerts/appDistribution"
130
+ ],
131
+ "v2/alerts/billing": [
132
+ "lib/v2/providers/alerts/billing"
133
+ ],
134
+ "v2/alerts/crashlytics": [
135
+ "lib/v2/providers/alerts/crashlytics"
117
136
  ]
118
137
  }
119
138
  },
@@ -130,7 +149,8 @@
130
149
  "format:fix": "prettier --write '**/*.{json,md,ts,yml,yaml}'",
131
150
  "lint": "tslint --config tslint.json --project tsconfig.json ",
132
151
  "lint:fix": "tslint --config tslint.json --fix --project tsconfig.json",
133
- "test": "mocha"
152
+ "test": "mocha --file ./mocha/setup.ts spec/**/*.spec.ts ",
153
+ "test:bin": "./scripts/bin-test/run.sh"
134
154
  },
135
155
  "dependencies": {
136
156
  "@types/cors": "^2.8.5",
@@ -161,9 +181,12 @@
161
181
  "mock-require": "^3.0.3",
162
182
  "mz": "^2.7.0",
163
183
  "nock": "^10.0.6",
184
+ "node-fetch": "^2.6.7",
185
+ "portfinder": "^1.0.28",
164
186
  "prettier": "^1.18.2",
187
+ "semver": "^7.3.5",
165
188
  "sinon": "^7.3.2",
166
- "ts-node": "^8.3.0",
189
+ "ts-node": "^10.4.0",
167
190
  "tslint": "^5.18.0",
168
191
  "tslint-config-prettier": "^1.18.0",
169
192
  "tslint-no-unused-expression-chai": "^0.1.4",