@kintone/rest-api-client 6.1.7 → 6.2.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 -0
- package/esm/package.json +2 -2
- package/esm/src/KintoneRestAPIClient.d.ts +3 -0
- package/esm/src/KintoneRestAPIClient.js +5 -0
- package/esm/src/KintoneRestAPIClient.js.map +1 -1
- package/esm/src/client/SearchClient.d.ts +5 -0
- package/esm/src/client/SearchClient.js +62 -0
- package/esm/src/client/SearchClient.js.map +1 -0
- package/esm/src/client/types/index.d.ts +1 -0
- package/esm/src/client/types/index.js +1 -0
- package/esm/src/client/types/index.js.map +1 -1
- package/esm/src/client/types/search/index.d.ts +200 -0
- package/esm/src/client/types/search/index.js +2 -0
- package/esm/src/client/types/search/index.js.map +1 -0
- package/esm/tsconfig.build.esm.tsbuildinfo +1 -1
- package/lib/package.json +2 -2
- package/lib/src/KintoneRestAPIClient.d.ts +3 -0
- package/lib/src/KintoneRestAPIClient.js +5 -0
- package/lib/src/KintoneRestAPIClient.js.map +1 -1
- package/lib/src/client/SearchClient.d.ts +5 -0
- package/lib/src/client/SearchClient.js +65 -0
- package/lib/src/client/SearchClient.js.map +1 -0
- package/lib/src/client/types/index.d.ts +1 -0
- package/lib/src/client/types/index.js +1 -0
- package/lib/src/client/types/index.js.map +1 -1
- package/lib/src/client/types/search/index.d.ts +200 -0
- package/lib/src/client/types/search/index.js +3 -0
- package/lib/src/client/types/search/index.js.map +1 -0
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/tsconfig.typecheck.node.tsbuildinfo +1 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/umd/KintoneRestAPIClient.js +590 -422
- package/umd/KintoneRestAPIClient.min.js +1 -1
package/README.md
CHANGED
|
@@ -179,6 +179,7 @@ See [TypeScript Definitions](https://github.com/kintone/js-sdk/tree/main/package
|
|
|
179
179
|
- [Space](https://github.com/kintone/js-sdk/tree/main/packages/rest-api-client/docs/space.md)
|
|
180
180
|
- [File](https://github.com/kintone/js-sdk/tree/main/packages/rest-api-client/docs/file.md)
|
|
181
181
|
- [BulkRequest](https://github.com/kintone/js-sdk/tree/main/packages/rest-api-client/docs/bulkRequest.md)
|
|
182
|
+
- [Search](https://github.com/kintone/js-sdk/tree/main/packages/rest-api-client/docs/search.md)
|
|
182
183
|
|
|
183
184
|
## Contribution Guide
|
|
184
185
|
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kintone/rest-api-client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Kintone REST API client for JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kintone",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"babel-loader": "9.2.1",
|
|
81
81
|
"core-js": "3.49.0",
|
|
82
82
|
"rimraf": "6.1.3",
|
|
83
|
-
"rollup": "4.60.
|
|
83
|
+
"rollup": "4.60.4",
|
|
84
84
|
"rollup-plugin-ecma-version-validator": "0.2.13",
|
|
85
85
|
"rollup-plugin-license": "3.7.1",
|
|
86
86
|
"rollup-plugin-node-globals": "1.4.0",
|
|
@@ -4,6 +4,7 @@ import { RecordClient } from "./client/RecordClient";
|
|
|
4
4
|
import { SpaceClient } from "./client/SpaceClient";
|
|
5
5
|
import { FileClient } from "./client/FileClient";
|
|
6
6
|
import { PluginClient } from "./client/PluginClient";
|
|
7
|
+
import type { SearchRequest, SearchResponse } from "./client/types";
|
|
7
8
|
import type { ProxyConfig } from "./http/HttpClientInterface";
|
|
8
9
|
import type { BasicAuth, DiscriminatedAuth } from "./types/auth";
|
|
9
10
|
import type { Agent as HttpsAgent } from "https";
|
|
@@ -35,11 +36,13 @@ export declare class KintoneRestAPIClient {
|
|
|
35
36
|
space: SpaceClient;
|
|
36
37
|
file: FileClient;
|
|
37
38
|
plugin: PluginClient;
|
|
39
|
+
private search_;
|
|
38
40
|
private bulkRequest_;
|
|
39
41
|
private baseUrl?;
|
|
40
42
|
constructor(options?: Options);
|
|
41
43
|
static get version(): string;
|
|
42
44
|
getBaseUrl(): string | undefined;
|
|
45
|
+
search(params: SearchRequest): Promise<SearchResponse>;
|
|
43
46
|
bulkRequest(params: {
|
|
44
47
|
requests: Array<{
|
|
45
48
|
method: string;
|
|
@@ -15,6 +15,7 @@ import { RecordClient } from "./client/RecordClient";
|
|
|
15
15
|
import { SpaceClient } from "./client/SpaceClient";
|
|
16
16
|
import { FileClient } from "./client/FileClient";
|
|
17
17
|
import { PluginClient } from "./client/PluginClient";
|
|
18
|
+
import { SearchClient } from "./client/SearchClient";
|
|
18
19
|
import { DefaultHttpClient } from "./http/";
|
|
19
20
|
import { KintoneRequestConfigBuilder } from "./KintoneRequestConfigBuilder";
|
|
20
21
|
import { KintoneResponseHandler } from "./KintoneResponseHandler";
|
|
@@ -64,6 +65,7 @@ var KintoneRestAPIClient = /** @class */ (function () {
|
|
|
64
65
|
this.space = new SpaceClient(httpClient, guestSpaceId);
|
|
65
66
|
this.file = new FileClient(httpClient, guestSpaceId);
|
|
66
67
|
this.plugin = new PluginClient(httpClient);
|
|
68
|
+
this.search_ = new SearchClient(httpClient, guestSpaceId);
|
|
67
69
|
}
|
|
68
70
|
Object.defineProperty(KintoneRestAPIClient, "version", {
|
|
69
71
|
get: function () {
|
|
@@ -75,6 +77,9 @@ var KintoneRestAPIClient = /** @class */ (function () {
|
|
|
75
77
|
KintoneRestAPIClient.prototype.getBaseUrl = function () {
|
|
76
78
|
return this.baseUrl;
|
|
77
79
|
};
|
|
80
|
+
KintoneRestAPIClient.prototype.search = function (params) {
|
|
81
|
+
return this.search_.search(params);
|
|
82
|
+
};
|
|
78
83
|
KintoneRestAPIClient.prototype.bulkRequest = function (params) {
|
|
79
84
|
return this.bulkRequest_.send(params);
|
|
80
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KintoneR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AG,UAAC,YAAqC;IACjE,IAAI,YAAY,KAAK,EAAE,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,qCAA8B,YAAY,MAAG,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC;AAEF,IAAM,qBAAqB,GAAG,UAC5B,aAAgD;IAEhD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IAED,IAAM,MAAM,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
+
t[p] = s[p];
|
|
31
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
+
t[p[i]] = s[p[i]];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
};
|
|
38
|
+
import { BaseClient } from "./BaseClient";
|
|
39
|
+
var SearchClient = /** @class */ (function (_super) {
|
|
40
|
+
__extends(SearchClient, _super);
|
|
41
|
+
function SearchClient() {
|
|
42
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
43
|
+
}
|
|
44
|
+
SearchClient.prototype.search = function (params) {
|
|
45
|
+
var path = this.buildPathWithGuestSpaceId({
|
|
46
|
+
endpointName: "search",
|
|
47
|
+
});
|
|
48
|
+
var createdAfter = params.createdAfter, createdBefore = params.createdBefore, rest = __rest(params, ["createdAfter", "createdBefore"]);
|
|
49
|
+
return this.client.post(path, __assign(__assign(__assign({}, rest), (createdAfter !== undefined && {
|
|
50
|
+
createdAfter: createdAfter instanceof Date
|
|
51
|
+
? createdAfter.toISOString()
|
|
52
|
+
: createdAfter,
|
|
53
|
+
})), (createdBefore !== undefined && {
|
|
54
|
+
createdBefore: createdBefore instanceof Date
|
|
55
|
+
? createdBefore.toISOString()
|
|
56
|
+
: createdBefore,
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
return SearchClient;
|
|
60
|
+
}(BaseClient));
|
|
61
|
+
export { SearchClient };
|
|
62
|
+
//# sourceMappingURL=SearchClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchClient.js","sourceRoot":"","sources":["../../../src/client/SearchClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;IAAkC,gCAAU;IAA5C;;IAsBA,CAAC;IArBQ,6BAAM,GAAb,UAAc,MAAqB;QACjC,IAAM,IAAI,GAAG,IAAI,CAAC,yBAAyB,CAAC;YAC1C,YAAY,EAAE,QAAQ;SACvB,CAAC,CAAC;QACK,IAAA,YAAY,GAA6B,MAAM,aAAnC,EAAE,aAAa,GAAc,MAAM,cAApB,EAAK,IAAI,UAAK,MAAM,EAAjD,iCAAwC,CAAF,CAAY;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,iCACvB,IAAI,GACJ,CAAC,YAAY,KAAK,SAAS,IAAI;YAChC,YAAY,EACV,YAAY,YAAY,IAAI;gBAC1B,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE;gBAC5B,CAAC,CAAC,YAAY;SACnB,CAAC,GACC,CAAC,aAAa,KAAK,SAAS,IAAI;YACjC,aAAa,EACX,aAAa,YAAY,IAAI;gBAC3B,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE;gBAC7B,CAAC,CAAC,aAAa;SACpB,CAAC,EACF,CAAC;IACL,CAAC;IACH,mBAAC;AAAD,CAAC,AAtBD,CAAkC,UAAU,GAsB3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/types/index.ts"],"names":[],"mappings":"AASA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/types/index.ts"],"names":[],"mappings":"AASA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export type SearchHitType = "RECORD" | "RECORD_COMMENT" | "SPACE" | "THREAD" | "THREAD_COMMENT" | "PEOPLE_COMMENT" | "MESSAGE_COMMENT" | "ATTACHMENT";
|
|
2
|
+
export type SearchAttachmentTarget = "RECORD" | "SPACE" | "THREAD" | "THREAD_COMMENT" | "PEOPLE_COMMENT" | "MESSAGE_COMMENT";
|
|
3
|
+
export type SearchScopeType = "SPACE" | "APP" | "PEOPLE" | "MESSAGE";
|
|
4
|
+
export type SearchSortBy = "RELEVANCE" | "CREATED_AT";
|
|
5
|
+
export type SearchSortOrder = "ASC" | "DESC";
|
|
6
|
+
/**
|
|
7
|
+
* A single search condition. `query` is AND-joined as a whole, while each
|
|
8
|
+
* entry's `operator` describes how its `keywords` are matched. If no entry
|
|
9
|
+
* has `operator` set to `AND` or `OR`, the API returns an empty result set.
|
|
10
|
+
*/
|
|
11
|
+
export type SearchQuery = {
|
|
12
|
+
operator: "AND" | "OR" | "NOT";
|
|
13
|
+
keywords: string[];
|
|
14
|
+
};
|
|
15
|
+
type AppID = number | string;
|
|
16
|
+
type SpaceID = number | string;
|
|
17
|
+
export type SearchScope = {
|
|
18
|
+
scope: "SPACE";
|
|
19
|
+
ids?: SpaceID[] | null;
|
|
20
|
+
} | {
|
|
21
|
+
scope: "APP";
|
|
22
|
+
ids?: AppID[] | null;
|
|
23
|
+
} | {
|
|
24
|
+
scope: "PEOPLE";
|
|
25
|
+
codes?: string[] | null;
|
|
26
|
+
} | {
|
|
27
|
+
scope: "MESSAGE";
|
|
28
|
+
codes?: string[] | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Sort condition. Defaults to `{ by: "RELEVANCE", order: "DESC" }`.
|
|
32
|
+
* The combination `{ by: "RELEVANCE", order: "ASC" }` is rejected by the
|
|
33
|
+
* API, so the union forbids it at the type level: when `by` is omitted or
|
|
34
|
+
* `"RELEVANCE"`, only `order: "DESC"` is allowed.
|
|
35
|
+
*/
|
|
36
|
+
export type SearchSort = {
|
|
37
|
+
by?: "RELEVANCE";
|
|
38
|
+
order?: "DESC";
|
|
39
|
+
} | {
|
|
40
|
+
by: "CREATED_AT";
|
|
41
|
+
order?: SearchSortOrder;
|
|
42
|
+
};
|
|
43
|
+
export type SearchRequest = {
|
|
44
|
+
/**
|
|
45
|
+
* One or more search conditions. The non-empty tuple type reflects the
|
|
46
|
+
* API's requirement that `query` itself must be present and non-empty
|
|
47
|
+
* (a CB_VA01 error otherwise). Note that the "no AND/OR ⇒ empty result"
|
|
48
|
+
* relaxation only applies once `query` has at least one entry.
|
|
49
|
+
*/
|
|
50
|
+
query: [SearchQuery, ...SearchQuery[]];
|
|
51
|
+
types?: SearchHitType[] | null;
|
|
52
|
+
scopes?: SearchScope[] | null;
|
|
53
|
+
excludeScopes?: SearchScope[] | null;
|
|
54
|
+
createdAfter?: string | Date;
|
|
55
|
+
createdBefore?: string | Date;
|
|
56
|
+
creators?: string[] | null;
|
|
57
|
+
sort?: SearchSort;
|
|
58
|
+
limit?: number | string;
|
|
59
|
+
pageToken?: string | null;
|
|
60
|
+
};
|
|
61
|
+
export type SearchUser = {
|
|
62
|
+
code: string;
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
type SearchHitBase = {
|
|
66
|
+
url: string;
|
|
67
|
+
snippets: string[];
|
|
68
|
+
};
|
|
69
|
+
export type SearchHitRecord = {
|
|
70
|
+
appId: string;
|
|
71
|
+
appName: string;
|
|
72
|
+
recordId: string;
|
|
73
|
+
recordTitle: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
creator: SearchUser;
|
|
76
|
+
matchedFields: Array<{
|
|
77
|
+
code: string;
|
|
78
|
+
label: string;
|
|
79
|
+
}>;
|
|
80
|
+
spaceId?: string;
|
|
81
|
+
spaceName?: string;
|
|
82
|
+
};
|
|
83
|
+
export type SearchHitRecordComment = {
|
|
84
|
+
appId: string;
|
|
85
|
+
appName: string;
|
|
86
|
+
recordId: string;
|
|
87
|
+
recordTitle: string;
|
|
88
|
+
commentId: string;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
creator: SearchUser;
|
|
91
|
+
spaceId?: string;
|
|
92
|
+
spaceName?: string;
|
|
93
|
+
};
|
|
94
|
+
export type SearchHitSpace = {
|
|
95
|
+
spaceId: string;
|
|
96
|
+
spaceName: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
creator: SearchUser;
|
|
99
|
+
};
|
|
100
|
+
export type SearchHitThread = {
|
|
101
|
+
spaceId: string;
|
|
102
|
+
spaceName: string;
|
|
103
|
+
threadId: string;
|
|
104
|
+
threadName: string;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
creator: SearchUser;
|
|
107
|
+
};
|
|
108
|
+
export type SearchHitThreadComment = {
|
|
109
|
+
commentId: string;
|
|
110
|
+
replyId?: string;
|
|
111
|
+
spaceId: string;
|
|
112
|
+
spaceName: string;
|
|
113
|
+
threadId: string;
|
|
114
|
+
threadName: string;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
creator: SearchUser;
|
|
117
|
+
};
|
|
118
|
+
export type SearchHitPeopleComment = {
|
|
119
|
+
commentId: string;
|
|
120
|
+
replyId?: string;
|
|
121
|
+
owner: SearchUser;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
creator: SearchUser;
|
|
124
|
+
};
|
|
125
|
+
export type SearchHitMessageComment = {
|
|
126
|
+
commentId: string;
|
|
127
|
+
recipient: SearchUser;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
creator: SearchUser;
|
|
130
|
+
};
|
|
131
|
+
export type SearchHitAttachment = {
|
|
132
|
+
attachedTo: SearchAttachmentTarget;
|
|
133
|
+
fileKey: string;
|
|
134
|
+
name: string;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
creator: SearchUser;
|
|
137
|
+
};
|
|
138
|
+
export type SearchHit = (SearchHitBase & {
|
|
139
|
+
type: "RECORD";
|
|
140
|
+
record: SearchHitRecord;
|
|
141
|
+
}) | (SearchHitBase & {
|
|
142
|
+
type: "RECORD_COMMENT";
|
|
143
|
+
recordComment: SearchHitRecordComment;
|
|
144
|
+
}) | (SearchHitBase & {
|
|
145
|
+
type: "SPACE";
|
|
146
|
+
space: SearchHitSpace;
|
|
147
|
+
}) | (SearchHitBase & {
|
|
148
|
+
type: "THREAD";
|
|
149
|
+
thread: SearchHitThread;
|
|
150
|
+
}) | (SearchHitBase & {
|
|
151
|
+
type: "THREAD_COMMENT";
|
|
152
|
+
threadComment: SearchHitThreadComment;
|
|
153
|
+
}) | (SearchHitBase & {
|
|
154
|
+
type: "PEOPLE_COMMENT";
|
|
155
|
+
peopleComment: SearchHitPeopleComment;
|
|
156
|
+
}) | (SearchHitBase & {
|
|
157
|
+
type: "MESSAGE_COMMENT";
|
|
158
|
+
messageComment: SearchHitMessageComment;
|
|
159
|
+
}) | (SearchHitBase & {
|
|
160
|
+
type: "ATTACHMENT";
|
|
161
|
+
attachment: SearchHitAttachment & {
|
|
162
|
+
attachedTo: "RECORD";
|
|
163
|
+
};
|
|
164
|
+
record: SearchHitRecord;
|
|
165
|
+
}) | (SearchHitBase & {
|
|
166
|
+
type: "ATTACHMENT";
|
|
167
|
+
attachment: SearchHitAttachment & {
|
|
168
|
+
attachedTo: "SPACE";
|
|
169
|
+
};
|
|
170
|
+
space: SearchHitSpace;
|
|
171
|
+
}) | (SearchHitBase & {
|
|
172
|
+
type: "ATTACHMENT";
|
|
173
|
+
attachment: SearchHitAttachment & {
|
|
174
|
+
attachedTo: "THREAD";
|
|
175
|
+
};
|
|
176
|
+
thread: SearchHitThread;
|
|
177
|
+
}) | (SearchHitBase & {
|
|
178
|
+
type: "ATTACHMENT";
|
|
179
|
+
attachment: SearchHitAttachment & {
|
|
180
|
+
attachedTo: "THREAD_COMMENT";
|
|
181
|
+
};
|
|
182
|
+
threadComment: SearchHitThreadComment;
|
|
183
|
+
}) | (SearchHitBase & {
|
|
184
|
+
type: "ATTACHMENT";
|
|
185
|
+
attachment: SearchHitAttachment & {
|
|
186
|
+
attachedTo: "PEOPLE_COMMENT";
|
|
187
|
+
};
|
|
188
|
+
peopleComment: SearchHitPeopleComment;
|
|
189
|
+
}) | (SearchHitBase & {
|
|
190
|
+
type: "ATTACHMENT";
|
|
191
|
+
attachment: SearchHitAttachment & {
|
|
192
|
+
attachedTo: "MESSAGE_COMMENT";
|
|
193
|
+
};
|
|
194
|
+
messageComment: SearchHitMessageComment;
|
|
195
|
+
});
|
|
196
|
+
export type SearchResponse = {
|
|
197
|
+
hits: SearchHit[];
|
|
198
|
+
nextPageToken: string | null;
|
|
199
|
+
};
|
|
200
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/client/types/search/index.ts"],"names":[],"mappings":""}
|