@getclarify/nodejs-sdk 0.0.1 → 0.0.3
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 +104 -0
- package/dist/cjs/client.d.ts +0 -11
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +0 -13
- 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 +2 -2
- package/dist/cjs/http/http-client.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -4
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/base-resource.js +1 -1
- package/dist/cjs/resources/base-resource.js.map +1 -1
- package/dist/cjs/resources/records.d.ts +65 -90
- package/dist/cjs/resources/records.d.ts.map +1 -1
- package/dist/cjs/resources/records.js +111 -165
- package/dist/cjs/resources/records.js.map +1 -1
- package/dist/cjs/types/common.d.ts +28 -0
- package/dist/cjs/types/common.d.ts.map +1 -1
- package/dist/cjs/types/config.d.ts +4 -4
- package/dist/cjs/types/config.d.ts.map +1 -1
- package/dist/cjs/types/config.js +2 -2
- package/dist/cjs/types/config.js.map +1 -1
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/client.d.ts +0 -11
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +0 -13
- 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 +2 -2
- package/dist/esm/http/http-client.js.map +1 -1
- package/dist/esm/index.d.ts +1 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/base-resource.js +1 -1
- package/dist/esm/resources/base-resource.js.map +1 -1
- package/dist/esm/resources/records.d.ts +65 -90
- package/dist/esm/resources/records.d.ts.map +1 -1
- package/dist/esm/resources/records.js +111 -165
- package/dist/esm/resources/records.js.map +1 -1
- package/dist/esm/types/common.d.ts +28 -0
- package/dist/esm/types/common.d.ts.map +1 -1
- package/dist/esm/types/config.d.ts +4 -4
- package/dist/esm/types/config.d.ts.map +1 -1
- package/dist/esm/types/config.js +2 -2
- package/dist/esm/types/config.js.map +1 -1
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/types/client.d.ts +0 -11
- 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 +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/records.d.ts +65 -90
- package/dist/types/resources/records.d.ts.map +1 -1
- package/dist/types/types/common.d.ts +28 -0
- package/dist/types/types/common.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +4 -4
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +37 -37
- package/dist/cjs/resources/messages.d.ts +0 -105
- package/dist/cjs/resources/messages.d.ts.map +0 -1
- package/dist/cjs/resources/messages.js +0 -166
- package/dist/cjs/resources/messages.js.map +0 -1
- package/dist/cjs/resources/relationships.d.ts +0 -96
- package/dist/cjs/resources/relationships.d.ts.map +0 -1
- package/dist/cjs/resources/relationships.js +0 -157
- package/dist/cjs/resources/relationships.js.map +0 -1
- package/dist/cjs/resources/tasks.d.ts +0 -141
- package/dist/cjs/resources/tasks.d.ts.map +0 -1
- package/dist/cjs/resources/tasks.js +0 -211
- package/dist/cjs/resources/tasks.js.map +0 -1
- package/dist/esm/resources/messages.d.ts +0 -105
- package/dist/esm/resources/messages.d.ts.map +0 -1
- package/dist/esm/resources/messages.js +0 -166
- package/dist/esm/resources/messages.js.map +0 -1
- package/dist/esm/resources/relationships.d.ts +0 -96
- package/dist/esm/resources/relationships.d.ts.map +0 -1
- package/dist/esm/resources/relationships.js +0 -157
- package/dist/esm/resources/relationships.js.map +0 -1
- package/dist/esm/resources/tasks.d.ts +0 -141
- package/dist/esm/resources/tasks.d.ts.map +0 -1
- package/dist/esm/resources/tasks.js +0 -211
- package/dist/esm/resources/tasks.js.map +0 -1
- package/dist/types/resources/messages.d.ts +0 -105
- package/dist/types/resources/messages.d.ts.map +0 -1
- package/dist/types/resources/relationships.d.ts +0 -96
- package/dist/types/resources/relationships.d.ts.map +0 -1
- package/dist/types/resources/tasks.d.ts +0 -141
- package/dist/types/resources/tasks.d.ts.map +0 -1
|
@@ -1,157 +1,132 @@
|
|
|
1
1
|
import type { HttpClient } from '../http/http-client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GetRecordOptions, ListResponse, ResolvedConfig, ResourceCreate, ResourceUpdate, SingleResponse, UpdateRecordOptions } from '../types/index.js';
|
|
3
3
|
import { BaseResource } from './base-resource.js';
|
|
4
|
-
import { RelationshipsResource } from './relationships.js';
|
|
5
4
|
/**
|
|
6
5
|
* Manages CRUD operations for records.
|
|
7
6
|
*/
|
|
8
7
|
export declare class RecordsResource extends BaseResource {
|
|
9
|
-
/** Sub-resource for managing record relationships */
|
|
10
|
-
readonly relationships: RelationshipsResource;
|
|
11
8
|
constructor(httpClient: HttpClient, config: ResolvedConfig);
|
|
12
9
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
16
|
-
* @param options - Pagination, filter, and sort options
|
|
17
|
-
* @returns Paginated list of records
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const companies = await clarify.records.list('company', {
|
|
22
|
-
* page: { limit: 20 },
|
|
23
|
-
* filter: { industry: 'technology' },
|
|
24
|
-
* sort: { field: 'name', direction: 'asc' },
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
10
|
+
* Gets the base path for record operations on a specific entity.
|
|
27
11
|
*/
|
|
28
|
-
|
|
12
|
+
private getEntityPath;
|
|
29
13
|
/**
|
|
30
|
-
*
|
|
14
|
+
* Retrieves a single record by ID.
|
|
31
15
|
*
|
|
32
|
-
* @param entity - The entity type
|
|
16
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
33
17
|
* @param id - The record ID
|
|
34
|
-
* @
|
|
18
|
+
* @param options - Optional parameters including relationships to include
|
|
19
|
+
* @returns The record wrapped in a JSON:API response
|
|
35
20
|
*
|
|
36
21
|
* @example
|
|
37
22
|
* ```typescript
|
|
38
|
-
* const
|
|
39
|
-
* console.log(
|
|
23
|
+
* const response = await client.records.get('company', 'abc123');
|
|
24
|
+
* console.log(response.data.attributes.name);
|
|
25
|
+
*
|
|
26
|
+
* // With included relationships
|
|
27
|
+
* const response = await client.records.get('deal', 'xyz789', {
|
|
28
|
+
* include: ['company', 'person']
|
|
29
|
+
* });
|
|
40
30
|
* ```
|
|
41
31
|
*/
|
|
42
|
-
get<T = Record<string, unknown>>(entity: string, id: string): Promise<SingleResponse<T>>;
|
|
32
|
+
get<T = Record<string, unknown>>(entity: string, id: string, options?: GetRecordOptions): Promise<SingleResponse<T>>;
|
|
43
33
|
/**
|
|
44
|
-
* Creates a
|
|
34
|
+
* Creates a single record.
|
|
45
35
|
*
|
|
46
|
-
* @param entity - The entity type
|
|
47
|
-
* @param
|
|
48
|
-
* @returns The created record
|
|
36
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
37
|
+
* @param attributes - The record attributes to create
|
|
38
|
+
* @returns The created record wrapped in a JSON:API response
|
|
49
39
|
*
|
|
50
40
|
* @example
|
|
51
41
|
* ```typescript
|
|
52
|
-
* const
|
|
53
|
-
*
|
|
54
|
-
*
|
|
42
|
+
* const response = await client.records.create('company', {
|
|
43
|
+
* name: 'Acme Corp',
|
|
44
|
+
* website: 'https://acme.com'
|
|
55
45
|
* });
|
|
46
|
+
* console.log(response.data.id);
|
|
56
47
|
* ```
|
|
57
48
|
*/
|
|
58
|
-
create<T = Record<string, unknown>>(entity: string,
|
|
49
|
+
create<T = Record<string, unknown>>(entity: string, attributes: T): Promise<SingleResponse<T>>;
|
|
59
50
|
/**
|
|
60
|
-
*
|
|
51
|
+
* Creates multiple records in bulk.
|
|
61
52
|
*
|
|
62
|
-
* @param entity - The entity type
|
|
63
|
-
* @param
|
|
64
|
-
* @
|
|
65
|
-
* @returns The updated record
|
|
53
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
54
|
+
* @param records - Array of record create objects with type and attributes
|
|
55
|
+
* @returns The created records wrapped in a JSON:API list response
|
|
66
56
|
*
|
|
67
57
|
* @example
|
|
68
58
|
* ```typescript
|
|
69
|
-
* const
|
|
70
|
-
* type: 'company',
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
59
|
+
* const response = await client.records.createBulk('company', [
|
|
60
|
+
* { type: 'company', attributes: { name: 'Acme Corp' } },
|
|
61
|
+
* { type: 'company', attributes: { name: 'Widget Inc' } }
|
|
62
|
+
* ]);
|
|
63
|
+
* console.log(response.data.length);
|
|
74
64
|
* ```
|
|
75
65
|
*/
|
|
76
|
-
|
|
66
|
+
createBulk<T = Record<string, unknown>>(entity: string, records: ResourceCreate<T>[]): Promise<ListResponse<T>>;
|
|
77
67
|
/**
|
|
78
|
-
*
|
|
68
|
+
* Updates a single record.
|
|
79
69
|
*
|
|
80
|
-
* @param entity - The entity type
|
|
70
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
81
71
|
* @param id - The record ID
|
|
72
|
+
* @param attributes - The attributes to update
|
|
73
|
+
* @param options - Optional update options including field operation rules
|
|
74
|
+
* @returns The updated record wrapped in a JSON:API response
|
|
82
75
|
*
|
|
83
76
|
* @example
|
|
84
77
|
* ```typescript
|
|
85
|
-
* await
|
|
78
|
+
* const response = await client.records.update('company', 'abc123', {
|
|
79
|
+
* name: 'Acme Corporation'
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* // With field operation rules (e.g., append to array field)
|
|
83
|
+
* const response = await client.records.update('deal', 'xyz789',
|
|
84
|
+
* { tags: ['new-tag'] },
|
|
85
|
+
* { meta: { tags: { array: 'append' } } }
|
|
86
|
+
* );
|
|
86
87
|
* ```
|
|
87
88
|
*/
|
|
88
|
-
|
|
89
|
+
update<T = Record<string, unknown>>(entity: string, id: string, attributes: Partial<T>, options?: UpdateRecordOptions): Promise<SingleResponse<T>>;
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
+
* Updates multiple records in bulk.
|
|
91
92
|
*
|
|
92
|
-
* @param entity - The entity type
|
|
93
|
-
* @param
|
|
94
|
-
* @
|
|
93
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
94
|
+
* @param records - Array of record update objects with type, id, and attributes
|
|
95
|
+
* @param options - Optional update options including field operation rules
|
|
96
|
+
* @returns The updated records wrapped in a JSON:API list response
|
|
95
97
|
*
|
|
96
98
|
* @example
|
|
97
99
|
* ```typescript
|
|
98
|
-
* const
|
|
99
|
-
* { type: 'company', attributes: {
|
|
100
|
-
* { type: 'company', attributes: {
|
|
100
|
+
* const response = await client.records.updateBulk('company', [
|
|
101
|
+
* { type: 'company', id: 'abc123', attributes: { status: 'active' } },
|
|
102
|
+
* { type: 'company', id: 'def456', attributes: { status: 'active' } }
|
|
101
103
|
* ]);
|
|
102
104
|
* ```
|
|
103
105
|
*/
|
|
104
|
-
|
|
106
|
+
updateBulk<T = Record<string, unknown>>(entity: string, records: ResourceUpdate<T>[], options?: UpdateRecordOptions): Promise<ListResponse<T>>;
|
|
105
107
|
/**
|
|
106
|
-
*
|
|
108
|
+
* Deletes a single record.
|
|
107
109
|
*
|
|
108
|
-
* @param entity - The entity type
|
|
109
|
-
* @param
|
|
110
|
-
* @returns The updated records
|
|
110
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
111
|
+
* @param id - The record ID to delete
|
|
111
112
|
*
|
|
112
113
|
* @example
|
|
113
114
|
* ```typescript
|
|
114
|
-
*
|
|
115
|
-
* { type: 'company', id: 'id-1', attributes: { industry: 'tech' } },
|
|
116
|
-
* { type: 'company', id: 'id-2', attributes: { industry: 'finance' } },
|
|
117
|
-
* ]);
|
|
115
|
+
* await client.records.delete('company', 'abc123');
|
|
118
116
|
* ```
|
|
119
117
|
*/
|
|
120
|
-
|
|
118
|
+
delete(entity: string, id: string): Promise<void>;
|
|
121
119
|
/**
|
|
122
120
|
* Deletes multiple records in bulk.
|
|
123
121
|
*
|
|
124
|
-
* @param entity - The entity type
|
|
122
|
+
* @param entity - The entity type (e.g., 'company', 'person', 'deal')
|
|
125
123
|
* @param ids - Array of record IDs to delete
|
|
126
124
|
*
|
|
127
125
|
* @example
|
|
128
126
|
* ```typescript
|
|
129
|
-
* await
|
|
127
|
+
* await client.records.deleteBulk('company', ['abc123', 'def456']);
|
|
130
128
|
* ```
|
|
131
129
|
*/
|
|
132
130
|
deleteBulk(entity: string, ids: string[]): Promise<void>;
|
|
133
|
-
/**
|
|
134
|
-
* Async iterator for paginating through all records.
|
|
135
|
-
*
|
|
136
|
-
* @param entity - The entity type
|
|
137
|
-
* @param options - Filter and sort options (pagination is handled automatically)
|
|
138
|
-
* @yields Individual records
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```typescript
|
|
142
|
-
* for await (const company of clarify.records.iterate('company')) {
|
|
143
|
-
* console.log(company.attributes.name);
|
|
144
|
-
* }
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
iterate<T = Record<string, unknown>>(entity: string, options?: Omit<ListOptions, 'page'>): AsyncGenerator<Resource<T>, void, undefined>;
|
|
148
|
-
/**
|
|
149
|
-
* Builds query parameters from list options.
|
|
150
|
-
*/
|
|
151
|
-
private buildListQuery;
|
|
152
|
-
/**
|
|
153
|
-
* Extracts the cursor from a pagination URL.
|
|
154
|
-
*/
|
|
155
|
-
private extractCursor;
|
|
156
131
|
}
|
|
157
132
|
//# sourceMappingURL=records.d.ts.map
|
|
@@ -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,
|
|
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;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CAAC,GACZ,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAe7B;;;;;;;;;;;;;;;OAeG;IACG,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,GAC3B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAY3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAuB7B;;;;;;;;;;;;;;;OAeG;IACG,UAAU,CAAC,CAAC,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"}
|
|
@@ -123,4 +123,32 @@ export interface BulkDeleteBody {
|
|
|
123
123
|
* HTTP methods supported by the SDK.
|
|
124
124
|
*/
|
|
125
125
|
export type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
126
|
+
/**
|
|
127
|
+
* Options for retrieving a single record.
|
|
128
|
+
*/
|
|
129
|
+
export interface GetRecordOptions {
|
|
130
|
+
/** Relationships to include in the response (comma-separated in API, array here) */
|
|
131
|
+
include?: string[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Field operation rules for update operations.
|
|
135
|
+
* Specifies how specific fields should be updated (e.g., append to arrays, merge objects).
|
|
136
|
+
*/
|
|
137
|
+
export interface FieldOperationRules {
|
|
138
|
+
[fieldName: string]: {
|
|
139
|
+
/** How to handle collection fields (e.g., multi-select) */
|
|
140
|
+
collection?: 'append' | 'remove' | 'replace';
|
|
141
|
+
/** How to handle array fields */
|
|
142
|
+
array?: 'append';
|
|
143
|
+
/** How to handle object fields */
|
|
144
|
+
object?: 'merge';
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Options for updating records.
|
|
149
|
+
*/
|
|
150
|
+
export interface UpdateRecordOptions {
|
|
151
|
+
/** Field operation rules specifying how fields should be updated */
|
|
152
|
+
meta?: FieldOperationRules;
|
|
153
|
+
}
|
|
126
154
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -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,MAAM,EAAE,OAAO,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;CACf;AAED;;GAEG;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,OAAO,CAAC,CAAC,CAAC,CAAC;CACxB;AAED;;GAEG;AAC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,SAAS,CAAC;QAC7C,iCAAiC;QACjC,KAAK,CAAC,EAAE,QAAQ,CAAC;QACjB,kCAAkC;QAClC,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B"}
|
|
@@ -8,9 +8,9 @@ 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: 3000) */
|
|
12
12
|
timeout?: number;
|
|
13
|
-
/** Number of retry attempts for failed requests (default:
|
|
13
|
+
/** Number of retry attempts for failed requests (default: 1) */
|
|
14
14
|
retries?: number;
|
|
15
15
|
/** Custom fetch implementation (default: global fetch) */
|
|
16
16
|
fetch?: typeof fetch;
|
|
@@ -30,7 +30,7 @@ export interface ResolvedConfig {
|
|
|
30
30
|
* Default configuration values.
|
|
31
31
|
*/
|
|
32
32
|
export declare const DEFAULT_CONFIG: {
|
|
33
|
-
readonly timeout:
|
|
34
|
-
readonly retries:
|
|
33
|
+
readonly timeout: 3000;
|
|
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,sDAAsD;IACtD,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ClarifyClientConfig, ResolvedConfig
|
|
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, } 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, } 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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getclarify/nodejs-sdk",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": false,
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public",
|
|
7
|
-
"registry": "https://registry.npmjs.org/"
|
|
8
|
-
},
|
|
9
3
|
"description": "JavaScript/TypeScript SDK for Clarify platform",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@vitest/coverage-v8": "^3.1.2",
|
|
7
|
+
"eslint": "^9.39.0",
|
|
8
|
+
"eslint-config-prettier": "^10.1.8",
|
|
9
|
+
"prettier": "^3.7.4",
|
|
10
|
+
"typescript": "^5.9.3",
|
|
11
|
+
"typescript-eslint": "^8.47.0",
|
|
12
|
+
"vite": "^7.3.1",
|
|
13
|
+
"vitest": "^3.0.8"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=24"
|
|
17
|
+
},
|
|
13
18
|
"exports": {
|
|
14
19
|
".": {
|
|
15
20
|
"import": {
|
|
@@ -25,44 +30,39 @@
|
|
|
25
30
|
"files": [
|
|
26
31
|
"dist"
|
|
27
32
|
],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"api",
|
|
35
|
+
"clarify",
|
|
36
|
+
"client",
|
|
37
|
+
"crm",
|
|
38
|
+
"sdk"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"main": "./dist/cjs/index.js",
|
|
42
|
+
"module": "./dist/esm/index.js",
|
|
43
|
+
"private": false,
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"registry": "https://registry.npmjs.org/"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/clarify/clarify.git",
|
|
51
|
+
"directory": "packages/sdk/js"
|
|
52
|
+
},
|
|
28
53
|
"scripts": {
|
|
29
54
|
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
|
|
30
|
-
"build:esm": "tsc -p tsconfig.build.json --module NodeNext --moduleResolution NodeNext --outDir dist/esm",
|
|
31
55
|
"build:cjs": "tsc -p tsconfig.build.json --module CommonJS --moduleResolution Node --outDir dist/cjs",
|
|
56
|
+
"build:esm": "tsc -p tsconfig.build.json --module NodeNext --moduleResolution NodeNext --outDir dist/esm",
|
|
32
57
|
"build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist/types",
|
|
33
58
|
"clean": "rm -rf dist",
|
|
34
59
|
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
35
60
|
"lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --fix",
|
|
36
61
|
"test": "vitest run",
|
|
37
|
-
"test:watch": "vitest --watch",
|
|
38
62
|
"test:cov": "vitest run --coverage",
|
|
63
|
+
"test:watch": "vitest --watch",
|
|
39
64
|
"tsc": "tsc --noEmit",
|
|
40
65
|
"tsc:watch": "tsc --noEmit --watch"
|
|
41
66
|
},
|
|
42
|
-
"
|
|
43
|
-
"@vitest/coverage-v8": "^3.1.2",
|
|
44
|
-
"eslint": "^8.57.0",
|
|
45
|
-
"eslint-config-prettier": "^10.1.8",
|
|
46
|
-
"prettier": "^3.7.4",
|
|
47
|
-
"typescript": "^5.9.3",
|
|
48
|
-
"typescript-eslint": "^8.47.0",
|
|
49
|
-
"vite": "^7.3.1",
|
|
50
|
-
"vitest": "^3.0.8"
|
|
51
|
-
},
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">=18.0.0"
|
|
54
|
-
},
|
|
55
|
-
"keywords": [
|
|
56
|
-
"clarify",
|
|
57
|
-
"crm",
|
|
58
|
-
"sdk",
|
|
59
|
-
"api",
|
|
60
|
-
"client"
|
|
61
|
-
],
|
|
62
|
-
"license": "MIT",
|
|
63
|
-
"repository": {
|
|
64
|
-
"type": "git",
|
|
65
|
-
"url": "https://github.com/clarify/clarify.git",
|
|
66
|
-
"directory": "packages/sdk/js"
|
|
67
|
-
}
|
|
67
|
+
"types": "./dist/types/index.d.ts"
|
|
68
68
|
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { HttpClient } from '../http/http-client.js';
|
|
2
|
-
import type { ListOptions, ListResponse, ResolvedConfig, Resource, ResourceCreate, SingleResponse } from '../types/index.js';
|
|
3
|
-
import { BaseResource } from './base-resource.js';
|
|
4
|
-
/**
|
|
5
|
-
* Message attributes.
|
|
6
|
-
*/
|
|
7
|
-
export interface MessageAttributes {
|
|
8
|
-
subject?: string;
|
|
9
|
-
body?: string;
|
|
10
|
-
from?: string;
|
|
11
|
-
to?: string[];
|
|
12
|
-
cc?: string[];
|
|
13
|
-
bcc?: string[];
|
|
14
|
-
sent_at?: string;
|
|
15
|
-
received_at?: string;
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Manages messages in the Clarify platform.
|
|
20
|
-
*/
|
|
21
|
-
export declare class MessagesResource extends BaseResource {
|
|
22
|
-
constructor(httpClient: HttpClient, config: ResolvedConfig);
|
|
23
|
-
/**
|
|
24
|
-
* Lists messages.
|
|
25
|
-
*
|
|
26
|
-
* @param options - Pagination, filter, and sort options
|
|
27
|
-
* @returns Paginated list of messages
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const messages = await clarify.messages.list({
|
|
32
|
-
* page: { limit: 20 },
|
|
33
|
-
* filter: { from: 'user@example.com' },
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
list<T extends MessageAttributes = MessageAttributes>(options?: ListOptions): Promise<ListResponse<T>>;
|
|
38
|
-
/**
|
|
39
|
-
* Gets a single message by ID.
|
|
40
|
-
*
|
|
41
|
-
* @param id - The message ID
|
|
42
|
-
* @returns The message
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
* const message = await clarify.messages.get('message-id');
|
|
47
|
-
* console.log(message.data.attributes.subject);
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
get<T extends MessageAttributes = MessageAttributes>(id: string): Promise<SingleResponse<T>>;
|
|
51
|
-
/**
|
|
52
|
-
* Creates a new message.
|
|
53
|
-
*
|
|
54
|
-
* @param data - The message data to create
|
|
55
|
-
* @returns The created message
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const message = await clarify.messages.create({
|
|
60
|
-
* type: 'message',
|
|
61
|
-
* attributes: {
|
|
62
|
-
* subject: 'Hello',
|
|
63
|
-
* body: 'Message content',
|
|
64
|
-
* from: 'sender@example.com',
|
|
65
|
-
* to: ['recipient@example.com'],
|
|
66
|
-
* },
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
create<T extends MessageAttributes = MessageAttributes>(data: ResourceCreate<T>): Promise<SingleResponse<T>>;
|
|
71
|
-
/**
|
|
72
|
-
* Deletes a message.
|
|
73
|
-
*
|
|
74
|
-
* @param id - The message ID
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* await clarify.messages.delete('message-id');
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
delete(id: string): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Async iterator for paginating through all messages.
|
|
84
|
-
*
|
|
85
|
-
* @param options - Filter and sort options (pagination is handled automatically)
|
|
86
|
-
* @yields Individual messages
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```typescript
|
|
90
|
-
* for await (const message of clarify.messages.iterate()) {
|
|
91
|
-
* console.log(message.attributes.subject);
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
iterate<T extends MessageAttributes = MessageAttributes>(options?: Omit<ListOptions, 'page'>): AsyncGenerator<Resource<T>, void, undefined>;
|
|
96
|
-
/**
|
|
97
|
-
* Builds query parameters from list options.
|
|
98
|
-
*/
|
|
99
|
-
private buildListQuery;
|
|
100
|
-
/**
|
|
101
|
-
* Extracts the cursor from a pagination URL.
|
|
102
|
-
*/
|
|
103
|
-
private extractCursor;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/resources/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,cAAc,EACd,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAA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