@outseta/api-client 0.4.7 → 0.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import type {
3
+ AddDefinitionRequest,
3
4
  Definition,
4
5
  DefinitionGetAllDefinitions200,
5
6
  DefinitionGetAllDefinitionsParams,
@@ -7,7 +8,9 @@ import type {
7
8
  TagAddTagBody,
8
9
  TagGetAllTags200,
9
10
  TagGetAllTagsParams,
10
- TagUpdateTagBody
11
+ TagUpdateTagBody,
12
+ UpdateDefinitionRequest,
13
+ ValidationError
11
14
  } from '.././models';
12
15
 
13
16
  import { customFetch } from '../../client';
@@ -368,8 +371,84 @@ export const definitionGetAllDefinitions = async (entityType: string | null,
368
371
 
369
372
 
370
373
  /**
371
- * The entityType segment of the URL must match the type the definition belongs to
372
- (e.g. Account, Person, Deal).
374
+ * Adds the definition of a custom property: its label, its system name and the control
375
+ used to fill it in. Only Account, Person and Deal have custom properties; any other
376
+ entityType returns 404. Once added, the property's values are read and written under
377
+ its SystemName on the accounts, people or deals themselves.
378
+
379
+ - **Label** (required): the name shown in Outseta. It must be unique among the entity
380
+ type's custom properties and must not be the label of a standard property (for
381
+ example Email on a person).
382
+ - **SystemName**: the property's name in the API, webhooks and forms. It must start
383
+ with a letter, contain only letters, numbers and _, be unique for the entity type and
384
+ not be the name of a standard property. When left out it is derived from Label the way
385
+ the Outseta app does: Label "Favorite color" gives FavoriteColor.
386
+ - **ControlType**: one of Text, TextArea, Number, Date, Checkbox, Select, RadioList,
387
+ CheckboxList. Defaults to Text. Select is a dropdown with one choice, RadioList shows
388
+ the same choice as radio buttons, CheckboxList allows several choices, and Checkbox is
389
+ a single yes/no whose value is True or False.
390
+ - **ControlParams**: the control's settings as a JSON object serialized into a string,
391
+ not a nested object. Select, RadioList and CheckboxList need at least one option:
392
+ "{\"Options\":[\"Small\",\"Medium\",\"Large\"]}". Number may set a Step
393
+ ("{\"Step\":0.01}"); Text may set HintText and a Pattern (a regular expression the value
394
+ must match). Other controls need no ControlParams.
395
+
396
+ EntityType comes from the URL; a Uid or EntityType in the request body is ignored.
397
+ * @summary Add a custom property to accounts, people or deals.
398
+ */
399
+ export type definitionAddDefinitionResponse200 = {
400
+ data: Definition
401
+ status: 200
402
+ }
403
+
404
+ export type definitionAddDefinitionResponse400 = {
405
+ data: ValidationError
406
+ status: 400
407
+ }
408
+
409
+ export type definitionAddDefinitionResponse401 = {
410
+ data: void
411
+ status: 401
412
+ }
413
+
414
+ export type definitionAddDefinitionResponse404 = {
415
+ data: void
416
+ status: 404
417
+ }
418
+
419
+ export type definitionAddDefinitionResponseSuccess = (definitionAddDefinitionResponse200) & {
420
+ headers: Headers;
421
+ };
422
+ export type definitionAddDefinitionResponseError = (definitionAddDefinitionResponse400 | definitionAddDefinitionResponse401 | definitionAddDefinitionResponse404) & {
423
+ headers: Headers;
424
+ };
425
+
426
+ export type definitionAddDefinitionResponse = (definitionAddDefinitionResponseSuccess | definitionAddDefinitionResponseError)
427
+
428
+ export const getDefinitionAddDefinitionUrl = (entityType: string | null,) => {
429
+
430
+
431
+
432
+
433
+ return `/api/v1/attributes/${entityType}/definitions`
434
+ }
435
+
436
+ export const definitionAddDefinition = async (entityType: string | null,
437
+ addDefinitionRequest: AddDefinitionRequest, options?: RequestInit): Promise<definitionAddDefinitionResponse> => {
438
+
439
+ return customFetch<definitionAddDefinitionResponse>(getDefinitionAddDefinitionUrl(entityType),
440
+ {
441
+ ...options,
442
+ method: 'POST',
443
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
444
+ body: JSON.stringify(
445
+ addDefinitionRequest,)
446
+ }
447
+ );}
448
+
449
+
450
+ /**
451
+ * Use the entity type the definition belongs to (Account, Person or Deal) in the URL.
373
452
  * @summary Retrieve a custom attribute definition.
374
453
  */
375
454
  export type definitionGetDefinitionResponse200 = {
@@ -396,17 +475,19 @@ export type definitionGetDefinitionResponseError = (definitionGetDefinitionRespo
396
475
 
397
476
  export type definitionGetDefinitionResponse = (definitionGetDefinitionResponseSuccess | definitionGetDefinitionResponseError)
398
477
 
399
- export const getDefinitionGetDefinitionUrl = (definitionUid: string | null,) => {
478
+ export const getDefinitionGetDefinitionUrl = (entityType: string | null,
479
+ definitionUid: string | null,) => {
400
480
 
401
481
 
402
482
 
403
483
 
404
- return `/api/v1/attributes/definitions/${definitionUid}`
484
+ return `/api/v1/attributes/${entityType}/definitions/${definitionUid}`
405
485
  }
406
486
 
407
- export const definitionGetDefinition = async (definitionUid: string | null, options?: RequestInit): Promise<definitionGetDefinitionResponse> => {
487
+ export const definitionGetDefinition = async (entityType: string | null,
488
+ definitionUid: string | null, options?: RequestInit): Promise<definitionGetDefinitionResponse> => {
408
489
 
409
- return customFetch<definitionGetDefinitionResponse>(getDefinitionGetDefinitionUrl(definitionUid),
490
+ return customFetch<definitionGetDefinitionResponse>(getDefinitionGetDefinitionUrl(entityType,definitionUid),
410
491
  {
411
492
  ...options,
412
493
  method: 'GET'
@@ -416,3 +497,73 @@ export const definitionGetDefinition = async (definitionUid: string | null, opti
416
497
  );}
417
498
 
418
499
 
500
+ /**
501
+ * Send only the fields to change: fields left out keep their current values. The rules
502
+ for Label, SystemName, ControlType and ControlParams are those of adding a definition.
503
+ The Uid and EntityType in the request body are ignored; the definition must belong to
504
+ the entityType in the URL, otherwise 404.
505
+
506
+ ControlParams is replaced as a whole. To add an option to a Select, RadioList or
507
+ CheckboxList, read the definition, add the option to its Options and send the full
508
+ list: "{\"Options\":[\"Small\",\"Medium\",\"Large\",\"X-Large\"]}". Values already
509
+ stored on accounts, people or deals are not changed when an option is renamed or
510
+ removed.
511
+
512
+ Changing SystemName keeps the stored values, which are returned under the new name
513
+ from then on. Anything that uses the old name (API clients, sign-up and profile forms,
514
+ segments, Zapier or other integrations) has to be updated to the new name.
515
+ * @summary Update a custom property of accounts, people or deals.
516
+ */
517
+ export type definitionUpdateDefinitionResponse200 = {
518
+ data: Definition
519
+ status: 200
520
+ }
521
+
522
+ export type definitionUpdateDefinitionResponse400 = {
523
+ data: ValidationError
524
+ status: 400
525
+ }
526
+
527
+ export type definitionUpdateDefinitionResponse401 = {
528
+ data: void
529
+ status: 401
530
+ }
531
+
532
+ export type definitionUpdateDefinitionResponse404 = {
533
+ data: void
534
+ status: 404
535
+ }
536
+
537
+ export type definitionUpdateDefinitionResponseSuccess = (definitionUpdateDefinitionResponse200) & {
538
+ headers: Headers;
539
+ };
540
+ export type definitionUpdateDefinitionResponseError = (definitionUpdateDefinitionResponse400 | definitionUpdateDefinitionResponse401 | definitionUpdateDefinitionResponse404) & {
541
+ headers: Headers;
542
+ };
543
+
544
+ export type definitionUpdateDefinitionResponse = (definitionUpdateDefinitionResponseSuccess | definitionUpdateDefinitionResponseError)
545
+
546
+ export const getDefinitionUpdateDefinitionUrl = (entityType: string | null,
547
+ definitionUid: string | null,) => {
548
+
549
+
550
+
551
+
552
+ return `/api/v1/attributes/${entityType}/definitions/${definitionUid}`
553
+ }
554
+
555
+ export const definitionUpdateDefinition = async (entityType: string | null,
556
+ definitionUid: string | null,
557
+ updateDefinitionRequest: UpdateDefinitionRequest, options?: RequestInit): Promise<definitionUpdateDefinitionResponse> => {
558
+
559
+ return customFetch<definitionUpdateDefinitionResponse>(getDefinitionUpdateDefinitionUrl(entityType,definitionUid),
560
+ {
561
+ ...options,
562
+ method: 'PUT',
563
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
564
+ body: JSON.stringify(
565
+ updateDefinitionRequest,)
566
+ }
567
+ );}
568
+
569
+
@@ -0,0 +1,36 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * A custom property to add to accounts, people or deals. Only Label is required.
5
+ */
6
+ export interface AddDefinitionRequest {
7
+ /**
8
+ * The name of the property shown in Outseta, for example "T-shirt size". Unique among the
9
+ entity type's custom properties, and not the label of a standard property.
10
+ * @minLength 1
11
+ */
12
+ Label: string;
13
+ /**
14
+ * The name of the property in the API, webhooks and forms, for example TShirtSize. Starts
15
+ with a letter and holds only letters, numbers and _. Unique for the entity type, and not
16
+ the name of a standard property. Derived from Label when left out.
17
+ * @nullable
18
+ * @pattern ^[A-Za-z][A-Za-z0-9_]*$
19
+ */
20
+ SystemName?: string | null;
21
+ /**
22
+ * The control used to fill in the property: Text (the default), TextArea, Number, Date,
23
+ Checkbox (True or False), Select (a dropdown with one choice), RadioList (one choice) or
24
+ CheckboxList (several choices).
25
+ * @nullable
26
+ */
27
+ ControlType?: string | null;
28
+ /**
29
+ * The control's settings: a JSON object serialized into a string, not a nested object.
30
+ Select, RadioList and CheckboxList need their options, for example
31
+ "{\"Options\":[\"Small\",\"Medium\",\"Large\"]}". Number may set a Step, for example
32
+ "{\"Step\":0.01}"; Text may set HintText and Pattern (a regular expression).
33
+ * @nullable
34
+ */
35
+ ControlParams?: string | null;
36
+ }
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ import type { EntityValidationErrorEntity } from './entityValidationErrorEntity';
3
+ import type { FieldValidationError } from './fieldValidationError';
4
+
5
+ export interface EntityValidationError {
6
+ /** @nullable */
7
+ Entity?: EntityValidationErrorEntity;
8
+ /** @nullable */
9
+ TypeName?: string | null;
10
+ /** @nullable */
11
+ ValidationErrors?: FieldValidationError[] | null;
12
+ }
@@ -0,0 +1,6 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * @nullable
5
+ */
6
+ export type EntityValidationErrorEntity = unknown | null;
@@ -0,0 +1,10 @@
1
+ // @ts-nocheck
2
+
3
+ export interface FieldValidationError {
4
+ /** @nullable */
5
+ ErrorCode?: string | null;
6
+ /** @nullable */
7
+ ErrorMessage?: string | null;
8
+ /** @nullable */
9
+ PropertyName?: string | null;
10
+ }
@@ -217,6 +217,7 @@ export * from './activityGetAllParams';
217
217
  export * from './activityNotification';
218
218
  export * from './activityNotificationAllOf';
219
219
  export * from './activityType';
220
+ export * from './addDefinitionRequest';
220
221
  export * from './addOn';
221
222
  export * from './addOnAllOf';
222
223
  export * from './addOnChangeType';
@@ -427,9 +428,12 @@ export * from './emailListSubscriberStatus';
427
428
  export * from './emailListUpdateEmailListBody';
428
429
  export * from './emailSubscriptionsPayload';
429
430
  export * from './entityType';
431
+ export * from './entityValidationError';
432
+ export * from './entityValidationErrorEntity';
430
433
  export * from './extendRenewalParams';
431
434
  export * from './extendSubscriptionOptions';
432
435
  export * from './extendTrialParams';
436
+ export * from './fieldValidationError';
433
437
  export * from './flatfileImportData';
434
438
  export * from './flatfileImportDataSchemalessData';
435
439
  export * from './importResult';
@@ -471,7 +475,9 @@ export * from './passwordPayload';
471
475
  export * from './pauseCollectionOptions';
472
476
  export * from './paymentInformation';
473
477
  export * from './paymentInformationAllOf';
478
+ export * from './paymentInformationCompleteRequest';
474
479
  export * from './paymentInformationSavePaymentInformationBody';
480
+ export * from './paymentInformationStateRequest';
475
481
  export * from './paymentsGatewayActivationStatus';
476
482
  export * from './paymentsMode';
477
483
  export * from './person';
@@ -852,11 +858,13 @@ export * from './twoFactorTotpEnrollmentPayload';
852
858
  export * from './twoFactorVerifyRequest';
853
859
  export * from './updateAccountMemberRoleModel';
854
860
  export * from './updateAccountMemberRoleModelRole';
861
+ export * from './updateDefinitionRequest';
855
862
  export * from './updateTemplateRequest';
856
863
  export * from './usage';
857
864
  export * from './usageAddUsageBody';
858
865
  export * from './usageAllOf';
859
866
  export * from './usageAllOfInvoice';
867
+ export * from './validationError';
860
868
  export * from './webflowCollection';
861
869
  export * from './webflowConfiguration';
862
870
  export * from './webflowConfigurationSyncConfiguration';
@@ -0,0 +1,10 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * Request body for POST /api/v1/billing/paymentinformation/complete: the client
5
+ secret of the Stripe intent the user confirmed.
6
+ */
7
+ export interface PaymentInformationCompleteRequest {
8
+ /** @nullable */
9
+ ClientSecret?: string | null;
10
+ }
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * Request body for POST /api/v1/billing/paymentinformation/state: the account
5
+ whose payment information is being updated, and the client secret of the Stripe
6
+ intent the user is about to confirm.
7
+ */
8
+ export interface PaymentInformationStateRequest {
9
+ /** @nullable */
10
+ AccountUid?: string | null;
11
+ /** @nullable */
12
+ ClientSecret?: string | null;
13
+ }
@@ -0,0 +1,28 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * The fields of a custom property that an update may change. Every field is optional:
5
+ a field left out keeps its current value.
6
+ */
7
+ export interface UpdateDefinitionRequest {
8
+ /** The name of the property shown in Outseta. Unique among the entity type's custom
9
+ properties, and not the label of a standard property. Cannot be null. */
10
+ Label?: string;
11
+ /**
12
+ * The name of the property in the API, webhooks and forms. Starts with a letter and holds
13
+ only letters, numbers and _. Changing it keeps the stored values under the new name;
14
+ anything that uses the old name has to be updated. Cannot be null.
15
+ * @pattern ^[A-Za-z][A-Za-z0-9_]*$
16
+ */
17
+ SystemName?: string;
18
+ /** The control used to fill in the property: Text, TextArea, Number, Date, Checkbox, Select,
19
+ RadioList or CheckboxList. Cannot be null. */
20
+ ControlType?: string;
21
+ /**
22
+ * The control's settings: a JSON object serialized into a string, replaced as a whole.
23
+ To add an option, send the full list, for example
24
+ "{\"Options\":[\"Small\",\"Medium\",\"Large\",\"X-Large\"]}".
25
+ * @nullable
26
+ */
27
+ ControlParams?: string | null;
28
+ }
@@ -0,0 +1,9 @@
1
+ // @ts-nocheck
2
+ import type { EntityValidationError } from './entityValidationError';
3
+
4
+ export interface ValidationError {
5
+ /** @nullable */
6
+ ErrorMessage?: string | null;
7
+ /** @nullable */
8
+ EntityValidationErrors?: EntityValidationError[] | null;
9
+ }