@unito/integration-api 8.0.5 → 8.0.7

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.
@@ -0,0 +1,58 @@
1
+ {
2
+ "$id": "https://unito.io/integration_api/createItemResponsePayload.schema.json",
3
+ "title": "CreateItemResponsePayload",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["path", "canonicalPath"],
7
+ "properties": {
8
+ "path": {
9
+ "type": "string",
10
+ "format": "uri-reference",
11
+ "pattern": "^\/.*$"
12
+ },
13
+ "fields": {
14
+ "type": "object",
15
+ "additionalProperties": true
16
+ },
17
+ "relations": {
18
+ "type": "object",
19
+ "additionalProperties": {
20
+ "type": "string",
21
+ "format": "uri-reference",
22
+ "pattern": "^\/.*$"
23
+ }
24
+ },
25
+ "requestSchema": {
26
+ "$ref": "https://unito.io/integration_api/requestSchema.schema.json"
27
+ },
28
+ "canonicalPath": {
29
+ "type": "string"
30
+ },
31
+ "errors": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["source", "code", "message"],
37
+ "properties": {
38
+ "source": {
39
+ "type": "string"
40
+ },
41
+ "code": {
42
+ "type": "string"
43
+ },
44
+ "message": {
45
+ "type": "string"
46
+ },
47
+ "details": {
48
+ "type": "object",
49
+ "additionalProperties": true
50
+ },
51
+ "originalError": {
52
+ "$ref": "https://unito.io/integration_api/error.schema.json"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$id": "https://unito.io/integration_api/updateItemResponsePayload.schema.json",
3
+ "title": "UpdateItemResponsePayload",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["fields", "relations", "canonicalPath"],
7
+ "properties": {
8
+ "fields": {
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ },
12
+ "relations": {
13
+ "type": "array",
14
+ "items": {
15
+ "$ref": "https://unito.io/integration_api/relation.schema.json"
16
+ }
17
+ },
18
+ "canonicalPath": {
19
+ "type": "string"
20
+ },
21
+ "errors": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["source", "code", "message"],
27
+ "properties": {
28
+ "source": {
29
+ "type": "string"
30
+ },
31
+ "code": {
32
+ "type": "string"
33
+ },
34
+ "message": {
35
+ "type": "string"
36
+ },
37
+ "details": {
38
+ "type": "object",
39
+ "additionalProperties": true
40
+ },
41
+ "originalError": {
42
+ "$ref": "https://unito.io/integration_api/error.schema.json"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
@@ -405,9 +405,9 @@ export declare const fieldTypeCompatibilityMatrix: {
405
405
  readonly object: null;
406
406
  readonly reference: null;
407
407
  readonly richText: {};
408
- readonly html: null;
409
- readonly markdown: null;
410
- readonly string: null;
408
+ readonly html: {};
409
+ readonly markdown: {};
410
+ readonly string: {};
411
411
  readonly url: null;
412
412
  };
413
413
  readonly html: {
@@ -423,7 +423,7 @@ export declare const fieldTypeCompatibilityMatrix: {
423
423
  readonly number: null;
424
424
  readonly object: null;
425
425
  readonly reference: null;
426
- readonly richText: null;
426
+ readonly richText: {};
427
427
  readonly html: {
428
428
  readonly decoratorTemplate: {
429
429
  readonly type: "stringWithSourceItemFields";
@@ -492,7 +492,7 @@ export declare const fieldTypeCompatibilityMatrix: {
492
492
  readonly number: null;
493
493
  readonly object: null;
494
494
  readonly reference: null;
495
- readonly richText: null;
495
+ readonly richText: {};
496
496
  readonly html: {
497
497
  readonly decoratorTemplate: {
498
498
  readonly type: "stringWithSourceItemFields";
@@ -570,7 +570,7 @@ export declare const fieldTypeCompatibilityMatrix: {
570
570
  readonly required: true;
571
571
  };
572
572
  };
573
- readonly richText: null;
573
+ readonly richText: {};
574
574
  readonly html: {};
575
575
  readonly markdown: {};
576
576
  readonly string: {};
@@ -347,9 +347,9 @@ export const fieldTypeCompatibilityMatrix = {
347
347
  [Api.FieldValueTypes.OBJECT]: null,
348
348
  [Api.FieldValueTypes.REFERENCE]: null,
349
349
  [Api.FieldValueTypes.RICH_TEXT]: {},
350
- [Api.FieldValueTypes.RICH_TEXT_HTML]: null,
351
- [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
352
- [Api.FieldValueTypes.STRING]: null,
350
+ [Api.FieldValueTypes.RICH_TEXT_HTML]: {},
351
+ [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
352
+ [Api.FieldValueTypes.STRING]: {},
353
353
  [Api.FieldValueTypes.URL]: null,
354
354
  },
355
355
  [Api.FieldValueTypes.RICH_TEXT_HTML]: {
@@ -365,7 +365,7 @@ export const fieldTypeCompatibilityMatrix = {
365
365
  [Api.FieldValueTypes.NUMBER]: null,
366
366
  [Api.FieldValueTypes.OBJECT]: null,
367
367
  [Api.FieldValueTypes.REFERENCE]: null,
368
- [Api.FieldValueTypes.RICH_TEXT]: null,
368
+ [Api.FieldValueTypes.RICH_TEXT]: {},
369
369
  [Api.FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
370
370
  [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
371
371
  [Api.FieldValueTypes.STRING]: {},
@@ -384,7 +384,7 @@ export const fieldTypeCompatibilityMatrix = {
384
384
  [Api.FieldValueTypes.NUMBER]: null,
385
385
  [Api.FieldValueTypes.OBJECT]: null,
386
386
  [Api.FieldValueTypes.REFERENCE]: null,
387
- [Api.FieldValueTypes.RICH_TEXT]: null,
387
+ [Api.FieldValueTypes.RICH_TEXT]: {},
388
388
  [Api.FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
389
389
  [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
390
390
  [Api.FieldValueTypes.STRING]: {},
@@ -403,7 +403,7 @@ export const fieldTypeCompatibilityMatrix = {
403
403
  [Api.FieldValueTypes.NUMBER]: {},
404
404
  [Api.FieldValueTypes.OBJECT]: null,
405
405
  [Api.FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
406
- [Api.FieldValueTypes.RICH_TEXT]: null,
406
+ [Api.FieldValueTypes.RICH_TEXT]: {},
407
407
  [Api.FieldValueTypes.RICH_TEXT_HTML]: {},
408
408
  [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
409
409
  [Api.FieldValueTypes.STRING]: {},
@@ -626,9 +626,9 @@ const fieldTypeCompatibilityMatrix = {
626
626
  [FieldValueTypes.OBJECT]: null,
627
627
  [FieldValueTypes.REFERENCE]: null,
628
628
  [FieldValueTypes.RICH_TEXT]: {},
629
- [FieldValueTypes.RICH_TEXT_HTML]: null,
630
- [FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
631
- [FieldValueTypes.STRING]: null,
629
+ [FieldValueTypes.RICH_TEXT_HTML]: {},
630
+ [FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
631
+ [FieldValueTypes.STRING]: {},
632
632
  [FieldValueTypes.URL]: null,
633
633
  },
634
634
  [FieldValueTypes.RICH_TEXT_HTML]: {
@@ -644,7 +644,7 @@ const fieldTypeCompatibilityMatrix = {
644
644
  [FieldValueTypes.NUMBER]: null,
645
645
  [FieldValueTypes.OBJECT]: null,
646
646
  [FieldValueTypes.REFERENCE]: null,
647
- [FieldValueTypes.RICH_TEXT]: null,
647
+ [FieldValueTypes.RICH_TEXT]: {},
648
648
  [FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
649
649
  [FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
650
650
  [FieldValueTypes.STRING]: {},
@@ -663,7 +663,7 @@ const fieldTypeCompatibilityMatrix = {
663
663
  [FieldValueTypes.NUMBER]: null,
664
664
  [FieldValueTypes.OBJECT]: null,
665
665
  [FieldValueTypes.REFERENCE]: null,
666
- [FieldValueTypes.RICH_TEXT]: null,
666
+ [FieldValueTypes.RICH_TEXT]: {},
667
667
  [FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
668
668
  [FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
669
669
  [FieldValueTypes.STRING]: {},
@@ -682,7 +682,7 @@ const fieldTypeCompatibilityMatrix = {
682
682
  [FieldValueTypes.NUMBER]: {},
683
683
  [FieldValueTypes.OBJECT]: null,
684
684
  [FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
685
- [FieldValueTypes.RICH_TEXT]: null,
685
+ [FieldValueTypes.RICH_TEXT]: {},
686
686
  [FieldValueTypes.RICH_TEXT_HTML]: {},
687
687
  [FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
688
688
  [FieldValueTypes.STRING]: {},
@@ -476,15 +476,15 @@ export interface RelationSchema {
476
476
  /**
477
477
  * Can we create items?
478
478
  */
479
- canCreateItem?: boolean;
479
+ canCreateItem: boolean;
480
480
  /**
481
481
  * Can we update items?
482
482
  */
483
- canUpdateItem?: boolean;
483
+ canUpdateItem: boolean;
484
484
  /**
485
485
  * Can we delete items?
486
486
  */
487
- canDeleteItem?: boolean;
487
+ canDeleteItem: boolean;
488
488
  /**
489
489
  * Can we add fields to the schema?
490
490
  * Defaults to false.
@@ -536,6 +536,31 @@ export type UpdateItemRequestPayload = CreateItemRequestPayload & {
536
536
  };
537
537
  };
538
538
  };
539
+ /**
540
+ * Describes a field the integration accepted in the request body but did not send to,
541
+ * or that was not successfully accepted by, the provider. Reported alongside a 2xx
542
+ * response so the caller knows the resource was created/updated but the listed
543
+ * locations were dropped.
544
+ */
545
+ export type FieldError = Error & {
546
+ /**
547
+ * JSONPath query (dot/bracket notation) locating the problematic field on the request body.
548
+ * e.g. "name", "customFields.priority", "tags[0]"
549
+ */
550
+ source: string;
551
+ };
552
+ /**
553
+ * A CreateItemResponsePayload describes the shape of a response from an item creation endpoint.
554
+ */
555
+ export type CreateItemResponsePayload<T extends RelationSchema | undefined = undefined> = ItemSummary<T> & {
556
+ errors?: FieldError[];
557
+ };
558
+ /**
559
+ * An UpdateItemResponsePayload describes the shape of a response from an item update endpoint.
560
+ */
561
+ export type UpdateItemResponsePayload<T extends RelationSchema | undefined = undefined> = Item<T> & {
562
+ errors?: FieldError[];
563
+ };
539
564
  /**
540
565
  * A Request Schema describes how a path should be accessed.
541
566
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-api",
3
- "version": "8.0.5",
3
+ "version": "8.0.7",
4
4
  "description": "The Unito Integration API",
5
5
  "type": "module",
6
6
  "types": "./dist/src/index.d.ts",