@gtmi/ramp-api-client 0.0.1

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.
@@ -0,0 +1,140 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
4
+ import {
5
+ type ArraySeparatorStyle,
6
+ serializeArrayParam,
7
+ serializeObjectParam,
8
+ serializePrimitiveParam,
9
+ } from './pathSerializer.gen';
10
+
11
+ export interface PathSerializer {
12
+ path: Record<string, unknown>;
13
+ url: string;
14
+ }
15
+
16
+ export const PATH_PARAM_RE: RegExp = /\{[^{}]+\}/g;
17
+
18
+ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer): string => {
19
+ let url = _url;
20
+ const matches = _url.match(PATH_PARAM_RE);
21
+ if (matches) {
22
+ for (const match of matches) {
23
+ let explode = false;
24
+ let name = match.substring(1, match.length - 1);
25
+ let style: ArraySeparatorStyle = 'simple';
26
+
27
+ if (name.endsWith('*')) {
28
+ explode = true;
29
+ name = name.substring(0, name.length - 1);
30
+ }
31
+
32
+ if (name.startsWith('.')) {
33
+ name = name.substring(1);
34
+ style = 'label';
35
+ } else if (name.startsWith(';')) {
36
+ name = name.substring(1);
37
+ style = 'matrix';
38
+ }
39
+
40
+ const value = path[name];
41
+
42
+ if (value === undefined || value === null) {
43
+ continue;
44
+ }
45
+
46
+ if (Array.isArray(value)) {
47
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
48
+ continue;
49
+ }
50
+
51
+ if (typeof value === 'object') {
52
+ url = url.replace(
53
+ match,
54
+ serializeObjectParam({
55
+ explode,
56
+ name,
57
+ style,
58
+ value: value as Record<string, unknown>,
59
+ valueOnly: true,
60
+ }),
61
+ );
62
+ continue;
63
+ }
64
+
65
+ if (style === 'matrix') {
66
+ url = url.replace(
67
+ match,
68
+ `;${serializePrimitiveParam({
69
+ name,
70
+ value: value as string,
71
+ })}`,
72
+ );
73
+ continue;
74
+ }
75
+
76
+ const replaceValue = encodeURIComponent(
77
+ style === 'label' ? `.${value as string}` : (value as string),
78
+ );
79
+ url = url.replace(match, replaceValue);
80
+ }
81
+ }
82
+ return url;
83
+ };
84
+
85
+ export const getUrl = ({
86
+ baseUrl,
87
+ path,
88
+ query,
89
+ querySerializer,
90
+ url: _url,
91
+ }: {
92
+ baseUrl?: string;
93
+ path?: Record<string, unknown>;
94
+ query?: Record<string, unknown>;
95
+ querySerializer: QuerySerializer;
96
+ url: string;
97
+ }): string => {
98
+ const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
99
+ let url = (baseUrl ?? '') + pathUrl;
100
+ if (path) {
101
+ url = defaultPathSerializer({ path, url });
102
+ }
103
+ let search = query ? querySerializer(query) : '';
104
+ if (search.startsWith('?')) {
105
+ search = search.substring(1);
106
+ }
107
+ if (search) {
108
+ url += `?${search}`;
109
+ }
110
+ return url;
111
+ };
112
+
113
+ export function getValidRequestBody(options: {
114
+ body?: unknown;
115
+ bodySerializer?: BodySerializer | null;
116
+ serializedBody?: unknown;
117
+ }): unknown {
118
+ const hasBody = options.body !== undefined;
119
+ const isSerializedBody = hasBody && options.bodySerializer;
120
+
121
+ if (isSerializedBody) {
122
+ if ('serializedBody' in options) {
123
+ const hasSerializedBody =
124
+ options.serializedBody !== undefined && options.serializedBody !== '';
125
+
126
+ return hasSerializedBody ? options.serializedBody : null;
127
+ }
128
+
129
+ // not all clients implement a serializedBody property (i.e., client-axios)
130
+ return options.body !== '' ? options.body : null;
131
+ }
132
+
133
+ // plain/text body
134
+ if (hasBody) {
135
+ return options.body;
136
+ }
137
+
138
+ // no body was provided
139
+ return undefined;
140
+ }
@@ -0,0 +1,268 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export {
4
+ deleteConversationMemoryConversationSummaries,
5
+ deleteConversationMemoryIdentifiers,
6
+ deleteConversationMemoryObservations,
7
+ deleteConversationMemoryProfiles,
8
+ deleteConversationMemoryReset,
9
+ deleteConversationMemoryTraitGroups,
10
+ deleteConversationalIntelligenceOperator,
11
+ deleteLeadGen,
12
+ deleteLinkShortenerByCode,
13
+ deleteTemplate,
14
+ getCampaign,
15
+ getConversationMemoryConversationSummaries,
16
+ getConversationMemoryIdentifiers,
17
+ getConversationMemoryObservations,
18
+ getConversationMemoryProfiles,
19
+ getConversationMemoryTraitGroups,
20
+ getConversationMemoryTraits,
21
+ getConversationalIntelligenceOperator,
22
+ getConversationsFetch,
23
+ getDocsOpenapiJson,
24
+ getHealth,
25
+ getIntelligenceConfiguration,
26
+ getLinkShortener,
27
+ getLookupDemo,
28
+ getParticipants,
29
+ getSupportedRegions,
30
+ getSyncToken,
31
+ getVoiceToken,
32
+ patchConversationMemoryConversationSummaries,
33
+ patchConversationMemoryIdentifiers,
34
+ patchConversationMemoryObservations,
35
+ patchConversationMemoryProfiles,
36
+ patchConversationMemoryTraitGroups,
37
+ patchLeadGen,
38
+ patchLinkShortener,
39
+ postAssignDemo,
40
+ postConversationMemoryConversationSummaries,
41
+ postConversationMemoryIdentifiers,
42
+ postConversationMemoryObservations,
43
+ postConversationMemoryProfiles,
44
+ postConversationMemoryProfilesLookup,
45
+ postConversationMemoryRecall,
46
+ postConversationMemoryTraitGroups,
47
+ postConversationalIntelligenceOperator,
48
+ postConversations,
49
+ postConversationsCommunicationsByConversationId,
50
+ postConversationsToken,
51
+ postCreateExternalFlexConnection,
52
+ postInstallFlexPlugin,
53
+ postIntelligenceConfiguration,
54
+ postLeadGen,
55
+ postLeadGenMonitor,
56
+ postLinkShortener,
57
+ postLiveAgentWebchatConnect,
58
+ postLiveAgentWebchatEnd,
59
+ postLiveAgentWebchatSend,
60
+ postParticipants,
61
+ postTemplate,
62
+ postTemplateAutogen,
63
+ postUiConfig,
64
+ putConversationalIntelligenceOperator,
65
+ putConversations,
66
+ putIntelligenceConfiguration,
67
+ putParticipants,
68
+ type Options,
69
+ } from './sdk.gen';
70
+ export type {
71
+ AutogenRequest,
72
+ ClientOptions,
73
+ DeleteConversationMemoryConversationSummariesData,
74
+ DeleteConversationMemoryConversationSummariesErrors,
75
+ DeleteConversationMemoryConversationSummariesResponses,
76
+ DeleteConversationMemoryIdentifiersData,
77
+ DeleteConversationMemoryIdentifiersErrors,
78
+ DeleteConversationMemoryIdentifiersResponses,
79
+ DeleteConversationMemoryObservationsData,
80
+ DeleteConversationMemoryObservationsErrors,
81
+ DeleteConversationMemoryObservationsResponses,
82
+ DeleteConversationMemoryProfilesData,
83
+ DeleteConversationMemoryProfilesErrors,
84
+ DeleteConversationMemoryProfilesResponses,
85
+ DeleteConversationMemoryResetData,
86
+ DeleteConversationMemoryResetErrors,
87
+ DeleteConversationMemoryResetResponses,
88
+ DeleteConversationMemoryTraitGroupsData,
89
+ DeleteConversationMemoryTraitGroupsErrors,
90
+ DeleteConversationMemoryTraitGroupsResponses,
91
+ DeleteConversationalIntelligenceOperatorData,
92
+ DeleteConversationalIntelligenceOperatorErrors,
93
+ DeleteConversationalIntelligenceOperatorResponses,
94
+ DeleteLeadGenData,
95
+ DeleteLeadGenErrors,
96
+ DeleteLeadGenResponses,
97
+ DeleteLinkShortenerByCodeData,
98
+ DeleteLinkShortenerByCodeErrors,
99
+ DeleteLinkShortenerByCodeResponses,
100
+ DeleteTemplateData,
101
+ DeleteTemplateErrors,
102
+ DeleteTemplateResponses,
103
+ GetCampaignData,
104
+ GetCampaignErrors,
105
+ GetCampaignResponses,
106
+ GetConversationMemoryConversationSummariesData,
107
+ GetConversationMemoryConversationSummariesErrors,
108
+ GetConversationMemoryConversationSummariesResponses,
109
+ GetConversationMemoryIdentifiersData,
110
+ GetConversationMemoryIdentifiersErrors,
111
+ GetConversationMemoryIdentifiersResponses,
112
+ GetConversationMemoryObservationsData,
113
+ GetConversationMemoryObservationsErrors,
114
+ GetConversationMemoryObservationsResponses,
115
+ GetConversationMemoryProfilesData,
116
+ GetConversationMemoryProfilesErrors,
117
+ GetConversationMemoryProfilesResponses,
118
+ GetConversationMemoryTraitGroupsData,
119
+ GetConversationMemoryTraitGroupsErrors,
120
+ GetConversationMemoryTraitGroupsResponses,
121
+ GetConversationMemoryTraitsData,
122
+ GetConversationMemoryTraitsErrors,
123
+ GetConversationMemoryTraitsResponses,
124
+ GetConversationalIntelligenceOperatorData,
125
+ GetConversationalIntelligenceOperatorErrors,
126
+ GetConversationalIntelligenceOperatorResponses,
127
+ GetConversationsFetchData,
128
+ GetConversationsFetchErrors,
129
+ GetConversationsFetchResponses,
130
+ GetDocsOpenapiJsonData,
131
+ GetDocsOpenapiJsonErrors,
132
+ GetDocsOpenapiJsonResponses,
133
+ GetHealthData,
134
+ GetHealthErrors,
135
+ GetHealthResponses,
136
+ GetIntelligenceConfigurationData,
137
+ GetIntelligenceConfigurationErrors,
138
+ GetIntelligenceConfigurationResponses,
139
+ GetLinkShortenerData,
140
+ GetLinkShortenerErrors,
141
+ GetLinkShortenerResponses,
142
+ GetLookupDemoData,
143
+ GetLookupDemoErrors,
144
+ GetLookupDemoResponses,
145
+ GetParticipantsData,
146
+ GetParticipantsErrors,
147
+ GetParticipantsResponses,
148
+ GetSupportedRegionsData,
149
+ GetSupportedRegionsErrors,
150
+ GetSupportedRegionsResponse,
151
+ GetSupportedRegionsResponses,
152
+ GetSyncTokenData,
153
+ GetSyncTokenErrors,
154
+ GetSyncTokenResponses,
155
+ GetVoiceTokenData,
156
+ GetVoiceTokenErrors,
157
+ GetVoiceTokenResponses,
158
+ PatchConversationMemoryConversationSummariesData,
159
+ PatchConversationMemoryConversationSummariesErrors,
160
+ PatchConversationMemoryConversationSummariesResponses,
161
+ PatchConversationMemoryIdentifiersData,
162
+ PatchConversationMemoryIdentifiersErrors,
163
+ PatchConversationMemoryIdentifiersResponses,
164
+ PatchConversationMemoryObservationsData,
165
+ PatchConversationMemoryObservationsErrors,
166
+ PatchConversationMemoryObservationsResponses,
167
+ PatchConversationMemoryProfilesData,
168
+ PatchConversationMemoryProfilesErrors,
169
+ PatchConversationMemoryProfilesResponses,
170
+ PatchConversationMemoryTraitGroupsData,
171
+ PatchConversationMemoryTraitGroupsErrors,
172
+ PatchConversationMemoryTraitGroupsResponses,
173
+ PatchLeadGenData,
174
+ PatchLeadGenErrors,
175
+ PatchLeadGenResponses,
176
+ PatchLinkShortenerData,
177
+ PatchLinkShortenerErrors,
178
+ PatchLinkShortenerResponses,
179
+ PostAssignDemoData,
180
+ PostAssignDemoErrors,
181
+ PostAssignDemoResponses,
182
+ PostConversationMemoryConversationSummariesData,
183
+ PostConversationMemoryConversationSummariesErrors,
184
+ PostConversationMemoryConversationSummariesResponses,
185
+ PostConversationMemoryIdentifiersData,
186
+ PostConversationMemoryIdentifiersErrors,
187
+ PostConversationMemoryIdentifiersResponses,
188
+ PostConversationMemoryObservationsData,
189
+ PostConversationMemoryObservationsErrors,
190
+ PostConversationMemoryObservationsResponses,
191
+ PostConversationMemoryProfilesData,
192
+ PostConversationMemoryProfilesErrors,
193
+ PostConversationMemoryProfilesLookupData,
194
+ PostConversationMemoryProfilesLookupErrors,
195
+ PostConversationMemoryProfilesLookupResponses,
196
+ PostConversationMemoryProfilesResponses,
197
+ PostConversationMemoryRecallData,
198
+ PostConversationMemoryRecallErrors,
199
+ PostConversationMemoryRecallResponses,
200
+ PostConversationMemoryTraitGroupsData,
201
+ PostConversationMemoryTraitGroupsErrors,
202
+ PostConversationMemoryTraitGroupsResponses,
203
+ PostConversationalIntelligenceOperatorData,
204
+ PostConversationalIntelligenceOperatorErrors,
205
+ PostConversationalIntelligenceOperatorResponses,
206
+ PostConversationsCommunicationsByConversationIdData,
207
+ PostConversationsCommunicationsByConversationIdErrors,
208
+ PostConversationsCommunicationsByConversationIdResponses,
209
+ PostConversationsData,
210
+ PostConversationsErrors,
211
+ PostConversationsResponses,
212
+ PostConversationsTokenData,
213
+ PostConversationsTokenErrors,
214
+ PostConversationsTokenResponses,
215
+ PostCreateExternalFlexConnectionData,
216
+ PostCreateExternalFlexConnectionErrors,
217
+ PostCreateExternalFlexConnectionResponses,
218
+ PostInstallFlexPluginData,
219
+ PostInstallFlexPluginErrors,
220
+ PostInstallFlexPluginResponses,
221
+ PostIntelligenceConfigurationData,
222
+ PostIntelligenceConfigurationErrors,
223
+ PostIntelligenceConfigurationResponses,
224
+ PostLeadGenData,
225
+ PostLeadGenErrors,
226
+ PostLeadGenMonitorData,
227
+ PostLeadGenMonitorErrors,
228
+ PostLeadGenMonitorResponses,
229
+ PostLeadGenResponses,
230
+ PostLinkShortenerData,
231
+ PostLinkShortenerErrors,
232
+ PostLinkShortenerResponses,
233
+ PostLiveAgentWebchatConnectData,
234
+ PostLiveAgentWebchatConnectErrors,
235
+ PostLiveAgentWebchatConnectResponses,
236
+ PostLiveAgentWebchatEndData,
237
+ PostLiveAgentWebchatEndErrors,
238
+ PostLiveAgentWebchatEndResponses,
239
+ PostLiveAgentWebchatSendData,
240
+ PostLiveAgentWebchatSendErrors,
241
+ PostLiveAgentWebchatSendResponses,
242
+ PostParticipantsData,
243
+ PostParticipantsErrors,
244
+ PostParticipantsResponses,
245
+ PostTemplateAutogenData,
246
+ PostTemplateAutogenErrors,
247
+ PostTemplateAutogenResponses,
248
+ PostTemplateData,
249
+ PostTemplateErrors,
250
+ PostTemplateResponses,
251
+ PostUiConfigData,
252
+ PostUiConfigErrors,
253
+ PostUiConfigResponses,
254
+ PutConversationalIntelligenceOperatorData,
255
+ PutConversationalIntelligenceOperatorErrors,
256
+ PutConversationalIntelligenceOperatorResponses,
257
+ PutConversationsData,
258
+ PutConversationsErrors,
259
+ PutConversationsResponses,
260
+ PutIntelligenceConfigurationData,
261
+ PutIntelligenceConfigurationErrors,
262
+ PutIntelligenceConfigurationResponses,
263
+ PutParticipantsData,
264
+ PutParticipantsErrors,
265
+ PutParticipantsResponses,
266
+ ShortenUrlInput,
267
+ SupportedRegion,
268
+ } from './types.gen';