@jsb188/app 1.1.8 → 1.1.10

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.
@@ -2499,6 +2499,7 @@ export function getDayLightSavingsInfo(tz: string, d?: Date) {
2499
2499
  * @param date - Date object or date string to extract time from if hhmmStr is not provided
2500
2500
  * @param addAMPM - If true, return time in "HH:MM AM/PM" format, otherwise "HH:MM" format
2501
2501
  * @param timeZone - Timezone string (IANA format), defaults to DEFAULT_TIMEZONE
2502
+ * @param short - If true, hide ":00" minutes (e.g. "5 PM" instead of "5:00 PM")
2502
2503
  * @returns {string} - Formatted time string
2503
2504
  */
2504
2505
 
@@ -2507,6 +2508,7 @@ export function hhmmFromDateOrTime(
2507
2508
  dVal: Date | string | null,
2508
2509
  addAMPM: boolean,
2509
2510
  timeZone?: string | null,
2511
+ short?: boolean,
2510
2512
  ): string {
2511
2513
  let hhmm: string = '';
2512
2514
  if (hhmmStr && /^[0-9]{3,4}$/.test(String(hhmmStr))) {
@@ -2533,13 +2535,14 @@ export function hhmmFromDateOrTime(
2533
2535
  }
2534
2536
 
2535
2537
  if (hh) {
2538
+ const minuteText = short && mm === '00' ? '' : `:${mm}`;
2536
2539
  if (addAMPM) {
2537
2540
  const hourNum = parseInt(hh, 10);
2538
2541
  const ampm = hourNum >= 12 ? 'PM' : 'AM';
2539
2542
  const hour12 = hourNum % 12 === 0 ? 12 : hourNum % 12;
2540
- return `${hour12}:${mm} ${ampm}`;
2543
+ return `${hour12}${minuteText} ${ampm}`;
2541
2544
  }
2542
- return `${hh}:${mm}`;
2545
+ return `${hh}${minuteText}`;
2543
2546
  }
2544
2547
 
2545
2548
  return '';
@@ -2584,4 +2587,4 @@ export function getDayOfWeekInTimeZone(date: Date, timeZone: string | null): num
2584
2587
  Fri: 5,
2585
2588
  Sat: 6,
2586
2589
  }[day as 'Sun'];
2587
- }
2590
+ }
@@ -17,24 +17,24 @@ type LinkType = 'USER' | 'KAJI' | 'DATASET' | 'VOICE' | 'FEED' | 'ROOM' | 'THREA
17
17
 
18
18
  export function makeUploadsUrl(
19
19
  urlPath?: string | null,
20
- size?: string,
21
- animateGifs?: boolean,
20
+ size?: 'small' | 'medium' | 'original',
21
+ download?: boolean,
22
22
  ): string {
23
23
  if (!urlPath) {
24
24
  return '';
25
25
  }
26
26
 
27
- const isGif = urlPath.substring(urlPath.lastIndexOf('.')).toLowerCase() === '.gif';
28
-
29
- let prefix = '';
30
- if (isGif && animateGifs) {
31
- // Do gif path here
32
- prefix = '';
33
- } else {
34
- // Do size paths here
27
+ const searchParams: string[] = [];
28
+ if (size) {
29
+ searchParams.push(`size=${encodeURIComponent(size)}`);
30
+ }
31
+ if (download) {
32
+ searchParams.push('download=1');
35
33
  }
36
34
 
37
- return 'https://assets.chiefhappiness.co/marketday/' + prefix + urlPath;
35
+ const searchPath = searchParams.length ? `?${searchParams.join('&')}` : '';
36
+
37
+ return 'https://assets.chiefhappiness.co/marketday/' + urlPath + searchPath;
38
38
  }
39
39
 
40
40
  /**
package/tsconfig.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "allowImportingTsExtensions": true,
7
7
  "noEmit": true,
8
8
  "strict": true,
9
- "skipLibCheck": true,
10
9
  "esModuleInterop": true
11
10
  },
12
11
  "include": ["src/**/*"]
@@ -1,4 +0,0 @@
1
-
2
- export const STORAGE_INTENT_ENUMS = [
3
- 'REPORT_SUBMISSION_FILE'
4
- ];
@@ -1,63 +0,0 @@
1
- import type { OrganizationACL, OrganizationRoleEnum } from './organization.d.ts';
2
-
3
- /**
4
- * Account; phone
5
- */
6
-
7
- export interface AccountPhoneObj {
8
- id: number;
9
- number: string;
10
- verified: boolean;
11
- }
12
-
13
- /**
14
- * Account
15
- */
16
-
17
- export interface AccountObj {
18
- id: number;
19
- settings: Record<string, any>;
20
- profile: Partial<{
21
- firstName: string;
22
- lastName: string;
23
- storageId: number | null;
24
- // phone: AccountPhoneObj | null; // ?? This is a coding mistake, I think
25
- }>;
26
- }
27
-
28
- export interface AccountData extends AccountObj {
29
- __table: 'accounts';
30
- phone: {
31
- id: number;
32
- number: string;
33
- verified: boolean;
34
- banned: boolean;
35
- editAt: Date;
36
- };
37
- email: {
38
- id: number;
39
- address: string;
40
- verified: boolean;
41
- banned: boolean;
42
- editAt: Date;
43
- };
44
- createdAt: Date;
45
- updatedAt: Date;
46
- }
47
-
48
- /**
49
- * Account with membership
50
- */
51
-
52
- export interface AccountMembershipData {
53
- id: number;
54
- accountId: number;
55
- organizationId: number;
56
- role: OrganizationRoleEnum;
57
- acl: OrganizationACL;
58
- notes?: string;
59
- primary: boolean;
60
- createdAt: Date;
61
- updatedAt: Date;
62
- account: AccountData;
63
- }
@@ -1,70 +0,0 @@
1
- import { STORAGE_INTENT_ENUMS } from '../constants/storage.ts';
2
-
3
- /**
4
- * Enums
5
- */
6
-
7
- export type StorageIntentEnum = typeof STORAGE_INTENT_ENUMS[number];
8
-
9
- /**
10
- * Storage
11
- */
12
-
13
- export interface StorageData {
14
- __table: 'storage';
15
- id: number;
16
- organizationId: number | null;
17
- accountId: number | null;
18
- uri: string;
19
- size: number;
20
- checked: boolean;
21
- at: Date;
22
- contentType: string;
23
- values: Record<string, any> | null;
24
- }
25
-
26
- export interface StorageGQL {
27
- __deleted?: boolean;
28
-
29
- id: string;
30
- organizationId: string | null;
31
- accountId: string | null;
32
- uri: string;
33
- size: number;
34
- checked: boolean;
35
- at: Date;
36
- contentType: string;
37
-
38
- // client-side only
39
- uploadStatus?: 'ERROR' | 'UPLOADING' | null;
40
-
41
- // metadata
42
- name: string | null;
43
- description: string | null;
44
- aiNote: string | null;
45
- }
46
-
47
- export type StorageUploadObj = Partial<{
48
- uploaderAccountId: number;
49
- values: Partial<{
50
- name: string;
51
- description: string;
52
- aiNote: string;
53
- }>;
54
- uploadIntent: {
55
- intent: StorageIntentEnum;
56
- entries: [string, string][];
57
- };
58
- upsertQuery?: RelatedDocumentUpsertQuery;
59
- realTimeUpdate?: string; // JSON.stringified object; "{{storageId}}" will be replaced with actual storage ID after upload
60
- }>;
61
-
62
- /**
63
- * Post-upload related document query execution object
64
- */
65
-
66
- export interface RelatedDocumentUpsertQuery {
67
- __table: string;
68
- conflictKeys: string[];
69
- data: Record<string, any>;
70
- }