@unito/integration-api 1.0.4 → 3.0.0

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.
@@ -5,7 +5,7 @@
5
5
  * The type represents a unique scalar value such as a string or an integer.
6
6
  * For more complex types, use an Item instead.
7
7
  */
8
- const FieldValueType = {
8
+ const FieldValueTypes = {
9
9
  BLOB: 'blob',
10
10
  BOOLEAN: 'boolean',
11
11
  DATE: 'date',
@@ -28,7 +28,7 @@ const FieldValueType = {
28
28
  * An object with a specified semantic is expected to hold a certain type of value that can later be used
29
29
  * by the consumers of the spec to better understand what that value means.
30
30
  */
31
- const Semantic = {
31
+ const Semantics = {
32
32
  CREATED_AT: 'createdAt',
33
33
  DESCRIPTION: 'description',
34
34
  DISPLAY_NAME: 'displayName',
@@ -42,7 +42,7 @@ const Semantic = {
42
42
  * specified semantic is expected to hold a certain type of item that can later be used by
43
43
  * the consumers of the spec for specific usage.
44
44
  */
45
- const RelationSemantic = {
45
+ const RelationSemantics = {
46
46
  COMMENTS: 'comments',
47
47
  SUBTASKS: 'subtasks',
48
48
  USERS: 'users',
@@ -51,7 +51,7 @@ const RelationSemantic = {
51
51
  /**
52
52
  * An OperatorType represents an operator used in a filter.
53
53
  */
54
- const OperatorType = {
54
+ const OperatorTypes = {
55
55
  EQUAL: '=',
56
56
  NOT_EQUAL: '!=',
57
57
  GREATER_THAN: '>',
@@ -68,7 +68,7 @@ const OperatorType = {
68
68
  /**
69
69
  * HTTP code returned by the integration
70
70
  */
71
- const StatusCode = {
71
+ const StatusCodes = {
72
72
  OK: 200,
73
73
  CREATED: 201,
74
74
  ACCEPTED: 202,
@@ -85,8 +85,8 @@ const StatusCode = {
85
85
  INTERNAL_SERVER_ERROR: 500,
86
86
  };
87
87
 
88
- exports.FieldValueType = FieldValueType;
89
- exports.OperatorType = OperatorType;
90
- exports.RelationSemantic = RelationSemantic;
91
- exports.Semantic = Semantic;
92
- exports.StatusCode = StatusCode;
88
+ exports.FieldValueTypes = FieldValueTypes;
89
+ exports.OperatorTypes = OperatorTypes;
90
+ exports.RelationSemantics = RelationSemantics;
91
+ exports.Semantics = Semantics;
92
+ exports.StatusCodes = StatusCodes;
@@ -70,7 +70,7 @@ interface AbstractFieldSchema {
70
70
  /**
71
71
  * The semantic of the field.
72
72
  */
73
- semantic?: (typeof Semantic)[keyof typeof Semantic];
73
+ semantic?: Semantic;
74
74
  /**
75
75
  * Description of the field. For information purposes only.
76
76
  */
@@ -94,19 +94,19 @@ export interface BasicFieldSchema extends AbstractFieldSchema {
94
94
  /**
95
95
  * The type of the field.
96
96
  */
97
- type: Exclude<(typeof FieldValueType)[keyof typeof FieldValueType], typeof FieldValueType.BLOB | typeof FieldValueType.REFERENCE | typeof FieldValueType.OBJECT | typeof FieldValueType.DATETIME_RANGE | typeof FieldValueType.DATE_RANGE>;
97
+ type: Exclude<FieldValueType, typeof FieldValueTypes.BLOB | typeof FieldValueTypes.REFERENCE | typeof FieldValueTypes.OBJECT | typeof FieldValueTypes.DATETIME_RANGE | typeof FieldValueTypes.DATE_RANGE>;
98
98
  }
99
99
  export interface BlobFieldSchema extends AbstractFieldSchema {
100
100
  /**
101
101
  * The type of the field.
102
102
  */
103
- type: typeof FieldValueType.BLOB;
103
+ type: typeof FieldValueTypes.BLOB;
104
104
  }
105
105
  export interface ReferenceFieldSchema extends AbstractFieldSchema {
106
106
  /**
107
107
  * The type of the field.
108
108
  */
109
- type: typeof FieldValueType.REFERENCE;
109
+ type: typeof FieldValueTypes.REFERENCE;
110
110
  /**
111
111
  * Describe the referenced collection.
112
112
  */
@@ -116,7 +116,7 @@ export interface DatetimeRangeFieldSchema extends AbstractFieldSchema {
116
116
  /**
117
117
  * The type of the field.
118
118
  */
119
- type: typeof FieldValueType.DATETIME_RANGE;
119
+ type: typeof FieldValueTypes.DATETIME_RANGE;
120
120
  /**
121
121
  * Optional values that can be used in lieu of actual dates. They should represent points in time relative to today.
122
122
  * e.g. [{ label: 'Yesterday', value: 'yesterday' }, ...]
@@ -132,7 +132,7 @@ export interface DateRangeFieldSchema extends AbstractFieldSchema {
132
132
  /**
133
133
  * The type of the field.
134
134
  */
135
- type: typeof FieldValueType.DATE_RANGE;
135
+ type: typeof FieldValueTypes.DATE_RANGE;
136
136
  /**
137
137
  * Optional values that can be used in lieu of actual dates. They should represent points in time relative to today.
138
138
  * e.g. [{ label: 'Yesterday', value: 'yesterday' }, ...]
@@ -148,7 +148,7 @@ export interface ObjectFieldSchema extends AbstractFieldSchema {
148
148
  /**
149
149
  * The type of the field.
150
150
  */
151
- type: typeof FieldValueType.OBJECT;
151
+ type: typeof FieldValueTypes.OBJECT;
152
152
  /**
153
153
  * Describe the schema of the object.
154
154
  */
@@ -163,7 +163,7 @@ export type FieldSchema = BasicFieldSchema | BlobFieldSchema | ReferenceFieldSch
163
163
  * The type represents a unique scalar value such as a string or an integer.
164
164
  * For more complex types, use an Item instead.
165
165
  */
166
- export declare const FieldValueType: {
166
+ export declare const FieldValueTypes: {
167
167
  readonly BLOB: "blob";
168
168
  readonly BOOLEAN: "boolean";
169
169
  readonly DATE: "date";
@@ -181,12 +181,13 @@ export declare const FieldValueType: {
181
181
  readonly STRING: "string";
182
182
  readonly URL: "url";
183
183
  };
184
+ export type FieldValueType = (typeof FieldValueTypes)[keyof typeof FieldValueTypes];
184
185
  /**
185
186
  * A Semantic gives meaning to an Item or a Field in the Unito platform.
186
187
  * An object with a specified semantic is expected to hold a certain type of value that can later be used
187
188
  * by the consumers of the spec to better understand what that value means.
188
189
  */
189
- export declare const Semantic: {
190
+ export declare const Semantics: {
190
191
  readonly CREATED_AT: "createdAt";
191
192
  readonly DESCRIPTION: "description";
192
193
  readonly DISPLAY_NAME: "displayName";
@@ -195,21 +196,23 @@ export declare const Semantic: {
195
196
  readonly USER: "user";
196
197
  readonly PARENT: "parent";
197
198
  };
199
+ export type Semantic = (typeof Semantics)[keyof typeof Semantics];
198
200
  /**
199
201
  * A Relation Semantic gives meaning to a Relation in the Unito platform. A relation with a
200
202
  * specified semantic is expected to hold a certain type of item that can later be used by
201
203
  * the consumers of the spec for specific usage.
202
204
  */
203
- export declare const RelationSemantic: {
205
+ export declare const RelationSemantics: {
204
206
  readonly COMMENTS: "comments";
205
207
  readonly SUBTASKS: "subtasks";
206
208
  readonly USERS: "users";
207
209
  readonly ATTACHMENTS: "attachments";
208
210
  };
211
+ export type RelationSemantic = (typeof RelationSemantics)[keyof typeof RelationSemantics];
209
212
  /**
210
213
  * An OperatorType represents an operator used in a filter.
211
214
  */
212
- export declare const OperatorType: {
215
+ export declare const OperatorTypes: {
213
216
  readonly EQUAL: "=";
214
217
  readonly NOT_EQUAL: "!=";
215
218
  readonly GREATER_THAN: ">";
@@ -223,6 +226,7 @@ export declare const OperatorType: {
223
226
  readonly IS_NULL: "!!";
224
227
  readonly IS_NOT_NULL: "!";
225
228
  };
229
+ export type OperatorType = (typeof OperatorTypes)[keyof typeof OperatorTypes];
226
230
  /**
227
231
  * An Item represents a syncable entity. It has fields of its own as well as relations to other items.
228
232
  */
@@ -310,7 +314,7 @@ export interface Relation {
310
314
  /**
311
315
  * The semantic of the relation.
312
316
  */
313
- semantic?: (typeof RelationSemantic)[keyof typeof RelationSemantic];
317
+ semantic?: Semantic;
314
318
  /**
315
319
  * The shape of the relation.
316
320
  */
@@ -336,7 +340,7 @@ export type RelationSummary = {
336
340
  /**
337
341
  * The semantic of the relation.
338
342
  */
339
- semantic?: (typeof RelationSemantic)[keyof typeof RelationSemantic];
343
+ semantic?: RelationSemantic;
340
344
  /**
341
345
  * The shape of the relation.
342
346
  */
@@ -411,7 +415,7 @@ export interface RequestSchema {
411
415
  /**
412
416
  * HTTP code returned by the integration
413
417
  */
414
- export declare const StatusCode: {
418
+ export declare const StatusCodes: {
415
419
  readonly OK: 200;
416
420
  readonly CREATED: 201;
417
421
  readonly ACCEPTED: 202;
@@ -427,6 +431,7 @@ export declare const StatusCode: {
427
431
  readonly TOO_MANY_REQUESTS: 429;
428
432
  readonly INTERNAL_SERVER_ERROR: 500;
429
433
  };
434
+ export type StatusCode = (typeof StatusCodes)[keyof typeof StatusCodes];
430
435
  /**
431
436
  * A WebhookSubscriptionPayload describes the shape of the request on the "webhook subscription" endpoint.
432
437
  */
package/dist/src/types.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * The type represents a unique scalar value such as a string or an integer.
4
4
  * For more complex types, use an Item instead.
5
5
  */
6
- export const FieldValueType = {
6
+ export const FieldValueTypes = {
7
7
  BLOB: 'blob',
8
8
  BOOLEAN: 'boolean',
9
9
  DATE: 'date',
@@ -26,7 +26,7 @@ export const FieldValueType = {
26
26
  * An object with a specified semantic is expected to hold a certain type of value that can later be used
27
27
  * by the consumers of the spec to better understand what that value means.
28
28
  */
29
- export const Semantic = {
29
+ export const Semantics = {
30
30
  CREATED_AT: 'createdAt',
31
31
  DESCRIPTION: 'description',
32
32
  DISPLAY_NAME: 'displayName',
@@ -40,7 +40,7 @@ export const Semantic = {
40
40
  * specified semantic is expected to hold a certain type of item that can later be used by
41
41
  * the consumers of the spec for specific usage.
42
42
  */
43
- export const RelationSemantic = {
43
+ export const RelationSemantics = {
44
44
  COMMENTS: 'comments',
45
45
  SUBTASKS: 'subtasks',
46
46
  USERS: 'users',
@@ -49,7 +49,7 @@ export const RelationSemantic = {
49
49
  /**
50
50
  * An OperatorType represents an operator used in a filter.
51
51
  */
52
- export const OperatorType = {
52
+ export const OperatorTypes = {
53
53
  EQUAL: '=',
54
54
  NOT_EQUAL: '!=',
55
55
  GREATER_THAN: '>',
@@ -66,7 +66,7 @@ export const OperatorType = {
66
66
  /**
67
67
  * HTTP code returned by the integration
68
68
  */
69
- export const StatusCode = {
69
+ export const StatusCodes = {
70
70
  OK: 200,
71
71
  CREATED: 201,
72
72
  ACCEPTED: 202,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-api",
3
- "version": "1.0.4",
3
+ "version": "3.0.0",
4
4
  "description": "The Unito Integration API",
5
5
  "type": "module",
6
6
  "types": "./dist/src/index.d.ts",