@data-fair/lib-common-types 1.4.1 → 1.4.2

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.
@@ -7,8 +7,8 @@ export type Content = string;
7
7
  export type HTMLContent = string;
8
8
  export type URLOfEventIcon = string;
9
9
  export type Type = "user" | "organization";
10
- export type CleDuSujet = string;
11
- export type LibelleDuSujet = string;
10
+ export type TopicKey = string;
11
+ export type TopicTitle = string;
12
12
  export type Visibility = "public" | "private";
13
13
  export type ReceptionDate = string;
14
14
 
@@ -18,10 +18,7 @@ export interface Event {
18
18
  htmlBody?: HTMLContent | InternationalizedHTMLContent;
19
19
  icon?: URLOfEventIcon;
20
20
  sender: Emitter;
21
- topic: {
22
- key: CleDuSujet;
23
- title?: LibelleDuSujet;
24
- };
21
+ topic: TopicRef;
25
22
  urlParams?: UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl;
26
23
  visibility?: Visibility;
27
24
  date: ReceptionDate;
@@ -53,6 +50,10 @@ export interface InternationalizedHTMLContent {
53
50
  */
54
51
  [k: string]: string;
55
52
  }
53
+ /**
54
+ * This interface was referenced by `Event`'s JSON-Schema
55
+ * via the `definition` "sender".
56
+ */
56
57
  export interface Emitter {
57
58
  type: Type;
58
59
  /**
@@ -77,6 +78,14 @@ export interface Emitter {
77
78
  */
78
79
  departmentName?: string;
79
80
  }
81
+ /**
82
+ * This interface was referenced by `Event`'s JSON-Schema
83
+ * via the `definition` "topicRef".
84
+ */
85
+ export interface TopicRef {
86
+ key: TopicKey;
87
+ title?: TopicTitle;
88
+ }
80
89
  export interface UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl {
81
90
  /**
82
91
  * This interface was referenced by `UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl`'s JSON-Schema definition
@@ -84,32 +93,4 @@ export interface UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl {
84
93
  */
85
94
  [k: string]: string;
86
95
  }
87
- /**
88
- * This interface was referenced by `Event`'s JSON-Schema
89
- * via the `definition` "sender".
90
- */
91
- export interface Proprietaire {
92
- type: Type;
93
- /**
94
- * The unique id of the user or organization
95
- */
96
- id: string;
97
- /**
98
- * The display name of the user or organization
99
- */
100
- name: string;
101
- /**
102
- * @deprecated
103
- * If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role
104
- */
105
- role?: string;
106
- /**
107
- * If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department
108
- */
109
- department?: string;
110
- /**
111
- * The display name of the department
112
- */
113
- departmentName?: string;
114
- }
115
96
 
package/event/schema.d.ts CHANGED
@@ -54,22 +54,9 @@ declare const _default: {
54
54
  };
55
55
  sender: {
56
56
  $ref: string;
57
- title: string;
58
57
  };
59
58
  topic: {
60
- type: string;
61
- additionalProperties: boolean;
62
- required: string[];
63
- properties: {
64
- key: {
65
- type: string;
66
- title: string;
67
- };
68
- title: {
69
- type: string;
70
- title: string;
71
- };
72
- };
59
+ $ref: string;
73
60
  };
74
61
  urlParams: {
75
62
  type: string;
@@ -131,6 +118,21 @@ declare const _default: {
131
118
  };
132
119
  };
133
120
  };
121
+ topicRef: {
122
+ type: string;
123
+ additionalProperties: boolean;
124
+ required: string[];
125
+ properties: {
126
+ key: {
127
+ type: string;
128
+ title: string;
129
+ };
130
+ title: {
131
+ type: string;
132
+ title: string;
133
+ };
134
+ };
135
+ };
134
136
  };
135
137
  };
136
138
  export default _default;
package/event/schema.js CHANGED
@@ -37,22 +37,8 @@ export default {
37
37
  title: 'URL of event icon'
38
38
  },
39
39
  // sender is the owner of the topic
40
- sender: { $ref: '#/$defs/sender', title: 'Emitter' },
41
- topic: {
42
- type: 'object',
43
- additionalProperties: false,
44
- required: ['key'],
45
- properties: {
46
- key: {
47
- type: 'string',
48
- title: 'Clé du sujet'
49
- },
50
- title: {
51
- type: 'string',
52
- title: 'Libellé du sujet'
53
- }
54
- }
55
- },
40
+ sender: { $ref: '#/$defs/sender' },
41
+ topic: { $ref: '#/$defs/topicRef' },
56
42
  urlParams: {
57
43
  type: 'object',
58
44
  title: 'used to fill subscription.urlTemplate and so create notification.url',
@@ -79,7 +65,7 @@ export default {
79
65
  $defs: {
80
66
  sender: {
81
67
  type: 'object',
82
- title: 'Propriétaire',
68
+ title: 'Emitter',
83
69
  additionalProperties: false,
84
70
  required: ['type', 'id', 'name'],
85
71
  properties: {
@@ -110,6 +96,21 @@ export default {
110
96
  description: 'The display name of the department'
111
97
  }
112
98
  }
99
+ },
100
+ topicRef: {
101
+ type: 'object',
102
+ additionalProperties: false,
103
+ required: ['key'],
104
+ properties: {
105
+ key: {
106
+ type: 'string',
107
+ title: 'Topic key'
108
+ },
109
+ title: {
110
+ type: 'string',
111
+ title: 'Topic title'
112
+ }
113
+ }
113
114
  }
114
115
  }
115
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-common-types",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Shared schemas and built type definitions in the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "scripts": {