• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-typescript-sdk-gen / 12431627290

20 Dec 2024 12:42PM UTC coverage: 43.449% (+0.05%) from 43.401%
12431627290

Pull #453

github

web-flow
Merge 68f9ced81 into 03d7f3ef2
Pull Request #453: docs: Update documents about integration (box/box-codegen#628)

3912 of 15217 branches covered (25.71%)

Branch coverage included in aggregate %.

6 of 12 new or added lines in 1 file covered. (50.0%)

8 existing lines in 6 files now uncovered.

13670 of 25249 relevant lines covered (54.14%)

81.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.2
/src/schemas/signRequestBase.generated.ts
1
import { serializeSignRequestPrefillTag } from './signRequestPrefillTag.generated.js';
140✔
2
import { deserializeSignRequestPrefillTag } from './signRequestPrefillTag.generated.js';
140✔
3
import { SignRequestPrefillTag } from './signRequestPrefillTag.generated.js';
4
import { BoxSdkError } from '../box/errors.js';
140✔
5
import { SerializedData } from '../serialization/json.js';
6
import { sdIsEmpty } from '../serialization/json.js';
7
import { sdIsBoolean } from '../serialization/json.js';
140✔
8
import { sdIsNumber } from '../serialization/json.js';
140✔
9
import { sdIsString } from '../serialization/json.js';
140✔
10
import { sdIsList } from '../serialization/json.js';
140✔
11
import { sdIsMap } from '../serialization/json.js';
140✔
12
export interface SignRequestBase {
13
  /**
14
   * Indicates if the sender should receive a `prepare_url` in the response to complete document preparation using the UI. */
15
  readonly isDocumentPreparationNeeded?: boolean;
16
  /**
17
   * When specified, the signature request will be redirected to this url when a document is signed. */
18
  readonly redirectUrl?: string | null;
19
  /**
20
   * The uri that a signer will be redirected to after declining to sign a document. */
21
  readonly declinedRedirectUrl?: string | null;
22
  /**
23
   * Disables the usage of signatures generated by typing (text). */
24
  readonly areTextSignaturesEnabled?: boolean;
25
  /**
26
   * Subject of sign request email. This is cleaned by sign request. If this field is not passed, a default subject will be used. */
27
  readonly emailSubject?: string | null;
28
  /**
29
   * Message to include in sign request email. The field is cleaned through sanitization of specific characters. However, some html tags are allowed. Links included in the message are also converted to hyperlinks in the email. The message may contain the following html tags including `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. If this field is not passed, a default message will be used. */
30
  readonly emailMessage?: string | null;
31
  /**
32
   * Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to outstanding signers. */
33
  readonly areRemindersEnabled?: boolean;
34
  /**
35
   * Name of the signature request. */
36
  readonly name?: string;
37
  /**
38
   * When a document contains sign-related tags in the content, you can prefill them using this `prefill_tags` by referencing the 'id' of the tag as the `external_id` field of the prefill tag. */
39
  readonly prefillTags?: readonly SignRequestPrefillTag[];
40
  /**
41
   * Set the number of days after which the created signature request will automatically expire if not completed. By default, we do not apply any expiration date on signature requests, and the signature request does not expire. */
42
  readonly daysValid?: number | null;
43
  /**
44
   * This can be used to reference an ID in an external system that the sign request is related to. */
45
  readonly externalId?: string | null;
46
  /**
47
   * When a signature request is created from a template this field will indicate the id of that template. */
48
  readonly templateId?: string | null;
49
  /**
50
   * Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`. */
51
  readonly externalSystemName?: string | null;
52
  readonly rawData?: SerializedData;
53
}
54
export function serializeSignRequestBase(val: SignRequestBase): SerializedData {
140✔
55
  return {
4✔
56
    ['is_document_preparation_needed']: val.isDocumentPreparationNeeded,
57
    ['redirect_url']: val.redirectUrl,
58
    ['declined_redirect_url']: val.declinedRedirectUrl,
59
    ['are_text_signatures_enabled']: val.areTextSignaturesEnabled,
60
    ['email_subject']: val.emailSubject,
61
    ['email_message']: val.emailMessage,
62
    ['are_reminders_enabled']: val.areRemindersEnabled,
63
    ['name']: val.name,
64
    ['prefill_tags']:
65
      val.prefillTags == void 0
4✔
66
        ? val.prefillTags
67
        : (val.prefillTags.map(function (
68
            item: SignRequestPrefillTag,
69
          ): SerializedData {
70
            return serializeSignRequestPrefillTag(item);
2✔
71
          }) as readonly any[]),
72
    ['days_valid']: val.daysValid,
73
    ['external_id']: val.externalId,
74
    ['template_id']: val.templateId,
75
    ['external_system_name']: val.externalSystemName,
76
  };
77
}
78
export function deserializeSignRequestBase(
140✔
79
  val: SerializedData,
80
): SignRequestBase {
81
  if (!sdIsMap(val)) {
×
82
    throw new BoxSdkError({ message: 'Expecting a map for "SignRequestBase"' });
×
83
  }
84
  if (
×
85
    !(val.is_document_preparation_needed == void 0) &&
×
86
    !sdIsBoolean(val.is_document_preparation_needed)
87
  ) {
88
    throw new BoxSdkError({
×
89
      message:
90
        'Expecting boolean for "is_document_preparation_needed" of type "SignRequestBase"',
91
    });
92
  }
93
  const isDocumentPreparationNeeded: undefined | boolean =
94
    val.is_document_preparation_needed == void 0
×
95
      ? void 0
96
      : val.is_document_preparation_needed;
97
  if (!(val.redirect_url == void 0) && !sdIsString(val.redirect_url)) {
×
98
    throw new BoxSdkError({
×
99
      message: 'Expecting string for "redirect_url" of type "SignRequestBase"',
100
    });
101
  }
102
  const redirectUrl: undefined | string =
103
    val.redirect_url == void 0 ? void 0 : val.redirect_url;
×
104
  if (
×
105
    !(val.declined_redirect_url == void 0) &&
×
106
    !sdIsString(val.declined_redirect_url)
107
  ) {
108
    throw new BoxSdkError({
×
109
      message:
110
        'Expecting string for "declined_redirect_url" of type "SignRequestBase"',
111
    });
112
  }
113
  const declinedRedirectUrl: undefined | string =
114
    val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url;
×
115
  if (
×
116
    !(val.are_text_signatures_enabled == void 0) &&
×
117
    !sdIsBoolean(val.are_text_signatures_enabled)
118
  ) {
119
    throw new BoxSdkError({
×
120
      message:
121
        'Expecting boolean for "are_text_signatures_enabled" of type "SignRequestBase"',
122
    });
123
  }
124
  const areTextSignaturesEnabled: undefined | boolean =
125
    val.are_text_signatures_enabled == void 0
×
126
      ? void 0
127
      : val.are_text_signatures_enabled;
128
  if (!(val.email_subject == void 0) && !sdIsString(val.email_subject)) {
×
129
    throw new BoxSdkError({
×
130
      message: 'Expecting string for "email_subject" of type "SignRequestBase"',
131
    });
132
  }
133
  const emailSubject: undefined | string =
134
    val.email_subject == void 0 ? void 0 : val.email_subject;
×
135
  if (!(val.email_message == void 0) && !sdIsString(val.email_message)) {
×
136
    throw new BoxSdkError({
×
137
      message: 'Expecting string for "email_message" of type "SignRequestBase"',
138
    });
139
  }
140
  const emailMessage: undefined | string =
141
    val.email_message == void 0 ? void 0 : val.email_message;
×
142
  if (
×
143
    !(val.are_reminders_enabled == void 0) &&
×
144
    !sdIsBoolean(val.are_reminders_enabled)
145
  ) {
146
    throw new BoxSdkError({
×
147
      message:
148
        'Expecting boolean for "are_reminders_enabled" of type "SignRequestBase"',
149
    });
150
  }
151
  const areRemindersEnabled: undefined | boolean =
152
    val.are_reminders_enabled == void 0 ? void 0 : val.are_reminders_enabled;
×
153
  if (!(val.name == void 0) && !sdIsString(val.name)) {
×
154
    throw new BoxSdkError({
×
155
      message: 'Expecting string for "name" of type "SignRequestBase"',
156
    });
157
  }
158
  const name: undefined | string = val.name == void 0 ? void 0 : val.name;
×
159
  if (!(val.prefill_tags == void 0) && !sdIsList(val.prefill_tags)) {
×
160
    throw new BoxSdkError({
×
161
      message: 'Expecting array for "prefill_tags" of type "SignRequestBase"',
162
    });
163
  }
164
  const prefillTags: undefined | readonly SignRequestPrefillTag[] =
165
    val.prefill_tags == void 0
×
166
      ? void 0
167
      : sdIsList(val.prefill_tags)
×
168
        ? (val.prefill_tags.map(function (
169
            itm: SerializedData,
170
          ): SignRequestPrefillTag {
171
            return deserializeSignRequestPrefillTag(itm);
×
172
          }) as readonly any[])
173
        : [];
174
  if (!(val.days_valid == void 0) && !sdIsNumber(val.days_valid)) {
×
175
    throw new BoxSdkError({
×
176
      message: 'Expecting number for "days_valid" of type "SignRequestBase"',
177
    });
178
  }
179
  const daysValid: undefined | number =
180
    val.days_valid == void 0 ? void 0 : val.days_valid;
×
181
  if (!(val.external_id == void 0) && !sdIsString(val.external_id)) {
×
182
    throw new BoxSdkError({
×
183
      message: 'Expecting string for "external_id" of type "SignRequestBase"',
184
    });
185
  }
186
  const externalId: undefined | string =
187
    val.external_id == void 0 ? void 0 : val.external_id;
×
188
  if (!(val.template_id == void 0) && !sdIsString(val.template_id)) {
×
UNCOV
189
    throw new BoxSdkError({
×
190
      message: 'Expecting string for "template_id" of type "SignRequestBase"',
191
    });
192
  }
193
  const templateId: undefined | string =
194
    val.template_id == void 0 ? void 0 : val.template_id;
×
195
  if (
×
196
    !(val.external_system_name == void 0) &&
×
197
    !sdIsString(val.external_system_name)
198
  ) {
199
    throw new BoxSdkError({
×
200
      message:
201
        'Expecting string for "external_system_name" of type "SignRequestBase"',
202
    });
203
  }
204
  const externalSystemName: undefined | string =
205
    val.external_system_name == void 0 ? void 0 : val.external_system_name;
×
206
  return {
×
207
    isDocumentPreparationNeeded: isDocumentPreparationNeeded,
208
    redirectUrl: redirectUrl,
209
    declinedRedirectUrl: declinedRedirectUrl,
210
    areTextSignaturesEnabled: areTextSignaturesEnabled,
211
    emailSubject: emailSubject,
212
    emailMessage: emailMessage,
213
    areRemindersEnabled: areRemindersEnabled,
214
    name: name,
215
    prefillTags: prefillTags,
216
    daysValid: daysValid,
217
    externalId: externalId,
218
    templateId: templateId,
219
    externalSystemName: externalSystemName,
220
  } satisfies SignRequestBase;
221
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc