@greensecurity/javascript-sdk 0.44.0-beta.24 → 0.44.0-beta.25

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 (70) hide show
  1. package/dist/commonjs/__tests__/users.test.js +3 -1
  2. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/zones.test.js +3 -32
  6. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  7. package/dist/commonjs/funcs/usersGetLinkedUsers.d.ts +6 -4
  8. package/dist/commonjs/funcs/usersGetLinkedUsers.d.ts.map +1 -1
  9. package/dist/commonjs/funcs/usersGetLinkedUsers.js +6 -4
  10. package/dist/commonjs/funcs/usersGetLinkedUsers.js.map +1 -1
  11. package/dist/commonjs/lib/config.d.ts +3 -3
  12. package/dist/commonjs/lib/config.js +3 -3
  13. package/dist/commonjs/lib/retries.js +7 -0
  14. package/dist/commonjs/lib/retries.js.map +1 -1
  15. package/dist/commonjs/models/operations/getlinkedusers.d.ts +8 -3
  16. package/dist/commonjs/models/operations/getlinkedusers.d.ts.map +1 -1
  17. package/dist/commonjs/models/operations/getlinkedusers.js +1 -1
  18. package/dist/commonjs/models/operations/getlinkedusers.js.map +1 -1
  19. package/dist/commonjs/react-query/usersGetLinkedUsers.core.d.ts +1 -1
  20. package/dist/commonjs/react-query/usersGetLinkedUsers.core.d.ts.map +1 -1
  21. package/dist/commonjs/react-query/usersGetLinkedUsers.core.js.map +1 -1
  22. package/dist/commonjs/react-query/usersGetLinkedUsers.d.ts +14 -10
  23. package/dist/commonjs/react-query/usersGetLinkedUsers.d.ts.map +1 -1
  24. package/dist/commonjs/react-query/usersGetLinkedUsers.js +12 -8
  25. package/dist/commonjs/react-query/usersGetLinkedUsers.js.map +1 -1
  26. package/dist/commonjs/sdk/users.d.ts +6 -4
  27. package/dist/commonjs/sdk/users.d.ts.map +1 -1
  28. package/dist/commonjs/sdk/users.js +6 -4
  29. package/dist/commonjs/sdk/users.js.map +1 -1
  30. package/dist/esm/__tests__/users.test.js +3 -1
  31. package/dist/esm/__tests__/users.test.js.map +1 -1
  32. package/dist/esm/__tests__/webhooks.test.js +1 -1
  33. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  34. package/dist/esm/__tests__/zones.test.js +3 -32
  35. package/dist/esm/__tests__/zones.test.js.map +1 -1
  36. package/dist/esm/funcs/usersGetLinkedUsers.d.ts +6 -4
  37. package/dist/esm/funcs/usersGetLinkedUsers.d.ts.map +1 -1
  38. package/dist/esm/funcs/usersGetLinkedUsers.js +6 -4
  39. package/dist/esm/funcs/usersGetLinkedUsers.js.map +1 -1
  40. package/dist/esm/lib/config.d.ts +3 -3
  41. package/dist/esm/lib/config.js +3 -3
  42. package/dist/esm/lib/retries.js +7 -0
  43. package/dist/esm/lib/retries.js.map +1 -1
  44. package/dist/esm/models/operations/getlinkedusers.d.ts +8 -3
  45. package/dist/esm/models/operations/getlinkedusers.d.ts.map +1 -1
  46. package/dist/esm/models/operations/getlinkedusers.js +1 -1
  47. package/dist/esm/models/operations/getlinkedusers.js.map +1 -1
  48. package/dist/esm/react-query/usersGetLinkedUsers.core.d.ts +1 -1
  49. package/dist/esm/react-query/usersGetLinkedUsers.core.d.ts.map +1 -1
  50. package/dist/esm/react-query/usersGetLinkedUsers.core.js.map +1 -1
  51. package/dist/esm/react-query/usersGetLinkedUsers.d.ts +14 -10
  52. package/dist/esm/react-query/usersGetLinkedUsers.d.ts.map +1 -1
  53. package/dist/esm/react-query/usersGetLinkedUsers.js +12 -8
  54. package/dist/esm/react-query/usersGetLinkedUsers.js.map +1 -1
  55. package/dist/esm/sdk/users.d.ts +6 -4
  56. package/dist/esm/sdk/users.d.ts.map +1 -1
  57. package/dist/esm/sdk/users.js +6 -4
  58. package/dist/esm/sdk/users.js.map +1 -1
  59. package/jsr.json +1 -1
  60. package/package.json +1 -1
  61. package/src/__tests__/users.test.ts +3 -1
  62. package/src/__tests__/webhooks.test.ts +1 -1
  63. package/src/__tests__/zones.test.ts +3 -32
  64. package/src/funcs/usersGetLinkedUsers.ts +6 -4
  65. package/src/lib/config.ts +3 -3
  66. package/src/lib/retries.ts +8 -0
  67. package/src/models/operations/getlinkedusers.ts +9 -4
  68. package/src/react-query/usersGetLinkedUsers.core.ts +1 -1
  69. package/src/react-query/usersGetLinkedUsers.ts +14 -10
  70. package/src/sdk/users.ts +6 -4
@@ -11,9 +11,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type GetLinkedUsersRequest = {
13
13
  /**
14
- * The ID of the user to fetch linked users for. Required for API users.
14
+ * The user to fetch linked users for. Pass `me` for the authenticated user
15
+ *
16
+ * @remarks
17
+ * (allowed for any user type), or a positive numeric user ID. A numeric ID is
18
+ * only honored for API users with an active app activation for that user;
19
+ * non-API users must pass `me`.
15
20
  */
16
- userId?: number | undefined;
21
+ userId: string;
17
22
  };
18
23
 
19
24
  export type LinkedUsers = {
@@ -33,7 +38,7 @@ export type GetLinkedUsersGetLinkedUsersOk = {
33
38
 
34
39
  /** @internal */
35
40
  export type GetLinkedUsersRequest$Outbound = {
36
- user_id?: number | undefined;
41
+ user_id: string;
37
42
  };
38
43
 
39
44
  /** @internal */
@@ -42,7 +47,7 @@ export const GetLinkedUsersRequest$outboundSchema: z.ZodType<
42
47
  z.ZodTypeDef,
43
48
  GetLinkedUsersRequest
44
49
  > = z.object({
45
- userId: z.number().int().optional(),
50
+ userId: z.string(),
46
51
  }).transform((v) => {
47
52
  return remap$(v, {
48
53
  userId: "user_id",
@@ -67,7 +67,7 @@ export function buildUsersGetLinkedUsersQuery(
67
67
  }
68
68
 
69
69
  export function queryKeyUsersGetLinkedUsers(
70
- parameters: { userId?: number | undefined },
70
+ parameters: { userId: string },
71
71
  ): QueryKey {
72
72
  return [
73
73
  "@greensecurity/javascript-sdk",
@@ -56,12 +56,14 @@ export type UsersGetLinkedUsersQueryError =
56
56
  * Get linked users
57
57
  *
58
58
  * @remarks
59
- * Returns a list of users linked to the authenticated user.
59
+ * Returns a list of users linked to the requested user.
60
60
  *
61
- * For regular users, returns their own linked users.
61
+ * Pass `user_id=me` to fetch the linked users of the authenticated user. This
62
+ * is allowed for any authenticated user type.
62
63
  *
63
- * For API users, the `user_id` parameter is required. The API user must
64
- * have an active app activation for the requested user.
64
+ * API users may additionally pass a numeric `user_id` to fetch another user's
65
+ * linked users, provided they have an active app activation for that user.
66
+ * Non-API users may only pass `me`.
65
67
  */
66
68
  export function useUsersGetLinkedUsers(
67
69
  request: operations.GetLinkedUsersRequest,
@@ -85,12 +87,14 @@ export function useUsersGetLinkedUsers(
85
87
  * Get linked users
86
88
  *
87
89
  * @remarks
88
- * Returns a list of users linked to the authenticated user.
90
+ * Returns a list of users linked to the requested user.
89
91
  *
90
- * For regular users, returns their own linked users.
92
+ * Pass `user_id=me` to fetch the linked users of the authenticated user. This
93
+ * is allowed for any authenticated user type.
91
94
  *
92
- * For API users, the `user_id` parameter is required. The API user must
93
- * have an active app activation for the requested user.
95
+ * API users may additionally pass a numeric `user_id` to fetch another user's
96
+ * linked users, provided they have an active app activation for that user.
97
+ * Non-API users may only pass `me`.
94
98
  */
95
99
  export function useUsersGetLinkedUsersSuspense(
96
100
  request: operations.GetLinkedUsersRequest,
@@ -115,7 +119,7 @@ export function useUsersGetLinkedUsersSuspense(
115
119
 
116
120
  export function setUsersGetLinkedUsersData(
117
121
  client: QueryClient,
118
- queryKeyBase: [parameters: { userId?: number | undefined }],
122
+ queryKeyBase: [parameters: { userId: string }],
119
123
  data: UsersGetLinkedUsersQueryData,
120
124
  ): UsersGetLinkedUsersQueryData | undefined {
121
125
  const key = queryKeyUsersGetLinkedUsers(...queryKeyBase);
@@ -125,7 +129,7 @@ export function setUsersGetLinkedUsersData(
125
129
 
126
130
  export function invalidateUsersGetLinkedUsers(
127
131
  client: QueryClient,
128
- queryKeyBase: TupleToPrefixes<[parameters: { userId?: number | undefined }]>,
132
+ queryKeyBase: TupleToPrefixes<[parameters: { userId: string }]>,
129
133
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
130
134
  ): Promise<void> {
131
135
  return client.invalidateQueries({
package/src/sdk/users.ts CHANGED
@@ -173,12 +173,14 @@ export class Users extends ClientSDK {
173
173
  * Get linked users
174
174
  *
175
175
  * @remarks
176
- * Returns a list of users linked to the authenticated user.
176
+ * Returns a list of users linked to the requested user.
177
177
  *
178
- * For regular users, returns their own linked users.
178
+ * Pass `user_id=me` to fetch the linked users of the authenticated user. This
179
+ * is allowed for any authenticated user type.
179
180
  *
180
- * For API users, the `user_id` parameter is required. The API user must
181
- * have an active app activation for the requested user.
181
+ * API users may additionally pass a numeric `user_id` to fetch another user's
182
+ * linked users, provided they have an active app activation for that user.
183
+ * Non-API users may only pass `me`.
182
184
  */
183
185
  async getLinkedUsers(
184
186
  request: operations.GetLinkedUsersRequest,