@getclarify/nodejs-sdk 0.0.2 → 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.
Files changed (49) hide show
  1. package/dist/cjs/client.d.ts +0 -5
  2. package/dist/cjs/client.d.ts.map +1 -1
  3. package/dist/cjs/client.js +0 -5
  4. package/dist/cjs/client.js.map +1 -1
  5. package/dist/cjs/types/index.d.ts +1 -1
  6. package/dist/cjs/types/index.d.ts.map +1 -1
  7. package/dist/cjs/types/index.js.map +1 -1
  8. package/dist/esm/client.d.ts +0 -5
  9. package/dist/esm/client.d.ts.map +1 -1
  10. package/dist/esm/client.js +0 -5
  11. package/dist/esm/client.js.map +1 -1
  12. package/dist/esm/types/index.d.ts +1 -1
  13. package/dist/esm/types/index.d.ts.map +1 -1
  14. package/dist/esm/types/index.js.map +1 -1
  15. package/dist/types/client.d.ts +0 -5
  16. package/dist/types/client.d.ts.map +1 -1
  17. package/dist/types/types/index.d.ts +1 -1
  18. package/dist/types/types/index.d.ts.map +1 -1
  19. package/package.json +37 -37
  20. package/dist/cjs/resources/messages.d.ts +0 -105
  21. package/dist/cjs/resources/messages.d.ts.map +0 -1
  22. package/dist/cjs/resources/messages.js +0 -166
  23. package/dist/cjs/resources/messages.js.map +0 -1
  24. package/dist/cjs/resources/relationships.d.ts +0 -96
  25. package/dist/cjs/resources/relationships.d.ts.map +0 -1
  26. package/dist/cjs/resources/relationships.js +0 -157
  27. package/dist/cjs/resources/relationships.js.map +0 -1
  28. package/dist/cjs/resources/tasks.d.ts +0 -141
  29. package/dist/cjs/resources/tasks.d.ts.map +0 -1
  30. package/dist/cjs/resources/tasks.js +0 -211
  31. package/dist/cjs/resources/tasks.js.map +0 -1
  32. package/dist/esm/resources/messages.d.ts +0 -105
  33. package/dist/esm/resources/messages.d.ts.map +0 -1
  34. package/dist/esm/resources/messages.js +0 -166
  35. package/dist/esm/resources/messages.js.map +0 -1
  36. package/dist/esm/resources/relationships.d.ts +0 -96
  37. package/dist/esm/resources/relationships.d.ts.map +0 -1
  38. package/dist/esm/resources/relationships.js +0 -157
  39. package/dist/esm/resources/relationships.js.map +0 -1
  40. package/dist/esm/resources/tasks.d.ts +0 -141
  41. package/dist/esm/resources/tasks.d.ts.map +0 -1
  42. package/dist/esm/resources/tasks.js +0 -211
  43. package/dist/esm/resources/tasks.js.map +0 -1
  44. package/dist/types/resources/messages.d.ts +0 -105
  45. package/dist/types/resources/messages.d.ts.map +0 -1
  46. package/dist/types/resources/relationships.d.ts +0 -96
  47. package/dist/types/resources/relationships.d.ts.map +0 -1
  48. package/dist/types/resources/tasks.d.ts +0 -141
  49. package/dist/types/resources/tasks.d.ts.map +0 -1
@@ -21,11 +21,6 @@ import type { ClarifyClientConfig } from './types/index.js';
21
21
  * type: 'company',
22
22
  * attributes: { name: 'Acme Inc.' },
23
23
  * });
24
- *
25
- * // Iterate through all records
26
- * for await (const company of clarify.records.iterate('company')) {
27
- * console.log(company.attributes.name);
28
- * }
29
24
  * ```
30
25
  */
31
26
  export declare class ClarifyClient {
@@ -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,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
@@ -26,11 +26,6 @@ const index_js_2 = require("./types/index.js");
26
26
  * type: 'company',
27
27
  * attributes: { name: 'Acme Inc.' },
28
28
  * });
29
- *
30
- * // Iterate through all records
31
- * for await (const company of clarify.records.iterate('company')) {
32
- * console.log(company.attributes.name);
33
- * }
34
29
  * ```
35
30
  */
36
31
  class ClarifyClient {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAC3D,0DAAmD;AACnD,uDAAyD;AAEzD,+CAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa;IACxB,oCAAoC;IAC3B,OAAO,CAAkB;IAEjB,MAAM,CAAiB;IACvB,UAAU,CAAa;IAExC;;;;;OAKG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,2BAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,GAAG,IAAI,4BAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAA2B;QAC/C,MAAM,MA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,sCAmDC"}
@@ -1,4 +1,4 @@
1
- export type { ClarifyClientConfig, ResolvedConfig, } from './config.js';
1
+ export type { ClarifyClientConfig, ResolvedConfig } from './config.js';
2
2
  export { DEFAULT_CONFIG } from './config.js';
3
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,EACV,mBAAmB,EACnB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,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,GACpB,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAKA,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAEA,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
@@ -21,11 +21,6 @@ import type { ClarifyClientConfig } from './types/index.js';
21
21
  * type: 'company',
22
22
  * attributes: { name: 'Acme Inc.' },
23
23
  * });
24
- *
25
- * // Iterate through all records
26
- * for await (const company of clarify.records.iterate('company')) {
27
- * console.log(company.attributes.name);
28
- * }
29
24
  * ```
30
25
  */
31
26
  export declare class ClarifyClient {
@@ -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,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
@@ -26,11 +26,6 @@ const index_js_2 = require("./types/index.js");
26
26
  * type: 'company',
27
27
  * attributes: { name: 'Acme Inc.' },
28
28
  * });
29
- *
30
- * // Iterate through all records
31
- * for await (const company of clarify.records.iterate('company')) {
32
- * console.log(company.attributes.name);
33
- * }
34
29
  * ```
35
30
  */
36
31
  class ClarifyClient {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAC3D,0DAAmD;AACnD,uDAAyD;AAEzD,+CAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa;IACxB,oCAAoC;IAC3B,OAAO,CAAkB;IAEjB,MAAM,CAAiB;IACvB,UAAU,CAAa;IAExC;;;;;OAKG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,2BAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,GAAG,IAAI,4BAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAA2B;QAC/C,MAAM,MAAM,GAA6B,EAAE,CAAC;QAE5C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,SAAS,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olvedConfig } from './config.js';
2
2
  export { DEFAULT_CONFIG } from './config.js';
3
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,EACV,mBAAmB,EACnB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,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,GACpB,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAKA,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAEA,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
@@ -21,11 +21,6 @@ import type { ClarifyClientConfig } from './types/index.js';
21
21
  * type: 'company',
22
22
  * attributes: { name: 'Acme Inc.' },
23
23
  * });
24
- *
25
- * // Iterate through all records
26
- * for await (const company of clarify.records.iterate('company')) {
27
- * console.log(company.attributes.name);
28
- * }
29
24
  * ```
30
25
  */
31
26
  export declare class ClarifyClient {
@@ -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,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;IACxB,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;;;OAKG;gBACS,MAAM,EAAE,mBAAmB;IAOvC;;OAEG;IACH,OAAO,CAAC,aAAa;CA4BtB"}
@@ -1,4 +1,4 @@
1
- export type { ClarifyClientConfig, ResolvedConfig, } from './config.js';
1
+ export type { ClarifyClientConfig, ResolvedConfig } from './config.js';
2
2
  export { DEFAULT_CONFIG } from './config.js';
3
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,EACV,mBAAmB,EACnB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,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,GACpB,MAAM,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "@getclarify/nodejs-sdk",
3
- "version": "0.0.2",
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
- "main": "./dist/cjs/index.js",
11
- "module": "./dist/esm/index.js",
12
- "types": "./dist/types/index.d.ts",
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
- "devDependencies": {
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,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;gBACpC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAI1D;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EACxD,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAU3B;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EACvD,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAO7B;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAC1D,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAU7B;;;;;;;;;OASG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvC;;;;;;;;;;;;OAYG;IACI,OAAO,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAC5D,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAClC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAiB/C;;OAEG;IACH,OAAO,CAAC,cAAc;IAgCtB;;OAEG;IACH,OAAO,CAAC,aAAa;CAYtB"}
@@ -1,166 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessagesResource = void 0;
4
- const base_resource_js_1 = require("./base-resource.js");
5
- /**
6
- * Manages messages in the Clarify platform.
7
- */
8
- class MessagesResource extends base_resource_js_1.BaseResource {
9
- constructor(httpClient, config) {
10
- super(httpClient, config);
11
- }
12
- /**
13
- * Lists messages.
14
- *
15
- * @param options - Pagination, filter, and sort options
16
- * @returns Paginated list of messages
17
- *
18
- * @example
19
- * ```typescript
20
- * const messages = await clarify.messages.list({
21
- * page: { limit: 20 },
22
- * filter: { from: 'user@example.com' },
23
- * });
24
- * ```
25
- */
26
- async list(options) {
27
- const query = this.buildListQuery(options);
28
- return this.httpClient.request({
29
- method: 'GET',
30
- path: `${this.basePath}/messages`,
31
- query,
32
- });
33
- }
34
- /**
35
- * Gets a single message by ID.
36
- *
37
- * @param id - The message ID
38
- * @returns The message
39
- *
40
- * @example
41
- * ```typescript
42
- * const message = await clarify.messages.get('message-id');
43
- * console.log(message.data.attributes.subject);
44
- * ```
45
- */
46
- async get(id) {
47
- return this.httpClient.request({
48
- method: 'GET',
49
- path: `${this.basePath}/messages/${id}`,
50
- });
51
- }
52
- /**
53
- * Creates a new message.
54
- *
55
- * @param data - The message data to create
56
- * @returns The created message
57
- *
58
- * @example
59
- * ```typescript
60
- * const message = await clarify.messages.create({
61
- * type: 'message',
62
- * attributes: {
63
- * subject: 'Hello',
64
- * body: 'Message content',
65
- * from: 'sender@example.com',
66
- * to: ['recipient@example.com'],
67
- * },
68
- * });
69
- * ```
70
- */
71
- async create(data) {
72
- const body = { data };
73
- return this.httpClient.request({
74
- method: 'POST',
75
- path: `${this.basePath}/messages`,
76
- body,
77
- });
78
- }
79
- /**
80
- * Deletes a message.
81
- *
82
- * @param id - The message ID
83
- *
84
- * @example
85
- * ```typescript
86
- * await clarify.messages.delete('message-id');
87
- * ```
88
- */
89
- async delete(id) {
90
- await this.httpClient.request({
91
- method: 'DELETE',
92
- path: `${this.basePath}/messages/${id}`,
93
- });
94
- }
95
- /**
96
- * Async iterator for paginating through all messages.
97
- *
98
- * @param options - Filter and sort options (pagination is handled automatically)
99
- * @yields Individual messages
100
- *
101
- * @example
102
- * ```typescript
103
- * for await (const message of clarify.messages.iterate()) {
104
- * console.log(message.attributes.subject);
105
- * }
106
- * ```
107
- */
108
- async *iterate(options) {
109
- let cursor;
110
- do {
111
- const response = await this.list({
112
- ...options,
113
- page: { cursor, limit: 100 },
114
- });
115
- for (const message of response.data) {
116
- yield message;
117
- }
118
- cursor = this.extractCursor(response.links?.next);
119
- } while (cursor);
120
- }
121
- /**
122
- * Builds query parameters from list options.
123
- */
124
- buildListQuery(options) {
125
- const query = {};
126
- if (options?.page?.cursor) {
127
- query['page[cursor]'] = options.page.cursor;
128
- }
129
- if (options?.page?.limit) {
130
- query['page[limit]'] = options.page.limit;
131
- }
132
- if (options?.filter) {
133
- for (const [key, value] of Object.entries(options.filter)) {
134
- if (value !== undefined) {
135
- query[`filter[${key}]`] = Array.isArray(value)
136
- ? value.join(',')
137
- : String(value);
138
- }
139
- }
140
- }
141
- if (options?.sort) {
142
- const sorts = Array.isArray(options.sort) ? options.sort : [options.sort];
143
- query['sort'] = sorts
144
- .map((s) => (s.direction === 'desc' ? `-${s.field}` : s.field))
145
- .join(',');
146
- }
147
- return query;
148
- }
149
- /**
150
- * Extracts the cursor from a pagination URL.
151
- */
152
- extractCursor(url) {
153
- if (!url) {
154
- return undefined;
155
- }
156
- try {
157
- const parsedUrl = new URL(url);
158
- return parsedUrl.searchParams.get('page[cursor]') ?? undefined;
159
- }
160
- catch {
161
- return undefined;
162
- }
163
- }
164
- }
165
- exports.MessagesResource = MessagesResource;
166
- //# sourceMappingURL=messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/resources/messages.ts"],"names":[],"mappings":";;;AAUA,yDAAkD;AAiBlD;;GAEG;AACH,MAAa,gBAAiB,SAAQ,+BAAY;IAChD,YAAY,UAAsB,EAAE,MAAsB;QACxD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,CACR,OAAqB;QAErB,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAkB;YAC9C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,WAAW;YACjC,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,GAAG,CACP,EAAU;QAEV,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAoB;YAChD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QA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SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/B,OAAO,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC;QACjE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAtLD,4CAsLC"}
@@ -1,96 +0,0 @@
1
- import type { HttpClient } from '../http/http-client.js';
2
- import type { ListOptions, ListResponse, ResolvedConfig, Resource, ResourceIdentifier } from '../types/index.js';
3
- import { BaseResource } from './base-resource.js';
4
- /**
5
- * Request body for adding relationships.
6
- */
7
- export interface AddRelationshipsBody {
8
- data: ResourceIdentifier[];
9
- }
10
- /**
11
- * Request body for removing relationships.
12
- */
13
- export interface RemoveRelationshipsBody {
14
- data: ResourceIdentifier[];
15
- }
16
- /**
17
- * Manages relationships between records.
18
- */
19
- export declare class RelationshipsResource extends BaseResource {
20
- constructor(httpClient: HttpClient, config: ResolvedConfig);
21
- /**
22
- * Lists related records for a given record and relationship.
23
- *
24
- * @param entity - The entity type of the source record
25
- * @param recordId - The ID of the source record
26
- * @param relationship - The name of the relationship
27
- * @param options - Pagination and filter options
28
- * @returns Paginated list of related records
29
- *
30
- * @example
31
- * ```typescript
32
- * const people = await clarify.records.relationships.list('company', 'company-id', 'people');
33
- * ```
34
- */
35
- list<T = Record<string, unknown>>(entity: string, recordId: string, relationship: string, options?: ListOptions): Promise<ListResponse<T>>;
36
- /**
37
- * Adds relationships between a source record and target records.
38
- *
39
- * @param entity - The entity type of the source record
40
- * @param recordId - The ID of the source record
41
- * @param relationship - The name of the relationship
42
- * @param targets - Array of resource identifiers to add
43
- * @returns The updated list of related records
44
- *
45
- * @example
46
- * ```typescript
47
- * await clarify.records.relationships.add('company', 'company-id', 'people', [
48
- * { type: 'person', id: 'person-id-1' },
49
- * { type: 'person', id: 'person-id-2' },
50
- * ]);
51
- * ```
52
- */
53
- add<T = Record<string, unknown>>(entity: string, recordId: string, relationship: string, targets: ResourceIdentifier[]): Promise<ListResponse<T>>;
54
- /**
55
- * Removes relationships between a source record and target records.
56
- *
57
- * @param entity - The entity type of the source record
58
- * @param recordId - The ID of the source record
59
- * @param relationship - The name of the relationship
60
- * @param targets - Array of resource identifiers to remove
61
- *
62
- * @example
63
- * ```typescript
64
- * await clarify.records.relationships.remove('company', 'company-id', 'people', [
65
- * { type: 'person', id: 'person-id-1' },
66
- * ]);
67
- * ```
68
- */
69
- remove(entity: string, recordId: string, relationship: string, targets: ResourceIdentifier[]): Promise<void>;
70
- /**
71
- * Async iterator for paginating through all related records.
72
- *
73
- * @param entity - The entity type of the source record
74
- * @param recordId - The ID of the source record
75
- * @param relationship - The name of the relationship
76
- * @param options - Filter and sort options (pagination is handled automatically)
77
- * @yields Individual related records
78
- *
79
- * @example
80
- * ```typescript
81
- * for await (const person of clarify.records.relationships.iterate('company', 'company-id', 'people')) {
82
- * console.log(person.attributes.name);
83
- * }
84
- * ```
85
- */
86
- iterate<T = Record<string, unknown>>(entity: string, recordId: string, relationship: string, options?: Omit<ListOptions, 'page'>): AsyncGenerator<Resource<T>, void, undefined>;
87
- /**
88
- * Builds query parameters from list options.
89
- */
90
- private buildListQuery;
91
- /**
92
- * Extracts the cursor from a pagination URL.
93
- */
94
- private extractCursor;
95
- }
96
- //# sourceMappingURL=relationships.d.ts.map
@@ -1 +0,0 @@
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,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC5B;AAED;;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