@eide/foir-cli 0.37.0 → 0.39.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.
- package/dist/cli.js +107 -107
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -686,12 +686,11 @@ function createIdentityMethods(client) {
|
|
|
686
686
|
},
|
|
687
687
|
// ── Admin Users ───────────────────────────────────────
|
|
688
688
|
async createAdminUser(params) {
|
|
689
|
-
const createData = { email: params.email };
|
|
690
|
-
if (params.firstName !== void 0) createData.firstName = params.firstName;
|
|
691
|
-
if (params.lastName !== void 0) createData.lastName = params.lastName;
|
|
692
689
|
const resp = await client.createAdminUser(
|
|
693
690
|
create(CreateAdminUserRequestSchema, {
|
|
694
|
-
|
|
691
|
+
email: params.email,
|
|
692
|
+
firstName: params.firstName,
|
|
693
|
+
lastName: params.lastName,
|
|
695
694
|
tenantId: params.tenantId,
|
|
696
695
|
projectId: params.projectId,
|
|
697
696
|
role: params.role
|
|
@@ -706,13 +705,14 @@ function createIdentityMethods(client) {
|
|
|
706
705
|
return { user: resp.user ?? null };
|
|
707
706
|
},
|
|
708
707
|
async updateAdminUser(params) {
|
|
709
|
-
const update = {};
|
|
710
|
-
if (params.firstName !== void 0) update.firstName = { set: params.firstName };
|
|
711
|
-
if (params.lastName !== void 0) update.lastName = { set: params.lastName };
|
|
712
|
-
if (params.avatarUrl !== void 0) update.avatarUrl = { set: params.avatarUrl };
|
|
713
|
-
if (params.status !== void 0) update.status = { set: params.status };
|
|
714
708
|
const resp = await client.updateAdminUser(
|
|
715
|
-
create(UpdateAdminUserRequestSchema, {
|
|
709
|
+
create(UpdateAdminUserRequestSchema, {
|
|
710
|
+
id: params.id,
|
|
711
|
+
firstName: params.firstName,
|
|
712
|
+
lastName: params.lastName,
|
|
713
|
+
avatarUrl: params.avatarUrl,
|
|
714
|
+
status: params.status
|
|
715
|
+
})
|
|
716
716
|
);
|
|
717
717
|
return { user: resp.user ?? null };
|
|
718
718
|
},
|
|
@@ -746,7 +746,7 @@ function createIdentityMethods(client) {
|
|
|
746
746
|
async createCustomer(params) {
|
|
747
747
|
const resp = await client.createCustomer(
|
|
748
748
|
create(CreateCustomerRequestSchema, {
|
|
749
|
-
|
|
749
|
+
email: params.email,
|
|
750
750
|
password: params.password
|
|
751
751
|
})
|
|
752
752
|
);
|
|
@@ -763,13 +763,11 @@ function createIdentityMethods(client) {
|
|
|
763
763
|
};
|
|
764
764
|
},
|
|
765
765
|
async updateCustomer(params) {
|
|
766
|
-
const update = {};
|
|
767
|
-
if (params.email !== void 0) update.email = { set: params.email };
|
|
768
|
-
if (params.status !== void 0) update.status = { set: params.status };
|
|
769
766
|
const resp = await client.updateCustomer(
|
|
770
767
|
create(UpdateCustomerRequestSchema, {
|
|
771
768
|
id: params.id,
|
|
772
|
-
|
|
769
|
+
email: params.email,
|
|
770
|
+
status: params.status
|
|
773
771
|
})
|
|
774
772
|
);
|
|
775
773
|
return {
|
|
@@ -830,14 +828,15 @@ function createIdentityMethods(client) {
|
|
|
830
828
|
async listTenants(params = {}) {
|
|
831
829
|
const resp = await client.listTenants(
|
|
832
830
|
create(ListTenantsRequestSchema, {
|
|
833
|
-
|
|
831
|
+
where: params.where,
|
|
834
832
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
835
833
|
after: params?.after
|
|
836
834
|
})
|
|
837
835
|
);
|
|
838
836
|
return {
|
|
839
837
|
items: resp.items ?? [],
|
|
840
|
-
total: Number(resp.total)
|
|
838
|
+
total: Number(resp.total),
|
|
839
|
+
cursors: resp.cursors ?? []
|
|
841
840
|
};
|
|
842
841
|
},
|
|
843
842
|
async deleteTenant(id) {
|
|
@@ -886,7 +885,7 @@ function createIdentityMethods(client) {
|
|
|
886
885
|
const resp = await client.listProjects(
|
|
887
886
|
create(ListProjectsRequestSchema, {
|
|
888
887
|
tenantId: params.tenantId,
|
|
889
|
-
|
|
888
|
+
where: params.where,
|
|
890
889
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
891
890
|
after: params?.after
|
|
892
891
|
})
|
|
@@ -936,7 +935,7 @@ function createIdentityMethods(client) {
|
|
|
936
935
|
const resp = await client.listInvitations(
|
|
937
936
|
create(ListInvitationsRequestSchema, {
|
|
938
937
|
tenantId: params.tenantId,
|
|
939
|
-
|
|
938
|
+
where: params.where,
|
|
940
939
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
941
940
|
after: params?.after
|
|
942
941
|
})
|
|
@@ -1044,7 +1043,7 @@ function createIdentityMethods(client) {
|
|
|
1044
1043
|
async listAuthProviders(params = {}) {
|
|
1045
1044
|
const resp = await client.listAuthProviders(
|
|
1046
1045
|
create(ListAuthProvidersRequestSchema, {
|
|
1047
|
-
|
|
1046
|
+
where: params.where,
|
|
1048
1047
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
1049
1048
|
after: params?.after
|
|
1050
1049
|
})
|
|
@@ -1922,9 +1921,7 @@ function createConfigsMethods(client) {
|
|
|
1922
1921
|
async listOperations(params = {}) {
|
|
1923
1922
|
return client.listOperations(
|
|
1924
1923
|
create5(ListOperationsRequestSchema, {
|
|
1925
|
-
|
|
1926
|
-
isActive: params.isActive,
|
|
1927
|
-
search: params.search,
|
|
1924
|
+
where: params.where,
|
|
1928
1925
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
1929
1926
|
after: params?.after
|
|
1930
1927
|
})
|
|
@@ -1946,8 +1943,7 @@ function createConfigsMethods(client) {
|
|
|
1946
1943
|
async listConfigs(params = {}) {
|
|
1947
1944
|
return client.listConfigs(
|
|
1948
1945
|
create5(ListConfigsRequestSchema, {
|
|
1949
|
-
|
|
1950
|
-
enabled: params.enabled,
|
|
1946
|
+
where: params.where,
|
|
1951
1947
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
1952
1948
|
after: params?.after
|
|
1953
1949
|
})
|
|
@@ -2084,8 +2080,7 @@ function createSegmentsMethods(client) {
|
|
|
2084
2080
|
async listSegments(params = {}) {
|
|
2085
2081
|
return client.listSegments(
|
|
2086
2082
|
create6(ListSegmentsRequestSchema, {
|
|
2087
|
-
|
|
2088
|
-
configId: params.configId,
|
|
2083
|
+
where: params.where,
|
|
2089
2084
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2090
2085
|
after: params?.after
|
|
2091
2086
|
})
|
|
@@ -2255,8 +2250,7 @@ function createSettingsMethods(client) {
|
|
|
2255
2250
|
async listMyMentions(params = {}) {
|
|
2256
2251
|
return client.listMyMentions(
|
|
2257
2252
|
create7(ListMyMentionsRequestSchema, {
|
|
2258
|
-
|
|
2259
|
-
entityType: params.entityType,
|
|
2253
|
+
where: params.where,
|
|
2260
2254
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2261
2255
|
after: params?.after
|
|
2262
2256
|
})
|
|
@@ -2287,11 +2281,10 @@ function createSettingsMethods(client) {
|
|
|
2287
2281
|
const resp = await client.getNote(create7(GetNoteRequestSchema, { id }));
|
|
2288
2282
|
return resp.note ?? null;
|
|
2289
2283
|
},
|
|
2290
|
-
async listNotes(params) {
|
|
2284
|
+
async listNotes(params = {}) {
|
|
2291
2285
|
return client.listNotes(
|
|
2292
2286
|
create7(ListNotesRequestSchema, {
|
|
2293
|
-
|
|
2294
|
-
entityId: params.entityId,
|
|
2287
|
+
where: params.where,
|
|
2295
2288
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2296
2289
|
after: params?.after
|
|
2297
2290
|
})
|
|
@@ -2330,34 +2323,26 @@ function createSettingsMethods(client) {
|
|
|
2330
2323
|
return resp.dimension ?? null;
|
|
2331
2324
|
},
|
|
2332
2325
|
async createContextDimension(params) {
|
|
2333
|
-
const createInput = {
|
|
2334
|
-
key: params.key,
|
|
2335
|
-
name: params.name,
|
|
2336
|
-
sourceType: params.sourceType,
|
|
2337
|
-
sourceModelKey: params.sourceModelKey
|
|
2338
|
-
};
|
|
2339
|
-
if (params.description !== void 0)
|
|
2340
|
-
createInput.description = params.description;
|
|
2341
|
-
if (params.defaultRecordKey !== void 0)
|
|
2342
|
-
createInput.defaultRecordKey = params.defaultRecordKey;
|
|
2343
2326
|
const resp = await client.createContextDimension(
|
|
2344
|
-
create7(CreateContextDimensionRequestSchema, {
|
|
2327
|
+
create7(CreateContextDimensionRequestSchema, {
|
|
2328
|
+
key: params.key,
|
|
2329
|
+
name: params.name,
|
|
2330
|
+
description: params.description,
|
|
2331
|
+
sourceType: params.sourceType,
|
|
2332
|
+
sourceModelKey: params.sourceModelKey,
|
|
2333
|
+
defaultRecordKey: params.defaultRecordKey
|
|
2334
|
+
})
|
|
2345
2335
|
);
|
|
2346
2336
|
return resp.dimension ?? null;
|
|
2347
2337
|
},
|
|
2348
2338
|
async updateContextDimension(params) {
|
|
2349
|
-
const update = {};
|
|
2350
|
-
if (params.name !== void 0) update.name = { set: params.name };
|
|
2351
|
-
if (params.description !== void 0)
|
|
2352
|
-
update.description = { set: params.description };
|
|
2353
|
-
if (params.sourceModelKey !== void 0)
|
|
2354
|
-
update.sourceModelKey = { set: params.sourceModelKey };
|
|
2355
|
-
if (params.defaultRecordKey !== void 0)
|
|
2356
|
-
update.defaultRecordKey = { set: params.defaultRecordKey };
|
|
2357
2339
|
const resp = await client.updateContextDimension(
|
|
2358
2340
|
create7(UpdateContextDimensionRequestSchema, {
|
|
2359
2341
|
id: params.id,
|
|
2360
|
-
|
|
2342
|
+
name: params.name,
|
|
2343
|
+
description: params.description,
|
|
2344
|
+
sourceModelKey: params.sourceModelKey,
|
|
2345
|
+
defaultRecordKey: params.defaultRecordKey,
|
|
2361
2346
|
publish: params.publish
|
|
2362
2347
|
})
|
|
2363
2348
|
);
|
|
@@ -2496,7 +2481,7 @@ function createSettingsMethods(client) {
|
|
|
2496
2481
|
async listVariantCatalog(params = {}) {
|
|
2497
2482
|
return client.listVariantCatalog(
|
|
2498
2483
|
create7(ListVariantCatalogRequestSchema, {
|
|
2499
|
-
|
|
2484
|
+
where: params.where,
|
|
2500
2485
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2501
2486
|
after: params?.after
|
|
2502
2487
|
})
|
|
@@ -2546,7 +2531,7 @@ function createSettingsMethods(client) {
|
|
|
2546
2531
|
async listLocales(params = {}) {
|
|
2547
2532
|
return client.listLocales(
|
|
2548
2533
|
create7(ListLocalesRequestSchema, {
|
|
2549
|
-
|
|
2534
|
+
where: params.where,
|
|
2550
2535
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2551
2536
|
after: params?.after
|
|
2552
2537
|
})
|
|
@@ -2703,12 +2688,10 @@ function createStorageMethods(client) {
|
|
|
2703
2688
|
const resp = await client.getFile(create8(GetFileRequestSchema, { id }));
|
|
2704
2689
|
return resp.file ?? null;
|
|
2705
2690
|
},
|
|
2706
|
-
async listFiles(params) {
|
|
2691
|
+
async listFiles(params = {}) {
|
|
2707
2692
|
return client.listFiles(
|
|
2708
2693
|
create8(ListFilesRequestSchema, {
|
|
2709
|
-
|
|
2710
|
-
mimeType: params.mimeType,
|
|
2711
|
-
search: params.search,
|
|
2694
|
+
where: params.where,
|
|
2712
2695
|
includeDeleted: params.includeDeleted ?? false,
|
|
2713
2696
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2714
2697
|
after: params?.after
|
|
@@ -2727,7 +2710,9 @@ function createStorageMethods(client) {
|
|
|
2727
2710
|
id: params.id,
|
|
2728
2711
|
filename: params.filename,
|
|
2729
2712
|
folder: params.folder,
|
|
2730
|
-
tags: params.tags ?? []
|
|
2713
|
+
tags: params.tags ?? [],
|
|
2714
|
+
status: params.status,
|
|
2715
|
+
metadata: params.metadata
|
|
2731
2716
|
})
|
|
2732
2717
|
);
|
|
2733
2718
|
return resp.file ?? null;
|
|
@@ -2808,10 +2793,7 @@ function createOperationsMethods(client) {
|
|
|
2808
2793
|
async listOperations(params = {}) {
|
|
2809
2794
|
return client.listOperations(
|
|
2810
2795
|
create9(ListOperationsRequestSchema2, {
|
|
2811
|
-
|
|
2812
|
-
category: params.category,
|
|
2813
|
-
isActive: params.isActive,
|
|
2814
|
-
search: params.search,
|
|
2796
|
+
where: params.where,
|
|
2815
2797
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2816
2798
|
after: params?.after
|
|
2817
2799
|
})
|
|
@@ -2900,7 +2882,7 @@ function createOperationsMethods(client) {
|
|
|
2900
2882
|
async listDeadLetterEntries(params = {}) {
|
|
2901
2883
|
return client.listDeadLetterEntries(
|
|
2902
2884
|
create9(ListDeadLetterEntriesRequestSchema, {
|
|
2903
|
-
|
|
2885
|
+
where: params.where,
|
|
2904
2886
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2905
2887
|
after: params?.after
|
|
2906
2888
|
})
|
|
@@ -2946,9 +2928,7 @@ function createHooksMethods(client) {
|
|
|
2946
2928
|
async listHooks(params = {}) {
|
|
2947
2929
|
return client.listHooks(
|
|
2948
2930
|
create10(ListHooksRequestSchema, {
|
|
2949
|
-
|
|
2950
|
-
isActive: params.isActive,
|
|
2951
|
-
configId: params.configId,
|
|
2931
|
+
where: params.where,
|
|
2952
2932
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
2953
2933
|
after: params?.after
|
|
2954
2934
|
})
|
|
@@ -3003,11 +2983,10 @@ function createHooksMethods(client) {
|
|
|
3003
2983
|
return resp.hook ?? null;
|
|
3004
2984
|
},
|
|
3005
2985
|
// ── Deliveries ──────────────────────────────────────────
|
|
3006
|
-
async listHookDeliveries(params) {
|
|
2986
|
+
async listHookDeliveries(params = {}) {
|
|
3007
2987
|
return client.listHookDeliveries(
|
|
3008
2988
|
create10(ListHookDeliveriesRequestSchema, {
|
|
3009
|
-
|
|
3010
|
-
status: params.status,
|
|
2989
|
+
where: params.where,
|
|
3011
2990
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
3012
2991
|
after: params?.after
|
|
3013
2992
|
})
|
|
@@ -3047,7 +3026,7 @@ function createNotificationsMethods(client) {
|
|
|
3047
3026
|
async listNotifications(params = {}) {
|
|
3048
3027
|
return client.listNotifications(
|
|
3049
3028
|
create11(ListNotificationsRequestSchema, {
|
|
3050
|
-
|
|
3029
|
+
where: params.where,
|
|
3051
3030
|
first: params.first ?? 20,
|
|
3052
3031
|
after: params?.after
|
|
3053
3032
|
})
|
|
@@ -3087,8 +3066,7 @@ function createCronSchedulesMethods(client) {
|
|
|
3087
3066
|
async listCronSchedules(params = {}) {
|
|
3088
3067
|
return client.listCronSchedules(
|
|
3089
3068
|
create12(ListCronSchedulesRequestSchema, {
|
|
3090
|
-
|
|
3091
|
-
isActive: params.isActive,
|
|
3069
|
+
where: params.where,
|
|
3092
3070
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
3093
3071
|
after: params?.after
|
|
3094
3072
|
})
|
|
@@ -3185,7 +3163,7 @@ function createPublishBatchesMethods(client) {
|
|
|
3185
3163
|
async listPublishBatches(params = {}) {
|
|
3186
3164
|
const resp = await client.listPublishBatches(
|
|
3187
3165
|
create13(ListPublishBatchesRequestSchema, {
|
|
3188
|
-
|
|
3166
|
+
where: params.where,
|
|
3189
3167
|
first: params.first ?? DEFAULT_PAGE_SIZE,
|
|
3190
3168
|
after: params?.after
|
|
3191
3169
|
})
|
|
@@ -3561,8 +3539,7 @@ function registerSelectProjectCommand(program2, globalOpts) {
|
|
|
3561
3539
|
for (const tenant of tenants) {
|
|
3562
3540
|
const { items } = await client.identity.listProjects({
|
|
3563
3541
|
tenantId: tenant.id,
|
|
3564
|
-
status:
|
|
3565
|
-
// PROJECT_STATUS_ACTIVE
|
|
3542
|
+
where: { status: { eq: "ACTIVE" } },
|
|
3566
3543
|
first: 100
|
|
3567
3544
|
});
|
|
3568
3545
|
for (const p of items) {
|
|
@@ -4059,10 +4036,13 @@ function registerMediaCommands(program2, globalOpts) {
|
|
|
4059
4036
|
const opts = globalOpts();
|
|
4060
4037
|
const { getToken } = await getStorageAuth(opts);
|
|
4061
4038
|
const storage = createStorageRpcClient(getToken);
|
|
4039
|
+
const mediaWhere = {};
|
|
4040
|
+
if (flags.folder) mediaWhere.folder = { eq: flags.folder };
|
|
4041
|
+
const mediaMime = flags["mime-type"] ?? flags.mimeType;
|
|
4042
|
+
if (mediaMime) mediaWhere.mimeType = { eq: mediaMime };
|
|
4043
|
+
if (flags.search) mediaWhere.filename = { contains: flags.search };
|
|
4062
4044
|
const result = await storage.listFiles({
|
|
4063
|
-
|
|
4064
|
-
mimeType: flags["mime-type"] ?? flags.mimeType,
|
|
4065
|
-
search: flags.search,
|
|
4045
|
+
where: Object.keys(mediaWhere).length > 0 ? mediaWhere : void 0,
|
|
4066
4046
|
includeDeleted: !!flags.includeDeleted,
|
|
4067
4047
|
first: Number(flags.first) || 50,
|
|
4068
4048
|
after: flags.after
|
|
@@ -5314,7 +5294,10 @@ function resolveEndpoint(endpoint, baseUrl) {
|
|
|
5314
5294
|
return baseUrl ? `${baseUrl.replace(/\/+$/, "")}${endpoint.startsWith("/") ? "" : "/"}${endpoint}` : endpoint;
|
|
5315
5295
|
}
|
|
5316
5296
|
async function reconcileOperations(client, configId, operations, operationBaseUrl, summary) {
|
|
5317
|
-
const existing = await client.operations.listOperations({
|
|
5297
|
+
const existing = await client.operations.listOperations({
|
|
5298
|
+
where: { configId: { eq: configId } },
|
|
5299
|
+
first: 200
|
|
5300
|
+
});
|
|
5318
5301
|
const existingByKey = new Map(
|
|
5319
5302
|
(existing.operations ?? []).map((o) => [o.key, o])
|
|
5320
5303
|
);
|
|
@@ -5394,7 +5377,10 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
|
|
|
5394
5377
|
}
|
|
5395
5378
|
}
|
|
5396
5379
|
async function reconcileHooks(client, configId, hooks, summary) {
|
|
5397
|
-
const existing = await client.hooks.listHooks({
|
|
5380
|
+
const existing = await client.hooks.listHooks({
|
|
5381
|
+
where: { configId: { eq: configId } },
|
|
5382
|
+
first: 200
|
|
5383
|
+
});
|
|
5398
5384
|
const existingByKey = new Map(
|
|
5399
5385
|
(existing.hooks ?? []).map((h) => [h.key, h])
|
|
5400
5386
|
);
|
|
@@ -5442,7 +5428,7 @@ async function reconcileHooks(client, configId, hooks, summary) {
|
|
|
5442
5428
|
}
|
|
5443
5429
|
async function reconcileSegments(client, configId, segments, summary) {
|
|
5444
5430
|
const [scoped, all] = await Promise.all([
|
|
5445
|
-
client.segments.listSegments({ configId, first: 200 }),
|
|
5431
|
+
client.segments.listSegments({ where: { configId: { eq: configId } }, first: 200 }),
|
|
5446
5432
|
client.segments.listSegments({ first: 200 })
|
|
5447
5433
|
]);
|
|
5448
5434
|
const existingByKey = /* @__PURE__ */ new Map();
|
|
@@ -5491,7 +5477,10 @@ async function reconcileSegments(client, configId, segments, summary) {
|
|
|
5491
5477
|
}
|
|
5492
5478
|
}
|
|
5493
5479
|
async function reconcileCronSchedules(client, configId, schedules, summary) {
|
|
5494
|
-
const existing = await client.cronSchedules.listCronSchedules({
|
|
5480
|
+
const existing = await client.cronSchedules.listCronSchedules({
|
|
5481
|
+
where: { configId: { eq: configId } },
|
|
5482
|
+
first: 200
|
|
5483
|
+
});
|
|
5495
5484
|
const schedulesList = existing.schedules ?? [];
|
|
5496
5485
|
const existingByKey = new Map(
|
|
5497
5486
|
schedulesList.map((s) => [s.key, s])
|
|
@@ -7263,9 +7252,11 @@ function registerOperationsCommands(program2, globalOpts) {
|
|
|
7263
7252
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
7264
7253
|
const opts = globalOpts();
|
|
7265
7254
|
const client = await createPlatformClient(opts);
|
|
7255
|
+
const where = {};
|
|
7256
|
+
if (cmdOpts.category) where.category = { eq: cmdOpts.category };
|
|
7257
|
+
if (cmdOpts.active) where.isActive = { eq: true };
|
|
7266
7258
|
const data = await client.operations.listOperations({
|
|
7267
|
-
|
|
7268
|
-
isActive: cmdOpts.active ? true : void 0,
|
|
7259
|
+
where: Object.keys(where).length > 0 ? where : void 0,
|
|
7269
7260
|
first: parseInt(String(cmdOpts.first ?? "50"), 10)
|
|
7270
7261
|
});
|
|
7271
7262
|
formatListProto(OperationSchema, data.operations, opts, {
|
|
@@ -7338,7 +7329,7 @@ function registerOperationsCommands(program2, globalOpts) {
|
|
|
7338
7329
|
const opts = globalOpts();
|
|
7339
7330
|
const client = await createPlatformClient(opts);
|
|
7340
7331
|
const data = await client.operations.listDeadLetterEntries({
|
|
7341
|
-
operationKey: cmdOpts.operation,
|
|
7332
|
+
where: cmdOpts.operation ? { operationKey: { eq: cmdOpts.operation } } : void 0,
|
|
7342
7333
|
first: parseInt(cmdOpts.first ?? "20", 10)
|
|
7343
7334
|
});
|
|
7344
7335
|
formatListProto(DeadLetterEntrySchema, data.entries, opts, {
|
|
@@ -7400,7 +7391,7 @@ function registerSegmentsCommands(program2, globalOpts) {
|
|
|
7400
7391
|
const opts = globalOpts();
|
|
7401
7392
|
const client = await createPlatformClient(opts);
|
|
7402
7393
|
const data = await client.segments.listSegments({
|
|
7403
|
-
|
|
7394
|
+
where: cmdOpts.active ? { isActive: { eq: true } } : void 0,
|
|
7404
7395
|
first: parseInt(String(cmdOpts.first ?? "50"), 10),
|
|
7405
7396
|
after: cmdOpts.after
|
|
7406
7397
|
});
|
|
@@ -7528,7 +7519,7 @@ function registerSchedulesCommands(program2, globalOpts) {
|
|
|
7528
7519
|
const opts = globalOpts();
|
|
7529
7520
|
const client = await createPlatformClient(opts);
|
|
7530
7521
|
const data = await client.cronSchedules.listCronSchedules({
|
|
7531
|
-
|
|
7522
|
+
where: cmdOpts.active ? { isActive: { eq: true } } : void 0,
|
|
7532
7523
|
first: parseInt(String(cmdOpts.first ?? "50"), 10)
|
|
7533
7524
|
});
|
|
7534
7525
|
formatListProto(CronScheduleSchema, data.schedules, opts, {
|
|
@@ -7868,7 +7859,7 @@ function registerAuthProvidersCommands(program2, globalOpts) {
|
|
|
7868
7859
|
const opts = globalOpts();
|
|
7869
7860
|
const client = await createPlatformClient(opts);
|
|
7870
7861
|
const result = await client.identity.listAuthProviders({
|
|
7871
|
-
|
|
7862
|
+
where: cmdOpts.enabledOnly ? { enabled: { eq: true } } : void 0
|
|
7872
7863
|
});
|
|
7873
7864
|
formatListProto(AuthProviderSchema, result.items, opts, {
|
|
7874
7865
|
columns: [
|
|
@@ -8202,12 +8193,12 @@ function registerHooksCommands(program2, globalOpts) {
|
|
|
8202
8193
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
8203
8194
|
const opts = globalOpts();
|
|
8204
8195
|
const client = await createPlatformClient(opts);
|
|
8205
|
-
|
|
8206
|
-
if (cmdOpts.
|
|
8207
|
-
|
|
8196
|
+
const where = {};
|
|
8197
|
+
if (cmdOpts.event) where.event = { eq: cmdOpts.event };
|
|
8198
|
+
if (cmdOpts.active) where.isActive = { eq: true };
|
|
8199
|
+
else if (cmdOpts.inactive) where.isActive = { eq: false };
|
|
8208
8200
|
const resp = await client.hooks.listHooks({
|
|
8209
|
-
|
|
8210
|
-
isActive,
|
|
8201
|
+
where: Object.keys(where).length > 0 ? where : void 0,
|
|
8211
8202
|
first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
|
|
8212
8203
|
after: cmdOpts.after
|
|
8213
8204
|
});
|
|
@@ -8329,9 +8320,10 @@ function registerHooksCommands(program2, globalOpts) {
|
|
|
8329
8320
|
async (hookId, cmdOpts) => {
|
|
8330
8321
|
const opts = globalOpts();
|
|
8331
8322
|
const client = await createPlatformClient(opts);
|
|
8323
|
+
const where = { hookId: { eq: hookId } };
|
|
8324
|
+
if (cmdOpts.status) where.status = { eq: cmdOpts.status };
|
|
8332
8325
|
const resp = await client.hooks.listHookDeliveries({
|
|
8333
|
-
|
|
8334
|
-
status: cmdOpts.status,
|
|
8326
|
+
where,
|
|
8335
8327
|
first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
|
|
8336
8328
|
after: cmdOpts.after
|
|
8337
8329
|
});
|
|
@@ -8411,7 +8403,7 @@ function registerRolloutsCommands(program2, globalOpts) {
|
|
|
8411
8403
|
const opts = globalOpts();
|
|
8412
8404
|
const client = await createPlatformClient(opts);
|
|
8413
8405
|
const { batches } = await client.publishBatches.listPublishBatches({
|
|
8414
|
-
status: cmdOpts.status,
|
|
8406
|
+
where: cmdOpts.status ? { status: { eq: cmdOpts.status } } : void 0,
|
|
8415
8407
|
first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
|
|
8416
8408
|
after: cmdOpts.after
|
|
8417
8409
|
});
|
|
@@ -8675,7 +8667,7 @@ function registerLocalesCommands(program2, globalOpts) {
|
|
|
8675
8667
|
const opts = globalOpts();
|
|
8676
8668
|
const client = await createPlatformClient(opts);
|
|
8677
8669
|
const result = await client.settings.listLocales({
|
|
8678
|
-
|
|
8670
|
+
where: cmdOpts.includeInactive ? void 0 : { isActive: { eq: true } },
|
|
8679
8671
|
first: parseInt(String(cmdOpts.first ?? "50"), 10)
|
|
8680
8672
|
});
|
|
8681
8673
|
formatListProto(LocaleSchema, result.locales, opts, {
|
|
@@ -8982,7 +8974,7 @@ function registerVariantCatalogCommands(program2, globalOpts) {
|
|
|
8982
8974
|
const opts = globalOpts();
|
|
8983
8975
|
const client = await createPlatformClient(opts);
|
|
8984
8976
|
const result = await client.settings.listVariantCatalog({
|
|
8985
|
-
|
|
8977
|
+
where: cmdOpts.active ? { isActive: { eq: true } } : void 0,
|
|
8986
8978
|
first: parseInt(String(cmdOpts.first ?? "50"), 10)
|
|
8987
8979
|
});
|
|
8988
8980
|
formatListProto(VariantCatalogEntrySchema, result.entries, opts, {
|
|
@@ -9087,10 +9079,12 @@ function registerFilesCommands(program2, globalOpts) {
|
|
|
9087
9079
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
9088
9080
|
const opts = globalOpts();
|
|
9089
9081
|
const client = await createPlatformClient(opts);
|
|
9082
|
+
const where = {};
|
|
9083
|
+
if (cmdOpts.folder) where.folder = { eq: cmdOpts.folder };
|
|
9084
|
+
if (cmdOpts.mimeType) where.mimeType = { eq: cmdOpts.mimeType };
|
|
9085
|
+
if (cmdOpts.search) where.filename = { contains: cmdOpts.search };
|
|
9090
9086
|
const data = await client.storage.listFiles({
|
|
9091
|
-
|
|
9092
|
-
mimeType: cmdOpts.mimeType,
|
|
9093
|
-
search: cmdOpts.search,
|
|
9087
|
+
where: Object.keys(where).length > 0 ? where : void 0,
|
|
9094
9088
|
first: parseInt(cmdOpts.first ?? "50", 10),
|
|
9095
9089
|
after: cmdOpts.after
|
|
9096
9090
|
});
|
|
@@ -9209,9 +9203,13 @@ function registerNotesCommands(program2, globalOpts) {
|
|
|
9209
9203
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
9210
9204
|
const opts = globalOpts();
|
|
9211
9205
|
const client = await createPlatformClient(opts);
|
|
9206
|
+
const where = {
|
|
9207
|
+
entityType: { eq: cmdOpts.entityType },
|
|
9208
|
+
entityId: { eq: cmdOpts.entityId }
|
|
9209
|
+
};
|
|
9210
|
+
if (!cmdOpts.includeResolved) where.isResolved = { eq: false };
|
|
9212
9211
|
const data = await client.settings.listNotes({
|
|
9213
|
-
|
|
9214
|
-
entityId: cmdOpts.entityId,
|
|
9212
|
+
where,
|
|
9215
9213
|
first: parseInt(String(cmdOpts.first ?? "20"), 10)
|
|
9216
9214
|
});
|
|
9217
9215
|
formatListProto(NoteSchema, data.notes, opts, {
|
|
@@ -9309,7 +9307,7 @@ function registerNotificationsCommands(program2, globalOpts) {
|
|
|
9309
9307
|
const opts = globalOpts();
|
|
9310
9308
|
const client = await createPlatformClient(opts);
|
|
9311
9309
|
const data = await client.notifications.listNotifications({
|
|
9312
|
-
|
|
9310
|
+
where: cmdOpts.unread ? { isRead: { eq: false } } : void 0,
|
|
9313
9311
|
first: parseInt(String(cmdOpts.first ?? "20"), 10)
|
|
9314
9312
|
});
|
|
9315
9313
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
@@ -9372,9 +9370,11 @@ function registerConfigsCommands(program2, globalOpts) {
|
|
|
9372
9370
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
9373
9371
|
const opts = globalOpts();
|
|
9374
9372
|
const client = await createPlatformClient(opts);
|
|
9373
|
+
const where = {};
|
|
9374
|
+
if (cmdOpts.type) where.configType = { eq: cmdOpts.type };
|
|
9375
|
+
if (cmdOpts.enabled) where.enabled = { eq: true };
|
|
9375
9376
|
const data = await client.configs.listConfigs({
|
|
9376
|
-
|
|
9377
|
-
enabled: cmdOpts.enabled ? true : void 0,
|
|
9377
|
+
where: Object.keys(where).length > 0 ? where : void 0,
|
|
9378
9378
|
first: parseInt(String(cmdOpts.first ?? "50"), 10)
|
|
9379
9379
|
});
|
|
9380
9380
|
formatListProto(ConfigSchema, data.configs, opts, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eide/foir-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Universal platform CLI for Foir platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@bufbuild/protovalidate": "^1.1.1",
|
|
51
51
|
"@connectrpc/connect": "^2.0.0",
|
|
52
52
|
"@connectrpc/connect-node": "^2.0.0",
|
|
53
|
-
"@eide/foir-proto-ts": "^0.
|
|
53
|
+
"@eide/foir-proto-ts": "^0.90.0",
|
|
54
54
|
"chalk": "^5.3.0",
|
|
55
55
|
"commander": "^12.1.0",
|
|
56
56
|
"dotenv": "^16.4.5",
|