@lucern/sdk 0.2.0-alpha.5 → 0.2.0-alpha.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 (166) hide show
  1. package/.turbo/turbo-build.log +7 -0
  2. package/.turbo/turbo-typecheck.log +4 -0
  3. package/CHANGELOG.md +13 -0
  4. package/examples/README.md +69 -0
  5. package/examples/contradiction.ts +94 -0
  6. package/examples/investigation-context.ts +118 -0
  7. package/examples/questions-and-tasks.ts +55 -0
  8. package/examples/quickstart.ts +97 -0
  9. package/examples/shared.ts +318 -0
  10. package/examples/strict-public-types.ts +143 -0
  11. package/examples/worktree-lifecycle.ts +79 -0
  12. package/package.json +16 -59
  13. package/src/README.md +6 -0
  14. package/src/adminClient.ts +789 -0
  15. package/{dist/lib/platform/sdk/answersClient.d.ts → src/answersClient.ts} +17 -4
  16. package/src/audiencesClient.ts +209 -0
  17. package/src/auditClient.ts +50 -0
  18. package/src/beliefsClient.ts +319 -0
  19. package/src/client.ts +2647 -0
  20. package/src/contextClient.ts +130 -0
  21. package/src/contextFacade.ts +15 -0
  22. package/src/contextPackCompiler.ts +828 -0
  23. package/src/contextPackSchema.ts +251 -0
  24. package/src/contextTypes.ts +153 -0
  25. package/src/contracts/api-enums.contract.ts +202 -0
  26. package/src/contracts/auth-session.contract.ts +109 -0
  27. package/src/contracts/context-pack.contract.ts +700 -0
  28. package/src/contracts/contextPack.ts +1 -0
  29. package/src/contracts/index.ts +10 -0
  30. package/src/contracts/lens-filter.contract.ts +183 -0
  31. package/src/contracts/lens-workflow.contract.ts +162 -0
  32. package/src/contracts/lensFilter.ts +1 -0
  33. package/src/contracts/lensWorkflow.ts +1 -0
  34. package/src/contracts/mcp-tools.contract.ts +3636 -0
  35. package/src/contracts/mcpTools.ts +1 -0
  36. package/src/contracts/prompt.contract.ts +50 -0
  37. package/src/contracts/prompt.ts +1 -0
  38. package/src/contracts/sdk-tools.contract.ts +1457 -0
  39. package/src/contracts/sdkTools.ts +1 -0
  40. package/src/contracts/workflow-runtime.contract.ts +440 -0
  41. package/src/contracts/workflowRuntime.ts +1 -0
  42. package/src/controlObjectOwnership.ts +286 -0
  43. package/src/coreClient.ts +570 -0
  44. package/src/customTools.ts +398 -0
  45. package/src/decisionsClient.ts +286 -0
  46. package/src/domainContext.ts +15 -0
  47. package/src/events.ts +531 -0
  48. package/src/eventsCore.ts +168 -0
  49. package/src/facade/beliefs.ts +83 -0
  50. package/src/facade/context.ts +110 -0
  51. package/src/facade/contradictions.ts +29 -0
  52. package/src/facade/edges.ts +30 -0
  53. package/src/facade/events.ts +23 -0
  54. package/src/facade/evidence.ts +41 -0
  55. package/src/facade/graph.ts +38 -0
  56. package/src/facade/identity.ts +16 -0
  57. package/src/facade/ontologies.ts +34 -0
  58. package/src/facade/questions.ts +59 -0
  59. package/src/facade/search.ts +16 -0
  60. package/src/facade/tasks.ts +37 -0
  61. package/src/facade/topics.ts +42 -0
  62. package/src/facade/webhooks.ts +58 -0
  63. package/src/facade/worktrees.ts +51 -0
  64. package/src/gatewayFacades.ts +1666 -0
  65. package/src/graphClient.ts +529 -0
  66. package/src/harnessClient.ts +585 -0
  67. package/src/identityClient.ts +278 -0
  68. package/{dist/lib/platform/sdk/index.d.ts → src/index.ts} +3 -0
  69. package/src/learningClient.ts +95 -0
  70. package/src/mcpParityClient.ts +240 -0
  71. package/src/mcpParitySurface.ts +70 -0
  72. package/src/ontologyClient.ts +275 -0
  73. package/src/packRuntime.ts +3 -0
  74. package/src/packsClient.ts +260 -0
  75. package/src/policyClient.ts +572 -0
  76. package/src/promptCatalog.ts +1 -0
  77. package/src/realtime/index.ts +51 -0
  78. package/src/realtime/refs.ts +17 -0
  79. package/src/reportsClient.ts +99 -0
  80. package/src/schemaClient.ts +129 -0
  81. package/src/sdkSurface.ts +190 -0
  82. package/src/topicsClient.ts +243 -0
  83. package/src/types.ts +807 -0
  84. package/src/workflowClient.ts +826 -0
  85. package/tsconfig.json +9 -0
  86. package/dist/.generated +0 -2
  87. package/dist/index.d.ts +0 -3
  88. package/dist/index.js +0 -3
  89. package/dist/lib/platform/auth/credentials.d.ts +0 -5
  90. package/dist/lib/platform/auth/credentials.js +0 -40
  91. package/dist/lib/platform/sdk/adminClient.d.ts +0 -404
  92. package/dist/lib/platform/sdk/adminClient.js +0 -384
  93. package/dist/lib/platform/sdk/answersClient.js +0 -21
  94. package/dist/lib/platform/sdk/audiencesClient.d.ts +0 -93
  95. package/dist/lib/platform/sdk/audiencesClient.js +0 -111
  96. package/dist/lib/platform/sdk/auditClient.d.ts +0 -24
  97. package/dist/lib/platform/sdk/auditClient.js +0 -21
  98. package/dist/lib/platform/sdk/beliefsClient.d.ts +0 -157
  99. package/dist/lib/platform/sdk/beliefsClient.js +0 -124
  100. package/dist/lib/platform/sdk/client.d.ts +0 -2369
  101. package/dist/lib/platform/sdk/client.js +0 -1831
  102. package/dist/lib/platform/sdk/contextClient.d.ts +0 -21
  103. package/dist/lib/platform/sdk/contextClient.js +0 -86
  104. package/dist/lib/platform/sdk/contextPackCompiler.d.ts +0 -100
  105. package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
  106. package/dist/lib/platform/sdk/contextTypes.d.ts +0 -133
  107. package/dist/lib/platform/sdk/contextTypes.js +0 -1
  108. package/dist/lib/platform/sdk/controlObjectOwnership.d.ts +0 -308
  109. package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
  110. package/dist/lib/platform/sdk/coreClient.d.ts +0 -139
  111. package/dist/lib/platform/sdk/coreClient.js +0 -366
  112. package/dist/lib/platform/sdk/customTools.d.ts +0 -83
  113. package/dist/lib/platform/sdk/customTools.js +0 -247
  114. package/dist/lib/platform/sdk/decisionsClient.d.ts +0 -106
  115. package/dist/lib/platform/sdk/decisionsClient.js +0 -129
  116. package/dist/lib/platform/sdk/domainContext.d.ts +0 -1
  117. package/dist/lib/platform/sdk/domainContext.js +0 -1
  118. package/dist/lib/platform/sdk/events.d.ts +0 -176
  119. package/dist/lib/platform/sdk/events.js +0 -261
  120. package/dist/lib/platform/sdk/gatewayFacades.d.ts +0 -586
  121. package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
  122. package/dist/lib/platform/sdk/graphClient.d.ts +0 -266
  123. package/dist/lib/platform/sdk/graphClient.js +0 -235
  124. package/dist/lib/platform/sdk/harnessClient.d.ts +0 -309
  125. package/dist/lib/platform/sdk/harnessClient.js +0 -219
  126. package/dist/lib/platform/sdk/identityClient.d.ts +0 -134
  127. package/dist/lib/platform/sdk/identityClient.js +0 -131
  128. package/dist/lib/platform/sdk/index.js +0 -46
  129. package/dist/lib/platform/sdk/learningClient.d.ts +0 -40
  130. package/dist/lib/platform/sdk/learningClient.js +0 -53
  131. package/dist/lib/platform/sdk/mcpParityClient.d.ts +0 -69
  132. package/dist/lib/platform/sdk/mcpParityClient.js +0 -196
  133. package/dist/lib/platform/sdk/mcpParitySurface.d.ts +0 -10
  134. package/dist/lib/platform/sdk/mcpParitySurface.js +0 -57
  135. package/dist/lib/platform/sdk/ontologyClient.d.ts +0 -131
  136. package/dist/lib/platform/sdk/ontologyClient.js +0 -161
  137. package/dist/lib/platform/sdk/packRuntime.d.ts +0 -1
  138. package/dist/lib/platform/sdk/packRuntime.js +0 -1
  139. package/dist/lib/platform/sdk/packsClient.d.ts +0 -126
  140. package/dist/lib/platform/sdk/packsClient.js +0 -157
  141. package/dist/lib/platform/sdk/policyClient.d.ts +0 -293
  142. package/dist/lib/platform/sdk/policyClient.js +0 -277
  143. package/dist/lib/platform/sdk/promptCatalog.d.ts +0 -1
  144. package/dist/lib/platform/sdk/promptCatalog.js +0 -1
  145. package/dist/lib/platform/sdk/reportsClient.d.ts +0 -34
  146. package/dist/lib/platform/sdk/reportsClient.js +0 -64
  147. package/dist/lib/platform/sdk/schemaClient.d.ts +0 -59
  148. package/dist/lib/platform/sdk/schemaClient.js +0 -71
  149. package/dist/lib/platform/sdk/sdkSurface.d.ts +0 -56
  150. package/dist/lib/platform/sdk/sdkSurface.js +0 -140
  151. package/dist/lib/platform/sdk/topicsClient.d.ts +0 -78
  152. package/dist/lib/platform/sdk/topicsClient.js +0 -118
  153. package/dist/lib/platform/sdk/types.d.ts +0 -692
  154. package/dist/lib/platform/sdk/types.js +0 -1
  155. package/dist/lib/platform/sdk/version.d.ts +0 -2
  156. package/dist/lib/platform/sdk/workflowClient.d.ts +0 -313
  157. package/dist/lib/platform/sdk/workflowClient.js +0 -366
  158. package/dist/lucern/contracts/src/api-enums.contract.d.ts +0 -58
  159. package/dist/lucern/contracts/src/api-enums.contract.js +0 -147
  160. package/dist/lucern/contracts/src/lens-filter.contract.d.ts +0 -70
  161. package/dist/lucern/contracts/src/lens-filter.contract.js +0 -95
  162. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
  163. package/dist/lucern/contracts/src/lens-workflow.contract.js +0 -54
  164. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
  165. package/dist/lucern/contracts/src/mcp-tools.contract.js +0 -3281
  166. /package/{dist/lib/platform/sdk/version.js → src/version.ts} +0 -0
@@ -1,384 +0,0 @@
1
- import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { createListResult, mapGatewayData } from "./sdkSurface.js";
3
- export { LucernApiError };
4
- function asTenantApiKeyRecord(data) {
5
- if (!data || typeof data !== "object") {
6
- return null;
7
- }
8
- return data;
9
- }
10
- function asTenantApiKeyArray(data) {
11
- if (!Array.isArray(data)) {
12
- return [];
13
- }
14
- return data
15
- .map(asTenantApiKeyRecord)
16
- .filter((row) => Boolean(row));
17
- }
18
- function asTenantVaultSecretRecord(data) {
19
- if (!data || typeof data !== "object") {
20
- return null;
21
- }
22
- return data;
23
- }
24
- function asTenantVaultSecretArray(data) {
25
- if (!Array.isArray(data)) {
26
- return [];
27
- }
28
- return data
29
- .map(asTenantVaultSecretRecord)
30
- .filter((row) => Boolean(row));
31
- }
32
- /**
33
- * Create the admin client for tenant, workspace, and membership administration.
34
- * @param config - Gateway transport configuration.
35
- * @returns An object with methods to manage tenants, workspaces, and memberships.
36
- */
37
- export function createAdminClient(config = {}) {
38
- const gateway = createGatewayRequestClient(config);
39
- return {
40
- /**
41
- * List tenants visible to the current principal.
42
- */
43
- async listTenants(query = {}) {
44
- return gateway.request({
45
- path: `/api/platform/v1/tenants${toQueryString(query)}`,
46
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "tenants")));
47
- },
48
- /**
49
- * Create a tenant.
50
- */
51
- async createTenant(input, idempotencyKey) {
52
- return gateway.request({
53
- path: "/api/platform/v1/tenants",
54
- method: "POST",
55
- body: input,
56
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
57
- });
58
- },
59
- /**
60
- * Get the control-object ownership contract.
61
- */
62
- async getControlObjectOwnership() {
63
- return gateway.request({
64
- path: "/api/platform/v1/admin/control-ownership",
65
- });
66
- },
67
- /**
68
- * @deprecated Use getControlObjectOwnership.
69
- */
70
- async getControlObjectOwnershipContract() {
71
- return gateway.request({
72
- path: "/api/platform/v1/admin/control-ownership",
73
- });
74
- },
75
- /**
76
- * List workspaces for the current admin scope.
77
- */
78
- async listWorkspaces(query = {}) {
79
- return gateway.request({
80
- path: `/api/platform/v1/workspaces${toQueryString(query)}`,
81
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "workspaces")));
82
- },
83
- /**
84
- * Create a workspace.
85
- */
86
- async createWorkspace(input, idempotencyKey) {
87
- return gateway.request({
88
- path: "/api/platform/v1/workspaces",
89
- method: "POST",
90
- body: input,
91
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
92
- });
93
- },
94
- /**
95
- * List memberships for the current admin scope.
96
- */
97
- async listMemberships(query = {}) {
98
- return gateway.request({
99
- path: `/api/platform/v1/memberships${toQueryString(query)}`,
100
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "memberships")));
101
- },
102
- /**
103
- * Create a membership.
104
- */
105
- async createMembership(input, idempotencyKey) {
106
- return gateway.request({
107
- path: "/api/platform/v1/memberships",
108
- method: "POST",
109
- body: input,
110
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
111
- });
112
- },
113
- /**
114
- * Update a membership.
115
- */
116
- async updateMembership(input, idempotencyKey) {
117
- return this.createMembership(input, idempotencyKey);
118
- },
119
- /**
120
- * @deprecated Use createMembership or updateMembership.
121
- */
122
- async upsertMembership(input, idempotencyKey) {
123
- return this.createMembership(input, idempotencyKey);
124
- },
125
- /**
126
- * List tenant API keys in the current admin scope.
127
- */
128
- async listTenantApiKeys(scope) {
129
- const response = await gateway.request({
130
- path: `/api/platform/v1/tenant-api-keys${toQueryString(scope)}`,
131
- });
132
- return {
133
- ...response,
134
- data: {
135
- keys: asTenantApiKeyArray(response.data?.keys),
136
- },
137
- };
138
- },
139
- /**
140
- * Create a tenant API key.
141
- */
142
- async createTenantApiKey(input, idempotencyKey) {
143
- const response = await gateway.request({
144
- path: "/api/platform/v1/tenant-api-keys",
145
- method: "POST",
146
- body: input,
147
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
148
- });
149
- return {
150
- ...response,
151
- data: {
152
- key: asTenantApiKeyRecord(response.data?.key),
153
- plaintextKey: typeof response.data?.plaintextKey === "string"
154
- ? response.data.plaintextKey
155
- : undefined,
156
- },
157
- };
158
- },
159
- /**
160
- * Revoke a tenant API key.
161
- */
162
- async revokeTenantApiKey(keyId, input = {}, idempotencyKey) {
163
- return gateway.request({
164
- path: `/api/platform/v1/tenant-api-keys/${encodeURIComponent(keyId)}/revoke`,
165
- method: "POST",
166
- body: input,
167
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
168
- });
169
- },
170
- /**
171
- * List tenant vault secrets.
172
- */
173
- async listTenantVaultSecrets(scope) {
174
- const response = await gateway.request({
175
- path: `/api/platform/v1/tenant-vault-secrets${toQueryString(scope)}`,
176
- });
177
- return {
178
- ...response,
179
- data: {
180
- secrets: asTenantVaultSecretArray(response.data?.secrets),
181
- },
182
- };
183
- },
184
- /**
185
- * Create a tenant vault secret.
186
- */
187
- async createTenantVaultSecret(input, idempotencyKey) {
188
- const response = await gateway.request({
189
- path: "/api/platform/v1/tenant-vault-secrets",
190
- method: "POST",
191
- body: input,
192
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
193
- });
194
- return {
195
- ...response,
196
- data: {
197
- secret: asTenantVaultSecretRecord(response.data?.secret),
198
- },
199
- };
200
- },
201
- /**
202
- * Update a tenant vault secret.
203
- */
204
- async updateTenantVaultSecret(secretId, input, idempotencyKey) {
205
- const response = await gateway.request({
206
- path: `/api/platform/v1/tenant-vault-secrets/${encodeURIComponent(secretId)}`,
207
- method: "PATCH",
208
- body: input,
209
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
210
- });
211
- return {
212
- ...response,
213
- data: {
214
- secret: asTenantVaultSecretRecord(response.data?.secret),
215
- },
216
- };
217
- },
218
- /**
219
- * Delete a tenant vault secret.
220
- */
221
- async deleteTenantVaultSecret(secretId, scope, idempotencyKey) {
222
- return gateway.request({
223
- path: `/api/platform/v1/tenant-vault-secrets/${encodeURIComponent(secretId)}${toQueryString(scope)}`,
224
- method: "DELETE",
225
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
226
- });
227
- },
228
- /**
229
- * List tenant provider secrets.
230
- */
231
- async listTenantSecrets(scope) {
232
- return gateway.request({
233
- path: `/api/platform/v1/tenant-secrets${toQueryString(scope)}`,
234
- });
235
- },
236
- /**
237
- * Upsert a tenant provider secret.
238
- */
239
- async upsertTenantSecret(input, idempotencyKey) {
240
- return gateway.request({
241
- path: "/api/platform/v1/tenant-secrets",
242
- method: "POST",
243
- body: input,
244
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
245
- });
246
- },
247
- /**
248
- * Revoke a tenant provider secret.
249
- */
250
- async revokeTenantSecret(secretRef, input, idempotencyKey) {
251
- return gateway.request({
252
- path: `/api/platform/v1/tenant-secrets/${encodeURIComponent(secretRef)}/revoke`,
253
- method: "POST",
254
- body: input,
255
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
256
- });
257
- },
258
- /**
259
- * Get tenant configuration.
260
- */
261
- async getTenantConfig(scope) {
262
- return gateway.request({
263
- path: `/api/platform/v1/tenant-config${toQueryString(scope)}`,
264
- });
265
- },
266
- /**
267
- * Get tenant model routing.
268
- */
269
- async getTenantModelRouting(scope) {
270
- return gateway.request({
271
- path: `/api/platform/v1/tenant-config/model-routing${toQueryString(scope)}`,
272
- });
273
- },
274
- /**
275
- * Upsert tenant configuration.
276
- */
277
- async upsertTenantConfig(input, idempotencyKey) {
278
- return gateway.request({
279
- path: "/api/platform/v1/tenant-config",
280
- method: "POST",
281
- body: input,
282
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
283
- });
284
- },
285
- /**
286
- * List groups.
287
- */
288
- async listGroups(scope = {}) {
289
- return gateway.request({
290
- path: `/api/platform/v1/groups${toQueryString(scope)}`,
291
- });
292
- },
293
- /**
294
- * Create a group.
295
- */
296
- async createGroup(input, idempotencyKey) {
297
- return gateway.request({
298
- path: "/api/platform/v1/groups",
299
- method: "POST",
300
- body: input,
301
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
302
- });
303
- },
304
- /**
305
- * Update a group.
306
- */
307
- async updateGroup(groupId, input, idempotencyKey) {
308
- return gateway.request({
309
- path: `/api/platform/v1/groups/${encodeURIComponent(groupId)}`,
310
- method: "PATCH",
311
- body: input,
312
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
313
- });
314
- },
315
- /**
316
- * Delete a group.
317
- */
318
- async deleteGroup(groupId, input = {}, idempotencyKey) {
319
- return gateway.request({
320
- path: `/api/platform/v1/groups/${encodeURIComponent(groupId)}${toQueryString(input)}`,
321
- method: "DELETE",
322
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
323
- });
324
- },
325
- /**
326
- * List group members.
327
- */
328
- async listGroupMembers(query) {
329
- return gateway.request({
330
- path: `/api/platform/v1/groups/members${toQueryString(query)}`,
331
- });
332
- },
333
- /**
334
- * Add a group member.
335
- */
336
- async addGroupMember(input, idempotencyKey) {
337
- return gateway.request({
338
- path: "/api/platform/v1/groups/members",
339
- method: "POST",
340
- body: input,
341
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
342
- });
343
- },
344
- /**
345
- * Remove a group member.
346
- */
347
- async removeGroupMember(input, idempotencyKey) {
348
- return gateway.request({
349
- path: `/api/platform/v1/groups/members${toQueryString(input)}`,
350
- method: "DELETE",
351
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
352
- });
353
- },
354
- /**
355
- * List pack-to-group assignments.
356
- */
357
- async listPackGroupAssignments(query = {}) {
358
- return gateway.request({
359
- path: `/api/platform/v1/groups/packs${toQueryString(query)}`,
360
- });
361
- },
362
- /**
363
- * Assign a pack to a group.
364
- */
365
- async assignPackToGroup(input, idempotencyKey) {
366
- return gateway.request({
367
- path: "/api/platform/v1/groups/packs",
368
- method: "POST",
369
- body: input,
370
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
371
- });
372
- },
373
- /**
374
- * Remove a pack from a group.
375
- */
376
- async removePackFromGroup(input, idempotencyKey) {
377
- return gateway.request({
378
- path: `/api/platform/v1/groups/packs${toQueryString(input)}`,
379
- method: "DELETE",
380
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
381
- });
382
- },
383
- };
384
- }
@@ -1,21 +0,0 @@
1
- import { createGatewayRequestClient, } from "./coreClient.js";
2
- /**
3
- * Create the answers client for retrieving question answers.
4
- * @param config - Gateway transport configuration.
5
- * @returns An object with a `get` method to fetch the answer for a question.
6
- */
7
- export function createAnswersClient(config = {}) {
8
- const gateway = createGatewayRequestClient(config);
9
- return {
10
- /**
11
- * Get the current answer for a question.
12
- * @param questionId - The question node identifier.
13
- * @returns The answer record for the given question.
14
- */
15
- async get(questionId) {
16
- return gateway.request({
17
- path: `/api/platform/v1/questions/${encodeURIComponent(questionId)}/answer`,
18
- });
19
- },
20
- };
21
- }
@@ -1,93 +0,0 @@
1
- import { type GatewayClientConfig, type GatewayScope } from "./coreClient";
2
- import type { JsonObject } from "./types";
3
- /** Configuration for the audiences client. */
4
- export type AudiencesClientConfig = GatewayClientConfig;
5
- /** Input for creating or updating an audience registry entry. */
6
- export type AudienceRegistryInput = GatewayScope & {
7
- audienceKey: string;
8
- audienceLabel: string;
9
- audienceClass: "internal" | "restricted_external" | "public";
10
- status?: "active" | "disabled" | "archived";
11
- description?: string;
12
- metadata?: JsonObject;
13
- };
14
- /** Input for creating an audience access grant. */
15
- export type AudienceGrantInput = GatewayScope & {
16
- audienceKey: string;
17
- audienceClass?: "internal" | "restricted_external" | "public";
18
- principalId?: string;
19
- groupId?: string;
20
- expiresAt?: number;
21
- metadata?: JsonObject;
22
- };
23
- /** Input for revoking an audience grant by its identifier. */
24
- export type AudienceGrantRevokeInput = GatewayScope & {
25
- grantId: string;
26
- };
27
- /**
28
- * Create the audiences client for registry entries and grants.
29
- * @param config - Gateway transport configuration.
30
- * @returns An object with methods to manage audience registry entries and grants.
31
- */
32
- export declare function createAudiencesClient(config?: AudiencesClientConfig): {
33
- /**
34
- * List audience registry entries.
35
- */
36
- listRegistry(query?: GatewayScope & {
37
- effective?: boolean;
38
- status?: "active" | "disabled" | "archived";
39
- }): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "registryEntries">>>;
40
- /**
41
- * @deprecated Use listRegistry.
42
- */
43
- getRegistry(query?: GatewayScope & {
44
- effective?: boolean;
45
- status?: "active" | "disabled" | "archived";
46
- }): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "registryEntries">>>;
47
- /**
48
- * Create an audience registry entry.
49
- */
50
- createRegistryEntry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
51
- /**
52
- * Update an audience registry entry.
53
- */
54
- updateRegistryEntry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
55
- /**
56
- * @deprecated Use createRegistryEntry or updateRegistryEntry.
57
- */
58
- upsertRegistry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
59
- /**
60
- * List audience grants.
61
- */
62
- listGrants(query?: GatewayScope & {
63
- audienceKey?: string;
64
- principalId?: string;
65
- groupId?: string;
66
- status?: "active" | "revoked" | "expired";
67
- }): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "grants">>>;
68
- /**
69
- * @deprecated Use listGrants.
70
- */
71
- getGrants(query?: GatewayScope & {
72
- audienceKey?: string;
73
- principalId?: string;
74
- groupId?: string;
75
- status?: "active" | "revoked" | "expired";
76
- }): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "grants">>>;
77
- /**
78
- * Create an audience grant.
79
- */
80
- createGrant(input: AudienceGrantInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
81
- /**
82
- * @deprecated Use createGrant.
83
- */
84
- grant(input: AudienceGrantInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
85
- /**
86
- * Delete an audience grant by revoking it.
87
- */
88
- deleteGrant(input: AudienceGrantRevokeInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
89
- /**
90
- * @deprecated Use deleteGrant.
91
- */
92
- revokeGrant(input: AudienceGrantRevokeInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
93
- };
@@ -1,111 +0,0 @@
1
- import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { createListResult, mapGatewayData } from "./sdkSurface.js";
3
- /**
4
- * Create the audiences client for registry entries and grants.
5
- * @param config - Gateway transport configuration.
6
- * @returns An object with methods to manage audience registry entries and grants.
7
- */
8
- export function createAudiencesClient(config = {}) {
9
- const gateway = createGatewayRequestClient(config);
10
- return {
11
- /**
12
- * List audience registry entries.
13
- */
14
- async listRegistry(query = {}) {
15
- return gateway.request({
16
- path: `/api/platform/v1/audiences/registry${toQueryString({
17
- ...query,
18
- effective: typeof query.effective === "boolean"
19
- ? query.effective
20
- ? "true"
21
- : "false"
22
- : undefined,
23
- status: query.status,
24
- })}`,
25
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "registryEntries")));
26
- },
27
- /**
28
- * @deprecated Use listRegistry.
29
- */
30
- async getRegistry(query = {}) {
31
- return this.listRegistry(query);
32
- },
33
- /**
34
- * Create an audience registry entry.
35
- */
36
- async createRegistryEntry(input, idempotencyKey) {
37
- return gateway.request({
38
- path: "/api/platform/v1/audiences/registry",
39
- method: "POST",
40
- body: input,
41
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
42
- });
43
- },
44
- /**
45
- * Update an audience registry entry.
46
- */
47
- async updateRegistryEntry(input, idempotencyKey) {
48
- return this.createRegistryEntry(input, idempotencyKey);
49
- },
50
- /**
51
- * @deprecated Use createRegistryEntry or updateRegistryEntry.
52
- */
53
- async upsertRegistry(input, idempotencyKey) {
54
- return this.createRegistryEntry(input, idempotencyKey);
55
- },
56
- /**
57
- * List audience grants.
58
- */
59
- async listGrants(query = {}) {
60
- return gateway.request({
61
- path: `/api/platform/v1/audiences/grants${toQueryString({
62
- ...query,
63
- audienceKey: query.audienceKey,
64
- principalId: query.principalId,
65
- groupId: query.groupId,
66
- status: query.status,
67
- })}`,
68
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "grants")));
69
- },
70
- /**
71
- * @deprecated Use listGrants.
72
- */
73
- async getGrants(query = {}) {
74
- return this.listGrants(query);
75
- },
76
- /**
77
- * Create an audience grant.
78
- */
79
- async createGrant(input, idempotencyKey) {
80
- return gateway.request({
81
- path: "/api/platform/v1/audiences/grants",
82
- method: "POST",
83
- body: input,
84
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
85
- });
86
- },
87
- /**
88
- * @deprecated Use createGrant.
89
- */
90
- async grant(input, idempotencyKey) {
91
- return this.createGrant(input, idempotencyKey);
92
- },
93
- /**
94
- * Delete an audience grant by revoking it.
95
- */
96
- async deleteGrant(input, idempotencyKey) {
97
- return gateway.request({
98
- path: "/api/platform/v1/audiences/grants/revoke",
99
- method: "POST",
100
- body: input,
101
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
102
- });
103
- },
104
- /**
105
- * @deprecated Use deleteGrant.
106
- */
107
- async revokeGrant(input, idempotencyKey) {
108
- return this.deleteGrant(input, idempotencyKey);
109
- },
110
- };
111
- }
@@ -1,24 +0,0 @@
1
- import { type GatewayClientConfig, type GatewayScope, LucernApiError } from "./coreClient";
2
- import type { TopicIdentifierInput } from "./types";
3
- export { LucernApiError };
4
- export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
5
- /** Configuration for the audit client. */
6
- export type AuditClientConfig = GatewayClientConfig;
7
- /**
8
- * Create the audit client for transport-level audit event reads.
9
- * @param config - Gateway transport configuration.
10
- * @returns An object with methods to list audit events.
11
- */
12
- export declare function createAuditClient(config?: AuditClientConfig): {
13
- /**
14
- * List audit events for the current scope.
15
- */
16
- listEvents(query?: GatewayScope & {
17
- action?: string;
18
- decision?: string;
19
- traceId?: string;
20
- principalId?: string;
21
- topicId?: string;
22
- limit?: number;
23
- } & TopicIdentifierInput): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "events">>>;
24
- };
@@ -1,21 +0,0 @@
1
- import { createGatewayRequestClient, LucernApiError, toQueryString, } from "./coreClient.js";
2
- import { createListResult, mapGatewayData, normalizeTopicQuery } from "./sdkSurface.js";
3
- export { LucernApiError };
4
- /**
5
- * Create the audit client for transport-level audit event reads.
6
- * @param config - Gateway transport configuration.
7
- * @returns An object with methods to list audit events.
8
- */
9
- export function createAuditClient(config = {}) {
10
- const gateway = createGatewayRequestClient(config);
11
- return {
12
- /**
13
- * List audit events for the current scope.
14
- */
15
- async listEvents(query = {}) {
16
- return gateway.request({
17
- path: `/api/platform/v1/audit/events${toQueryString(normalizeTopicQuery(query))}`,
18
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "events")));
19
- },
20
- };
21
- }