@chift/chift-nodejs 1.0.27 → 1.0.29

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.
@@ -49,12 +49,14 @@ const client = new chift.API({
49
49
  const consumerName = 'test consumer';
50
50
  const email = 'support@chift.eu';
51
51
  const redirect_url = 'https://chift.eu';
52
+ const internalReference = 'test-internal-ref';
52
53
  let consumer;
53
54
  (0, globals_1.beforeAll)(() => __awaiter(void 0, void 0, void 0, function* () {
54
55
  consumer = yield client.Consumers.createConsumer({
55
56
  email,
56
57
  redirect_url,
57
58
  name: consumerName,
59
+ internal_reference: internalReference,
58
60
  });
59
61
  }));
60
62
  (0, globals_1.test)('createConsumer', () => __awaiter(void 0, void 0, void 0, function* () {
@@ -77,6 +79,18 @@ let consumer;
77
79
  const consumers = yield client.Consumers.getConsumers();
78
80
  (0, globals_1.expect)(consumers).toBeInstanceOf(Array);
79
81
  }));
82
+ (0, globals_1.test)('getConsumers with search param', () => __awaiter(void 0, void 0, void 0, function* () {
83
+ const withSearch = yield client.Consumers.getConsumers({ search: consumerName });
84
+ (0, globals_1.expect)(withSearch).toBeInstanceOf(Array);
85
+ }));
86
+ (0, globals_1.test)('getConsumers with internal_reference param', () => __awaiter(void 0, void 0, void 0, function* () {
87
+ const withInternalRef = yield client.Consumers.getConsumers({
88
+ internal_reference: internalReference,
89
+ });
90
+ (0, globals_1.expect)(withInternalRef).toBeInstanceOf(Array);
91
+ (0, globals_1.expect)(withInternalRef.length).toBeGreaterThanOrEqual(1);
92
+ (0, globals_1.expect)(withInternalRef[0].internal_reference).toBe(internalReference);
93
+ }));
80
94
  (0, globals_1.test)('getConsumersByName', () => __awaiter(void 0, void 0, void 0, function* () {
81
95
  const consumersWithName = yield client.Consumers.getConsumersByName(consumerName);
82
96
  (0, globals_1.expect)(consumersWithName).toBeInstanceOf(Array);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chift/chift-nodejs",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "The Chift NodeJS library provides convenient access to the Chift API from applications written in the NodeJS language (Javascript/Typescript).",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "dev": "chokidar src --command 'npm run build' --debounce=5000",
13
13
  "prepare": "husky install",
14
- "build": "tsc",
14
+ "build": "tsc && cp src/types/public-api/schema.d.ts dist/src/types/public-api/schema.d.ts",
15
15
  "test": "jest --maxWorkers 1"
16
16
  },
17
17
  "keywords": [],