@unito/integration-api 8.0.6 → 8.0.8

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
+ }
@@ -407,7 +407,7 @@ export declare const fieldTypeCompatibilityMatrix: {
407
407
  readonly richText: {};
408
408
  readonly html: {};
409
409
  readonly markdown: {};
410
- readonly string: null;
410
+ readonly string: {};
411
411
  readonly url: null;
412
412
  };
413
413
  readonly html: {
@@ -349,7 +349,7 @@ export const fieldTypeCompatibilityMatrix = {
349
349
  [Api.FieldValueTypes.RICH_TEXT]: {},
350
350
  [Api.FieldValueTypes.RICH_TEXT_HTML]: {},
351
351
  [Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
352
- [Api.FieldValueTypes.STRING]: null,
352
+ [Api.FieldValueTypes.STRING]: {},
353
353
  [Api.FieldValueTypes.URL]: null,
354
354
  },
355
355
  [Api.FieldValueTypes.RICH_TEXT_HTML]: {
@@ -102,9 +102,6 @@ const StatusCodes = {
102
102
  */
103
103
  const RelationSchemaDefaultValues = {
104
104
  CAN_READ_ITEM: true,
105
- CAN_CREATE_ITEM: true,
106
- CAN_UPDATE_ITEM: true,
107
- CAN_DELETE_ITEM: false,
108
105
  CAN_ADD_FIELDS: false,
109
106
  };
110
107
  /**
@@ -628,7 +625,7 @@ const fieldTypeCompatibilityMatrix = {
628
625
  [FieldValueTypes.RICH_TEXT]: {},
629
626
  [FieldValueTypes.RICH_TEXT_HTML]: {},
630
627
  [FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
631
- [FieldValueTypes.STRING]: null,
628
+ [FieldValueTypes.STRING]: {},
632
629
  [FieldValueTypes.URL]: null,
633
630
  },
634
631
  [FieldValueTypes.RICH_TEXT_HTML]: {
@@ -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
  */
@@ -691,9 +716,6 @@ export type WebhookParseResponsePayload = WebhookParsedItem | WebhookItem | (Web
691
716
  */
692
717
  export declare const RelationSchemaDefaultValues: {
693
718
  readonly CAN_READ_ITEM: true;
694
- readonly CAN_CREATE_ITEM: true;
695
- readonly CAN_UPDATE_ITEM: true;
696
- readonly CAN_DELETE_ITEM: false;
697
719
  readonly CAN_ADD_FIELDS: false;
698
720
  };
699
721
  /**
package/dist/src/types.js CHANGED
@@ -100,9 +100,6 @@ export const StatusCodes = {
100
100
  */
101
101
  export const RelationSchemaDefaultValues = {
102
102
  CAN_READ_ITEM: true,
103
- CAN_CREATE_ITEM: true,
104
- CAN_UPDATE_ITEM: true,
105
- CAN_DELETE_ITEM: false,
106
103
  CAN_ADD_FIELDS: false,
107
104
  };
108
105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-api",
3
- "version": "8.0.6",
3
+ "version": "8.0.8",
4
4
  "description": "The Unito Integration API",
5
5
  "type": "module",
6
6
  "types": "./dist/src/index.d.ts",