@wildix/xbees-kite-client 1.0.8 → 1.0.10

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 (37) hide show
  1. package/dist-cjs/Kite.js +8 -2
  2. package/dist-cjs/KiteClient.js +4 -2
  3. package/dist-cjs/commands/{ListCalendarSlotsCommand.js → CancelCalendarEventCommand.js} +7 -7
  4. package/dist-cjs/commands/GetCalendarAvailabilityCommand.js +21 -0
  5. package/dist-cjs/commands/RescheduleCalendarEventCommand.js +21 -0
  6. package/dist-cjs/commands/ScheduleCalendarEventCommand.js +21 -0
  7. package/dist-cjs/commands/index.js +4 -1
  8. package/dist-cjs/models/models_0.js +22 -2
  9. package/dist-cjs/protocols/Aws_restJson1.js +155 -24
  10. package/dist-es/Kite.js +8 -2
  11. package/dist-es/KiteClient.js +4 -2
  12. package/dist-es/commands/CancelCalendarEventCommand.js +17 -0
  13. package/dist-es/commands/GetCalendarAvailabilityCommand.js +17 -0
  14. package/dist-es/commands/RescheduleCalendarEventCommand.js +17 -0
  15. package/dist-es/commands/ScheduleCalendarEventCommand.js +17 -0
  16. package/dist-es/commands/index.js +4 -1
  17. package/dist-es/models/models_0.js +21 -1
  18. package/dist-es/protocols/Aws_restJson1.js +144 -19
  19. package/dist-types/Kite.d.ts +28 -7
  20. package/dist-types/KiteClient.d.ts +8 -5
  21. package/dist-types/commands/CancelCalendarEventCommand.d.ts +146 -0
  22. package/dist-types/commands/CreateWidgetCommand.d.ts +2 -2
  23. package/dist-types/commands/GetCalendarAvailabilityCommand.d.ts +89 -0
  24. package/dist-types/commands/GetWidgetCommand.d.ts +1 -1
  25. package/dist-types/commands/ListWidgetsCommand.d.ts +1 -1
  26. package/dist-types/commands/RescheduleCalendarEventCommand.d.ts +155 -0
  27. package/dist-types/commands/ScheduleCalendarEventCommand.d.ts +152 -0
  28. package/dist-types/commands/UpdateWidgetCommand.d.ts +2 -2
  29. package/dist-types/commands/index.d.ts +4 -1
  30. package/dist-types/models/models_0.d.ts +272 -16
  31. package/dist-types/protocols/Aws_restJson1.d.ts +36 -9
  32. package/dist-types/runtimeConfig.browser.d.ts +2 -2
  33. package/dist-types/runtimeConfig.d.ts +2 -2
  34. package/dist-types/runtimeConfig.native.d.ts +2 -2
  35. package/package.json +1 -1
  36. package/dist-es/commands/ListCalendarSlotsCommand.js +0 -17
  37. package/dist-types/commands/ListCalendarSlotsCommand.d.ts +0 -64
package/dist-cjs/Kite.js CHANGED
@@ -2,25 +2,31 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Kite = void 0;
4
4
  const KiteClient_1 = require("./KiteClient");
5
+ const CancelCalendarEventCommand_1 = require("./commands/CancelCalendarEventCommand");
5
6
  const CreateWidgetCommand_1 = require("./commands/CreateWidgetCommand");
6
7
  const DeleteWidgetCommand_1 = require("./commands/DeleteWidgetCommand");
8
+ const GetCalendarAvailabilityCommand_1 = require("./commands/GetCalendarAvailabilityCommand");
7
9
  const GetConfigCommand_1 = require("./commands/GetConfigCommand");
8
10
  const GetWidgetCommand_1 = require("./commands/GetWidgetCommand");
9
11
  const ListAgentsCommand_1 = require("./commands/ListAgentsCommand");
10
- const ListCalendarSlotsCommand_1 = require("./commands/ListCalendarSlotsCommand");
11
12
  const ListServicesCommand_1 = require("./commands/ListServicesCommand");
12
13
  const ListWidgetsCommand_1 = require("./commands/ListWidgetsCommand");
14
+ const RescheduleCalendarEventCommand_1 = require("./commands/RescheduleCalendarEventCommand");
15
+ const ScheduleCalendarEventCommand_1 = require("./commands/ScheduleCalendarEventCommand");
13
16
  const UpdateWidgetCommand_1 = require("./commands/UpdateWidgetCommand");
14
17
  const smithy_client_1 = require("@smithy/smithy-client");
15
18
  const commands = {
19
+ CancelCalendarEventCommand: CancelCalendarEventCommand_1.CancelCalendarEventCommand,
16
20
  CreateWidgetCommand: CreateWidgetCommand_1.CreateWidgetCommand,
17
21
  DeleteWidgetCommand: DeleteWidgetCommand_1.DeleteWidgetCommand,
22
+ GetCalendarAvailabilityCommand: GetCalendarAvailabilityCommand_1.GetCalendarAvailabilityCommand,
18
23
  GetConfigCommand: GetConfigCommand_1.GetConfigCommand,
19
24
  GetWidgetCommand: GetWidgetCommand_1.GetWidgetCommand,
20
25
  ListAgentsCommand: ListAgentsCommand_1.ListAgentsCommand,
21
- ListCalendarSlotsCommand: ListCalendarSlotsCommand_1.ListCalendarSlotsCommand,
22
26
  ListServicesCommand: ListServicesCommand_1.ListServicesCommand,
23
27
  ListWidgetsCommand: ListWidgetsCommand_1.ListWidgetsCommand,
28
+ RescheduleCalendarEventCommand: RescheduleCalendarEventCommand_1.RescheduleCalendarEventCommand,
29
+ ScheduleCalendarEventCommand: ScheduleCalendarEventCommand_1.ScheduleCalendarEventCommand,
24
30
  UpdateWidgetCommand: UpdateWidgetCommand_1.UpdateWidgetCommand,
25
31
  };
26
32
  class Kite extends KiteClient_1.KiteClient {
@@ -15,7 +15,7 @@ class KiteClient extends smithy_client_1.Client {
15
15
  let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
16
16
  let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
17
17
  let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
18
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `api-${configuration.env}.x-bees.com` : 'api.x-bees.com';
18
+ const hostname = ['stable', 'stage'].includes(configuration?.env || '') ? `api-${configuration?.env}.x-bees.com` : 'api.x-bees.com';
19
19
  const endpoint = () => {
20
20
  return {
21
21
  hostname,
@@ -30,7 +30,9 @@ class KiteClient extends smithy_client_1.Client {
30
30
  };
31
31
  super(config);
32
32
  this.config = config;
33
- this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
33
+ if (configuration?.token) {
34
+ this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
35
+ }
34
36
  this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
35
37
  this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
36
38
  this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListCalendarSlotsCommand = exports.$Command = void 0;
3
+ exports.CancelCalendarEventCommand = exports.$Command = void 0;
4
4
  const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
5
  const middleware_serde_1 = require("@smithy/middleware-serde");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
7
7
  Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- class ListCalendarSlotsCommand extends smithy_client_1.Command.classBuilder()
8
+ class CancelCalendarEventCommand extends smithy_client_1.Command.classBuilder()
9
9
  .m(function (Command, cs, config, o) {
10
10
  return [
11
11
  (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
12
  ];
13
13
  })
14
- .s("Kite", "ListCalendarSlots", {})
15
- .n("KiteClient", "ListCalendarSlotsCommand")
14
+ .s("Kite", "CancelCalendarEvent", {})
15
+ .n("KiteClient", "CancelCalendarEventCommand")
16
16
  .f(void 0, void 0)
17
- .ser(Aws_restJson1_1.se_ListCalendarSlotsCommand)
18
- .de(Aws_restJson1_1.de_ListCalendarSlotsCommand)
17
+ .ser(Aws_restJson1_1.se_CancelCalendarEventCommand)
18
+ .de(Aws_restJson1_1.de_CancelCalendarEventCommand)
19
19
  .build() {
20
20
  }
21
- exports.ListCalendarSlotsCommand = ListCalendarSlotsCommand;
21
+ exports.CancelCalendarEventCommand = CancelCalendarEventCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetCalendarAvailabilityCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class GetCalendarAvailabilityCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Kite", "GetCalendarAvailability", {})
15
+ .n("KiteClient", "GetCalendarAvailabilityCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_GetCalendarAvailabilityCommand)
18
+ .de(Aws_restJson1_1.de_GetCalendarAvailabilityCommand)
19
+ .build() {
20
+ }
21
+ exports.GetCalendarAvailabilityCommand = GetCalendarAvailabilityCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RescheduleCalendarEventCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class RescheduleCalendarEventCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Kite", "RescheduleCalendarEvent", {})
15
+ .n("KiteClient", "RescheduleCalendarEventCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_RescheduleCalendarEventCommand)
18
+ .de(Aws_restJson1_1.de_RescheduleCalendarEventCommand)
19
+ .build() {
20
+ }
21
+ exports.RescheduleCalendarEventCommand = RescheduleCalendarEventCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleCalendarEventCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class ScheduleCalendarEventCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Kite", "ScheduleCalendarEvent", {})
15
+ .n("KiteClient", "ScheduleCalendarEventCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_ScheduleCalendarEventCommand)
18
+ .de(Aws_restJson1_1.de_ScheduleCalendarEventCommand)
19
+ .build() {
20
+ }
21
+ exports.ScheduleCalendarEventCommand = ScheduleCalendarEventCommand;
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./CancelCalendarEventCommand"), exports);
4
5
  tslib_1.__exportStar(require("./CreateWidgetCommand"), exports);
5
6
  tslib_1.__exportStar(require("./DeleteWidgetCommand"), exports);
7
+ tslib_1.__exportStar(require("./GetCalendarAvailabilityCommand"), exports);
6
8
  tslib_1.__exportStar(require("./GetConfigCommand"), exports);
7
9
  tslib_1.__exportStar(require("./GetWidgetCommand"), exports);
8
10
  tslib_1.__exportStar(require("./ListAgentsCommand"), exports);
9
- tslib_1.__exportStar(require("./ListCalendarSlotsCommand"), exports);
10
11
  tslib_1.__exportStar(require("./ListServicesCommand"), exports);
11
12
  tslib_1.__exportStar(require("./ListWidgetsCommand"), exports);
13
+ tslib_1.__exportStar(require("./RescheduleCalendarEventCommand"), exports);
14
+ tslib_1.__exportStar(require("./ScheduleCalendarEventCommand"), exports);
12
15
  tslib_1.__exportStar(require("./UpdateWidgetCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListAgentsFilter = exports.WidgetNotFoundException = exports.TargetNotFoundException = exports.KiteVariant = exports.KiteFeatures = exports.WidgetTarget = exports.WidgetRouteRule = exports.WidgetRouteTimeFrameDay = exports.Element = exports.ActionElement = exports.ButtonVariant = exports.ButtonHandler = exports.RateLimitExceededException = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.ListAgentsFilter = exports.WidgetNotFoundException = exports.TargetNotFoundException = exports.KiteVariant = exports.KiteFeatures = exports.WidgetTarget = exports.WidgetRouteRule = exports.WidgetRouteTimeFrameDay = exports.Element = exports.ChannelWhatsAppStatus = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelAccess = exports.ActionElement = exports.ButtonVariant = exports.ButtonHandler = exports.ChannelType = exports.RateLimitExceededException = exports.ForbiddenException = exports.ValidationException = void 0;
4
4
  const KiteServiceException_1 = require("./KiteServiceException");
5
5
  class ValidationException extends KiteServiceException_1.KiteServiceException {
6
6
  constructor(opts) {
@@ -45,6 +45,10 @@ class RateLimitExceededException extends KiteServiceException_1.KiteServiceExcep
45
45
  }
46
46
  }
47
47
  exports.RateLimitExceededException = RateLimitExceededException;
48
+ exports.ChannelType = {
49
+ DIRECT: "direct",
50
+ GROUP: "group",
51
+ };
48
52
  var ButtonHandler;
49
53
  (function (ButtonHandler) {
50
54
  ButtonHandler.visit = (value, visitor) => {
@@ -69,6 +73,22 @@ var ActionElement;
69
73
  return visitor._(value.$unknown[0], value.$unknown[1]);
70
74
  };
71
75
  })(ActionElement = exports.ActionElement || (exports.ActionElement = {}));
76
+ exports.ChannelAccess = {
77
+ PRIVATE: "private",
78
+ PUBLIC: "public",
79
+ };
80
+ exports.ChannelContextEventAttendeeStatus = {
81
+ ACCEPTED: "accepted",
82
+ DECLINED: "declined",
83
+ NONE: "none",
84
+ TENTATIVE: "tentative",
85
+ };
86
+ exports.ChannelContextSource = {
87
+ KITE: "kite",
88
+ };
89
+ exports.ChannelWhatsAppStatus = {
90
+ CHANNEL_CLOSED: "24h_channel_closed",
91
+ };
72
92
  var Element;
73
93
  (function (Element) {
74
94
  Element.visit = (value, visitor) => {
@@ -83,8 +103,8 @@ exports.WidgetRouteTimeFrameDay = {
83
103
  MONDAY: "MONDAY",
84
104
  SATURDAY: "SATURDAY",
85
105
  SUNDAY: "SUNDAY",
86
- THUESDAY: "THUESDAY",
87
106
  THURSDAY: "THURSDAY",
107
+ TUESDAY: "TUESDAY",
88
108
  WEDNESDAY: "WEDNESDAY",
89
109
  WEEKDAYS: "WEEKDAYS",
90
110
  WEEKENDS: "WEEKENDS",
@@ -1,10 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateWidgetCommand = exports.de_ListWidgetsCommand = exports.de_ListServicesCommand = exports.de_ListCalendarSlotsCommand = exports.de_ListAgentsCommand = exports.de_GetWidgetCommand = exports.de_GetConfigCommand = exports.de_DeleteWidgetCommand = exports.de_CreateWidgetCommand = exports.se_UpdateWidgetCommand = exports.se_ListWidgetsCommand = exports.se_ListServicesCommand = exports.se_ListCalendarSlotsCommand = exports.se_ListAgentsCommand = exports.se_GetWidgetCommand = exports.se_GetConfigCommand = exports.se_DeleteWidgetCommand = exports.se_CreateWidgetCommand = void 0;
3
+ exports.de_UpdateWidgetCommand = exports.de_ScheduleCalendarEventCommand = exports.de_RescheduleCalendarEventCommand = exports.de_ListWidgetsCommand = exports.de_ListServicesCommand = exports.de_ListAgentsCommand = exports.de_GetWidgetCommand = exports.de_GetConfigCommand = exports.de_GetCalendarAvailabilityCommand = exports.de_DeleteWidgetCommand = exports.de_CreateWidgetCommand = exports.de_CancelCalendarEventCommand = exports.se_UpdateWidgetCommand = exports.se_ScheduleCalendarEventCommand = exports.se_RescheduleCalendarEventCommand = exports.se_ListWidgetsCommand = exports.se_ListServicesCommand = exports.se_ListAgentsCommand = exports.se_GetWidgetCommand = exports.se_GetConfigCommand = exports.se_GetCalendarAvailabilityCommand = exports.se_DeleteWidgetCommand = exports.se_CreateWidgetCommand = exports.se_CancelCalendarEventCommand = void 0;
4
4
  const KiteServiceException_1 = require("../models/KiteServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
6
  const core_1 = require("@smithy/core");
7
7
  const smithy_client_1 = require("@smithy/smithy-client");
8
+ const se_CancelCalendarEventCommand = async (input, context) => {
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
+ const headers = {};
11
+ b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
12
+ b.p('channelId', () => input.channelId, '{channelId}', false);
13
+ b.p('eventId', () => input.eventId, '{eventId}', false);
14
+ b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
15
+ const query = (0, smithy_client_1.map)({
16
+ [_r]: [, input[_r]],
17
+ });
18
+ let body;
19
+ b.m("DELETE")
20
+ .h(headers)
21
+ .q(query)
22
+ .b(body);
23
+ return b.build();
24
+ };
25
+ exports.se_CancelCalendarEventCommand = se_CancelCalendarEventCommand;
8
26
  const se_CreateWidgetCommand = async (input, context) => {
9
27
  const b = (0, core_1.requestBuilder)(input, context);
10
28
  const headers = {
@@ -41,13 +59,33 @@ const se_DeleteWidgetCommand = async (input, context) => {
41
59
  return b.build();
42
60
  };
43
61
  exports.se_DeleteWidgetCommand = se_DeleteWidgetCommand;
62
+ const se_GetCalendarAvailabilityCommand = async (input, context) => {
63
+ const b = (0, core_1.requestBuilder)(input, context);
64
+ const headers = {};
65
+ b.bp("/v2/kite/calendar/widgets/{targetId}/availability");
66
+ b.p('targetId', () => input.targetId, '{targetId}', false);
67
+ const query = (0, smithy_client_1.map)({
68
+ [_f]: [, (0, smithy_client_1.expectNonNull)(input[_f], `from`)],
69
+ [_t]: [, (0, smithy_client_1.expectNonNull)(input[_t], `till`)],
70
+ [_d]: [, input[_d]],
71
+ [_tZ]: [, (0, smithy_client_1.expectNonNull)(input[_tZ], `timeZone`)],
72
+ [_e]: [, input[_e]],
73
+ });
74
+ let body;
75
+ b.m("GET")
76
+ .h(headers)
77
+ .q(query)
78
+ .b(body);
79
+ return b.build();
80
+ };
81
+ exports.se_GetCalendarAvailabilityCommand = se_GetCalendarAvailabilityCommand;
44
82
  const se_GetConfigCommand = async (input, context) => {
45
83
  const b = (0, core_1.requestBuilder)(input, context);
46
84
  const headers = {};
47
85
  b.bp("/v2/kite/config/{targetId}");
48
86
  b.p('targetId', () => input.targetId, '{targetId}', false);
49
87
  const query = (0, smithy_client_1.map)({
50
- [_r]: [, input[_tRI]],
88
+ [_ro]: [, input[_tRI]],
51
89
  });
52
90
  let body;
53
91
  b.m("GET")
@@ -89,18 +127,6 @@ const se_ListAgentsCommand = async (input, context) => {
89
127
  return b.build();
90
128
  };
91
129
  exports.se_ListAgentsCommand = se_ListAgentsCommand;
92
- const se_ListCalendarSlotsCommand = async (input, context) => {
93
- const b = (0, core_1.requestBuilder)(input, context);
94
- const headers = {};
95
- b.bp("/v2/kite/calendar/slots/{targetId}");
96
- b.p('targetId', () => input.targetId, '{targetId}', false);
97
- let body;
98
- b.m("POST")
99
- .h(headers)
100
- .b(body);
101
- return b.build();
102
- };
103
- exports.se_ListCalendarSlotsCommand = se_ListCalendarSlotsCommand;
104
130
  const se_ListServicesCommand = async (input, context) => {
105
131
  const b = (0, core_1.requestBuilder)(input, context);
106
132
  const headers = {};
@@ -131,6 +157,53 @@ const se_ListWidgetsCommand = async (input, context) => {
131
157
  return b.build();
132
158
  };
133
159
  exports.se_ListWidgetsCommand = se_ListWidgetsCommand;
160
+ const se_RescheduleCalendarEventCommand = async (input, context) => {
161
+ const b = (0, core_1.requestBuilder)(input, context);
162
+ const headers = {
163
+ 'content-type': 'application/json',
164
+ };
165
+ b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
166
+ b.p('channelId', () => input.channelId, '{channelId}', false);
167
+ b.p('eventId', () => input.eventId, '{eventId}', false);
168
+ b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
169
+ let body;
170
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
171
+ 'attendees': _ => (0, smithy_client_1._json)(_),
172
+ 'changed': _ => (0, smithy_client_1._json)(_),
173
+ 'duration': [],
174
+ 'reason': [],
175
+ 'start': [],
176
+ 'summary': [],
177
+ }));
178
+ b.m("PATCH")
179
+ .h(headers)
180
+ .b(body);
181
+ return b.build();
182
+ };
183
+ exports.se_RescheduleCalendarEventCommand = se_RescheduleCalendarEventCommand;
184
+ const se_ScheduleCalendarEventCommand = async (input, context) => {
185
+ const b = (0, core_1.requestBuilder)(input, context);
186
+ const headers = {
187
+ 'content-type': 'application/json',
188
+ };
189
+ b.bp("/v2/kite/calendar/widgets/{targetId}");
190
+ b.p('targetId', () => input.targetId, '{targetId}', false);
191
+ let body;
192
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
193
+ 'attendees': _ => (0, smithy_client_1._json)(_),
194
+ 'channelId': [],
195
+ 'duration': [],
196
+ 'language': [],
197
+ 'start': [],
198
+ 'summary': [],
199
+ 'timeZone': [],
200
+ }));
201
+ b.m("POST")
202
+ .h(headers)
203
+ .b(body);
204
+ return b.build();
205
+ };
206
+ exports.se_ScheduleCalendarEventCommand = se_ScheduleCalendarEventCommand;
134
207
  const se_UpdateWidgetCommand = async (input, context) => {
135
208
  const b = (0, core_1.requestBuilder)(input, context);
136
209
  const headers = {
@@ -156,6 +229,22 @@ const se_UpdateWidgetCommand = async (input, context) => {
156
229
  return b.build();
157
230
  };
158
231
  exports.se_UpdateWidgetCommand = se_UpdateWidgetCommand;
232
+ const de_CancelCalendarEventCommand = async (output, context) => {
233
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
234
+ return de_CommandError(output, context);
235
+ }
236
+ const contents = (0, smithy_client_1.map)({
237
+ $metadata: deserializeMetadata(output),
238
+ });
239
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
240
+ const doc = (0, smithy_client_1.take)(data, {
241
+ 'channel': smithy_client_1._json,
242
+ 'event': smithy_client_1._json,
243
+ });
244
+ Object.assign(contents, doc);
245
+ return contents;
246
+ };
247
+ exports.de_CancelCalendarEventCommand = de_CancelCalendarEventCommand;
159
248
  const de_CreateWidgetCommand = async (output, context) => {
160
249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
161
250
  return de_CommandError(output, context);
@@ -182,6 +271,21 @@ const de_DeleteWidgetCommand = async (output, context) => {
182
271
  return contents;
183
272
  };
184
273
  exports.de_DeleteWidgetCommand = de_DeleteWidgetCommand;
274
+ const de_GetCalendarAvailabilityCommand = async (output, context) => {
275
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
276
+ return de_CommandError(output, context);
277
+ }
278
+ const contents = (0, smithy_client_1.map)({
279
+ $metadata: deserializeMetadata(output),
280
+ });
281
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
282
+ const doc = (0, smithy_client_1.take)(data, {
283
+ 'availability': smithy_client_1._json,
284
+ });
285
+ Object.assign(contents, doc);
286
+ return contents;
287
+ };
288
+ exports.de_GetCalendarAvailabilityCommand = de_GetCalendarAvailabilityCommand;
185
289
  const de_GetConfigCommand = async (output, context) => {
186
290
  if (output.statusCode !== 200 && output.statusCode >= 300) {
187
291
  return de_CommandError(output, context);
@@ -227,18 +331,22 @@ const de_ListAgentsCommand = async (output, context) => {
227
331
  return contents;
228
332
  };
229
333
  exports.de_ListAgentsCommand = de_ListAgentsCommand;
230
- const de_ListCalendarSlotsCommand = async (output, context) => {
334
+ const de_ListServicesCommand = async (output, context) => {
231
335
  if (output.statusCode !== 200 && output.statusCode >= 300) {
232
336
  return de_CommandError(output, context);
233
337
  }
234
338
  const contents = (0, smithy_client_1.map)({
235
339
  $metadata: deserializeMetadata(output),
236
340
  });
237
- await (0, smithy_client_1.collectBody)(output.body, context);
341
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
342
+ const doc = (0, smithy_client_1.take)(data, {
343
+ 'services': smithy_client_1._json,
344
+ });
345
+ Object.assign(contents, doc);
238
346
  return contents;
239
347
  };
240
- exports.de_ListCalendarSlotsCommand = de_ListCalendarSlotsCommand;
241
- const de_ListServicesCommand = async (output, context) => {
348
+ exports.de_ListServicesCommand = de_ListServicesCommand;
349
+ const de_ListWidgetsCommand = async (output, context) => {
242
350
  if (output.statusCode !== 200 && output.statusCode >= 300) {
243
351
  return de_CommandError(output, context);
244
352
  }
@@ -247,13 +355,13 @@ const de_ListServicesCommand = async (output, context) => {
247
355
  });
248
356
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
249
357
  const doc = (0, smithy_client_1.take)(data, {
250
- 'services': smithy_client_1._json,
358
+ 'widgets': _ => de_WidgetsList(_, context),
251
359
  });
252
360
  Object.assign(contents, doc);
253
361
  return contents;
254
362
  };
255
- exports.de_ListServicesCommand = de_ListServicesCommand;
256
- const de_ListWidgetsCommand = async (output, context) => {
363
+ exports.de_ListWidgetsCommand = de_ListWidgetsCommand;
364
+ const de_RescheduleCalendarEventCommand = async (output, context) => {
257
365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
258
366
  return de_CommandError(output, context);
259
367
  }
@@ -262,12 +370,29 @@ const de_ListWidgetsCommand = async (output, context) => {
262
370
  });
263
371
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
264
372
  const doc = (0, smithy_client_1.take)(data, {
265
- 'widgets': _ => de_WidgetsList(_, context),
373
+ 'channel': smithy_client_1._json,
374
+ 'event': smithy_client_1._json,
266
375
  });
267
376
  Object.assign(contents, doc);
268
377
  return contents;
269
378
  };
270
- exports.de_ListWidgetsCommand = de_ListWidgetsCommand;
379
+ exports.de_RescheduleCalendarEventCommand = de_RescheduleCalendarEventCommand;
380
+ const de_ScheduleCalendarEventCommand = async (output, context) => {
381
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
382
+ return de_CommandError(output, context);
383
+ }
384
+ const contents = (0, smithy_client_1.map)({
385
+ $metadata: deserializeMetadata(output),
386
+ });
387
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
388
+ const doc = (0, smithy_client_1.take)(data, {
389
+ 'channel': smithy_client_1._json,
390
+ 'event': smithy_client_1._json,
391
+ });
392
+ Object.assign(contents, doc);
393
+ return contents;
394
+ };
395
+ exports.de_ScheduleCalendarEventCommand = de_ScheduleCalendarEventCommand;
271
396
  const de_UpdateWidgetCommand = async (output, context) => {
272
397
  if (output.statusCode !== 200 && output.statusCode >= 300) {
273
398
  return de_CommandError(output, context);
@@ -406,13 +531,19 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
406
531
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
407
532
  const _c = "company";
408
533
  const _cI = "companyId";
409
- const _r = "route";
534
+ const _d = "duration";
535
+ const _e = "excluded";
536
+ const _f = "from";
537
+ const _r = "reason";
410
538
  const _rA = "retryAfter";
411
539
  const _rL = "rateLimit";
412
540
  const _rLR = "rateLimitRemaining";
413
541
  const _rLRa = "rateLimitReset";
414
542
  const _ra = "retry-after";
543
+ const _ro = "route";
544
+ const _t = "till";
415
545
  const _tRI = "targetRouteId";
546
+ const _tZ = "timeZone";
416
547
  const _xrl = "x-ratelimit-limit";
417
548
  const _xrr = "x-ratelimit-remaining";
418
549
  const _xrr_ = "x-ratelimit-reset";
package/dist-es/Kite.js CHANGED
@@ -1,23 +1,29 @@
1
1
  import { KiteClient, } from "./KiteClient";
2
+ import { CancelCalendarEventCommand, } from "./commands/CancelCalendarEventCommand";
2
3
  import { CreateWidgetCommand, } from "./commands/CreateWidgetCommand";
3
4
  import { DeleteWidgetCommand, } from "./commands/DeleteWidgetCommand";
5
+ import { GetCalendarAvailabilityCommand, } from "./commands/GetCalendarAvailabilityCommand";
4
6
  import { GetConfigCommand, } from "./commands/GetConfigCommand";
5
7
  import { GetWidgetCommand, } from "./commands/GetWidgetCommand";
6
8
  import { ListAgentsCommand, } from "./commands/ListAgentsCommand";
7
- import { ListCalendarSlotsCommand, } from "./commands/ListCalendarSlotsCommand";
8
9
  import { ListServicesCommand, } from "./commands/ListServicesCommand";
9
10
  import { ListWidgetsCommand, } from "./commands/ListWidgetsCommand";
11
+ import { RescheduleCalendarEventCommand, } from "./commands/RescheduleCalendarEventCommand";
12
+ import { ScheduleCalendarEventCommand, } from "./commands/ScheduleCalendarEventCommand";
10
13
  import { UpdateWidgetCommand, } from "./commands/UpdateWidgetCommand";
11
14
  import { createAggregatedClient } from "@smithy/smithy-client";
12
15
  const commands = {
16
+ CancelCalendarEventCommand,
13
17
  CreateWidgetCommand,
14
18
  DeleteWidgetCommand,
19
+ GetCalendarAvailabilityCommand,
15
20
  GetConfigCommand,
16
21
  GetWidgetCommand,
17
22
  ListAgentsCommand,
18
- ListCalendarSlotsCommand,
19
23
  ListServicesCommand,
20
24
  ListWidgetsCommand,
25
+ RescheduleCalendarEventCommand,
26
+ ScheduleCalendarEventCommand,
21
27
  UpdateWidgetCommand,
22
28
  };
23
29
  export class Kite extends KiteClient {
@@ -12,7 +12,7 @@ export class KiteClient extends __Client {
12
12
  let _config_1 = resolveUserAgentConfig(_config_0);
13
13
  let _config_2 = resolveRetryConfig(_config_1);
14
14
  let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
15
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `api-${configuration.env}.x-bees.com` : 'api.x-bees.com';
15
+ const hostname = ['stable', 'stage'].includes(configuration?.env || '') ? `api-${configuration?.env}.x-bees.com` : 'api.x-bees.com';
16
16
  const endpoint = () => {
17
17
  return {
18
18
  hostname,
@@ -27,7 +27,9 @@ export class KiteClient extends __Client {
27
27
  };
28
28
  super(config);
29
29
  this.config = config;
30
- this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
30
+ if (configuration?.token) {
31
+ this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
32
+ }
31
33
  this.middlewareStack.use(getUserAgentPlugin(this.config));
32
34
  this.middlewareStack.use(getRetryPlugin(this.config));
33
35
  this.middlewareStack.use(getContentLengthPlugin(this.config));
@@ -0,0 +1,17 @@
1
+ import { de_CancelCalendarEventCommand, se_CancelCalendarEventCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class CancelCalendarEventCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "CancelCalendarEvent", {})
12
+ .n("KiteClient", "CancelCalendarEventCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_CancelCalendarEventCommand)
15
+ .de(de_CancelCalendarEventCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_GetCalendarAvailabilityCommand, se_GetCalendarAvailabilityCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class GetCalendarAvailabilityCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "GetCalendarAvailability", {})
12
+ .n("KiteClient", "GetCalendarAvailabilityCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetCalendarAvailabilityCommand)
15
+ .de(de_GetCalendarAvailabilityCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_RescheduleCalendarEventCommand, se_RescheduleCalendarEventCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class RescheduleCalendarEventCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "RescheduleCalendarEvent", {})
12
+ .n("KiteClient", "RescheduleCalendarEventCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_RescheduleCalendarEventCommand)
15
+ .de(de_RescheduleCalendarEventCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ScheduleCalendarEventCommand, se_ScheduleCalendarEventCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class ScheduleCalendarEventCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Kite", "ScheduleCalendarEvent", {})
12
+ .n("KiteClient", "ScheduleCalendarEventCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ScheduleCalendarEventCommand)
15
+ .de(de_ScheduleCalendarEventCommand)
16
+ .build() {
17
+ }
@@ -1,9 +1,12 @@
1
+ export * from "./CancelCalendarEventCommand";
1
2
  export * from "./CreateWidgetCommand";
2
3
  export * from "./DeleteWidgetCommand";
4
+ export * from "./GetCalendarAvailabilityCommand";
3
5
  export * from "./GetConfigCommand";
4
6
  export * from "./GetWidgetCommand";
5
7
  export * from "./ListAgentsCommand";
6
- export * from "./ListCalendarSlotsCommand";
7
8
  export * from "./ListServicesCommand";
8
9
  export * from "./ListWidgetsCommand";
10
+ export * from "./RescheduleCalendarEventCommand";
11
+ export * from "./ScheduleCalendarEventCommand";
9
12
  export * from "./UpdateWidgetCommand";