tods-competition-factory 2.0.0-beta.8 → 2.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.
@@ -7189,6 +7189,16 @@ declare namespace mutate$4 {
7189
7189
  export { mutate$4_publishEvent as publishEvent, mutate$4_publishEventSeeding as publishEventSeeding, mutate$4_publishOrderOfPlay as publishOrderOfPlay, mutate$4_setEventDisplay as setEventDisplay, mutate$4_unPublishEvent as unPublishEvent, mutate$4_unPublishEventSeeding as unPublishEventSeeding, mutate$4_unPublishOrderOfPlay as unPublishOrderOfPlay };
7190
7190
  }
7191
7191
 
7192
+ declare function getTournamentPublishStatus({ tournamentRecord, status }: {
7193
+ tournamentRecord: any;
7194
+ status?: string | undefined;
7195
+ }): any;
7196
+
7197
+ declare function getEventPublishStatus({ event, status }: {
7198
+ event: any;
7199
+ status?: string | undefined;
7200
+ }): any;
7201
+
7192
7202
  type GetPublishStateArgs = {
7193
7203
  tournamentRecord?: Tournament;
7194
7204
  drawDefinition?: DrawDefinition;
@@ -7269,10 +7279,12 @@ declare const query$4_getAllEventData: typeof getAllEventData;
7269
7279
  declare const query$4_getCourtInfo: typeof getCourtInfo;
7270
7280
  declare const query$4_getDrawData: typeof getDrawData;
7271
7281
  declare const query$4_getEventData: typeof getEventData;
7282
+ declare const query$4_getEventPublishStatus: typeof getEventPublishStatus;
7272
7283
  declare const query$4_getPublishState: typeof getPublishState;
7284
+ declare const query$4_getTournamentPublishStatus: typeof getTournamentPublishStatus;
7273
7285
  declare const query$4_getVenueData: typeof getVenueData;
7274
7286
  declare namespace query$4 {
7275
- export { query$4_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, query$4_getAllEventData as getAllEventData, query$4_getCourtInfo as getCourtInfo, query$4_getDrawData as getDrawData, query$4_getEventData as getEventData, query$4_getPublishState as getPublishState, query$4_getVenueData as getVenueData };
7287
+ export { query$4_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, query$4_getAllEventData as getAllEventData, query$4_getCourtInfo as getCourtInfo, query$4_getDrawData as getDrawData, query$4_getEventData as getEventData, query$4_getEventPublishStatus as getEventPublishStatus, query$4_getPublishState as getPublishState, query$4_getTournamentPublishStatus as getTournamentPublishStatus, query$4_getVenueData as getVenueData };
7276
7288
  }
7277
7289
 
7278
7290
  declare const index$a_bulkUpdatePublishedEventIds: typeof bulkUpdatePublishedEventIds;
@@ -7280,7 +7292,9 @@ declare const index$a_getAllEventData: typeof getAllEventData;
7280
7292
  declare const index$a_getCourtInfo: typeof getCourtInfo;
7281
7293
  declare const index$a_getDrawData: typeof getDrawData;
7282
7294
  declare const index$a_getEventData: typeof getEventData;
7295
+ declare const index$a_getEventPublishStatus: typeof getEventPublishStatus;
7283
7296
  declare const index$a_getPublishState: typeof getPublishState;
7297
+ declare const index$a_getTournamentPublishStatus: typeof getTournamentPublishStatus;
7284
7298
  declare const index$a_getVenueData: typeof getVenueData;
7285
7299
  declare const index$a_publishEvent: typeof publishEvent;
7286
7300
  declare const index$a_publishEventSeeding: typeof publishEventSeeding;
@@ -7290,7 +7304,7 @@ declare const index$a_unPublishEvent: typeof unPublishEvent;
7290
7304
  declare const index$a_unPublishEventSeeding: typeof unPublishEventSeeding;
7291
7305
  declare const index$a_unPublishOrderOfPlay: typeof unPublishOrderOfPlay;
7292
7306
  declare namespace index$a {
7293
- export { index$a_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$a_getAllEventData as getAllEventData, index$a_getCourtInfo as getCourtInfo, index$a_getDrawData as getDrawData, index$a_getEventData as getEventData, index$a_getPublishState as getPublishState, index$a_getVenueData as getVenueData, mutate$4 as mutate, index$a_publishEvent as publishEvent, index$a_publishEventSeeding as publishEventSeeding, index$a_publishOrderOfPlay as publishOrderOfPlay, query$4 as query, index$a_setEventDisplay as setEventDisplay, index$a_unPublishEvent as unPublishEvent, index$a_unPublishEventSeeding as unPublishEventSeeding, index$a_unPublishOrderOfPlay as unPublishOrderOfPlay };
7307
+ export { index$a_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$a_getAllEventData as getAllEventData, index$a_getCourtInfo as getCourtInfo, index$a_getDrawData as getDrawData, index$a_getEventData as getEventData, index$a_getEventPublishStatus as getEventPublishStatus, index$a_getPublishState as getPublishState, index$a_getTournamentPublishStatus as getTournamentPublishStatus, index$a_getVenueData as getVenueData, mutate$4 as mutate, index$a_publishEvent as publishEvent, index$a_publishEventSeeding as publishEventSeeding, index$a_publishOrderOfPlay as publishOrderOfPlay, query$4 as query, index$a_setEventDisplay as setEventDisplay, index$a_unPublishEvent as unPublishEvent, index$a_unPublishEventSeeding as unPublishEventSeeding, index$a_unPublishOrderOfPlay as unPublishOrderOfPlay };
7294
7308
  }
7295
7309
 
7296
7310
  type FindExtensionType = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.0.0-beta.8';
6
+ return '2.0.0';
7
7
  }
8
8
 
9
9
  /******************************************************************************
@@ -12997,6 +12997,16 @@ function stringSort(a, b) {
12997
12997
  return (a || '').localeCompare(b || '');
12998
12998
  }
12999
12999
 
13000
+ function getTournamentPublishStatus(_a) {
13001
+ var _b, _c, _d;
13002
+ var tournamentRecord = _a.tournamentRecord, _e = _a.status, status = _e === void 0 ? PUBLIC : _e;
13003
+ var itemType = "".concat(PUBLISH, ".").concat(STATUS$1);
13004
+ return (_d = (_c = (_b = getTournamentTimeItem({
13005
+ tournamentRecord: tournamentRecord,
13006
+ itemType: itemType,
13007
+ })) === null || _b === void 0 ? void 0 : _b.timeItem) === null || _c === void 0 ? void 0 : _c.itemValue) === null || _d === void 0 ? void 0 : _d[status];
13008
+ }
13009
+
13000
13010
  function getEventPublishStatus(_a) {
13001
13011
  var _b, _c, _d;
13002
13012
  var event = _a.event, _e = _a.status, status = _e === void 0 ? PUBLIC : _e;
@@ -13017,7 +13027,7 @@ function getDrawPublishStatus(_a) {
13017
13027
 
13018
13028
  function getPublishState(_a) {
13019
13029
  var e_1, _b, e_2, _c, e_3, _d, e_4, _e;
13020
- var _f, _g, _h, _j, _k;
13030
+ var _f, _g, _h, _j, _k, _l, _m;
13021
13031
  var tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, eventIds = _a.eventIds, eventId = _a.eventId, drawIds = _a.drawIds, drawId = _a.drawId, event = _a.event;
13022
13032
  if (eventId && !event) {
13023
13033
  return { error: EVENT_NOT_FOUND };
@@ -13057,6 +13067,7 @@ function getPublishState(_a) {
13057
13067
  return {
13058
13068
  publishState: __assign({ status: {
13059
13069
  published: !!((_f = pubStatus.status.publishedDrawIds) === null || _f === void 0 ? void 0 : _f.includes(drawId)),
13070
+ drawDetail: (_g = pubStatus.status.drawDetails) === null || _g === void 0 ? void 0 : _g[drawId],
13060
13071
  } }, SUCCESS),
13061
13072
  };
13062
13073
  }
@@ -13070,6 +13081,7 @@ function getPublishState(_a) {
13070
13081
  publishState[drawId_1] = {
13071
13082
  status: {
13072
13083
  published: !!pubStatus.status.publishedDrawIds.includes(drawId_1),
13084
+ drawDetail: (_h = pubStatus.status.drawDetails) === null || _h === void 0 ? void 0 : _h[drawId_1],
13073
13085
  },
13074
13086
  };
13075
13087
  return __assign(__assign({}, SUCCESS), { publishState: publishState });
@@ -13092,19 +13104,21 @@ function getPublishState(_a) {
13092
13104
  }
13093
13105
  else {
13094
13106
  var publishState = {};
13107
+ var pubStatus = getTournamentPublishStatus({ tournamentRecord: tournamentRecord });
13108
+ publishState.tournament = pubStatus;
13095
13109
  try {
13096
- for (var _l = __values((_g = tournamentRecord.events) !== null && _g !== void 0 ? _g : []), _m = _l.next(); !_m.done; _m = _l.next()) {
13097
- var event_2 = _m.value;
13098
- var pubStatus = getPubStatus({ event: event_2 });
13099
- publishState[event_2.eventId] = pubStatus;
13100
- if (pubStatus.error)
13101
- return pubStatus;
13110
+ for (var _o = __values((_j = tournamentRecord.events) !== null && _j !== void 0 ? _j : []), _p = _o.next(); !_p.done; _p = _o.next()) {
13111
+ var event_2 = _p.value;
13112
+ var pubStatus_1 = getPubStatus({ event: event_2 });
13113
+ publishState[event_2.eventId] = pubStatus_1;
13114
+ if (pubStatus_1.error)
13115
+ return pubStatus_1;
13102
13116
  try {
13103
- for (var _o = (e_4 = void 0, __values((_h = event_2.drawDefinitions) !== null && _h !== void 0 ? _h : [])), _p = _o.next(); !_p.done; _p = _o.next()) {
13104
- var drawId_2 = _p.value.drawId;
13117
+ for (var _q = (e_4 = void 0, __values((_k = event_2.drawDefinitions) !== null && _k !== void 0 ? _k : [])), _r = _q.next(); !_r.done; _r = _q.next()) {
13118
+ var drawId_2 = _r.value.drawId;
13105
13119
  if (!isString(drawId_2))
13106
13120
  return { error: INVALID_VALUES };
13107
- var published = (_k = (_j = pubStatus.publishState) === null || _j === void 0 ? void 0 : _j.publishedDrawIds) === null || _k === void 0 ? void 0 : _k.includes(drawId_2);
13121
+ var published = (_m = (_l = pubStatus_1.publishState) === null || _l === void 0 ? void 0 : _l.publishedDrawIds) === null || _m === void 0 ? void 0 : _m.includes(drawId_2);
13108
13122
  if (published) {
13109
13123
  publishState[drawId_2] = { status: { published: published } };
13110
13124
  }
@@ -13113,7 +13127,7 @@ function getPublishState(_a) {
13113
13127
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
13114
13128
  finally {
13115
13129
  try {
13116
- if (_p && !_p.done && (_e = _o.return)) _e.call(_o);
13130
+ if (_r && !_r.done && (_e = _q.return)) _e.call(_q);
13117
13131
  }
13118
13132
  finally { if (e_4) throw e_4.error; }
13119
13133
  }
@@ -13122,7 +13136,7 @@ function getPublishState(_a) {
13122
13136
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
13123
13137
  finally {
13124
13138
  try {
13125
- if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
13139
+ if (_p && !_p.done && (_d = _o.return)) _d.call(_o);
13126
13140
  }
13127
13141
  finally { if (e_3) throw e_3.error; }
13128
13142
  }
@@ -13166,12 +13180,14 @@ function getPubStatus(_a) {
13166
13180
  var publishedDrawIds = (drawDetails && Object.keys(drawDetails).filter(function (drawId) { return getDrawPublishStatus({ drawDetails: drawDetails, drawId: drawId }); })) ||
13167
13181
  eventPubStatus.drawIds ||
13168
13182
  [];
13169
- return __assign({ status: {
13183
+ return {
13184
+ status: {
13170
13185
  published: publishedDrawIds.length > 0,
13171
13186
  publishedDrawIds: publishedDrawIds,
13172
13187
  publishedSeeding: publishedSeeding,
13173
13188
  drawDetails: drawDetails,
13174
- } }, SUCCESS);
13189
+ },
13190
+ };
13175
13191
  }
13176
13192
 
13177
13193
  function addStructureParticipation(_a) {
@@ -54647,7 +54663,9 @@ var query$4 = {
54647
54663
  getCourtInfo: getCourtInfo,
54648
54664
  getDrawData: getDrawData,
54649
54665
  getEventData: getEventData,
54666
+ getEventPublishStatus: getEventPublishStatus,
54650
54667
  getPublishState: getPublishState,
54668
+ getTournamentPublishStatus: getTournamentPublishStatus,
54651
54669
  getVenueData: getVenueData
54652
54670
  };
54653
54671
 
@@ -54658,7 +54676,9 @@ var index$8 = {
54658
54676
  getCourtInfo: getCourtInfo,
54659
54677
  getDrawData: getDrawData,
54660
54678
  getEventData: getEventData,
54679
+ getEventPublishStatus: getEventPublishStatus,
54661
54680
  getPublishState: getPublishState,
54681
+ getTournamentPublishStatus: getTournamentPublishStatus,
54662
54682
  getVenueData: getVenueData,
54663
54683
  mutate: mutate$4,
54664
54684
  publishEvent: publishEvent,