glitch-javascript-sdk 0.3.2 → 0.3.3

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.
@@ -0,0 +1,9 @@
1
+ export declare const ContentStatus: Readonly<{
2
+ UNAPPROVED: 0;
3
+ APPROVED: 1;
4
+ IN_REVIEW: 2;
5
+ PENDING: 3;
6
+ FLAGGED: 4;
7
+ REMOVED: 5;
8
+ DELETED: 6;
9
+ }>;
@@ -0,0 +1,7 @@
1
+ export declare const PostTypes: Readonly<{
2
+ TEXT: "text";
3
+ LINK: "link";
4
+ POLL: "poll";
5
+ IMAGE: "image";
6
+ VIDEO: "video";
7
+ }>;
@@ -13,6 +13,7 @@ import Parser from "./util/Parser";
13
13
  import Session from "./util/Session";
14
14
  import Storage from "./util/Storage";
15
15
  import Data from './util/Data';
16
+ import LabelManager from "./util/LabelManager";
16
17
  import { Modes } from "./constants/Modes";
17
18
  import { Roles } from "./constants/Roles";
18
19
  import { TeamJoinProcess } from "./constants/TeamJoinProcess";
@@ -41,6 +42,7 @@ declare class Glitch {
41
42
  Session: typeof Session;
42
43
  Storage: typeof Storage;
43
44
  Data: typeof Data;
45
+ LabelManager: typeof LabelManager;
44
46
  };
45
47
  static constants: {
46
48
  AcceptanceStatus: Readonly<{
@@ -69,7 +71,23 @@ declare class Glitch {
69
71
  SEMI_ROUND_ROBINS: 8;
70
72
  EXTENDED: 9;
71
73
  }>;
74
+ ContentStatus: Readonly<{
75
+ UNAPPROVED: 0;
76
+ APPROVED: 1;
77
+ IN_REVIEW: 2;
78
+ PENDING: 3;
79
+ FLAGGED: 4;
80
+ REMOVED: 5;
81
+ DELETED: 6;
82
+ }>;
72
83
  Modes: typeof Modes;
84
+ PostTypes: Readonly<{
85
+ TEXT: "text";
86
+ LINK: "link";
87
+ POLL: "poll";
88
+ IMAGE: "image";
89
+ VIDEO: "video";
90
+ }>;
73
91
  Roles: typeof Roles;
74
92
  TeamJoinProcess: typeof TeamJoinProcess;
75
93
  TicketTypes: typeof TicketTypes;
package/dist/esm/index.js CHANGED
@@ -1,3 +1,31 @@
1
+ var LabelManager = /** @class */ (function () {
2
+ function LabelManager() {
3
+ }
4
+ LabelManager.initialize = function (community) {
5
+ LabelManager.community = community;
6
+ };
7
+ LabelManager.getLabel = function (labelName, plural, capitalize) {
8
+ var label = LabelManager.community[labelName + (plural ? "_plural" : "_singular")];
9
+ if (capitalize) {
10
+ label = label.charAt(0).toUpperCase() + label.slice(1);
11
+ }
12
+ return label;
13
+ };
14
+ LabelManager.getUserLabel = function (plural, capitalize) {
15
+ return LabelManager.getLabel("label_users", plural, capitalize);
16
+ };
17
+ LabelManager.getCompetitionLabel = function (plural, capitalize) {
18
+ return LabelManager.getLabel("label_competitions", plural, capitalize);
19
+ };
20
+ LabelManager.getStreamLabel = function (plural, capitalize) {
21
+ return LabelManager.getLabel("label_streams", plural, capitalize);
22
+ };
23
+ LabelManager.getPostLabel = function (plural, capitalize) {
24
+ return LabelManager.getLabel("label_posts", plural, capitalize);
25
+ };
26
+ return LabelManager;
27
+ }());
28
+
1
29
  /******************************************************************************
2
30
  Copyright (c) Microsoft Corporation.
3
31
 
@@ -30094,6 +30122,7 @@ var Config = /** @class */ (function () {
30094
30122
  Config.setCommunity = function (community) {
30095
30123
  Config._community = community;
30096
30124
  Requests.setCommunityID(community.id);
30125
+ LabelManager.initialize(community);
30097
30126
  };
30098
30127
  Object.defineProperty(Config, "baseUrl", {
30099
30128
  /**
@@ -32365,6 +32394,16 @@ var AddressLocationType = Object.freeze({
32365
32394
  HYBRID: 3,
32366
32395
  });
32367
32396
 
32397
+ var ContentStatus = Object.freeze({
32398
+ UNAPPROVED: 0,
32399
+ APPROVED: 1,
32400
+ IN_REVIEW: 2,
32401
+ PENDING: 3,
32402
+ FLAGGED: 4,
32403
+ REMOVED: 5,
32404
+ DELETED: 6,
32405
+ });
32406
+
32368
32407
  var CompetitionTypes = Object.freeze({
32369
32408
  SINGLE_ELIMINATION: 1,
32370
32409
  DOUBLE_ELIMINATION: 2,
@@ -32384,6 +32423,14 @@ var Modes;
32384
32423
  Modes[Modes["RTMP"] = 2] = "RTMP";
32385
32424
  })(Modes || (Modes = {}));
32386
32425
 
32426
+ var PostTypes = Object.freeze({
32427
+ TEXT: 'text',
32428
+ LINK: 'link',
32429
+ POLL: 'poll',
32430
+ IMAGE: 'image',
32431
+ VIDEO: 'video',
32432
+ });
32433
+
32387
32434
  var Roles;
32388
32435
  (function (Roles) {
32389
32436
  Roles[Roles["NONE"] = 0] = "NONE";
@@ -32470,12 +32517,15 @@ var Glitch = /** @class */ (function () {
32470
32517
  Session: Session,
32471
32518
  Storage: Storage,
32472
32519
  Data: Data,
32520
+ LabelManager: LabelManager,
32473
32521
  };
32474
32522
  Glitch.constants = {
32475
32523
  AcceptanceStatus: AcceptanceStatus,
32476
32524
  AddressLocationType: AddressLocationType,
32477
32525
  CompetitionTypes: CompetitionTypes,
32526
+ ContentStatus: ContentStatus,
32478
32527
  Modes: Modes,
32528
+ PostTypes: PostTypes,
32479
32529
  Roles: Roles,
32480
32530
  TeamJoinProcess: TeamJoinProcess,
32481
32531
  TicketTypes: TicketTypes$1,