@getclarify/nodejs-sdk 0.0.4 → 0.0.6
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 +24 -24
- package/dist/cjs/client.d.ts +8 -3
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +10 -3
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/http/http-client.d.ts.map +1 -1
- package/dist/cjs/http/http-client.js +3 -1
- package/dist/cjs/http/http-client.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/json-api/link.js.map +1 -1
- package/dist/cjs/resources/comments.d.ts +83 -0
- package/dist/cjs/resources/comments.d.ts.map +1 -0
- package/dist/cjs/resources/comments.js +75 -0
- package/dist/cjs/resources/comments.js.map +1 -0
- package/dist/cjs/resources/records.d.ts +17 -3
- package/dist/cjs/resources/records.d.ts.map +1 -1
- package/dist/cjs/resources/records.js +22 -2
- package/dist/cjs/resources/records.js.map +1 -1
- package/dist/cjs/resources/relationships.d.ts +80 -0
- package/dist/cjs/resources/relationships.d.ts.map +1 -0
- package/dist/cjs/resources/relationships.js +77 -0
- package/dist/cjs/resources/relationships.js.map +1 -0
- package/dist/cjs/resources/resources.d.ts.map +1 -1
- package/dist/cjs/resources/resources.js.map +1 -1
- package/dist/cjs/types/common.d.ts +13 -0
- package/dist/cjs/types/common.d.ts.map +1 -1
- package/dist/cjs/types/config.d.ts +2 -2
- package/dist/cjs/types/config.d.ts.map +1 -1
- package/dist/cjs/types/config.js +1 -1
- package/dist/cjs/types/config.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/esm/client.d.ts +8 -3
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +10 -3
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/http/http-client.d.ts.map +1 -1
- package/dist/esm/http/http-client.js +3 -1
- package/dist/esm/http/http-client.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/json-api/link.js.map +1 -1
- package/dist/esm/resources/comments.d.ts +83 -0
- package/dist/esm/resources/comments.d.ts.map +1 -0
- package/dist/esm/resources/comments.js +75 -0
- package/dist/esm/resources/comments.js.map +1 -0
- package/dist/esm/resources/records.d.ts +17 -3
- package/dist/esm/resources/records.d.ts.map +1 -1
- package/dist/esm/resources/records.js +22 -2
- package/dist/esm/resources/records.js.map +1 -1
- package/dist/esm/resources/relationships.d.ts +80 -0
- package/dist/esm/resources/relationships.d.ts.map +1 -0
- package/dist/esm/resources/relationships.js +77 -0
- package/dist/esm/resources/relationships.js.map +1 -0
- package/dist/esm/resources/resources.d.ts.map +1 -1
- package/dist/esm/resources/resources.js.map +1 -1
- package/dist/esm/types/common.d.ts +13 -0
- package/dist/esm/types/common.d.ts.map +1 -1
- package/dist/esm/types/config.d.ts +2 -2
- package/dist/esm/types/config.d.ts.map +1 -1
- package/dist/esm/types/config.js +1 -1
- package/dist/esm/types/config.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/types/client.d.ts +8 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/http/http-client.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/comments.d.ts +83 -0
- package/dist/types/resources/comments.d.ts.map +1 -0
- package/dist/types/resources/records.d.ts +17 -3
- package/dist/types/resources/records.d.ts.map +1 -1
- package/dist/types/resources/relationships.d.ts +80 -0
- package/dist/types/resources/relationships.d.ts.map +1 -0
- package/dist/types/resources/resources.d.ts.map +1 -1
- package/dist/types/types/common.d.ts +13 -0
- package/dist/types/types/common.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +2 -2
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +34 -38
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommentsResource = void 0;
|
|
4
|
+
const base_resource_js_1 = require("./base-resource.js");
|
|
5
|
+
/**
|
|
6
|
+
* Manages CRUD operations for comments on records.
|
|
7
|
+
*
|
|
8
|
+
* There is no bulk comment endpoint; to comment on many records, loop `create`
|
|
9
|
+
* inside a single `execute-code` script so the work stays in the runtime.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* await clarify.comments.create({
|
|
14
|
+
* entity: 'deal',
|
|
15
|
+
* ownerId: 'deal-123',
|
|
16
|
+
* message: [
|
|
17
|
+
* { type: 'paragraph', content: [{ type: 'text', text: 'Following up.' }] },
|
|
18
|
+
* ],
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
class CommentsResource extends base_resource_js_1.BaseResource {
|
|
23
|
+
constructor(httpClient, config) {
|
|
24
|
+
super(httpClient, config);
|
|
25
|
+
}
|
|
26
|
+
get commentsPath() {
|
|
27
|
+
return `${this.basePath}/comments`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates a comment on a record.
|
|
31
|
+
*/
|
|
32
|
+
async create(params) {
|
|
33
|
+
return this.httpClient.request({
|
|
34
|
+
method: 'POST',
|
|
35
|
+
path: this.commentsPath,
|
|
36
|
+
body: {
|
|
37
|
+
entity: params.entity,
|
|
38
|
+
owner_id: params.ownerId,
|
|
39
|
+
message: params.message,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves a single comment by ID.
|
|
45
|
+
*/
|
|
46
|
+
async get(id) {
|
|
47
|
+
return this.httpClient.request({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
path: `${this.commentsPath}/${id}`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Updates a comment's body.
|
|
54
|
+
*/
|
|
55
|
+
async update(id, params) {
|
|
56
|
+
return this.httpClient.request({
|
|
57
|
+
method: 'PATCH',
|
|
58
|
+
path: `${this.commentsPath}/${id}`,
|
|
59
|
+
body: {
|
|
60
|
+
message: params.message,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Deletes a comment by ID.
|
|
66
|
+
*/
|
|
67
|
+
async delete(id) {
|
|
68
|
+
await this.httpClient.request({
|
|
69
|
+
method: 'DELETE',
|
|
70
|
+
path: `${this.commentsPath}/${id}`,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.CommentsResource = CommentsResource;
|
|
75
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/resources/comments.ts"],"names":[],"mappings":";;;AAEA,yDAAkD;AAgDlD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,gBAAiB,SAAQ,+BAAY;IAChD,YAAY,UAAsB,EAAE,MAAsB;QACxD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,IAAY,YAAY;QACtB,OAAO,GAAG,IAAI,CAAC,QAAQ,WAAW,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAU;YACtC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,YAAY;YACvB,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,OAAO;gBACxB,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAU;YACtC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAA2B;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAU;YACtC,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE;YAClC,IAAI,EAAE;gBACJ,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAwB;YACnD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;CACF;AAxDD,4CAwDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from '../http/http-client.js';
|
|
2
|
-
import type { GetRecordOptions, ListResponse, ResolvedConfig, ResourceCreate, ResourceUpdate, SingleResponse, UpdateRecordOptions } from '../types/index.js';
|
|
2
|
+
import type { CreateRecordOptions, GetRecordOptions, ListResponse, ResolvedConfig, ResourceCreate, ResourceUpdate, SingleResponse, UpdateRecordOptions } from '../types/index.js';
|
|
3
3
|
import { BaseResource } from './base-resource.js';
|
|
4
4
|
/**
|
|
5
5
|
* Manages CRUD operations for records.
|
|
@@ -35,6 +35,7 @@ export declare class RecordsResource extends BaseResource {
|
|
|
35
35
|
*
|
|
36
36
|
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
37
37
|
* @param attributes - The record attributes to create
|
|
38
|
+
* @param options - Optional create options including `matchOn` for upsert
|
|
38
39
|
* @returns The created record wrapped in a JSON:API response
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
@@ -44,14 +45,21 @@ export declare class RecordsResource extends BaseResource {
|
|
|
44
45
|
* website: 'https://acme.com'
|
|
45
46
|
* });
|
|
46
47
|
* console.log(response.data.id);
|
|
48
|
+
*
|
|
49
|
+
* // Upsert by a unique field instead of always creating
|
|
50
|
+
* await client.records.create('person',
|
|
51
|
+
* { email: 'jane@acme.com', name: 'Jane Doe' },
|
|
52
|
+
* { matchOn: 'email' },
|
|
53
|
+
* );
|
|
47
54
|
* ```
|
|
48
55
|
*/
|
|
49
|
-
create<T = Record<string, unknown>>(entity: string, attributes: T): Promise<SingleResponse<T>>;
|
|
56
|
+
create<T = Record<string, unknown>>(entity: string, attributes: T, options?: CreateRecordOptions): Promise<SingleResponse<T>>;
|
|
50
57
|
/**
|
|
51
58
|
* Creates multiple records in bulk.
|
|
52
59
|
*
|
|
53
60
|
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
54
61
|
* @param records - Array of record create objects with type and attributes
|
|
62
|
+
* @param options - Optional create options including `matchOn` for upsert
|
|
55
63
|
* @returns The created records wrapped in a JSON:API list response
|
|
56
64
|
*
|
|
57
65
|
* @example
|
|
@@ -61,9 +69,15 @@ export declare class RecordsResource extends BaseResource {
|
|
|
61
69
|
* { type: 'company', attributes: { name: 'Widget Inc' } }
|
|
62
70
|
* ]);
|
|
63
71
|
* console.log(response.data.length);
|
|
72
|
+
*
|
|
73
|
+
* // Upsert a batch by a unique field
|
|
74
|
+
* await client.records.createBulk('person', [
|
|
75
|
+
* { type: 'person', attributes: { email: 'jane@acme.com', name: 'Jane' } },
|
|
76
|
+
* { type: 'person', attributes: { email: 'joe@acme.com', name: 'Joe' } },
|
|
77
|
+
* ], { matchOn: 'email' });
|
|
64
78
|
* ```
|
|
65
79
|
*/
|
|
66
|
-
createBulk<T = Record<string, unknown>>(entity: string, records: ResourceCreate<T>[]): Promise<ListResponse<T>>;
|
|
80
|
+
createBulk<T = Record<string, unknown>>(entity: string, records: ResourceCreate<T>[], options?: CreateRecordOptions): Promise<ListResponse<T>>;
|
|
67
81
|
/**
|
|
68
82
|
* Updates a single record.
|
|
69
83
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/resources/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAGV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAI1D;;OAEG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;;;;;;;;OAkBG;IACG,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAc7B
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/resources/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAGV,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,mBAAmB,CAAC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,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,EAC5B,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAmB3B;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvD;;;;;;;;;;OAUG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAS/D"}
|
|
@@ -50,6 +50,7 @@ class RecordsResource extends base_resource_js_1.BaseResource {
|
|
|
50
50
|
*
|
|
51
51
|
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
52
52
|
* @param attributes - The record attributes to create
|
|
53
|
+
* @param options - Optional create options including `matchOn` for upsert
|
|
53
54
|
* @returns The created record wrapped in a JSON:API response
|
|
54
55
|
*
|
|
55
56
|
* @example
|
|
@@ -59,15 +60,24 @@ class RecordsResource extends base_resource_js_1.BaseResource {
|
|
|
59
60
|
* website: 'https://acme.com'
|
|
60
61
|
* });
|
|
61
62
|
* console.log(response.data.id);
|
|
63
|
+
*
|
|
64
|
+
* // Upsert by a unique field instead of always creating
|
|
65
|
+
* await client.records.create('person',
|
|
66
|
+
* { email: 'jane@acme.com', name: 'Jane Doe' },
|
|
67
|
+
* { matchOn: 'email' },
|
|
68
|
+
* );
|
|
62
69
|
* ```
|
|
63
70
|
*/
|
|
64
|
-
async create(entity, attributes) {
|
|
71
|
+
async create(entity, attributes, options) {
|
|
65
72
|
const body = {
|
|
66
73
|
data: {
|
|
67
74
|
type: entity,
|
|
68
75
|
attributes,
|
|
69
76
|
},
|
|
70
77
|
};
|
|
78
|
+
if (options?.matchOn) {
|
|
79
|
+
body.match_on = options.matchOn;
|
|
80
|
+
}
|
|
71
81
|
return this.httpClient.request({
|
|
72
82
|
method: 'POST',
|
|
73
83
|
path: this.getEntityPath(entity),
|
|
@@ -79,6 +89,7 @@ class RecordsResource extends base_resource_js_1.BaseResource {
|
|
|
79
89
|
*
|
|
80
90
|
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
81
91
|
* @param records - Array of record create objects with type and attributes
|
|
92
|
+
* @param options - Optional create options including `matchOn` for upsert
|
|
82
93
|
* @returns The created records wrapped in a JSON:API list response
|
|
83
94
|
*
|
|
84
95
|
* @example
|
|
@@ -88,12 +99,21 @@ class RecordsResource extends base_resource_js_1.BaseResource {
|
|
|
88
99
|
* { type: 'company', attributes: { name: 'Widget Inc' } }
|
|
89
100
|
* ]);
|
|
90
101
|
* console.log(response.data.length);
|
|
102
|
+
*
|
|
103
|
+
* // Upsert a batch by a unique field
|
|
104
|
+
* await client.records.createBulk('person', [
|
|
105
|
+
* { type: 'person', attributes: { email: 'jane@acme.com', name: 'Jane' } },
|
|
106
|
+
* { type: 'person', attributes: { email: 'joe@acme.com', name: 'Joe' } },
|
|
107
|
+
* ], { matchOn: 'email' });
|
|
91
108
|
* ```
|
|
92
109
|
*/
|
|
93
|
-
async createBulk(entity, records) {
|
|
110
|
+
async createBulk(entity, records, options) {
|
|
94
111
|
const body = {
|
|
95
112
|
data: records,
|
|
96
113
|
};
|
|
114
|
+
if (options?.matchOn) {
|
|
115
|
+
body.match_on = options.matchOn;
|
|
116
|
+
}
|
|
97
117
|
return this.httpClient.request({
|
|
98
118
|
method: 'POST',
|
|
99
119
|
path: `${this.getEntityPath(entity)}/bulk`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../src/resources/records.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../src/resources/records.ts"],"names":[],"mappings":";;;AAaA,yDAAkD;AAElD;;GAEG;AACH,MAAa,eAAgB,SAA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AM,EAAE,OAAO;YACf,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;YAChC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,EAAU;QACrC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAwB;YACnD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,GAAa;QAC5C,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAwB;YACnD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;YAChC,IAAI,EAAE;gBACJ,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAzQD,0CAyQC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { HttpClient } from '../http/http-client.js';
|
|
2
|
+
import type { ListResponse, ResolvedConfig } from '../types/index.js';
|
|
3
|
+
import { BaseResource } from './base-resource.js';
|
|
4
|
+
/**
|
|
5
|
+
* Common anchor for a relationship operation: the record whose relationship is
|
|
6
|
+
* being read or written.
|
|
7
|
+
*/
|
|
8
|
+
interface RelationshipAnchor {
|
|
9
|
+
/** The anchor record's object type, e.g. 'company'. */
|
|
10
|
+
entity: string;
|
|
11
|
+
/** The anchor record's ID. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** The relationship field name, e.g. 'contacts'. */
|
|
14
|
+
relationship: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parameters for listing the records linked through a relationship.
|
|
18
|
+
*/
|
|
19
|
+
export interface RelationshipListParams extends RelationshipAnchor {
|
|
20
|
+
/** Nested relationship paths to resolve, relative to the parent record. */
|
|
21
|
+
include?: string[];
|
|
22
|
+
/** Pagination options using offset/limit. */
|
|
23
|
+
page?: {
|
|
24
|
+
offset?: number;
|
|
25
|
+
limit?: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parameters for replacing or unlinking related records.
|
|
30
|
+
*
|
|
31
|
+
* `related` ids may be `null` only to clear a to-one relationship.
|
|
32
|
+
*/
|
|
33
|
+
export interface RelationshipWriteParams extends RelationshipAnchor {
|
|
34
|
+
/** The related records to link/unlink. */
|
|
35
|
+
related: Array<{
|
|
36
|
+
type: string;
|
|
37
|
+
id: string | null;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Manages the records linked to a record through a relationship field.
|
|
42
|
+
*
|
|
43
|
+
* The public API exposes replace and unlink only. `replace` sets the full set
|
|
44
|
+
* of links (unlisted links are removed; it is not additive), and `unlink`
|
|
45
|
+
* removes the listed links. There is no additive-link method.
|
|
46
|
+
*
|
|
47
|
+
* To create records and link them, `records.createBulk` the records, then
|
|
48
|
+
* `relationships.replace` each anchor's links from inside one `execute-code`
|
|
49
|
+
* script so the loop stays in the runtime.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* await clarify.relationships.replace({
|
|
54
|
+
* entity: 'company',
|
|
55
|
+
* id: 'company-123',
|
|
56
|
+
* relationship: 'contacts',
|
|
57
|
+
* related: [{ type: 'person', id: 'person-1' }],
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare class RelationshipsResource extends BaseResource {
|
|
62
|
+
constructor(httpClient: HttpClient, config: ResolvedConfig);
|
|
63
|
+
private getRelationshipPath;
|
|
64
|
+
/**
|
|
65
|
+
* Lists the records linked to a record through the given relationship.
|
|
66
|
+
*/
|
|
67
|
+
list<T = Record<string, unknown>>(params: RelationshipListParams): Promise<ListResponse<T>>;
|
|
68
|
+
/**
|
|
69
|
+
* Replaces the full set of records linked through the relationship. Links not
|
|
70
|
+
* listed in `related` are removed; this is not additive.
|
|
71
|
+
*/
|
|
72
|
+
replace(params: RelationshipWriteParams): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Removes the listed records from the relationship. The records themselves
|
|
75
|
+
* are not deleted.
|
|
76
|
+
*/
|
|
77
|
+
unlink(params: RelationshipWriteParams): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=relationships.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/resources/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,UAAU,kBAAkB;IAC1B,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,0CAA0C;IAC1C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAI1D,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAsB3B;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7D;;;OAGG;IACG,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAO7D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationshipsResource = void 0;
|
|
4
|
+
const base_resource_js_1 = require("./base-resource.js");
|
|
5
|
+
/**
|
|
6
|
+
* Manages the records linked to a record through a relationship field.
|
|
7
|
+
*
|
|
8
|
+
* The public API exposes replace and unlink only. `replace` sets the full set
|
|
9
|
+
* of links (unlisted links are removed; it is not additive), and `unlink`
|
|
10
|
+
* removes the listed links. There is no additive-link method.
|
|
11
|
+
*
|
|
12
|
+
* To create records and link them, `records.createBulk` the records, then
|
|
13
|
+
* `relationships.replace` each anchor's links from inside one `execute-code`
|
|
14
|
+
* script so the loop stays in the runtime.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* await clarify.relationships.replace({
|
|
19
|
+
* entity: 'company',
|
|
20
|
+
* id: 'company-123',
|
|
21
|
+
* relationship: 'contacts',
|
|
22
|
+
* related: [{ type: 'person', id: 'person-1' }],
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
class RelationshipsResource extends base_resource_js_1.BaseResource {
|
|
27
|
+
constructor(httpClient, config) {
|
|
28
|
+
super(httpClient, config);
|
|
29
|
+
}
|
|
30
|
+
getRelationshipPath(anchor) {
|
|
31
|
+
return `${this.basePath}/objects/${anchor.entity}/records/${anchor.id}/relationships/${anchor.relationship}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Lists the records linked to a record through the given relationship.
|
|
35
|
+
*/
|
|
36
|
+
async list(params) {
|
|
37
|
+
const query = {};
|
|
38
|
+
if (params.include && params.include.length > 0) {
|
|
39
|
+
query.include = params.include.join(',');
|
|
40
|
+
}
|
|
41
|
+
if (params.page?.offset !== undefined) {
|
|
42
|
+
query['page[offset]'] = params.page.offset;
|
|
43
|
+
}
|
|
44
|
+
if (params.page?.limit !== undefined) {
|
|
45
|
+
query['page[limit]'] = params.page.limit;
|
|
46
|
+
}
|
|
47
|
+
return this.httpClient.request({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
path: this.getRelationshipPath(params),
|
|
50
|
+
query,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Replaces the full set of records linked through the relationship. Links not
|
|
55
|
+
* listed in `related` are removed; this is not additive.
|
|
56
|
+
*/
|
|
57
|
+
async replace(params) {
|
|
58
|
+
await this.httpClient.request({
|
|
59
|
+
method: 'PATCH',
|
|
60
|
+
path: this.getRelationshipPath(params),
|
|
61
|
+
body: { data: params.related },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Removes the listed records from the relationship. The records themselves
|
|
66
|
+
* are not deleted.
|
|
67
|
+
*/
|
|
68
|
+
async unlink(params) {
|
|
69
|
+
await this.httpClient.request({
|
|
70
|
+
method: 'DELETE',
|
|
71
|
+
path: this.getRelationshipPath(params),
|
|
72
|
+
body: { data: params.related },
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.RelationshipsResource = RelationshipsResource;
|
|
77
|
+
//# sourceMappingURL=relationships.js.map
|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C,MAA+B;QAC3C,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAwB;YACnD,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,MAA+B;QAC1C,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAwB;YACnD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;CACF;AA3DD,sDA2DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/resources/resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/resources/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC;IACd,aAAa,EAAE,MAAM,CACnB,MAAM,EACN;QAAE,IAAI,EAAE,cAAc,GAAG,cAAc,EAAE,GAAG,IAAI,CAAA;KAAE,CACnD,CAAC;CACH;AAED;;GAEG;AACH,MAA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CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAkBrC;;;;;;;OAOG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAS1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/resources/resources.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/resources/resources.ts"],"names":[],"mappings":";;;AACA,iDAAwE;AAOxE,yDAAkD;AA8HlD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,iBAAkB,SAAQ,+BAAY;IACjD,YAAY,UAAsB,EAAE,MAAsB;QACxD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEO,aAAa,CAAC,IAAY;QAChC,OAAO,GAAG,IAAI,CAAC,QAAQ,YAAY,IAAI,YAAY,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,GAAG,CACP,MAAyB;QAEzB,MAAM,KAAK,GAAuC,EAAE,CAAC;QAErD,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChD,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAkB;YACzD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,EAAE,EAAE;YACvD,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,IAAA,qBAAW,EAAC,GAAG,CAAyC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;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|
|
89
89
|
filter?: FilterOptions;
|
|
90
90
|
sort?: SortOptions | SortOptions[];
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Options for creating records, including upsert-by-unique-field.
|
|
94
|
+
*/
|
|
95
|
+
export interface CreateRecordOptions {
|
|
96
|
+
/**
|
|
97
|
+
* Name of a unique field to upsert on. When a create matches an existing
|
|
98
|
+
* record on this field, the record is updated instead of duplicated. Maps to
|
|
99
|
+
* the API's `match_on` body field.
|
|
100
|
+
*/
|
|
101
|
+
matchOn?: string;
|
|
102
|
+
}
|
|
92
103
|
/**
|
|
93
104
|
* Request body for creating a single resource.
|
|
94
105
|
*/
|
|
95
106
|
export interface CreateBody<T = Record<string, unknown>> {
|
|
96
107
|
data: ResourceCreate<T>;
|
|
108
|
+
match_on?: string;
|
|
97
109
|
}
|
|
98
110
|
/**
|
|
99
111
|
* Request body for updating a single resource.
|
|
@@ -106,6 +118,7 @@ export interface UpdateBody<T = Record<string, unknown>> {
|
|
|
106
118
|
*/
|
|
107
119
|
export interface BulkCreateBody<T = Record<string, unknown>> {
|
|
108
120
|
data: ResourceCreate<T>[];
|
|
121
|
+
match_on?: string;
|
|
109
122
|
}
|
|
110
123
|
/**
|
|
111
124
|
* Request body for bulk update operations.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MA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M,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B"}
|
|
@@ -8,7 +8,7 @@ export interface ClarifyClientConfig {
|
|
|
8
8
|
apiKey: string;
|
|
9
9
|
/** Workspace slug for API calls */
|
|
10
10
|
workspace: string;
|
|
11
|
-
/** Request timeout in milliseconds (default:
|
|
11
|
+
/** Request timeout in milliseconds (default: 20000) */
|
|
12
12
|
timeout?: number;
|
|
13
13
|
/** Number of retry attempts for failed requests (default: 1) */
|
|
14
14
|
retries?: number;
|
|
@@ -30,7 +30,7 @@ export interface ResolvedConfig {
|
|
|
30
30
|
* Default configuration values.
|
|
31
31
|
*/
|
|
32
32
|
export declare const DEFAULT_CONFIG: {
|
|
33
|
-
readonly timeout:
|
|
33
|
+
readonly timeout: 20000;
|
|
34
34
|
readonly retries: 1;
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAEhB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IAEf,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAElB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAEhB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IAEf,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;CAGjB,CAAC"}
|
package/dist/esm/types/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":";;;AAmCA;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":";;;AAmCA;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { ClarifyClientConfig, ResolvedConfig } from './config.js';
|
|
2
2
|
export { DEFAULT_CONFIG } from './config.js';
|
|
3
|
-
export type { ResourceIdentifier, Resource, ResourceCreate, ResourceUpdate, SingleResponse, ListResponse, PaginationLinks, PaginationMeta, PaginationOptions, FilterOptions, SortOptions, ListOptions, CreateBody, UpdateBody, BulkCreateBody, BulkUpdateBody, BulkDeleteBody, HttpMethod, GetRecordOptions, FieldOperationRules, UpdateRecordOptions, } from './common.js';
|
|
3
|
+
export type { ResourceIdentifier, Resource, ResourceCreate, ResourceUpdate, SingleResponse, ListResponse, PaginationLinks, PaginationMeta, PaginationOptions, FilterOptions, SortOptions, ListOptions, CreateBody, UpdateBody, BulkCreateBody, BulkUpdateBody, BulkDeleteBody, HttpMethod, GetRecordOptions, FieldOperationRules, UpdateRecordOptions, CreateRecordOptions, } from './common.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EACV,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EACV,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { CommentsResource } from './resources/comments.js';
|
|
1
2
|
import { RecordsResource } from './resources/records.js';
|
|
3
|
+
import { RelationshipsResource } from './resources/relationships.js';
|
|
2
4
|
import { ResourcesResource } from './resources/resources.js';
|
|
3
5
|
import type { ClarifyClientConfig } from './types/index.js';
|
|
4
6
|
/**
|
|
@@ -6,7 +8,7 @@ import type { ClarifyClientConfig } from './types/index.js';
|
|
|
6
8
|
*
|
|
7
9
|
* @example
|
|
8
10
|
* ```typescript
|
|
9
|
-
* import { ClarifyClient } from '@
|
|
11
|
+
* import { ClarifyClient } from '@getclarify/nodejs-sdk';
|
|
10
12
|
*
|
|
11
13
|
* const clarify = new ClarifyClient({
|
|
12
14
|
* baseUrl: 'https://api.clarify.ai',
|
|
@@ -29,10 +31,13 @@ export declare class ClarifyClient {
|
|
|
29
31
|
readonly records: RecordsResource;
|
|
30
32
|
/**
|
|
31
33
|
* Resource for querying and creating resources via the `/resources` endpoints.
|
|
32
|
-
* Responses include relationships
|
|
33
|
-
* Use `linkJsonApi` to resolve relationship references into inline objects.
|
|
34
|
+
* Responses include a `relationships` map with fully resolved related records.
|
|
34
35
|
*/
|
|
35
36
|
readonly resources: ResourcesResource;
|
|
37
|
+
/** Resource for creating, reading, updating, and deleting comments. */
|
|
38
|
+
readonly comments: CommentsResource;
|
|
39
|
+
/** Resource for listing, replacing, and unlinking record relationships. */
|
|
40
|
+
readonly relationships: RelationshipsResource;
|
|
36
41
|
private readonly config;
|
|
37
42
|
private readonly httpClient;
|
|
38
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IAEtC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAEpC,2EAA2E;IAC3E,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;IAE9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAavC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../../src/http/http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;gBAE5B,MAAM,EAAE,cAAc;IAIlC;;OAEG;IACG,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAezD;;OAEG;IACH,OAAO,CAAC,QAAQ;IAyBhB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;YACW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../../src/http/http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;gBAE5B,MAAM,EAAE,cAAc;IAIlC;;OAEG;IACG,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAezD;;OAEG;IACH,OAAO,CAAC,QAAQ;IAyBhB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;YACW,gBAAgB;IAmC9B;;OAEG;YACW,cAAc;IAgD5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;YACW,KAAK;CAGpB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { ClarifyClient } from './client.js';
|
|
2
2
|
export { ClarifyError, ClarifyApiError, ClarifyValidationError, ClarifyTimeoutError, ClarifyNetworkError, } from './errors/index.js';
|
|
3
3
|
export type { ApiErrorDetail } from './errors/index.js';
|
|
4
|
-
export type { ClarifyClientConfig, ResourceIdentifier, Resource, ResourceCreate, ResourceUpdate, SingleResponse, ListResponse, PaginationLinks, PaginationMeta, PaginationOptions, FilterOptions, SortOptions, ListOptions, GetRecordOptions, FieldOperationRules, UpdateRecordOptions, } from './types/index.js';
|
|
4
|
+
export type { ClarifyClientConfig, ResourceIdentifier, Resource, ResourceCreate, ResourceUpdate, SingleResponse, ListResponse, PaginationLinks, PaginationMeta, PaginationOptions, FilterOptions, SortOptions, ListOptions, GetRecordOptions, FieldOperationRules, UpdateRecordOptions, CreateRecordOptions, } from './types/index.js';
|
|
5
5
|
export { RecordsResource } from './resources/records.js';
|
|
6
6
|
export { ResourcesResource, type ResourceLinked, type SingleResourceResponse, type ListResourceResponse, type SortDirection, type ResourceGetParams, type ResourceListParams, type ResourceRelationshipInput, type ResourceRelationshipsInput, type ResourceCreateParams, type ResourceDeleteParams, } from './resources/resources.js';
|
|
7
|
+
export { CommentsResource, type RichTextNode, type Comment, type CommentCreateParams, type CommentUpdateParams, } from './resources/comments.js';
|
|
8
|
+
export { RelationshipsResource, type RelationshipListParams, type RelationshipWriteParams, } from './resources/relationships.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,cAAc,EACd,Y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