@coveo/platform-client 37.9.0 → 37.10.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/README.md +1 -15
- package/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts +27 -0
- package/dist/definitions/resources/Pipelines/Conditions/ConditionInterfaces.d.ts +63 -1
- package/dist/resources/Pipelines/Conditions/Condition.js +32 -0
- package/dist/resources/Pipelines/Conditions/Condition.js.map +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -263,18 +263,4 @@ ExperimentalPlatformClient.something.list();
|
|
|
263
263
|
|
|
264
264
|
## Contributing
|
|
265
265
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
- Make sure your changes are fully tested (when applicable).
|
|
269
|
-
- We tend to avoid comments in our code base, we strongly prefer good naming and code structure.
|
|
270
|
-
- Avoid pushing similar changes in different commits if it's within the same feature, because we want the changelogs to be clear and simple. To avoid that, there are at least 2 options:
|
|
271
|
-
1. Squash the commits into one when merging (you need to edit the final commit message though)
|
|
272
|
-
1. amend the previous commit when making related changes (`git commit --amend --no-edit`)
|
|
273
|
-
|
|
274
|
-
### Commit messages
|
|
275
|
-
|
|
276
|
-
**Every commit message must comply with the [Angular Commit Message Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format) specification. We use the commit messages to automatically bump the package version according to the semantic versionning notation. Moreover, we generate changlogs for each version using those commit messages.**
|
|
277
|
-
|
|
278
|
-
- You can either manually write a commit message that follows the convention using your favorite method.
|
|
279
|
-
- Or you can run `npm run commit-cli`. It will prompt you some questions about the nature of your changes, then it will commit your staged changes along with a generated message that follows our convention.
|
|
280
|
-
- Commits containing breaking changes need to be marked as such in the commit footer. See [BREAKING CHANGE convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-footer).
|
|
266
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
@@ -3,9 +3,36 @@ import Resource from '../../Resource';
|
|
|
3
3
|
import { ConditionModel, ListConditionsOptions, NewConditionModel } from './ConditionInterfaces';
|
|
4
4
|
export default class Condition extends Resource {
|
|
5
5
|
static baseUrl: string;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a paginated list of condition models.
|
|
8
|
+
* @param {ListConditionsOptions} options
|
|
9
|
+
*/
|
|
6
10
|
list(options?: ListConditionsOptions): Promise<PageModel<ConditionModel, "statements">>;
|
|
11
|
+
/**
|
|
12
|
+
* Creates and returns a new condition model.
|
|
13
|
+
* @param {NewConditionModel} conditionModel
|
|
14
|
+
*/
|
|
7
15
|
create(conditionModel: NewConditionModel): Promise<ConditionModel>;
|
|
16
|
+
/**
|
|
17
|
+
* Delete a condition model.
|
|
18
|
+
* @param {string} conditionId The unique identifier of the condition to be deleted.
|
|
19
|
+
*/
|
|
8
20
|
delete(conditionId: string): Promise<Record<string, unknown>>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a condition model.
|
|
23
|
+
* @param {string} conditionId The unique identifier of the condition to be fetched.
|
|
24
|
+
*/
|
|
9
25
|
get(conditionId: string): Promise<ConditionModel>;
|
|
26
|
+
/**
|
|
27
|
+
* Update a condition model with the model sent and returns the updated condition model.
|
|
28
|
+
* @param {string} conditionId The unique identifier of the condition to be updated.
|
|
29
|
+
* @param {ConditionModel | NewConditionModel} conditionModel
|
|
30
|
+
*/
|
|
10
31
|
update(conditionId: string, conditionModel: ConditionModel | NewConditionModel): Promise<ConditionModel>;
|
|
32
|
+
/**
|
|
33
|
+
* Bulk get a list of conditions corresponding of the ids sent.
|
|
34
|
+
* @param {string[]} conditionIds The list of condition's ids to be fetched. Limit of 1000 incoming ids.
|
|
35
|
+
* @param {ListConditionsOptions} params
|
|
36
|
+
*/
|
|
37
|
+
bulkGet(conditionIds: string[], params?: ListConditionsOptions): Promise<PageModel<ConditionModel, "statements">>;
|
|
11
38
|
}
|
|
@@ -1,25 +1,87 @@
|
|
|
1
1
|
import { Paginated } from '../../BaseInterfaces';
|
|
2
2
|
import { ListStatementSortBy } from '../../Enums';
|
|
3
3
|
export interface ConditionModel {
|
|
4
|
+
/**
|
|
5
|
+
* The unique identifier of this statement.
|
|
6
|
+
*/
|
|
4
7
|
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The intented purpose of thi statement in an actual implementation.
|
|
10
|
+
*/
|
|
5
11
|
description: string;
|
|
12
|
+
/**
|
|
13
|
+
* The query pipeline language expression that defines this statement.
|
|
14
|
+
*/
|
|
6
15
|
definition: string;
|
|
16
|
+
/**
|
|
17
|
+
* The structured object of the query pipeline language expression of this statement.
|
|
18
|
+
*/
|
|
7
19
|
detailed: any;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
* This property is exposed for backward compatibility reasons.
|
|
23
|
+
*/
|
|
8
24
|
childrenCount: number;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
* This property is exposed for backward compatibility reasons.
|
|
28
|
+
*/
|
|
9
29
|
feature: string;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
* This property is exposed for backward compatibility reasons.
|
|
33
|
+
*/
|
|
10
34
|
position: number;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated
|
|
37
|
+
* This property is exposed for backward compatibility reasons.
|
|
38
|
+
*/
|
|
11
39
|
ready: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
* This property is exposed for backward compatibility reasons.
|
|
43
|
+
*/
|
|
12
44
|
parent?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
* This property is exposed for backward compatibility reasons.
|
|
48
|
+
*/
|
|
13
49
|
condition?: string;
|
|
14
50
|
}
|
|
15
51
|
export interface NewConditionModel {
|
|
52
|
+
/**
|
|
53
|
+
* The query pipeline language expression that defines this statement.
|
|
54
|
+
*/
|
|
16
55
|
definition: string;
|
|
56
|
+
/**
|
|
57
|
+
* The unique identifier of this statement.
|
|
58
|
+
*/
|
|
17
59
|
id?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The intented purpose of this statement in an actual implementation.
|
|
62
|
+
*/
|
|
18
63
|
description?: string;
|
|
19
64
|
}
|
|
20
65
|
export interface ListConditionsOptions extends Paginated {
|
|
21
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Whether to sort the results in ascending order.
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
isOrderAscending?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The query filter to match.
|
|
73
|
+
* This allows you to search within query pipeline statement definitions and descriptions.
|
|
74
|
+
* By default, results are not required to match a specific query filter.
|
|
75
|
+
*/
|
|
22
76
|
filter?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The sort criteria to apply on the results.
|
|
79
|
+
* @default ListStatementSortBy.Position
|
|
80
|
+
*/
|
|
23
81
|
sortBy?: ListStatementSortBy;
|
|
82
|
+
/**
|
|
83
|
+
* The unique identifier of the target Coveo Cloud organization.
|
|
84
|
+
* The value set by default is provided by the API resource
|
|
85
|
+
*/
|
|
24
86
|
organizationId?: string;
|
|
25
87
|
}
|
|
@@ -7,22 +7,54 @@ var Condition = /** @class */ (function (_super) {
|
|
|
7
7
|
function Condition() {
|
|
8
8
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns a paginated list of condition models.
|
|
12
|
+
* @param {ListConditionsOptions} options
|
|
13
|
+
*/
|
|
10
14
|
Condition.prototype.list = function (options) {
|
|
11
15
|
if (options === void 0) { options = {}; }
|
|
12
16
|
return this.api.get(this.buildPath(Condition.baseUrl, tslib_1.__assign({ feature: 'when', organizationId: this.api.organizationId }, options)));
|
|
13
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates and returns a new condition model.
|
|
20
|
+
* @param {NewConditionModel} conditionModel
|
|
21
|
+
*/
|
|
14
22
|
Condition.prototype.create = function (conditionModel) {
|
|
15
23
|
return this.api.post(this.buildPath(Condition.baseUrl, { organizationId: this.api.organizationId }), conditionModel);
|
|
16
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Delete a condition model.
|
|
27
|
+
* @param {string} conditionId The unique identifier of the condition to be deleted.
|
|
28
|
+
*/
|
|
17
29
|
Condition.prototype.delete = function (conditionId) {
|
|
18
30
|
return this.api.delete(this.buildPath("".concat(Condition.baseUrl, "/").concat(conditionId), { organizationId: this.api.organizationId }));
|
|
19
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Returns a condition model.
|
|
34
|
+
* @param {string} conditionId The unique identifier of the condition to be fetched.
|
|
35
|
+
*/
|
|
20
36
|
Condition.prototype.get = function (conditionId) {
|
|
21
37
|
return this.api.get(this.buildPath("".concat(Condition.baseUrl, "/").concat(conditionId), { organizationId: this.api.organizationId }));
|
|
22
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Update a condition model with the model sent and returns the updated condition model.
|
|
41
|
+
* @param {string} conditionId The unique identifier of the condition to be updated.
|
|
42
|
+
* @param {ConditionModel | NewConditionModel} conditionModel
|
|
43
|
+
*/
|
|
23
44
|
Condition.prototype.update = function (conditionId, conditionModel) {
|
|
24
45
|
return this.api.put(this.buildPath("".concat(Condition.baseUrl, "/").concat(conditionId), { organizationId: this.api.organizationId }), conditionModel);
|
|
25
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Bulk get a list of conditions corresponding of the ids sent.
|
|
49
|
+
* @param {string[]} conditionIds The list of condition's ids to be fetched. Limit of 1000 incoming ids.
|
|
50
|
+
* @param {ListConditionsOptions} params
|
|
51
|
+
*/
|
|
52
|
+
Condition.prototype.bulkGet = function (conditionIds, params) {
|
|
53
|
+
if (params === void 0) { params = {}; }
|
|
54
|
+
return this.api.post(this.buildPath("".concat(Condition.baseUrl, "/bulkGet"), tslib_1.__assign({ organizationId: this.api.organizationId }, params)), {
|
|
55
|
+
ids: conditionIds,
|
|
56
|
+
});
|
|
57
|
+
};
|
|
26
58
|
Condition.baseUrl = "/rest/search/v1/admin/pipelines/statements";
|
|
27
59
|
return Condition;
|
|
28
60
|
}(Resource_1.default));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/Conditions/Condition.ts"],"names":[],"mappings":";;;AACA,oEAAsC;AAGtC;IAAuC,qCAAQ;IAA/C;;
|
|
1
|
+
{"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/Conditions/Condition.ts"],"names":[],"mappings":";;;AACA,oEAAsC;AAGtC;IAAuC,qCAAQ;IAA/C;;IAyEA,CAAC;IAtEG;;;OAGG;IACH,wBAAI,GAAJ,UAAK,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,qBAAG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IAAK,OAAO,EAAE,CAC5G,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,0BAAM,GAAN,UAAO,cAAiC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAC5E,cAAc,CACjB,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,0BAAM,GAAN,UAAO,WAAmB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAClB,IAAI,CAAC,SAAS,CAAC,UAAG,SAAS,CAAC,OAAO,cAAI,WAAW,CAAE,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,uBAAG,GAAH,UAAI,WAAmB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,UAAG,SAAS,CAAC,OAAO,cAAI,WAAW,CAAE,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,0BAAM,GAAN,UAAO,WAAmB,EAAE,cAAkD;QAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,UAAG,SAAS,CAAC,OAAO,cAAI,WAAW,CAAE,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAChG,cAAc,CACjB,CAAC;IACN,CAAC;IAED;;;;OAIG;IAEH,2BAAO,GAAP,UAAQ,YAAsB,EAAE,MAAkC;QAAlC,uBAAA,EAAA,WAAkC;QAC9D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,UAAG,SAAS,CAAC,OAAO,aAAU,qBACzC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IACpC,MAAM,EACX,EACF;YACI,GAAG,EAAE,YAAY;SACpB,CACJ,CAAC;IACN,CAAC;IAvEM,iBAAO,GAAG,4CAA4C,CAAC;IAwElE,gBAAC;CAAA,AAzED,CAAuC,kBAAQ,GAyE9C;kBAzEoB,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/platform-client",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/Entry.js",
|
|
6
6
|
"types": "dist/definitions/Entry.d.ts",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"eslint": "8.28.0",
|
|
35
35
|
"eslint-config-prettier": "8.5.0",
|
|
36
36
|
"eslint-config-typescript": "3.0.0",
|
|
37
|
-
"eslint-plugin-jest": "27.1.
|
|
37
|
+
"eslint-plugin-jest": "27.1.6",
|
|
38
38
|
"eslint-plugin-prettier": "4.2.1",
|
|
39
39
|
"husky": "8.0.2",
|
|
40
40
|
"jest": "29.3.1",
|
|
41
41
|
"jest-fetch-mock": "3.0.3",
|
|
42
42
|
"jest-runner-eslint": "1.1.0",
|
|
43
|
-
"lint-staged": "13.0.
|
|
44
|
-
"prettier": "2.
|
|
43
|
+
"lint-staged": "13.0.4",
|
|
44
|
+
"prettier": "2.8.0",
|
|
45
45
|
"semantic-release": "19.0.5",
|
|
46
46
|
"ts-jest": "29.0.3",
|
|
47
47
|
"tsjs": "4.2.1",
|
|
@@ -80,5 +80,6 @@
|
|
|
80
80
|
},
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
|
+
"packageManager": "npm@latest"
|
|
84
85
|
}
|