@osdk/react 0.10.0-beta.1 → 0.10.0-beta.11

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 (129) hide show
  1. package/AGENTS.md +46 -221
  2. package/CHANGELOG.md +147 -0
  3. package/build/browser/new/makeExternalStore.js +61 -0
  4. package/build/browser/new/makeExternalStore.js.map +1 -1
  5. package/build/browser/new/platform-apis/admin/useCbacBanner.js +63 -0
  6. package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  7. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  8. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  9. package/build/browser/new/platform-apis/admin/useMarkingCategories.js +46 -0
  10. package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  11. package/build/browser/new/platform-apis/admin/useMarkings.js +46 -0
  12. package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -0
  13. package/build/browser/new/platform-apis/admin/useUserMarkings.js +50 -0
  14. package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  15. package/build/browser/new/useLinks.js +11 -4
  16. package/build/browser/new/useLinks.js.map +1 -1
  17. package/build/browser/new/useObjectSet.js +42 -18
  18. package/build/browser/new/useObjectSet.js.map +1 -1
  19. package/build/browser/new/useOsdkAction.js +2 -2
  20. package/build/browser/new/useOsdkAction.js.map +1 -1
  21. package/build/browser/new/useOsdkAggregation.js +65 -27
  22. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  23. package/build/browser/new/useOsdkFunction.js +17 -12
  24. package/build/browser/new/useOsdkFunction.js.map +1 -1
  25. package/build/browser/new/useOsdkObject.js +48 -26
  26. package/build/browser/new/useOsdkObject.js.map +1 -1
  27. package/build/browser/new/useOsdkObjects.js +32 -19
  28. package/build/browser/new/useOsdkObjects.js.map +1 -1
  29. package/build/browser/public/experimental/admin.js +25 -0
  30. package/build/browser/public/experimental/admin.js.map +1 -0
  31. package/build/browser/public/experimental.js +0 -3
  32. package/build/browser/public/experimental.js.map +1 -1
  33. package/build/browser/useOsdkMetadata.js.map +1 -1
  34. package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
  35. package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
  36. package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
  37. package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
  38. package/build/cjs/index.cjs +4 -4
  39. package/build/cjs/index.d.cts +1 -1
  40. package/build/cjs/public/experimental/admin.cjs +293 -0
  41. package/build/cjs/public/experimental/admin.cjs.map +1 -0
  42. package/build/cjs/public/experimental/admin.d.cts +275 -0
  43. package/build/cjs/public/experimental.cjs +261 -492
  44. package/build/cjs/public/experimental.cjs.map +1 -1
  45. package/build/cjs/public/experimental.d.cts +113 -138
  46. package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
  47. package/build/esm/new/makeExternalStore.js +61 -0
  48. package/build/esm/new/makeExternalStore.js.map +1 -1
  49. package/build/esm/new/platform-apis/admin/useCbacBanner.js +63 -0
  50. package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  51. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  52. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  53. package/build/esm/new/platform-apis/admin/useMarkingCategories.js +46 -0
  54. package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  55. package/build/esm/new/platform-apis/admin/useMarkings.js +46 -0
  56. package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -0
  57. package/build/esm/new/platform-apis/admin/useUserMarkings.js +50 -0
  58. package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  59. package/build/esm/new/useLinks.js +11 -4
  60. package/build/esm/new/useLinks.js.map +1 -1
  61. package/build/esm/new/useObjectSet.js +42 -18
  62. package/build/esm/new/useObjectSet.js.map +1 -1
  63. package/build/esm/new/useOsdkAction.js +2 -2
  64. package/build/esm/new/useOsdkAction.js.map +1 -1
  65. package/build/esm/new/useOsdkAggregation.js +65 -27
  66. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  67. package/build/esm/new/useOsdkFunction.js +17 -12
  68. package/build/esm/new/useOsdkFunction.js.map +1 -1
  69. package/build/esm/new/useOsdkObject.js +48 -26
  70. package/build/esm/new/useOsdkObject.js.map +1 -1
  71. package/build/esm/new/useOsdkObjects.js +32 -19
  72. package/build/esm/new/useOsdkObjects.js.map +1 -1
  73. package/build/esm/public/experimental/admin.js +25 -0
  74. package/build/esm/public/experimental/admin.js.map +1 -0
  75. package/build/esm/public/experimental.js +0 -3
  76. package/build/esm/public/experimental.js.map +1 -1
  77. package/build/esm/useOsdkMetadata.js.map +1 -1
  78. package/build/types/new/makeExternalStore.d.ts +11 -0
  79. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  80. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts +33 -0
  81. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -0
  82. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts +34 -0
  83. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -0
  84. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts +27 -0
  85. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -0
  86. package/build/types/new/platform-apis/admin/useMarkings.d.ts +27 -0
  87. package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -0
  88. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts +33 -0
  89. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -0
  90. package/build/types/new/useLinks.d.ts +19 -0
  91. package/build/types/new/useLinks.d.ts.map +1 -1
  92. package/build/types/new/useObjectSet.d.ts +10 -4
  93. package/build/types/new/useObjectSet.d.ts.map +1 -1
  94. package/build/types/new/useOsdkAggregation.d.ts +41 -3
  95. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  96. package/build/types/new/useOsdkFunction.d.ts +11 -5
  97. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  98. package/build/types/new/useOsdkObject.d.ts +19 -7
  99. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  100. package/build/types/new/useOsdkObjects.d.ts +32 -2
  101. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  102. package/build/types/public/experimental/admin.d.ts +11 -0
  103. package/build/types/public/experimental/admin.d.ts.map +1 -0
  104. package/build/types/public/experimental.d.ts +0 -3
  105. package/build/types/public/experimental.d.ts.map +1 -1
  106. package/build/types/useOsdkMetadata.d.ts +5 -4
  107. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  108. package/docs/querying-data.md +19 -0
  109. package/{build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js → experimental/admin.d.ts} +1 -19
  110. package/package.json +28 -7
  111. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  112. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  113. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  114. package/build/browser/intellisense.test.js +0 -148
  115. package/build/browser/intellisense.test.js.map +0 -1
  116. package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
  117. package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
  118. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js +0 -35
  119. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  120. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  121. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  122. package/build/esm/intellisense.test.js +0 -148
  123. package/build/esm/intellisense.test.js.map +0 -1
  124. package/build/types/intellisense.test.d.ts +0 -1
  125. package/build/types/intellisense.test.d.ts.map +0 -1
  126. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
  127. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
  128. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
  129. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
@@ -0,0 +1,275 @@
1
+ import { User, ListUsersResponse, MarkingCategory, Marking } from '@osdk/foundry.admin';
2
+ import { UserStatus } from '@osdk/foundry.core';
3
+
4
+ interface CbacBannerData {
5
+ classificationString: string;
6
+ textColor: string;
7
+ backgroundColors: string[];
8
+ markingIds: string[];
9
+ }
10
+ interface UseCbacBannerOptions {
11
+ markingIds: string[];
12
+ /**
13
+ * Enable or disable the query.
14
+ *
15
+ * When `false`, the query will not automatically execute.
16
+ *
17
+ * This is useful for:
18
+ * - Lazy/on-demand queries that should wait for user interaction
19
+ * - Dependent queries that need data from another query first
20
+ * - Conditional queries based on component state
21
+ *
22
+ * @default true
23
+ */
24
+ enabled?: boolean;
25
+ }
26
+ interface UseCbacBannerResult {
27
+ banner: CbacBannerData | undefined;
28
+ isLoading: boolean;
29
+ error: Error | undefined;
30
+ refetch: () => void;
31
+ }
32
+ /**
33
+ * Get the CBAC banner data for the given marking IDs.
34
+ * @param options Options to control the query.
35
+ */
36
+ declare function useCbacBanner({ markingIds, enabled: externalEnabled }: UseCbacBannerOptions): UseCbacBannerResult;
37
+
38
+ interface CbacMarkingRestrictionsData {
39
+ disallowedMarkings: string[];
40
+ impliedMarkings: string[];
41
+ requiredMarkings: string[][];
42
+ userSatisfiesMarkings: boolean;
43
+ isValid: boolean;
44
+ }
45
+ interface UseCbacMarkingRestrictionsOptions {
46
+ markingIds: string[];
47
+ /**
48
+ * Enable or disable the query.
49
+ *
50
+ * When `false`, the query will not automatically execute.
51
+ *
52
+ * This is useful for:
53
+ * - Lazy/on-demand queries that should wait for user interaction
54
+ * - Dependent queries that need data from another query first
55
+ * - Conditional queries based on component state
56
+ *
57
+ * @default true
58
+ */
59
+ enabled?: boolean;
60
+ }
61
+ interface UseCbacMarkingRestrictionsResult {
62
+ restrictions: CbacMarkingRestrictionsData | undefined;
63
+ isLoading: boolean;
64
+ error: Error | undefined;
65
+ refetch: () => void;
66
+ }
67
+ /**
68
+ * Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.
69
+ * @param options Options to control the query.
70
+ */
71
+ declare function useCbacMarkingRestrictions({ markingIds, enabled: externalEnabled }: UseCbacMarkingRestrictionsOptions): UseCbacMarkingRestrictionsResult;
72
+
73
+ interface UseCurrentFoundryUserOptions {
74
+ /**
75
+ * Enable or disable the query.
76
+ *
77
+ * When `false`, the query will not automatically execute.
78
+ *
79
+ * This is useful for:
80
+ * - Lazy/on-demand queries that should wait for user interaction
81
+ * - Dependent queries that need data from another query first
82
+ * - Conditional queries based on component state
83
+ *
84
+ * @default true
85
+ * });
86
+ */
87
+ enabled?: boolean;
88
+ }
89
+ interface UseCurrentFoundryUserResult {
90
+ currentUser: User | undefined;
91
+ isLoading: boolean;
92
+ error: Error | undefined;
93
+ refetch: () => void;
94
+ }
95
+ /**
96
+ * Get the currently signed in User.
97
+ * @param options Options to control the query.
98
+ */
99
+ declare function useCurrentFoundryUser({ enabled }?: UseCurrentFoundryUserOptions): UseCurrentFoundryUserResult;
100
+
101
+ interface UseFoundryUserOptions {
102
+ /**
103
+ * Enable or disable the query.
104
+ *
105
+ * When `false`, the query will not automatically execute.
106
+ *
107
+ * This is useful for:
108
+ * - Lazy/on-demand queries that should wait for user interaction
109
+ * - Dependent queries that need data from another query first
110
+ * - Conditional queries based on component state
111
+ *
112
+ * @default true
113
+ * });
114
+ */
115
+ enabled?: boolean;
116
+ /**
117
+ * The default status of the users returned in the list.
118
+ *
119
+ * @default "ACTIVE"
120
+ */
121
+ status?: UserStatus;
122
+ }
123
+ interface UseFoundryUserResult {
124
+ user: User | undefined;
125
+ isLoading: boolean;
126
+ error: Error | undefined;
127
+ refetch: () => void;
128
+ }
129
+ /**
130
+ * Get the User with the specified id.
131
+ * @param userId A Foundry User ID.
132
+ * @param options Options to control the query.
133
+ */
134
+ declare function useFoundryUser(userId: string, { enabled, status }?: UseFoundryUserOptions): UseFoundryUserResult;
135
+
136
+ interface UseFoundryUsersListOptions {
137
+ /**
138
+ * Enable or disable the query.
139
+ *
140
+ * When `false`, the query will not automatically execute.
141
+ *
142
+ * This is useful for:
143
+ * - Lazy/on-demand queries that should wait for user interaction
144
+ * - Dependent queries that need data from another query first
145
+ * - Conditional queries based on component state
146
+ *
147
+ * @default true
148
+ * });
149
+ */
150
+ enabled?: boolean;
151
+ /**
152
+ * The default status of the users returned in the list.
153
+ *
154
+ * @default "ACTIVE"
155
+ */
156
+ include?: UserStatus;
157
+ /**
158
+ * The preferred page size for the list.
159
+ *
160
+ * @default 1000
161
+ */
162
+ pageSize?: number;
163
+ /**
164
+ * The page token indicates where to start paging. This should be omitted from the first page's request.
165
+ * To fetch the next page, clients should take the value from the nextPageToken field of the previous
166
+ * response and use it to populate the pageToken field of the next request.
167
+ */
168
+ pageToken?: string;
169
+ }
170
+ interface UseFoundryUsersListResult {
171
+ users: ListUsersResponse["data"] | undefined;
172
+ /**
173
+ * The page token to be used for the next page of users. If this is undefined, there are no more
174
+ * pages of users to load.
175
+ */
176
+ nextPageToken: string | undefined;
177
+ isLoading: boolean;
178
+ error: Error | undefined;
179
+ refetch: () => void;
180
+ }
181
+ /**
182
+ * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.
183
+ * @param options Options to control the query.
184
+ */
185
+ declare function useFoundryUsersList({ enabled, include, pageSize, pageToken }?: UseFoundryUsersListOptions): UseFoundryUsersListResult;
186
+
187
+ interface UseMarkingCategoriesOptions {
188
+ /**
189
+ * Enable or disable the query.
190
+ *
191
+ * When `false`, the query will not automatically execute.
192
+ *
193
+ * This is useful for:
194
+ * - Lazy/on-demand queries that should wait for user interaction
195
+ * - Dependent queries that need data from another query first
196
+ * - Conditional queries based on component state
197
+ *
198
+ * @default true
199
+ */
200
+ enabled?: boolean;
201
+ }
202
+ interface UseMarkingCategoriesResult {
203
+ categories: MarkingCategory[] | undefined;
204
+ isLoading: boolean;
205
+ error: Error | undefined;
206
+ refetch: () => void;
207
+ }
208
+ /**
209
+ * List all marking categories.
210
+ * @param options Options to control the query.
211
+ */
212
+ declare function useMarkingCategories({ enabled }?: UseMarkingCategoriesOptions): UseMarkingCategoriesResult;
213
+
214
+ interface UseMarkingsOptions {
215
+ /**
216
+ * Enable or disable the query.
217
+ *
218
+ * When `false`, the query will not automatically execute.
219
+ *
220
+ * This is useful for:
221
+ * - Lazy/on-demand queries that should wait for user interaction
222
+ * - Dependent queries that need data from another query first
223
+ * - Conditional queries based on component state
224
+ *
225
+ * @default true
226
+ */
227
+ enabled?: boolean;
228
+ }
229
+ interface UseMarkingsResult {
230
+ markings: Marking[] | undefined;
231
+ isLoading: boolean;
232
+ error: Error | undefined;
233
+ refetch: () => void;
234
+ }
235
+ /**
236
+ * List all markings.
237
+ * @param options Options to control the query.
238
+ */
239
+ declare function useMarkings({ enabled }?: UseMarkingsOptions): UseMarkingsResult;
240
+
241
+ interface UseUserViewMarkingsOptions {
242
+ /**
243
+ * The user ID to fetch view markings for.
244
+ * When omitted, fetches markings for the current user.
245
+ */
246
+ userId?: string;
247
+ /**
248
+ * Enable or disable the query.
249
+ *
250
+ * When `false`, the query will not automatically execute.
251
+ *
252
+ * This is useful for:
253
+ * - Lazy/on-demand queries that should wait for user interaction
254
+ * - Dependent queries that need data from another query first
255
+ * - Conditional queries based on component state
256
+ *
257
+ * @default true
258
+ */
259
+ enabled?: boolean;
260
+ }
261
+ interface UseUserViewMarkingsResult {
262
+ markingIds: string[] | undefined;
263
+ isLoading: boolean;
264
+ error: Error | undefined;
265
+ refetch: () => void;
266
+ }
267
+ /**
268
+ * Get view-accessible markings for a user.
269
+ * When `userId` is provided, fetches markings for that user.
270
+ * When omitted, fetches markings for the current user.
271
+ * @param options Options to control the query.
272
+ */
273
+ declare function useUserViewMarkings({ userId, enabled }?: UseUserViewMarkingsOptions): UseUserViewMarkingsResult;
274
+
275
+ export { type CbacBannerData, type CbacMarkingRestrictionsData, type UseCbacBannerOptions, type UseCbacBannerResult, type UseCbacMarkingRestrictionsOptions, type UseCbacMarkingRestrictionsResult, type UseUserViewMarkingsOptions, type UseUserViewMarkingsResult, useCbacBanner, useCbacMarkingRestrictions, useCurrentFoundryUser, useFoundryUser, useFoundryUsersList, useMarkingCategories, useMarkings, useUserViewMarkings };