@sonolus/core 7.8.0 → 7.9.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.
Files changed (34) hide show
  1. package/dist/common/core/icon.d.ts +2 -0
  2. package/dist/common/core/icon.js +2 -0
  3. package/dist/common/core/server/form.d.ts +1 -0
  4. package/dist/common/core/server/index.d.ts +1 -0
  5. package/dist/common/core/server/items/community/comment/submit.d.ts +3 -2
  6. package/dist/common/core/server/items/community/comment/upload.d.ts +1 -1
  7. package/dist/common/core/server/items/community/submit.d.ts +3 -2
  8. package/dist/common/core/server/items/community/upload.d.ts +1 -1
  9. package/dist/common/core/server/items/create.d.ts +2 -1
  10. package/dist/common/core/server/items/index.d.ts +1 -0
  11. package/dist/common/core/server/items/index.js +1 -0
  12. package/dist/common/core/server/items/level-result/index.d.ts +3 -0
  13. package/dist/common/core/server/items/level-result/index.js +2 -0
  14. package/dist/common/core/server/items/level-result/info.d.ts +4 -0
  15. package/dist/common/core/server/items/level-result/info.js +2 -0
  16. package/dist/common/core/server/items/level-result/submit.d.ts +9 -0
  17. package/dist/common/core/server/items/level-result/submit.js +2 -0
  18. package/dist/common/core/server/items/level-result/upload.d.ts +1 -0
  19. package/dist/common/core/server/items/level-result/upload.js +2 -0
  20. package/dist/common/core/server/items/section.d.ts +2 -0
  21. package/dist/common/core/server/items/submit-action.d.ts +3 -2
  22. package/dist/common/core/server/items/upload-action.d.ts +1 -1
  23. package/dist/common/core/server/items/upload.d.ts +1 -1
  24. package/dist/common/core/server/message.d.ts +3 -0
  25. package/dist/common/core/server/message.js +2 -0
  26. package/dist/common/core/server/multiplayer/create-room.d.ts +1 -1
  27. package/dist/common/core/service/authenticate-external.d.ts +2 -0
  28. package/dist/common/core/service/index.d.ts +1 -1
  29. package/dist/common/core/text.d.ts +18 -2
  30. package/dist/common/core/text.js +18 -2
  31. package/dist/common/version.js +2 -2
  32. package/dist/node/core/resource/compress.js +2 -0
  33. package/dist/node/core/resource/decompress.js +1 -0
  34. package/package.json +6 -5
@@ -32,6 +32,7 @@ export declare const Icon: {
32
32
  readonly Heart: "heart";
33
33
  readonly HeartHollow: "heartHollow";
34
34
  readonly Hide: "hide";
35
+ readonly Information: "information";
35
36
  readonly Level: "level";
36
37
  readonly Lock: "lock";
37
38
  readonly Medal: "medal";
@@ -44,6 +45,7 @@ export declare const Icon: {
44
45
  readonly Playlist: "playlist";
45
46
  readonly Plus: "plus";
46
47
  readonly Post: "post";
48
+ readonly Question: "question";
47
49
  readonly Ranking: "ranking";
48
50
  readonly Replay: "replay";
49
51
  readonly Reply: "reply";
@@ -35,6 +35,7 @@ exports.Icon = {
35
35
  Heart: 'heart',
36
36
  HeartHollow: 'heartHollow',
37
37
  Hide: 'hide',
38
+ Information: 'information',
38
39
  Level: 'level',
39
40
  Lock: 'lock',
40
41
  Medal: 'medal',
@@ -47,6 +48,7 @@ exports.Icon = {
47
48
  Playlist: 'playlist',
48
49
  Plus: 'plus',
49
50
  Post: 'post',
51
+ Question: 'question',
50
52
  Ranking: 'ranking',
51
53
  Replay: 'replay',
52
54
  Reply: 'reply',
@@ -6,6 +6,7 @@ export type ServerForm = {
6
6
  title: Text | (string & {});
7
7
  icon?: Icon | (string & {});
8
8
  description?: string;
9
+ help?: string;
9
10
  requireConfirmation: boolean;
10
11
  options: ServerOption[];
11
12
  };
@@ -3,5 +3,6 @@ export { ServerConfiguration } from './configuration';
3
3
  export { ServerForm } from './form';
4
4
  export { ServerInfo, ServerInfoButton } from './info';
5
5
  export * from './items';
6
+ export { ServerMessage } from './message';
6
7
  export * from './multiplayer';
7
8
  export { ServerCollectionItemOption, ServerFileOption, ServerMultiOption, ServerOption, ServerSelectOption, ServerServerItemOption, ServerServerItemsOption, ServerSliderOption, ServerTextAreaOption, ServerTextOption, ServerToggleOption, } from './option';
@@ -2,8 +2,9 @@ export type ServerSubmitItemCommunityCommentActionRequest = {
2
2
  values: string;
3
3
  };
4
4
  export type ServerSubmitItemCommunityCommentActionResponse = {
5
- shouldUpdateCommunity?: boolean;
6
- shouldNavigateCommentsToPage?: number;
7
5
  key: string;
8
6
  hashes: string[];
7
+ shouldUpdateCommunity?: boolean;
8
+ shouldUpdateComments?: boolean;
9
+ shouldNavigateCommentsToPage?: number;
9
10
  };
@@ -1 +1 @@
1
- export type ServerUploadItemCommunityCommentActionResponse = {};
1
+ export type ServerUploadItemCommunityCommentActionResponse = object;
@@ -2,8 +2,9 @@ export type ServerSubmitItemCommunityActionRequest = {
2
2
  values: string;
3
3
  };
4
4
  export type ServerSubmitItemCommunityActionResponse = {
5
- shouldUpdateCommunity?: boolean;
6
- shouldNavigateCommentsToPage?: number;
7
5
  key: string;
8
6
  hashes: string[];
7
+ shouldUpdateCommunity?: boolean;
8
+ shouldUpdateComments?: boolean;
9
+ shouldNavigateCommentsToPage?: number;
9
10
  };
@@ -1 +1 @@
1
- export type ServerUploadItemCommunityActionResponse = {};
1
+ export type ServerUploadItemCommunityActionResponse = object;
@@ -2,7 +2,8 @@ export type ServerCreateItemRequest = {
2
2
  values: string;
3
3
  };
4
4
  export type ServerCreateItemResponse = {
5
- name: string;
6
5
  key: string;
7
6
  hashes: string[];
7
+ shouldUpdateInfo?: boolean;
8
+ shouldNavigateToItem?: string;
8
9
  };
@@ -3,6 +3,7 @@ export { ServerCreateItemRequest, ServerCreateItemResponse } from './create';
3
3
  export { ServerItemDetails } from './details';
4
4
  export { ServerItemInfo } from './info';
5
5
  export * from './leaderboard';
6
+ export * from './level-result';
6
7
  export { ServerItemList } from './list';
7
8
  export { ServerItemSection, ServerItemSectionTyped } from './section';
8
9
  export { ServerSubmitItemActionRequest, ServerSubmitItemActionResponse } from './submit-action';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./community"), exports);
18
18
  __exportStar(require("./leaderboard"), exports);
19
+ __exportStar(require("./level-result"), exports);
@@ -0,0 +1,3 @@
1
+ export { ServerLevelResultInfo } from './info';
2
+ export { ServerSubmitLevelResultRequest, ServerSubmitLevelResultResponse } from './submit';
3
+ export { ServerUploadLevelResultResponse } from './upload';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { ServerForm } from '../../form';
2
+ export type ServerLevelResultInfo = {
3
+ submits?: ServerForm[];
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { ReplayItem } from '../../../replay/item';
2
+ export type ServerSubmitLevelResultRequest = {
3
+ replay: ReplayItem;
4
+ values: string;
5
+ };
6
+ export type ServerSubmitLevelResultResponse = {
7
+ key: string;
8
+ hashes: string[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ServerUploadLevelResultResponse = object;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,6 +15,8 @@ export type ServerItemSection = ServerItemSectionTyped<'post', PostItem> | Serve
15
15
  export type ServerItemSectionTyped<TItemType, TItem> = {
16
16
  title: Text | (string & {});
17
17
  icon?: Icon | (string & {});
18
+ description?: string;
19
+ help?: string;
18
20
  itemType: TItemType;
19
21
  items: TItem[];
20
22
  search?: ServerForm;
@@ -2,8 +2,9 @@ export type ServerSubmitItemActionRequest = {
2
2
  values: string;
3
3
  };
4
4
  export type ServerSubmitItemActionResponse = {
5
- shouldUpdate?: boolean;
6
- shouldRemove?: boolean;
7
5
  key: string;
8
6
  hashes: string[];
7
+ shouldUpdateItem?: boolean;
8
+ shouldRemoveItem?: boolean;
9
+ shouldNavigateToItem?: string;
9
10
  };
@@ -1 +1 @@
1
- export type ServerUploadItemActionResponse = {};
1
+ export type ServerUploadItemActionResponse = object;
@@ -1 +1 @@
1
- export type ServerUploadItemResponse = {};
1
+ export type ServerUploadItemResponse = object;
@@ -0,0 +1,3 @@
1
+ export type ServerMessage = {
2
+ message?: string;
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- export type ServerCreateRoomRequest = {};
1
+ export type ServerCreateRoomRequest = object;
2
2
  export type ServerCreateRoomResponse = {
3
3
  name: string;
4
4
  key: string;
@@ -1,3 +1,4 @@
1
+ import { ServerMessage } from '../server/message';
1
2
  import { ServiceUserProfile } from '../service/user-profile';
2
3
  export type ServiceAuthenticateExternalRequest = {
3
4
  type: 'authenticateExternal';
@@ -5,3 +6,4 @@ export type ServiceAuthenticateExternalRequest = {
5
6
  time: number;
6
7
  userProfile: ServiceUserProfile;
7
8
  };
9
+ export type ServiceAuthenticateExternalResponse = ServerMessage;
@@ -1,3 +1,3 @@
1
- export { ServiceAuthenticateExternalRequest } from './authenticate-external';
1
+ export { ServiceAuthenticateExternalRequest, ServiceAuthenticateExternalResponse, } from './authenticate-external';
2
2
  export { signaturePublicKeyJWK } from './keys';
3
3
  export { ServiceUserId, ServiceUserProfile } from './user-profile';
@@ -519,6 +519,8 @@ export declare const Text: {
519
519
  readonly Announcement: "#ANNOUNCEMENT";
520
520
  /** en: Information */
521
521
  readonly Information: "#INFORMATION";
522
+ /** en: Help */
523
+ readonly Help: "#HELP";
522
524
  /** en: Maintenance */
523
525
  readonly Maintenance: "#MAINTENANCE";
524
526
  /** en: Event */
@@ -559,6 +561,12 @@ export declare const Text: {
559
561
  readonly OtherGenres: "#OTHER_GENRES";
560
562
  /** en: Other Versions */
561
563
  readonly OtherVersions: "#OTHER_VERSIONS";
564
+ /** en: Draft */
565
+ readonly Draft: "#DRAFT";
566
+ /** en: Reviewing */
567
+ readonly Reviewing: "#REVIEWING";
568
+ /** en: Published */
569
+ readonly Published: "#PUBLISHED";
562
570
  /** en: Verifying */
563
571
  readonly Verifying: "#VERIFYING";
564
572
  /** en: Verified */
@@ -711,6 +719,12 @@ export declare const Text: {
711
719
  readonly TeamWhite: "#TEAM_WHITE";
712
720
  /** en: Team Black */
713
721
  readonly TeamBlack: "#TEAM_BLACK";
722
+ /** en: Upload */
723
+ readonly Upload: "#UPLOAD";
724
+ /** en: Submit */
725
+ readonly Submit: "#SUBMIT";
726
+ /** en: Edit */
727
+ readonly Edit: "#EDIT";
714
728
  /** en: Like */
715
729
  readonly Like: "#LIKE";
716
730
  /** en: Liked */
@@ -727,8 +741,6 @@ export declare const Text: {
727
741
  readonly Delete: "#DELETE";
728
742
  /** en: Restore */
729
743
  readonly Restore: "#RESTORE";
730
- /** en: Edit */
731
- readonly Edit: "#EDIT";
732
744
  /** en: Confirm */
733
745
  readonly Confirm: "#CONFIRM";
734
746
  /** en: Cancel */
@@ -769,6 +781,10 @@ export declare const Text: {
769
781
  readonly Subscribe: "#SUBSCRIBE";
770
782
  /** en: Unsubscribe */
771
783
  readonly Unsubscribe: "#UNSUBSCRIBE";
784
+ /** en: Publish */
785
+ readonly Publish: "#PUBLISH";
786
+ /** en: Unpublish */
787
+ readonly Unpublish: "#UNPUBLISH";
772
788
  /** en: Show */
773
789
  readonly Show: "#SHOW";
774
790
  /** en: Hide */
@@ -522,6 +522,8 @@ exports.Text = {
522
522
  Announcement: '#ANNOUNCEMENT',
523
523
  /** en: Information */
524
524
  Information: '#INFORMATION',
525
+ /** en: Help */
526
+ Help: '#HELP',
525
527
  /** en: Maintenance */
526
528
  Maintenance: '#MAINTENANCE',
527
529
  /** en: Event */
@@ -562,6 +564,12 @@ exports.Text = {
562
564
  OtherGenres: '#OTHER_GENRES',
563
565
  /** en: Other Versions */
564
566
  OtherVersions: '#OTHER_VERSIONS',
567
+ /** en: Draft */
568
+ Draft: '#DRAFT',
569
+ /** en: Reviewing */
570
+ Reviewing: '#REVIEWING',
571
+ /** en: Published */
572
+ Published: '#PUBLISHED',
565
573
  /** en: Verifying */
566
574
  Verifying: '#VERIFYING',
567
575
  /** en: Verified */
@@ -714,6 +722,12 @@ exports.Text = {
714
722
  TeamWhite: '#TEAM_WHITE',
715
723
  /** en: Team Black */
716
724
  TeamBlack: '#TEAM_BLACK',
725
+ /** en: Upload */
726
+ Upload: '#UPLOAD',
727
+ /** en: Submit */
728
+ Submit: '#SUBMIT',
729
+ /** en: Edit */
730
+ Edit: '#EDIT',
717
731
  /** en: Like */
718
732
  Like: '#LIKE',
719
733
  /** en: Liked */
@@ -730,8 +744,6 @@ exports.Text = {
730
744
  Delete: '#DELETE',
731
745
  /** en: Restore */
732
746
  Restore: '#RESTORE',
733
- /** en: Edit */
734
- Edit: '#EDIT',
735
747
  /** en: Confirm */
736
748
  Confirm: '#CONFIRM',
737
749
  /** en: Cancel */
@@ -772,6 +784,10 @@ exports.Text = {
772
784
  Subscribe: '#SUBSCRIBE',
773
785
  /** en: Unsubscribe */
774
786
  Unsubscribe: '#UNSUBSCRIBE',
787
+ /** en: Publish */
788
+ Publish: '#PUBLISH',
789
+ /** en: Unpublish */
790
+ Unpublish: '#UNPUBLISH',
775
791
  /** en: Show */
776
792
  Show: '#SHOW',
777
793
  /** en: Hide */
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  exports.version = {
5
- package: '7.8.0',
6
- sonolus: '0.8.4',
5
+ package: '7.9.0',
6
+ sonolus: '0.8.5',
7
7
  };
@@ -7,7 +7,9 @@ const zlibOptions = {
7
7
  level: 9,
8
8
  };
9
9
  const gzipPromise = (0, node_util_1.promisify)(node_zlib_1.gzip);
10
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
10
11
  const compress = (data) => gzipPromise(JSON.stringify(data), zlibOptions);
11
12
  exports.compress = compress;
13
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
12
14
  const compressSync = (data) => (0, node_zlib_1.gzipSync)(JSON.stringify(data), zlibOptions);
13
15
  exports.compressSync = compressSync;
@@ -6,5 +6,6 @@ const node_zlib_1 = require("node:zlib");
6
6
  const unzipPromise = (0, node_util_1.promisify)(node_zlib_1.unzip);
7
7
  const decompress = async (data) => JSON.parse((await unzipPromise(data)).toString());
8
8
  exports.decompress = decompress;
9
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
9
10
  const decompressSync = (data) => JSON.parse((0, node_zlib_1.unzipSync)(data).toString());
10
11
  exports.decompressSync = decompressSync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonolus/core",
3
- "version": "7.8.0",
3
+ "version": "7.9.0",
4
4
  "description": "Core library for Sonolus",
5
5
  "author": "NonSpicyBurrito",
6
6
  "repository": "github:Sonolus/sonolus-core",
@@ -18,13 +18,14 @@
18
18
  "build": "tsc -p ."
19
19
  },
20
20
  "devDependencies": {
21
- "@eslint/js": "^8.57.0",
22
- "@types/node": "^20.14.11",
23
- "eslint": "^8.57.0",
21
+ "@eslint/js": "^9.9.0",
22
+ "@types/eslint__js": "^8.42.3",
23
+ "@types/node": "^20.15.0",
24
+ "eslint": "^9.9.0",
24
25
  "eslint-config-prettier": "^9.1.0",
25
26
  "prettier": "^3.3.3",
26
27
  "prettier-plugin-organize-imports": "^4.0.0",
27
28
  "typescript": "~5.5.4",
28
- "typescript-eslint": "^7.17.0"
29
+ "typescript-eslint": "^8.1.0"
29
30
  }
30
31
  }