@credal/actions 0.2.155 → 0.2.157

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 (35) hide show
  1. package/dist/actions/actionMapper.js +43 -1
  2. package/dist/actions/autogen/templates.js +100 -86
  3. package/dist/actions/autogen/types.d.ts +22 -31
  4. package/dist/actions/autogen/types.js +65 -48
  5. package/dist/actions/parse.d.ts +0 -10
  6. package/dist/actions/parse.js +2 -11
  7. package/dist/actions/providers/confluence/updatePage.js +15 -14
  8. package/dist/actions/providers/github/searchOrganization.js +3 -3
  9. package/dist/actions/providers/jamf/types.d.ts +8 -0
  10. package/dist/actions/providers/jamf/types.js +7 -0
  11. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +42 -27
  12. package/dist/actions/providers/salesforce/getSalesforceRecordsByQuery.js +1 -1
  13. package/package.json +1 -1
  14. package/dist/actions/providers/generic/fillTemplateAction.d.ts +0 -7
  15. package/dist/actions/providers/generic/fillTemplateAction.js +0 -18
  16. package/dist/actions/providers/generic/genericApiCall.d.ts +0 -3
  17. package/dist/actions/providers/generic/genericApiCall.js +0 -38
  18. package/dist/actions/providers/google-oauth/getDriveContentById.d.ts +0 -3
  19. package/dist/actions/providers/google-oauth/getDriveContentById.js +0 -161
  20. package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.d.ts +0 -3
  21. package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.js +0 -47
  22. package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.d.ts +0 -3
  23. package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.js +0 -110
  24. package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.d.ts +0 -3
  25. package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.js +0 -78
  26. package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.d.ts +0 -15
  27. package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.js +0 -129
  28. package/dist/actions/providers/googlemaps/nearbysearch.d.ts +0 -3
  29. package/dist/actions/providers/googlemaps/nearbysearch.js +0 -96
  30. package/dist/actions/providers/slackUser/getSlackMessagesInTimeRange.d.ts +0 -3
  31. package/dist/actions/providers/slackUser/getSlackMessagesInTimeRange.js +0 -81
  32. package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.d.ts +0 -3
  33. package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.js +0 -154
  34. package/dist/actions/providers/x/scrapeTweetDataWithNitter.d.ts +0 -3
  35. package/dist/actions/providers/x/scrapeTweetDataWithNitter.js +0 -45
@@ -1634,7 +1634,6 @@ export declare const jiraGetJiraIssuesByQueryParamsSchema: z.ZodObject<{
1634
1634
  }>;
1635
1635
  export type jiraGetJiraIssuesByQueryParamsType = z.infer<typeof jiraGetJiraIssuesByQueryParamsSchema>;
1636
1636
  export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
1637
- success: z.ZodBoolean;
1638
1637
  results: z.ZodOptional<z.ZodArray<z.ZodObject<{
1639
1638
  name: z.ZodString;
1640
1639
  url: z.ZodString;
@@ -1807,7 +1806,6 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
1807
1806
  }>, "many">>;
1808
1807
  error: z.ZodOptional<z.ZodString>;
1809
1808
  }, "strip", z.ZodTypeAny, {
1810
- success: boolean;
1811
1809
  error?: string | undefined;
1812
1810
  results?: {
1813
1811
  name: string;
@@ -1842,7 +1840,6 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
1842
1840
  };
1843
1841
  }[] | undefined;
1844
1842
  }, {
1845
- success: boolean;
1846
1843
  error?: string | undefined;
1847
1844
  results?: {
1848
1845
  name: string;
@@ -2320,7 +2317,6 @@ export declare const jiraOrgGetJiraIssuesByQueryParamsSchema: z.ZodObject<{
2320
2317
  }>;
2321
2318
  export type jiraOrgGetJiraIssuesByQueryParamsType = z.infer<typeof jiraOrgGetJiraIssuesByQueryParamsSchema>;
2322
2319
  export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
2323
- success: z.ZodBoolean;
2324
2320
  results: z.ZodOptional<z.ZodArray<z.ZodObject<{
2325
2321
  name: z.ZodString;
2326
2322
  url: z.ZodString;
@@ -2493,7 +2489,6 @@ export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
2493
2489
  }>, "many">>;
2494
2490
  error: z.ZodOptional<z.ZodString>;
2495
2491
  }, "strip", z.ZodTypeAny, {
2496
- success: boolean;
2497
2492
  error?: string | undefined;
2498
2493
  results?: {
2499
2494
  name: string;
@@ -2528,7 +2523,6 @@ export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
2528
2523
  };
2529
2524
  }[] | undefined;
2530
2525
  }, {
2531
- success: boolean;
2532
2526
  error?: string | undefined;
2533
2527
  results?: {
2534
2528
  name: string;
@@ -3006,7 +3000,6 @@ export declare const jiraDataCenterGetJiraIssuesByQueryParamsSchema: z.ZodObject
3006
3000
  }>;
3007
3001
  export type jiraDataCenterGetJiraIssuesByQueryParamsType = z.infer<typeof jiraDataCenterGetJiraIssuesByQueryParamsSchema>;
3008
3002
  export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
3009
- success: z.ZodBoolean;
3010
3003
  results: z.ZodOptional<z.ZodArray<z.ZodObject<{
3011
3004
  name: z.ZodString;
3012
3005
  url: z.ZodString;
@@ -3179,7 +3172,6 @@ export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject
3179
3172
  }>, "many">>;
3180
3173
  error: z.ZodOptional<z.ZodString>;
3181
3174
  }, "strip", z.ZodTypeAny, {
3182
- success: boolean;
3183
3175
  error?: string | undefined;
3184
3176
  results?: {
3185
3177
  name: string;
@@ -3214,7 +3206,6 @@ export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject
3214
3206
  };
3215
3207
  }[] | undefined;
3216
3208
  }, {
3217
- success: boolean;
3218
3209
  error?: string | undefined;
3219
3210
  results?: {
3220
3211
  name: string;
@@ -9576,20 +9567,20 @@ export declare const githubSearchOrganizationOutputSchema: z.ZodObject<{
9576
9567
  success: z.ZodBoolean;
9577
9568
  error: z.ZodOptional<z.ZodString>;
9578
9569
  results: z.ZodOptional<z.ZodArray<z.ZodObject<{
9570
+ type: z.ZodEnum<["code", "commit", "issueOrPullRequest"]>;
9579
9571
  name: z.ZodString;
9580
9572
  url: z.ZodString;
9581
- type: z.ZodEnum<["code", "commit", "issueOrPullRequest"]>;
9582
- content: z.ZodEffects<z.ZodAny, any, any>;
9573
+ contents: z.ZodEffects<z.ZodAny, any, any>;
9583
9574
  }, "strip", z.ZodTypeAny, {
9584
9575
  type: "code" | "commit" | "issueOrPullRequest";
9585
9576
  name: string;
9586
9577
  url: string;
9587
- content?: any;
9578
+ contents?: any;
9588
9579
  }, {
9589
9580
  type: "code" | "commit" | "issueOrPullRequest";
9590
9581
  name: string;
9591
9582
  url: string;
9592
- content?: any;
9583
+ contents?: any;
9593
9584
  }>, "many">>;
9594
9585
  }, "strip", z.ZodTypeAny, {
9595
9586
  success: boolean;
@@ -9598,7 +9589,7 @@ export declare const githubSearchOrganizationOutputSchema: z.ZodObject<{
9598
9589
  type: "code" | "commit" | "issueOrPullRequest";
9599
9590
  name: string;
9600
9591
  url: string;
9601
- content?: any;
9592
+ contents?: any;
9602
9593
  }[] | undefined;
9603
9594
  }, {
9604
9595
  success: boolean;
@@ -9607,7 +9598,7 @@ export declare const githubSearchOrganizationOutputSchema: z.ZodObject<{
9607
9598
  type: "code" | "commit" | "issueOrPullRequest";
9608
9599
  name: string;
9609
9600
  url: string;
9610
- content?: any;
9601
+ contents?: any;
9611
9602
  }[] | undefined;
9612
9603
  }>;
9613
9604
  export type githubSearchOrganizationOutputType = z.infer<typeof githubSearchOrganizationOutputSchema>;
@@ -9724,15 +9715,15 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9724
9715
  }, "strip", z.ZodTypeAny, {
9725
9716
  type?: string | undefined;
9726
9717
  id?: number | undefined;
9727
- login?: string | undefined;
9728
9718
  html_url?: string | undefined;
9719
+ login?: string | undefined;
9729
9720
  node_id?: string | undefined;
9730
9721
  avatar_url?: string | undefined;
9731
9722
  }, {
9732
9723
  type?: string | undefined;
9733
9724
  id?: number | undefined;
9734
- login?: string | undefined;
9735
9725
  html_url?: string | undefined;
9726
+ login?: string | undefined;
9736
9727
  node_id?: string | undefined;
9737
9728
  avatar_url?: string | undefined;
9738
9729
  }>>>;
@@ -9746,15 +9737,15 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9746
9737
  }, "strip", z.ZodTypeAny, {
9747
9738
  type?: string | undefined;
9748
9739
  id?: number | undefined;
9749
- login?: string | undefined;
9750
9740
  html_url?: string | undefined;
9741
+ login?: string | undefined;
9751
9742
  node_id?: string | undefined;
9752
9743
  avatar_url?: string | undefined;
9753
9744
  }, {
9754
9745
  type?: string | undefined;
9755
9746
  id?: number | undefined;
9756
- login?: string | undefined;
9757
9747
  html_url?: string | undefined;
9748
+ login?: string | undefined;
9758
9749
  node_id?: string | undefined;
9759
9750
  avatar_url?: string | undefined;
9760
9751
  }>>>;
@@ -9777,16 +9768,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9777
9768
  author?: {
9778
9769
  type?: string | undefined;
9779
9770
  id?: number | undefined;
9780
- login?: string | undefined;
9781
9771
  html_url?: string | undefined;
9772
+ login?: string | undefined;
9782
9773
  node_id?: string | undefined;
9783
9774
  avatar_url?: string | undefined;
9784
9775
  } | null | undefined;
9785
9776
  committer?: {
9786
9777
  type?: string | undefined;
9787
9778
  id?: number | undefined;
9788
- login?: string | undefined;
9789
9779
  html_url?: string | undefined;
9780
+ login?: string | undefined;
9790
9781
  node_id?: string | undefined;
9791
9782
  avatar_url?: string | undefined;
9792
9783
  } | null | undefined;
@@ -9823,16 +9814,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9823
9814
  author?: {
9824
9815
  type?: string | undefined;
9825
9816
  id?: number | undefined;
9826
- login?: string | undefined;
9827
9817
  html_url?: string | undefined;
9818
+ login?: string | undefined;
9828
9819
  node_id?: string | undefined;
9829
9820
  avatar_url?: string | undefined;
9830
9821
  } | null | undefined;
9831
9822
  committer?: {
9832
9823
  type?: string | undefined;
9833
9824
  id?: number | undefined;
9834
- login?: string | undefined;
9835
9825
  html_url?: string | undefined;
9826
+ login?: string | undefined;
9836
9827
  node_id?: string | undefined;
9837
9828
  avatar_url?: string | undefined;
9838
9829
  } | null | undefined;
@@ -9914,16 +9905,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9914
9905
  author?: {
9915
9906
  type?: string | undefined;
9916
9907
  id?: number | undefined;
9917
- login?: string | undefined;
9918
9908
  html_url?: string | undefined;
9909
+ login?: string | undefined;
9919
9910
  node_id?: string | undefined;
9920
9911
  avatar_url?: string | undefined;
9921
9912
  } | null | undefined;
9922
9913
  committer?: {
9923
9914
  type?: string | undefined;
9924
9915
  id?: number | undefined;
9925
- login?: string | undefined;
9926
9916
  html_url?: string | undefined;
9917
+ login?: string | undefined;
9927
9918
  node_id?: string | undefined;
9928
9919
  avatar_url?: string | undefined;
9929
9920
  } | null | undefined;
@@ -9977,16 +9968,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
9977
9968
  author?: {
9978
9969
  type?: string | undefined;
9979
9970
  id?: number | undefined;
9980
- login?: string | undefined;
9981
9971
  html_url?: string | undefined;
9972
+ login?: string | undefined;
9982
9973
  node_id?: string | undefined;
9983
9974
  avatar_url?: string | undefined;
9984
9975
  } | null | undefined;
9985
9976
  committer?: {
9986
9977
  type?: string | undefined;
9987
9978
  id?: number | undefined;
9988
- login?: string | undefined;
9989
9979
  html_url?: string | undefined;
9980
+ login?: string | undefined;
9990
9981
  node_id?: string | undefined;
9991
9982
  avatar_url?: string | undefined;
9992
9983
  } | null | undefined;
@@ -10044,16 +10035,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
10044
10035
  author?: {
10045
10036
  type?: string | undefined;
10046
10037
  id?: number | undefined;
10047
- login?: string | undefined;
10048
10038
  html_url?: string | undefined;
10039
+ login?: string | undefined;
10049
10040
  node_id?: string | undefined;
10050
10041
  avatar_url?: string | undefined;
10051
10042
  } | null | undefined;
10052
10043
  committer?: {
10053
10044
  type?: string | undefined;
10054
10045
  id?: number | undefined;
10055
- login?: string | undefined;
10056
10046
  html_url?: string | undefined;
10047
+ login?: string | undefined;
10057
10048
  node_id?: string | undefined;
10058
10049
  avatar_url?: string | undefined;
10059
10050
  } | null | undefined;
@@ -10111,16 +10102,16 @@ export declare const githubGetBranchOutputSchema: z.ZodObject<{
10111
10102
  author?: {
10112
10103
  type?: string | undefined;
10113
10104
  id?: number | undefined;
10114
- login?: string | undefined;
10115
10105
  html_url?: string | undefined;
10106
+ login?: string | undefined;
10116
10107
  node_id?: string | undefined;
10117
10108
  avatar_url?: string | undefined;
10118
10109
  } | null | undefined;
10119
10110
  committer?: {
10120
10111
  type?: string | undefined;
10121
10112
  id?: number | undefined;
10122
- login?: string | undefined;
10123
10113
  html_url?: string | undefined;
10114
+ login?: string | undefined;
10124
10115
  node_id?: string | undefined;
10125
10116
  avatar_url?: string | undefined;
10126
10117
  } | null | undefined;
@@ -556,7 +556,6 @@ export const jiraGetJiraIssuesByQueryParamsSchema = z.object({
556
556
  limit: z.number().describe("The maximum number of records to retrieve").optional(),
557
557
  });
558
558
  export const jiraGetJiraIssuesByQueryOutputSchema = z.object({
559
- success: z.boolean().describe("Whether the records were successfully retrieved"),
560
559
  results: z
561
560
  .array(z.object({
562
561
  name: z.string().describe("The name of the result"),
@@ -749,7 +748,6 @@ export const jiraOrgGetJiraIssuesByQueryParamsSchema = z.object({
749
748
  limit: z.number().describe("The maximum number of records to retrieve").optional(),
750
749
  });
751
750
  export const jiraOrgGetJiraIssuesByQueryOutputSchema = z.object({
752
- success: z.boolean().describe("Whether the records were successfully retrieved"),
753
751
  results: z
754
752
  .array(z.object({
755
753
  name: z.string().describe("The name of the result"),
@@ -942,7 +940,6 @@ export const jiraDataCenterGetJiraIssuesByQueryParamsSchema = z.object({
942
940
  limit: z.number().describe("The maximum number of records to retrieve").optional(),
943
941
  });
944
942
  export const jiraDataCenterGetJiraIssuesByQueryOutputSchema = z.object({
945
- success: z.boolean().describe("Whether the records were successfully retrieved"),
946
943
  results: z
947
944
  .array(z.object({
948
945
  name: z.string().describe("The name of the result"),
@@ -4298,75 +4295,94 @@ export const githubSearchOrganizationParamsSchema = z.object({
4298
4295
  repository: z.string().describe("The repository to search for data in").optional(),
4299
4296
  });
4300
4297
  export const githubSearchOrganizationOutputSchema = z.object({
4301
- success: z.boolean().describe("Whether the operation was successful"),
4302
- error: z.string().describe("Error message if the operation failed").optional(),
4298
+ success: z.boolean().describe("Whether the operation was successful."),
4299
+ error: z.string().describe("Error message if the operation failed.").optional(),
4303
4300
  results: z
4304
4301
  .array(z.object({
4305
- name: z.string().describe("The name of the result (file name, commit SHA, or issue/PR title)"),
4306
- url: z.string().describe("The URL of the result"),
4307
- type: z.enum(["code", "commit", "issueOrPullRequest"]).describe("The type of the result"),
4308
- content: z.any().superRefine((x, ctx) => {
4302
+ type: z.enum(["code", "commit", "issueOrPullRequest"]).describe("The type of search result."),
4303
+ name: z.string().describe("The name or identifier for the result (e.g., file name, commit SHA, or PR title)."),
4304
+ url: z.string().describe("The API URL of the result."),
4305
+ contents: z
4306
+ .any()
4307
+ .superRefine((x, ctx) => {
4309
4308
  const schemas = [
4310
4309
  z
4311
4310
  .object({
4312
- name: z.string().describe("The name of the file that had a match"),
4313
- path: z.string().describe("The path of the file that had a match"),
4314
- sha: z.string().describe("The SHA of the commit that had a match"),
4315
- url: z.string().describe("The URL of the file that had a match"),
4316
- score: z.number().describe("The similarity score of the match"),
4311
+ name: z.string().describe("The name of the file that had a match."),
4312
+ path: z.string().describe("The path of the file that had a match."),
4313
+ sha: z.string().describe("The short SHA of the commit containing the match."),
4314
+ url: z.string().describe("The API URL of the file that had a match."),
4315
+ score: z.number().describe("The similarity score of the match."),
4317
4316
  textMatches: z
4318
4317
  .array(z.object({
4319
- object_url: z.string().describe("The URL of the object that had a match").optional(),
4320
- object_type: z.string().describe("The type of the object that had a match").optional(),
4321
- fragment: z.string().describe("The fragment of the text that had a match").optional(),
4318
+ object_url: z.string().describe("The API URL of the matched object.").optional(),
4319
+ object_type: z.string().describe("The type of object that was matched.").optional(),
4320
+ fragment: z.string().describe("Text snippet showing the match.").optional(),
4322
4321
  matches: z
4323
4322
  .array(z.object({
4324
- text: z.string().describe("The text that had a match").optional(),
4325
- indices: z
4326
- .array(z.number())
4327
- .describe("The indices of the text that had a match")
4328
- .optional(),
4323
+ text: z.string().describe("The text that matched.").optional(),
4324
+ indices: z.array(z.number()).describe("Start and end indices of the match.").optional(),
4329
4325
  }))
4330
- .describe("A list of matches that match the query"),
4326
+ .describe("List of matches found in the fragment."),
4331
4327
  }))
4332
- .describe("A list of text matches that match the query"),
4328
+ .describe("A list of text matches found within the file."),
4333
4329
  })
4334
- .describe("Code result content"),
4330
+ .describe("Code search result content."),
4335
4331
  z
4336
4332
  .object({
4337
- sha: z.string().describe("The SHA of the commit that had a match"),
4338
- url: z.string().describe("The URL of the commit that had a match"),
4339
- commit: z
4340
- .object({
4333
+ sha: z.string().describe("The commit SHA."),
4334
+ url: z.string().describe("The API URL of the commit."),
4335
+ commit: z.object({
4336
+ message: z.string().describe("The commit message."),
4341
4337
  author: z.object({
4342
- name: z.string().describe("The name of the author"),
4343
- email: z.string().describe("The email of the author"),
4344
- date: z.string().describe("The date of the commit"),
4338
+ name: z.string().describe("The commit author name."),
4339
+ email: z.string().describe("The commit author email."),
4340
+ date: z.string().describe("The commit date."),
4345
4341
  }),
4346
- message: z.string().describe("The message of the commit"),
4342
+ }),
4343
+ author: z
4344
+ .object({
4345
+ login: z.string().describe("GitHub username of the author.").optional(),
4346
+ html_url: z.string().describe("URL to the author’s GitHub profile.").optional(),
4347
4347
  })
4348
+ .describe("The GitHub user who authored the commit.")
4349
+ .optional(),
4350
+ score: z.number().describe("The commit search relevance score."),
4351
+ files: z
4352
+ .array(z.object({
4353
+ filename: z.string().describe("The filename of the changed file."),
4354
+ status: z.string().describe("The status of the change (added, modified, deleted)."),
4355
+ patch: z.string().describe("The diff patch (truncated).").optional(),
4356
+ }))
4357
+ .describe("List of files changed in the commit.")
4348
4358
  .optional(),
4349
4359
  })
4350
- .describe("Commit result content"),
4360
+ .describe("Commit search result content."),
4351
4361
  z
4352
4362
  .object({
4353
- number: z.number().describe("The number of the issue or pull request").optional(),
4354
- title: z.string().describe("The title of the issue or pull request"),
4355
- html_url: z.string().describe("The URL of the issue or pull request").optional(),
4356
- state: z.enum(["open", "closed"]).describe("The state of the issue or pull request"),
4357
- isPullRequest: z.boolean().describe("Whether the issue or pull request is a pull request").optional(),
4358
- body: z.string().describe("The body of the issue or pull request").optional(),
4359
- score: z.number().describe("The score of the issue or pull request").optional(),
4363
+ number: z.number().describe("The issue or pull request number."),
4364
+ title: z.string().describe("The title of the issue or pull request."),
4365
+ html_url: z.string().describe("The URL of the issue or pull request."),
4366
+ state: z.enum(["open", "closed"]).describe("The state of the issue or pull request."),
4367
+ isPullRequest: z.boolean().describe("Whether the item is a pull request."),
4368
+ body: z.string().describe("The body text of the issue or pull request.").optional(),
4369
+ user: z
4370
+ .object({
4371
+ name: z.string().describe("The user’s display name.").optional(),
4372
+ email: z.string().describe("The user’s email address, if available.").optional(),
4373
+ })
4374
+ .describe("The user who created the issue or pull request."),
4375
+ score: z.number().describe("The search result relevance score."),
4360
4376
  files: z
4361
4377
  .array(z.object({
4362
- filename: z.string().describe("The filename of the file"),
4363
- status: z.string().describe("The status of the file"),
4364
- patch: z.string().describe("The patch of the file").optional(),
4378
+ filename: z.string().describe("File name in the PR diff."),
4379
+ status: z.string().describe("File change status (added, modified, removed)."),
4380
+ patch: z.string().describe("Diff patch content (truncated).").optional(),
4365
4381
  }))
4366
- .describe("A list of files that match the query")
4382
+ .describe("Files associated with the pull request.")
4367
4383
  .optional(),
4368
4384
  })
4369
- .describe("Issue or pull request result content"),
4385
+ .describe("Issue or pull request search result content."),
4370
4386
  ];
4371
4387
  const errors = schemas.reduce((errors, schema) => (result => (result.error ? [...errors, result.error] : errors))(schema.safeParse(x)), []);
4372
4388
  if (schemas.length - errors.length !== 1) {
@@ -4377,9 +4393,10 @@ export const githubSearchOrganizationOutputSchema = z.object({
4377
4393
  message: "Invalid input: Should pass single schema",
4378
4394
  });
4379
4395
  }
4380
- }),
4396
+ })
4397
+ .describe("The contents of the result, which vary depending on its type."),
4381
4398
  }))
4382
- .describe("Array of search results")
4399
+ .describe("List of search results.")
4383
4400
  .optional(),
4384
4401
  });
4385
4402
  export const githubGetBranchParamsSchema = z.object({
@@ -6,33 +6,27 @@ declare const actionTemplateSchema: z.ZodObject<{
6
6
  type: z.ZodString;
7
7
  required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
8
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
9
- oneOf: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
10
9
  }, "strip", z.ZodTypeAny, {
11
10
  type: string;
12
11
  required?: string[] | undefined;
13
12
  properties?: Record<string, any> | undefined;
14
- oneOf?: any[] | undefined;
15
13
  }, {
16
14
  type: string;
17
15
  required?: string[] | undefined;
18
16
  properties?: Record<string, any> | undefined;
19
- oneOf?: any[] | undefined;
20
17
  }>>;
21
18
  output: z.ZodOptional<z.ZodObject<{
22
19
  type: z.ZodString;
23
20
  required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
21
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
- oneOf: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
26
22
  }, "strip", z.ZodTypeAny, {
27
23
  type: string;
28
24
  required?: string[] | undefined;
29
25
  properties?: Record<string, any> | undefined;
30
- oneOf?: any[] | undefined;
31
26
  }, {
32
27
  type: string;
33
28
  required?: string[] | undefined;
34
29
  properties?: Record<string, any> | undefined;
35
- oneOf?: any[] | undefined;
36
30
  }>>;
37
31
  } & {
38
32
  name: z.ZodString;
@@ -46,13 +40,11 @@ declare const actionTemplateSchema: z.ZodObject<{
46
40
  type: string;
47
41
  required?: string[] | undefined;
48
42
  properties?: Record<string, any> | undefined;
49
- oneOf?: any[] | undefined;
50
43
  } | undefined;
51
44
  output?: {
52
45
  type: string;
53
46
  required?: string[] | undefined;
54
47
  properties?: Record<string, any> | undefined;
55
- oneOf?: any[] | undefined;
56
48
  } | undefined;
57
49
  }, {
58
50
  description: string;
@@ -63,13 +55,11 @@ declare const actionTemplateSchema: z.ZodObject<{
63
55
  type: string;
64
56
  required?: string[] | undefined;
65
57
  properties?: Record<string, any> | undefined;
66
- oneOf?: any[] | undefined;
67
58
  } | undefined;
68
59
  output?: {
69
60
  type: string;
70
61
  required?: string[] | undefined;
71
62
  properties?: Record<string, any> | undefined;
72
- oneOf?: any[] | undefined;
73
63
  } | undefined;
74
64
  }>;
75
65
  export type ActionTemplate = z.infer<typeof actionTemplateSchema>;
@@ -14,11 +14,11 @@ import convert from "json-schema-to-zod";
14
14
  import { Project, VariableDeclarationKind } from "ts-morph";
15
15
  import { z } from "zod";
16
16
  import { snakeToPascal } from "../utils/string.js";
17
+ // TODO support oneOf correctly
17
18
  const jsonObjectSchema = z.object({
18
19
  type: z.string(),
19
20
  required: z.array(z.string()).optional(),
20
21
  properties: z.record(z.string(), z.any()).optional(), // Permissive for now, validate using JSON schema later
21
- oneOf: z.array(z.any()).optional(), // Support oneOf schemas
22
22
  });
23
23
  const actionSchema = z.object({
24
24
  description: z.string(),
@@ -71,16 +71,7 @@ function validateObject(object) {
71
71
  throw new Error(`Error validating object: ${JSON.stringify(ajv.errors, null, 4)}`);
72
72
  }
73
73
  // Handle oneOf schemas
74
- if (object.oneOf) {
75
- // For oneOf schemas, validate each option
76
- for (const oneOfOption of object.oneOf) {
77
- const validOption = ajv.validateSchema(oneOfOption);
78
- if (!validOption) {
79
- throw new Error(`Error validating oneOf option: ${JSON.stringify(ajv.errors, null, 4)}`);
80
- }
81
- }
82
- }
83
- else if (object.required && object.properties) {
74
+ if (object.required && object.properties) {
84
75
  // Handle regular object schemas - check required fields
85
76
  for (const field of object.required) {
86
77
  if (!object.properties[field]) {
@@ -8,28 +8,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
13
- function getConfluenceRequestConfig(baseUrl, username, apiToken) {
14
- return {
15
+ const axios_1 = __importDefault(require("axios"));
16
+ function getConfluenceApi(baseUrl, username, apiToken) {
17
+ const api = axios_1.default.create({
15
18
  baseURL: baseUrl,
16
19
  headers: {
17
20
  Accept: "application/json",
21
+ // Tokens are associated with a specific user.
18
22
  Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
19
23
  },
20
- };
24
+ });
25
+ return api;
21
26
  }
22
27
  const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
23
- const { pageId, content, title } = params;
24
- const { baseUrl, authToken, username } = authParams;
25
- if (!baseUrl || !authToken || !username) {
26
- throw new Error("Missing required authentication information");
27
- }
28
- const config = getConfluenceRequestConfig(baseUrl, username, authToken);
28
+ const { pageId, username, content, title } = params;
29
+ const { baseUrl, authToken } = authParams;
30
+ const api = getConfluenceApi(baseUrl, username, authToken);
29
31
  // Get current version number
30
- const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
32
+ const response = yield api.get(`/api/v2/pages/${pageId}`);
31
33
  const currVersion = response.data.version.number;
32
- const payload = {
34
+ yield api.put(`/api/v2/pages/${pageId}`, {
33
35
  id: pageId,
34
36
  status: "current",
35
37
  title,
@@ -40,7 +42,6 @@ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* (
40
42
  version: {
41
43
  number: currVersion + 1,
42
44
  },
43
- };
44
- yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
45
+ });
45
46
  });
46
47
  exports.default = confluenceUpdatePage;
@@ -151,19 +151,19 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
151
151
  type: "code",
152
152
  name: result.name,
153
153
  url: result.url,
154
- content: result,
154
+ contents: result,
155
155
  })),
156
156
  ...enrichedCommits.map(result => ({
157
157
  type: "commit",
158
158
  name: result.sha,
159
159
  url: result.url,
160
- content: result,
160
+ contents: result,
161
161
  })),
162
162
  ...issuesAndPRs.map(result => ({
163
163
  type: "issueOrPullRequest",
164
164
  name: result.title,
165
165
  url: result.html_url,
166
- content: result,
166
+ contents: result,
167
167
  })),
168
168
  ],
169
169
  };
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const TokenResponseSchema: z.ZodObject<{
3
+ token: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ token: string;
6
+ }, {
7
+ token: string;
8
+ }>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.TokenResponseSchema = zod_1.z.object({
6
+ token: zod_1.z.string(),
7
+ });