@foru-ms/sdk 2.0.5 → 2.0.7

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 (98) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +1 -1
  3. package/dist/cjs/Client.js +1 -1
  4. package/dist/cjs/api/resources/auth/client/Client.d.ts +13 -1
  5. package/dist/cjs/api/resources/auth/client/Client.js +29 -5
  6. package/dist/cjs/api/resources/auth/types/GetAuthMeResponse.d.ts +7 -2
  7. package/dist/cjs/api/resources/auth/types/PostAuthForgotPasswordResponse.d.ts +7 -2
  8. package/dist/cjs/api/resources/auth/types/PostAuthLoginResponse.d.ts +20 -1
  9. package/dist/cjs/api/resources/auth/types/PostAuthRegisterResponse.d.ts +20 -1
  10. package/dist/cjs/api/resources/auth/types/PostAuthResetPasswordResponse.d.ts +6 -1
  11. package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
  12. package/dist/cjs/api/resources/integrations/client/Client.js +1 -1
  13. package/dist/cjs/api/resources/integrations/types/GetIntegrationsResponse.d.ts +35 -32
  14. package/dist/cjs/api/resources/integrations/types/GetIntegrationsResponse.js +15 -12
  15. package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
  16. package/dist/cjs/api/resources/notifications/client/Client.js +1 -1
  17. package/dist/cjs/api/resources/notifications/types/GetNotificationsResponse.d.ts +35 -32
  18. package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/posts/client/Client.js +1 -1
  20. package/dist/cjs/api/resources/posts/types/GetPostsResponse.d.ts +28 -25
  21. package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +1 -1
  22. package/dist/cjs/api/resources/privateMessages/client/Client.js +1 -1
  23. package/dist/cjs/api/resources/privateMessages/types/GetPrivateMessagesResponse.d.ts +31 -28
  24. package/dist/cjs/api/resources/reports/client/Client.d.ts +1 -1
  25. package/dist/cjs/api/resources/reports/client/Client.js +1 -1
  26. package/dist/cjs/api/resources/reports/types/GetReportsResponse.d.ts +33 -30
  27. package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
  28. package/dist/cjs/api/resources/roles/client/Client.js +1 -1
  29. package/dist/cjs/api/resources/roles/types/GetRolesResponse.d.ts +27 -24
  30. package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
  31. package/dist/cjs/api/resources/ssOs/client/Client.js +1 -1
  32. package/dist/cjs/api/resources/ssOs/types/GetSsoResponse.d.ts +32 -29
  33. package/dist/cjs/api/resources/ssOs/types/GetSsoResponse.js +12 -9
  34. package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
  35. package/dist/cjs/api/resources/tags/client/Client.js +1 -1
  36. package/dist/cjs/api/resources/tags/types/GetTagsResponse.d.ts +27 -24
  37. package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
  38. package/dist/cjs/api/resources/threads/client/Client.js +1 -1
  39. package/dist/cjs/api/resources/threads/types/GetThreadsResponse.d.ts +55 -52
  40. package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
  41. package/dist/cjs/api/resources/users/client/Client.js +1 -1
  42. package/dist/cjs/api/resources/users/types/GetUsersResponse.d.ts +46 -43
  43. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
  44. package/dist/cjs/api/resources/webhooks/client/Client.js +1 -1
  45. package/dist/cjs/api/resources/webhooks/types/GetWebhooksResponse.d.ts +29 -26
  46. package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
  47. package/dist/cjs/version.d.ts +1 -1
  48. package/dist/cjs/version.js +1 -1
  49. package/dist/esm/BaseClient.mjs +2 -2
  50. package/dist/esm/Client.d.mts +1 -1
  51. package/dist/esm/Client.mjs +1 -1
  52. package/dist/esm/api/resources/auth/client/Client.d.mts +13 -1
  53. package/dist/esm/api/resources/auth/client/Client.mjs +29 -5
  54. package/dist/esm/api/resources/auth/types/GetAuthMeResponse.d.mts +7 -2
  55. package/dist/esm/api/resources/auth/types/PostAuthForgotPasswordResponse.d.mts +7 -2
  56. package/dist/esm/api/resources/auth/types/PostAuthLoginResponse.d.mts +20 -1
  57. package/dist/esm/api/resources/auth/types/PostAuthRegisterResponse.d.mts +20 -1
  58. package/dist/esm/api/resources/auth/types/PostAuthResetPasswordResponse.d.mts +6 -1
  59. package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
  60. package/dist/esm/api/resources/integrations/client/Client.mjs +1 -1
  61. package/dist/esm/api/resources/integrations/types/GetIntegrationsResponse.d.mts +35 -32
  62. package/dist/esm/api/resources/integrations/types/GetIntegrationsResponse.mjs +15 -12
  63. package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
  64. package/dist/esm/api/resources/notifications/client/Client.mjs +1 -1
  65. package/dist/esm/api/resources/notifications/types/GetNotificationsResponse.d.mts +35 -32
  66. package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
  67. package/dist/esm/api/resources/posts/client/Client.mjs +1 -1
  68. package/dist/esm/api/resources/posts/types/GetPostsResponse.d.mts +28 -25
  69. package/dist/esm/api/resources/privateMessages/client/Client.d.mts +1 -1
  70. package/dist/esm/api/resources/privateMessages/client/Client.mjs +1 -1
  71. package/dist/esm/api/resources/privateMessages/types/GetPrivateMessagesResponse.d.mts +31 -28
  72. package/dist/esm/api/resources/reports/client/Client.d.mts +1 -1
  73. package/dist/esm/api/resources/reports/client/Client.mjs +1 -1
  74. package/dist/esm/api/resources/reports/types/GetReportsResponse.d.mts +33 -30
  75. package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
  76. package/dist/esm/api/resources/roles/client/Client.mjs +1 -1
  77. package/dist/esm/api/resources/roles/types/GetRolesResponse.d.mts +27 -24
  78. package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
  79. package/dist/esm/api/resources/ssOs/client/Client.mjs +1 -1
  80. package/dist/esm/api/resources/ssOs/types/GetSsoResponse.d.mts +32 -29
  81. package/dist/esm/api/resources/ssOs/types/GetSsoResponse.mjs +12 -9
  82. package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
  83. package/dist/esm/api/resources/tags/client/Client.mjs +1 -1
  84. package/dist/esm/api/resources/tags/types/GetTagsResponse.d.mts +27 -24
  85. package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
  86. package/dist/esm/api/resources/threads/client/Client.mjs +1 -1
  87. package/dist/esm/api/resources/threads/types/GetThreadsResponse.d.mts +55 -52
  88. package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
  89. package/dist/esm/api/resources/users/client/Client.mjs +1 -1
  90. package/dist/esm/api/resources/users/types/GetUsersResponse.d.mts +46 -43
  91. package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
  92. package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -1
  93. package/dist/esm/api/resources/webhooks/types/GetWebhooksResponse.d.mts +29 -26
  94. package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
  95. package/dist/esm/version.d.mts +1 -1
  96. package/dist/esm/version.mjs +1 -1
  97. package/package.json +2 -4
  98. package/reference.md +56 -0
@@ -9,7 +9,7 @@ export declare namespace ThreadsClient {
9
9
  }
10
10
  export declare class ThreadsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
12
- constructor(options?: ThreadsClient.Options);
12
+ constructor(options: ThreadsClient.Options);
13
13
  /**
14
14
  * @param {Forum.GetThreadsRequest} request
15
15
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
27
27
  import * as errors from "../../../../errors/index.mjs";
28
28
  import * as Forum from "../../../index.mjs";
29
29
  export class ThreadsClient {
30
- constructor(options = {}) {
30
+ constructor(options) {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
@@ -1,64 +1,67 @@
1
1
  export interface GetThreadsResponse {
2
- data: GetThreadsResponse.Data.Item[];
3
- meta: GetThreadsResponse.Meta;
2
+ data: GetThreadsResponse.Data;
4
3
  }
5
4
  export declare namespace GetThreadsResponse {
6
- type Data = Data.Item[];
5
+ interface Data {
6
+ items: Data.Items.Item[];
7
+ /** Cursor for next page */
8
+ nextCursor?: string;
9
+ /** Total count of items */
10
+ count: number;
11
+ }
7
12
  namespace Data {
8
- interface Item {
9
- /** Thread title */
10
- title: string;
11
- /** Thread content (Markdown supported) */
12
- body: string;
13
- /** Author user ID (required for API key auth, ignored for JWT auth) */
14
- userId?: string;
15
- /** List of tag slugs, names, or IDs to attach */
16
- tags?: string[];
17
- /** Poll data */
18
- poll?: Item.Poll;
19
- id: string;
20
- /** URL-friendly identifier */
21
- slug: string | null;
22
- /** Whether thread is locked */
23
- locked: boolean | null;
24
- /** Whether thread is pinned */
25
- pinned: boolean | null;
26
- /** View count */
27
- views: number;
28
- /** Number of posts/replies */
29
- postsCount: number;
30
- /** Timestamp of the last post */
31
- lastPostAt: string | null;
32
- /** Custom metadata */
33
- extendedData: Record<string, unknown> | null;
34
- createdAt: string;
35
- updatedAt: string;
36
- }
37
- namespace Item {
38
- /**
39
- * Poll data
40
- */
41
- interface Poll {
42
- /** Poll title */
13
+ type Items = Items.Item[];
14
+ namespace Items {
15
+ interface Item {
16
+ /** Thread title */
43
17
  title: string;
44
- /** Poll options */
45
- options: Poll.Options.Item[];
18
+ /** Thread content (Markdown supported) */
19
+ body: string;
20
+ /** Author user ID (required for API key auth, ignored for JWT auth) */
21
+ userId?: string;
22
+ /** List of tag slugs, names, or IDs to attach */
23
+ tags?: string[];
24
+ /** Poll data */
25
+ poll?: Item.Poll;
26
+ id: string;
27
+ /** URL-friendly identifier */
28
+ slug: string | null;
29
+ /** Whether thread is locked */
30
+ locked: boolean | null;
31
+ /** Whether thread is pinned */
32
+ pinned: boolean | null;
33
+ /** View count */
34
+ views: number;
35
+ /** Number of posts/replies */
36
+ postsCount: number;
37
+ /** Timestamp of the last post */
38
+ lastPostAt: string | null;
39
+ /** Custom metadata */
40
+ extendedData: Record<string, unknown> | null;
41
+ createdAt: string;
42
+ updatedAt: string;
46
43
  }
47
- namespace Poll {
48
- type Options = Options.Item[];
49
- namespace Options {
50
- interface Item {
51
- title: string;
52
- color?: string;
53
- extendedData?: Record<string, unknown>;
44
+ namespace Item {
45
+ /**
46
+ * Poll data
47
+ */
48
+ interface Poll {
49
+ /** Poll title */
50
+ title: string;
51
+ /** Poll options */
52
+ options: Poll.Options.Item[];
53
+ }
54
+ namespace Poll {
55
+ type Options = Options.Item[];
56
+ namespace Options {
57
+ interface Item {
58
+ title: string;
59
+ color?: string;
60
+ extendedData?: Record<string, unknown>;
61
+ }
54
62
  }
55
63
  }
56
64
  }
57
65
  }
58
66
  }
59
- interface Meta {
60
- total: number;
61
- page: number;
62
- limit: number;
63
- }
64
67
  }
@@ -9,7 +9,7 @@ export declare namespace UsersClient {
9
9
  }
10
10
  export declare class UsersClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
12
- constructor(options?: UsersClient.Options);
12
+ constructor(options: UsersClient.Options);
13
13
  /**
14
14
  * @param {Forum.GetUsersRequest} request
15
15
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
27
27
  import * as errors from "../../../../errors/index.mjs";
28
28
  import * as Forum from "../../../index.mjs";
29
29
  export class UsersClient {
30
- constructor(options = {}) {
30
+ constructor(options) {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
@@ -1,52 +1,55 @@
1
1
  export interface GetUsersResponse {
2
- data: GetUsersResponse.Data.Item[];
3
- meta: GetUsersResponse.Meta;
2
+ data: GetUsersResponse.Data;
4
3
  }
5
4
  export declare namespace GetUsersResponse {
6
- type Data = Data.Item[];
5
+ interface Data {
6
+ items: Data.Items.Item[];
7
+ /** Cursor for next page */
8
+ nextCursor?: string;
9
+ /** Total count of items */
10
+ count: number;
11
+ }
7
12
  namespace Data {
8
- interface Item {
9
- id: string;
10
- username: string;
11
- /** Display name */
12
- displayName: string | null;
13
- /** User bio */
14
- bio: string | null;
15
- /** Forum signature */
16
- signature: string | null;
17
- /** User website URL */
18
- url: string | null;
19
- /** Total posts by user */
20
- postsCount?: number;
21
- /** Total threads by user */
22
- threadsCount?: number;
23
- /** Online status */
24
- isOnline: boolean | null;
25
- /** Last activity timestamp */
26
- lastSeenAt: string | null;
27
- /** User roles */
28
- roles?: Item.Roles.Item[];
29
- /** Custom user data */
30
- extendedData: Record<string, unknown> | null;
31
- /** Account creation timestamp */
32
- createdAt: string;
33
- /** Profile last update timestamp */
34
- updatedAt: string;
35
- }
36
- namespace Item {
37
- type Roles = Roles.Item[];
38
- namespace Roles {
39
- interface Item {
40
- id: string;
41
- name: string;
42
- slug: string | null;
13
+ type Items = Items.Item[];
14
+ namespace Items {
15
+ interface Item {
16
+ id: string;
17
+ username: string;
18
+ /** Display name */
19
+ displayName: string | null;
20
+ /** User bio */
21
+ bio: string | null;
22
+ /** Forum signature */
23
+ signature: string | null;
24
+ /** User website URL */
25
+ url: string | null;
26
+ /** Total posts by user */
27
+ postsCount?: number;
28
+ /** Total threads by user */
29
+ threadsCount?: number;
30
+ /** Online status */
31
+ isOnline: boolean | null;
32
+ /** Last activity timestamp */
33
+ lastSeenAt: string | null;
34
+ /** User roles */
35
+ roles?: Item.Roles.Item[];
36
+ /** Custom user data */
37
+ extendedData: Record<string, unknown> | null;
38
+ /** Account creation timestamp */
39
+ createdAt: string;
40
+ /** Profile last update timestamp */
41
+ updatedAt: string;
42
+ }
43
+ namespace Item {
44
+ type Roles = Roles.Item[];
45
+ namespace Roles {
46
+ interface Item {
47
+ id: string;
48
+ name: string;
49
+ slug: string | null;
50
+ }
43
51
  }
44
52
  }
45
53
  }
46
54
  }
47
- interface Meta {
48
- total: number;
49
- page: number;
50
- limit: number;
51
- }
52
55
  }
@@ -9,7 +9,7 @@ export declare namespace WebhooksClient {
9
9
  }
10
10
  export declare class WebhooksClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
12
- constructor(options?: WebhooksClient.Options);
12
+ constructor(options: WebhooksClient.Options);
13
13
  /**
14
14
  * @param {Forum.GetWebhooksRequest} request
15
15
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
16
16
  import * as errors from "../../../../errors/index.mjs";
17
17
  import * as Forum from "../../../index.mjs";
18
18
  export class WebhooksClient {
19
- constructor(options = {}) {
19
+ constructor(options) {
20
20
  this._options = normalizeClientOptionsWithAuth(options);
21
21
  }
22
22
  /**
@@ -1,33 +1,36 @@
1
1
  export interface GetWebhooksResponse {
2
- data: GetWebhooksResponse.Data.Item[];
3
- meta: GetWebhooksResponse.Meta;
2
+ data: GetWebhooksResponse.Data;
4
3
  }
5
4
  export declare namespace GetWebhooksResponse {
6
- type Data = Data.Item[];
5
+ interface Data {
6
+ items: Data.Items.Item[];
7
+ /** Cursor for next page */
8
+ nextCursor?: string;
9
+ /** Total count of items */
10
+ count: number;
11
+ }
7
12
  namespace Data {
8
- interface Item {
9
- id: string;
10
- /** Webhook name */
11
- name: string;
12
- /** Webhook endpoint URL */
13
- url: string;
14
- /** Event types to trigger on */
15
- events: string[];
16
- /** Whether webhook is active */
17
- active: boolean;
18
- /** Last trigger timestamp */
19
- lastTriggered: string | null;
20
- /** Consecutive failure count */
21
- failureCount: number;
22
- /** Webhook creation timestamp */
23
- createdAt: string;
24
- /** Webhook last update timestamp */
25
- updatedAt: string;
13
+ type Items = Items.Item[];
14
+ namespace Items {
15
+ interface Item {
16
+ id: string;
17
+ /** Webhook name */
18
+ name: string;
19
+ /** Webhook endpoint URL */
20
+ url: string;
21
+ /** Event types to trigger on */
22
+ events: string[];
23
+ /** Whether webhook is active */
24
+ active: boolean;
25
+ /** Last trigger timestamp */
26
+ lastTriggered: string | null;
27
+ /** Consecutive failure count */
28
+ failureCount: number;
29
+ /** Webhook creation timestamp */
30
+ createdAt: string;
31
+ /** Webhook last update timestamp */
32
+ updatedAt: string;
33
+ }
26
34
  }
27
35
  }
28
- interface Meta {
29
- total: number;
30
- page: number;
31
- limit: number;
32
- }
33
36
  }
@@ -1,7 +1,7 @@
1
1
  import * as core from "../core/index.mjs";
2
2
  export declare namespace HeaderAuthProvider {
3
3
  interface AuthOptions {
4
- apiKey?: core.Supplier<string>;
4
+ apiKey: core.Supplier<string>;
5
5
  }
6
6
  interface Options extends AuthOptions {
7
7
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.5";
1
+ export declare const SDK_VERSION = "2.0.7";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.5";
1
+ export const SDK_VERSION = "2.0.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foru-ms/sdk",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,15 +42,13 @@
42
42
  "build:cjs": "tsc --project ./tsconfig.cjs.json",
43
43
  "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
44
44
  "test": "vitest",
45
- "test:unit": "vitest --project unit",
46
- "test:wire": "vitest --project wire"
45
+ "test:unit": "vitest --project unit"
47
46
  },
48
47
  "dependencies": {},
49
48
  "devDependencies": {
50
49
  "webpack": "^5.97.1",
51
50
  "ts-loader": "^9.5.1",
52
51
  "vitest": "^3.2.4",
53
- "msw": "2.11.2",
54
52
  "@types/node": "^18.19.70",
55
53
  "typescript": "~5.7.2",
56
54
  "@biomejs/biome": "2.3.1"
package/reference.md CHANGED
@@ -4,6 +4,20 @@
4
4
  <dl>
5
5
  <dd>
6
6
 
7
+ #### 📝 Description
8
+
9
+ <dl>
10
+ <dd>
11
+
12
+ <dl>
13
+ <dd>
14
+
15
+ Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
16
+ </dd>
17
+ </dl>
18
+ </dd>
19
+ </dl>
20
+
7
21
  #### 🔌 Usage
8
22
 
9
23
  <dl>
@@ -57,6 +71,20 @@ await client.auth.register({
57
71
  <dl>
58
72
  <dd>
59
73
 
74
+ #### 📝 Description
75
+
76
+ <dl>
77
+ <dd>
78
+
79
+ <dl>
80
+ <dd>
81
+
82
+ Authenticate an existing user. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
83
+ </dd>
84
+ </dl>
85
+ </dd>
86
+ </dl>
87
+
60
88
  #### 🔌 Usage
61
89
 
62
90
  <dl>
@@ -150,6 +178,20 @@ await client.auth.getCurrentUser();
150
178
  <dl>
151
179
  <dd>
152
180
 
181
+ #### 📝 Description
182
+
183
+ <dl>
184
+ <dd>
185
+
186
+ <dl>
187
+ <dd>
188
+
189
+ Request a password reset email. Requires API key for instance identification.
190
+ </dd>
191
+ </dl>
192
+ </dd>
193
+ </dl>
194
+
153
195
  #### 🔌 Usage
154
196
 
155
197
  <dl>
@@ -201,6 +243,20 @@ await client.auth.requestPasswordReset({
201
243
  <dl>
202
244
  <dd>
203
245
 
246
+ #### 📝 Description
247
+
248
+ <dl>
249
+ <dd>
250
+
251
+ <dl>
252
+ <dd>
253
+
254
+ Reset password using a reset token. Requires API key for instance identification.
255
+ </dd>
256
+ </dl>
257
+ </dd>
258
+ </dl>
259
+
204
260
  #### 🔌 Usage
205
261
 
206
262
  <dl>