@greensecurity/javascript-sdk 0.40.8-beta.22 → 0.40.8-beta.24

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 (114) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/vendors.test.js +25 -0
  3. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +28 -4
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/vendorsGetNextUnansweredScreeningQuestion.d.ts +18 -0
  9. package/dist/commonjs/funcs/vendorsGetNextUnansweredScreeningQuestion.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/vendorsGetNextUnansweredScreeningQuestion.js +126 -0
  11. package/dist/commonjs/funcs/vendorsGetNextUnansweredScreeningQuestion.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +4 -4
  13. package/dist/commonjs/lib/config.js +4 -4
  14. package/dist/commonjs/models/components/expand.d.ts +3 -0
  15. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/expand.js +1 -0
  17. package/dist/commonjs/models/components/expand.js.map +1 -1
  18. package/dist/commonjs/models/components/index.d.ts +2 -0
  19. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/index.js +2 -0
  21. package/dist/commonjs/models/components/index.js.map +1 -1
  22. package/dist/commonjs/models/components/screeninganswer.d.ts +112 -0
  23. package/dist/commonjs/models/components/screeninganswer.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/screeninganswer.js +138 -0
  25. package/dist/commonjs/models/components/screeninganswer.js.map +1 -0
  26. package/dist/commonjs/models/components/screeningquestion.d.ts +98 -0
  27. package/dist/commonjs/models/components/screeningquestion.d.ts.map +1 -0
  28. package/dist/commonjs/models/components/screeningquestion.js +125 -0
  29. package/dist/commonjs/models/components/screeningquestion.js.map +1 -0
  30. package/dist/commonjs/models/operations/getnextunansweredscreeningquestion.d.ts +70 -0
  31. package/dist/commonjs/models/operations/getnextunansweredscreeningquestion.d.ts.map +1 -0
  32. package/dist/commonjs/models/operations/getnextunansweredscreeningquestion.js +122 -0
  33. package/dist/commonjs/models/operations/getnextunansweredscreeningquestion.js.map +1 -0
  34. package/dist/commonjs/models/operations/index.d.ts +1 -0
  35. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  36. package/dist/commonjs/models/operations/index.js +1 -0
  37. package/dist/commonjs/models/operations/index.js.map +1 -1
  38. package/dist/commonjs/react-query/index.d.ts +1 -0
  39. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  40. package/dist/commonjs/react-query/index.js +1 -0
  41. package/dist/commonjs/react-query/index.js.map +1 -1
  42. package/dist/commonjs/react-query/vendorsGetNextUnansweredScreeningQuestion.d.ts +43 -0
  43. package/dist/commonjs/react-query/vendorsGetNextUnansweredScreeningQuestion.d.ts.map +1 -0
  44. package/dist/commonjs/react-query/vendorsGetNextUnansweredScreeningQuestion.js +97 -0
  45. package/dist/commonjs/react-query/vendorsGetNextUnansweredScreeningQuestion.js.map +1 -0
  46. package/dist/commonjs/sdk/vendors.d.ts +7 -0
  47. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  48. package/dist/commonjs/sdk/vendors.js +10 -0
  49. package/dist/commonjs/sdk/vendors.js.map +1 -1
  50. package/dist/esm/__tests__/vendors.test.js +25 -0
  51. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  52. package/dist/esm/__tests__/webhooks.test.js +1 -1
  53. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  54. package/dist/esm/__tests__/zones.test.js +28 -4
  55. package/dist/esm/__tests__/zones.test.js.map +1 -1
  56. package/dist/esm/funcs/vendorsGetNextUnansweredScreeningQuestion.d.ts +18 -0
  57. package/dist/esm/funcs/vendorsGetNextUnansweredScreeningQuestion.d.ts.map +1 -0
  58. package/dist/esm/funcs/vendorsGetNextUnansweredScreeningQuestion.js +90 -0
  59. package/dist/esm/funcs/vendorsGetNextUnansweredScreeningQuestion.js.map +1 -0
  60. package/dist/esm/lib/config.d.ts +4 -4
  61. package/dist/esm/lib/config.js +4 -4
  62. package/dist/esm/models/components/expand.d.ts +3 -0
  63. package/dist/esm/models/components/expand.d.ts.map +1 -1
  64. package/dist/esm/models/components/expand.js +1 -0
  65. package/dist/esm/models/components/expand.js.map +1 -1
  66. package/dist/esm/models/components/index.d.ts +2 -0
  67. package/dist/esm/models/components/index.d.ts.map +1 -1
  68. package/dist/esm/models/components/index.js +2 -0
  69. package/dist/esm/models/components/index.js.map +1 -1
  70. package/dist/esm/models/components/screeninganswer.d.ts +112 -0
  71. package/dist/esm/models/components/screeninganswer.d.ts.map +1 -0
  72. package/dist/esm/models/components/screeninganswer.js +100 -0
  73. package/dist/esm/models/components/screeninganswer.js.map +1 -0
  74. package/dist/esm/models/components/screeningquestion.d.ts +98 -0
  75. package/dist/esm/models/components/screeningquestion.d.ts.map +1 -0
  76. package/dist/esm/models/components/screeningquestion.js +87 -0
  77. package/dist/esm/models/components/screeningquestion.js.map +1 -0
  78. package/dist/esm/models/operations/getnextunansweredscreeningquestion.d.ts +70 -0
  79. package/dist/esm/models/operations/getnextunansweredscreeningquestion.d.ts.map +1 -0
  80. package/dist/esm/models/operations/getnextunansweredscreeningquestion.js +82 -0
  81. package/dist/esm/models/operations/getnextunansweredscreeningquestion.js.map +1 -0
  82. package/dist/esm/models/operations/index.d.ts +1 -0
  83. package/dist/esm/models/operations/index.d.ts.map +1 -1
  84. package/dist/esm/models/operations/index.js +1 -0
  85. package/dist/esm/models/operations/index.js.map +1 -1
  86. package/dist/esm/react-query/index.d.ts +1 -0
  87. package/dist/esm/react-query/index.d.ts.map +1 -1
  88. package/dist/esm/react-query/index.js +1 -0
  89. package/dist/esm/react-query/index.js.map +1 -1
  90. package/dist/esm/react-query/vendorsGetNextUnansweredScreeningQuestion.d.ts +43 -0
  91. package/dist/esm/react-query/vendorsGetNextUnansweredScreeningQuestion.d.ts.map +1 -0
  92. package/dist/esm/react-query/vendorsGetNextUnansweredScreeningQuestion.js +87 -0
  93. package/dist/esm/react-query/vendorsGetNextUnansweredScreeningQuestion.js.map +1 -0
  94. package/dist/esm/sdk/vendors.d.ts +7 -0
  95. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  96. package/dist/esm/sdk/vendors.js +10 -0
  97. package/dist/esm/sdk/vendors.js.map +1 -1
  98. package/examples/package-lock.json +1 -1
  99. package/jsr.json +1 -1
  100. package/package.json +1 -1
  101. package/src/__tests__/vendors.test.ts +32 -0
  102. package/src/__tests__/webhooks.test.ts +1 -1
  103. package/src/__tests__/zones.test.ts +28 -4
  104. package/src/funcs/vendorsGetNextUnansweredScreeningQuestion.ts +188 -0
  105. package/src/lib/config.ts +4 -4
  106. package/src/models/components/expand.ts +1 -0
  107. package/src/models/components/index.ts +2 -0
  108. package/src/models/components/screeninganswer.ts +195 -0
  109. package/src/models/components/screeningquestion.ts +163 -0
  110. package/src/models/operations/getnextunansweredscreeningquestion.ts +191 -0
  111. package/src/models/operations/index.ts +1 -0
  112. package/src/react-query/index.ts +1 -0
  113. package/src/react-query/vendorsGetNextUnansweredScreeningQuestion.ts +190 -0
  114. package/src/sdk/vendors.ts +18 -0
@@ -0,0 +1,195 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ ScreeningQuestion,
13
+ ScreeningQuestion$inboundSchema,
14
+ ScreeningQuestion$Outbound,
15
+ ScreeningQuestion$outboundSchema,
16
+ } from "./screeningquestion.js";
17
+
18
+ /**
19
+ * The type of answer option.
20
+ */
21
+ export const AnswerType = {
22
+ Preset: "preset",
23
+ Date: "date",
24
+ ShortAnswer: "short answer",
25
+ LongAnswer: "long answer",
26
+ } as const;
27
+ /**
28
+ * The type of answer option.
29
+ */
30
+ export type AnswerType = ClosedEnum<typeof AnswerType>;
31
+
32
+ /**
33
+ * Reduced list of attributes of ScreeningAnswer records
34
+ */
35
+ export type ScreeningAnswer = {
36
+ id: number;
37
+ screeningQuestionId?: number | null | undefined;
38
+ /**
39
+ * The content of the screening answer option.
40
+ */
41
+ answer?: string | null | undefined;
42
+ /**
43
+ * The type of answer option.
44
+ */
45
+ answerType?: AnswerType | null | undefined;
46
+ /**
47
+ * The title or label for the answer input field.
48
+ */
49
+ answerTitle?: string | null | undefined;
50
+ /**
51
+ * Whether or not to allow an empty answer for this option.
52
+ */
53
+ allowEmptyAnswer: boolean;
54
+ /**
55
+ * The error message to display if an empty answer is submitted when not allowed.
56
+ */
57
+ emptyAnswerErrorMessage?: string | null | undefined;
58
+ /**
59
+ * Whether or not to show a confirmation prompt when this answer is selected.
60
+ */
61
+ showConfirmation: boolean;
62
+ /**
63
+ * The text to display in the confirmation prompt.
64
+ */
65
+ confirmationText?: string | null | undefined;
66
+ priority?: number | null | undefined;
67
+ screeningQuestions?: Array<ScreeningQuestion> | null | undefined;
68
+ };
69
+
70
+ /** @internal */
71
+ export const AnswerType$inboundSchema: z.ZodNativeEnum<typeof AnswerType> = z
72
+ .nativeEnum(AnswerType);
73
+
74
+ /** @internal */
75
+ export const AnswerType$outboundSchema: z.ZodNativeEnum<typeof AnswerType> =
76
+ AnswerType$inboundSchema;
77
+
78
+ /**
79
+ * @internal
80
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
81
+ */
82
+ export namespace AnswerType$ {
83
+ /** @deprecated use `AnswerType$inboundSchema` instead. */
84
+ export const inboundSchema = AnswerType$inboundSchema;
85
+ /** @deprecated use `AnswerType$outboundSchema` instead. */
86
+ export const outboundSchema = AnswerType$outboundSchema;
87
+ }
88
+
89
+ /** @internal */
90
+ export const ScreeningAnswer$inboundSchema: z.ZodType<
91
+ ScreeningAnswer,
92
+ z.ZodTypeDef,
93
+ unknown
94
+ > = z.object({
95
+ id: z.number().int(),
96
+ screening_question_id: z.nullable(z.number().int()).optional(),
97
+ answer: z.nullable(z.string()).optional(),
98
+ answer_type: z.nullable(AnswerType$inboundSchema).optional(),
99
+ answer_title: z.nullable(z.string()).optional(),
100
+ allow_empty_answer: z.boolean(),
101
+ empty_answer_error_message: z.nullable(z.string()).optional(),
102
+ show_confirmation: z.boolean(),
103
+ confirmation_text: z.nullable(z.string()).optional(),
104
+ priority: z.nullable(z.number().int()).optional(),
105
+ screening_questions: z.nullable(
106
+ z.array(z.lazy(() => ScreeningQuestion$inboundSchema)),
107
+ ).optional(),
108
+ }).transform((v) => {
109
+ return remap$(v, {
110
+ "screening_question_id": "screeningQuestionId",
111
+ "answer_type": "answerType",
112
+ "answer_title": "answerTitle",
113
+ "allow_empty_answer": "allowEmptyAnswer",
114
+ "empty_answer_error_message": "emptyAnswerErrorMessage",
115
+ "show_confirmation": "showConfirmation",
116
+ "confirmation_text": "confirmationText",
117
+ "screening_questions": "screeningQuestions",
118
+ });
119
+ });
120
+
121
+ /** @internal */
122
+ export type ScreeningAnswer$Outbound = {
123
+ id: number;
124
+ screening_question_id?: number | null | undefined;
125
+ answer?: string | null | undefined;
126
+ answer_type?: string | null | undefined;
127
+ answer_title?: string | null | undefined;
128
+ allow_empty_answer: boolean;
129
+ empty_answer_error_message?: string | null | undefined;
130
+ show_confirmation: boolean;
131
+ confirmation_text?: string | null | undefined;
132
+ priority?: number | null | undefined;
133
+ screening_questions?: Array<ScreeningQuestion$Outbound> | null | undefined;
134
+ };
135
+
136
+ /** @internal */
137
+ export const ScreeningAnswer$outboundSchema: z.ZodType<
138
+ ScreeningAnswer$Outbound,
139
+ z.ZodTypeDef,
140
+ ScreeningAnswer
141
+ > = z.object({
142
+ id: z.number().int(),
143
+ screeningQuestionId: z.nullable(z.number().int()).optional(),
144
+ answer: z.nullable(z.string()).optional(),
145
+ answerType: z.nullable(AnswerType$outboundSchema).optional(),
146
+ answerTitle: z.nullable(z.string()).optional(),
147
+ allowEmptyAnswer: z.boolean(),
148
+ emptyAnswerErrorMessage: z.nullable(z.string()).optional(),
149
+ showConfirmation: z.boolean(),
150
+ confirmationText: z.nullable(z.string()).optional(),
151
+ priority: z.nullable(z.number().int()).optional(),
152
+ screeningQuestions: z.nullable(
153
+ z.array(z.lazy(() => ScreeningQuestion$outboundSchema)),
154
+ ).optional(),
155
+ }).transform((v) => {
156
+ return remap$(v, {
157
+ screeningQuestionId: "screening_question_id",
158
+ answerType: "answer_type",
159
+ answerTitle: "answer_title",
160
+ allowEmptyAnswer: "allow_empty_answer",
161
+ emptyAnswerErrorMessage: "empty_answer_error_message",
162
+ showConfirmation: "show_confirmation",
163
+ confirmationText: "confirmation_text",
164
+ screeningQuestions: "screening_questions",
165
+ });
166
+ });
167
+
168
+ /**
169
+ * @internal
170
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
171
+ */
172
+ export namespace ScreeningAnswer$ {
173
+ /** @deprecated use `ScreeningAnswer$inboundSchema` instead. */
174
+ export const inboundSchema = ScreeningAnswer$inboundSchema;
175
+ /** @deprecated use `ScreeningAnswer$outboundSchema` instead. */
176
+ export const outboundSchema = ScreeningAnswer$outboundSchema;
177
+ /** @deprecated use `ScreeningAnswer$Outbound` instead. */
178
+ export type Outbound = ScreeningAnswer$Outbound;
179
+ }
180
+
181
+ export function screeningAnswerToJSON(
182
+ screeningAnswer: ScreeningAnswer,
183
+ ): string {
184
+ return JSON.stringify(ScreeningAnswer$outboundSchema.parse(screeningAnswer));
185
+ }
186
+
187
+ export function screeningAnswerFromJSON(
188
+ jsonString: string,
189
+ ): SafeParseResult<ScreeningAnswer, SDKValidationError> {
190
+ return safeParse(
191
+ jsonString,
192
+ (x) => ScreeningAnswer$inboundSchema.parse(JSON.parse(x)),
193
+ `Failed to parse 'ScreeningAnswer' from JSON`,
194
+ );
195
+ }
@@ -0,0 +1,163 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ ScreeningAnswer,
13
+ ScreeningAnswer$inboundSchema,
14
+ ScreeningAnswer$Outbound,
15
+ ScreeningAnswer$outboundSchema,
16
+ } from "./screeninganswer.js";
17
+
18
+ /**
19
+ * The display format for the question.
20
+ */
21
+ export const PresetDisplayAs = {
22
+ FloatingButtons: "floating buttons",
23
+ LineButtons: "line buttons",
24
+ Radio: "radio",
25
+ Select: "select",
26
+ Checkbox: "checkbox",
27
+ Checkbox2Column: "checkbox (2-column)",
28
+ } as const;
29
+ /**
30
+ * The display format for the question.
31
+ */
32
+ export type PresetDisplayAs = ClosedEnum<typeof PresetDisplayAs>;
33
+
34
+ /**
35
+ * Reduced list of attributes of ScreeningQuestion record
36
+ */
37
+ export type ScreeningQuestion = {
38
+ id: number;
39
+ screeningQuestionSeriesId: number;
40
+ screeningAnswerId?: number | null | undefined;
41
+ /**
42
+ * The order for displaying the question relative to other questions in the same series. Questions with lower priority values should be shown first.
43
+ */
44
+ priority?: number | null | undefined;
45
+ /**
46
+ * The content of the screening question to be presented.
47
+ */
48
+ question?: string | null | undefined;
49
+ /**
50
+ * The display format for the question.
51
+ */
52
+ presetDisplayAs?: PresetDisplayAs | null | undefined;
53
+ screeningAnswers?: Array<ScreeningAnswer> | undefined;
54
+ };
55
+
56
+ /** @internal */
57
+ export const PresetDisplayAs$inboundSchema: z.ZodNativeEnum<
58
+ typeof PresetDisplayAs
59
+ > = z.nativeEnum(PresetDisplayAs);
60
+
61
+ /** @internal */
62
+ export const PresetDisplayAs$outboundSchema: z.ZodNativeEnum<
63
+ typeof PresetDisplayAs
64
+ > = PresetDisplayAs$inboundSchema;
65
+
66
+ /**
67
+ * @internal
68
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
69
+ */
70
+ export namespace PresetDisplayAs$ {
71
+ /** @deprecated use `PresetDisplayAs$inboundSchema` instead. */
72
+ export const inboundSchema = PresetDisplayAs$inboundSchema;
73
+ /** @deprecated use `PresetDisplayAs$outboundSchema` instead. */
74
+ export const outboundSchema = PresetDisplayAs$outboundSchema;
75
+ }
76
+
77
+ /** @internal */
78
+ export const ScreeningQuestion$inboundSchema: z.ZodType<
79
+ ScreeningQuestion,
80
+ z.ZodTypeDef,
81
+ unknown
82
+ > = z.object({
83
+ id: z.number().int(),
84
+ screening_question_series_id: z.number().int(),
85
+ screening_answer_id: z.nullable(z.number().int()).optional(),
86
+ priority: z.nullable(z.number().int()).optional(),
87
+ question: z.nullable(z.string()).optional(),
88
+ preset_display_as: z.nullable(PresetDisplayAs$inboundSchema).optional(),
89
+ screening_answers: z.array(z.lazy(() => ScreeningAnswer$inboundSchema))
90
+ .optional(),
91
+ }).transform((v) => {
92
+ return remap$(v, {
93
+ "screening_question_series_id": "screeningQuestionSeriesId",
94
+ "screening_answer_id": "screeningAnswerId",
95
+ "preset_display_as": "presetDisplayAs",
96
+ "screening_answers": "screeningAnswers",
97
+ });
98
+ });
99
+
100
+ /** @internal */
101
+ export type ScreeningQuestion$Outbound = {
102
+ id: number;
103
+ screening_question_series_id: number;
104
+ screening_answer_id?: number | null | undefined;
105
+ priority?: number | null | undefined;
106
+ question?: string | null | undefined;
107
+ preset_display_as?: string | null | undefined;
108
+ screening_answers?: Array<ScreeningAnswer$Outbound> | undefined;
109
+ };
110
+
111
+ /** @internal */
112
+ export const ScreeningQuestion$outboundSchema: z.ZodType<
113
+ ScreeningQuestion$Outbound,
114
+ z.ZodTypeDef,
115
+ ScreeningQuestion
116
+ > = z.object({
117
+ id: z.number().int(),
118
+ screeningQuestionSeriesId: z.number().int(),
119
+ screeningAnswerId: z.nullable(z.number().int()).optional(),
120
+ priority: z.nullable(z.number().int()).optional(),
121
+ question: z.nullable(z.string()).optional(),
122
+ presetDisplayAs: z.nullable(PresetDisplayAs$outboundSchema).optional(),
123
+ screeningAnswers: z.array(z.lazy(() => ScreeningAnswer$outboundSchema))
124
+ .optional(),
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ screeningQuestionSeriesId: "screening_question_series_id",
128
+ screeningAnswerId: "screening_answer_id",
129
+ presetDisplayAs: "preset_display_as",
130
+ screeningAnswers: "screening_answers",
131
+ });
132
+ });
133
+
134
+ /**
135
+ * @internal
136
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
137
+ */
138
+ export namespace ScreeningQuestion$ {
139
+ /** @deprecated use `ScreeningQuestion$inboundSchema` instead. */
140
+ export const inboundSchema = ScreeningQuestion$inboundSchema;
141
+ /** @deprecated use `ScreeningQuestion$outboundSchema` instead. */
142
+ export const outboundSchema = ScreeningQuestion$outboundSchema;
143
+ /** @deprecated use `ScreeningQuestion$Outbound` instead. */
144
+ export type Outbound = ScreeningQuestion$Outbound;
145
+ }
146
+
147
+ export function screeningQuestionToJSON(
148
+ screeningQuestion: ScreeningQuestion,
149
+ ): string {
150
+ return JSON.stringify(
151
+ ScreeningQuestion$outboundSchema.parse(screeningQuestion),
152
+ );
153
+ }
154
+
155
+ export function screeningQuestionFromJSON(
156
+ jsonString: string,
157
+ ): SafeParseResult<ScreeningQuestion, SDKValidationError> {
158
+ return safeParse(
159
+ jsonString,
160
+ (x) => ScreeningQuestion$inboundSchema.parse(JSON.parse(x)),
161
+ `Failed to parse 'ScreeningQuestion' from JSON`,
162
+ );
163
+ }
@@ -0,0 +1,191 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type GetNextUnansweredScreeningQuestionRequest = {
13
+ /**
14
+ * Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
15
+ */
16
+ vendorIdOrMe: string;
17
+ /**
18
+ * An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
19
+ */
20
+ expand?: Array<components.Expand> | undefined;
21
+ };
22
+
23
+ /**
24
+ * The request was successful, and the server has returned the requested resource in the response body.
25
+ */
26
+ export type GetNextUnansweredScreeningQuestionResponseBody = {
27
+ screeningQuestion: components.ScreeningQuestion | null;
28
+ screeningResponse: components.ScreeningResponse | null;
29
+ success: boolean;
30
+ };
31
+
32
+ /** @internal */
33
+ export const GetNextUnansweredScreeningQuestionRequest$inboundSchema: z.ZodType<
34
+ GetNextUnansweredScreeningQuestionRequest,
35
+ z.ZodTypeDef,
36
+ unknown
37
+ > = z.object({
38
+ vendor_id_or_me: z.string(),
39
+ expand: z.array(components.Expand$inboundSchema).optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "vendor_id_or_me": "vendorIdOrMe",
43
+ });
44
+ });
45
+
46
+ /** @internal */
47
+ export type GetNextUnansweredScreeningQuestionRequest$Outbound = {
48
+ vendor_id_or_me: string;
49
+ expand?: Array<string> | undefined;
50
+ };
51
+
52
+ /** @internal */
53
+ export const GetNextUnansweredScreeningQuestionRequest$outboundSchema:
54
+ z.ZodType<
55
+ GetNextUnansweredScreeningQuestionRequest$Outbound,
56
+ z.ZodTypeDef,
57
+ GetNextUnansweredScreeningQuestionRequest
58
+ > = z.object({
59
+ vendorIdOrMe: z.string(),
60
+ expand: z.array(components.Expand$outboundSchema).optional(),
61
+ }).transform((v) => {
62
+ return remap$(v, {
63
+ vendorIdOrMe: "vendor_id_or_me",
64
+ });
65
+ });
66
+
67
+ /**
68
+ * @internal
69
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
70
+ */
71
+ export namespace GetNextUnansweredScreeningQuestionRequest$ {
72
+ /** @deprecated use `GetNextUnansweredScreeningQuestionRequest$inboundSchema` instead. */
73
+ export const inboundSchema =
74
+ GetNextUnansweredScreeningQuestionRequest$inboundSchema;
75
+ /** @deprecated use `GetNextUnansweredScreeningQuestionRequest$outboundSchema` instead. */
76
+ export const outboundSchema =
77
+ GetNextUnansweredScreeningQuestionRequest$outboundSchema;
78
+ /** @deprecated use `GetNextUnansweredScreeningQuestionRequest$Outbound` instead. */
79
+ export type Outbound = GetNextUnansweredScreeningQuestionRequest$Outbound;
80
+ }
81
+
82
+ export function getNextUnansweredScreeningQuestionRequestToJSON(
83
+ getNextUnansweredScreeningQuestionRequest:
84
+ GetNextUnansweredScreeningQuestionRequest,
85
+ ): string {
86
+ return JSON.stringify(
87
+ GetNextUnansweredScreeningQuestionRequest$outboundSchema.parse(
88
+ getNextUnansweredScreeningQuestionRequest,
89
+ ),
90
+ );
91
+ }
92
+
93
+ export function getNextUnansweredScreeningQuestionRequestFromJSON(
94
+ jsonString: string,
95
+ ): SafeParseResult<
96
+ GetNextUnansweredScreeningQuestionRequest,
97
+ SDKValidationError
98
+ > {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) =>
102
+ GetNextUnansweredScreeningQuestionRequest$inboundSchema.parse(
103
+ JSON.parse(x),
104
+ ),
105
+ `Failed to parse 'GetNextUnansweredScreeningQuestionRequest' from JSON`,
106
+ );
107
+ }
108
+
109
+ /** @internal */
110
+ export const GetNextUnansweredScreeningQuestionResponseBody$inboundSchema:
111
+ z.ZodType<
112
+ GetNextUnansweredScreeningQuestionResponseBody,
113
+ z.ZodTypeDef,
114
+ unknown
115
+ > = z.object({
116
+ screening_question: z.nullable(components.ScreeningQuestion$inboundSchema),
117
+ screening_response: z.nullable(components.ScreeningResponse$inboundSchema),
118
+ success: z.boolean(),
119
+ }).transform((v) => {
120
+ return remap$(v, {
121
+ "screening_question": "screeningQuestion",
122
+ "screening_response": "screeningResponse",
123
+ });
124
+ });
125
+
126
+ /** @internal */
127
+ export type GetNextUnansweredScreeningQuestionResponseBody$Outbound = {
128
+ screening_question: components.ScreeningQuestion$Outbound | null;
129
+ screening_response: components.ScreeningResponse$Outbound | null;
130
+ success: boolean;
131
+ };
132
+
133
+ /** @internal */
134
+ export const GetNextUnansweredScreeningQuestionResponseBody$outboundSchema:
135
+ z.ZodType<
136
+ GetNextUnansweredScreeningQuestionResponseBody$Outbound,
137
+ z.ZodTypeDef,
138
+ GetNextUnansweredScreeningQuestionResponseBody
139
+ > = z.object({
140
+ screeningQuestion: z.nullable(components.ScreeningQuestion$outboundSchema),
141
+ screeningResponse: z.nullable(components.ScreeningResponse$outboundSchema),
142
+ success: z.boolean(),
143
+ }).transform((v) => {
144
+ return remap$(v, {
145
+ screeningQuestion: "screening_question",
146
+ screeningResponse: "screening_response",
147
+ });
148
+ });
149
+
150
+ /**
151
+ * @internal
152
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
153
+ */
154
+ export namespace GetNextUnansweredScreeningQuestionResponseBody$ {
155
+ /** @deprecated use `GetNextUnansweredScreeningQuestionResponseBody$inboundSchema` instead. */
156
+ export const inboundSchema =
157
+ GetNextUnansweredScreeningQuestionResponseBody$inboundSchema;
158
+ /** @deprecated use `GetNextUnansweredScreeningQuestionResponseBody$outboundSchema` instead. */
159
+ export const outboundSchema =
160
+ GetNextUnansweredScreeningQuestionResponseBody$outboundSchema;
161
+ /** @deprecated use `GetNextUnansweredScreeningQuestionResponseBody$Outbound` instead. */
162
+ export type Outbound =
163
+ GetNextUnansweredScreeningQuestionResponseBody$Outbound;
164
+ }
165
+
166
+ export function getNextUnansweredScreeningQuestionResponseBodyToJSON(
167
+ getNextUnansweredScreeningQuestionResponseBody:
168
+ GetNextUnansweredScreeningQuestionResponseBody,
169
+ ): string {
170
+ return JSON.stringify(
171
+ GetNextUnansweredScreeningQuestionResponseBody$outboundSchema.parse(
172
+ getNextUnansweredScreeningQuestionResponseBody,
173
+ ),
174
+ );
175
+ }
176
+
177
+ export function getNextUnansweredScreeningQuestionResponseBodyFromJSON(
178
+ jsonString: string,
179
+ ): SafeParseResult<
180
+ GetNextUnansweredScreeningQuestionResponseBody,
181
+ SDKValidationError
182
+ > {
183
+ return safeParse(
184
+ jsonString,
185
+ (x) =>
186
+ GetNextUnansweredScreeningQuestionResponseBody$inboundSchema.parse(
187
+ JSON.parse(x),
188
+ ),
189
+ `Failed to parse 'GetNextUnansweredScreeningQuestionResponseBody' from JSON`,
190
+ );
191
+ }
@@ -28,6 +28,7 @@ export * from "./deletevendormanagedbycompany.js";
28
28
  export * from "./expeditetimeremaining.js";
29
29
  export * from "./getfacility.js";
30
30
  export * from "./getfhirconfig.js";
31
+ export * from "./getnextunansweredscreeningquestion.js";
31
32
  export * from "./getsecurityzone.js";
32
33
  export * from "./getsubscription.js";
33
34
  export * from "./getsupportarticle.js";
@@ -60,6 +60,7 @@ export * from "./vendorsDeclineVendorCredential.js";
60
60
  export * from "./vendorsDeleteVendorCredentialFile.js";
61
61
  export * from "./vendorsDeleteVendorManagedByCompany.js";
62
62
  export * from "./vendorsExpediteTimeRemaining.js";
63
+ export * from "./vendorsGetNextUnansweredScreeningQuestion.js";
63
64
  export * from "./vendorsGetSubscription.js";
64
65
  export * from "./vendorsGetVendorCredentialDetails.js";
65
66
  export * from "./vendorsGetVendorCredentialFile.js";