@portaidentity/sdk 0.1.0

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 (238) hide show
  1. package/README.md +224 -0
  2. package/dist/agent.d.ts +42 -0
  3. package/dist/agent.d.ts.map +1 -0
  4. package/dist/agent.js +146 -0
  5. package/dist/agent.js.map +1 -0
  6. package/dist/auth/cli-auth.d.ts +83 -0
  7. package/dist/auth/cli-auth.d.ts.map +1 -0
  8. package/dist/auth/cli-auth.js +188 -0
  9. package/dist/auth/cli-auth.js.map +1 -0
  10. package/dist/auth/client-credentials-auth.d.ts +54 -0
  11. package/dist/auth/client-credentials-auth.d.ts.map +1 -0
  12. package/dist/auth/client-credentials-auth.js +147 -0
  13. package/dist/auth/client-credentials-auth.js.map +1 -0
  14. package/dist/auth/index.d.ts +20 -0
  15. package/dist/auth/index.d.ts.map +1 -0
  16. package/dist/auth/index.js +16 -0
  17. package/dist/auth/index.js.map +1 -0
  18. package/dist/auth/token-auth.d.ts +40 -0
  19. package/dist/auth/token-auth.d.ts.map +1 -0
  20. package/dist/auth/token-auth.js +44 -0
  21. package/dist/auth/token-auth.js.map +1 -0
  22. package/dist/auth/types.d.ts +28 -0
  23. package/dist/auth/types.d.ts.map +1 -0
  24. package/dist/auth/types.js +11 -0
  25. package/dist/auth/types.js.map +1 -0
  26. package/dist/browser.d.ts +12 -0
  27. package/dist/browser.d.ts.map +1 -0
  28. package/dist/browser.js +12 -0
  29. package/dist/browser.js.map +1 -0
  30. package/dist/client.d.ts +52 -0
  31. package/dist/client.d.ts.map +1 -0
  32. package/dist/client.js +52 -0
  33. package/dist/client.js.map +1 -0
  34. package/dist/domains/applications.d.ts +23 -0
  35. package/dist/domains/applications.d.ts.map +1 -0
  36. package/dist/domains/applications.js +59 -0
  37. package/dist/domains/applications.js.map +1 -0
  38. package/dist/domains/audit.d.ts +13 -0
  39. package/dist/domains/audit.d.ts.map +1 -0
  40. package/dist/domains/audit.js +19 -0
  41. package/dist/domains/audit.js.map +1 -0
  42. package/dist/domains/branding.d.ts +16 -0
  43. package/dist/domains/branding.d.ts.map +1 -0
  44. package/dist/domains/branding.js +29 -0
  45. package/dist/domains/branding.js.map +1 -0
  46. package/dist/domains/bulk.d.ts +12 -0
  47. package/dist/domains/bulk.d.ts.map +1 -0
  48. package/dist/domains/bulk.js +14 -0
  49. package/dist/domains/bulk.js.map +1 -0
  50. package/dist/domains/clients.d.ts +22 -0
  51. package/dist/domains/clients.d.ts.map +1 -0
  52. package/dist/domains/clients.js +55 -0
  53. package/dist/domains/clients.js.map +1 -0
  54. package/dist/domains/config.d.ts +14 -0
  55. package/dist/domains/config.d.ts.map +1 -0
  56. package/dist/domains/config.js +23 -0
  57. package/dist/domains/config.js.map +1 -0
  58. package/dist/domains/custom-claims.d.ts +17 -0
  59. package/dist/domains/custom-claims.d.ts.map +1 -0
  60. package/dist/domains/custom-claims.js +35 -0
  61. package/dist/domains/custom-claims.js.map +1 -0
  62. package/dist/domains/exports.d.ts +12 -0
  63. package/dist/domains/exports.d.ts.map +1 -0
  64. package/dist/domains/exports.js +20 -0
  65. package/dist/domains/exports.js.map +1 -0
  66. package/dist/domains/helpers.d.ts +27 -0
  67. package/dist/domains/helpers.d.ts.map +1 -0
  68. package/dist/domains/helpers.js +46 -0
  69. package/dist/domains/helpers.js.map +1 -0
  70. package/dist/domains/imports.d.ts +12 -0
  71. package/dist/domains/imports.d.ts.map +1 -0
  72. package/dist/domains/imports.js +14 -0
  73. package/dist/domains/imports.js.map +1 -0
  74. package/dist/domains/index.d.ts +45 -0
  75. package/dist/domains/index.d.ts.map +1 -0
  76. package/dist/domains/index.js +46 -0
  77. package/dist/domains/index.js.map +1 -0
  78. package/dist/domains/keys.d.ts +14 -0
  79. package/dist/domains/keys.d.ts.map +1 -0
  80. package/dist/domains/keys.js +23 -0
  81. package/dist/domains/keys.js.map +1 -0
  82. package/dist/domains/organizations.d.ts +33 -0
  83. package/dist/domains/organizations.d.ts.map +1 -0
  84. package/dist/domains/organizations.js +69 -0
  85. package/dist/domains/organizations.js.map +1 -0
  86. package/dist/domains/permissions.d.ts +16 -0
  87. package/dist/domains/permissions.d.ts.map +1 -0
  88. package/dist/domains/permissions.js +31 -0
  89. package/dist/domains/permissions.js.map +1 -0
  90. package/dist/domains/roles.d.ts +19 -0
  91. package/dist/domains/roles.d.ts.map +1 -0
  92. package/dist/domains/roles.js +41 -0
  93. package/dist/domains/roles.js.map +1 -0
  94. package/dist/domains/sessions.d.ts +17 -0
  95. package/dist/domains/sessions.d.ts.map +1 -0
  96. package/dist/domains/sessions.js +28 -0
  97. package/dist/domains/sessions.js.map +1 -0
  98. package/dist/domains/stats.d.ts +12 -0
  99. package/dist/domains/stats.d.ts.map +1 -0
  100. package/dist/domains/stats.js +14 -0
  101. package/dist/domains/stats.js.map +1 -0
  102. package/dist/domains/two-factor.d.ts +14 -0
  103. package/dist/domains/two-factor.d.ts.map +1 -0
  104. package/dist/domains/two-factor.js +24 -0
  105. package/dist/domains/two-factor.js.map +1 -0
  106. package/dist/domains/user-claims.d.ts +14 -0
  107. package/dist/domains/user-claims.d.ts.map +1 -0
  108. package/dist/domains/user-claims.js +24 -0
  109. package/dist/domains/user-claims.js.map +1 -0
  110. package/dist/domains/user-roles.d.ts +14 -0
  111. package/dist/domains/user-roles.d.ts.map +1 -0
  112. package/dist/domains/user-roles.js +24 -0
  113. package/dist/domains/user-roles.js.map +1 -0
  114. package/dist/domains/users.d.ts +25 -0
  115. package/dist/domains/users.d.ts.map +1 -0
  116. package/dist/domains/users.js +67 -0
  117. package/dist/domains/users.js.map +1 -0
  118. package/dist/errors/index.d.ts +110 -0
  119. package/dist/errors/index.d.ts.map +1 -0
  120. package/dist/errors/index.js +206 -0
  121. package/dist/errors/index.js.map +1 -0
  122. package/dist/index.d.ts +24 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +22 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/node.d.ts +14 -0
  127. package/dist/node.d.ts.map +1 -0
  128. package/dist/node.js +12 -0
  129. package/dist/node.js.map +1 -0
  130. package/dist/pagination/index.d.ts +87 -0
  131. package/dist/pagination/index.d.ts.map +1 -0
  132. package/dist/pagination/index.js +67 -0
  133. package/dist/pagination/index.js.map +1 -0
  134. package/dist/transport/browser-transport.d.ts +64 -0
  135. package/dist/transport/browser-transport.d.ts.map +1 -0
  136. package/dist/transport/browser-transport.js +96 -0
  137. package/dist/transport/browser-transport.js.map +1 -0
  138. package/dist/transport/node-transport.d.ts +51 -0
  139. package/dist/transport/node-transport.d.ts.map +1 -0
  140. package/dist/transport/node-transport.js +108 -0
  141. package/dist/transport/node-transport.js.map +1 -0
  142. package/dist/transport/types.d.ts +84 -0
  143. package/dist/transport/types.d.ts.map +1 -0
  144. package/dist/transport/types.js +13 -0
  145. package/dist/transport/types.js.map +1 -0
  146. package/dist/transport/utils.d.ts +78 -0
  147. package/dist/transport/utils.d.ts.map +1 -0
  148. package/dist/transport/utils.js +126 -0
  149. package/dist/transport/utils.js.map +1 -0
  150. package/dist/types/applications.d.ts +48 -0
  151. package/dist/types/applications.d.ts.map +1 -0
  152. package/dist/types/applications.js +7 -0
  153. package/dist/types/applications.js.map +1 -0
  154. package/dist/types/audit.d.ts +31 -0
  155. package/dist/types/audit.d.ts.map +1 -0
  156. package/dist/types/audit.js +7 -0
  157. package/dist/types/audit.js.map +1 -0
  158. package/dist/types/branding.d.ts +13 -0
  159. package/dist/types/branding.d.ts.map +1 -0
  160. package/dist/types/branding.js +7 -0
  161. package/dist/types/branding.js.map +1 -0
  162. package/dist/types/bulk.d.ts +22 -0
  163. package/dist/types/bulk.d.ts.map +1 -0
  164. package/dist/types/bulk.js +7 -0
  165. package/dist/types/bulk.js.map +1 -0
  166. package/dist/types/clients.d.ts +70 -0
  167. package/dist/types/clients.d.ts.map +1 -0
  168. package/dist/types/clients.js +7 -0
  169. package/dist/types/clients.js.map +1 -0
  170. package/dist/types/common.d.ts +75 -0
  171. package/dist/types/common.d.ts.map +1 -0
  172. package/dist/types/common.js +7 -0
  173. package/dist/types/common.js.map +1 -0
  174. package/dist/types/config.d.ts +15 -0
  175. package/dist/types/config.d.ts.map +1 -0
  176. package/dist/types/config.js +7 -0
  177. package/dist/types/config.js.map +1 -0
  178. package/dist/types/custom-claims.d.ts +48 -0
  179. package/dist/types/custom-claims.d.ts.map +1 -0
  180. package/dist/types/custom-claims.js +7 -0
  181. package/dist/types/custom-claims.js.map +1 -0
  182. package/dist/types/exports.d.ts +14 -0
  183. package/dist/types/exports.d.ts.map +1 -0
  184. package/dist/types/exports.js +7 -0
  185. package/dist/types/exports.js.map +1 -0
  186. package/dist/types/imports.d.ts +31 -0
  187. package/dist/types/imports.d.ts.map +1 -0
  188. package/dist/types/imports.js +7 -0
  189. package/dist/types/imports.js.map +1 -0
  190. package/dist/types/index.d.ts +26 -0
  191. package/dist/types/index.d.ts.map +1 -0
  192. package/dist/types/index.js +7 -0
  193. package/dist/types/index.js.map +1 -0
  194. package/dist/types/keys.d.ts +14 -0
  195. package/dist/types/keys.d.ts.map +1 -0
  196. package/dist/types/keys.js +7 -0
  197. package/dist/types/keys.js.map +1 -0
  198. package/dist/types/organizations.d.ts +47 -0
  199. package/dist/types/organizations.d.ts.map +1 -0
  200. package/dist/types/organizations.js +7 -0
  201. package/dist/types/organizations.js.map +1 -0
  202. package/dist/types/permissions.d.ts +23 -0
  203. package/dist/types/permissions.d.ts.map +1 -0
  204. package/dist/types/permissions.js +7 -0
  205. package/dist/types/permissions.js.map +1 -0
  206. package/dist/types/roles.d.ts +30 -0
  207. package/dist/types/roles.d.ts.map +1 -0
  208. package/dist/types/roles.js +7 -0
  209. package/dist/types/roles.js.map +1 -0
  210. package/dist/types/sessions.d.ts +25 -0
  211. package/dist/types/sessions.d.ts.map +1 -0
  212. package/dist/types/sessions.js +7 -0
  213. package/dist/types/sessions.js.map +1 -0
  214. package/dist/types/stats.d.ts +18 -0
  215. package/dist/types/stats.d.ts.map +1 -0
  216. package/dist/types/stats.js +7 -0
  217. package/dist/types/stats.js.map +1 -0
  218. package/dist/types/two-factor.d.ts +14 -0
  219. package/dist/types/two-factor.d.ts.map +1 -0
  220. package/dist/types/two-factor.js +7 -0
  221. package/dist/types/two-factor.js.map +1 -0
  222. package/dist/types/user-claims.d.ts +16 -0
  223. package/dist/types/user-claims.d.ts.map +1 -0
  224. package/dist/types/user-claims.js +7 -0
  225. package/dist/types/user-claims.js.map +1 -0
  226. package/dist/types/user-roles.d.ts +17 -0
  227. package/dist/types/user-roles.d.ts.map +1 -0
  228. package/dist/types/user-roles.js +7 -0
  229. package/dist/types/user-roles.js.map +1 -0
  230. package/dist/types/users.d.ts +53 -0
  231. package/dist/types/users.d.ts.map +1 -0
  232. package/dist/types/users.js +7 -0
  233. package/dist/types/users.js.map +1 -0
  234. package/dist/version.d.ts +9 -0
  235. package/dist/version.d.ts.map +1 -0
  236. package/dist/version.js +9 -0
  237. package/dist/version.js.map +1 -0
  238. package/package.json +51 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Shared transport utilities.
3
+ *
4
+ * Internal helpers used by both BrowserTransport and NodeTransport
5
+ * for URL construction, header extraction, body serialization,
6
+ * and safe JSON parsing.
7
+ *
8
+ * These functions are NOT exported from the package public API —
9
+ * they are internal implementation details of the transport layer.
10
+ */
11
+ /**
12
+ * Builds the full request URL with `/api/admin` prefix and query parameters.
13
+ *
14
+ * Both transports prepend `/api/admin` to all request paths so that
15
+ * domain methods only specify the resource path (e.g., `/organizations`).
16
+ *
17
+ * @param baseUrl - Base URL (e.g., 'https://porta.example.com' or '' for same-origin)
18
+ * @param path - Resource path (e.g., '/organizations', '/users/123')
19
+ * @param params - Optional query parameters (null/undefined values are skipped)
20
+ * @returns Complete URL string with query parameters
21
+ */
22
+ export declare function buildRequestUrl(baseUrl: string, path: string, params?: Record<string, string | number | boolean | undefined | null>): string;
23
+ /**
24
+ * Extracts response headers as a lowercased-key record.
25
+ *
26
+ * Response header keys are normalized to lowercase for consistent
27
+ * access regardless of how the server formats them (e.g., `ETag`
28
+ * becomes `etag`, `X-CSRF-Token` becomes `x-csrf-token`).
29
+ *
30
+ * @param response - The native fetch Response object
31
+ * @returns Record with lowercased header keys and string values
32
+ */
33
+ export declare function extractResponseHeaders(response: Response): Record<string, string>;
34
+ /**
35
+ * Builds common request headers used by both transports.
36
+ *
37
+ * Sets `Accept`, `Content-Type` (respecting overrides), and the SDK
38
+ * version header. Additional transport-specific headers (CSRF token,
39
+ * Authorization Bearer) are added by individual transport implementations.
40
+ *
41
+ * Content-Type logic:
42
+ * - `contentType: null` → omit entirely (lets runtime set it for FormData)
43
+ * - `contentType: 'some/type'` → use the provided value
44
+ * - `contentType: undefined` + body present → `application/json`
45
+ * - `contentType: undefined` + no body → omit
46
+ *
47
+ * @param req - Partial request with contentType, body, and optional headers
48
+ * @returns Complete headers record ready for fetch()
49
+ */
50
+ export declare function buildCommonHeaders(req: {
51
+ contentType?: string | null;
52
+ body?: unknown;
53
+ headers?: Record<string, string>;
54
+ }): Record<string, string>;
55
+ /**
56
+ * Serializes a request body for the fetch API.
57
+ *
58
+ * When `contentType` is null (FormData uploads), the body is passed
59
+ * as-is so the runtime can set the multipart boundary automatically.
60
+ * Otherwise, the body is JSON-serialized.
61
+ *
62
+ * @param body - The request body (undefined means no body)
63
+ * @param contentType - Content-Type override (null for FormData passthrough)
64
+ * @returns Serialized body suitable for fetch(), or undefined
65
+ */
66
+ export declare function serializeBody(body: unknown, contentType?: string | null): BodyInit | undefined;
67
+ /**
68
+ * Safely parses a Response body as JSON.
69
+ *
70
+ * Returns undefined if parsing fails (e.g., empty body, non-JSON
71
+ * content type, or malformed JSON). Used for error responses where
72
+ * the body format is not guaranteed.
73
+ *
74
+ * @param response - The native fetch Response object
75
+ * @returns Parsed JSON body, or undefined on failure
76
+ */
77
+ export declare function safeParseJson(response: Response): Promise<unknown>;
78
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/transport/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,GACpE,MAAM,CAaR;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMjF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,CAK9F;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAMxE"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Shared transport utilities.
3
+ *
4
+ * Internal helpers used by both BrowserTransport and NodeTransport
5
+ * for URL construction, header extraction, body serialization,
6
+ * and safe JSON parsing.
7
+ *
8
+ * These functions are NOT exported from the package public API —
9
+ * they are internal implementation details of the transport layer.
10
+ */
11
+ import { SDK_VERSION } from '../version.js';
12
+ /**
13
+ * Builds the full request URL with `/api/admin` prefix and query parameters.
14
+ *
15
+ * Both transports prepend `/api/admin` to all request paths so that
16
+ * domain methods only specify the resource path (e.g., `/organizations`).
17
+ *
18
+ * @param baseUrl - Base URL (e.g., 'https://porta.example.com' or '' for same-origin)
19
+ * @param path - Resource path (e.g., '/organizations', '/users/123')
20
+ * @param params - Optional query parameters (null/undefined values are skipped)
21
+ * @returns Complete URL string with query parameters
22
+ */
23
+ export function buildRequestUrl(baseUrl, path, params) {
24
+ const url = `${baseUrl}/api/admin${path}`;
25
+ if (!params)
26
+ return url;
27
+ const parts = [];
28
+ for (const [key, value] of Object.entries(params)) {
29
+ if (value !== null && value !== undefined) {
30
+ parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
31
+ }
32
+ }
33
+ return parts.length > 0 ? `${url}?${parts.join('&')}` : url;
34
+ }
35
+ /**
36
+ * Extracts response headers as a lowercased-key record.
37
+ *
38
+ * Response header keys are normalized to lowercase for consistent
39
+ * access regardless of how the server formats them (e.g., `ETag`
40
+ * becomes `etag`, `X-CSRF-Token` becomes `x-csrf-token`).
41
+ *
42
+ * @param response - The native fetch Response object
43
+ * @returns Record with lowercased header keys and string values
44
+ */
45
+ export function extractResponseHeaders(response) {
46
+ const headers = {};
47
+ response.headers.forEach((value, key) => {
48
+ headers[key.toLowerCase()] = value;
49
+ });
50
+ return headers;
51
+ }
52
+ /**
53
+ * Builds common request headers used by both transports.
54
+ *
55
+ * Sets `Accept`, `Content-Type` (respecting overrides), and the SDK
56
+ * version header. Additional transport-specific headers (CSRF token,
57
+ * Authorization Bearer) are added by individual transport implementations.
58
+ *
59
+ * Content-Type logic:
60
+ * - `contentType: null` → omit entirely (lets runtime set it for FormData)
61
+ * - `contentType: 'some/type'` → use the provided value
62
+ * - `contentType: undefined` + body present → `application/json`
63
+ * - `contentType: undefined` + no body → omit
64
+ *
65
+ * @param req - Partial request with contentType, body, and optional headers
66
+ * @returns Complete headers record ready for fetch()
67
+ */
68
+ export function buildCommonHeaders(req) {
69
+ const headers = {
70
+ 'Accept': 'application/json',
71
+ 'X-Porta-SDK-Version': SDK_VERSION,
72
+ };
73
+ // Content-Type: null → omit (FormData), string → use it, undefined → json if body
74
+ if (req.contentType === null) {
75
+ // Intentionally omitted — runtime sets boundary for FormData
76
+ }
77
+ else if (req.contentType) {
78
+ headers['Content-Type'] = req.contentType;
79
+ }
80
+ else if (req.body !== undefined) {
81
+ headers['Content-Type'] = 'application/json';
82
+ }
83
+ // Merge request-specific headers (allows overrides)
84
+ if (req.headers) {
85
+ Object.assign(headers, req.headers);
86
+ }
87
+ return headers;
88
+ }
89
+ /**
90
+ * Serializes a request body for the fetch API.
91
+ *
92
+ * When `contentType` is null (FormData uploads), the body is passed
93
+ * as-is so the runtime can set the multipart boundary automatically.
94
+ * Otherwise, the body is JSON-serialized.
95
+ *
96
+ * @param body - The request body (undefined means no body)
97
+ * @param contentType - Content-Type override (null for FormData passthrough)
98
+ * @returns Serialized body suitable for fetch(), or undefined
99
+ */
100
+ export function serializeBody(body, contentType) {
101
+ if (body === undefined)
102
+ return undefined;
103
+ // FormData or other raw body types — pass through
104
+ if (contentType === null)
105
+ return body;
106
+ return JSON.stringify(body);
107
+ }
108
+ /**
109
+ * Safely parses a Response body as JSON.
110
+ *
111
+ * Returns undefined if parsing fails (e.g., empty body, non-JSON
112
+ * content type, or malformed JSON). Used for error responses where
113
+ * the body format is not guaranteed.
114
+ *
115
+ * @param response - The native fetch Response object
116
+ * @returns Parsed JSON body, or undefined on failure
117
+ */
118
+ export async function safeParseJson(response) {
119
+ try {
120
+ return await response.json();
121
+ }
122
+ catch {
123
+ return undefined;
124
+ }
125
+ }
126
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/transport/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,IAAY,EACZ,MAAqE;IAErE,MAAM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,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC;IAC5C,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,oDAAoD;IACpD,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QAChB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,IAAa,EAAE,WAA2B;IACtE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,kDAAkD;IAClD,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,IAAgB,CAAC;IAClD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAkB;IACpD,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Application entity types for the Porta SDK.
3
+ *
4
+ * @module types/applications
5
+ */
6
+ export type ApplicationStatus = 'active' | 'inactive' | 'archived';
7
+ export interface Application {
8
+ id: string;
9
+ organizationId: string;
10
+ name: string;
11
+ slug: string;
12
+ description: string | null;
13
+ status: ApplicationStatus;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ }
17
+ export interface CreateApplicationInput {
18
+ organizationId: string;
19
+ name: string;
20
+ slug?: string;
21
+ description?: string;
22
+ }
23
+ export interface UpdateApplicationInput {
24
+ name?: string;
25
+ slug?: string;
26
+ description?: string | null;
27
+ }
28
+ export interface ApplicationModule {
29
+ id: string;
30
+ applicationId: string;
31
+ name: string;
32
+ slug: string;
33
+ description: string | null;
34
+ isActive: boolean;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ }
38
+ export interface CreateModuleInput {
39
+ name: string;
40
+ slug?: string;
41
+ description?: string;
42
+ }
43
+ export interface UpdateModuleInput {
44
+ name?: string;
45
+ description?: string | null;
46
+ isActive?: boolean;
47
+ }
48
+ //# sourceMappingURL=applications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../src/types/applications.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAMnE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAMD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Application entity types for the Porta SDK.
3
+ *
4
+ * @module types/applications
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=applications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applications.js","sourceRoot":"","sources":["../../src/types/applications.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Audit log types for the Porta SDK.
3
+ *
4
+ * @module types/audit
5
+ */
6
+ export interface AuditEntry {
7
+ id: string;
8
+ eventType: string;
9
+ actorId: string | null;
10
+ actorEmail: string | null;
11
+ organizationId: string | null;
12
+ resourceType: string | null;
13
+ resourceId: string | null;
14
+ details: Record<string, unknown> | null;
15
+ ipAddress: string | null;
16
+ createdAt: string;
17
+ }
18
+ export interface AuditListParams {
19
+ page?: number;
20
+ pageSize?: number;
21
+ cursor?: string;
22
+ eventType?: string;
23
+ actorId?: string;
24
+ organizationId?: string;
25
+ resourceType?: string;
26
+ resourceId?: string;
27
+ from?: string;
28
+ to?: string;
29
+ [key: string]: string | number | boolean | undefined | null;
30
+ }
31
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;CAC7D"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Audit log types for the Porta SDK.
3
+ *
4
+ * @module types/audit
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Branding asset types for the Porta SDK.
3
+ *
4
+ * @module types/branding
5
+ */
6
+ export interface BrandingAssets {
7
+ logoUrl: string | null;
8
+ faviconUrl: string | null;
9
+ primaryColor: string | null;
10
+ companyName: string | null;
11
+ customCss: string | null;
12
+ }
13
+ //# sourceMappingURL=branding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../../src/types/branding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Branding asset types for the Porta SDK.
3
+ *
4
+ * @module types/branding
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=branding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branding.js","sourceRoot":"","sources":["../../src/types/branding.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Bulk operation types for the Porta SDK.
3
+ *
4
+ * @module types/bulk
5
+ */
6
+ export type BulkEntityType = 'organizations' | 'users';
7
+ export type BulkAction = 'suspend' | 'activate' | 'deactivate' | 'lock' | 'unlock';
8
+ export interface BulkOperationInput {
9
+ entityType: BulkEntityType;
10
+ action: BulkAction;
11
+ ids: string[];
12
+ }
13
+ export interface BulkOperationResult {
14
+ succeeded: number;
15
+ failed: number;
16
+ errors: BulkItemError[];
17
+ }
18
+ export interface BulkItemError {
19
+ id: string;
20
+ error: string;
21
+ }
22
+ //# sourceMappingURL=bulk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../../src/types/bulk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;IACnB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Bulk operation types for the Porta SDK.
3
+ *
4
+ * @module types/bulk
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=bulk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../src/types/bulk.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Client entity types for the Porta SDK.
3
+ *
4
+ * @module types/clients
5
+ */
6
+ import type { LoginMethod } from './organizations.js';
7
+ export type ClientStatus = 'active' | 'revoked';
8
+ export type ClientType = 'public' | 'confidential';
9
+ export type GrantType = 'authorization_code' | 'client_credentials' | 'refresh_token';
10
+ export type ResponseType = 'code';
11
+ export interface Client {
12
+ id: string;
13
+ applicationId: string;
14
+ clientId: string;
15
+ name: string;
16
+ description: string | null;
17
+ clientType: ClientType;
18
+ status: ClientStatus;
19
+ redirectUris: string[];
20
+ postLogoutRedirectUris: string[];
21
+ grantTypes: GrantType[];
22
+ responseTypes: ResponseType[];
23
+ tokenEndpointAuthMethod: string;
24
+ loginMethods: LoginMethod[] | null;
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ }
28
+ export interface CreateClientInput {
29
+ applicationId: string;
30
+ name: string;
31
+ description?: string;
32
+ clientType?: ClientType;
33
+ redirectUris: string[];
34
+ postLogoutRedirectUris?: string[];
35
+ grantTypes?: GrantType[];
36
+ responseTypes?: ResponseType[];
37
+ tokenEndpointAuthMethod?: string;
38
+ loginMethods?: LoginMethod[] | null;
39
+ }
40
+ export interface UpdateClientInput {
41
+ name?: string;
42
+ description?: string | null;
43
+ redirectUris?: string[];
44
+ postLogoutRedirectUris?: string[];
45
+ grantTypes?: GrantType[];
46
+ responseTypes?: ResponseType[];
47
+ tokenEndpointAuthMethod?: string;
48
+ loginMethods?: LoginMethod[] | null;
49
+ }
50
+ export interface ClientSecret {
51
+ id: string;
52
+ clientId: string;
53
+ label: string | null;
54
+ lastUsedAt: string | null;
55
+ expiresAt: string | null;
56
+ createdAt: string;
57
+ }
58
+ export interface GenerateSecretInput {
59
+ label?: string;
60
+ expiresAt?: string;
61
+ }
62
+ export interface GeneratedSecret {
63
+ id: string;
64
+ clientId: string;
65
+ secret: string;
66
+ label: string | null;
67
+ expiresAt: string | null;
68
+ createdAt: string;
69
+ }
70
+ //# sourceMappingURL=clients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../src/types/clients.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;AACnD,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AACtF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAMlC,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IA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,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Client entity types for the Porta SDK.
3
+ *
4
+ * @module types/clients
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=clients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.js","sourceRoot":"","sources":["../../src/types/clients.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Common types shared across all SDK entity domains.
3
+ *
4
+ * @module types/common
5
+ */
6
+ /**
7
+ * Standard paginated list parameters accepted by all `list()` methods.
8
+ */
9
+ export interface ListParams {
10
+ /** Page number (1-based, offset pagination) */
11
+ page?: number;
12
+ /** Items per page (default: 20, max: 100) */
13
+ pageSize?: number;
14
+ /** Cursor for keyset pagination (alternative to page) */
15
+ cursor?: string;
16
+ /** Search query (searches name/email/slug depending on entity) */
17
+ search?: string;
18
+ /** Sort field (entity-specific) */
19
+ sort?: string;
20
+ /** Sort direction */
21
+ order?: 'asc' | 'desc';
22
+ /** Additional filter parameters */
23
+ [key: string]: string | number | boolean | undefined | null;
24
+ }
25
+ /**
26
+ * Paginated response shape returned by the API.
27
+ */
28
+ export interface PaginatedResponse<T> {
29
+ /** Array of entity items */
30
+ data: T[];
31
+ /** Total number of matching items */
32
+ total: number;
33
+ /** Current page number (offset pagination) */
34
+ page?: number;
35
+ /** Items per page */
36
+ pageSize?: number;
37
+ /** Total pages (offset pagination) */
38
+ totalPages?: number;
39
+ /** Next cursor value (keyset pagination) */
40
+ cursor?: string;
41
+ /** Whether more items exist after this page */
42
+ hasMore?: boolean;
43
+ }
44
+ /**
45
+ * Response wrapper for entities that support ETag concurrency.
46
+ */
47
+ export interface ETagResponse<T> {
48
+ /** The entity data */
49
+ data: T;
50
+ /** ETag value for optimistic concurrency (If-Match header) */
51
+ etag: string | null;
52
+ }
53
+ /**
54
+ * Entity change history entry returned by `getHistory()` methods.
55
+ */
56
+ export interface HistoryEntry {
57
+ /** History entry ID */
58
+ id: string;
59
+ /** Entity type (e.g., 'organization', 'user') */
60
+ entityType: string;
61
+ /** Entity ID */
62
+ entityId: string;
63
+ /** Action performed (e.g., 'created', 'updated', 'status_changed') */
64
+ action: string;
65
+ /** Changes made (field → { old, new }) */
66
+ changes: Record<string, {
67
+ old: unknown;
68
+ new: unknown;
69
+ }>;
70
+ /** User who made the change */
71
+ performedBy: string | null;
72
+ /** ISO 8601 timestamp */
73
+ createdAt: string;
74
+ }
75
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC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}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Common types shared across all SDK entity domains.
3
+ *
4
+ * @module types/common
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * System configuration types for the Porta SDK.
3
+ *
4
+ * @module types/config
5
+ */
6
+ export interface ConfigEntry {
7
+ key: string;
8
+ value: string;
9
+ description: string | null;
10
+ updatedAt: string;
11
+ }
12
+ export interface SetConfigInput {
13
+ value: string;
14
+ }
15
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * System configuration types for the Porta SDK.
3
+ *
4
+ * @module types/config
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Custom claims entity types for the Porta SDK.
3
+ *
4
+ * @module types/custom-claims
5
+ */
6
+ export type ClaimValueType = 'string' | 'number' | 'boolean' | 'json';
7
+ export interface ClaimDefinition {
8
+ id: string;
9
+ applicationId: string;
10
+ name: string;
11
+ slug: string;
12
+ description: string | null;
13
+ valueType: ClaimValueType;
14
+ isRequired: boolean;
15
+ defaultValue: unknown;
16
+ validationRules: Record<string, unknown> | null;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ }
20
+ export interface CreateClaimDefinitionInput {
21
+ applicationId: string;
22
+ name: string;
23
+ slug?: string;
24
+ description?: string;
25
+ valueType: ClaimValueType;
26
+ isRequired?: boolean;
27
+ defaultValue?: unknown;
28
+ validationRules?: Record<string, unknown>;
29
+ }
30
+ export interface UpdateClaimDefinitionInput {
31
+ name?: string;
32
+ description?: string | null;
33
+ isRequired?: boolean;
34
+ defaultValue?: unknown;
35
+ validationRules?: Record<string, unknown> | null;
36
+ }
37
+ export interface UserClaimValue {
38
+ id: string;
39
+ userId: string;
40
+ claimDefinitionId: string;
41
+ value: unknown;
42
+ createdAt: string;
43
+ updatedAt: string;
44
+ }
45
+ export interface SetUserClaimInput {
46
+ value: unknown;
47
+ }
48
+ //# sourceMappingURL=custom-claims.d.ts.map