@stream-io/node-sdk 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/index.cjs.js +4136 -9282
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -3
  4. package/dist/index.es.js +4136 -9206
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/BaseApi.d.ts +10 -0
  7. package/dist/src/StreamCall.d.ts +5 -37
  8. package/dist/src/StreamChannel.d.ts +7 -34
  9. package/dist/src/StreamChatClient.d.ts +2 -25
  10. package/dist/src/StreamClient.d.ts +51 -59
  11. package/dist/src/StreamModerationClient.d.ts +3 -0
  12. package/dist/src/StreamVideoClient.d.ts +2 -18
  13. package/dist/src/gen/chat/ChannelApi.d.ts +33 -0
  14. package/dist/src/gen/chat/ChatApi.d.ts +241 -0
  15. package/dist/src/gen/common/CommonApi.d.ts +99 -0
  16. package/dist/src/gen/model-decoders/index.d.ts +3 -0
  17. package/dist/src/gen/models/index.d.ts +3881 -0
  18. package/dist/src/gen/moderation/ModerationApi.d.ts +38 -0
  19. package/dist/src/gen/video/CallApi.d.ts +56 -0
  20. package/dist/src/gen/video/VideoApi.d.ts +151 -0
  21. package/dist/src/types.d.ts +25 -0
  22. package/dist/src/utils/create-token.d.ts +2 -0
  23. package/dist/src/utils/rate-limit.d.ts +2 -0
  24. package/index.ts +2 -3
  25. package/package.json +5 -4
  26. package/src/BaseApi.ts +115 -0
  27. package/src/StreamCall.ts +9 -199
  28. package/src/StreamChannel.ts +23 -246
  29. package/src/StreamChatClient.ts +3 -122
  30. package/src/StreamClient.ts +101 -345
  31. package/src/StreamModerationClient.ts +3 -0
  32. package/src/StreamVideoClient.ts +3 -95
  33. package/src/gen/chat/ChannelApi.ts +270 -0
  34. package/src/gen/chat/ChatApi.ts +1857 -0
  35. package/src/gen/common/CommonApi.ts +1004 -0
  36. package/src/gen/model-decoders/index.ts +1897 -0
  37. package/src/gen/models/index.ts +6794 -0
  38. package/src/gen/moderation/ModerationApi.ts +476 -0
  39. package/src/gen/video/CallApi.ts +309 -0
  40. package/src/gen/video/VideoApi.ts +1007 -0
  41. package/src/types.ts +35 -0
  42. package/src/utils/create-token.ts +6 -1
  43. package/src/utils/rate-limit.ts +21 -0
  44. package/dist/src/gen/chat/apis/ProductchatApi.d.ts +0 -1750
  45. package/dist/src/gen/chat/apis/index.d.ts +0 -1
  46. package/dist/src/gen/chat/index.d.ts +0 -3
  47. package/dist/src/gen/chat/models/index.d.ts +0 -14865
  48. package/dist/src/gen/chat/runtime.d.ts +0 -180
  49. package/dist/src/gen/video/apis/ProductvideoApi.d.ts +0 -648
  50. package/dist/src/gen/video/apis/index.d.ts +0 -1
  51. package/dist/src/gen/video/index.d.ts +0 -3
  52. package/dist/src/gen/video/models/index.d.ts +0 -5011
  53. package/dist/src/gen/video/runtime.d.ts +0 -180
  54. package/src/gen/chat/.openapi-generator/FILES +0 -6
  55. package/src/gen/chat/.openapi-generator/VERSION +0 -1
  56. package/src/gen/chat/.openapi-generator-ignore +0 -23
  57. package/src/gen/chat/apis/ProductchatApi.ts +0 -7007
  58. package/src/gen/chat/apis/index.ts +0 -3
  59. package/src/gen/chat/index.ts +0 -5
  60. package/src/gen/chat/models/index.ts +0 -14766
  61. package/src/gen/chat/runtime.ts +0 -415
  62. package/src/gen/video/.openapi-generator/FILES +0 -6
  63. package/src/gen/video/.openapi-generator/VERSION +0 -1
  64. package/src/gen/video/.openapi-generator-ignore +0 -23
  65. package/src/gen/video/apis/ProductvideoApi.ts +0 -2575
  66. package/src/gen/video/apis/index.ts +0 -3
  67. package/src/gen/video/index.ts +0 -5
  68. package/src/gen/video/models/index.ts +0 -5000
  69. package/src/gen/video/runtime.ts +0 -415
@@ -1,180 +0,0 @@
1
- /**
2
- * Stream API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: v122.3.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- export declare const BASE_PATH: string;
13
- export interface ConfigurationParameters {
14
- basePath?: string;
15
- fetchApi?: FetchAPI;
16
- middleware?: Middleware[];
17
- queryParamsStringify?: (params: HTTPQuery) => string;
18
- username?: string;
19
- password?: string;
20
- apiKey?: string | ((name: string) => string);
21
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
22
- headers?: HTTPHeaders;
23
- credentials?: RequestCredentials;
24
- }
25
- export declare class Configuration {
26
- private configuration;
27
- constructor(configuration?: ConfigurationParameters);
28
- set config(configuration: Configuration);
29
- get basePath(): string;
30
- get fetchApi(): FetchAPI | undefined;
31
- get middleware(): Middleware[];
32
- get queryParamsStringify(): (params: HTTPQuery) => string;
33
- get username(): string | undefined;
34
- get password(): string | undefined;
35
- get apiKey(): ((name: string) => string) | undefined;
36
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
37
- get headers(): HTTPHeaders | undefined;
38
- get credentials(): RequestCredentials | undefined;
39
- }
40
- export declare const DefaultConfig: Configuration;
41
- /**
42
- * This is the base class for all generated API classes.
43
- */
44
- export declare class BaseAPI {
45
- protected configuration: Configuration;
46
- private static readonly jsonRegex;
47
- private middleware;
48
- constructor(configuration?: Configuration);
49
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
50
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
51
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
52
- /**
53
- * Check if the given MIME is a JSON MIME.
54
- * JSON MIME examples:
55
- * application/json
56
- * application/json; charset=UTF8
57
- * APPLICATION/JSON
58
- * application/vnd.company+json
59
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
60
- * @return True if the given MIME is JSON, false otherwise.
61
- */
62
- protected isJsonMime(mime: string | null | undefined): boolean;
63
- protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
64
- private createFetchParams;
65
- private fetchApi;
66
- /**
67
- * Create a shallow clone of `this` by constructing a new instance
68
- * and then shallow cloning data members.
69
- */
70
- private clone;
71
- }
72
- export declare class ResponseError extends Error {
73
- response: Response;
74
- name: "ResponseError";
75
- constructor(response: Response, msg?: string);
76
- }
77
- export declare class FetchError extends Error {
78
- cause: Error;
79
- name: "FetchError";
80
- constructor(cause: Error, msg?: string);
81
- }
82
- export declare class RequiredError extends Error {
83
- field: string;
84
- name: "RequiredError";
85
- constructor(field: string, msg?: string);
86
- }
87
- export declare const COLLECTION_FORMATS: {
88
- csv: string;
89
- ssv: string;
90
- tsv: string;
91
- pipes: string;
92
- };
93
- export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
94
- export type Json = any;
95
- export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
96
- export type HTTPHeaders = {
97
- [key: string]: string;
98
- };
99
- export type HTTPQuery = {
100
- [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
101
- };
102
- export type HTTPBody = Json | FormData | URLSearchParams;
103
- export type HTTPRequestInit = {
104
- headers?: HTTPHeaders;
105
- method: HTTPMethod;
106
- credentials?: RequestCredentials;
107
- body?: HTTPBody;
108
- };
109
- export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
110
- export type InitOverrideFunction = (requestContext: {
111
- init: HTTPRequestInit;
112
- context: RequestOpts;
113
- }) => Promise<RequestInit>;
114
- export interface FetchParams {
115
- url: string;
116
- init: RequestInit;
117
- }
118
- export interface RequestOpts {
119
- path: string;
120
- method: HTTPMethod;
121
- headers: HTTPHeaders;
122
- query?: HTTPQuery;
123
- body?: HTTPBody;
124
- }
125
- export declare function querystring(params: HTTPQuery, prefix?: string): string;
126
- export declare function canConsumeForm(consumes: Consume[]): boolean;
127
- export interface Consume {
128
- contentType: string;
129
- }
130
- export interface RequestContext {
131
- fetch: FetchAPI;
132
- url: string;
133
- init: RequestInit;
134
- }
135
- export interface ResponseContext {
136
- fetch: FetchAPI;
137
- url: string;
138
- init: RequestInit;
139
- response: Response;
140
- }
141
- export interface ErrorContext {
142
- fetch: FetchAPI;
143
- url: string;
144
- init: RequestInit;
145
- error: unknown;
146
- response?: Response;
147
- }
148
- export interface Middleware {
149
- pre?(context: RequestContext): Promise<FetchParams | void>;
150
- post?(context: ResponseContext): Promise<Response | void>;
151
- onError?(context: ErrorContext): Promise<Response | void>;
152
- }
153
- export interface ApiResponse<T> {
154
- raw: Response;
155
- value(): Promise<T>;
156
- }
157
- export interface ResponseTransformer<T> {
158
- (json: any): T;
159
- }
160
- export declare class JSONApiResponse<T> {
161
- raw: Response;
162
- private transformer;
163
- constructor(raw: Response, transformer?: ResponseTransformer<T>);
164
- value(): Promise<T>;
165
- }
166
- export declare class VoidApiResponse {
167
- raw: Response;
168
- constructor(raw: Response);
169
- value(): Promise<void>;
170
- }
171
- export declare class BlobApiResponse {
172
- raw: Response;
173
- constructor(raw: Response);
174
- value(): Promise<Blob>;
175
- }
176
- export declare class TextApiResponse {
177
- raw: Response;
178
- constructor(raw: Response);
179
- value(): Promise<string>;
180
- }