@unito/integration-api 6.0.0 → 7.0.1
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/dist/schemas/definitions.json +1 -0
- package/dist/schemas/referenceRelation.json +2 -3
- package/dist/src/guards.js +1 -0
- package/dist/src/index.cjs +12 -0
- package/dist/src/types.d.ts +28 -5
- package/dist/src/types.js +11 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"title": "Relation",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"additionalProperties": false,
|
|
6
|
-
"required": ["path", "schema", "label"],
|
|
6
|
+
"required": ["path", "schema", "label", "name"],
|
|
7
7
|
"properties": {
|
|
8
8
|
"path": {
|
|
9
9
|
"type": "string",
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"type": "string",
|
|
26
26
|
"pattern": "^[a-zA-Z0-9_-]*$",
|
|
27
27
|
"minLength": 1,
|
|
28
|
-
"maxLength": 100
|
|
29
|
-
"deprecated": true
|
|
28
|
+
"maxLength": 100
|
|
30
29
|
},
|
|
31
30
|
"schema": {
|
|
32
31
|
"oneOf": [
|
package/dist/src/guards.js
CHANGED
|
@@ -53,6 +53,7 @@ export function isItem(potentialItem) {
|
|
|
53
53
|
*/
|
|
54
54
|
export function isReferenceRelation(potentialReferenceRelation) {
|
|
55
55
|
return (isObject(potentialReferenceRelation) &&
|
|
56
|
+
isString(potentialReferenceRelation['name']) &&
|
|
56
57
|
isString(potentialReferenceRelation['path']) &&
|
|
57
58
|
isString(potentialReferenceRelation['label']) &&
|
|
58
59
|
isRelationSchemaOrSelf(potentialReferenceRelation['schema']));
|
package/dist/src/index.cjs
CHANGED
|
@@ -32,6 +32,17 @@ const Semantics = {
|
|
|
32
32
|
CREATED_AT: 'createdAt',
|
|
33
33
|
DESCRIPTION: 'description',
|
|
34
34
|
DISPLAY_NAME: 'displayName',
|
|
35
|
+
/**
|
|
36
|
+
* Indicates whether an item is publicly visible.
|
|
37
|
+
* For example, a comment marked as public is visible to external users.
|
|
38
|
+
*
|
|
39
|
+
* Expected field value to be of type FieldValueType.BOOLEAN.
|
|
40
|
+
* `true` means the item is public, `false` means it is private/internal.
|
|
41
|
+
*
|
|
42
|
+
* Integrations should map their provider's visibility field directly — e.g.,
|
|
43
|
+
* a Salesforce field named `Public` maps to `IS_PUBLIC` with the same polarity.
|
|
44
|
+
*/
|
|
45
|
+
IS_PUBLIC: 'isPublic',
|
|
35
46
|
PROVIDER_URL: 'providerUrl',
|
|
36
47
|
UPDATED_AT: 'updatedAt',
|
|
37
48
|
USER: 'user',
|
|
@@ -159,6 +170,7 @@ function isItem(potentialItem) {
|
|
|
159
170
|
*/
|
|
160
171
|
function isReferenceRelation(potentialReferenceRelation) {
|
|
161
172
|
return (isObject(potentialReferenceRelation) &&
|
|
173
|
+
isString(potentialReferenceRelation['name']) &&
|
|
162
174
|
isString(potentialReferenceRelation['path']) &&
|
|
163
175
|
isString(potentialReferenceRelation['label']) &&
|
|
164
176
|
isRelationSchemaOrSelf(potentialReferenceRelation['schema']));
|
package/dist/src/types.d.ts
CHANGED
|
@@ -124,11 +124,15 @@ interface DisplayNameFieldSchema extends AbstractFieldSchema {
|
|
|
124
124
|
semantic: typeof Semantics.DISPLAY_NAME;
|
|
125
125
|
type: typeof FieldValueTypes.STRING | typeof FieldValueTypes.EMAIL;
|
|
126
126
|
}
|
|
127
|
+
interface IsPublicFieldSchema extends AbstractFieldSchema {
|
|
128
|
+
semantic: typeof Semantics.IS_PUBLIC;
|
|
129
|
+
type: typeof FieldValueTypes.BOOLEAN;
|
|
130
|
+
}
|
|
127
131
|
interface UnconstrainedBasicFieldSchema extends AbstractFieldSchema {
|
|
128
132
|
semantic?: never;
|
|
129
133
|
type: BasicFieldValueType;
|
|
130
134
|
}
|
|
131
|
-
export type BasicFieldSchema = ProviderUrlFieldSchema | CreatedAtFieldSchema | UpdatedAtFieldSchema | DescriptionFieldSchema | DisplayNameFieldSchema | UnconstrainedBasicFieldSchema;
|
|
135
|
+
export type BasicFieldSchema = ProviderUrlFieldSchema | CreatedAtFieldSchema | UpdatedAtFieldSchema | DescriptionFieldSchema | DisplayNameFieldSchema | IsPublicFieldSchema | UnconstrainedBasicFieldSchema;
|
|
132
136
|
export interface BlobFieldSchema extends AbstractFieldSchema {
|
|
133
137
|
/**
|
|
134
138
|
* The type of the field.
|
|
@@ -176,10 +180,9 @@ export interface ReferenceRelation {
|
|
|
176
180
|
*/
|
|
177
181
|
semantic?: RelationSemantic;
|
|
178
182
|
/**
|
|
179
|
-
* The
|
|
180
|
-
* @deprecated Will be removed in a future version.
|
|
183
|
+
* The main identifier of the reference relation.
|
|
181
184
|
*/
|
|
182
|
-
name
|
|
185
|
+
name: string;
|
|
183
186
|
/**
|
|
184
187
|
* The shape of the relation.
|
|
185
188
|
*/
|
|
@@ -264,6 +267,17 @@ export declare const Semantics: {
|
|
|
264
267
|
readonly CREATED_AT: "createdAt";
|
|
265
268
|
readonly DESCRIPTION: "description";
|
|
266
269
|
readonly DISPLAY_NAME: "displayName";
|
|
270
|
+
/**
|
|
271
|
+
* Indicates whether an item is publicly visible.
|
|
272
|
+
* For example, a comment marked as public is visible to external users.
|
|
273
|
+
*
|
|
274
|
+
* Expected field value to be of type FieldValueType.BOOLEAN.
|
|
275
|
+
* `true` means the item is public, `false` means it is private/internal.
|
|
276
|
+
*
|
|
277
|
+
* Integrations should map their provider's visibility field directly — e.g.,
|
|
278
|
+
* a Salesforce field named `Public` maps to `IS_PUBLIC` with the same polarity.
|
|
279
|
+
*/
|
|
280
|
+
readonly IS_PUBLIC: "isPublic";
|
|
267
281
|
readonly PROVIDER_URL: "providerUrl";
|
|
268
282
|
readonly UPDATED_AT: "updatedAt";
|
|
269
283
|
readonly USER: "user";
|
|
@@ -608,7 +622,16 @@ export interface WebhookParsedItem {
|
|
|
608
622
|
}
|
|
609
623
|
export interface WebhookItem {
|
|
610
624
|
/**
|
|
611
|
-
* The canonical path of the parent item
|
|
625
|
+
* The canonical path of the parent item for this webhook event.
|
|
626
|
+
*
|
|
627
|
+
* Used as a fallback when the item's canonicalPath is not yet known to the platform
|
|
628
|
+
* (e.g., newly created items). In that case, sync-platform enqueues a sync job for
|
|
629
|
+
* the parent, which will discover the new child item during its scan.
|
|
630
|
+
*
|
|
631
|
+
* - If the exact parent is unknown without an extra API call, setting a grandparent
|
|
632
|
+
* (e.g., a sheet or project) is acceptable — it triggers a broader scan that will
|
|
633
|
+
* still pick up the new item.
|
|
634
|
+
* - If undefined and the item is not found, the webhook event is skipped entirely.
|
|
612
635
|
*/
|
|
613
636
|
parentCanonicalPath?: string;
|
|
614
637
|
/**
|
package/dist/src/types.js
CHANGED
|
@@ -30,6 +30,17 @@ export const Semantics = {
|
|
|
30
30
|
CREATED_AT: 'createdAt',
|
|
31
31
|
DESCRIPTION: 'description',
|
|
32
32
|
DISPLAY_NAME: 'displayName',
|
|
33
|
+
/**
|
|
34
|
+
* Indicates whether an item is publicly visible.
|
|
35
|
+
* For example, a comment marked as public is visible to external users.
|
|
36
|
+
*
|
|
37
|
+
* Expected field value to be of type FieldValueType.BOOLEAN.
|
|
38
|
+
* `true` means the item is public, `false` means it is private/internal.
|
|
39
|
+
*
|
|
40
|
+
* Integrations should map their provider's visibility field directly — e.g.,
|
|
41
|
+
* a Salesforce field named `Public` maps to `IS_PUBLIC` with the same polarity.
|
|
42
|
+
*/
|
|
43
|
+
IS_PUBLIC: 'isPublic',
|
|
33
44
|
PROVIDER_URL: 'providerUrl',
|
|
34
45
|
UPDATED_AT: 'updatedAt',
|
|
35
46
|
USER: 'user',
|