• 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

18.18
/src/schemas/signRequestCreateSigner.generated.ts
1
import { BoxSdkError } from '../box/errors.js';
140✔
2
import { SerializedData } from '../serialization/json.js';
3
import { sdIsEmpty } from '../serialization/json.js';
4
import { sdIsBoolean } from '../serialization/json.js';
140✔
5
import { sdIsNumber } from '../serialization/json.js';
140✔
6
import { sdIsString } from '../serialization/json.js';
140✔
7
import { sdIsList } from '../serialization/json.js';
8
import { sdIsMap } from '../serialization/json.js';
140✔
9
export type SignRequestCreateSignerRoleField =
10
  | 'signer'
11
  | 'approver'
12
  | 'final_copy_reader';
13
export interface SignRequestCreateSigner {
14
  /**
15
   * Email address of the signer.
16
   * The email address of the signer is required when making signature requests, except when using templates that are configured to include emails. */
17
  readonly email?: string | null;
18
  /**
19
   * Defines the role of the signer in the signature request. A `signer`
20
   * must sign the document and an `approver` must approve the document. A
21
   * `final_copy_reader` only receives the final signed document and signing
22
   * log. */
23
  readonly role?: SignRequestCreateSignerRoleField;
24
  /**
25
   * Used in combination with an embed URL for a sender. After the
26
   * sender signs, they are redirected to the next `in_person` signer. */
27
  readonly isInPerson?: boolean;
28
  /**
29
   * Order of the signer */
30
  readonly order?: number;
31
  /**
32
   * User ID for the signer in an external application responsible
33
   * for authentication when accessing the embed URL. */
34
  readonly embedUrlExternalUserId?: string | null;
35
  /**
36
   * The URL that a signer will be redirected
37
   * to after signing a document. Defining this URL
38
   * overrides default or global redirect URL
39
   * settings for a specific signer.
40
   * If no declined redirect URL is specified,
41
   * this URL will be used for decline actions as well. */
42
  readonly redirectUrl?: string | null;
43
  /**
44
   * The URL that a signer will be redirect
45
   * to after declining to sign a document.
46
   * Defining this URL overrides default or global
47
   * declined redirect URL settings for a specific signer. */
48
  readonly declinedRedirectUrl?: string | null;
49
  /**
50
   * If set to true, the signer will need to log in to a Box account
51
   * before signing the request. If the signer does not have
52
   * an existing account, they will have the option to create
53
   * a free Box account. */
54
  readonly loginRequired?: boolean | null;
55
  /**
56
   * If set, the signer is required to enter the password before they are able
57
   * to sign a document. This field is write only. */
58
  readonly password?: string | null;
59
  /**
60
   * If set, signers who have the same value will be assigned to the same input and to the same signer group.
61
   * A signer group is not a Box Group. It is an entity that belongs to a Sign Request and can only be
62
   * used/accessed within this Sign Request. A signer group is expected to have more than one signer.
63
   * If the provided value is only used for one signer, this value will be ignored and request will be handled
64
   * as it was intended for an individual signer. The value provided can be any string and only used to
65
   * determine which signers belongs to same group. A successful response will provide a generated UUID value
66
   * instead for signers in the same signer group. */
67
  readonly signerGroupId?: string | null;
68
  /**
69
   * If true, no emails about the sign request will be sent */
70
  readonly suppressNotifications?: boolean | null;
71
  readonly rawData?: SerializedData;
72
}
73
export function serializeSignRequestCreateSignerRoleField(
140✔
74
  val: SignRequestCreateSignerRoleField,
75
): SerializedData {
76
  return val;
2✔
77
}
78
export function deserializeSignRequestCreateSignerRoleField(
140✔
79
  val: SerializedData,
80
): SignRequestCreateSignerRoleField {
81
  if (val == 'signer') {
24✔
82
    return val;
13✔
83
  }
84
  if (val == 'approver') {
11!
85
    return val;
×
86
  }
87
  if (val == 'final_copy_reader') {
11✔
88
    return val;
11✔
89
  }
90
  throw new BoxSdkError({
×
91
    message: "Can't deserialize SignRequestCreateSignerRoleField",
92
  });
93
}
94
export function serializeSignRequestCreateSigner(
140✔
95
  val: SignRequestCreateSigner,
96
): SerializedData {
97
  return {
6✔
98
    ['email']: val.email,
99
    ['role']:
100
      val.role == void 0
6✔
101
        ? val.role
102
        : serializeSignRequestCreateSignerRoleField(val.role),
103
    ['is_in_person']: val.isInPerson,
104
    ['order']: val.order,
105
    ['embed_url_external_user_id']: val.embedUrlExternalUserId,
106
    ['redirect_url']: val.redirectUrl,
107
    ['declined_redirect_url']: val.declinedRedirectUrl,
108
    ['login_required']: val.loginRequired,
109
    ['password']: val.password,
110
    ['signer_group_id']: val.signerGroupId,
111
    ['suppress_notifications']: val.suppressNotifications,
112
  };
113
}
114
export function deserializeSignRequestCreateSigner(
140✔
115
  val: SerializedData,
116
): SignRequestCreateSigner {
117
  if (!sdIsMap(val)) {
×
118
    throw new BoxSdkError({
×
119
      message: 'Expecting a map for "SignRequestCreateSigner"',
120
    });
121
  }
122
  if (!(val.email == void 0) && !sdIsString(val.email)) {
×
123
    throw new BoxSdkError({
×
124
      message: 'Expecting string for "email" of type "SignRequestCreateSigner"',
125
    });
126
  }
127
  const email: undefined | string = val.email == void 0 ? void 0 : val.email;
×
128
  const role: undefined | SignRequestCreateSignerRoleField =
129
    val.role == void 0
×
130
      ? void 0
131
      : deserializeSignRequestCreateSignerRoleField(val.role);
132
  if (!(val.is_in_person == void 0) && !sdIsBoolean(val.is_in_person)) {
×
133
    throw new BoxSdkError({
×
134
      message:
135
        'Expecting boolean for "is_in_person" of type "SignRequestCreateSigner"',
136
    });
137
  }
138
  const isInPerson: undefined | boolean =
139
    val.is_in_person == void 0 ? void 0 : val.is_in_person;
×
140
  if (!(val.order == void 0) && !sdIsNumber(val.order)) {
×
141
    throw new BoxSdkError({
×
142
      message: 'Expecting number for "order" of type "SignRequestCreateSigner"',
143
    });
144
  }
145
  const order: undefined | number = val.order == void 0 ? void 0 : val.order;
×
146
  if (
×
147
    !(val.embed_url_external_user_id == void 0) &&
×
148
    !sdIsString(val.embed_url_external_user_id)
149
  ) {
150
    throw new BoxSdkError({
×
151
      message:
152
        'Expecting string for "embed_url_external_user_id" of type "SignRequestCreateSigner"',
153
    });
154
  }
155
  const embedUrlExternalUserId: undefined | string =
156
    val.embed_url_external_user_id == void 0
×
157
      ? void 0
158
      : val.embed_url_external_user_id;
159
  if (!(val.redirect_url == void 0) && !sdIsString(val.redirect_url)) {
×
160
    throw new BoxSdkError({
×
161
      message:
162
        'Expecting string for "redirect_url" of type "SignRequestCreateSigner"',
163
    });
164
  }
165
  const redirectUrl: undefined | string =
166
    val.redirect_url == void 0 ? void 0 : val.redirect_url;
×
167
  if (
×
168
    !(val.declined_redirect_url == void 0) &&
×
169
    !sdIsString(val.declined_redirect_url)
170
  ) {
171
    throw new BoxSdkError({
×
172
      message:
173
        'Expecting string for "declined_redirect_url" of type "SignRequestCreateSigner"',
174
    });
175
  }
176
  const declinedRedirectUrl: undefined | string =
177
    val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url;
×
178
  if (!(val.login_required == void 0) && !sdIsBoolean(val.login_required)) {
×
179
    throw new BoxSdkError({
×
180
      message:
181
        'Expecting boolean for "login_required" of type "SignRequestCreateSigner"',
182
    });
183
  }
184
  const loginRequired: undefined | boolean =
185
    val.login_required == void 0 ? void 0 : val.login_required;
×
186
  if (!(val.password == void 0) && !sdIsString(val.password)) {
×
UNCOV
187
    throw new BoxSdkError({
×
188
      message:
189
        'Expecting string for "password" of type "SignRequestCreateSigner"',
190
    });
191
  }
192
  const password: undefined | string =
193
    val.password == void 0 ? void 0 : val.password;
×
194
  if (!(val.signer_group_id == void 0) && !sdIsString(val.signer_group_id)) {
×
195
    throw new BoxSdkError({
×
196
      message:
197
        'Expecting string for "signer_group_id" of type "SignRequestCreateSigner"',
198
    });
199
  }
200
  const signerGroupId: undefined | string =
201
    val.signer_group_id == void 0 ? void 0 : val.signer_group_id;
×
202
  if (
×
203
    !(val.suppress_notifications == void 0) &&
×
204
    !sdIsBoolean(val.suppress_notifications)
205
  ) {
206
    throw new BoxSdkError({
×
207
      message:
208
        'Expecting boolean for "suppress_notifications" of type "SignRequestCreateSigner"',
209
    });
210
  }
211
  const suppressNotifications: undefined | boolean =
212
    val.suppress_notifications == void 0 ? void 0 : val.suppress_notifications;
×
213
  return {
×
214
    email: email,
215
    role: role,
216
    isInPerson: isInPerson,
217
    order: order,
218
    embedUrlExternalUserId: embedUrlExternalUserId,
219
    redirectUrl: redirectUrl,
220
    declinedRedirectUrl: declinedRedirectUrl,
221
    loginRequired: loginRequired,
222
    password: password,
223
    signerGroupId: signerGroupId,
224
    suppressNotifications: suppressNotifications,
225
  } satisfies SignRequestCreateSigner;
226
}
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