@linqapp/sdk 0.1.0-alpha.4 → 0.1.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/CHANGELOG.md +32 -27
- package/LICENSE +198 -4
- package/README.md +52 -52
- package/client.d.mts +34 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +34 -22
- package/client.d.ts.map +1 -1
- package/client.js +50 -41
- package/client.js.map +1 -1
- package/client.mjs +49 -40
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +3 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/attachments.d.mts +32 -7
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +32 -7
- package/resources/attachments.d.ts.map +1 -1
- package/resources/capability.d.mts +74 -0
- package/resources/capability.d.mts.map +1 -0
- package/resources/capability.d.ts +74 -0
- package/resources/capability.d.ts.map +1 -0
- package/resources/capability.js +36 -0
- package/resources/capability.js.map +1 -0
- package/resources/capability.mjs +32 -0
- package/resources/capability.mjs.map +1 -0
- package/resources/chats/chats.d.mts +141 -675
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +141 -675
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +6 -2
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +6 -2
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +2 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +2 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/messages.d.mts +55 -724
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +55 -724
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -2
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +131 -555
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +131 -555
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +3 -52
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +3 -52
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +2 -10
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +2 -10
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/phonenumbers.d.mts +58 -0
- package/resources/phonenumbers.d.mts.map +1 -0
- package/resources/phonenumbers.d.ts +58 -0
- package/resources/phonenumbers.d.ts.map +1 -0
- package/resources/phonenumbers.js +17 -0
- package/resources/phonenumbers.js.map +1 -0
- package/resources/phonenumbers.mjs +13 -0
- package/resources/phonenumbers.mjs.map +1 -0
- package/resources/webhook-events.d.mts +29 -0
- package/resources/webhook-events.d.mts.map +1 -0
- package/resources/webhook-events.d.ts +29 -0
- package/resources/webhook-events.d.ts.map +1 -0
- package/resources/{webhooks/events.js → webhook-events.js} +5 -10
- package/resources/webhook-events.js.map +1 -0
- package/resources/{webhooks/events.mjs → webhook-events.mjs} +3 -8
- package/resources/webhook-events.mjs.map +1 -0
- package/resources/webhook-subscriptions.d.mts +184 -0
- package/resources/webhook-subscriptions.d.mts.map +1 -0
- package/resources/webhook-subscriptions.d.ts +184 -0
- package/resources/webhook-subscriptions.d.ts.map +1 -0
- package/resources/{webhooks/subscriptions.js → webhook-subscriptions.js} +16 -16
- package/resources/webhook-subscriptions.js.map +1 -0
- package/resources/{webhooks/subscriptions.mjs → webhook-subscriptions.mjs} +14 -14
- package/resources/webhook-subscriptions.mjs.map +1 -0
- package/src/client.ts +97 -41
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/resource.ts +3 -3
- package/src/index.ts +3 -3
- package/src/internal/parse.ts +2 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/values.ts +6 -6
- package/src/resources/attachments.ts +85 -108
- package/src/resources/capability.ts +98 -0
- package/src/resources/chats/chats.ts +143 -782
- package/src/resources/chats/index.ts +4 -2
- package/src/resources/chats/messages.ts +60 -847
- package/src/resources/index.ts +29 -9
- package/src/resources/messages.ts +155 -661
- package/src/resources/phone-numbers.ts +3 -67
- package/src/resources/phonenumbers.ts +72 -0
- package/src/resources/webhook-events.ts +57 -0
- package/src/resources/webhook-subscriptions.ts +238 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/webhooks/events.d.mts +0 -30
- package/resources/webhooks/events.d.mts.map +0 -1
- package/resources/webhooks/events.d.ts +0 -30
- package/resources/webhooks/events.d.ts.map +0 -1
- package/resources/webhooks/events.js.map +0 -1
- package/resources/webhooks/events.mjs.map +0 -1
- package/resources/webhooks/index.d.mts +0 -4
- package/resources/webhooks/index.d.mts.map +0 -1
- package/resources/webhooks/index.d.ts +0 -4
- package/resources/webhooks/index.d.ts.map +0 -1
- package/resources/webhooks/index.js +0 -11
- package/resources/webhooks/index.js.map +0 -1
- package/resources/webhooks/index.mjs +0 -5
- package/resources/webhooks/index.mjs.map +0 -1
- package/resources/webhooks/subscriptions.d.mts +0 -237
- package/resources/webhooks/subscriptions.d.mts.map +0 -1
- package/resources/webhooks/subscriptions.d.ts +0 -237
- package/resources/webhooks/subscriptions.d.ts.map +0 -1
- package/resources/webhooks/subscriptions.js.map +0 -1
- package/resources/webhooks/subscriptions.mjs.map +0 -1
- package/resources/webhooks/webhooks.d.mts +0 -14
- package/resources/webhooks/webhooks.d.mts.map +0 -1
- package/resources/webhooks/webhooks.d.ts +0 -14
- package/resources/webhooks/webhooks.d.ts.map +0 -1
- package/resources/webhooks/webhooks.js +0 -21
- package/resources/webhooks/webhooks.js.map +0 -1
- package/resources/webhooks/webhooks.mjs +0 -16
- package/resources/webhooks/webhooks.mjs.map +0 -1
- package/resources/webhooks.d.mts +0 -2
- package/resources/webhooks.d.mts.map +0 -1
- package/resources/webhooks.d.ts +0 -2
- package/resources/webhooks.d.ts.map +0 -1
- package/resources/webhooks.js +0 -6
- package/resources/webhooks.js.map +0 -1
- package/resources/webhooks.mjs +0 -3
- package/resources/webhooks.mjs.map +0 -1
- package/src/resources/webhooks/events.ts +0 -55
- package/src/resources/webhooks/index.ts +0 -13
- package/src/resources/webhooks/subscriptions.ts +0 -409
- package/src/resources/webhooks/webhooks.ts +0 -37
- package/src/resources/webhooks.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,73 +1,78 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.1.
|
|
3
|
+
## 0.1.3 (2026-02-24)
|
|
4
4
|
|
|
5
|
-
Full Changelog: [v0.1.
|
|
5
|
+
Full Changelog: [v0.1.2...v0.1.3](https://github.com/linq-team/linq-node/compare/v0.1.2...v0.1.3)
|
|
6
6
|
|
|
7
7
|
### Features
|
|
8
8
|
|
|
9
|
-
* **api:**
|
|
10
|
-
* **api:** api update ([b921025](https://github.com/linq-team/linq-node/commit/b921025a36162f324395253939647b1d2a5461b9))
|
|
11
|
-
* deprecate /phonenumbers in favor of /phone_numbers endpoint ([91f4b97](https://github.com/linq-team/linq-node/commit/91f4b97af63525cc1089c6340ced767cda7d81c8))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Bug Fixes
|
|
15
|
-
|
|
16
|
-
* configure OIDC publishing and fix chat list test examples ([fc00a34](https://github.com/linq-team/linq-node/commit/fc00a344a1d32b9dead7318b89b565af7f273a76))
|
|
9
|
+
* **api:** add publish ([9985388](https://github.com/linq-team/linq-node/commit/9985388e902289caf832e5bd9ec679eea086babf))
|
|
17
10
|
|
|
18
11
|
|
|
19
12
|
### Chores
|
|
20
13
|
|
|
21
|
-
*
|
|
22
|
-
* update SDK settings ([
|
|
14
|
+
* update SDK settings ([5fcd66d](https://github.com/linq-team/linq-node/commit/5fcd66d24acb2d008474d5b286c2597e2f5642ce))
|
|
15
|
+
* update SDK settings ([ddbc1b9](https://github.com/linq-team/linq-node/commit/ddbc1b903f83f0b51b3ef0a411d738f002b6da88))
|
|
23
16
|
|
|
24
|
-
## 0.1.
|
|
17
|
+
## 0.1.2 (2026-02-24)
|
|
25
18
|
|
|
26
|
-
Full Changelog: [v0.1.
|
|
19
|
+
Full Changelog: [v0.1.1...v0.1.2](https://github.com/linq-team/linq-node/compare/v0.1.1...v0.1.2)
|
|
27
20
|
|
|
28
21
|
### Features
|
|
29
22
|
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* update organization docs URL to apidocs.linqapp.com ([4ad2b90](https://github.com/linq-team/linq-node/commit/4ad2b900f779bfe4e18b403cd90ff9a0a46020da))
|
|
23
|
+
* **api:** fix service type ([d0abbf2](https://github.com/linq-team/linq-node/commit/d0abbf2e3a3a85266215d01e6cd4268148c7d66d))
|
|
36
24
|
|
|
37
|
-
## 0.1.
|
|
25
|
+
## 0.1.1 (2026-02-24)
|
|
38
26
|
|
|
39
|
-
Full Changelog: [v0.1.0
|
|
27
|
+
Full Changelog: [v0.1.0...v0.1.1](https://github.com/linq-team/linq-node/compare/v0.1.0...v0.1.1)
|
|
40
28
|
|
|
41
29
|
### Features
|
|
42
30
|
|
|
43
|
-
*
|
|
31
|
+
* **api:** manual updates ([1e5a3c1](https://github.com/linq-team/linq-node/commit/1e5a3c15f90814f696548098570640d36aff3410))
|
|
44
32
|
|
|
45
33
|
|
|
46
|
-
###
|
|
34
|
+
### Chores
|
|
47
35
|
|
|
48
|
-
* remove
|
|
36
|
+
* remove custom code ([b0958ec](https://github.com/linq-team/linq-node/commit/b0958ec1385f9bb1fa946f2948fee08055adfb22))
|
|
37
|
+
* update SDK settings ([f6da0a0](https://github.com/linq-team/linq-node/commit/f6da0a0623ff711f92744872d079f4de903c7613))
|
|
49
38
|
|
|
50
|
-
## 0.1.0
|
|
39
|
+
## 0.1.0 (2026-02-23)
|
|
51
40
|
|
|
52
|
-
Full Changelog: [v0.0.1...v0.1.0
|
|
41
|
+
Full Changelog: [v0.0.1...v0.1.0](https://github.com/linq-team/linq-node/compare/v0.0.1...v0.1.0)
|
|
53
42
|
|
|
54
43
|
### Features
|
|
55
44
|
|
|
45
|
+
* Add Stainless SDK build to OpenAPI workflow ([7d710e6](https://github.com/linq-team/linq-node/commit/7d710e615b08c3294ffa35091557bf360193af55))
|
|
46
|
+
* **api:** api update ([0a6d75d](https://github.com/linq-team/linq-node/commit/0a6d75d3e35aabac4843629852ebc23bd091c192))
|
|
47
|
+
* **api:** api update ([b921025](https://github.com/linq-team/linq-node/commit/b921025a36162f324395253939647b1d2a5461b9))
|
|
56
48
|
* **api:** api update ([593b266](https://github.com/linq-team/linq-node/commit/593b266a51ec44bc4ddbe893ae08ed0ce254375e))
|
|
57
49
|
* **api:** api update ([e6642f4](https://github.com/linq-team/linq-node/commit/e6642f4bc9520fb92433cd25ec78d1abf3392c03))
|
|
50
|
+
* deprecate /phonenumbers in favor of /phone_numbers endpoint ([91f4b97](https://github.com/linq-team/linq-node/commit/91f4b97af63525cc1089c6340ced767cda7d81c8))
|
|
51
|
+
* enable documented OpenAPI spec with SDK code samples ([3dde73c](https://github.com/linq-team/linq-node/commit/3dde73cadb43e86fec82a805551b79c9aa234f71))
|
|
52
|
+
* enable OIDC trusted publishing and npm provenance ([b372e1c](https://github.com/linq-team/linq-node/commit/b372e1c4f984aef4d73a60fbd0b699d51fee397d))
|
|
58
53
|
* switch npm publishing to OIDC trusted publishing ([52954e8](https://github.com/linq-team/linq-node/commit/52954e82b349c631a118a4e921eab7be5e9f670a))
|
|
59
54
|
|
|
60
55
|
|
|
61
56
|
### Bug Fixes
|
|
62
57
|
|
|
58
|
+
* configure OIDC publishing and fix chat list test examples ([fc00a34](https://github.com/linq-team/linq-node/commit/fc00a344a1d32b9dead7318b89b565af7f273a76))
|
|
63
59
|
* remove NPM_TOKEN requirement from release-doctor, add provenance ([bfe16fe](https://github.com/linq-team/linq-node/commit/bfe16fe2cebedab7d3c8733fd4c7b477a108c05a))
|
|
60
|
+
* remove provenance flag for private repo publishing ([3ae4be7](https://github.com/linq-team/linq-node/commit/3ae4be7539d46672439d540c58ba011cb3f58e1e))
|
|
61
|
+
* restore correct stainless config ([f092ae5](https://github.com/linq-team/linq-node/commit/f092ae5f133a2226abddec4565892be91a96afb1))
|
|
62
|
+
* restore setup-node v4 and registry-url in publish workflow ([50f11ea](https://github.com/linq-team/linq-node/commit/50f11ea701b3e7ec5342f316146cfdd15bcaafc8))
|
|
63
|
+
* update organization docs URL to apidocs.linqapp.com ([4ad2b90](https://github.com/linq-team/linq-node/commit/4ad2b900f779bfe4e18b403cd90ff9a0a46020da))
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
### Chores
|
|
67
67
|
|
|
68
|
+
* **internal/client:** fix form-urlencoded requests ([dd2b7f6](https://github.com/linq-team/linq-node/commit/dd2b7f67a9acdbffd96c8f6e3a45e6860b498e3f))
|
|
69
|
+
* sync repo ([a780316](https://github.com/linq-team/linq-node/commit/a7803164fb5f12afdec8ed51c35003307a14b480))
|
|
70
|
+
* update SDK settings ([d176c25](https://github.com/linq-team/linq-node/commit/d176c255fc623ab12aa74ea5bf00262ce633a81b))
|
|
71
|
+
* update SDK settings ([b61c9ee](https://github.com/linq-team/linq-node/commit/b61c9ee72f8700531c70ac3161bbe0dbeb1cde61))
|
|
68
72
|
* update SDK settings ([cdc73fc](https://github.com/linq-team/linq-node/commit/cdc73fccde19ba94d27de4ae2b31c48d18627756))
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
### Documentation
|
|
72
76
|
|
|
73
77
|
* add CLAUDE.md and .stainless/ workspace config ([82b2491](https://github.com/linq-team/linq-node/commit/82b2491bf0ee34e9ce6b6d1bff6705ab581c7e95))
|
|
78
|
+
* note contact card setup required for share_contact_card endpoint ([2c8c39f](https://github.com/linq-team/linq-node/commit/2c8c39f99ac55620f5d13e4a2349d046db7c8f45))
|
package/LICENSE
CHANGED
|
@@ -1,7 +1,201 @@
|
|
|
1
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
1. Definitions.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Linq API V3
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Linq TypeScript API Library
|
|
1
|
+
# Linq API V3 TypeScript API Library
|
|
2
2
|
|
|
3
3
|
[>)](https://npmjs.org/package/@linqapp/sdk) 
|
|
4
4
|
|
|
5
|
-
This library provides convenient access to the Linq REST API from server-side TypeScript or JavaScript.
|
|
5
|
+
This library provides convenient access to the Linq API V3 REST API from server-side TypeScript or JavaScript.
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The full API of this library can be found in [api.md](api.md).
|
|
8
8
|
|
|
9
9
|
It is generated with [Stainless](https://www.stainless.com/).
|
|
10
10
|
|
|
@@ -20,16 +20,16 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
20
20
|
|
|
21
21
|
<!-- prettier-ignore -->
|
|
22
22
|
```js
|
|
23
|
-
import
|
|
23
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
24
24
|
|
|
25
|
-
const client = new
|
|
26
|
-
apiKey: process.env['
|
|
25
|
+
const client = new LinqAPIV3({
|
|
26
|
+
apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const chat = await client.chats.create({
|
|
30
|
-
from: '+
|
|
31
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
32
|
-
to: ['+
|
|
30
|
+
from: '+12052535597',
|
|
31
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
32
|
+
to: ['+12052532136'],
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
console.log(chat.chat);
|
|
@@ -41,18 +41,18 @@ This library includes TypeScript definitions for all request params and response
|
|
|
41
41
|
|
|
42
42
|
<!-- prettier-ignore -->
|
|
43
43
|
```ts
|
|
44
|
-
import
|
|
44
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
45
45
|
|
|
46
|
-
const client = new
|
|
47
|
-
apiKey: process.env['
|
|
46
|
+
const client = new LinqAPIV3({
|
|
47
|
+
apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const params:
|
|
51
|
-
from: '+
|
|
52
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
53
|
-
to: ['+
|
|
50
|
+
const params: LinqAPIV3.ChatCreateParams = {
|
|
51
|
+
from: '+12052535597',
|
|
52
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
53
|
+
to: ['+12052532136'],
|
|
54
54
|
};
|
|
55
|
-
const chat:
|
|
55
|
+
const chat: LinqAPIV3.ChatCreateResponse = await client.chats.create(params);
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -67,12 +67,12 @@ a subclass of `APIError` will be thrown:
|
|
|
67
67
|
```ts
|
|
68
68
|
const chat = await client.chats
|
|
69
69
|
.create({
|
|
70
|
-
from: '+
|
|
71
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
72
|
-
to: ['+
|
|
70
|
+
from: '+12052535597',
|
|
71
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
72
|
+
to: ['+12052532136'],
|
|
73
73
|
})
|
|
74
74
|
.catch(async (err) => {
|
|
75
|
-
if (err instanceof
|
|
75
|
+
if (err instanceof LinqAPIV3.APIError) {
|
|
76
76
|
console.log(err.status); // 400
|
|
77
77
|
console.log(err.name); // BadRequestError
|
|
78
78
|
console.log(err.headers); // {server: 'nginx', ...}
|
|
@@ -106,15 +106,15 @@ You can use the `maxRetries` option to configure or disable this:
|
|
|
106
106
|
<!-- prettier-ignore -->
|
|
107
107
|
```js
|
|
108
108
|
// Configure the default for all requests:
|
|
109
|
-
const client = new
|
|
109
|
+
const client = new LinqAPIV3({
|
|
110
110
|
maxRetries: 0, // default is 2
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
// Or, configure per-request:
|
|
114
114
|
await client.chats.create({
|
|
115
|
-
from: '+
|
|
116
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
117
|
-
to: ['+
|
|
115
|
+
from: '+12052535597',
|
|
116
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
117
|
+
to: ['+12052532136'],
|
|
118
118
|
}, {
|
|
119
119
|
maxRetries: 5,
|
|
120
120
|
});
|
|
@@ -127,15 +127,15 @@ Requests time out after 1 minute by default. You can configure this with a `time
|
|
|
127
127
|
<!-- prettier-ignore -->
|
|
128
128
|
```ts
|
|
129
129
|
// Configure the default for all requests:
|
|
130
|
-
const client = new
|
|
130
|
+
const client = new LinqAPIV3({
|
|
131
131
|
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
// Override per-request:
|
|
135
135
|
await client.chats.create({
|
|
136
|
-
from: '+
|
|
137
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
138
|
-
to: ['+
|
|
136
|
+
from: '+12052535597',
|
|
137
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
138
|
+
to: ['+12052532136'],
|
|
139
139
|
}, {
|
|
140
140
|
timeout: 5 * 1000,
|
|
141
141
|
});
|
|
@@ -157,13 +157,13 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
157
157
|
|
|
158
158
|
<!-- prettier-ignore -->
|
|
159
159
|
```ts
|
|
160
|
-
const client = new
|
|
160
|
+
const client = new LinqAPIV3();
|
|
161
161
|
|
|
162
162
|
const response = await client.chats
|
|
163
163
|
.create({
|
|
164
|
-
from: '+
|
|
165
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
166
|
-
to: ['+
|
|
164
|
+
from: '+12052535597',
|
|
165
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
166
|
+
to: ['+12052532136'],
|
|
167
167
|
})
|
|
168
168
|
.asResponse();
|
|
169
169
|
console.log(response.headers.get('X-My-Header'));
|
|
@@ -171,9 +171,9 @@ console.log(response.statusText); // access the underlying Response object
|
|
|
171
171
|
|
|
172
172
|
const { data: chat, response: raw } = await client.chats
|
|
173
173
|
.create({
|
|
174
|
-
from: '+
|
|
175
|
-
message: { parts: [{ type: 'text', value: 'Hello
|
|
176
|
-
to: ['+
|
|
174
|
+
from: '+12052535597',
|
|
175
|
+
message: { parts: [{ type: 'text', value: 'Hello! How can I help you today?' }] },
|
|
176
|
+
to: ['+12052532136'],
|
|
177
177
|
})
|
|
178
178
|
.withResponse();
|
|
179
179
|
console.log(raw.headers.get('X-My-Header'));
|
|
@@ -190,13 +190,13 @@ console.log(chat.chat);
|
|
|
190
190
|
|
|
191
191
|
The log level can be configured in two ways:
|
|
192
192
|
|
|
193
|
-
1. Via the `
|
|
193
|
+
1. Via the `LINQ_API_V3_LOG` environment variable
|
|
194
194
|
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
195
195
|
|
|
196
196
|
```ts
|
|
197
|
-
import
|
|
197
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
198
198
|
|
|
199
|
-
const client = new
|
|
199
|
+
const client = new LinqAPIV3({
|
|
200
200
|
logLevel: 'debug', // Show all log messages
|
|
201
201
|
});
|
|
202
202
|
```
|
|
@@ -222,13 +222,13 @@ When providing a custom logger, the `logLevel` option still controls which messa
|
|
|
222
222
|
below the configured level will not be sent to your logger.
|
|
223
223
|
|
|
224
224
|
```ts
|
|
225
|
-
import
|
|
225
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
226
226
|
import pino from 'pino';
|
|
227
227
|
|
|
228
228
|
const logger = pino();
|
|
229
229
|
|
|
230
|
-
const client = new
|
|
231
|
-
logger: logger.child({ name: '
|
|
230
|
+
const client = new LinqAPIV3({
|
|
231
|
+
logger: logger.child({ name: 'LinqAPIV3' }),
|
|
232
232
|
logLevel: 'debug', // Send all messages to pino, allowing it to filter
|
|
233
233
|
});
|
|
234
234
|
```
|
|
@@ -291,10 +291,10 @@ globalThis.fetch = fetch;
|
|
|
291
291
|
Or pass it to the client:
|
|
292
292
|
|
|
293
293
|
```ts
|
|
294
|
-
import
|
|
294
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
295
295
|
import fetch from 'my-fetch';
|
|
296
296
|
|
|
297
|
-
const client = new
|
|
297
|
+
const client = new LinqAPIV3({ fetch });
|
|
298
298
|
```
|
|
299
299
|
|
|
300
300
|
### Fetch options
|
|
@@ -302,9 +302,9 @@ const client = new Linq({ fetch });
|
|
|
302
302
|
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
|
|
303
303
|
|
|
304
304
|
```ts
|
|
305
|
-
import
|
|
305
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
306
306
|
|
|
307
|
-
const client = new
|
|
307
|
+
const client = new LinqAPIV3({
|
|
308
308
|
fetchOptions: {
|
|
309
309
|
// `RequestInit` options
|
|
310
310
|
},
|
|
@@ -319,11 +319,11 @@ options to requests:
|
|
|
319
319
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
|
|
320
320
|
|
|
321
321
|
```ts
|
|
322
|
-
import
|
|
322
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
323
323
|
import * as undici from 'undici';
|
|
324
324
|
|
|
325
325
|
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
|
|
326
|
-
const client = new
|
|
326
|
+
const client = new LinqAPIV3({
|
|
327
327
|
fetchOptions: {
|
|
328
328
|
dispatcher: proxyAgent,
|
|
329
329
|
},
|
|
@@ -333,9 +333,9 @@ const client = new Linq({
|
|
|
333
333
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
|
|
334
334
|
|
|
335
335
|
```ts
|
|
336
|
-
import
|
|
336
|
+
import LinqAPIV3 from '@linqapp/sdk';
|
|
337
337
|
|
|
338
|
-
const client = new
|
|
338
|
+
const client = new LinqAPIV3({
|
|
339
339
|
fetchOptions: {
|
|
340
340
|
proxy: 'http://localhost:8888',
|
|
341
341
|
},
|
|
@@ -345,10 +345,10 @@ const client = new Linq({
|
|
|
345
345
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
|
|
346
346
|
|
|
347
347
|
```ts
|
|
348
|
-
import
|
|
348
|
+
import LinqAPIV3 from 'npm:@linqapp/sdk';
|
|
349
349
|
|
|
350
350
|
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
|
|
351
|
-
const client = new
|
|
351
|
+
const client = new LinqAPIV3({
|
|
352
352
|
fetchOptions: {
|
|
353
353
|
client: httpClient,
|
|
354
354
|
},
|