@revenexx/sdk 0.0.2
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/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/sdk.js +16340 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/sdk.js +16250 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +20101 -0
- package/package.json +56 -0
- package/src/channel.ts +158 -0
- package/src/client.ts +950 -0
- package/src/enums/adapter.ts +4 -0
- package/src/enums/attribute-boolean-status.ts +7 -0
- package/src/enums/attribute-datetime-status.ts +7 -0
- package/src/enums/attribute-email-status.ts +7 -0
- package/src/enums/attribute-enum-status.ts +7 -0
- package/src/enums/attribute-float-status.ts +7 -0
- package/src/enums/attribute-integer-status.ts +7 -0
- package/src/enums/attribute-ip-status.ts +7 -0
- package/src/enums/attribute-line-status.ts +7 -0
- package/src/enums/attribute-longtext-status.ts +7 -0
- package/src/enums/attribute-mediumtext-status.ts +7 -0
- package/src/enums/attribute-point-status.ts +7 -0
- package/src/enums/attribute-polygon-status.ts +7 -0
- package/src/enums/attribute-relationship-status.ts +7 -0
- package/src/enums/attribute-string-status.ts +7 -0
- package/src/enums/attribute-text-status.ts +7 -0
- package/src/enums/attribute-url-status.ts +7 -0
- package/src/enums/attribute-varchar-status.ts +7 -0
- package/src/enums/build-runtime.ts +73 -0
- package/src/enums/code.ts +16 -0
- package/src/enums/collection.ts +4 -0
- package/src/enums/column-boolean-status.ts +7 -0
- package/src/enums/column-datetime-status.ts +7 -0
- package/src/enums/column-email-status.ts +7 -0
- package/src/enums/column-enum-status.ts +7 -0
- package/src/enums/column-float-status.ts +7 -0
- package/src/enums/column-integer-status.ts +7 -0
- package/src/enums/column-ip-status.ts +7 -0
- package/src/enums/column-line-status.ts +7 -0
- package/src/enums/column-longtext-status.ts +7 -0
- package/src/enums/column-mediumtext-status.ts +7 -0
- package/src/enums/column-point-status.ts +7 -0
- package/src/enums/column-polygon-status.ts +7 -0
- package/src/enums/column-relationship-status.ts +7 -0
- package/src/enums/column-string-status.ts +7 -0
- package/src/enums/column-text-status.ts +7 -0
- package/src/enums/column-url-status.ts +7 -0
- package/src/enums/column-varchar-status.ts +7 -0
- package/src/enums/compression.ts +5 -0
- package/src/enums/database-type.ts +4 -0
- package/src/enums/deployment-status.ts +8 -0
- package/src/enums/execution-status.ts +7 -0
- package/src/enums/execution-trigger.ts +5 -0
- package/src/enums/framework.ts +17 -0
- package/src/enums/gravity.ts +11 -0
- package/src/enums/health-antivirus-status.ts +5 -0
- package/src/enums/health-status-status.ts +4 -0
- package/src/enums/index-status.ts +7 -0
- package/src/enums/message-status.ts +7 -0
- package/src/enums/method.ts +9 -0
- package/src/enums/output.ts +9 -0
- package/src/enums/permissions.ts +22 -0
- package/src/enums/priority.ts +4 -0
- package/src/enums/range.ts +5 -0
- package/src/enums/runtime.ts +73 -0
- package/src/enums/runtimes.ts +73 -0
- package/src/enums/scopes.ts +57 -0
- package/src/enums/theme.ts +4 -0
- package/src/enums/timezone.ts +421 -0
- package/src/enums/type.ts +5 -0
- package/src/enums/use-cases.ts +9 -0
- package/src/id.ts +47 -0
- package/src/index.ts +92 -0
- package/src/models.ts +6013 -0
- package/src/operator.ts +308 -0
- package/src/permission.ts +57 -0
- package/src/query.ts +576 -0
- package/src/role.ts +100 -0
- package/src/service.ts +30 -0
- package/src/services/apps.ts +2473 -0
- package/src/services/avatars.ts +744 -0
- package/src/services/carts.ts +1057 -0
- package/src/services/channels.ts +227 -0
- package/src/services/customers.ts +729 -0
- package/src/services/greetings.ts +294 -0
- package/src/services/locale.ts +198 -0
- package/src/services/markets.ts +796 -0
- package/src/services/messaging.ts +3463 -0
- package/src/services/products.ts +3100 -0
- package/src/services/realtime.ts +537 -0
- package/src/services/search.ts +346 -0
- package/src/services/sites.ts +1847 -0
- package/src/services/storage.ts +1076 -0
- package/src/services/tokens.ts +314 -0
- package/types/channel.d.ts +74 -0
- package/types/client.d.ts +211 -0
- package/types/enums/adapter.d.ts +4 -0
- package/types/enums/attribute-boolean-status.d.ts +7 -0
- package/types/enums/attribute-datetime-status.d.ts +7 -0
- package/types/enums/attribute-email-status.d.ts +7 -0
- package/types/enums/attribute-enum-status.d.ts +7 -0
- package/types/enums/attribute-float-status.d.ts +7 -0
- package/types/enums/attribute-integer-status.d.ts +7 -0
- package/types/enums/attribute-ip-status.d.ts +7 -0
- package/types/enums/attribute-line-status.d.ts +7 -0
- package/types/enums/attribute-longtext-status.d.ts +7 -0
- package/types/enums/attribute-mediumtext-status.d.ts +7 -0
- package/types/enums/attribute-point-status.d.ts +7 -0
- package/types/enums/attribute-polygon-status.d.ts +7 -0
- package/types/enums/attribute-relationship-status.d.ts +7 -0
- package/types/enums/attribute-string-status.d.ts +7 -0
- package/types/enums/attribute-text-status.d.ts +7 -0
- package/types/enums/attribute-url-status.d.ts +7 -0
- package/types/enums/attribute-varchar-status.d.ts +7 -0
- package/types/enums/build-runtime.d.ts +73 -0
- package/types/enums/code.d.ts +16 -0
- package/types/enums/collection.d.ts +4 -0
- package/types/enums/column-boolean-status.d.ts +7 -0
- package/types/enums/column-datetime-status.d.ts +7 -0
- package/types/enums/column-email-status.d.ts +7 -0
- package/types/enums/column-enum-status.d.ts +7 -0
- package/types/enums/column-float-status.d.ts +7 -0
- package/types/enums/column-integer-status.d.ts +7 -0
- package/types/enums/column-ip-status.d.ts +7 -0
- package/types/enums/column-line-status.d.ts +7 -0
- package/types/enums/column-longtext-status.d.ts +7 -0
- package/types/enums/column-mediumtext-status.d.ts +7 -0
- package/types/enums/column-point-status.d.ts +7 -0
- package/types/enums/column-polygon-status.d.ts +7 -0
- package/types/enums/column-relationship-status.d.ts +7 -0
- package/types/enums/column-string-status.d.ts +7 -0
- package/types/enums/column-text-status.d.ts +7 -0
- package/types/enums/column-url-status.d.ts +7 -0
- package/types/enums/column-varchar-status.d.ts +7 -0
- package/types/enums/compression.d.ts +5 -0
- package/types/enums/database-type.d.ts +4 -0
- package/types/enums/deployment-status.d.ts +8 -0
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/framework.d.ts +17 -0
- package/types/enums/gravity.d.ts +11 -0
- package/types/enums/health-antivirus-status.d.ts +5 -0
- package/types/enums/health-status-status.d.ts +4 -0
- package/types/enums/index-status.d.ts +7 -0
- package/types/enums/message-status.d.ts +7 -0
- package/types/enums/method.d.ts +9 -0
- package/types/enums/output.d.ts +9 -0
- package/types/enums/permissions.d.ts +22 -0
- package/types/enums/priority.d.ts +4 -0
- package/types/enums/range.d.ts +5 -0
- package/types/enums/runtime.d.ts +73 -0
- package/types/enums/runtimes.d.ts +73 -0
- package/types/enums/scopes.d.ts +57 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +421 -0
- package/types/enums/type.d.ts +5 -0
- package/types/enums/use-cases.d.ts +9 -0
- package/types/id.d.ts +20 -0
- package/types/index.d.ts +92 -0
- package/types/models.d.ts +5830 -0
- package/types/operator.d.ts +180 -0
- package/types/permission.d.ts +43 -0
- package/types/query.d.ts +442 -0
- package/types/role.d.ts +70 -0
- package/types/service.d.ts +11 -0
- package/types/services/apps.d.ts +932 -0
- package/types/services/avatars.d.ts +318 -0
- package/types/services/carts.d.ts +352 -0
- package/types/services/channels.d.ts +75 -0
- package/types/services/customers.d.ts +231 -0
- package/types/services/greetings.d.ts +101 -0
- package/types/services/locale.d.ts +64 -0
- package/types/services/markets.d.ts +274 -0
- package/types/services/messaging.d.ts +1324 -0
- package/types/services/products.d.ts +1014 -0
- package/types/services/realtime.d.ts +134 -0
- package/types/services/search.d.ts +131 -0
- package/types/services/sites.d.ts +689 -0
- package/types/services/storage.d.ts +421 -0
- package/types/services/tokens.d.ts +119 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class Channels {
|
|
7
|
+
client: Client;
|
|
8
|
+
|
|
9
|
+
constructor(client: Client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @throws {RevenexxException}
|
|
16
|
+
* @returns {Promise<{}>}
|
|
17
|
+
*/
|
|
18
|
+
channelsList(): Promise<{}> {
|
|
19
|
+
|
|
20
|
+
const apiPath = '/v1/channels';
|
|
21
|
+
const payload: Payload = {};
|
|
22
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
23
|
+
|
|
24
|
+
const apiHeaders: { [header: string]: string } = {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return this.client.call(
|
|
28
|
+
'get',
|
|
29
|
+
uri,
|
|
30
|
+
apiHeaders,
|
|
31
|
+
payload
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @throws {RevenexxException}
|
|
38
|
+
* @returns {Promise<Models.Channel>}
|
|
39
|
+
*/
|
|
40
|
+
channelsCreate(): Promise<Models.Channel> {
|
|
41
|
+
|
|
42
|
+
const apiPath = '/v1/channels';
|
|
43
|
+
const payload: Payload = {};
|
|
44
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45
|
+
|
|
46
|
+
const apiHeaders: { [header: string]: string } = {
|
|
47
|
+
'content-type': 'application/json',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return this.client.call(
|
|
51
|
+
'post',
|
|
52
|
+
uri,
|
|
53
|
+
apiHeaders,
|
|
54
|
+
payload
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @throws {RevenexxException}
|
|
61
|
+
* @returns {Promise<Models.ChannelDefaults>}
|
|
62
|
+
*/
|
|
63
|
+
channelsDefaults(): Promise<Models.ChannelDefaults> {
|
|
64
|
+
|
|
65
|
+
const apiPath = '/v1/channels/defaults';
|
|
66
|
+
const payload: Payload = {};
|
|
67
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
68
|
+
|
|
69
|
+
const apiHeaders: { [header: string]: string } = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return this.client.call(
|
|
73
|
+
'post',
|
|
74
|
+
uri,
|
|
75
|
+
apiHeaders,
|
|
76
|
+
payload
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {string} params.id -
|
|
83
|
+
* @throws {RevenexxException}
|
|
84
|
+
* @returns {Promise<{}>}
|
|
85
|
+
*/
|
|
86
|
+
channelsDelete(params: { id: string }): Promise<{}>;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @param {string} id -
|
|
90
|
+
* @throws {RevenexxException}
|
|
91
|
+
* @returns {Promise<{}>}
|
|
92
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
93
|
+
*/
|
|
94
|
+
channelsDelete(id: string): Promise<{}>;
|
|
95
|
+
channelsDelete(
|
|
96
|
+
paramsOrFirst: { id: string } | string
|
|
97
|
+
): Promise<{}> {
|
|
98
|
+
let params: { id: string };
|
|
99
|
+
|
|
100
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
101
|
+
params = (paramsOrFirst || {}) as { id: string };
|
|
102
|
+
} else {
|
|
103
|
+
params = {
|
|
104
|
+
id: paramsOrFirst as string
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const id = params.id;
|
|
109
|
+
|
|
110
|
+
if (typeof id === 'undefined') {
|
|
111
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const apiPath = '/v1/channels/{id}'.replace('{id}', id);
|
|
115
|
+
const payload: Payload = {};
|
|
116
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
117
|
+
|
|
118
|
+
const apiHeaders: { [header: string]: string } = {
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return this.client.call(
|
|
122
|
+
'delete',
|
|
123
|
+
uri,
|
|
124
|
+
apiHeaders,
|
|
125
|
+
payload
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param {string} params.id -
|
|
132
|
+
* @throws {RevenexxException}
|
|
133
|
+
* @returns {Promise<Models.Channel>}
|
|
134
|
+
*/
|
|
135
|
+
channelsGet(params: { id: string }): Promise<Models.Channel>;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {string} id -
|
|
139
|
+
* @throws {RevenexxException}
|
|
140
|
+
* @returns {Promise<Models.Channel>}
|
|
141
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
142
|
+
*/
|
|
143
|
+
channelsGet(id: string): Promise<Models.Channel>;
|
|
144
|
+
channelsGet(
|
|
145
|
+
paramsOrFirst: { id: string } | string
|
|
146
|
+
): Promise<Models.Channel> {
|
|
147
|
+
let params: { id: string };
|
|
148
|
+
|
|
149
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
150
|
+
params = (paramsOrFirst || {}) as { id: string };
|
|
151
|
+
} else {
|
|
152
|
+
params = {
|
|
153
|
+
id: paramsOrFirst as string
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const id = params.id;
|
|
158
|
+
|
|
159
|
+
if (typeof id === 'undefined') {
|
|
160
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const apiPath = '/v1/channels/{id}'.replace('{id}', id);
|
|
164
|
+
const payload: Payload = {};
|
|
165
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
166
|
+
|
|
167
|
+
const apiHeaders: { [header: string]: string } = {
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return this.client.call(
|
|
171
|
+
'get',
|
|
172
|
+
uri,
|
|
173
|
+
apiHeaders,
|
|
174
|
+
payload
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @param {string} params.id -
|
|
181
|
+
* @throws {RevenexxException}
|
|
182
|
+
* @returns {Promise<Models.Channel>}
|
|
183
|
+
*/
|
|
184
|
+
channelsUpdate(params: { id: string }): Promise<Models.Channel>;
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
* @param {string} id -
|
|
188
|
+
* @throws {RevenexxException}
|
|
189
|
+
* @returns {Promise<Models.Channel>}
|
|
190
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
191
|
+
*/
|
|
192
|
+
channelsUpdate(id: string): Promise<Models.Channel>;
|
|
193
|
+
channelsUpdate(
|
|
194
|
+
paramsOrFirst: { id: string } | string
|
|
195
|
+
): Promise<Models.Channel> {
|
|
196
|
+
let params: { id: string };
|
|
197
|
+
|
|
198
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
199
|
+
params = (paramsOrFirst || {}) as { id: string };
|
|
200
|
+
} else {
|
|
201
|
+
params = {
|
|
202
|
+
id: paramsOrFirst as string
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const id = params.id;
|
|
207
|
+
|
|
208
|
+
if (typeof id === 'undefined') {
|
|
209
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const apiPath = '/v1/channels/{id}'.replace('{id}', id);
|
|
213
|
+
const payload: Payload = {};
|
|
214
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
215
|
+
|
|
216
|
+
const apiHeaders: { [header: string]: string } = {
|
|
217
|
+
'content-type': 'application/json',
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return this.client.call(
|
|
221
|
+
'put',
|
|
222
|
+
uri,
|
|
223
|
+
apiHeaders,
|
|
224
|
+
payload
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
}
|