@pact-foundation/pact-core 15.2.0 → 16.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [16.0.0](https://github.com/pact-foundation/pact-js-core/compare/v15.2.1...v16.0.0) (2025-02-17)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * build platform/arch specific npm packages
11
+
12
+ ### Features
13
+
14
+ * build platform/arch specific npm packages ([809775e](https://github.com/pact-foundation/pact-js-core/commit/809775e01e937e0b20a3305076f72c85dec8b674))
15
+
16
+
17
+ ### Fixes and Improvements
18
+
19
+ * **deps:** update dependency check-types to v7.4.0 ([30ff204](https://github.com/pact-foundation/pact-js-core/commit/30ff204ea4988ecef56ebef223880e3e44abd7c7))
20
+ * **deps:** update dependency underscore to v1.13.7 ([921f692](https://github.com/pact-foundation/pact-js-core/commit/921f6926955c74c45b33168da3aeb66c1b673ccd))
21
+
22
+ ## [15.2.1](https://github.com/pact-foundation/pact-js-core/compare/v15.2.0...v15.2.1) (2024-09-06)
23
+
24
+
25
+ ### Fixes and Improvements
26
+
27
+ * logFile default to info if undefined, warn if error setting ([a9906c4](https://github.com/pact-foundation/pact-js-core/commit/a9906c486f17832058148fc3b2d62b403a1909d1))
28
+
5
29
  ## [15.2.0](https://github.com/pact-foundation/pact-js-core/compare/v15.1.1...v15.2.0) (2024-09-06)
6
30
 
7
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pact-foundation/pact-core",
3
- "version": "15.2.0",
3
+ "version": "16.0.0",
4
4
  "description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/pact-foundation/pact-js-core#readme",
@@ -43,68 +43,69 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "check-types": "7.3.0",
46
+ "check-types": "7.4.0",
47
+ "detect-libc": "^2.0.3",
47
48
  "node-gyp-build": "^4.6.0",
48
49
  "pino": "^8.7.0",
49
50
  "pino-pretty": "^9.1.1",
50
- "underscore": "1.12.1"
51
+ "underscore": "1.13.7"
51
52
  },
52
53
  "devDependencies": {
53
- "@grpc/grpc-js": "^1.8.0",
54
- "@grpc/proto-loader": "^0.7.3",
55
- "@pact-foundation/pact-js-prettier-config": "^1.0.0",
56
- "@snyk/protect": "^1.1118.0",
57
- "@tsconfig/node14": "^1.0.3",
58
- "@types/basic-auth": "^1.1.2",
59
- "@types/chai": "4.1.2",
60
- "@types/chai-as-promised": "7.1.0",
61
- "@types/check-types": "^7.3.2",
62
- "@types/cors": "^2.8.6",
63
- "@types/decompress": "^4.2.3",
64
- "@types/express": "4.11.1",
65
- "@types/mocha": "9.0.0",
66
- "@types/needle": "2.5.2",
67
- "@types/node": "^18.11.10",
68
- "@types/rimraf": "^2.0.2",
69
- "@types/sinon": "^9.0.11",
70
- "@types/tar": "^4.0.3",
71
- "@types/underscore": "1.8.7",
72
- "@types/unixify": "^1.0.0",
73
- "@types/url-join": "^4.0.0",
74
- "@typescript-eslint/eslint-plugin": "^5.47.0",
75
- "@typescript-eslint/parser": "^5.47.0",
76
- "axios": "^1.6.0",
77
- "basic-auth": "2.0.0",
78
- "body-parser": "^1.18.2",
79
- "chai": "4.1.2",
80
- "chai-as-promised": "7.1.1",
81
- "commit-and-tag-version": "^11.1.0",
82
- "cors": "2.8.4",
83
- "cross-env": "^5.1.3",
54
+ "@grpc/grpc-js": "1.12.4",
55
+ "@grpc/proto-loader": "0.7.13",
56
+ "@pact-foundation/pact-js-prettier-config": "1.0.0",
57
+ "@snyk/protect": "1.1294.2",
58
+ "@tsconfig/node14": "14.1.2",
59
+ "@types/basic-auth": "1.1.8",
60
+ "@types/chai": "4.3.20",
61
+ "@types/chai-as-promised": "7.1.8",
62
+ "@types/check-types": "7.3.7",
63
+ "@types/cors": "2.8.17",
64
+ "@types/decompress": "4.2.7",
65
+ "@types/express": "4.17.21",
66
+ "@types/mocha": "10.0.10",
67
+ "@types/needle": "3.3.0",
68
+ "@types/node": "22.10.1",
69
+ "@types/rimraf": "2.0.5",
70
+ "@types/sinon": "17.0.3",
71
+ "@types/tar": "6.1.13",
72
+ "@types/underscore": "1.13.0",
73
+ "@types/unixify": "1.0.2",
74
+ "@types/url-join": "4.0.3",
75
+ "@typescript-eslint/eslint-plugin": "5.62.0",
76
+ "@typescript-eslint/parser": "5.62.0",
77
+ "axios": "1.7.9",
78
+ "basic-auth": "2.0.1",
79
+ "body-parser": "1.20.3",
80
+ "chai": "4.5.0",
81
+ "chai-as-promised": "7.1.2",
82
+ "commit-and-tag-version": "11.3.0",
83
+ "cors": "2.8.5",
84
+ "cross-env": "5.2.1",
84
85
  "decamelize": "2.0.0",
85
- "eslint": "^8.30.0",
86
- "eslint-config-airbnb-base": "^15.0.0",
87
- "eslint-config-airbnb-typescript": "^17.0.0",
88
- "eslint-config-prettier": "^8.5.0",
89
- "eslint-import-resolver-typescript": "^3.5.2",
90
- "eslint-plugin-chai-friendly": "^0.7.2",
91
- "eslint-plugin-import": "^2.26.0",
92
- "eslint-plugin-mocha": "^10.1.0",
93
- "express": "4.19.2",
94
- "form-data": "^4.0.0",
95
- "grpc-promise": "^1.4.0",
96
- "mocha": "^9.1.3",
97
- "node-addon-api": "^6.1.0",
98
- "nodemon": "^2.0.4",
99
- "prettier": "^2.3.0",
100
- "protobufjs": "^7.2.4",
86
+ "eslint": "8.57.1",
87
+ "eslint-config-airbnb-base": "15.0.0",
88
+ "eslint-config-airbnb-typescript": "17.1.0",
89
+ "eslint-config-prettier": "8.10.0",
90
+ "eslint-import-resolver-typescript": "3.7.0",
91
+ "eslint-plugin-chai-friendly": "0.7.4",
92
+ "eslint-plugin-import": "2.31.0",
93
+ "eslint-plugin-mocha": "10.1.0",
94
+ "express": "4.21.2",
95
+ "form-data": "4.0.1",
96
+ "grpc-promise": "1.4.0",
97
+ "mocha": "9.2.2",
98
+ "node-addon-api": "6.1.0",
99
+ "nodemon": "2.0.22",
100
+ "prettier": "2.8.8",
101
+ "protobufjs": "7.4.0",
101
102
  "rimraf": "2.7.1",
102
103
  "sinon": "9.2.4",
103
- "ts-node": "10.9.1",
104
- "typescript": "4.7.4"
104
+ "ts-node": "10.9.2",
105
+ "typescript": "4.9.5"
105
106
  },
106
107
  "overrides": {
107
- "semver": "7.5.2"
108
+ "semver": "7.6.3"
108
109
  },
109
110
  "scripts": {
110
111
  "clean": "rimraf '{src,test}/**/*.{js,map,d.ts}' 'package.zip' '.tmp' 'tmp'",
@@ -160,5 +161,14 @@
160
161
  }
161
162
  ]
162
163
  },
163
- "snyk": true
164
+ "snyk": true,
165
+ "optionalDependencies": {
166
+ "@pact-foundation/pact-core-darwin-arm64": "16.0.0",
167
+ "@pact-foundation/pact-core-darwin-x64": "16.0.0",
168
+ "@pact-foundation/pact-core-linux-arm64-glibc": "16.0.0",
169
+ "@pact-foundation/pact-core-linux-arm64-musl": "16.0.0",
170
+ "@pact-foundation/pact-core-linux-x64-glibc": "16.0.0",
171
+ "@pact-foundation/pact-core-linux-x64-musl": "16.0.0",
172
+ "@pact-foundation/pact-core-windows-x64": "16.0.0"
173
+ }
164
174
  }
@@ -1,6 +1,6 @@
1
1
  export declare const wrapWithCheck: <F extends (...args: never[]) => boolean>(f: BooleanFunction<F>, contextMessage: string) => (...args: Parameters<F>) => boolean;
2
- declare type BooleanFunction<T> = T extends (...args: infer A) => boolean ? (...args: A) => boolean : never;
3
- declare type BooleanFunctions<T> = {
2
+ type BooleanFunction<T> = T extends (...args: infer A) => boolean ? (...args: A) => boolean : never;
3
+ type BooleanFunctions<T> = {
4
4
  [key in keyof T]: BooleanFunction<T[key]>;
5
5
  };
6
6
  export declare const wrapAllWithCheck: <T extends BooleanFunctions<T>>(o: T) => BooleanFunctions<T>;
@@ -1,64 +1,65 @@
1
1
  /// <reference types="node" />
2
- export declare type MatchingResult = MatchingResultSuccess | MatchingResultRequestMismatch | MatchingResultRequestNotFound | MatchingResultMissingRequest | MatchingResultPlugin;
3
- export declare type MatchingResultSuccess = {
2
+ /// <reference types="node" />
3
+ export type MatchingResult = MatchingResultSuccess | MatchingResultRequestMismatch | MatchingResultRequestNotFound | MatchingResultMissingRequest | MatchingResultPlugin;
4
+ export type MatchingResultSuccess = {
4
5
  type: 'request-match';
5
6
  };
6
- export declare type MatchingResultRequestMismatch = {
7
+ export type MatchingResultRequestMismatch = {
7
8
  type: 'request-mismatch';
8
9
  method: string;
9
10
  path: string;
10
11
  mismatches: Mismatch[];
11
12
  };
12
- export declare type MatchingResultRequestNotFound = {
13
+ export type MatchingResultRequestNotFound = {
13
14
  type: 'request-not-found';
14
15
  method: string;
15
16
  path: string;
16
17
  request: RequestMismatch;
17
18
  };
18
- export declare type MatchingResultMissingRequest = {
19
+ export type MatchingResultMissingRequest = {
19
20
  type: 'missing-request';
20
21
  method: string;
21
22
  path: string;
22
23
  request: RequestMismatch;
23
24
  };
24
- export declare type MatchingResultPlugin = {
25
+ export type MatchingResultPlugin = {
25
26
  error: string;
26
27
  path?: string;
27
28
  mismatches: PluginContentMismatch[];
28
29
  };
29
- export declare type Mismatch = MethodMismatch | PathMismatch | StatusMismatch | QueryMismatch | HeaderMismatch | BodyTypeMismatch | BodyMismatch | MetadataMismatch | PluginContentMismatch;
30
- export declare type MethodMismatch = {
30
+ export type Mismatch = MethodMismatch | PathMismatch | StatusMismatch | QueryMismatch | HeaderMismatch | BodyTypeMismatch | BodyMismatch | MetadataMismatch | PluginContentMismatch;
31
+ export type MethodMismatch = {
31
32
  type: 'MethodMismatch';
32
33
  expected: string;
33
34
  actual: string;
34
35
  };
35
- export declare type PathMismatch = {
36
+ export type PathMismatch = {
36
37
  type: 'PathMismatch';
37
38
  expected: string;
38
39
  actual: string;
39
40
  mismatch: string;
40
41
  };
41
- export declare type StatusMismatch = {
42
+ export type StatusMismatch = {
42
43
  type: 'StatusMismatch';
43
44
  expected: string;
44
45
  actual: string;
45
46
  mismatch: string;
46
47
  };
47
- export declare type QueryMismatch = {
48
+ export type QueryMismatch = {
48
49
  type: 'QueryMismatch';
49
50
  parameter: string;
50
51
  expected: string;
51
52
  actual: string;
52
53
  mismatch: string;
53
54
  };
54
- export declare type HeaderMismatch = {
55
+ export type HeaderMismatch = {
55
56
  type: 'HeaderMismatch';
56
57
  key: string;
57
58
  expected: string;
58
59
  actual: string;
59
60
  mismatch: string;
60
61
  };
61
- export declare type BodyTypeMismatch = {
62
+ export type BodyTypeMismatch = {
62
63
  type: 'BodyTypeMismatch';
63
64
  expected: string;
64
65
  actual: string;
@@ -66,21 +67,21 @@ export declare type BodyTypeMismatch = {
66
67
  expectedBody?: string;
67
68
  actualBody?: string;
68
69
  };
69
- export declare type BodyMismatch = {
70
+ export type BodyMismatch = {
70
71
  type: 'BodyMismatch';
71
72
  path: string;
72
73
  expected?: string;
73
74
  actual?: string;
74
75
  mismatch: string;
75
76
  };
76
- export declare type MetadataMismatch = {
77
+ export type MetadataMismatch = {
77
78
  type: 'MetadataMismatch';
78
79
  key: string;
79
80
  expected: string;
80
81
  actual: string;
81
82
  mismatch: string;
82
83
  };
83
- export declare type RequestMismatch = {
84
+ export type RequestMismatch = {
84
85
  method?: string;
85
86
  path?: string;
86
87
  headers?: Record<string, Array<string>>;
@@ -94,22 +95,22 @@ export declare type PluginContentMismatch = {
94
95
  mismatch: string;
95
96
  diff?: string;
96
97
  };
97
- export declare type PluginInteraction = RequestPluginInteraction & ResponsePluginInteraction & RequestResponsePluginInteraction;
98
- export declare type RequestPluginInteraction = {
98
+ export type PluginInteraction = RequestPluginInteraction & ResponsePluginInteraction & RequestResponsePluginInteraction;
99
+ export type RequestPluginInteraction = {
99
100
  withPluginRequestInteractionContents: (contentType: string, contents: string) => boolean;
100
101
  };
101
- export declare type ResponsePluginInteraction = {
102
+ export type ResponsePluginInteraction = {
102
103
  withPluginResponseInteractionContents: (contentType: string, contents: string) => boolean;
103
104
  };
104
- export declare type RequestResponsePluginInteraction = {
105
+ export type RequestResponsePluginInteraction = {
105
106
  withPluginRequestResponseInteractionContents: (contentType: string, contents: string) => boolean;
106
107
  };
107
- export declare type PluginPact = {
108
+ export type PluginPact = {
108
109
  addPlugin: (plugin: string, version: string) => void;
109
110
  cleanupPlugins: () => void;
110
111
  cleanupMockServer: (port: number) => boolean;
111
112
  };
112
- export declare type ConsumerInteraction = PluginInteraction & {
113
+ export type ConsumerInteraction = PluginInteraction & {
113
114
  uponReceiving: (description: string) => boolean;
114
115
  given: (state: string) => boolean;
115
116
  givenWithParam: (state: string, name: string, value: string) => boolean;
@@ -126,7 +127,7 @@ export declare type ConsumerInteraction = PluginInteraction & {
126
127
  withResponseBinaryBody: (body: Buffer, contentType: string) => boolean;
127
128
  withResponseMultipartBody: (contentType: string, filename: string, mimePartName: string) => boolean;
128
129
  };
129
- export declare type ConsumerPact = PluginPact & {
130
+ export type ConsumerPact = PluginPact & {
130
131
  newInteraction: (description: string) => ConsumerInteraction;
131
132
  newAsynchronousMessage: (description: string) => AsynchronousMessage;
132
133
  newSynchronousMessage: (description: string) => SynchronousMessage;
@@ -139,7 +140,7 @@ export declare type ConsumerPact = PluginPact & {
139
140
  mockServerMatchedSuccessfully: (port: number) => boolean;
140
141
  addMetadata: (namespace: string, name: string, value: string) => boolean;
141
142
  };
142
- export declare type AsynchronousMessage = RequestPluginInteraction & {
143
+ export type AsynchronousMessage = RequestPluginInteraction & {
143
144
  given: (state: string) => void;
144
145
  givenWithParam: (state: string, name: string, value: string) => void;
145
146
  givenWithParams: (state: string, params: string) => void;
@@ -149,8 +150,8 @@ export declare type AsynchronousMessage = RequestPluginInteraction & {
149
150
  withBinaryContents: (body: Buffer, contentType: string) => void;
150
151
  reifyMessage: () => string;
151
152
  };
152
- export declare type ConsumerMessage = AsynchronousMessage;
153
- export declare type SynchronousMessage = PluginInteraction & {
153
+ export type ConsumerMessage = AsynchronousMessage;
154
+ export type SynchronousMessage = PluginInteraction & {
154
155
  given: (state: string) => void;
155
156
  givenWithParam: (state: string, name: string, value: string) => void;
156
157
  givenWithParams: (state: string, params: string) => void;
@@ -160,7 +161,7 @@ export declare type SynchronousMessage = PluginInteraction & {
160
161
  withRequestBinaryContents: (body: Buffer, contentType: string) => void;
161
162
  withResponseBinaryContents: (body: Buffer, contentType: string) => void;
162
163
  };
163
- export declare type ConsumerMessagePact = PluginPact & {
164
+ export type ConsumerMessagePact = PluginPact & {
164
165
  newMessage: (description: string) => AsynchronousMessage;
165
166
  newAsynchronousMessage: (description: string) => AsynchronousMessage;
166
167
  newSynchronousMessage: (description: string) => SynchronousMessage;
package/src/ffi/index.js CHANGED
@@ -29,9 +29,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getFfiLib = exports.PACT_FFI_VERSION = void 0;
30
30
  const node_path_1 = __importDefault(require("node:path"));
31
31
  const bindings = require("node-gyp-build");
32
+ const detect_libc_1 = require("detect-libc");
32
33
  const logger_1 = __importStar(require("../logger"));
33
34
  const types_1 = require("./types");
34
35
  exports.PACT_FFI_VERSION = '0.4.22';
36
+ function getPlatformArchSpecificPackage() {
37
+ const { arch } = process;
38
+ let os = process.platform;
39
+ if (['win32', 'cygwin'].includes(process.platform)) {
40
+ os = 'windows';
41
+ }
42
+ let platformArchSpecificPackage = `@pact-foundation/pact-core-${os}-${arch}`;
43
+ if (os === 'linux') {
44
+ platformArchSpecificPackage += (0, detect_libc_1.isNonGlibcLinuxSync)() ? '-musl' : '-glibc';
45
+ }
46
+ const prebuildPackageLocation = process.env['PACT_PREBUILD_PACKAGE_LOCATION'];
47
+ if (prebuildPackageLocation) {
48
+ platformArchSpecificPackage = node_path_1.default.join(prebuildPackageLocation, platformArchSpecificPackage);
49
+ }
50
+ const packagePath = `${platformArchSpecificPackage}/package.json`;
51
+ try {
52
+ let resolvedPackagePath = require.resolve(packagePath);
53
+ if (os === 'windows') {
54
+ resolvedPackagePath = resolvedPackagePath.replace('\\package.json', '');
55
+ }
56
+ else {
57
+ resolvedPackagePath = resolvedPackagePath.replace('/package.json', '');
58
+ }
59
+ return resolvedPackagePath;
60
+ }
61
+ catch (e) {
62
+ throw new Error(`Couldn't find npm package ${platformArchSpecificPackage} \n 💡 you can tell Pact where the npm package is located with env var $PACT_PREBUILD_PACKAGE_LOCATION`);
63
+ }
64
+ }
35
65
  const supportedPlatforms = [
36
66
  'darwin-arm64',
37
67
  'darwin-x64',
@@ -57,7 +87,7 @@ const loadPathMessage = (bindingsPath) => `: attempting to load native module fr
57
87
  : `\n source: pact-js-core binding lookup \n\n - You can override via PACT_PREBUILD_LOCATION\n`}`;
58
88
  const bindingsResolver = (bindingsPath) => bindings(bindingsPath);
59
89
  const bindingPaths = [
60
- node_path_1.default.resolve(__dirname, '..', '..'),
90
+ node_path_1.default.resolve(getPlatformArchSpecificPackage()),
61
91
  process.env['PACT_PREBUILD_LOCATION']?.toString() ?? node_path_1.default.resolve(),
62
92
  ];
63
93
  let ffiLib;
@@ -106,9 +136,11 @@ const getFfiLib = (logLevel = logger_1.DEFAULT_LOG_LEVEL, logFile = undefined) =
106
136
  ffi = initialiseFfi();
107
137
  logger_1.default.debug(`Initialising native core at log level '${logLevel}'`, logFile);
108
138
  if (logFile) {
109
- logger_1.default.debug(`writing log file at level ${types_1.FfiLogLevelFilter[logLevel]} to ${logFile}`);
110
- const res = ffiLib.pactffiLogToFile(logFile, types_1.FfiLogLevelFilter[logLevel]);
111
- logger_1.default.debug(`result of writing to file '${res}'`);
139
+ logger_1.default.debug(`writing log file at level ${logLevel} to ${logFile}`);
140
+ const res = ffiLib.pactffiLogToFile(logFile, types_1.FfiLogLevelFilter[logLevel] ?? 3);
141
+ if (res !== 0) {
142
+ logger_1.default.warn(`Failed to write log file to ${logFile}, reason: ${res}`);
143
+ }
112
144
  }
113
145
  else {
114
146
  ffiLib.pactffiInitWithLogLevel(logLevel);
@@ -1 +1 @@
1
-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M,CAAC,cAAc,EAAE,KAAK,wBAAgB,EAAE;oBAChD,gBAAM,CAAC,IAAI,CACT,iEAAiE,EACjE,MAAM,CAAC,cAAc,EAAE,CACxB,CAAC;oBACF,OAAO,KAAK,CAAC;iBACd;gBACD,OAAO,IAAI,CAAC;aACb;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,IAAI,CAAC;aACb;QACH,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,KAAK,EAAE;QACd,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEK,MAAM,SAAS,GAAG,CACvB,WAAqB,0BAAiB,EACtC,UAA8B,SAAS,EAC3B,EAAE;IACd,IAAI,CAAC,GAAG,EAAE;QACR,gBAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACpD,GAAG,GAAG,aAAa,EAAE,CAAC;QACtB,gBAAM,CAAC,KAAK,CACV,0CAA0C,QAAQ,GAAG,EACrD,OAAO,CACR,CAAC;QACF,IAAI,OAAO,EAAE;YACX,gBAAM,CAAC,KAAK,CAAC,6BAA6B,QAAQ,OAAO,OAAO,EAAE,CAAC,CAAC;YACpE,MAAM,GAAG,GAAG,MAAM,CAAC,gBAAgB,CACjC,OAAO,EACP,yBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CACjC,CAAC;YACF,IAAI,GAAG,KAAK,CAAC,EAAE;gBACb,gBAAM,CAAC,IAAI,CAAC,+BAA+B,OAAO,aAAa,GAAG,EAAE,CAAC,CAAC;aACvE;SACF;aAAM;YACL,MAAM,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;SAC1C;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAzBW,QAAA,SAAS,aAyBpB"}
@@ -1,21 +1,22 @@
1
1
  /// <reference types="node" />
2
- export declare type FfiHandle = number;
3
- export declare type FfiPactHandle = number;
4
- export declare type FfiInteractionHandle = number;
5
- export declare type FfiVerifierHandle = number;
6
- export declare type FfiMessagePactHandle = number;
7
- export declare type FfiMessageHandle = number;
8
- export declare type FfiSpecificationVersion = 0 | 1 | 2 | 3 | 4 | 5;
2
+ /// <reference types="node" />
3
+ export type FfiHandle = number;
4
+ export type FfiPactHandle = number;
5
+ export type FfiInteractionHandle = number;
6
+ export type FfiVerifierHandle = number;
7
+ export type FfiMessagePactHandle = number;
8
+ export type FfiMessageHandle = number;
9
+ export type FfiSpecificationVersion = 0 | 1 | 2 | 3 | 4 | 5;
9
10
  export declare const FfiSpecificationVersion: Record<string, FfiSpecificationVersion>;
10
- export declare type FfiWritePactResponse = 0 | 1 | 2 | 3;
11
+ export type FfiWritePactResponse = 0 | 1 | 2 | 3;
11
12
  export declare const FfiWritePactResponse: Record<string, FfiWritePactResponse>;
12
- export declare type FfiWriteMessagePactResponse = 0 | 1 | 2;
13
+ export type FfiWriteMessagePactResponse = 0 | 1 | 2;
13
14
  export declare const FfiWriteMessagePactResponse: Record<string, FfiWriteMessagePactResponse>;
14
- export declare type FfiConfigurePluginResponse = 0 | 1 | 2 | 3;
15
+ export type FfiConfigurePluginResponse = 0 | 1 | 2 | 3;
15
16
  export declare const FfiConfigurePluginResponse: Record<string, FfiConfigurePluginResponse>;
16
- export declare type FfiPluginInteractionResponse = 0 | 1 | 2 | 3 | 4 | 5 | 6;
17
+ export type FfiPluginInteractionResponse = 0 | 1 | 2 | 3 | 4 | 5 | 6;
17
18
  export declare const FfiPluginInteractionResponse: Record<string, FfiPluginInteractionResponse>;
18
- export declare type FfiInteractionPart = 0 | 1;
19
+ export type FfiInteractionPart = 0 | 1;
19
20
  export declare const INTERACTION_PART_REQUEST: FfiInteractionPart;
20
21
  export declare const INTERACTION_PART_RESPONSE: FfiInteractionPart;
21
22
  export declare const CREATE_MOCK_SERVER_ERRORS: {
@@ -38,18 +39,17 @@ export declare enum FfiFunctionResult {
38
39
  RESULT_FAILED = 1
39
40
  }
40
41
  export declare enum FfiLogLevelFilter {
41
- LOG_LEVEL_OFF = 0,
42
- LOG_LEVEL_ERROR = 1,
43
- LOG_LEVEL_WARN = 2,
44
- LOG_LEVEL_INFO = 3,
45
- LOG_LEVEL_DEBUG = 4,
46
- LOG_LEVEL_TRACE = 5
42
+ 'error' = 1,
43
+ 'warn' = 2,
44
+ 'info' = 3,
45
+ 'debug' = 4,
46
+ 'trace' = 5
47
47
  }
48
- export declare type Ffi = {
48
+ export type Ffi = {
49
49
  pactffiInit(logLevel: string): string;
50
50
  pactffiVersion(): string;
51
51
  } & FfiConsumerFunctions & FfiVerificationFunctions;
52
- export declare type FfiConsumerFunctions = {
52
+ export type FfiConsumerFunctions = {
53
53
  pactffiCreateMockServerForPact(handle: FfiPactHandle, address: string, tls: boolean): number;
54
54
  pactffiCreateMockServerForTransport(handle: FfiPactHandle, address: string, port: number, transport: string, config: string): number;
55
55
  pactffiNewPact(consumer: string, provider: string): FfiPactHandle;
@@ -93,7 +93,7 @@ export declare type FfiConsumerFunctions = {
93
93
  pactffiMessageWithMetadata(handle: FfiMessageHandle, key: string, value: string): void;
94
94
  pactffiMessageReify(handle: FfiMessageHandle): string;
95
95
  };
96
- export declare type FfiVerificationFunctions = {
96
+ export type FfiVerificationFunctions = {
97
97
  pactffiVerifierNewForApplication(libraryName: string, version: string): FfiVerifierHandle;
98
98
  pactffiVerifierSetProviderInfo(handle: FfiVerifierHandle, providerName: string, scheme: string, host: string, port: number, path: string): void;
99
99
  pactffiVerifierSetFilterInfo(handle: FfiVerifierHandle, description: string, state: string, noState: boolean): void;
package/src/ffi/types.js CHANGED
@@ -60,11 +60,10 @@ var FfiFunctionResult;
60
60
  })(FfiFunctionResult = exports.FfiFunctionResult || (exports.FfiFunctionResult = {}));
61
61
  var FfiLogLevelFilter;
62
62
  (function (FfiLogLevelFilter) {
63
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_OFF"] = 0] = "LOG_LEVEL_OFF";
64
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_ERROR"] = 1] = "LOG_LEVEL_ERROR";
65
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_WARN"] = 2] = "LOG_LEVEL_WARN";
66
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_INFO"] = 3] = "LOG_LEVEL_INFO";
67
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_DEBUG"] = 4] = "LOG_LEVEL_DEBUG";
68
- FfiLogLevelFilter[FfiLogLevelFilter["LOG_LEVEL_TRACE"] = 5] = "LOG_LEVEL_TRACE";
63
+ FfiLogLevelFilter[FfiLogLevelFilter["error"] = 1] = "error";
64
+ FfiLogLevelFilter[FfiLogLevelFilter["warn"] = 2] = "warn";
65
+ FfiLogLevelFilter[FfiLogLevelFilter["info"] = 3] = "info";
66
+ FfiLogLevelFilter[FfiLogLevelFilter["debug"] = 4] = "debug";
67
+ FfiLogLevelFilter[FfiLogLevelFilter["trace"] = 5] = "trace";
69
68
  })(FfiLogLevelFilter = exports.FfiLogLevelFilter || (exports.FfiLogLevelFilter = {}));
70
69
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAWa,QAAA,uBAAuB,GAClC;IACE,6BAA6B,EAAE,CAAC;IAChC,wBAAwB,EAAE,CAAC;IAC3B,0BAA0B,EAAE,CAAC;IAC7B,wBAAwB,EAAE,CAAC;IAC3B,wBAAwB,EAAE,CAAC;IAC3B,wBAAwB,EAAE,CAAC;CAC5B,CAAC;AAIS,QAAA,oBAAoB,GAAyC;IACxE,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;IAChB,yBAAyB,EAAE,CAAC;IAC5B,qBAAqB,EAAE,CAAC;CACzB,CAAC;AAIW,QAAA,2BAA2B,GAGpC;IACF,OAAO,EAAE,CAAC;IACV,yBAAyB,EAAE,CAAC;IAC5B,sBAAsB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AND,WAAY,wBAAwB;IAClC,6GAA2B,CAAA;IAC3B,qGAAmB,CAAA;IACnB,yGAAqB,CAAA;IACrB,6FAAe,CAAA;IACf,iGAAiB,CAAA;AACnB,CAAC,EANW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAMnC;AAUD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,mEAAa,CAAA;IACb,2EAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAED,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,2DAAW,CAAA;IACX,yDAAU,CAAA;IACV,yDAAU,CAAA;IACV,2DAAW,CAAA;IACX,2DAAW,CAAA;AACb,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B"}
@@ -1,5 +1,5 @@
1
- export declare type LogLevel = 'debug' | 'error' | 'info' | 'trace' | 'warn';
2
- export declare type Logger = {
1
+ export type LogLevel = 'debug' | 'error' | 'info' | 'trace' | 'warn';
2
+ export type Logger = {
3
3
  pactCrash: (message: string, context?: string) => void;
4
4
  error: (message: string, context?: string) => void;
5
5
  warn: (message: string, context?: string) => void;
@@ -1,17 +1,17 @@
1
1
  import { FnMapping } from './types';
2
2
  import { InternalPactVerifierOptions } from '../types';
3
3
  import { FfiVerificationFunctions } from '../../ffi/types';
4
- declare type IgnoredFfiFunctions = {
4
+ type IgnoredFfiFunctions = {
5
5
  pactffiVerifierNewForApplication: 1;
6
6
  pactffiVerifierExecute: 1;
7
7
  pactffiVerifierShutdown: 1;
8
8
  };
9
- declare type MergedFfiSourceFunctions = {
9
+ type MergedFfiSourceFunctions = {
10
10
  pactffiVerifierAddFileSource: 1;
11
11
  pactffiVerifierUrlSource: 1;
12
12
  };
13
- declare type RequiredFfiVerificationFunctions = Omit<FfiVerificationFunctions, keyof (IgnoredFfiFunctions & MergedFfiSourceFunctions)>;
14
- declare type OrderedExecution = {
13
+ type RequiredFfiVerificationFunctions = Omit<FfiVerificationFunctions, keyof (IgnoredFfiFunctions & MergedFfiSourceFunctions)>;
14
+ type OrderedExecution = {
15
15
  [Key in keyof RequiredFfiVerificationFunctions]: number;
16
16
  };
17
17
  export declare const orderOfExecution: OrderedExecution;
@@ -1,12 +1,12 @@
1
1
  import { Ffi, FfiHandle } from '../../ffi/types';
2
2
  export declare const deprecatedFunction: (_: unknown, property: string) => boolean;
3
- declare type KeyedObject = {
3
+ type KeyedObject = {
4
4
  [key: string]: unknown;
5
5
  };
6
- declare type FnArgumentMapping<O> = {
6
+ type FnArgumentMapping<O> = {
7
7
  validateAndExecute: (ffi: Ffi, handle: FfiHandle, options: O) => FnValidationResult;
8
8
  };
9
- export declare type FnMapping<T extends KeyedObject, O> = {
9
+ export type FnMapping<T extends KeyedObject, O> = {
10
10
  [Key in keyof T]: FnArgumentMapping<O>;
11
11
  };
12
12
  export declare enum FnValidationStatus {
@@ -14,16 +14,16 @@ export declare enum FnValidationStatus {
14
14
  IGNORE = 1,
15
15
  FAIL = 2
16
16
  }
17
- declare type FnValidationResultSuccess = {
17
+ type FnValidationResultSuccess = {
18
18
  status: FnValidationStatus.SUCCESS;
19
19
  };
20
- declare type FnValidationResultFail = {
20
+ type FnValidationResultFail = {
21
21
  status: FnValidationStatus.FAIL;
22
22
  messages: string[];
23
23
  };
24
- declare type FnValidationResultIgnore = {
24
+ type FnValidationResultIgnore = {
25
25
  status: FnValidationStatus.IGNORE;
26
26
  messages: string[];
27
27
  };
28
- export declare type FnValidationResult = FnValidationResultSuccess | FnValidationResultFail | FnValidationResultIgnore;
28
+ export type FnValidationResult = FnValidationResultSuccess | FnValidationResultFail | FnValidationResultIgnore;
29
29
  export {};
@@ -12,7 +12,7 @@ export interface ConsumerVersionSelector {
12
12
  mainBranch?: boolean;
13
13
  matchingBranch?: boolean;
14
14
  }
15
- export declare type CustomHeaders = {
15
+ export type CustomHeaders = {
16
16
  [header: string]: string;
17
17
  };
18
18
  export interface Transport {
@@ -4,8 +4,8 @@ export declare const deprecatedBy: (preferredOption: string) => () => (_: unknow
4
4
  export declare const incompatibleWith: (keys: (keyof InternalPactVerifierOptions)[]) => (options: InternalPactVerifierOptions) => (_: unknown, property: string) => boolean;
5
5
  export declare const requires: (keys: (keyof InternalPactVerifierOptions)[]) => (options: InternalPactVerifierOptions) => (_: unknown, property: string) => boolean;
6
6
  export declare const requiresOneOf: (keys: (keyof InternalPactVerifierOptions)[]) => (options: InternalPactVerifierOptions) => (_: unknown, property: string) => boolean;
7
- declare type AssertFunction = (a: unknown, property: string) => boolean;
8
- export declare type ArgumentValidationRules<T> = {
7
+ type AssertFunction = (a: unknown, property: string) => boolean;
8
+ export type ArgumentValidationRules<T> = {
9
9
  [Key in keyof T]-?: ((options: T) => AssertFunction)[];
10
10
  };
11
11
  export declare const validationRules: ArgumentValidationRules<InternalPactVerifierOptions>;
Binary file
Binary file
Binary file
Binary file
Binary file