skapi-js 1.2.12-beta.5 → 1.2.12

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 (62) hide show
  1. package/README.md +0 -13
  2. package/dist/bundle-report-commonjs.html +2 -2
  3. package/dist/bundle-report.html +2 -2
  4. package/dist/skapi.cjs +1 -1
  5. package/dist/skapi.cjs.map +1 -1
  6. package/dist/skapi.d.mts +1534 -0
  7. package/dist/skapi.d.ts +1534 -0
  8. package/dist/skapi.js +1 -1
  9. package/dist/skapi.js.map +1 -1
  10. package/dist/skapi.mjs +234 -0
  11. package/dist/skapi.mjs.map +1 -0
  12. package/js/Main.d.ts +0 -1
  13. package/js/Types.d.ts +1 -8
  14. package/js/main/skapi.d.ts +10 -9
  15. package/js/main/skapi.js +44 -43
  16. package/js/main/skapi.js.map +1 -1
  17. package/js/methods/admin.d.ts +2 -4
  18. package/js/methods/admin.js +9 -9
  19. package/js/methods/admin.js.map +1 -1
  20. package/js/methods/database.js +17 -10
  21. package/js/methods/database.js.map +1 -1
  22. package/js/methods/notification.js +0 -12
  23. package/js/methods/notification.js.map +1 -1
  24. package/js/methods/realtime.js +2 -17
  25. package/js/methods/realtime.js.map +1 -1
  26. package/js/methods/subscription.js +1 -1
  27. package/js/methods/subscription.js.map +1 -1
  28. package/js/methods/user.d.ts +2 -5
  29. package/js/methods/user.js +10 -47
  30. package/js/methods/user.js.map +1 -1
  31. package/js/methods/vivian.js +1 -1
  32. package/js/methods/vivian.js.map +1 -1
  33. package/js/methods/webrtc.js +3 -9
  34. package/js/methods/webrtc.js.map +1 -1
  35. package/js/polyfills/global.js +1 -173
  36. package/js/polyfills/global.js.map +1 -1
  37. package/js/utils/network.js +7 -19
  38. package/js/utils/network.js.map +1 -1
  39. package/js/utils/utils.js +4 -5
  40. package/js/utils/utils.js.map +1 -1
  41. package/js/utils/validator.js +4 -4
  42. package/js/utils/validator.js.map +1 -1
  43. package/package.json +1 -2
  44. package/js/node_modules/qpass/index.d.ts +0 -25
  45. package/js/src/Main.d.ts +0 -6
  46. package/js/src/Types.d.ts +0 -266
  47. package/js/src/main/error.d.ts +0 -9
  48. package/js/src/main/skapi.d.ts +0 -477
  49. package/js/src/methods/admin.d.ts +0 -61
  50. package/js/src/methods/database.d.ts +0 -87
  51. package/js/src/methods/notification.d.ts +0 -21
  52. package/js/src/methods/param_restrictions.d.ts +0 -21
  53. package/js/src/methods/realtime.d.ts +0 -35
  54. package/js/src/methods/request.d.ts +0 -43
  55. package/js/src/methods/subscription.d.ts +0 -69
  56. package/js/src/methods/user.d.ts +0 -174
  57. package/js/src/methods/vivian.d.ts +0 -3
  58. package/js/src/methods/webrtc.d.ts +0 -26
  59. package/js/src/polyfills/global.d.ts +0 -0
  60. package/js/src/utils/network.d.ts +0 -24
  61. package/js/src/utils/utils.d.ts +0 -32
  62. package/js/src/utils/validator.d.ts +0 -24
package/js/src/Types.d.ts DELETED
@@ -1,266 +0,0 @@
1
- export type Condition = 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | '>' | '>=' | '<' | '<=' | '=';
2
- export type RTCReceiverParams = {
3
- ice?: string;
4
- media?: {
5
- video: boolean;
6
- audio: boolean;
7
- } | MediaStream | MediaStreamConstraints;
8
- };
9
- export type RTCConnectorParams = {
10
- cid: string;
11
- ice?: string;
12
- media?: {
13
- video: boolean;
14
- audio: boolean;
15
- } | MediaStream | MediaStreamConstraints;
16
- channels?: Array<RTCDataChannelInit | 'text-chat' | 'file-transfer' | 'video-chat' | 'voice-chat' | 'gaming'>;
17
- };
18
- export type RTCConnector = {
19
- hangup: () => void;
20
- connection: Promise<RTCResolved>;
21
- };
22
- export type RTCResolved = {
23
- target: RTCPeerConnection;
24
- channels: {
25
- [protocol: string]: RTCDataChannel;
26
- };
27
- hangup: () => void;
28
- media: MediaStream;
29
- };
30
- export type RTCEvent = (e: {
31
- type: string;
32
- [key: string]: any;
33
- }) => void;
34
- export type WebSocketMessage = {
35
- type: 'message' | 'error' | 'success' | 'close' | 'notice' | 'private' | 'reconnect' | 'rtc:incoming' | 'rtc:closed';
36
- message?: any;
37
- connectRTC?: (params: RTCReceiverParams, callback: RTCEvent) => Promise<RTCResolved>;
38
- hangup?: () => void;
39
- sender?: string;
40
- sender_cid?: string;
41
- sender_rid?: string;
42
- code?: 'USER_LEFT' | 'USER_DISCONNECTED' | 'USER_JOINED' | null;
43
- };
44
- export type RealtimeCallback = (rt: WebSocketMessage) => void;
45
- export type DelRecordQuery = GetRecordQuery & {
46
- unique_id?: string | string[];
47
- record_id?: string | string[];
48
- };
49
- export type GetRecordQuery = {
50
- unique_id?: string;
51
- record_id?: string;
52
- table?: string | {
53
- name: string;
54
- access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
55
- subscription?: string;
56
- };
57
- reference?: string;
58
- index?: {
59
- name: string | '$updated' | '$uploaded' | '$referenced_count' | '$user_id';
60
- value: string | number | boolean;
61
- condition?: Condition;
62
- range?: string | number | boolean;
63
- };
64
- tag?: string;
65
- };
66
- export type PostRecordConfig = {
67
- record_id?: string;
68
- unique_id?: string;
69
- readonly?: boolean;
70
- table?: {
71
- name: string;
72
- access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
73
- subscription?: {
74
- is_subscription_record?: boolean;
75
- upload_to_feed?: boolean;
76
- notify_subscribers?: boolean;
77
- feed_referencing_records?: boolean;
78
- notify_referencing_records?: boolean;
79
- };
80
- };
81
- source?: {
82
- referencing_limit?: number;
83
- prevent_multiple_referencing?: boolean;
84
- can_remove_referencing_records?: boolean;
85
- only_granted_can_reference?: boolean;
86
- referencing_index_restrictions?: {
87
- name: string;
88
- value?: string | number | boolean;
89
- range?: string | number | boolean;
90
- condition?: 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'ne' | '>' | '>=' | '<' | '<=' | '=' | '!=';
91
- }[] | null;
92
- allow_granted_to_grant_others?: boolean;
93
- };
94
- reference?: string;
95
- index?: {
96
- name: string;
97
- value: string | number | boolean;
98
- } | null;
99
- tags?: string[] | null;
100
- remove_bin?: BinaryFile[] | string[] | null;
101
- progress?: ProgressCallback;
102
- };
103
- export type BinaryFile = {
104
- access_group: number | 'private' | 'public' | 'authorized';
105
- filename: string;
106
- url: string;
107
- path: string;
108
- size: number;
109
- uploaded: number;
110
- getFile: (dataType?: 'base64' | 'endpoint' | 'blob', progress?: ProgressCallback) => Promise<Blob | string | void>;
111
- };
112
- export type RecordData = {
113
- record_id: string;
114
- unique_id?: string;
115
- user_id: string;
116
- updated: number;
117
- uploaded: number;
118
- referenced_count: number;
119
- table: {
120
- name: string;
121
- access_group: number | 'private' | 'public' | 'authorized' | 'admin';
122
- subscription?: {
123
- is_subscription_record: boolean;
124
- upload_to_feed: boolean;
125
- notify_subscribers: boolean;
126
- feed_referencing_records: boolean;
127
- notify_referencing_records: boolean;
128
- };
129
- };
130
- source: {
131
- referencing_limit: number;
132
- prevent_multiple_referencing: boolean;
133
- can_remove_referencing_records: boolean;
134
- only_granted_can_reference: boolean;
135
- referencing_index_restrictions?: {
136
- name: string;
137
- value?: string | number | boolean;
138
- range?: string | number | boolean;
139
- condition?: 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'ne' | '>' | '>=' | '<' | '<=' | '=' | '!=';
140
- }[];
141
- };
142
- reference?: string;
143
- index?: {
144
- name: string;
145
- value: string | number | boolean;
146
- };
147
- data?: Record<string, any>;
148
- tags?: string[];
149
- bin: {
150
- [key: string]: BinaryFile[];
151
- };
152
- ip: string;
153
- readonly: boolean;
154
- };
155
- export type Connection = {
156
- locale: string;
157
- user_agent: string;
158
- ip: string;
159
- group: number;
160
- service_name: string;
161
- opt: {
162
- freeze_database: boolean;
163
- prevent_inquiry: boolean;
164
- prevent_signup: boolean;
165
- };
166
- };
167
- export type Form<T> = HTMLFormElement | FormData | SubmitEvent | T;
168
- export type Newsletters = {
169
- message_id: string;
170
- timestamp: number;
171
- complaint: number;
172
- read: number;
173
- subject: string;
174
- bounced: string;
175
- url: string;
176
- };
177
- export type UserProfilePublicSettings = {
178
- email_public?: boolean;
179
- phone_number_public?: boolean;
180
- address_public?: boolean;
181
- gender_public?: boolean;
182
- birthdate_public?: boolean;
183
- };
184
- export type UserAttributes = {
185
- user_id?: string;
186
- name?: string;
187
- email?: string;
188
- phone_number?: string;
189
- address?: string | {
190
- formatted: string;
191
- locality: string;
192
- region: string;
193
- postal_code: string;
194
- country: string;
195
- };
196
- gender?: string;
197
- birthdate?: string;
198
- misc?: string;
199
- picture?: string;
200
- profile?: string;
201
- website?: string;
202
- nickname?: string;
203
- };
204
- export type UserProfile = {
205
- service: string;
206
- owner: string;
207
- access_group: number;
208
- user_id: string;
209
- locale: string;
210
- email_verified?: boolean;
211
- phone_number_verified?: boolean;
212
- signup_ticket?: string;
213
- } & UserAttributes & UserProfilePublicSettings;
214
- export type UserPublic = {
215
- service: string;
216
- owner: string;
217
- access_group: number;
218
- user_id: string;
219
- locale: string;
220
- subscribers?: number;
221
- subscribed?: number;
222
- records?: number;
223
- timestamp: number;
224
- } & UserAttributes;
225
- export type ProgressCallback = (e: {
226
- status: 'upload' | 'download';
227
- progress: number;
228
- loaded: number;
229
- total: number;
230
- currentFile?: File;
231
- completed?: File[];
232
- failed?: File[];
233
- abort: () => void;
234
- }) => void;
235
- export type FetchOptions = {
236
- limit?: number;
237
- fetchMore?: boolean;
238
- ascending?: boolean;
239
- startKey?: {
240
- [key: string]: any;
241
- };
242
- progress?: ProgressCallback;
243
- };
244
- export type DatabaseResponse<T> = {
245
- list: T[];
246
- startKey: string;
247
- endOfList: boolean;
248
- startKeyHistory: string[];
249
- };
250
- export type FileInfo = {
251
- url: string;
252
- filename: string;
253
- access_group: number | 'private' | 'public' | 'authorized';
254
- filesize: number;
255
- record_id: string;
256
- uploader: string;
257
- uploaded: number;
258
- fileKey: string;
259
- };
260
- export type ConnectionInfo = {
261
- user_ip: string;
262
- user_agent: string;
263
- user_location: string;
264
- service_name: string;
265
- version: string;
266
- };
@@ -1,9 +0,0 @@
1
- export default class SkapiError extends Error {
2
- code: string | number;
3
- cause: Error;
4
- constructor(error: any, options?: {
5
- name?: string;
6
- code?: string;
7
- cause?: Error;
8
- });
9
- }