@wildix/stream-client 4.0.3 → 4.0.5

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.
@@ -38,6 +38,10 @@ class StreamServiceClient extends client_2.Client {
38
38
  httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultStreamServiceHttpAuthSchemeParametersProvider,
39
39
  identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({
40
40
  "smithy.api#httpBearerAuth": config.token,
41
+ "wildix.auth#apiKeys": config.token,
42
+ "wildix.auth#pbx": config.token,
43
+ "wildix.auth#s2s": config.token,
44
+ "wildix.auth#xbs": config.token,
41
45
  }),
42
46
  }));
43
47
  this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchSort = exports.MessageUnsetFields = exports.MentionsFilter = exports.GroupChannelUnsetOptions = exports.FileCategory = exports.DownloadStrategy = exports.SectionType = exports.TargetNotEligibleReason = exports.MessageWhatsAppStatus = exports.MessageSmsStatus = exports.GroupChannelCreationEventType = exports.ChannelsFilter = exports.ChannelWhatsAppStatus = exports.MessageType = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelType = exports.ChannelAccess = exports.AttachmentType = exports.AssignChannelVariant = exports.ChannelMemberRole = exports.ButtonVariant = void 0;
3
+ exports.SearchSort = exports.MessageUnsetFields = exports.MessageAnchor = exports.MentionsFilter = exports.GroupChannelUnsetOptions = exports.FileCategory = exports.DownloadStrategy = exports.SectionType = exports.TargetNotEligibleReason = exports.MessageWhatsAppStatus = exports.MessageSmsStatus = exports.GroupChannelCreationEventType = exports.ChannelsFilter = exports.ChannelWhatsAppStatus = exports.MessageType = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelType = exports.ChannelAccess = exports.AttachmentType = exports.AssignChannelVariant = exports.ChannelMemberRole = exports.ButtonVariant = void 0;
4
4
  exports.ButtonVariant = {
5
5
  CONTAINED: "contained",
6
6
  OUTLINED: "outlined",
@@ -105,6 +105,9 @@ exports.GroupChannelUnsetOptions = {
105
105
  exports.MentionsFilter = {
106
106
  UNREAD: "unread",
107
107
  };
108
+ exports.MessageAnchor = {
109
+ FIRST_UNREAD: "firstUnread",
110
+ };
108
111
  exports.MessageUnsetFields = {
109
112
  ATTACHMENTS: "attachments",
110
113
  ELEMENTS: "elements",
@@ -24,6 +24,26 @@ const getRuntimeConfig = (config) => {
24
24
  identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"),
25
25
  signer: new core_1.HttpBearerAuthSigner(),
26
26
  },
27
+ {
28
+ schemeId: "wildix.auth#apiKeys",
29
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#apiKeys"),
30
+ signer: new core_1.HttpBearerAuthSigner(),
31
+ },
32
+ {
33
+ schemeId: "wildix.auth#pbx",
34
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#pbx"),
35
+ signer: new core_1.HttpBearerAuthSigner(),
36
+ },
37
+ {
38
+ schemeId: "wildix.auth#s2s",
39
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#s2s"),
40
+ signer: new core_1.HttpBearerAuthSigner(),
41
+ },
42
+ {
43
+ schemeId: "wildix.auth#xbs",
44
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#xbs"),
45
+ signer: new core_1.HttpBearerAuthSigner(),
46
+ },
27
47
  ],
28
48
  logger: config?.logger ?? new client_1.NoOpLogger(),
29
49
  protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol,
@@ -276,6 +276,7 @@ const _aT = "attachmentTypes";
276
276
  const _ac = "access";
277
277
  const _act = "action";
278
278
  const _acti = "actions";
279
+ const _an = "anchor";
279
280
  const _at = "attendees";
280
281
  const _att = "attachments";
281
282
  const _b = "broadcast";
@@ -313,6 +314,7 @@ const _ex = "external";
313
314
  const _exp = "expires";
314
315
  const _f = "file";
315
316
  const _fI = "fsId";
317
+ const _fUVS = "firstUnreadVisibleSeq";
316
318
  const _fi = "filter";
317
319
  const _fo = "forward";
318
320
  const _for = "force";
@@ -990,13 +992,13 @@ exports.ListMentionsOutput$ = [3, n1, _LMO,
990
992
  ];
991
993
  exports.ListMessagesInput$ = [3, n1, _LMIi,
992
994
  0,
993
- [_cI, _cIo, _uI, _fr, _to_],
994
- [[0, 1], [0, { [_hQ]: _co }], [0, { [_hQ]: _uI }], [1, { [_hQ]: _fr }], [1, { [_hQ]: _to_ }]], 1
995
+ [_cI, _cIo, _uI, _fr, _to_, _an],
996
+ [[0, 1], [0, { [_hQ]: _co }], [0, { [_hQ]: _uI }], [1, { [_hQ]: _fr }], [1, { [_hQ]: _to_ }], [0, { [_hQ]: _an }]], 1
995
997
  ];
996
998
  exports.ListMessagesOutput$ = [3, n1, _LMOi,
997
999
  0,
998
- [_mes],
999
- [() => MessageList], 1
1000
+ [_mes, _fUVS],
1001
+ [() => MessageList, 1], 1
1000
1002
  ];
1001
1003
  exports.MarkReadInput$ = [3, n1, _MRI,
1002
1004
  0,
@@ -35,6 +35,10 @@ export class StreamServiceClient extends __Client {
35
35
  httpAuthSchemeParametersProvider: defaultStreamServiceHttpAuthSchemeParametersProvider,
36
36
  identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
37
37
  "smithy.api#httpBearerAuth": config.token,
38
+ "wildix.auth#apiKeys": config.token,
39
+ "wildix.auth#pbx": config.token,
40
+ "wildix.auth#s2s": config.token,
41
+ "wildix.auth#xbs": config.token,
38
42
  }),
39
43
  }));
40
44
  this.middlewareStack.use(getHttpSigningPlugin(this.config));
@@ -102,6 +102,9 @@ export const GroupChannelUnsetOptions = {
102
102
  export const MentionsFilter = {
103
103
  UNREAD: "unread",
104
104
  };
105
+ export const MessageAnchor = {
106
+ FIRST_UNREAD: "firstUnread",
107
+ };
105
108
  export const MessageUnsetFields = {
106
109
  ATTACHMENTS: "attachments",
107
110
  ELEMENTS: "elements",
@@ -21,6 +21,26 @@ export const getRuntimeConfig = (config) => {
21
21
  identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"),
22
22
  signer: new HttpBearerAuthSigner(),
23
23
  },
24
+ {
25
+ schemeId: "wildix.auth#apiKeys",
26
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#apiKeys"),
27
+ signer: new HttpBearerAuthSigner(),
28
+ },
29
+ {
30
+ schemeId: "wildix.auth#pbx",
31
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#pbx"),
32
+ signer: new HttpBearerAuthSigner(),
33
+ },
34
+ {
35
+ schemeId: "wildix.auth#s2s",
36
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#s2s"),
37
+ signer: new HttpBearerAuthSigner(),
38
+ },
39
+ {
40
+ schemeId: "wildix.auth#xbs",
41
+ identityProvider: (ipc) => ipc.getIdentityProvider("wildix.auth#xbs"),
42
+ signer: new HttpBearerAuthSigner(),
43
+ },
24
44
  ],
25
45
  logger: config?.logger ?? new NoOpLogger(),
26
46
  protocol: config?.protocol ?? AwsRestJsonProtocol,
@@ -269,6 +269,7 @@ const _aT = "attachmentTypes";
269
269
  const _ac = "access";
270
270
  const _act = "action";
271
271
  const _acti = "actions";
272
+ const _an = "anchor";
272
273
  const _at = "attendees";
273
274
  const _att = "attachments";
274
275
  const _b = "broadcast";
@@ -306,6 +307,7 @@ const _ex = "external";
306
307
  const _exp = "expires";
307
308
  const _f = "file";
308
309
  const _fI = "fsId";
310
+ const _fUVS = "firstUnreadVisibleSeq";
309
311
  const _fi = "filter";
310
312
  const _fo = "forward";
311
313
  const _for = "force";
@@ -983,13 +985,13 @@ export var ListMentionsOutput$ = [3, n1, _LMO,
983
985
  ];
984
986
  export var ListMessagesInput$ = [3, n1, _LMIi,
985
987
  0,
986
- [_cI, _cIo, _uI, _fr, _to_],
987
- [[0, 1], [0, { [_hQ]: _co }], [0, { [_hQ]: _uI }], [1, { [_hQ]: _fr }], [1, { [_hQ]: _to_ }]], 1
988
+ [_cI, _cIo, _uI, _fr, _to_, _an],
989
+ [[0, 1], [0, { [_hQ]: _co }], [0, { [_hQ]: _uI }], [1, { [_hQ]: _fr }], [1, { [_hQ]: _to_ }], [0, { [_hQ]: _an }]], 1
988
990
  ];
989
991
  export var ListMessagesOutput$ = [3, n1, _LMOi,
990
992
  0,
991
- [_mes],
992
- [() => MessageList], 1
993
+ [_mes, _fUVS],
994
+ [() => MessageList, 1], 1
993
995
  ];
994
996
  export var MarkReadInput$ = [3, n1, _MRI,
995
997
  0,
@@ -42,6 +42,7 @@ declare const ListMessagesCommand_base: {
42
42
  * channelId: "STRING_VALUE", // required
43
43
  * from: Number("long"),
44
44
  * to: Number("long"),
45
+ * anchor: "firstUnread",
45
46
  * };
46
47
  * const command = new ListMessagesCommand(input);
47
48
  * const response = await client.send(command);
@@ -153,6 +154,7 @@ declare const ListMessagesCommand_base: {
153
154
  * // event: "STRING_VALUE",
154
155
  * // },
155
156
  * // ],
157
+ * // firstUnreadVisibleSeq: Number("long"),
156
158
  * // };
157
159
  *
158
160
  * ```
@@ -277,6 +277,20 @@ export declare const MentionsFilter: {
277
277
  * @public
278
278
  */
279
279
  export type MentionsFilter = (typeof MentionsFilter)[keyof typeof MentionsFilter];
280
+ /**
281
+ * @public
282
+ * @enum
283
+ */
284
+ export declare const MessageAnchor: {
285
+ /**
286
+ * Return a bounded window starting at the caller's first unread message, resolved from their authoritative read cursor. `from`/`to` are ignored.
287
+ */
288
+ readonly FIRST_UNREAD: "firstUnread";
289
+ };
290
+ /**
291
+ * @public
292
+ */
293
+ export type MessageAnchor = (typeof MessageAnchor)[keyof typeof MessageAnchor];
280
294
  /**
281
295
  * @public
282
296
  * @enum
@@ -1,4 +1,4 @@
1
- import type { AssignChannelVariant, AttachmentType, ButtonVariant, ChannelAccess, ChannelContextEventAttendeeStatus, ChannelContextSource, ChannelMemberRole, ChannelsFilter, ChannelType, ChannelWhatsAppStatus, DownloadStrategy, FileCategory, GroupChannelCreationEventType, GroupChannelUnsetOptions, MentionsFilter, MessageSmsStatus, MessageType, MessageUnsetFields, MessageWhatsAppStatus, SearchSort, SectionType } from "./enums";
1
+ import type { AssignChannelVariant, AttachmentType, ButtonVariant, ChannelAccess, ChannelContextEventAttendeeStatus, ChannelContextSource, ChannelMemberRole, ChannelsFilter, ChannelType, ChannelWhatsAppStatus, DownloadStrategy, FileCategory, GroupChannelCreationEventType, GroupChannelUnsetOptions, MentionsFilter, MessageAnchor, MessageSmsStatus, MessageType, MessageUnsetFields, MessageWhatsAppStatus, SearchSort, SectionType } from "./enums";
2
2
  /**
3
3
  * @public
4
4
  */
@@ -2404,6 +2404,11 @@ export interface ListMessagesInput {
2404
2404
  * @public
2405
2405
  */
2406
2406
  to?: number | undefined;
2407
+ /**
2408
+ * Server-resolved starting point. `firstUnread` returns a window beginning at the caller's first unread message (from their read cursor), so a channel can open positioned on it in one request; `from`/`to` are ignored when set.
2409
+ * @public
2410
+ */
2411
+ anchor?: MessageAnchor | undefined;
2407
2412
  }
2408
2413
  /**
2409
2414
  * @public
@@ -2414,6 +2419,11 @@ export interface ListMessagesOutput {
2414
2419
  * @public
2415
2420
  */
2416
2421
  messages: Message[];
2422
+ /**
2423
+ * Present on an `anchor=firstUnread` response: the `visibleSeq` of the caller's first unread message, resolved from their authoritative read cursor. Absent when the channel is fully read.
2424
+ * @public
2425
+ */
2426
+ firstUnreadVisibleSeq?: number | undefined;
2417
2427
  }
2418
2428
  /**
2419
2429
  * @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/stream-client",
3
3
  "description": "@wildix/stream-client client",
4
- "version": "4.0.3",
4
+ "version": "4.0.5",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",