@connectedxm/admin 6.25.0 → 6.26.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/index.js CHANGED
@@ -17927,6 +17927,33 @@ var useGetCustomReport = (reportId, options = {}) => {
17927
17927
  );
17928
17928
  };
17929
17929
 
17930
+ // src/queries/reports/useGetCustomReportSchedule.ts
17931
+ var CUSTOM_REPORT_SCHEDULE_QUERY_KEY = (reportId) => [
17932
+ ...CUSTOM_REPORT_QUERY_KEY(reportId),
17933
+ "schedule"
17934
+ ];
17935
+ var SET_CUSTOM_REPORT_SCHEDULE_QUERY_DATA = (client, keyParams, response) => {
17936
+ client.setQueryData(CUSTOM_REPORT_SCHEDULE_QUERY_KEY(...keyParams), response);
17937
+ };
17938
+ var GetCustomReportSchedule = async ({
17939
+ reportId,
17940
+ adminApiParams
17941
+ }) => {
17942
+ const adminApi = await GetAdminAPI(adminApiParams);
17943
+ const { data } = await adminApi.get(`/reports/custom/${reportId}/schedule`);
17944
+ return data;
17945
+ };
17946
+ var useGetCustomReportSchedule = (reportId, options = {}) => {
17947
+ return useConnectedSingleQuery(
17948
+ CUSTOM_REPORT_SCHEDULE_QUERY_KEY(reportId),
17949
+ (params) => GetCustomReportSchedule({ reportId, ...params }),
17950
+ {
17951
+ ...options,
17952
+ enabled: !!reportId && (options?.enabled ?? true)
17953
+ }
17954
+ );
17955
+ };
17956
+
17930
17957
  // src/queries/reports/useGetReport.ts
17931
17958
  var REPORT_QUERY_KEY = (standard, filters = {}) => ["REPORT", standard, ...Object.values(filters)];
17932
17959
  var SET_REPORT_QUERY_DATA = (client, keyParams, response) => {
@@ -36125,6 +36152,25 @@ var useDeleteCustomReport = (options = {}) => {
36125
36152
  return useConnectedMutation(DeleteCustomReport, options);
36126
36153
  };
36127
36154
 
36155
+ // src/mutations/reports/useDeleteCustomReportSchedule.ts
36156
+ var DeleteCustomReportSchedule = async ({
36157
+ reportId,
36158
+ adminApiParams,
36159
+ queryClient
36160
+ }) => {
36161
+ const connectedXM = await GetAdminAPI(adminApiParams);
36162
+ const { data } = await connectedXM.delete(`/reports/custom/${reportId}/schedule`);
36163
+ if (queryClient && data.status === "ok") {
36164
+ queryClient.invalidateQueries({
36165
+ queryKey: CUSTOM_REPORT_SCHEDULE_QUERY_KEY(reportId)
36166
+ });
36167
+ }
36168
+ return data;
36169
+ };
36170
+ var useDeleteCustomReportSchedule = (options = {}) => {
36171
+ return useConnectedMutation(DeleteCustomReportSchedule, options);
36172
+ };
36173
+
36128
36174
  // src/mutations/reports/useExportCustomReport.ts
36129
36175
  var ExportCustomReport = async ({
36130
36176
  reportId,
@@ -36173,6 +36219,24 @@ var useUpdateCustomReport = (options = {}) => {
36173
36219
  return useConnectedMutation(UpdateCustomReport, options);
36174
36220
  };
36175
36221
 
36222
+ // src/mutations/reports/useUpsertCustomReportSchedule.ts
36223
+ var UpsertCustomReportSchedule = async ({
36224
+ reportId,
36225
+ schedule,
36226
+ adminApiParams,
36227
+ queryClient
36228
+ }) => {
36229
+ const connectedXM = await GetAdminAPI(adminApiParams);
36230
+ const { data } = await connectedXM.post(`/reports/custom/${reportId}/schedule`, schedule);
36231
+ if (queryClient && data.status === "ok") {
36232
+ SET_CUSTOM_REPORT_SCHEDULE_QUERY_DATA(queryClient, [reportId], data);
36233
+ }
36234
+ return data;
36235
+ };
36236
+ var useUpsertCustomReportSchedule = (options = {}) => {
36237
+ return useConnectedMutation(UpsertCustomReportSchedule, options);
36238
+ };
36239
+
36176
36240
  // src/mutations/reports/users/useAddCustomReportUser.ts
36177
36241
  var AddCustomReportUser = async ({
36178
36242
  reportId,
@@ -39731,6 +39795,7 @@ export {
39731
39795
  CUSTOM_MODULE_TRANSLATION_QUERY_KEY,
39732
39796
  CUSTOM_REPORTS_QUERY_KEY,
39733
39797
  CUSTOM_REPORT_QUERY_KEY,
39798
+ CUSTOM_REPORT_SCHEDULE_QUERY_KEY,
39734
39799
  CUSTOM_REPORT_USERS_QUERY_KEY,
39735
39800
  CacheIndividualQueries,
39736
39801
  CalculateDuration,
@@ -39897,6 +39962,7 @@ export {
39897
39962
  DeleteCustomModule,
39898
39963
  DeleteCustomModuleTranslation,
39899
39964
  DeleteCustomReport,
39965
+ DeleteCustomReportSchedule,
39900
39966
  DeleteDashboard,
39901
39967
  DeleteDashboardWidget,
39902
39968
  DeleteEvent,
@@ -40395,6 +40461,7 @@ export {
40395
40461
  GetCustomModuleTranslations,
40396
40462
  GetCustomModules,
40397
40463
  GetCustomReport,
40464
+ GetCustomReportSchedule,
40398
40465
  GetCustomReportUsers,
40399
40466
  GetCustomReports,
40400
40467
  GetDashboard,
@@ -41166,6 +41233,7 @@ export {
41166
41233
  SET_CUSTOM_MODULE_TRANSLATION_QUERY_DATA,
41167
41234
  SET_CUSTOM_REPORTS_QUERY_DATA,
41168
41235
  SET_CUSTOM_REPORT_QUERY_DATA,
41236
+ SET_CUSTOM_REPORT_SCHEDULE_QUERY_DATA,
41169
41237
  SET_CUSTOM_REPORT_USERS_QUERY_DATA,
41170
41238
  SET_DASHBOARDS_QUERY_DATA,
41171
41239
  SET_DASHBOARD_ATTRIBUTES_QUERY_DATA,
@@ -41862,6 +41930,7 @@ export {
41862
41930
  UpdateVideo,
41863
41931
  UploadFile,
41864
41932
  UploadVideoCaptions,
41933
+ UpsertCustomReportSchedule,
41865
41934
  UpsertLinkPreview,
41866
41935
  UserRole,
41867
41936
  VIDEOS_QUERY_KEY,
@@ -42106,6 +42175,7 @@ export {
42106
42175
  useDeleteCustomModule,
42107
42176
  useDeleteCustomModuleTranslation,
42108
42177
  useDeleteCustomReport,
42178
+ useDeleteCustomReportSchedule,
42109
42179
  useDeleteDashboard,
42110
42180
  useDeleteDashboardWidget,
42111
42181
  useDeleteEvent,
@@ -42348,6 +42418,7 @@ export {
42348
42418
  useGetCustomModuleTranslations,
42349
42419
  useGetCustomModules,
42350
42420
  useGetCustomReport,
42421
+ useGetCustomReportSchedule,
42351
42422
  useGetCustomReportUsers,
42352
42423
  useGetCustomReports,
42353
42424
  useGetDashboard,
@@ -43072,6 +43143,7 @@ export {
43072
43143
  useUpdateVideo,
43073
43144
  useUploadFile,
43074
43145
  useUploadVideoCaptions,
43146
+ useUpsertCustomReportSchedule,
43075
43147
  useUpsertLinkPreview,
43076
43148
  useVerifyOrganizationWebhook,
43077
43149
  useVoidInvoice
package/openapi.json CHANGED
@@ -76245,6 +76245,181 @@
76245
76245
  ]
76246
76246
  }
76247
76247
  },
76248
+ "/reports/custom/{reportId}/schedule": {
76249
+ "get": {
76250
+ "operationId": "GetCustomReportSchedule",
76251
+ "summary": "Get Custom Report Schedule",
76252
+ "description": "Get Custom Report Schedule endpoint",
76253
+ "parameters": [
76254
+ {
76255
+ "in": "path",
76256
+ "name": "reportId",
76257
+ "schema": {
76258
+ "type": "string"
76259
+ },
76260
+ "description": "The report identifier",
76261
+ "required": true
76262
+ }
76263
+ ],
76264
+ "responses": {
76265
+ "200": {
76266
+ "description": "Successful response",
76267
+ "content": {
76268
+ "application/json": {
76269
+ "schema": {
76270
+ "type": "object",
76271
+ "properties": {
76272
+ "status": {
76273
+ "type": "string",
76274
+ "enum": [
76275
+ "ok"
76276
+ ]
76277
+ },
76278
+ "message": {
76279
+ "type": "string",
76280
+ "example": "Success message."
76281
+ },
76282
+ "data": {
76283
+ "allOf": [
76284
+ {
76285
+ "$ref": "#/components/schemas/CustomReportSchedule"
76286
+ }
76287
+ ],
76288
+ "nullable": true
76289
+ }
76290
+ },
76291
+ "required": [
76292
+ "status",
76293
+ "message",
76294
+ "data"
76295
+ ]
76296
+ }
76297
+ }
76298
+ }
76299
+ }
76300
+ },
76301
+ "tags": [
76302
+ "Reports"
76303
+ ]
76304
+ },
76305
+ "post": {
76306
+ "operationId": "UpsertCustomReportSchedule",
76307
+ "summary": "Upsert Custom Report Schedule",
76308
+ "description": "Upsert Custom Report Schedule endpoint",
76309
+ "parameters": [
76310
+ {
76311
+ "in": "path",
76312
+ "name": "reportId",
76313
+ "schema": {
76314
+ "type": "string"
76315
+ },
76316
+ "description": "The report identifier",
76317
+ "required": true
76318
+ }
76319
+ ],
76320
+ "requestBody": {
76321
+ "required": true,
76322
+ "content": {
76323
+ "application/json": {
76324
+ "schema": {
76325
+ "$ref": "#/components/schemas/CustomReportScheduleInputs"
76326
+ }
76327
+ }
76328
+ }
76329
+ },
76330
+ "responses": {
76331
+ "200": {
76332
+ "description": "Successful response",
76333
+ "content": {
76334
+ "application/json": {
76335
+ "schema": {
76336
+ "type": "object",
76337
+ "properties": {
76338
+ "status": {
76339
+ "type": "string",
76340
+ "enum": [
76341
+ "ok"
76342
+ ]
76343
+ },
76344
+ "message": {
76345
+ "type": "string",
76346
+ "example": "Success message."
76347
+ },
76348
+ "data": {
76349
+ "$ref": "#/components/schemas/CustomReportSchedule"
76350
+ }
76351
+ },
76352
+ "required": [
76353
+ "status",
76354
+ "message",
76355
+ "data"
76356
+ ]
76357
+ }
76358
+ }
76359
+ }
76360
+ }
76361
+ },
76362
+ "tags": [
76363
+ "Reports"
76364
+ ]
76365
+ },
76366
+ "delete": {
76367
+ "operationId": "DeleteCustomReportSchedule",
76368
+ "summary": "Delete Custom Report Schedule",
76369
+ "description": "Delete Custom Report Schedule endpoint",
76370
+ "parameters": [
76371
+ {
76372
+ "in": "path",
76373
+ "name": "reportId",
76374
+ "schema": {
76375
+ "type": "string"
76376
+ },
76377
+ "description": "The report identifier",
76378
+ "required": true
76379
+ }
76380
+ ],
76381
+ "responses": {
76382
+ "200": {
76383
+ "description": "Successful response",
76384
+ "content": {
76385
+ "application/json": {
76386
+ "schema": {
76387
+ "type": "object",
76388
+ "properties": {
76389
+ "status": {
76390
+ "type": "string",
76391
+ "enum": [
76392
+ "ok"
76393
+ ]
76394
+ },
76395
+ "message": {
76396
+ "type": "string",
76397
+ "example": "Success message."
76398
+ },
76399
+ "data": {
76400
+ "allOf": [
76401
+ {
76402
+ "$ref": "#/components/schemas/CustomReportSchedule"
76403
+ }
76404
+ ],
76405
+ "nullable": true
76406
+ }
76407
+ },
76408
+ "required": [
76409
+ "status",
76410
+ "message",
76411
+ "data"
76412
+ ]
76413
+ }
76414
+ }
76415
+ }
76416
+ }
76417
+ },
76418
+ "tags": [
76419
+ "Reports"
76420
+ ]
76421
+ }
76422
+ },
76248
76423
  "/reports/custom/{reportId}/users": {
76249
76424
  "get": {
76250
76425
  "operationId": "GetCustomReportUsers",
@@ -100902,6 +101077,31 @@
100902
101077
  "updatedAt"
100903
101078
  ]
100904
101079
  },
101080
+ "CustomReportSchedule": {
101081
+ "type": "object",
101082
+ "properties": {
101083
+ "scheduleExpression": {
101084
+ "type": "string",
101085
+ "nullable": true
101086
+ },
101087
+ "scheduleTimezone": {
101088
+ "type": "string",
101089
+ "nullable": true
101090
+ },
101091
+ "scheduleEmails": {
101092
+ "type": "array",
101093
+ "items": {
101094
+ "type": "string"
101095
+ },
101096
+ "nullable": true
101097
+ }
101098
+ },
101099
+ "required": [
101100
+ "scheduleExpression",
101101
+ "scheduleTimezone",
101102
+ "scheduleEmails"
101103
+ ]
101104
+ },
100905
101105
  "SearchField": {
100906
101106
  "type": "object",
100907
101107
  "properties": {
@@ -116991,6 +117191,26 @@
116991
117191
  }
116992
117192
  }
116993
117193
  },
117194
+ "CustomReportScheduleInputs": {
117195
+ "type": "object",
117196
+ "properties": {
117197
+ "scheduleExpression": {
117198
+ "type": "string",
117199
+ "nullable": true
117200
+ },
117201
+ "scheduleTimezone": {
117202
+ "type": "string",
117203
+ "nullable": true
117204
+ },
117205
+ "scheduleEmails": {
117206
+ "type": "array",
117207
+ "items": {
117208
+ "type": "string"
117209
+ },
117210
+ "nullable": true
117211
+ }
117212
+ }
117213
+ },
116994
117214
  "EventSectionCreateInputs": {
116995
117215
  "type": "object",
116996
117216
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "6.25.0",
3
+ "version": "6.26.0",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  "upgrade": "ncu -i --format group"
25
25
  },
26
26
  "dependencies": {
27
- "axios": "^1.13.6",
27
+ "axios": "^1.15.0",
28
28
  "immer": "^11.1.4"
29
29
  },
30
30
  "peerDependencies": {
@@ -32,16 +32,15 @@
32
32
  "react": "^18 || ^19"
33
33
  },
34
34
  "devDependencies": {
35
- "tsx": "^4.21.0",
36
- "@babel/parser": "^7.29.0",
37
- "@swc/core": "^1.15.18",
38
- "@tanstack/react-query": "^5.90.21",
35
+ "@babel/parser": "^7.29.2",
36
+ "@swc/core": "^1.15.24",
37
+ "@tanstack/react-query": "^5.97.0",
39
38
  "@types/glob": "^9.0.0",
40
39
  "@types/node": "^22.15.3",
41
40
  "@types/react": "^19.2.14",
42
- "@typescript-eslint/eslint-plugin": "^8.57.0",
43
- "@typescript-eslint/parser": "^8.57.0",
44
- "comment-parser": "^1.4.5",
41
+ "@typescript-eslint/eslint-plugin": "^8.58.1",
42
+ "@typescript-eslint/parser": "^8.58.1",
43
+ "comment-parser": "^1.4.6",
45
44
  "eslint": "^9.39.2",
46
45
  "eslint-plugin-react": "^7.37.5",
47
46
  "eslint-plugin-react-hooks": "^5.2.0",
@@ -49,10 +48,11 @@
49
48
  "openapi-schema-validator": "^12.1.3",
50
49
  "recast": "^0.23.11",
51
50
  "tsup": "^8.5.1",
51
+ "tsx": "^4.21.0",
52
52
  "typescript": "^5.9.3",
53
- "vitest": "^4.1.0"
53
+ "vitest": "^4.1.4"
54
54
  },
55
55
  "optionalDependencies": {
56
- "@rollup/rollup-linux-x64-gnu": "4.59.0"
56
+ "@rollup/rollup-linux-x64-gnu": "4.60.1"
57
57
  }
58
58
  }