@things-factory/calendar 10.1.202 → 10.1.205

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.
Files changed (114) hide show
  1. package/dist-client/pages/calendar/calendar-list-page.d.ts +1 -9
  2. package/dist-client/pages/calendar/calendar-list-page.js +2 -27
  3. package/dist-client/pages/calendar/calendar-list-page.js.map +1 -1
  4. package/dist-client/pages/event/event-list-page.d.ts +5 -28
  5. package/dist-client/pages/event/event-list-page.js +65 -177
  6. package/dist-client/pages/event/event-list-page.js.map +1 -1
  7. package/dist-client/route.d.ts +1 -1
  8. package/dist-client/route.js +0 -3
  9. package/dist-client/route.js.map +1 -1
  10. package/dist-client/tsconfig.tsbuildinfo +1 -1
  11. package/dist-server/index.d.ts +1 -0
  12. package/dist-server/index.js +5 -0
  13. package/dist-server/index.js.map +1 -1
  14. package/dist-server/role-tasks.d.ts +2 -0
  15. package/dist-server/role-tasks.js +16 -0
  16. package/dist-server/role-tasks.js.map +1 -0
  17. package/dist-server/service/attendee/attendee-query.d.ts +7 -4
  18. package/dist-server/service/attendee/attendee-query.js +34 -25
  19. package/dist-server/service/attendee/attendee-query.js.map +1 -1
  20. package/dist-server/service/attendee/attendee-service.d.ts +41 -0
  21. package/dist-server/service/attendee/attendee-service.js +90 -0
  22. package/dist-server/service/attendee/attendee-service.js.map +1 -0
  23. package/dist-server/service/attendee/attendee-type.d.ts +3 -15
  24. package/dist-server/service/attendee/attendee-type.js +12 -53
  25. package/dist-server/service/attendee/attendee-type.js.map +1 -1
  26. package/dist-server/service/attendee/attendee.d.ts +24 -7
  27. package/dist-server/service/attendee/attendee.js +99 -23
  28. package/dist-server/service/attendee/attendee.js.map +1 -1
  29. package/dist-server/service/attendee/index.d.ts +1 -2
  30. package/dist-server/service/attendee/index.js +1 -2
  31. package/dist-server/service/attendee/index.js.map +1 -1
  32. package/dist-server/service/calendar/calendar-mutation.d.ts +1 -3
  33. package/dist-server/service/calendar/calendar-mutation.js +21 -94
  34. package/dist-server/service/calendar/calendar-mutation.js.map +1 -1
  35. package/dist-server/service/calendar/calendar-query.d.ts +1 -1
  36. package/dist-server/service/calendar/calendar-query.js +15 -17
  37. package/dist-server/service/calendar/calendar-query.js.map +1 -1
  38. package/dist-server/service/calendar/calendar-service.d.ts +10 -0
  39. package/dist-server/service/calendar/calendar-service.js +58 -0
  40. package/dist-server/service/calendar/calendar-service.js.map +1 -0
  41. package/dist-server/service/calendar/calendar-type.d.ts +1 -4
  42. package/dist-server/service/calendar/calendar-type.js +13 -25
  43. package/dist-server/service/calendar/calendar-type.js.map +1 -1
  44. package/dist-server/service/calendar/calendar.d.ts +7 -8
  45. package/dist-server/service/calendar/calendar.js +23 -33
  46. package/dist-server/service/calendar/calendar.js.map +1 -1
  47. package/dist-server/service/event/event-mutation.d.ts +6 -4
  48. package/dist-server/service/event/event-mutation.js +60 -83
  49. package/dist-server/service/event/event-mutation.js.map +1 -1
  50. package/dist-server/service/event/event-query.d.ts +11 -1
  51. package/dist-server/service/event/event-query.js +106 -13
  52. package/dist-server/service/event/event-query.js.map +1 -1
  53. package/dist-server/service/event/event-rules.d.ts +10 -0
  54. package/dist-server/service/event/event-rules.js +38 -0
  55. package/dist-server/service/event/event-rules.js.map +1 -0
  56. package/dist-server/service/event/event-service.d.ts +42 -0
  57. package/dist-server/service/event/event-service.js +159 -0
  58. package/dist-server/service/event/event-service.js.map +1 -0
  59. package/dist-server/service/event/event-type.d.ts +10 -11
  60. package/dist-server/service/event/event-type.js +32 -36
  61. package/dist-server/service/event/event-type.js.map +1 -1
  62. package/dist-server/service/event/event.d.ts +25 -11
  63. package/dist-server/service/event/event.js +89 -36
  64. package/dist-server/service/event/event.js.map +1 -1
  65. package/dist-server/service/event-series/event-series-mutation.d.ts +11 -0
  66. package/dist-server/service/event-series/event-series-mutation.js +100 -0
  67. package/dist-server/service/event-series/event-series-mutation.js.map +1 -0
  68. package/dist-server/service/event-series/event-series-query.d.ts +16 -0
  69. package/dist-server/service/event-series/event-series-query.js +109 -0
  70. package/dist-server/service/event-series/event-series-query.js.map +1 -0
  71. package/dist-server/service/event-series/event-series-service.d.ts +40 -0
  72. package/dist-server/service/event-series/event-series-service.js +253 -0
  73. package/dist-server/service/event-series/event-series-service.js.map +1 -0
  74. package/dist-server/service/event-series/event-series-type.d.ts +41 -0
  75. package/dist-server/service/event-series/event-series-type.js +155 -0
  76. package/dist-server/service/event-series/event-series-type.js.map +1 -0
  77. package/dist-server/service/event-series/event-series.d.ts +32 -0
  78. package/dist-server/service/event-series/event-series.js +134 -0
  79. package/dist-server/service/event-series/event-series.js.map +1 -0
  80. package/dist-server/service/event-series/index.d.ts +6 -0
  81. package/dist-server/service/event-series/index.js +10 -0
  82. package/dist-server/service/event-series/index.js.map +1 -0
  83. package/dist-server/service/event-series/recurrence.d.ts +19 -0
  84. package/dist-server/service/event-series/recurrence.js +95 -0
  85. package/dist-server/service/event-series/recurrence.js.map +1 -0
  86. package/dist-server/service/index.d.ts +15 -4
  87. package/dist-server/service/index.js +29 -11
  88. package/dist-server/service/index.js.map +1 -1
  89. package/dist-server/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +8 -5
  91. package/tests/open-doors.test.ts +18 -21
  92. package/things-factory.config.js +0 -4
  93. package/translations/en.json +44 -1
  94. package/translations/es.json +44 -1
  95. package/translations/ja.json +44 -1
  96. package/translations/ko.json +44 -1
  97. package/translations/ms.json +44 -1
  98. package/translations/zh.json +44 -1
  99. package/concept.md +0 -31
  100. package/dist-client/pages/attendee/attendee-importer.d.ts +0 -23
  101. package/dist-client/pages/attendee/attendee-importer.js +0 -93
  102. package/dist-client/pages/attendee/attendee-importer.js.map +0 -1
  103. package/dist-client/pages/attendee/attendee-list-page.d.ts +0 -56
  104. package/dist-client/pages/attendee/attendee-list-page.js +0 -263
  105. package/dist-client/pages/attendee/attendee-list-page.js.map +0 -1
  106. package/dist-client/pages/calendar/calendar-importer.d.ts +0 -23
  107. package/dist-client/pages/calendar/calendar-importer.js +0 -93
  108. package/dist-client/pages/calendar/calendar-importer.js.map +0 -1
  109. package/dist-client/pages/event/event-importer.d.ts +0 -23
  110. package/dist-client/pages/event/event-importer.js +0 -93
  111. package/dist-client/pages/event/event-importer.js.map +0 -1
  112. package/dist-server/service/attendee/attendee-mutation.d.ts +0 -10
  113. package/dist-server/service/attendee/attendee-mutation.js +0 -140
  114. package/dist-server/service/attendee/attendee-mutation.js.map +0 -1
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventSeriesList = exports.EventSeriesChange = exports.EventSeriesPatch = exports.NewEventSeries = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const attendee_type_1 = require("../attendee/attendee-type");
7
+ const event_1 = require("../event/event");
8
+ const event_series_1 = require("./event-series");
9
+ let NewEventSeries = class NewEventSeries {
10
+ };
11
+ exports.NewEventSeries = NewEventSeries;
12
+ tslib_1.__decorate([
13
+ (0, type_graphql_1.Field)({ description: 'Name each occurrence takes' }),
14
+ tslib_1.__metadata("design:type", String)
15
+ ], NewEventSeries.prototype, "name", void 0);
16
+ tslib_1.__decorate([
17
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the series is about' }),
18
+ tslib_1.__metadata("design:type", String)
19
+ ], NewEventSeries.prototype, "description", void 0);
20
+ tslib_1.__decorate([
21
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where the occurrences take place' }),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], NewEventSeries.prototype, "location", void 0);
24
+ tslib_1.__decorate([
25
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the calendar to put the series on' }),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], NewEventSeries.prototype, "calendarId", void 0);
28
+ tslib_1.__decorate([
29
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the person responsible; whoever creates it when empty' }),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], NewEventSeries.prototype, "organizerId", void 0);
32
+ tslib_1.__decorate([
33
+ (0, type_graphql_1.Field)({ description: 'Five-field cron expression giving the start of each occurrence' }),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], NewEventSeries.prototype, "rule", void 0);
36
+ tslib_1.__decorate([
37
+ (0, type_graphql_1.Field)({ nullable: true, description: 'IANA timezone the rule is read in; the domain\'s when empty' }),
38
+ tslib_1.__metadata("design:type", String)
39
+ ], NewEventSeries.prototype, "timezone", void 0);
40
+ tslib_1.__decorate([
41
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Length of each occurrence in minutes' }),
42
+ tslib_1.__metadata("design:type", Number)
43
+ ], NewEventSeries.prototype, "durationMinutes", void 0);
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Field)({ description: 'No occurrence starts before this time' }),
46
+ tslib_1.__metadata("design:type", Date)
47
+ ], NewEventSeries.prototype, "startsAt", void 0);
48
+ tslib_1.__decorate([
49
+ (0, type_graphql_1.Field)({ nullable: true, description: 'No occurrence starts after this time' }),
50
+ tslib_1.__metadata("design:type", Date)
51
+ ], NewEventSeries.prototype, "endsAt", void 0);
52
+ tslib_1.__decorate([
53
+ (0, type_graphql_1.Field)(type => [attendee_type_1.AttendeeInput], { nullable: true, description: 'The people named on every occurrence' }),
54
+ tslib_1.__metadata("design:type", Array)
55
+ ], NewEventSeries.prototype, "attendees", void 0);
56
+ exports.NewEventSeries = NewEventSeries = tslib_1.__decorate([
57
+ (0, type_graphql_1.InputType)({ description: 'A series of events to create' })
58
+ ], NewEventSeries);
59
+ let EventSeriesPatch = class EventSeriesPatch {
60
+ };
61
+ exports.EventSeriesPatch = EventSeriesPatch;
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name each occurrence takes' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], EventSeriesPatch.prototype, "name", void 0);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the series is about' }),
68
+ tslib_1.__metadata("design:type", String)
69
+ ], EventSeriesPatch.prototype, "description", void 0);
70
+ tslib_1.__decorate([
71
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where the occurrences take place' }),
72
+ tslib_1.__metadata("design:type", String)
73
+ ], EventSeriesPatch.prototype, "location", void 0);
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the calendar to put the series on' }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], EventSeriesPatch.prototype, "calendarId", void 0);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the person responsible' }),
80
+ tslib_1.__metadata("design:type", String)
81
+ ], EventSeriesPatch.prototype, "organizerId", void 0);
82
+ tslib_1.__decorate([
83
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Five-field cron expression giving the start of each occurrence' }),
84
+ tslib_1.__metadata("design:type", String)
85
+ ], EventSeriesPatch.prototype, "rule", void 0);
86
+ tslib_1.__decorate([
87
+ (0, type_graphql_1.Field)({ nullable: true, description: 'IANA timezone the rule is read in' }),
88
+ tslib_1.__metadata("design:type", String)
89
+ ], EventSeriesPatch.prototype, "timezone", void 0);
90
+ tslib_1.__decorate([
91
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Length of each occurrence in minutes' }),
92
+ tslib_1.__metadata("design:type", Number)
93
+ ], EventSeriesPatch.prototype, "durationMinutes", void 0);
94
+ tslib_1.__decorate([
95
+ (0, type_graphql_1.Field)({ nullable: true, description: 'No occurrence starts before this time' }),
96
+ tslib_1.__metadata("design:type", Date)
97
+ ], EventSeriesPatch.prototype, "startsAt", void 0);
98
+ tslib_1.__decorate([
99
+ (0, type_graphql_1.Field)({ nullable: true, description: 'No occurrence starts after this time' }),
100
+ tslib_1.__metadata("design:type", Date)
101
+ ], EventSeriesPatch.prototype, "endsAt", void 0);
102
+ tslib_1.__decorate([
103
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Whether the series still makes occurrences; off removes its undecided future occurrences' }),
104
+ tslib_1.__metadata("design:type", Boolean)
105
+ ], EventSeriesPatch.prototype, "active", void 0);
106
+ exports.EventSeriesPatch = EventSeriesPatch = tslib_1.__decorate([
107
+ (0, type_graphql_1.InputType)({ description: 'What changes on a series; applies to its undecided occurrences from now on' })
108
+ ], EventSeriesPatch);
109
+ let EventSeriesChange = class EventSeriesChange {
110
+ };
111
+ exports.EventSeriesChange = EventSeriesChange;
112
+ tslib_1.__decorate([
113
+ (0, type_graphql_1.Field)(type => event_series_1.EventSeries, { description: 'The series — as it would be when previewed, as saved when applied' }),
114
+ tslib_1.__metadata("design:type", event_series_1.EventSeries)
115
+ ], EventSeriesChange.prototype, "series", void 0);
116
+ tslib_1.__decorate([
117
+ (0, type_graphql_1.Field)({ description: 'Whether the change was written; false for a preview' }),
118
+ tslib_1.__metadata("design:type", Boolean)
119
+ ], EventSeriesChange.prototype, "applied", void 0);
120
+ tslib_1.__decorate([
121
+ (0, type_graphql_1.Field)(type => [event_1.Event], { description: 'Undecided occurrences that stay, following the series' }),
122
+ tslib_1.__metadata("design:type", Array)
123
+ ], EventSeriesChange.prototype, "kept", void 0);
124
+ tslib_1.__decorate([
125
+ (0, type_graphql_1.Field)(type => [event_1.Event], { description: 'Undecided occurrences the change removes — records elsewhere may point at them' }),
126
+ tslib_1.__metadata("design:type", Array)
127
+ ], EventSeriesChange.prototype, "removed", void 0);
128
+ tslib_1.__decorate([
129
+ (0, type_graphql_1.Field)(type => [Date], { description: 'Start times of the occurrences the change adds' }),
130
+ tslib_1.__metadata("design:type", Array)
131
+ ], EventSeriesChange.prototype, "added", void 0);
132
+ tslib_1.__decorate([
133
+ (0, type_graphql_1.Field)(type => [event_1.Event], { description: 'The occurrences added; empty for a preview' }),
134
+ tslib_1.__metadata("design:type", Array)
135
+ ], EventSeriesChange.prototype, "created", void 0);
136
+ exports.EventSeriesChange = EventSeriesChange = tslib_1.__decorate([
137
+ (0, type_graphql_1.ObjectType)({
138
+ description: 'What a change to a series does to its occurrences from now on. Postponed, cancelled, held and past occurrences are never in it'
139
+ })
140
+ ], EventSeriesChange);
141
+ let EventSeriesList = class EventSeriesList {
142
+ };
143
+ exports.EventSeriesList = EventSeriesList;
144
+ tslib_1.__decorate([
145
+ (0, type_graphql_1.Field)(type => [event_series_1.EventSeries], { description: 'The series on this page' }),
146
+ tslib_1.__metadata("design:type", Array)
147
+ ], EventSeriesList.prototype, "items", void 0);
148
+ tslib_1.__decorate([
149
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many series match in all' }),
150
+ tslib_1.__metadata("design:type", Number)
151
+ ], EventSeriesList.prototype, "total", void 0);
152
+ exports.EventSeriesList = EventSeriesList = tslib_1.__decorate([
153
+ (0, type_graphql_1.ObjectType)({ description: 'A page of series' })
154
+ ], EventSeriesList);
155
+ //# sourceMappingURL=event-series-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-series-type.js","sourceRoot":"","sources":["../../../server/service/event-series/event-series-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAEhE,6DAAyD;AACzD,0CAAsC;AACtC,iDAA4C;AAGrC,IAAM,cAAc,GAApB,MAAM,cAAc;CAiC1B,CAAA;AAjCY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;4CACzC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;mDAC/C;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;gDAC1D;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;kDAC/D;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,W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ADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAK,CAAC,EAAE,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;;+CACpF;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAK,CAAC,EAAE,EAAE,WAAW,EAAE,gFAAgF,EAAE,CAAC;;kDAC1G;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;;gDAC5E;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAK,CAAC,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;kDACtE;4BAjBL,iBAAiB;IAJ7B,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,gIAAgI;KACnI,CAAC;GACW,iBAAiB,CAkB7B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;8CACrD;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;8CACvD;0BALF,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;GACnC,eAAe,CAM3B","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { AttendeeInput } from '../attendee/attendee-type'\nimport { Event } from '../event/event'\nimport { EventSeries } from './event-series'\n\n@InputType({ description: 'A series of events to create' })\nexport class NewEventSeries {\n @Field({ description: 'Name each occurrence takes' })\n name: string\n\n @Field({ nullable: true, description: 'What the series is about' })\n description?: string\n\n @Field({ nullable: true, description: 'Where the occurrences take place' })\n location?: string\n\n @Field({ nullable: true, description: 'Id of the calendar to put the series on' })\n calendarId?: string\n\n @Field({ nullable: true, description: 'Id of the person responsible; whoever creates it when empty' })\n organizerId?: string\n\n @Field({ description: 'Five-field cron expression giving the start of each occurrence' })\n rule: string\n\n @Field({ nullable: true, description: 'IANA timezone the rule is read in; the domain\\'s when empty' })\n timezone?: string\n\n @Field(type => Int, { description: 'Length of each occurrence in minutes' })\n durationMinutes: number\n\n @Field({ description: 'No occurrence starts before this time' })\n startsAt: Date\n\n @Field({ nullable: true, description: 'No occurrence starts after this time' })\n endsAt?: Date\n\n @Field(type => [AttendeeInput], { nullable: true, description: 'The people named on every occurrence' })\n attendees?: AttendeeInput[]\n}\n\n@InputType({ description: 'What changes on a series; applies to its undecided occurrences from now on' })\nexport class EventSeriesPatch {\n @Field({ nullable: true, description: 'Name each occurrence takes' })\n name?: string\n\n @Field({ nullable: true, description: 'What the series is about' })\n description?: string\n\n @Field({ nullable: true, description: 'Where the occurrences take place' })\n location?: string\n\n @Field({ nullable: true, description: 'Id of the calendar to put the series on' })\n calendarId?: string\n\n @Field({ nullable: true, description: 'Id of the person responsible' })\n organizerId?: string\n\n @Field({ nullable: true, description: 'Five-field cron expression giving the start of each occurrence' })\n rule?: string\n\n @Field({ nullable: true, description: 'IANA timezone the rule is read in' })\n timezone?: string\n\n @Field(type => Int, { nullable: true, description: 'Length of each occurrence in minutes' })\n durationMinutes?: number\n\n @Field({ nullable: true, description: 'No occurrence starts before this time' })\n startsAt?: Date\n\n @Field({ nullable: true, description: 'No occurrence starts after this time' })\n endsAt?: Date\n\n @Field({ nullable: true, description: 'Whether the series still makes occurrences; off removes its undecided future occurrences' })\n active?: boolean\n}\n\n@ObjectType({\n description:\n 'What a change to a series does to its occurrences from now on. Postponed, cancelled, held and past occurrences are never in it'\n})\nexport class EventSeriesChange {\n @Field(type => EventSeries, { description: 'The series — as it would be when previewed, as saved when applied' })\n series: EventSeries\n\n @Field({ description: 'Whether the change was written; false for a preview' })\n applied: boolean\n\n @Field(type => [Event], { description: 'Undecided occurrences that stay, following the series' })\n kept: Event[]\n\n @Field(type => [Event], { description: 'Undecided occurrences the change removes — records elsewhere may point at them' })\n removed: Event[]\n\n @Field(type => [Date], { description: 'Start times of the occurrences the change adds' })\n added: Date[]\n\n @Field(type => [Event], { description: 'The occurrences added; empty for a preview' })\n created: Event[]\n}\n\n@ObjectType({ description: 'A page of series' })\nexport class EventSeriesList {\n @Field(type => [EventSeries], { description: 'The series on this page' })\n items: EventSeries[]\n\n @Field(type => Int, { description: 'How many series match in all' })\n total: number\n}\n"]}
@@ -0,0 +1,32 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Calendar } from '../calendar/calendar';
4
+ /**
5
+ * Events that repeat by a rule — "first Monday of the month, 10:00 Seoul, two hours". Its occurrences are `Event`
6
+ * rows, each named by the series and the time the rule gave it, created when someone asks for them.
7
+ */
8
+ export declare class EventSeries {
9
+ readonly id: string;
10
+ domain?: Domain;
11
+ domainId?: string;
12
+ calendar?: Calendar;
13
+ calendarId?: string;
14
+ name: string;
15
+ description?: string;
16
+ location?: string;
17
+ organizer?: User;
18
+ organizerId?: string;
19
+ rule: string;
20
+ timezone: string;
21
+ durationMinutes: number;
22
+ startsAt: Date;
23
+ endsAt?: Date;
24
+ active: boolean;
25
+ createdAt?: Date;
26
+ updatedAt?: Date;
27
+ deletedAt?: Date;
28
+ creator?: User;
29
+ creatorId?: string;
30
+ updater?: User;
31
+ updaterId?: string;
32
+ }
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventSeries = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const calendar_1 = require("../calendar/calendar");
10
+ /**
11
+ * Events that repeat by a rule — "first Monday of the month, 10:00 Seoul, two hours". Its occurrences are `Event`
12
+ * rows, each named by the series and the time the rule gave it, created when someone asks for them.
13
+ */
14
+ let EventSeries = class EventSeries {
15
+ };
16
+ exports.EventSeries = EventSeries;
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
19
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier of the series' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], EventSeries.prototype, "id", void 0);
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
24
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain the series belongs to' }),
25
+ tslib_1.__metadata("design:type", shell_1.Domain)
26
+ ], EventSeries.prototype, "domain", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.RelationId)((series) => series.domain),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], EventSeries.prototype, "domainId", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.ManyToOne)(type => calendar_1.Calendar, { nullable: true }),
33
+ (0, type_graphql_1.Field)(type => calendar_1.Calendar, { nullable: true, description: 'The calendar the series belongs to, if any' }),
34
+ tslib_1.__metadata("design:type", calendar_1.Calendar)
35
+ ], EventSeries.prototype, "calendar", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.RelationId)((series) => series.calendar),
38
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the calendar the series belongs to' }),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], EventSeries.prototype, "calendarId", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)(),
43
+ (0, type_graphql_1.Field)({ description: 'Name each occurrence takes' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], EventSeries.prototype, "name", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
48
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the series is about' }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], EventSeries.prototype, "description", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ nullable: true }),
53
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where the occurrences take place' }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], EventSeries.prototype, "location", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
58
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The person responsible for the series' }),
59
+ tslib_1.__metadata("design:type", auth_base_1.User)
60
+ ], EventSeries.prototype, "organizer", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.RelationId)((series) => series.organizer),
63
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Id of the person responsible for the series' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], EventSeries.prototype, "organizerId", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)(),
68
+ (0, type_graphql_1.Field)({ description: 'Five-field cron expression giving the start of each occurrence' }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], EventSeries.prototype, "rule", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)(),
73
+ (0, type_graphql_1.Field)({ description: 'IANA timezone the rule is read in, such as Asia/Seoul' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], EventSeries.prototype, "timezone", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ type: 'int' }),
78
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Length of each occurrence in minutes' }),
79
+ tslib_1.__metadata("design:type", Number)
80
+ ], EventSeries.prototype, "durationMinutes", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.Column)(),
83
+ (0, type_graphql_1.Field)({ description: 'No occurrence starts before this time' }),
84
+ tslib_1.__metadata("design:type", Date)
85
+ ], EventSeries.prototype, "startsAt", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.Column)({ nullable: true }),
88
+ (0, type_graphql_1.Field)({ nullable: true, description: 'No occurrence starts after this time; open-ended when empty' }),
89
+ tslib_1.__metadata("design:type", Date)
90
+ ], EventSeries.prototype, "endsAt", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.Column)({ default: true }),
93
+ (0, type_graphql_1.Field)({ description: 'Whether the series still makes occurrences' }),
94
+ tslib_1.__metadata("design:type", Boolean)
95
+ ], EventSeries.prototype, "active", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.CreateDateColumn)(),
98
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp' }),
99
+ tslib_1.__metadata("design:type", Date)
100
+ ], EventSeries.prototype, "createdAt", void 0);
101
+ tslib_1.__decorate([
102
+ (0, typeorm_1.UpdateDateColumn)(),
103
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp' }),
104
+ tslib_1.__metadata("design:type", Date)
105
+ ], EventSeries.prototype, "updatedAt", void 0);
106
+ tslib_1.__decorate([
107
+ (0, typeorm_1.DeleteDateColumn)(),
108
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp' }),
109
+ tslib_1.__metadata("design:type", Date)
110
+ ], EventSeries.prototype, "deletedAt", void 0);
111
+ tslib_1.__decorate([
112
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
113
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who created the series' }),
114
+ tslib_1.__metadata("design:type", auth_base_1.User)
115
+ ], EventSeries.prototype, "creator", void 0);
116
+ tslib_1.__decorate([
117
+ (0, typeorm_1.RelationId)((series) => series.creator),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], EventSeries.prototype, "creatorId", void 0);
120
+ tslib_1.__decorate([
121
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
122
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed the series' }),
123
+ tslib_1.__metadata("design:type", auth_base_1.User)
124
+ ], EventSeries.prototype, "updater", void 0);
125
+ tslib_1.__decorate([
126
+ (0, typeorm_1.RelationId)((series) => series.updater),
127
+ tslib_1.__metadata("design:type", String)
128
+ ], EventSeries.prototype, "updaterId", void 0);
129
+ exports.EventSeries = EventSeries = tslib_1.__decorate([
130
+ (0, typeorm_1.Entity)(),
131
+ (0, typeorm_1.Index)('ix_event_series_0', (series) => [series.domain, series.calendar]),
132
+ (0, type_graphql_1.ObjectType)({ description: 'Events that repeat by a rule; its occurrences are events' })
133
+ ], EventSeries);
134
+ //# sourceMappingURL=event-series.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-series.js","sourceRoot":"","sources":["../../../server/service/event-series/event-series.ts"],"names":[],"mappings":";;;;AAAA,qCAAoJ;AACpJ,+CAAyD;AAEzD,iDAA8C;AAC9C,yDAAgD;AAEhD,mDAA+C;AAE/C;;;GAGG;AAII,IAAM,WAAW,GAAjB,MAAM,WAAW;CAyFvB,CAAA;AAzFY,kCAAW;AAGb;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;uCACnD;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;sCAClF,cAAM;2CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;6CAClC;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC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AK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;sCACpD,IAAI;8CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;sCACrE,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;8CAClC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;sCAC1E,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;8CAClC;sBAxFP,WAAW;IAHvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,MAAmB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0DAA0D,EAAE,CAAC;GAC3E,WAAW,CAyFvB","sourcesContent":["import { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\nimport { Field, ID, Int, ObjectType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nimport { Calendar } from '../calendar/calendar'\n\n/**\n * Events that repeat by a rule — \"first Monday of the month, 10:00 Seoul, two hours\". Its occurrences are `Event`\n * rows, each named by the series and the time the rule gave it, created when someone asks for them.\n */\n@Entity()\n@Index('ix_event_series_0', (series: EventSeries) => [series.domain, series.calendar])\n@ObjectType({ description: 'Events that repeat by a rule; its occurrences are events' })\nexport class EventSeries {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier of the series' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain the series belongs to' })\n domain?: Domain\n\n @RelationId((series: EventSeries) => series.domain)\n domainId?: string\n\n @ManyToOne(type => Calendar, { nullable: true })\n @Field(type => Calendar, { nullable: true, description: 'The calendar the series belongs to, if any' })\n calendar?: Calendar\n\n @RelationId((series: EventSeries) => series.calendar)\n @Field({ nullable: true, description: 'Id of the calendar the series belongs to' })\n calendarId?: string\n\n @Column()\n @Field({ description: 'Name each occurrence takes' })\n name: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What the series is about' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Where the occurrences take place' })\n location?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The person responsible for the series' })\n organizer?: User\n\n @RelationId((series: EventSeries) => series.organizer)\n @Field({ nullable: true, description: 'Id of the person responsible for the series' })\n organizerId?: string\n\n @Column()\n @Field({ description: 'Five-field cron expression giving the start of each occurrence' })\n rule: string\n\n @Column()\n @Field({ description: 'IANA timezone the rule is read in, such as Asia/Seoul' })\n timezone: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Length of each occurrence in minutes' })\n durationMinutes: number\n\n @Column()\n @Field({ description: 'No occurrence starts before this time' })\n startsAt: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'No occurrence starts after this time; open-ended when empty' })\n endsAt?: Date\n\n @Column({ default: true })\n @Field({ description: 'Whether the series still makes occurrences' })\n active: boolean\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation timestamp' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update timestamp' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Soft delete timestamp' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who created the series' })\n creator?: User\n\n @RelationId((series: EventSeries) => series.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed the series' })\n updater?: User\n\n @RelationId((series: EventSeries) => series.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { EventSeries } from './event-series';
2
+ import { EventSeriesQuery } from './event-series-query';
3
+ import { EventSeriesMutation } from './event-series-mutation';
4
+ export declare const entities: (typeof EventSeries)[];
5
+ export declare const resolvers: (typeof EventSeriesQuery | typeof EventSeriesMutation)[];
6
+ export declare const subscribers: any[];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const event_series_1 = require("./event-series");
5
+ const event_series_query_1 = require("./event-series-query");
6
+ const event_series_mutation_1 = require("./event-series-mutation");
7
+ exports.entities = [event_series_1.EventSeries];
8
+ exports.resolvers = [event_series_query_1.EventSeriesQuery, event_series_mutation_1.EventSeriesMutation];
9
+ exports.subscribers = [];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/event-series/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,6DAAuD;AACvD,mEAA6D;AAEhD,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA;AACnD,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { EventSeries } from './event-series'\nimport { EventSeriesQuery } from './event-series-query'\nimport { EventSeriesMutation } from './event-series-mutation'\n\nexport const entities = [EventSeries]\nexport const resolvers = [EventSeriesQuery, EventSeriesMutation]\nexport const subscribers = []\n"]}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The times a series' rule gives — a five-field cron expression read in an IANA timezone, the dialect the
3
+ * framework's schedules already use (`dataset`, `scheduler-client`). Cron cannot say "every other week"; a series
4
+ * that needs it waits for an interval option on the series.
5
+ */
6
+ /** The most occurrences one call creates or plans. A longer horizon is the caller's to split. */
7
+ export declare const MAX_OCCURRENCES = 400;
8
+ export declare function validTimezone(timezone: string): boolean;
9
+ /** Refuses a rule that is not five cron fields or does not parse, and a timezone that is not IANA. */
10
+ export declare function checkRule(rule: string, timezone: string): void;
11
+ /**
12
+ * The rule's times from `from` to `until`, both included, oldest first. Refuses rather than cuts short when there
13
+ * would be more than `MAX_OCCURRENCES`.
14
+ */
15
+ export declare function occurrenceTimes(rule: string, timezone: string, from: Date, until: Date): Date[];
16
+ /** The first second of a calendar day (YYYY-MM-DD) in a timezone - where "from that day" begins. */
17
+ export declare function dayStartIn(day: string, timezone: string): Date;
18
+ /** The last second of a calendar day (YYYY-MM-DD) in a timezone - a deadline "by that day" as that calendar keeps it. */
19
+ export declare function dayEndIn(day: string, timezone: string): Date;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_OCCURRENCES = void 0;
4
+ exports.validTimezone = validTimezone;
5
+ exports.checkRule = checkRule;
6
+ exports.occurrenceTimes = occurrenceTimes;
7
+ exports.dayStartIn = dayStartIn;
8
+ exports.dayEndIn = dayEndIn;
9
+ const cron_parser_1 = require("cron-parser");
10
+ const shell_1 = require("@things-factory/shell");
11
+ /**
12
+ * The times a series' rule gives — a five-field cron expression read in an IANA timezone, the dialect the
13
+ * framework's schedules already use (`dataset`, `scheduler-client`). Cron cannot say "every other week"; a series
14
+ * that needs it waits for an interval option on the series.
15
+ */
16
+ /** The most occurrences one call creates or plans. A longer horizon is the caller's to split. */
17
+ exports.MAX_OCCURRENCES = 400;
18
+ function validTimezone(timezone) {
19
+ if (!timezone)
20
+ return false;
21
+ try {
22
+ new Intl.DateTimeFormat('en-US', { timeZone: timezone });
23
+ return true;
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ }
29
+ /** Refuses a rule that is not five cron fields or does not parse, and a timezone that is not IANA. */
30
+ function checkRule(rule, timezone) {
31
+ if (!validTimezone(timezone))
32
+ throw new shell_1.Refusal('event-series-timezone-invalid', { timezone: timezone ?? null }, 'Give an IANA timezone such as Asia/Seoul');
33
+ const fields = rule?.trim().split(/\s+/) ?? [];
34
+ if (fields.length !== 5)
35
+ throw new shell_1.Refusal('event-series-rule-invalid', {}, 'Give the rule as five cron fields: minute hour day-of-month month day-of-week');
36
+ try {
37
+ (0, cron_parser_1.parseExpression)(fields.join(' '), { tz: timezone });
38
+ }
39
+ catch {
40
+ throw new shell_1.Refusal('event-series-rule-invalid', {}, 'Give the rule as five cron fields: minute hour day-of-month month day-of-week');
41
+ }
42
+ }
43
+ /**
44
+ * The rule's times from `from` to `until`, both included, oldest first. Refuses rather than cuts short when there
45
+ * would be more than `MAX_OCCURRENCES`.
46
+ */
47
+ function occurrenceTimes(rule, timezone, from, until) {
48
+ checkRule(rule, timezone);
49
+ if (!(until >= from))
50
+ return [];
51
+ const times = [];
52
+ const interval = (0, cron_parser_1.parseExpression)(rule.trim().split(/\s+/).join(' '), {
53
+ tz: timezone,
54
+ currentDate: new Date(from.getTime() - 1),
55
+ endDate: until,
56
+ iterator: false
57
+ });
58
+ while (interval.hasNext()) {
59
+ const next = interval.next().toDate();
60
+ if (next > until)
61
+ break;
62
+ if (times.length === exports.MAX_OCCURRENCES)
63
+ throw new shell_1.Refusal('event-series-too-many-occurrences', { limit: exports.MAX_OCCURRENCES }, 'Too many occurrences at once; give a shorter horizon');
64
+ times.push(next);
65
+ }
66
+ return times;
67
+ }
68
+ /** The wall clock of an instant in a timezone, read as if it were UTC - how far the zone is from UTC then. */
69
+ function wallOf(at, timezone) {
70
+ const parts = Object.fromEntries(new Intl.DateTimeFormat('en-US', { timeZone: timezone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })
71
+ .formatToParts(at)
72
+ .map(part => [part.type, part.value]));
73
+ return Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day), Number(parts.hour), Number(parts.minute), Number(parts.second));
74
+ }
75
+ /** The instant a wall-clock time of a calendar day is in a timezone - once more for a day whose offset changes. */
76
+ function instantOf(day, hour, minute, second, timezone) {
77
+ if (!validTimezone(timezone))
78
+ throw new shell_1.Refusal('event-series-timezone-invalid', { timezone: timezone ?? null }, 'Give an IANA timezone such as Asia/Seoul');
79
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(day ?? ''))
80
+ throw new shell_1.Refusal('event-day-invalid', { day: day ?? null }, 'Give the day as YYYY-MM-DD');
81
+ const [year, month, date] = day.split('-').map(Number);
82
+ const wanted = Date.UTC(year, month - 1, date, hour, minute, second);
83
+ let at = wanted - (wallOf(wanted, timezone) - wanted);
84
+ at += wanted - wallOf(at, timezone);
85
+ return new Date(at);
86
+ }
87
+ /** The first second of a calendar day (YYYY-MM-DD) in a timezone - where "from that day" begins. */
88
+ function dayStartIn(day, timezone) {
89
+ return instantOf(day, 0, 0, 0, timezone);
90
+ }
91
+ /** The last second of a calendar day (YYYY-MM-DD) in a timezone - a deadline "by that day" as that calendar keeps it. */
92
+ function dayEndIn(day, timezone) {
93
+ return instantOf(day, 23, 59, 59, timezone);
94
+ }
95
+ //# sourceMappingURL=recurrence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recurrence.js","sourceRoot":"","sources":["../../../server/service/event-series/recurrence.ts"],"names":[],"mappings":";;;AAaA,sCAQC;A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MAAM,CAAC,CAAA;IACrD,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IACnC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAA;AACrB,CAAC;AAED,oGAAoG;AACpG,SAAgB,UAAU,CAAC,GAAW,EAAE,QAAgB;IACtD,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC1C,CAAC;AAED,yHAAyH;AACzH,SAAgB,QAAQ,CAAC,GAAW,EAAE,QAAgB;IACpD,OAAO,SAAS,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;AAC7C,CAAC","sourcesContent":["import { parseExpression } from 'cron-parser'\n\nimport { Refusal } from '@things-factory/shell'\n\n/**\n * The times a series' rule gives — a five-field cron expression read in an IANA timezone, the dialect the\n * framework's schedules already use (`dataset`, `scheduler-client`). Cron cannot say \"every other week\"; a series\n * that needs it waits for an interval option on the series.\n */\n\n/** The most occurrences one call creates or plans. A longer horizon is the caller's to split. */\nexport const MAX_OCCURRENCES = 400\n\nexport function validTimezone(timezone: string): boolean {\n if (!timezone) return false\n try {\n new Intl.DateTimeFormat('en-US', { timeZone: timezone })\n return true\n } catch {\n return false\n }\n}\n\n/** Refuses a rule that is not five cron fields or does not parse, and a timezone that is not IANA. */\nexport function checkRule(rule: string, timezone: string) {\n if (!validTimezone(timezone)) throw new Refusal('event-series-timezone-invalid', { timezone: timezone ?? null }, 'Give an IANA timezone such as Asia/Seoul')\n const fields = rule?.trim().split(/\\s+/) ?? []\n if (fields.length !== 5) throw new Refusal('event-series-rule-invalid', {}, 'Give the rule as five cron fields: minute hour day-of-month month day-of-week')\n try {\n parseExpression(fields.join(' '), { tz: timezone })\n } catch {\n throw new Refusal('event-series-rule-invalid', {}, 'Give the rule as five cron fields: minute hour day-of-month month day-of-week')\n }\n}\n\n/**\n * The rule's times from `from` to `until`, both included, oldest first. Refuses rather than cuts short when there\n * would be more than `MAX_OCCURRENCES`.\n */\nexport function occurrenceTimes(rule: string, timezone: string, from: Date, until: Date): Date[] {\n checkRule(rule, timezone)\n if (!(until >= from)) return []\n\n const times: Date[] = []\n const interval = parseExpression(rule.trim().split(/\\s+/).join(' '), {\n tz: timezone,\n currentDate: new Date(from.getTime() - 1),\n endDate: until,\n iterator: false\n })\n while (interval.hasNext()) {\n const next = interval.next().toDate()\n if (next > until) break\n if (times.length === MAX_OCCURRENCES)\n throw new Refusal('event-series-too-many-occurrences', { limit: MAX_OCCURRENCES }, 'Too many occurrences at once; give a shorter horizon')\n times.push(next)\n }\n return times\n}\n\n/** The wall clock of an instant in a timezone, read as if it were UTC - how far the zone is from UTC then. */\nfunction wallOf(at: number, timezone: string): number {\n const parts = Object.fromEntries(\n new Intl.DateTimeFormat('en-US', { timeZone: timezone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })\n .formatToParts(at)\n .map(part => [part.type, part.value])\n )\n return Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day), Number(parts.hour), Number(parts.minute), Number(parts.second))\n}\n\n/** The instant a wall-clock time of a calendar day is in a timezone - once more for a day whose offset changes. */\nfunction instantOf(day: string, hour: number, minute: number, second: number, timezone: string): Date {\n if (!validTimezone(timezone)) throw new Refusal('event-series-timezone-invalid', { timezone: timezone ?? null }, 'Give an IANA timezone such as Asia/Seoul')\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(day ?? '')) throw new Refusal('event-day-invalid', { day: day ?? null }, 'Give the day as YYYY-MM-DD')\n const [year, month, date] = day.split('-').map(Number)\n const wanted = Date.UTC(year, month - 1, date, hour, minute, second)\n let at = wanted - (wallOf(wanted, timezone) - wanted)\n at += wanted - wallOf(at, timezone)\n return new Date(at)\n}\n\n/** The first second of a calendar day (YYYY-MM-DD) in a timezone - where \"from that day\" begins. */\nexport function dayStartIn(day: string, timezone: string): Date {\n return instantOf(day, 0, 0, 0, timezone)\n}\n\n/** The last second of a calendar day (YYYY-MM-DD) in a timezone - a deadline \"by that day\" as that calendar keeps it. */\nexport function dayEndIn(day: string, timezone: string): Date {\n return instantOf(day, 23, 59, 59, timezone)\n}\n"]}
@@ -1,8 +1,19 @@
1
- export * from './attendee/attendee';
2
- export * from './event/event';
3
1
  export * from './calendar/calendar';
4
- export declare const entities: (typeof import("./event/event").Event | typeof import("./attendee/attendee").Attendee | typeof import("./calendar/calendar").Calendar)[];
2
+ export * from './event/event';
3
+ export * from './event/event-rules';
4
+ export * from './event-series/event-series';
5
+ export * from './attendee/attendee';
6
+ export * from './calendar/calendar-type';
7
+ export * from './event/event-type';
8
+ export * from './event-series/event-series-type';
9
+ export * from './attendee/attendee-type';
10
+ export * from './calendar/calendar-service';
11
+ export * from './event/event-service';
12
+ export * from './event-series/event-series-service';
13
+ export * from './event-series/recurrence';
14
+ export { attendeesOf } from './attendee/attendee-service';
15
+ export declare const entities: (typeof import("./calendar/calendar").Calendar | typeof import("./event/event").Event | typeof import("./attendee/attendee").Attendee)[];
5
16
  export declare const subscribers: any[];
6
17
  export declare const schema: {
7
- resolverClasses: (typeof import("./attendee/attendee-query").AttendeeQuery | typeof import("./attendee/attendee-mutation").AttendeeMutation | typeof import("./event/event-query").EventQuery | typeof import("./event/event-mutation").EventMutation | typeof import("./calendar/calendar-query").CalendarQuery | typeof import("./calendar/calendar-mutation").CalendarMutation)[];
18
+ resolverClasses: (typeof import("./calendar/calendar-query").CalendarQuery | typeof import("./calendar/calendar-mutation").CalendarMutation | typeof import("./event/event-query").EventQuery | typeof import("./event/event-mutation").EventMutation | typeof import("./event-series/event-series-query").EventSeriesQuery | typeof import("./event-series/event-series-mutation").EventSeriesMutation | typeof import("./attendee/attendee-query").AttendeeQuery)[];
8
19
  };
@@ -1,33 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.subscribers = exports.entities = void 0;
3
+ exports.schema = exports.subscribers = exports.entities = exports.attendeesOf = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /* EXPORT ENTITY TYPES */
6
- tslib_1.__exportStar(require("./attendee/attendee"), exports);
7
- tslib_1.__exportStar(require("./event/event"), exports);
8
6
  tslib_1.__exportStar(require("./calendar/calendar"), exports);
7
+ tslib_1.__exportStar(require("./event/event"), exports);
8
+ tslib_1.__exportStar(require("./event/event-rules"), exports);
9
+ tslib_1.__exportStar(require("./event-series/event-series"), exports);
10
+ tslib_1.__exportStar(require("./attendee/attendee"), exports);
11
+ /* EXPORT INPUT AND RESULT TYPES */
12
+ tslib_1.__exportStar(require("./calendar/calendar-type"), exports);
13
+ tslib_1.__exportStar(require("./event/event-type"), exports);
14
+ tslib_1.__exportStar(require("./event-series/event-series-type"), exports);
15
+ tslib_1.__exportStar(require("./attendee/attendee-type"), exports);
16
+ /* EXPORT SERVICES — an application calls these inside its own transaction, behind its own doors */
17
+ tslib_1.__exportStar(require("./calendar/calendar-service"), exports);
18
+ tslib_1.__exportStar(require("./event/event-service"), exports);
19
+ tslib_1.__exportStar(require("./event-series/event-series-service"), exports);
20
+ tslib_1.__exportStar(require("./event-series/recurrence"), exports);
21
+ var attendee_service_1 = require("./attendee/attendee-service");
22
+ Object.defineProperty(exports, "attendeesOf", { enumerable: true, get: function () { return attendee_service_1.attendeesOf; } });
9
23
  /* IMPORT ENTITIES AND RESOLVERS */
10
- const attendee_1 = require("./attendee");
11
- const event_1 = require("./event");
12
24
  const calendar_1 = require("./calendar");
25
+ const event_1 = require("./event");
26
+ const event_series_1 = require("./event-series");
27
+ const attendee_1 = require("./attendee");
13
28
  exports.entities = [
14
29
  /* ENTITIES */
15
- ...attendee_1.entities,
16
- ...event_1.entities,
17
30
  ...calendar_1.entities,
31
+ ...event_1.entities,
32
+ ...event_series_1.entities,
33
+ ...attendee_1.entities
18
34
  ];
19
35
  exports.subscribers = [
20
36
  /* SUBSCRIBERS */
21
- ...attendee_1.subscribers,
22
- ...event_1.subscribers,
23
37
  ...calendar_1.subscribers,
38
+ ...event_1.subscribers,
39
+ ...event_series_1.subscribers,
40
+ ...attendee_1.subscribers
24
41
  ];
25
42
  exports.schema = {
26
43
  resolverClasses: [
27
44
  /* RESOLVER CLASSES */
28
- ...attendee_1.resolvers,
29
- ...event_1.resolvers,
30
45
  ...calendar_1.resolvers,
46
+ ...event_1.resolvers,
47
+ ...event_series_1.resolvers,
48
+ ...attendee_1.resolvers
31
49
  ]
32
50
  };
33
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8DAAmC;AACnC,wDAA6B;AAC7B,8DAAmC;AAEnC,mCAAmC;AACnC,yCAA6H;AAC7H,mCAAiH;AACjH,yCAA6H;AAEhH,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;CACnB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IAClB,GAAG,sBAAmB;IACtB,GAAG,mBAAgB;IACnB,GAAG,sBAAmB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,oBAAiB;QACpB,GAAG,iBAAc;QACjB,GAAG,oBAAiB;KACnB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './attendee/attendee'\nexport * from './event/event'\nexport * from './calendar/calendar'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AttendeeEntities, resolvers as AttendeeResolvers, subscribers as AttendeeSubscribers } from './attendee'\nimport { entities as EventEntities, resolvers as EventResolvers, subscribers as EventSubscribers } from './event'\nimport { entities as CalendarEntities, resolvers as CalendarResolvers, subscribers as CalendarSubscribers } from './calendar'\n\nexport const entities = [ \n /* ENTITIES */\n\t...AttendeeEntities,\n\t...EventEntities,\n\t...CalendarEntities,\n] \n\nexport const subscribers = [\n /* SUBSCRIBERS */\n\t...AttendeeSubscribers,\n\t...EventSubscribers,\n\t...CalendarSubscribers,\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n\t\t...AttendeeResolvers,\n\t\t...EventResolvers,\n\t\t...CalendarResolvers,\n ] \n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8DAAmC;AACnC,wDAA6B;AAC7B,8DAAmC;AACnC,sEAA2C;AAC3C,8DAAmC;AAEnC,mCAAmC;AACnC,mEAAwC;AACxC,6DAAkC;AAClC,2EAAgD;AAChD,mEAAwC;AAExC,mGAAmG;AACnG,sEAA2C;AAC3C,gEAAqC;AACrC,8EAAmD;AACnD,oEAAyC;AACzC,gEAAyD;AAAhD,+GAAA,WAAW,OAAA;AAEpB,mCAAmC;AACnC,yCAA6H;AAC7H,mCAAiH;AACjH,iDAA0I;AAC1I,yCAA6H;AAEhH,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,uBAAmB;IACtB,GAAG,mBAAgB;CACpB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IACjB,GAAG,sBAAmB;IACtB,GAAG,mBAAgB;IACnB,GAAG,0BAAsB;IACzB,GAAG,sBAAmB;CACvB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,oBAAiB;QACpB,GAAG,iBAAc;QACjB,GAAG,wBAAoB;QACvB,GAAG,oBAAiB;KACrB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './calendar/calendar'\nexport * from './event/event'\nexport * from './event/event-rules'\nexport * from './event-series/event-series'\nexport * from './attendee/attendee'\n\n/* EXPORT INPUT AND RESULT TYPES */\nexport * from './calendar/calendar-type'\nexport * from './event/event-type'\nexport * from './event-series/event-series-type'\nexport * from './attendee/attendee-type'\n\n/* EXPORT SERVICES — an application calls these inside its own transaction, behind its own doors */\nexport * from './calendar/calendar-service'\nexport * from './event/event-service'\nexport * from './event-series/event-series-service'\nexport * from './event-series/recurrence'\nexport { attendeesOf } from './attendee/attendee-service'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as CalendarEntities, resolvers as CalendarResolvers, subscribers as CalendarSubscribers } from './calendar'\nimport { entities as EventEntities, resolvers as EventResolvers, subscribers as EventSubscribers } from './event'\nimport { entities as EventSeriesEntities, resolvers as EventSeriesResolvers, subscribers as EventSeriesSubscribers } from './event-series'\nimport { entities as AttendeeEntities, resolvers as AttendeeResolvers, subscribers as AttendeeSubscribers } from './attendee'\n\nexport const entities = [\n /* ENTITIES */\n ...CalendarEntities,\n ...EventEntities,\n ...EventSeriesEntities,\n ...AttendeeEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...CalendarSubscribers,\n ...EventSubscribers,\n ...EventSeriesSubscribers,\n ...AttendeeSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...CalendarResolvers,\n ...EventResolvers,\n ...EventSeriesResolvers,\n ...AttendeeResolvers\n ]\n}\n"]}