weflayr 0.23.0 → 0.26.0

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 (225) hide show
  1. package/README.md +2 -2
  2. package/dist/{api → src/api}/generated/facade.gen.d.ts +163 -12
  3. package/dist/{api → src/api}/generated/facade.gen.js +10 -2
  4. package/dist/src/api/generated/index.d.ts +2 -0
  5. package/dist/{api → src/api}/generated/index.js +9 -1
  6. package/dist/{api → src/api}/generated/sdk.gen.d.ts +35 -3
  7. package/dist/{api → src/api}/generated/sdk.gen.js +88 -4
  8. package/{src/api/generated/types.gen.ts → dist/src/api/generated/types.gen.d.ts} +692 -116
  9. package/dist/{api → src/api}/makeEndpoint.js +1 -3
  10. package/dist/src/auto-instrument.d.ts +42 -0
  11. package/dist/src/auto-instrument.js +156 -0
  12. package/dist/src/index.d.ts +9 -0
  13. package/dist/src/index.js +49 -0
  14. package/dist/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.d.ts +20 -0
  15. package/dist/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.js +114 -0
  16. package/dist/src/instrumentation/anthropic/get_cache_config_telemetry.d.ts +28 -0
  17. package/dist/src/instrumentation/anthropic/get_cache_config_telemetry.js +92 -0
  18. package/dist/src/instrumentation/anthropic/get_streaming_accumulation_telemetry.d.ts +25 -0
  19. package/dist/src/instrumentation/anthropic/get_streaming_accumulation_telemetry.js +141 -0
  20. package/dist/src/instrumentation/anthropic/get_structured_output_schema_telemetry.d.ts +9 -0
  21. package/dist/src/instrumentation/anthropic/get_structured_output_schema_telemetry.js +17 -0
  22. package/dist/src/instrumentation/anthropic/get_tool_definitions_telemetry.d.ts +15 -0
  23. package/dist/src/instrumentation/anthropic/get_tool_definitions_telemetry.js +50 -0
  24. package/dist/src/instrumentation/anthropic/set_telemetry_attributes.d.ts +15 -0
  25. package/dist/src/instrumentation/anthropic/set_telemetry_attributes.js +39 -0
  26. package/dist/src/instrumentation/bedrock/get_cache_config_telemetry.d.ts +22 -0
  27. package/dist/src/instrumentation/bedrock/get_cache_config_telemetry.js +97 -0
  28. package/dist/src/instrumentation/bedrock/get_cache_telemetry.d.ts +22 -0
  29. package/dist/src/instrumentation/bedrock/get_cache_telemetry.js +102 -0
  30. package/dist/src/instrumentation/bedrock/get_input_message_content_telemetry.d.ts +15 -0
  31. package/dist/src/instrumentation/bedrock/get_input_message_content_telemetry.js +91 -0
  32. package/dist/src/instrumentation/bedrock/get_model_id_telemetry.d.ts +21 -0
  33. package/dist/src/instrumentation/bedrock/get_model_id_telemetry.js +54 -0
  34. package/dist/src/instrumentation/bedrock/get_reasoning_output_telemetry.d.ts +19 -0
  35. package/dist/src/instrumentation/bedrock/get_reasoning_output_telemetry.js +81 -0
  36. package/dist/src/instrumentation/bedrock/get_streaming_output_message_telemetry.d.ts +27 -0
  37. package/dist/src/instrumentation/bedrock/get_streaming_output_message_telemetry.js +126 -0
  38. package/dist/src/instrumentation/bedrock/get_tool_call_output_telemetry.d.ts +17 -0
  39. package/dist/src/instrumentation/bedrock/get_tool_call_output_telemetry.js +85 -0
  40. package/dist/src/instrumentation/bedrock/get_tool_definitions_telemetry.d.ts +15 -0
  41. package/dist/src/instrumentation/bedrock/get_tool_definitions_telemetry.js +68 -0
  42. package/dist/src/instrumentation/bedrock/set_telemetry_attributes.d.ts +18 -0
  43. package/dist/src/instrumentation/bedrock/set_telemetry_attributes.js +47 -0
  44. package/dist/src/instrumentation/cohere/get_chat_telemetry.d.ts +23 -0
  45. package/dist/src/instrumentation/cohere/get_chat_telemetry.js +77 -0
  46. package/dist/src/instrumentation/cohere/get_embeddings_telemetry.d.ts +18 -0
  47. package/dist/src/instrumentation/cohere/get_embeddings_telemetry.js +88 -0
  48. package/dist/src/instrumentation/cohere/get_structured_output_schema_telemetry.d.ts +12 -0
  49. package/dist/src/instrumentation/cohere/get_structured_output_schema_telemetry.js +18 -0
  50. package/dist/src/instrumentation/cohere/get_tool_call_output_telemetry.d.ts +31 -0
  51. package/dist/src/instrumentation/cohere/get_tool_call_output_telemetry.js +106 -0
  52. package/dist/src/instrumentation/cohere/get_tool_definitions_telemetry.d.ts +27 -0
  53. package/dist/src/instrumentation/cohere/get_tool_definitions_telemetry.js +75 -0
  54. package/dist/src/instrumentation/cohere/set_telemetry_attributes.d.ts +17 -0
  55. package/dist/src/instrumentation/cohere/set_telemetry_attributes.js +44 -0
  56. package/dist/src/instrumentation/elevenlabs/full_instrumentation.d.ts +28 -0
  57. package/dist/src/instrumentation/elevenlabs/full_instrumentation.js +209 -0
  58. package/dist/src/instrumentation/google/get_audio_telemetry.d.ts +9 -0
  59. package/dist/src/instrumentation/google/get_audio_telemetry.js +28 -0
  60. package/dist/src/instrumentation/google/get_cache_operations_telemetry.d.ts +23 -0
  61. package/dist/src/instrumentation/google/get_cache_operations_telemetry.js +154 -0
  62. package/dist/src/instrumentation/google/get_cache_telemetry.d.ts +16 -0
  63. package/dist/src/instrumentation/google/get_cache_telemetry.js +38 -0
  64. package/dist/src/instrumentation/google/get_embeddings_telemetry.d.ts +12 -0
  65. package/dist/src/instrumentation/google/get_embeddings_telemetry.js +85 -0
  66. package/dist/src/instrumentation/google/get_provider_name.d.ts +11 -0
  67. package/{src → dist/src}/instrumentation/google/get_provider_name.js +11 -12
  68. package/{src/instrumentation/google/get_reasoning_telemetry.js → dist/src/instrumentation/google/get_reasoning_telemetry.d.ts} +1 -11
  69. package/dist/src/instrumentation/google/get_reasoning_telemetry.js +21 -0
  70. package/dist/src/instrumentation/google/get_structured_output_schema_telemetry.d.ts +12 -0
  71. package/dist/src/instrumentation/google/get_structured_output_schema_telemetry.js +19 -0
  72. package/dist/src/instrumentation/google/set_telemetry_attributes.d.ts +18 -0
  73. package/dist/src/instrumentation/google/set_telemetry_attributes.js +98 -0
  74. package/dist/src/instrumentation/openai/get_audio_telemetry.d.ts +25 -0
  75. package/dist/src/instrumentation/openai/get_audio_telemetry.js +123 -0
  76. package/dist/src/instrumentation/openai/get_bedrock_mantle_telemetry.d.ts +35 -0
  77. package/dist/src/instrumentation/openai/get_bedrock_mantle_telemetry.js +148 -0
  78. package/dist/src/instrumentation/openai/get_cache_and_reasoning_telemetry.d.ts +27 -0
  79. package/dist/src/instrumentation/openai/get_cache_and_reasoning_telemetry.js +72 -0
  80. package/dist/src/instrumentation/openai/get_cache_config_telemetry.d.ts +28 -0
  81. package/dist/src/instrumentation/openai/get_cache_config_telemetry.js +91 -0
  82. package/dist/src/instrumentation/openai/get_embeddings_telemetry.d.ts +18 -0
  83. package/dist/src/instrumentation/openai/get_embeddings_telemetry.js +86 -0
  84. package/dist/src/instrumentation/openai/get_streaming_usage.d.ts +21 -0
  85. package/dist/src/instrumentation/openai/get_streaming_usage.js +74 -0
  86. package/dist/src/instrumentation/openai/get_structured_output_schema_telemetry.d.ts +12 -0
  87. package/dist/src/instrumentation/openai/get_structured_output_schema_telemetry.js +20 -0
  88. package/dist/src/instrumentation/openai/set_telemetry_attributes.d.ts +17 -0
  89. package/dist/src/instrumentation/openai/set_telemetry_attributes.js +47 -0
  90. package/dist/src/instrumentation/shared/get_structured_output_schema_telemetry.d.ts +35 -0
  91. package/dist/src/instrumentation/shared/get_structured_output_schema_telemetry.js +76 -0
  92. package/dist/src/instrumentation/vercel/full_instrumentation.d.ts +3 -0
  93. package/dist/src/instrumentation/vercel/full_instrumentation.js +54 -0
  94. package/dist/src/instrumentation/vercel/get_cache_creation_telemetry.d.ts +22 -0
  95. package/dist/src/instrumentation/vercel/get_cache_creation_telemetry.js +66 -0
  96. package/dist/src/instrumentation/vercel/get_structured_output_schema_telemetry.d.ts +24 -0
  97. package/dist/src/instrumentation/vercel/get_structured_output_schema_telemetry.js +84 -0
  98. package/dist/src/logger.d.ts +1 -0
  99. package/dist/src/logger.js +6 -0
  100. package/dist/src/otel/exporter.d.ts +19 -0
  101. package/dist/src/otel/exporter.js +94 -0
  102. package/dist/src/otel/propagation.d.ts +46 -0
  103. package/dist/src/otel/propagation.js +110 -0
  104. package/dist/src/otel/span-filter.d.ts +3 -0
  105. package/dist/src/otel/span-filter.js +61 -0
  106. package/dist/src/otel/span-processor.d.ts +55 -0
  107. package/dist/src/otel/span-processor.js +169 -0
  108. package/dist/src/otel/vercel-ai-sdk-span-filter.d.ts +12 -0
  109. package/dist/src/otel/vercel-ai-sdk-span-filter.js +88 -0
  110. package/dist/src/setup.d.ts +50 -0
  111. package/dist/src/setup.js +155 -0
  112. package/package.json +11 -5
  113. package/.prettierignore +0 -2
  114. package/.prettierrc.json +0 -7
  115. package/LICENSE-MIT +0 -21
  116. package/NOTICE +0 -12
  117. package/dist/api/generated/index.d.ts +0 -2
  118. package/dist/api/generated/types.gen.d.ts +0 -749
  119. package/eslint.config.mjs +0 -36
  120. package/index.d.ts +0 -167
  121. package/openapi-ts.config.mjs +0 -9
  122. package/scripts/generate_facade.mjs +0 -86
  123. package/src/api/caseConversion.ts +0 -58
  124. package/src/api/generated/client/client.gen.ts +0 -277
  125. package/src/api/generated/client/index.ts +0 -27
  126. package/src/api/generated/client/types.gen.ts +0 -218
  127. package/src/api/generated/client/utils.gen.ts +0 -316
  128. package/src/api/generated/client.gen.ts +0 -16
  129. package/src/api/generated/core/auth.gen.ts +0 -48
  130. package/src/api/generated/core/bodySerializer.gen.ts +0 -82
  131. package/src/api/generated/core/params.gen.ts +0 -178
  132. package/src/api/generated/core/pathSerializer.gen.ts +0 -171
  133. package/src/api/generated/core/queryKeySerializer.gen.ts +0 -117
  134. package/src/api/generated/core/serverSentEvents.gen.ts +0 -242
  135. package/src/api/generated/core/types.gen.ts +0 -110
  136. package/src/api/generated/core/utils.gen.ts +0 -140
  137. package/src/api/generated/facade.gen.ts +0 -68
  138. package/src/api/generated/index.ts +0 -4
  139. package/src/api/generated/sdk.gen.ts +0 -121
  140. package/src/api/index.ts +0 -45
  141. package/src/api/makeEndpoint.ts +0 -54
  142. package/src/auto-instrument.js +0 -171
  143. package/src/index.js +0 -19
  144. package/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.js +0 -107
  145. package/src/instrumentation/anthropic/get_streaming_stop_reason_telemetry.js +0 -121
  146. package/src/instrumentation/anthropic/get_tool_definitions_telemetry.js +0 -50
  147. package/src/instrumentation/anthropic/set_telemetry_attributes.js +0 -37
  148. package/src/instrumentation/bedrock/get_cache_telemetry.js +0 -104
  149. package/src/instrumentation/bedrock/get_input_message_content_telemetry.js +0 -94
  150. package/src/instrumentation/bedrock/get_streaming_output_message_telemetry.js +0 -87
  151. package/src/instrumentation/bedrock/set_telemetry_attributes.js +0 -36
  152. package/src/instrumentation/cohere/get_chat_telemetry.js +0 -88
  153. package/src/instrumentation/cohere/get_embeddings_telemetry.js +0 -107
  154. package/src/instrumentation/cohere/set_telemetry_attributes.js +0 -32
  155. package/src/instrumentation/elevenlabs/full_instrumentation.js +0 -236
  156. package/src/instrumentation/google/get_audio_telemetry.js +0 -30
  157. package/src/instrumentation/google/get_cache_telemetry.js +0 -25
  158. package/src/instrumentation/google/get_embeddings_telemetry.js +0 -99
  159. package/src/instrumentation/google/set_telemetry_attributes.js +0 -98
  160. package/src/instrumentation/openai/get_audio_telemetry.js +0 -149
  161. package/src/instrumentation/openai/get_cache_and_reasoning_telemetry.js +0 -71
  162. package/src/instrumentation/openai/get_embeddings_telemetry.js +0 -107
  163. package/src/instrumentation/openai/get_streaming_usage.js +0 -81
  164. package/src/instrumentation/openai/set_telemetry_attributes.js +0 -39
  165. package/src/instrumentation/vercel/full_instrumentation.js +0 -44
  166. package/src/logger.js +0 -8
  167. package/src/otel/exporter.js +0 -108
  168. package/src/otel/propagation.js +0 -133
  169. package/src/otel/span-filter.js +0 -69
  170. package/src/otel/span-processor.js +0 -162
  171. package/src/otel/vercel-ai-sdk-span-filter.js +0 -79
  172. package/src/setup.js +0 -167
  173. package/tests/api/index.test.js +0 -437
  174. package/tests/index.test.js +0 -824
  175. package/tests/instrumentation/anthropic/get_cache_and_reasoning_telemetry.test.js +0 -158
  176. package/tests/instrumentation/anthropic/get_streaming_stop_reason_telemetry.test.js +0 -117
  177. package/tests/instrumentation/anthropic/get_tool_definitions_telemetry.test.js +0 -82
  178. package/tests/instrumentation/bedrock/get_cache_telemetry.test.js +0 -102
  179. package/tests/instrumentation/bedrock/get_input_message_content_telemetry.test.js +0 -89
  180. package/tests/instrumentation/bedrock/get_streaming_output_message_telemetry.test.js +0 -87
  181. package/tests/instrumentation/cohere/get_chat_telemetry.test.js +0 -148
  182. package/tests/instrumentation/cohere/get_embeddings_telemetry.test.js +0 -132
  183. package/tests/instrumentation/elevenlabs/full_instrumentation.test.js +0 -258
  184. package/tests/instrumentation/google/get_embeddings_telemetry.test.js +0 -128
  185. package/tests/instrumentation/google/get_reasoning_telemetry.test.js +0 -41
  186. package/tests/instrumentation/google/set_telemetry_attributes.test.js +0 -219
  187. package/tests/instrumentation/openai/get_audio_telemetry.test.js +0 -170
  188. package/tests/instrumentation/openai/get_cache_and_reasoning_telemetry.test.js +0 -83
  189. package/tests/instrumentation/openai/get_embeddings_telemetry.test.js +0 -145
  190. package/tests/instrumentation/openai/get_streaming_usage.test.js +0 -105
  191. package/tests/instrumentation/vercel/full_instrumentation.test.js +0 -16
  192. package/tests/otel/vercel-ai-sdk-span-filter.test.js +0 -159
  193. package/tsconfig.json +0 -18
  194. /package/dist/{api → src/api}/caseConversion.d.ts +0 -0
  195. /package/dist/{api → src/api}/caseConversion.js +0 -0
  196. /package/dist/{api → src/api}/generated/client/client.gen.d.ts +0 -0
  197. /package/dist/{api → src/api}/generated/client/client.gen.js +0 -0
  198. /package/dist/{api → src/api}/generated/client/index.d.ts +0 -0
  199. /package/dist/{api → src/api}/generated/client/index.js +0 -0
  200. /package/dist/{api → src/api}/generated/client/types.gen.d.ts +0 -0
  201. /package/dist/{api → src/api}/generated/client/types.gen.js +0 -0
  202. /package/dist/{api → src/api}/generated/client/utils.gen.d.ts +0 -0
  203. /package/dist/{api → src/api}/generated/client/utils.gen.js +0 -0
  204. /package/dist/{api → src/api}/generated/client.gen.d.ts +0 -0
  205. /package/dist/{api → src/api}/generated/client.gen.js +0 -0
  206. /package/dist/{api → src/api}/generated/core/auth.gen.d.ts +0 -0
  207. /package/dist/{api → src/api}/generated/core/auth.gen.js +0 -0
  208. /package/dist/{api → src/api}/generated/core/bodySerializer.gen.d.ts +0 -0
  209. /package/dist/{api → src/api}/generated/core/bodySerializer.gen.js +0 -0
  210. /package/dist/{api → src/api}/generated/core/params.gen.d.ts +0 -0
  211. /package/dist/{api → src/api}/generated/core/params.gen.js +0 -0
  212. /package/dist/{api → src/api}/generated/core/pathSerializer.gen.d.ts +0 -0
  213. /package/dist/{api → src/api}/generated/core/pathSerializer.gen.js +0 -0
  214. /package/dist/{api → src/api}/generated/core/queryKeySerializer.gen.d.ts +0 -0
  215. /package/dist/{api → src/api}/generated/core/queryKeySerializer.gen.js +0 -0
  216. /package/dist/{api → src/api}/generated/core/serverSentEvents.gen.d.ts +0 -0
  217. /package/dist/{api → src/api}/generated/core/serverSentEvents.gen.js +0 -0
  218. /package/dist/{api → src/api}/generated/core/types.gen.d.ts +0 -0
  219. /package/dist/{api → src/api}/generated/core/types.gen.js +0 -0
  220. /package/dist/{api → src/api}/generated/core/utils.gen.d.ts +0 -0
  221. /package/dist/{api → src/api}/generated/core/utils.gen.js +0 -0
  222. /package/dist/{api → src/api}/generated/types.gen.js +0 -0
  223. /package/dist/{api → src/api}/index.d.ts +0 -0
  224. /package/dist/{api → src/api}/index.js +0 -0
  225. /package/dist/{api → src/api}/makeEndpoint.d.ts +0 -0
@@ -1,749 +0,0 @@
1
- export type ClientOptions = {
2
- baseUrl: 'https://app.weflayr.com/api' | (string & {});
3
- };
4
- /**
5
- * AllCustomerTagsOutput
6
- *
7
- * The customer-tags GET response: every known customer of the project.
8
- */
9
- export type AllCustomerTagsOutput = {
10
- /**
11
- * Customers
12
- */
13
- customers: Array<CustomerTagsOutput>;
14
- /**
15
- * Next Cursor
16
- */
17
- next_cursor: string | null;
18
- /**
19
- * Has More
20
- */
21
- has_more: boolean;
22
- };
23
- /**
24
- * ApiErrorOutput
25
- *
26
- * A refusal with a single human-readable message (401 and 404 bodies).
27
- */
28
- export type ApiErrorOutput = {
29
- /**
30
- * Error
31
- */
32
- error: string;
33
- };
34
- /**
35
- * CustomerMarginRow
36
- *
37
- * One customer's gross margin for a period.
38
- */
39
- export type CustomerMarginRow = {
40
- /**
41
- * Customer Name
42
- */
43
- customer_name: string;
44
- /**
45
- * Revenue
46
- */
47
- revenue: number;
48
- /**
49
- * Cost
50
- */
51
- cost: number;
52
- /**
53
- * Margin
54
- */
55
- margin: number;
56
- /**
57
- * Margin Pct
58
- */
59
- margin_pct: number | null;
60
- /**
61
- * Profitability Status
62
- */
63
- profitability_status: 'healthy' | 'watch' | 'at_risk' | 'unprofitable' | 'unknown';
64
- };
65
- /**
66
- * CustomerTags
67
- *
68
- * One customer's tag updates: a string value sets the tag, null deletes it.
69
- */
70
- export type CustomerTags = {
71
- /**
72
- * Customer Name
73
- */
74
- customer_name: string;
75
- /**
76
- * Tags
77
- */
78
- tags: {
79
- [key: string]: string | null;
80
- };
81
- };
82
- /**
83
- * CustomerTagsOutput
84
- *
85
- * One customer with its tags (possibly empty).
86
- */
87
- export type CustomerTagsOutput = {
88
- /**
89
- * Customer Name
90
- */
91
- customer_name: string;
92
- /**
93
- * Tags
94
- */
95
- tags: {
96
- [key: string]: string;
97
- };
98
- };
99
- /**
100
- * CustomersUpdatedOutput
101
- *
102
- * A successful tags upsert: how many customers were touched.
103
- */
104
- export type CustomersUpdatedOutput = {
105
- /**
106
- * Ok
107
- */
108
- ok: boolean;
109
- /**
110
- * Customers Updated
111
- */
112
- customers_updated: number;
113
- };
114
- /**
115
- * InvalidFieldDetail
116
- *
117
- * One offending field of a rejected payload.
118
- */
119
- export type InvalidFieldDetail = {
120
- /**
121
- * Field
122
- */
123
- field: string;
124
- /**
125
- * Error
126
- */
127
- error: string;
128
- };
129
- /**
130
- * InvalidPayloadOutput
131
- *
132
- * The all-or-nothing 422 body: every offending field, nothing written.
133
- */
134
- export type InvalidPayloadOutput = {
135
- /**
136
- * Error
137
- */
138
- error: string;
139
- /**
140
- * Detail
141
- */
142
- detail: Array<InvalidFieldDetail>;
143
- };
144
- /**
145
- * KeyMetricOutput
146
- *
147
- * A key-metric GET response: one row per booked value.
148
- */
149
- export type KeyMetricOutput = {
150
- /**
151
- * Rows
152
- */
153
- rows: Array<KeyMetricRowOutput>;
154
- /**
155
- * Next Cursor
156
- */
157
- next_cursor: string | null;
158
- /**
159
- * Has More
160
- */
161
- has_more: boolean;
162
- };
163
- /**
164
- * KeyMetricRow
165
- *
166
- * One booked key-metric value: the user, the metric, the amount, and
167
- * either its month or the month_start/month_end period it should be split
168
- * across.
169
- */
170
- export type KeyMetricRow = {
171
- /**
172
- * Metric Id
173
- *
174
- * Your own id for this value. Omit it to book a new value; reuse a previous one to update it (needs "upsert": true, see the "upsert" field).
175
- */
176
- metric_id?: string | null;
177
- /**
178
- * User Name
179
- */
180
- user_name: string;
181
- /**
182
- * Metric Name
183
- */
184
- metric_name: string;
185
- /**
186
- * Amount
187
- */
188
- amount: number;
189
- /**
190
- * Month
191
- */
192
- month?: string | null;
193
- /**
194
- * Month Start
195
- */
196
- month_start?: string | null;
197
- /**
198
- * Month End
199
- */
200
- month_end?: string | null;
201
- };
202
- /**
203
- * KeyMetricRowOutput
204
- *
205
- * One booked key-metric value.
206
- */
207
- export type KeyMetricRowOutput = {
208
- /**
209
- * Metric Name
210
- */
211
- metric_name: string;
212
- /**
213
- * Month
214
- */
215
- month: string;
216
- /**
217
- * Amount
218
- */
219
- amount: number;
220
- /**
221
- * Source
222
- */
223
- source: string;
224
- /**
225
- * Metric Id
226
- */
227
- metric_id: string;
228
- /**
229
- * User Name
230
- */
231
- user_name: string;
232
- };
233
- /**
234
- * MarginListOutput
235
- *
236
- * Margin GET response: one row per customer with booked revenue, sorted by
237
- * customer_name ascending.
238
- */
239
- export type MarginListOutput = {
240
- /**
241
- * Rows
242
- */
243
- rows: Array<CustomerMarginRow>;
244
- /**
245
- * Next Cursor
246
- */
247
- next_cursor: string | null;
248
- /**
249
- * Has More
250
- */
251
- has_more: boolean;
252
- };
253
- /**
254
- * RevenueOrKeyMetricDeletedRowOutput
255
- *
256
- * A successful values deletion: how many rows were removed.
257
- */
258
- export type RevenueOrKeyMetricDeletedRowOutput = {
259
- /**
260
- * Ok
261
- */
262
- ok: boolean;
263
- /**
264
- * Rows Deleted
265
- */
266
- rows_deleted: number;
267
- };
268
- /**
269
- * RevenueOrKeyMetricImportedRowOutput
270
- *
271
- * A successful values upsert: how many rows were imported.
272
- */
273
- export type RevenueOrKeyMetricImportedRowOutput = {
274
- /**
275
- * Ok
276
- */
277
- ok: boolean;
278
- /**
279
- * Rows Inserted
280
- */
281
- rows_inserted: number;
282
- };
283
- /**
284
- * RevenueOutput
285
- *
286
- * A revenue GET response: one row per booked value.
287
- */
288
- export type RevenueOutput = {
289
- /**
290
- * Rows
291
- */
292
- rows: Array<RevenueRowOutput>;
293
- /**
294
- * Next Cursor
295
- */
296
- next_cursor: string | null;
297
- /**
298
- * Has More
299
- */
300
- has_more: boolean;
301
- };
302
- /**
303
- * RevenueRow
304
- *
305
- * One booked revenue value: the customer, the amount, and either its
306
- * month or the month_start/month_end period it should be split across.
307
- */
308
- export type RevenueRow = {
309
- /**
310
- * Revenue Id
311
- *
312
- * Your own id for this value. Omit it to book a new value; reuse a previous one to update it (needs "upsert": true, see the "upsert" field).
313
- */
314
- revenue_id?: string | null;
315
- /**
316
- * Customer Name
317
- */
318
- customer_name: string;
319
- /**
320
- * Amount
321
- */
322
- amount: number;
323
- /**
324
- * Month
325
- */
326
- month?: string | null;
327
- /**
328
- * Month Start
329
- */
330
- month_start?: string | null;
331
- /**
332
- * Month End
333
- */
334
- month_end?: string | null;
335
- };
336
- /**
337
- * RevenueRowOutput
338
- *
339
- * One booked revenue value.
340
- */
341
- export type RevenueRowOutput = {
342
- /**
343
- * Metric Name
344
- */
345
- metric_name: string;
346
- /**
347
- * Month
348
- */
349
- month: string;
350
- /**
351
- * Amount
352
- */
353
- amount: number;
354
- /**
355
- * Source
356
- */
357
- source: string;
358
- /**
359
- * Revenue Id
360
- */
361
- revenue_id: string;
362
- /**
363
- * Customer Name
364
- */
365
- customer_name: string;
366
- };
367
- /**
368
- * SetCustomerTagsInput
369
- *
370
- * The tag updates posted to the public API, one entry per customer.
371
- */
372
- export type SetCustomerTagsInput = {
373
- /**
374
- * Customers
375
- */
376
- customers: Array<CustomerTags>;
377
- /**
378
- * Upsert
379
- *
380
- * If a customer's tag key already exists, overwrite it instead of rejecting the request.
381
- */
382
- upsert?: boolean;
383
- };
384
- /**
385
- * SetKeyMetricsInput
386
- *
387
- * The key-metric values posted to the public API. A user may have
388
- * several lines of the same metric in the same month; rows are only ever
389
- * matched against each other by metric_id, never by (user, metric,
390
- * month).
391
- */
392
- export type SetKeyMetricsInput = {
393
- /**
394
- * Rows
395
- */
396
- rows: Array<KeyMetricRow>;
397
- /**
398
- * Upsert
399
- *
400
- * If a row's metric_id already exists, overwrite it instead of rejecting the request.
401
- */
402
- upsert?: boolean;
403
- };
404
- /**
405
- * SetRevenueInput
406
- *
407
- * The revenue values posted to the public API. A customer may have several
408
- * revenue lines in the same month (e.g. one per product or contract); rows
409
- * are only ever matched against each other by revenue_id, never by
410
- * (customer, month).
411
- */
412
- export type SetRevenueInput = {
413
- /**
414
- * Rows
415
- */
416
- rows: Array<RevenueRow>;
417
- /**
418
- * Upsert
419
- *
420
- * If a row's revenue_id already exists, overwrite it instead of rejecting the request.
421
- */
422
- upsert?: boolean;
423
- };
424
- /**
425
- * TagsDeletedOutput
426
- *
427
- * A successful tags deletion: how many tags were removed.
428
- */
429
- export type TagsDeletedOutput = {
430
- /**
431
- * Ok
432
- */
433
- ok: boolean;
434
- /**
435
- * Tags Deleted
436
- */
437
- tags_deleted: number;
438
- };
439
- export type GetMarginData = {
440
- body?: never;
441
- path?: never;
442
- query?: {
443
- /**
444
- * Return only these customers' margin. Omit to return every customer's.
445
- */
446
- customer_names?: Array<string>;
447
- /**
448
- * Opaque cursor from a previous page's next_cursor.
449
- */
450
- cursor?: string;
451
- limit?: number;
452
- /**
453
- * Start of the period (inclusive), YYYY-MM-DD. Defaults to 30 days ago.
454
- */
455
- date_from?: string;
456
- /**
457
- * End of the period (inclusive), YYYY-MM-DD. Defaults to today.
458
- */
459
- date_to?: string;
460
- /**
461
- * Apply free-credit discounts to cost. Defaults to false.
462
- */
463
- apply_credits?: boolean;
464
- };
465
- url: '/margin/';
466
- };
467
- export type GetMarginErrors = {
468
- /**
469
- * Invalid request for this project type.
470
- */
471
- 400: ApiErrorOutput;
472
- /**
473
- * Missing or invalid API key.
474
- */
475
- 401: ApiErrorOutput;
476
- };
477
- export type GetMarginError = GetMarginErrors[keyof GetMarginErrors];
478
- export type GetMarginResponses = {
479
- /**
480
- * Success.
481
- */
482
- 200: MarginListOutput;
483
- };
484
- export type GetMarginResponse = GetMarginResponses[keyof GetMarginResponses];
485
- export type DeleteRevenueData = {
486
- body?: never;
487
- path?: never;
488
- query: {
489
- /**
490
- * Delete these customers' API-booked revenue (repeat the param for several).
491
- */
492
- customer_names: Array<string>;
493
- /**
494
- * First month to delete (inclusive). Omit both bounds to delete every matching API-booked value.
495
- */
496
- month_start?: string;
497
- /**
498
- * Last month to delete (inclusive).
499
- */
500
- month_end?: string;
501
- };
502
- url: '/revenue/';
503
- };
504
- export type DeleteRevenueErrors = {
505
- /**
506
- * Missing or invalid API key.
507
- */
508
- 401: ApiErrorOutput;
509
- /**
510
- * Invalid payload: every offending field is listed and nothing was written.
511
- */
512
- 422: InvalidPayloadOutput;
513
- };
514
- export type DeleteRevenueError = DeleteRevenueErrors[keyof DeleteRevenueErrors];
515
- export type DeleteRevenueResponses = {
516
- /**
517
- * Success.
518
- */
519
- 200: RevenueOrKeyMetricDeletedRowOutput;
520
- };
521
- export type DeleteRevenueResponse = DeleteRevenueResponses[keyof DeleteRevenueResponses];
522
- export type GetRevenueData = {
523
- body?: never;
524
- path?: never;
525
- query?: {
526
- /**
527
- * Return only these customers' revenue. Omit to return every customer's.
528
- */
529
- customer_names?: Array<string>;
530
- /**
531
- * Opaque cursor from a previous page's next_cursor.
532
- */
533
- cursor?: string;
534
- limit?: number;
535
- };
536
- url: '/revenue/';
537
- };
538
- export type GetRevenueErrors = {
539
- /**
540
- * Missing or invalid API key.
541
- */
542
- 401: ApiErrorOutput;
543
- };
544
- export type GetRevenueError = GetRevenueErrors[keyof GetRevenueErrors];
545
- export type GetRevenueResponses = {
546
- /**
547
- * Success.
548
- */
549
- 200: RevenueOutput;
550
- };
551
- export type GetRevenueResponse = GetRevenueResponses[keyof GetRevenueResponses];
552
- export type SetRevenueData = {
553
- body: SetRevenueInput;
554
- path?: never;
555
- query?: never;
556
- url: '/revenue/';
557
- };
558
- export type SetRevenueErrors = {
559
- /**
560
- * Missing or invalid API key.
561
- */
562
- 401: ApiErrorOutput;
563
- /**
564
- * Invalid payload: every offending field is listed and nothing was written.
565
- */
566
- 422: InvalidPayloadOutput;
567
- };
568
- export type SetRevenueError = SetRevenueErrors[keyof SetRevenueErrors];
569
- export type SetRevenueResponses = {
570
- /**
571
- * Success.
572
- */
573
- 200: RevenueOrKeyMetricImportedRowOutput;
574
- };
575
- export type SetRevenueResponse = SetRevenueResponses[keyof SetRevenueResponses];
576
- export type DeleteKeyMetricsData = {
577
- body?: never;
578
- path?: never;
579
- query: {
580
- /**
581
- * Delete these users' API-booked key metrics (repeat the param for several).
582
- */
583
- user_names: Array<string>;
584
- /**
585
- * First month to delete (inclusive). Omit both bounds to delete every matching API-booked value.
586
- */
587
- month_start?: string;
588
- /**
589
- * Last month to delete (inclusive).
590
- */
591
- month_end?: string;
592
- };
593
- url: '/key-metrics/';
594
- };
595
- export type DeleteKeyMetricsErrors = {
596
- /**
597
- * Missing or invalid API key.
598
- */
599
- 401: ApiErrorOutput;
600
- /**
601
- * Invalid payload: every offending field is listed and nothing was written.
602
- */
603
- 422: InvalidPayloadOutput;
604
- };
605
- export type DeleteKeyMetricsError = DeleteKeyMetricsErrors[keyof DeleteKeyMetricsErrors];
606
- export type DeleteKeyMetricsResponses = {
607
- /**
608
- * Success.
609
- */
610
- 200: RevenueOrKeyMetricDeletedRowOutput;
611
- };
612
- export type DeleteKeyMetricsResponse = DeleteKeyMetricsResponses[keyof DeleteKeyMetricsResponses];
613
- export type GetKeyMetricsData = {
614
- body?: never;
615
- path?: never;
616
- query?: {
617
- /**
618
- * Return only these users' key metrics. Omit to return every user's.
619
- */
620
- user_names?: Array<string>;
621
- /**
622
- * Opaque cursor from a previous page's next_cursor.
623
- */
624
- cursor?: string;
625
- limit?: number;
626
- };
627
- url: '/key-metrics/';
628
- };
629
- export type GetKeyMetricsErrors = {
630
- /**
631
- * Missing or invalid API key.
632
- */
633
- 401: ApiErrorOutput;
634
- };
635
- export type GetKeyMetricsError = GetKeyMetricsErrors[keyof GetKeyMetricsErrors];
636
- export type GetKeyMetricsResponses = {
637
- /**
638
- * Success.
639
- */
640
- 200: KeyMetricOutput;
641
- };
642
- export type GetKeyMetricsResponse = GetKeyMetricsResponses[keyof GetKeyMetricsResponses];
643
- export type SetKeyMetricsData = {
644
- body: SetKeyMetricsInput;
645
- path?: never;
646
- query?: never;
647
- url: '/key-metrics/';
648
- };
649
- export type SetKeyMetricsErrors = {
650
- /**
651
- * Missing or invalid API key.
652
- */
653
- 401: ApiErrorOutput;
654
- /**
655
- * Invalid payload: every offending field is listed and nothing was written.
656
- */
657
- 422: InvalidPayloadOutput;
658
- };
659
- export type SetKeyMetricsError = SetKeyMetricsErrors[keyof SetKeyMetricsErrors];
660
- export type SetKeyMetricsResponses = {
661
- /**
662
- * Success.
663
- */
664
- 200: RevenueOrKeyMetricImportedRowOutput;
665
- };
666
- export type SetKeyMetricsResponse = SetKeyMetricsResponses[keyof SetKeyMetricsResponses];
667
- export type DeleteCustomersTagsData = {
668
- body?: never;
669
- path?: never;
670
- query: {
671
- /**
672
- * Delete every tag of these customers.
673
- */
674
- customer_names: Array<string>;
675
- };
676
- url: '/customer-tags/';
677
- };
678
- export type DeleteCustomersTagsErrors = {
679
- /**
680
- * Missing or invalid API key.
681
- */
682
- 401: ApiErrorOutput;
683
- /**
684
- * Invalid payload: every offending field is listed and nothing was written.
685
- */
686
- 422: InvalidPayloadOutput;
687
- };
688
- export type DeleteCustomersTagsError = DeleteCustomersTagsErrors[keyof DeleteCustomersTagsErrors];
689
- export type DeleteCustomersTagsResponses = {
690
- /**
691
- * Success.
692
- */
693
- 200: TagsDeletedOutput;
694
- };
695
- export type DeleteCustomersTagsResponse = DeleteCustomersTagsResponses[keyof DeleteCustomersTagsResponses];
696
- export type GetCustomersTagsData = {
697
- body?: never;
698
- path?: never;
699
- query?: {
700
- /**
701
- * Return only these customers' tags. Omit to return every customer's.
702
- */
703
- customer_names?: Array<string>;
704
- /**
705
- * Opaque cursor from a previous page's next_cursor.
706
- */
707
- cursor?: string;
708
- limit?: number;
709
- };
710
- url: '/customer-tags/';
711
- };
712
- export type GetCustomersTagsErrors = {
713
- /**
714
- * Missing or invalid API key.
715
- */
716
- 401: ApiErrorOutput;
717
- };
718
- export type GetCustomersTagsError = GetCustomersTagsErrors[keyof GetCustomersTagsErrors];
719
- export type GetCustomersTagsResponses = {
720
- /**
721
- * Success.
722
- */
723
- 200: AllCustomerTagsOutput;
724
- };
725
- export type GetCustomersTagsResponse = GetCustomersTagsResponses[keyof GetCustomersTagsResponses];
726
- export type SetCustomersTagsData = {
727
- body: SetCustomerTagsInput;
728
- path?: never;
729
- query?: never;
730
- url: '/customer-tags/';
731
- };
732
- export type SetCustomersTagsErrors = {
733
- /**
734
- * Missing or invalid API key.
735
- */
736
- 401: ApiErrorOutput;
737
- /**
738
- * Invalid payload: every offending field is listed and nothing was written.
739
- */
740
- 422: InvalidPayloadOutput;
741
- };
742
- export type SetCustomersTagsError = SetCustomersTagsErrors[keyof SetCustomersTagsErrors];
743
- export type SetCustomersTagsResponses = {
744
- /**
745
- * Success.
746
- */
747
- 200: CustomersUpdatedOutput;
748
- };
749
- export type SetCustomersTagsResponse = SetCustomersTagsResponses[keyof SetCustomersTagsResponses];