1
- import { Caller } from '@/src/api' ;
1
+ // Copyright DataStax, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ /**
16
+ * The caller information to send with requests, of the form `[name, version?]`, or an array of such.
17
+ *
18
+ * **Intended generally for integrations or frameworks that wrap the client.**
19
+ *
20
+ * Used to identify the client making requests to the server.
21
+ *
22
+ * It will be sent in the headers of the request as such:
23
+ * ```
24
+ * User-Agent: ...<name>/<version> astra-db-ts/<version>
25
+ * ```
26
+ *
27
+ * If no caller information is provided, the client will simply be identified as `astra-db-ts/<version>`.
28
+ *
29
+ * **NB. If providing an array of callers, they should be ordered from most important to least important.**
30
+ */
31
+ export type Caller = [ name : string , version ?: string ] ;
2
32
3
33
/**
4
34
* The default options for the {@link DataApiClient}. The Data API & DevOps specific options may be overridden
@@ -16,6 +46,8 @@ export interface RootClientOptions {
16
46
/**
17
47
* The caller information to send with requests, of the form `[name, version?]`, or an array of such.
18
48
*
49
+ * **Intended generally for integrations or frameworks that wrap the client.**
50
+ *
19
51
* The caller information is used to identify the client making requests to the server.
20
52
*
21
53
* It will be sent in the headers of the request as such:
@@ -26,7 +58,6 @@ export interface RootClientOptions {
26
58
* If no caller information is provided, the client will simply be identified as `astra-db-ts/<version>`.
27
59
*
28
60
* **NB. If providing an array of callers, they should be ordered from most important to least important.**
29
- *
30
61
* @example
31
62
* ```typescript
32
63
* // 'my-app/1.0.0 astra-db-ts/1.0.0'
0 commit comments