doover-js 0.5.0-alpha.0 → 0.5.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 (68) hide show
  1. package/README.md +0 -31
  2. package/dist/apis/agents-api.d.ts +7 -4
  3. package/dist/apis/agents-api.js +1 -139
  4. package/dist/apis/aggregates-api.d.ts +3 -23
  5. package/dist/apis/aggregates-api.js +4 -33
  6. package/dist/apis/alarms-api.d.ts +0 -30
  7. package/dist/apis/alarms-api.js +6 -51
  8. package/dist/apis/channels-api.d.ts +3 -40
  9. package/dist/apis/channels-api.js +5 -50
  10. package/dist/apis/connections-api.d.ts +5 -21
  11. package/dist/apis/connections-api.js +10 -26
  12. package/dist/apis/messages-api.d.ts +9 -54
  13. package/dist/apis/messages-api.js +12 -94
  14. package/dist/apis/notifications-api.d.ts +0 -52
  15. package/dist/apis/notifications-api.js +13 -99
  16. package/dist/apis/permissions-api.d.ts +0 -8
  17. package/dist/apis/permissions-api.js +2 -11
  18. package/dist/apis/processors-api.d.ts +0 -35
  19. package/dist/apis/processors-api.js +8 -64
  20. package/dist/client/doover-client.d.ts +8 -4
  21. package/dist/client/doover-client.js +28 -16
  22. package/dist/client/stats.d.ts +0 -24
  23. package/dist/client/stats.js +0 -62
  24. package/dist/gateway/gateway-client.d.ts +1 -13
  25. package/dist/gateway/gateway-client.js +0 -54
  26. package/dist/index.d.ts +1 -6
  27. package/dist/index.js +7 -13
  28. package/dist/react/index.d.ts +2 -0
  29. package/dist/react/index.js +3 -1
  30. package/dist/react/useChannelAggregate.js +1 -8
  31. package/dist/react/useChannelMessages.d.ts +3 -1
  32. package/dist/react/useChannelMessages.js +26 -9
  33. package/dist/react/useChannelSubscription.js +18 -8
  34. package/dist/react/useDeviceMap.d.ts +109 -0
  35. package/dist/react/useDeviceMap.js +62 -0
  36. package/dist/react/useMultiAgentAggregates.d.ts +11 -1
  37. package/dist/react/useMultiAgentAggregates.js +25 -12
  38. package/dist/react/useMultiAgentChannelMessages.js +13 -8
  39. package/dist/react/useSendMessage.js +1 -6
  40. package/dist/react/useSendRpc.js +1 -4
  41. package/dist/react/useUpdateAggregate.js +3 -9
  42. package/dist/test/utils.test.js +2 -2
  43. package/dist/types/connection.d.ts +72 -0
  44. package/dist/types/connection.js +8 -0
  45. package/dist/utils/snowflake.js +1 -1
  46. package/dist/viewer/doover-data-provider.d.ts +34 -30
  47. package/dist/viewer/doover-data-provider.js +316 -82
  48. package/package.json +1 -1
  49. package/dist/apis/_args.d.ts +0 -16
  50. package/dist/apis/_args.js +0 -26
  51. package/dist/apis/users-api.d.ts +0 -8
  52. package/dist/apis/users-api.js +0 -13
  53. package/dist/rpc/errors.d.ts +0 -10
  54. package/dist/rpc/errors.js +0 -23
  55. package/dist/rpc/rpc-dispatcher.d.ts +0 -28
  56. package/dist/rpc/rpc-dispatcher.js +0 -129
  57. package/dist/test/api-args.test.d.ts +0 -1
  58. package/dist/test/api-args.test.js +0 -48
  59. package/dist/test/api-overloads.test.d.ts +0 -9
  60. package/dist/test/api-overloads.test.js +0 -276
  61. package/dist/test/gateway-subscriptions.test.d.ts +0 -1
  62. package/dist/test/gateway-subscriptions.test.js +0 -95
  63. package/dist/test/rpc-dispatcher.test.d.ts +0 -1
  64. package/dist/test/rpc-dispatcher.test.js +0 -190
  65. package/dist/test/stats-rpc.test.d.ts +0 -1
  66. package/dist/test/stats-rpc.test.js +0 -69
  67. package/dist/test/users-api.test.d.ts +0 -1
  68. package/dist/test/users-api.test.js +0 -19
@@ -5,12 +5,6 @@ export interface ListMessagesParams {
5
5
  after?: string;
6
6
  limit?: number;
7
7
  field_name?: string[];
8
- /**
9
- * Result order. `"desc"` (default) returns the server's native newest-first
10
- * order; `"asc"` reverses the array client-side so the oldest message is at
11
- * index 0.
12
- */
13
- order?: "asc" | "desc";
14
8
  }
15
9
  export interface MessageMutationParams {
16
10
  suppress_response?: boolean;
@@ -20,59 +14,20 @@ export type MessageBody = CreateMessageRequest | UpdateMessageRequest | FormData
20
14
  export declare class MessagesApi {
21
15
  private readonly rest;
22
16
  constructor(rest: RestClient);
23
- listMessages(agentId: string, channelName: string, params?: ListMessagesParams): Promise<MessageStructure[]>;
24
- listMessages(identifier: {
25
- agentId: string;
26
- channelName: string;
27
- }, params?: ListMessagesParams): Promise<MessageStructure[]>;
28
- private _listMessages;
29
- postMessage(agentId: string, channelName: string, body: MessageBody): Promise<MessageStructure>;
30
- postMessage(identifier: {
31
- agentId: string;
32
- channelName: string;
33
- }, body: MessageBody): Promise<MessageStructure>;
34
- private _postMessage;
17
+ listMessages(agentId: string, channelName: string, params?: ListMessagesParams): Promise<(Omit<MessageStructure<import("..").JSONValue>, "timestamp"> & {
18
+ timestamp: number;
19
+ })[]>;
20
+ postMessage(agentId: string, channelName: string, body: MessageBody): Promise<Omit<MessageStructure<import("..").JSONValue>, "timestamp"> & {
21
+ timestamp: number;
22
+ }>;
35
23
  getTimeseries(agentId: string, channelName: string, params: ListMessagesParams): Promise<DataSeries>;
36
- getTimeseries(identifier: {
37
- agentId: string;
38
- channelName: string;
39
- }, params: ListMessagesParams): Promise<DataSeries>;
40
- private _getTimeseries;
41
- getMessage(agentId: string, channelName: string, messageId: string): Promise<MessageStructure>;
42
- getMessage(identifier: {
43
- agentId: string;
44
- channelName: string;
45
- }, messageId: string): Promise<MessageStructure>;
46
- private _getMessage;
24
+ getMessage(agentId: string, channelName: string, messageId: string): Promise<Omit<MessageStructure<import("..").JSONValue>, "timestamp"> & {
25
+ timestamp: number;
26
+ }>;
47
27
  putMessage(agentId: string, channelName: string, messageId: string, body: MessageBody, params?: MessageMutationParams): Promise<unknown>;
48
- putMessage(identifier: {
49
- agentId: string;
50
- channelName: string;
51
- }, messageId: string, body: MessageBody, params?: MessageMutationParams): Promise<unknown>;
52
- private _putMessage;
53
28
  patchMessage(agentId: string, channelName: string, messageId: string, body: MessageBody, params?: MessageMutationParams): Promise<unknown>;
54
- patchMessage(identifier: {
55
- agentId: string;
56
- channelName: string;
57
- }, messageId: string, body: MessageBody, params?: MessageMutationParams): Promise<unknown>;
58
- private _patchMessage;
59
29
  deleteMessage(agentId: string, channelName: string, messageId: string): Promise<unknown>;
60
- deleteMessage(identifier: {
61
- agentId: string;
62
- channelName: string;
63
- }, messageId: string): Promise<unknown>;
64
- private _deleteMessage;
65
30
  getMessageAttachment(agentId: string, channelName: string, messageId: string, attachmentId: string): Promise<Blob>;
66
- getMessageAttachment(identifier: {
67
- agentId: string;
68
- channelName: string;
69
- }, messageId: string, attachmentId: string): Promise<Blob>;
70
- private _getMessageAttachment;
71
31
  getInvocationLogs<TLog = unknown>(agentId: string, channelName: string, messageId: string): Promise<TLog[]>;
72
- getInvocationLogs<TLog = unknown>(identifier: {
73
- agentId: string;
74
- channelName: string;
75
- }, messageId: string): Promise<TLog[]>;
76
- private _getInvocationLogs;
77
32
  createMultipartPayload(jsonPayload: Record<string, unknown>, attachments: Array<Blob | File>): FormData;
78
33
  }
@@ -2,120 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MessagesApi = void 0;
4
4
  const snowflake_1 = require("../utils/snowflake");
5
- const _args_1 = require("./_args");
6
- function resolveListMessagesParams(params) {
7
- const order = params?.order ?? "desc";
8
- const query = {
9
- before: params?.before ?? (0, snowflake_1.generateSnowflakeIdAtTime)(new Date()),
10
- limit: params?.limit ?? 10,
11
- };
12
- if (params?.after !== undefined)
13
- query.after = params.after;
14
- if (params?.field_name !== undefined)
15
- query.field_name = params.field_name;
16
- return { query, order };
17
- }
18
5
  class MessagesApi {
19
6
  constructor(rest) {
20
7
  this.rest = rest;
21
8
  }
22
- async listMessages(...args) {
23
- const { agentId, channelName, options } = (0, _args_1.resolveChannelArgs)(args);
24
- return this._listMessages(agentId, channelName, options);
25
- }
26
- async _listMessages(agentId, channelName, params) {
27
- const { query, order } = resolveListMessagesParams(params);
28
- const response = await this.rest.get(`/agents/${agentId}/channels/${channelName}/messages`, query);
29
- const stamped = response.map(snowflake_1.addTimestampToMessage);
30
- return order === "asc" ? [...stamped].reverse() : stamped;
31
- }
32
- async postMessage(...args) {
33
- if (typeof args[0] === "string") {
34
- const [agentId, channelName, body] = args;
35
- return this._postMessage(agentId, channelName, body);
36
- }
37
- const id = args[0];
38
- const body = args[1];
39
- return this._postMessage(id.agentId, id.channelName, body);
9
+ async listMessages(agentId, channelName, params) {
10
+ const response = await this.rest.get(`/agents/${agentId}/channels/${channelName}/messages`, params);
11
+ return response.map(snowflake_1.addTimestampToMessage);
40
12
  }
41
- async _postMessage(agentId, channelName, body) {
13
+ async postMessage(agentId, channelName, body) {
42
14
  const response = await this.rest.post(`/agents/${agentId}/channels/${channelName}/messages`, body);
43
15
  return (0, snowflake_1.addTimestampToMessage)(response);
44
16
  }
45
- getTimeseries(...args) {
46
- const { agentId, channelName, options } = (0, _args_1.resolveChannelArgs)(args);
47
- return this._getTimeseries(agentId, channelName, options);
48
- }
49
- _getTimeseries(agentId, channelName, params) {
50
- const { order: _order, ...rest } = params;
51
- return this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/timeseries`, rest);
52
- }
53
- async getMessage(...args) {
54
- if (typeof args[0] === "string") {
55
- const [agentId, channelName, messageId] = args;
56
- return this._getMessage(agentId, channelName, messageId);
57
- }
58
- const id = args[0];
59
- const messageId = args[1];
60
- return this._getMessage(id.agentId, id.channelName, messageId);
17
+ getTimeseries(agentId, channelName, params) {
18
+ return this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/timeseries`, params);
61
19
  }
62
- async _getMessage(agentId, channelName, messageId) {
20
+ async getMessage(agentId, channelName, messageId) {
63
21
  const response = await this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/${messageId}`);
64
22
  return (0, snowflake_1.addTimestampToMessage)(response);
65
23
  }
66
- putMessage(...args) {
67
- if (typeof args[0] === "string") {
68
- const [agentId, channelName, messageId, body, params] = args;
69
- return this._putMessage(agentId, channelName, messageId, body, params);
70
- }
71
- const id = args[0];
72
- return this._putMessage(id.agentId, id.channelName, args[1], args[2], args[3]);
73
- }
74
- _putMessage(agentId, channelName, messageId, body, params) {
24
+ putMessage(agentId, channelName, messageId, body, params) {
75
25
  return this.rest.put(`/agents/${agentId}/channels/${channelName}/messages/${messageId}`, body, params);
76
26
  }
77
- patchMessage(...args) {
78
- if (typeof args[0] === "string") {
79
- const [agentId, channelName, messageId, body, params] = args;
80
- return this._patchMessage(agentId, channelName, messageId, body, params);
81
- }
82
- const id = args[0];
83
- return this._patchMessage(id.agentId, id.channelName, args[1], args[2], args[3]);
84
- }
85
- _patchMessage(agentId, channelName, messageId, body, params) {
27
+ patchMessage(agentId, channelName, messageId, body, params) {
86
28
  return this.rest.patch(`/agents/${agentId}/channels/${channelName}/messages/${messageId}`, body, params);
87
29
  }
88
- deleteMessage(...args) {
89
- if (typeof args[0] === "string") {
90
- const [agentId, channelName, messageId] = args;
91
- return this._deleteMessage(agentId, channelName, messageId);
92
- }
93
- const id = args[0];
94
- return this._deleteMessage(id.agentId, id.channelName, args[1]);
95
- }
96
- _deleteMessage(agentId, channelName, messageId) {
30
+ deleteMessage(agentId, channelName, messageId) {
97
31
  return this.rest.delete(`/agents/${agentId}/channels/${channelName}/messages/${messageId}`);
98
32
  }
99
- getMessageAttachment(...args) {
100
- if (typeof args[0] === "string") {
101
- const [agentId, channelName, messageId, attachmentId] = args;
102
- return this._getMessageAttachment(agentId, channelName, messageId, attachmentId);
103
- }
104
- const id = args[0];
105
- return this._getMessageAttachment(id.agentId, id.channelName, args[1], args[2]);
106
- }
107
- _getMessageAttachment(agentId, channelName, messageId, attachmentId) {
33
+ getMessageAttachment(agentId, channelName, messageId, attachmentId) {
108
34
  return this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/${messageId}/attachments/${attachmentId}`);
109
35
  }
110
- getInvocationLogs(...args) {
111
- if (typeof args[0] === "string") {
112
- const [agentId, channelName, messageId] = args;
113
- return this._getInvocationLogs(agentId, channelName, messageId);
114
- }
115
- const id = args[0];
116
- return this._getInvocationLogs(id.agentId, id.channelName, args[1]);
117
- }
118
- _getInvocationLogs(agentId, channelName, messageId) {
36
+ getInvocationLogs(agentId, channelName, messageId) {
119
37
  return this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/${messageId}/logs`);
120
38
  }
121
39
  createMultipartPayload(jsonPayload, attachments) {
@@ -4,70 +4,18 @@ export declare class NotificationsApi {
4
4
  private readonly rest;
5
5
  constructor(rest: RestClient);
6
6
  getAgentNotifications(agentId: string): Promise<NotificationDataResponse>;
7
- getAgentNotifications(identifier: {
8
- agentId: string;
9
- }): Promise<NotificationDataResponse>;
10
- private _getAgentNotifications;
11
7
  getAgentNotificationEndpoints(agentId: string, name?: string): Promise<NotificationEndpointsResponse>;
12
- getAgentNotificationEndpoints(identifier: {
13
- agentId: string;
14
- }, name?: string): Promise<NotificationEndpointsResponse>;
15
- private _getAgentNotificationEndpoints;
16
8
  createNotificationEndpoint(agentId: string, body: CreateEndpointRequest): Promise<NotificationEndpoint>;
17
- createNotificationEndpoint(identifier: {
18
- agentId: string;
19
- }, body: CreateEndpointRequest): Promise<NotificationEndpoint>;
20
- private _createNotificationEndpoint;
21
9
  updateNotificationEndpoint(agentId: string, endpointId: string, body: UpdateEndpointRequest): Promise<NotificationEndpoint>;
22
- updateNotificationEndpoint(identifier: {
23
- agentId: string;
24
- }, endpointId: string, body: UpdateEndpointRequest): Promise<NotificationEndpoint>;
25
- private _updateNotificationEndpoint;
26
10
  deleteNotificationEndpoint(agentId: string, endpointId: string): Promise<unknown>;
27
- deleteNotificationEndpoint(identifier: {
28
- agentId: string;
29
- }, endpointId: string): Promise<unknown>;
30
- private _deleteNotificationEndpoint;
31
11
  testNotificationEndpoint(agentId: string, endpointId: string): Promise<unknown>;
32
- testNotificationEndpoint(identifier: {
33
- agentId: string;
34
- }, endpointId: string): Promise<unknown>;
35
- private _testNotificationEndpoint;
36
12
  getAgentNotificationSubscriptions(agentId: string, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
37
- getAgentNotificationSubscriptions(identifier: {
38
- agentId: string;
39
- }, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
40
- private _getAgentNotificationSubscriptions;
41
13
  createNotificationSubscription(agentId: string, body: CreateNotificationSubscriptionRequest): Promise<NotificationSubscriptionCreateResponse>;
42
- createNotificationSubscription(identifier: {
43
- agentId: string;
44
- }, body: CreateNotificationSubscriptionRequest): Promise<NotificationSubscriptionCreateResponse>;
45
- private _createNotificationSubscription;
46
14
  getAgentDefaultNotificationSubscriptions(agentId: string, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
47
- getAgentDefaultNotificationSubscriptions(identifier: {
48
- agentId: string;
49
- }, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
50
- private _getAgentDefaultNotificationSubscriptions;
51
15
  deleteDefaultNotificationSubscription(agentId: string, subscribedTo: string): Promise<unknown>;
52
- deleteDefaultNotificationSubscription(identifier: {
53
- agentId: string;
54
- }, subscribedTo: string): Promise<unknown>;
55
- private _deleteDefaultNotificationSubscription;
56
16
  updateNotificationSubscription(agentId: string, subscriptionId: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
57
- updateNotificationSubscription(identifier: {
58
- agentId: string;
59
- }, subscriptionId: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
60
- private _updateNotificationSubscription;
61
17
  deleteNotificationSubscription(agentId: string, subscriptionId: string): Promise<unknown>;
62
- deleteNotificationSubscription(identifier: {
63
- agentId: string;
64
- }, subscriptionId: string): Promise<unknown>;
65
- private _deleteNotificationSubscription;
66
18
  getAgentNotificationSubscribers(agentId: string): Promise<NotificationSubscribersResponse>;
67
- getAgentNotificationSubscribers(identifier: {
68
- agentId: string;
69
- }): Promise<NotificationSubscribersResponse>;
70
- private _getAgentNotificationSubscribers;
71
19
  updateMeWebPushEndpoint(body: UpdateMeWebPushEndpointRequest): Promise<unknown>;
72
20
  getWebPushPublicKey(): Promise<{
73
21
  key: string;
@@ -1,133 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationsApi = void 0;
4
- const _args_1 = require("./_args");
5
4
  class NotificationsApi {
6
5
  constructor(rest) {
7
6
  this.rest = rest;
8
7
  }
9
- getAgentNotifications(...args) {
10
- const { agentId } = (0, _args_1.resolveAgentArgs)(args);
11
- return this._getAgentNotifications(agentId);
12
- }
13
- _getAgentNotifications(agentId) {
8
+ getAgentNotifications(agentId) {
14
9
  return this.rest.get(`/agents/${agentId}/notifications`);
15
10
  }
16
- getAgentNotificationEndpoints(...args) {
17
- if (typeof args[0] === "string") {
18
- return this._getAgentNotificationEndpoints(args[0], args[1]);
19
- }
20
- const id = args[0];
21
- return this._getAgentNotificationEndpoints(id.agentId, args[1]);
22
- }
23
- _getAgentNotificationEndpoints(agentId, name) {
11
+ getAgentNotificationEndpoints(agentId, name) {
24
12
  return this.rest.get(`/agents/${agentId}/notifications/endpoints`, { name });
25
13
  }
26
- createNotificationEndpoint(...args) {
27
- if (typeof args[0] === "string") {
28
- return this._createNotificationEndpoint(args[0], args[1]);
29
- }
30
- const id = args[0];
31
- return this._createNotificationEndpoint(id.agentId, args[1]);
32
- }
33
- _createNotificationEndpoint(agentId, body) {
14
+ createNotificationEndpoint(agentId, body) {
34
15
  return this.rest.post(`/agents/${agentId}/notifications/endpoints`, body);
35
16
  }
36
- updateNotificationEndpoint(...args) {
37
- if (typeof args[0] === "string") {
38
- return this._updateNotificationEndpoint(args[0], args[1], args[2]);
39
- }
40
- const id = args[0];
41
- return this._updateNotificationEndpoint(id.agentId, args[1], args[2]);
42
- }
43
- _updateNotificationEndpoint(agentId, endpointId, body) {
17
+ updateNotificationEndpoint(agentId, endpointId, body) {
44
18
  return this.rest.patch(`/agents/${agentId}/notifications/endpoints/${endpointId}`, body);
45
19
  }
46
- deleteNotificationEndpoint(...args) {
47
- if (typeof args[0] === "string") {
48
- return this._deleteNotificationEndpoint(args[0], args[1]);
49
- }
50
- const id = args[0];
51
- return this._deleteNotificationEndpoint(id.agentId, args[1]);
52
- }
53
- _deleteNotificationEndpoint(agentId, endpointId) {
20
+ deleteNotificationEndpoint(agentId, endpointId) {
54
21
  return this.rest.delete(`/agents/${agentId}/notifications/endpoints/${endpointId}`);
55
22
  }
56
- testNotificationEndpoint(...args) {
57
- if (typeof args[0] === "string") {
58
- return this._testNotificationEndpoint(args[0], args[1]);
59
- }
60
- const id = args[0];
61
- return this._testNotificationEndpoint(id.agentId, args[1]);
62
- }
63
- _testNotificationEndpoint(agentId, endpointId) {
23
+ testNotificationEndpoint(agentId, endpointId) {
64
24
  return this.rest.post(`/agents/${agentId}/notifications/endpoints/${endpointId}/test`, {});
65
25
  }
66
- getAgentNotificationSubscriptions(...args) {
67
- if (typeof args[0] === "string") {
68
- return this._getAgentNotificationSubscriptions(args[0], args[1]);
69
- }
70
- const id = args[0];
71
- return this._getAgentNotificationSubscriptions(id.agentId, args[1]);
72
- }
73
- _getAgentNotificationSubscriptions(agentId, subscribed_to) {
26
+ getAgentNotificationSubscriptions(agentId, subscribed_to) {
74
27
  return this.rest.get(`/agents/${agentId}/notifications/subscriptions`, { subscribed_to });
75
28
  }
76
- createNotificationSubscription(...args) {
77
- if (typeof args[0] === "string") {
78
- return this._createNotificationSubscription(args[0], args[1]);
79
- }
80
- const id = args[0];
81
- return this._createNotificationSubscription(id.agentId, args[1]);
82
- }
83
- _createNotificationSubscription(agentId, body) {
29
+ createNotificationSubscription(agentId, body) {
84
30
  return this.rest.post(`/agents/${agentId}/notifications/subscriptions`, body);
85
31
  }
86
- getAgentDefaultNotificationSubscriptions(...args) {
87
- if (typeof args[0] === "string") {
88
- return this._getAgentDefaultNotificationSubscriptions(args[0], args[1]);
89
- }
90
- const id = args[0];
91
- return this._getAgentDefaultNotificationSubscriptions(id.agentId, args[1]);
92
- }
93
- _getAgentDefaultNotificationSubscriptions(agentId, subscribed_to) {
32
+ getAgentDefaultNotificationSubscriptions(agentId, subscribed_to) {
94
33
  return this.rest.get(`/agents/${agentId}/notifications/subscriptions/default`, { subscribed_to });
95
34
  }
96
- deleteDefaultNotificationSubscription(...args) {
97
- if (typeof args[0] === "string") {
98
- return this._deleteDefaultNotificationSubscription(args[0], args[1]);
99
- }
100
- const id = args[0];
101
- return this._deleteDefaultNotificationSubscription(id.agentId, args[1]);
102
- }
103
- _deleteDefaultNotificationSubscription(agentId, subscribedTo) {
35
+ deleteDefaultNotificationSubscription(agentId, subscribedTo) {
104
36
  return this.rest.delete(`/agents/${agentId}/notifications/subscriptions/default/${subscribedTo}`);
105
37
  }
106
- updateNotificationSubscription(...args) {
107
- if (typeof args[0] === "string") {
108
- return this._updateNotificationSubscription(args[0], args[1], args[2]);
109
- }
110
- const id = args[0];
111
- return this._updateNotificationSubscription(id.agentId, args[1], args[2]);
112
- }
113
- _updateNotificationSubscription(agentId, subscriptionId, body) {
38
+ updateNotificationSubscription(agentId, subscriptionId, body) {
114
39
  return this.rest.patch(`/agents/${agentId}/notifications/subscriptions/${subscriptionId}`, body);
115
40
  }
116
- deleteNotificationSubscription(...args) {
117
- if (typeof args[0] === "string") {
118
- return this._deleteNotificationSubscription(args[0], args[1]);
119
- }
120
- const id = args[0];
121
- return this._deleteNotificationSubscription(id.agentId, args[1]);
122
- }
123
- _deleteNotificationSubscription(agentId, subscriptionId) {
41
+ deleteNotificationSubscription(agentId, subscriptionId) {
124
42
  return this.rest.delete(`/agents/${agentId}/notifications/subscriptions/${subscriptionId}`);
125
43
  }
126
- getAgentNotificationSubscribers(...args) {
127
- const { agentId } = (0, _args_1.resolveAgentArgs)(args);
128
- return this._getAgentNotificationSubscribers(agentId);
129
- }
130
- _getAgentNotificationSubscribers(agentId) {
44
+ getAgentNotificationSubscribers(agentId) {
131
45
  return this.rest.get(`/agents/${agentId}/notifications/subscribers`);
132
46
  }
133
47
  updateMeWebPushEndpoint(body) {
@@ -4,14 +4,6 @@ export declare class PermissionsApi {
4
4
  private readonly rest;
5
5
  constructor(rest: RestClient);
6
6
  getAgentPermission(agentId: string): Promise<AgentPermission>;
7
- getAgentPermission(identifier: {
8
- agentId: string;
9
- }): Promise<AgentPermission>;
10
- private _getAgentPermission;
11
7
  getAgentPermissionDebug(agentId: string): Promise<PermissionDebugResponse>;
12
- getAgentPermissionDebug(identifier: {
13
- agentId: string;
14
- }): Promise<PermissionDebugResponse>;
15
- private _getAgentPermissionDebug;
16
8
  syncPermissions(body: SyncPermissionRequest): Promise<SuccessListResponse<string>>;
17
9
  }
@@ -1,23 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PermissionsApi = void 0;
4
- const _args_1 = require("./_args");
5
4
  class PermissionsApi {
6
5
  constructor(rest) {
7
6
  this.rest = rest;
8
7
  }
9
- getAgentPermission(...args) {
10
- const { agentId } = (0, _args_1.resolveAgentArgs)(args);
11
- return this._getAgentPermission(agentId);
12
- }
13
- _getAgentPermission(agentId) {
8
+ getAgentPermission(agentId) {
14
9
  return this.rest.get(`/agents/${agentId}/permissions`);
15
10
  }
16
- getAgentPermissionDebug(...args) {
17
- const { agentId } = (0, _args_1.resolveAgentArgs)(args);
18
- return this._getAgentPermissionDebug(agentId);
19
- }
20
- _getAgentPermissionDebug(agentId) {
11
+ getAgentPermissionDebug(agentId) {
21
12
  return this.rest.get(`/agents/${agentId}/permissions/debug`);
22
13
  }
23
14
  syncPermissions(body) {
@@ -4,53 +4,18 @@ export declare class ProcessorsApi {
4
4
  private readonly rest;
5
5
  constructor(rest: RestClient);
6
6
  createProcessorSchedule(agentId: string, scheduleId: string, body: PutScheduleRequest): Promise<unknown>;
7
- createProcessorSchedule(identifier: {
8
- agentId: string;
9
- }, scheduleId: string, body: PutScheduleRequest): Promise<unknown>;
10
- private _createProcessorSchedule;
11
7
  deleteProcessorSchedule(agentId: string, scheduleId: string): Promise<unknown>;
12
- deleteProcessorSchedule(identifier: {
13
- agentId: string;
14
- }, scheduleId: string): Promise<unknown>;
15
- private _deleteProcessorSchedule;
16
8
  regenerateScheduleToken(agentId: string, scheduleId: string): Promise<unknown>;
17
- regenerateScheduleToken(identifier: {
18
- agentId: string;
19
- }, scheduleId: string): Promise<unknown>;
20
- private _regenerateScheduleToken;
21
9
  getScheduleInfo(scheduleId: string): Promise<ScheduleInfo>;
22
10
  getScheduleInfoAlias(scheduleId: string): Promise<ScheduleInfo>;
23
11
  createProcessorSubscription(agentId: string, subscriptionId: string, body: PutSubscriptionRequest): Promise<unknown>;
24
- createProcessorSubscription(identifier: {
25
- agentId: string;
26
- }, subscriptionId: string, body: PutSubscriptionRequest): Promise<unknown>;
27
- private _createProcessorSubscription;
28
12
  deleteProcessorSubscription(agentId: string, subscriptionId: string): Promise<unknown>;
29
- deleteProcessorSubscription(identifier: {
30
- agentId: string;
31
- }, subscriptionId: string): Promise<unknown>;
32
- private _deleteProcessorSubscription;
33
13
  getProcessorSubscriptionInfo(subscriptionName: string): Promise<SubscriptionInfo>;
34
14
  getProcessorSubscriptionInfoAlias(subscriptionArn: string): Promise<SubscriptionInfo>;
35
15
  createIngestionEndpoint(agentId: string, ingestionId: string, body: CreateIngestionRequest): Promise<unknown>;
36
- createIngestionEndpoint(identifier: {
37
- agentId: string;
38
- }, ingestionId: string, body: CreateIngestionRequest): Promise<unknown>;
39
- private _createIngestionEndpoint;
40
16
  deleteIngestionEndpoint(agentId: string, ingestionId: string): Promise<unknown>;
41
- deleteIngestionEndpoint(identifier: {
42
- agentId: string;
43
- }, ingestionId: string): Promise<unknown>;
44
- private _deleteIngestionEndpoint;
45
17
  invokeIngestionEndpoint(agentId: string, ingestionId: string, body: unknown, params?: {
46
18
  wait?: boolean;
47
19
  json_response?: boolean;
48
20
  }): Promise<unknown>;
49
- invokeIngestionEndpoint(identifier: {
50
- agentId: string;
51
- }, ingestionId: string, body: unknown, params?: {
52
- wait?: boolean;
53
- json_response?: boolean;
54
- }): Promise<unknown>;
55
- private _invokeIngestionEndpoint;
56
21
  }
@@ -5,34 +5,13 @@ class ProcessorsApi {
5
5
  constructor(rest) {
6
6
  this.rest = rest;
7
7
  }
8
- createProcessorSchedule(...args) {
9
- if (typeof args[0] === "string") {
10
- return this._createProcessorSchedule(args[0], args[1], args[2]);
11
- }
12
- const id = args[0];
13
- return this._createProcessorSchedule(id.agentId, args[1], args[2]);
14
- }
15
- _createProcessorSchedule(agentId, scheduleId, body) {
8
+ createProcessorSchedule(agentId, scheduleId, body) {
16
9
  return this.rest.put(`/agents/${agentId}/processors/schedules/${scheduleId}`, body);
17
10
  }
18
- deleteProcessorSchedule(...args) {
19
- if (typeof args[0] === "string") {
20
- return this._deleteProcessorSchedule(args[0], args[1]);
21
- }
22
- const id = args[0];
23
- return this._deleteProcessorSchedule(id.agentId, args[1]);
24
- }
25
- _deleteProcessorSchedule(agentId, scheduleId) {
11
+ deleteProcessorSchedule(agentId, scheduleId) {
26
12
  return this.rest.delete(`/agents/${agentId}/processors/schedules/${scheduleId}`);
27
13
  }
28
- regenerateScheduleToken(...args) {
29
- if (typeof args[0] === "string") {
30
- return this._regenerateScheduleToken(args[0], args[1]);
31
- }
32
- const id = args[0];
33
- return this._regenerateScheduleToken(id.agentId, args[1]);
34
- }
35
- _regenerateScheduleToken(agentId, scheduleId) {
14
+ regenerateScheduleToken(agentId, scheduleId) {
36
15
  return this.rest.post(`/agents/${agentId}/processors/schedules/${scheduleId}/token`, {});
37
16
  }
38
17
  getScheduleInfo(scheduleId) {
@@ -41,24 +20,10 @@ class ProcessorsApi {
41
20
  getScheduleInfoAlias(scheduleId) {
42
21
  return this.rest.get(`/processors/schedules/${scheduleId}/info`);
43
22
  }
44
- createProcessorSubscription(...args) {
45
- if (typeof args[0] === "string") {
46
- return this._createProcessorSubscription(args[0], args[1], args[2]);
47
- }
48
- const id = args[0];
49
- return this._createProcessorSubscription(id.agentId, args[1], args[2]);
50
- }
51
- _createProcessorSubscription(agentId, subscriptionId, body) {
23
+ createProcessorSubscription(agentId, subscriptionId, body) {
52
24
  return this.rest.put(`/agents/${agentId}/processors/subscriptions/${subscriptionId}`, body);
53
25
  }
54
- deleteProcessorSubscription(...args) {
55
- if (typeof args[0] === "string") {
56
- return this._deleteProcessorSubscription(args[0], args[1]);
57
- }
58
- const id = args[0];
59
- return this._deleteProcessorSubscription(id.agentId, args[1]);
60
- }
61
- _deleteProcessorSubscription(agentId, subscriptionId) {
26
+ deleteProcessorSubscription(agentId, subscriptionId) {
62
27
  return this.rest.delete(`/agents/${agentId}/processors/subscriptions/${subscriptionId}`);
63
28
  }
64
29
  getProcessorSubscriptionInfo(subscriptionName) {
@@ -67,34 +32,13 @@ class ProcessorsApi {
67
32
  getProcessorSubscriptionInfoAlias(subscriptionArn) {
68
33
  return this.rest.get(`/processors/subscriptions/${subscriptionArn}/info`);
69
34
  }
70
- createIngestionEndpoint(...args) {
71
- if (typeof args[0] === "string") {
72
- return this._createIngestionEndpoint(args[0], args[1], args[2]);
73
- }
74
- const id = args[0];
75
- return this._createIngestionEndpoint(id.agentId, args[1], args[2]);
76
- }
77
- _createIngestionEndpoint(agentId, ingestionId, body) {
35
+ createIngestionEndpoint(agentId, ingestionId, body) {
78
36
  return this.rest.put(`/agents/${agentId}/processors/ingestions/${ingestionId}`, body);
79
37
  }
80
- deleteIngestionEndpoint(...args) {
81
- if (typeof args[0] === "string") {
82
- return this._deleteIngestionEndpoint(args[0], args[1]);
83
- }
84
- const id = args[0];
85
- return this._deleteIngestionEndpoint(id.agentId, args[1]);
86
- }
87
- _deleteIngestionEndpoint(agentId, ingestionId) {
38
+ deleteIngestionEndpoint(agentId, ingestionId) {
88
39
  return this.rest.delete(`/agents/${agentId}/processors/ingestions/${ingestionId}`);
89
40
  }
90
- invokeIngestionEndpoint(...args) {
91
- if (typeof args[0] === "string") {
92
- return this._invokeIngestionEndpoint(args[0], args[1], args[2], args[3]);
93
- }
94
- const id = args[0];
95
- return this._invokeIngestionEndpoint(id.agentId, args[1], args[2], args[3]);
96
- }
97
- _invokeIngestionEndpoint(agentId, ingestionId, body, params) {
41
+ invokeIngestionEndpoint(agentId, ingestionId, body, params) {
98
42
  return this.rest.post(`/agents/${agentId}/processors/ingestions/${ingestionId}/invoke`, body, params);
99
43
  }
100
44
  }