@das-fed/upf-utils 6.4.0-dev.268 → 6.4.0-dev.270

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 (55) hide show
  1. package/api-services/modules/authentication/es5.js +857 -860
  2. package/api-services/modules/authentication/index.js +670 -674
  3. package/api-services/modules/authentication/index.js.gz +0 -0
  4. package/api-services/modules/bems/es5.js +1153 -1141
  5. package/api-services/modules/bems/index.js +964 -946
  6. package/api-services/modules/bems/index.js.gz +0 -0
  7. package/api-services/modules/contract/es5.js +1133 -1124
  8. package/api-services/modules/contract/index.js +947 -933
  9. package/api-services/modules/contract/index.js.gz +0 -0
  10. package/api-services/modules/duty-manage/es5.js +1119 -1110
  11. package/api-services/modules/duty-manage/index.js +934 -920
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/es5.js +1355 -1367
  14. package/api-services/modules/gateway-edge/es5.js +1122 -1134
  15. package/api-services/modules/gateway-edge/index.js +930 -948
  16. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  17. package/api-services/modules/index.js +1068 -1086
  18. package/api-services/modules/index.js.gz +0 -0
  19. package/api-services/modules/iot/es5.js +1241 -1229
  20. package/api-services/modules/iot/index.js +1039 -1021
  21. package/api-services/modules/iot/index.js.gz +0 -0
  22. package/api-services/modules/link/es5.js +860 -857
  23. package/api-services/modules/link/index.js +674 -670
  24. package/api-services/modules/link/index.js.gz +0 -0
  25. package/api-services/modules/permission/es5.js +852 -850
  26. package/api-services/modules/permission/index.js +671 -667
  27. package/api-services/modules/permission/index.js.gz +0 -0
  28. package/api-services/modules/platformManage/es5.js +863 -866
  29. package/api-services/modules/platformManage/index.js +673 -677
  30. package/api-services/modules/platformManage/index.js.gz +0 -0
  31. package/api-services/modules/super-admin/es5.js +1138 -1126
  32. package/api-services/modules/super-admin/index.js +950 -932
  33. package/api-services/modules/super-admin/index.js.gz +0 -0
  34. package/api-services/modules/supplychain-manage/es5.js +1122 -1134
  35. package/api-services/modules/supplychain-manage/index.js +930 -948
  36. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  37. package/api-services/src/create-service/es5.js +1120 -1132
  38. package/api-services/src/create-service/index.js +929 -947
  39. package/api-services/src/create-service/index.js.gz +0 -0
  40. package/common-info/es5.js +1293 -1281
  41. package/common-info/getPermissionMethod/es5.js +1388 -1376
  42. package/common-info/getPermissionMethod/index.js +1155 -1137
  43. package/common-info/getPermissionMethod/index.js.gz +0 -0
  44. package/common-info/index.js +1073 -1055
  45. package/common-info/index.js.gz +0 -0
  46. package/common-tools/timezone-format/es5.d.ts +29 -1
  47. package/common-tools/timezone-format/es5.js +524 -416
  48. package/common-tools/timezone-format/index.d.ts +29 -1
  49. package/common-tools/timezone-format/index.js +360 -290
  50. package/common-tools/timezone-format/index.js.gz +0 -0
  51. package/create-api-service/es5.js +1121 -1133
  52. package/create-api-service/index.js +930 -948
  53. package/create-api-service/index.js.gz +0 -0
  54. package/esm-map.json +9 -1
  55. package/package.json +3 -3
Binary file
@@ -1,9 +1,10 @@
1
- import { Dayjs } from 'dayjs';
1
+ import { default as dayjs, Dayjs } from 'dayjs';
2
2
  import { default as dayjsTimezoneIanaPlugin, PackedIanaData, PreloadDayjsIanaOptions } from './get-iana-data/dayjs-timezone-iana-plugin';
3
3
  import { loadIanaData as loadMomentIanaData, loadIanaFromApi as loadMomentIanaFromApi, LoadIanaFromApiOptions, MomentWithTimezone, PackedIanaTzData } from './get-iana-data/moment-iana-loader';
4
4
 
5
5
  export * from './get-iana-data';
6
6
  export { dayjsTimezoneIanaPlugin, loadMomentIanaData, loadMomentIanaFromApi };
7
+ export type TimeZoneDayjsFactory = typeof dayjs;
7
8
  export type TimeValue = string | number | Date | Dayjs | null | undefined;
8
9
  export type TimeZoneFlag = number | string | null | undefined;
9
10
  export type TimeZoneDateLibrary = 'dayjs' | 'moment';
@@ -94,9 +95,21 @@ export interface FormatLocalDateTimeOptions {
94
95
  /** 未传 timeZone 时是否读取 sessionStorage/客户端时区。默认 false,兼容旧 toLocalDate。 */
95
96
  useClientTimeZone?: boolean;
96
97
  }
98
+ export interface FormatLocalDateTimeIntlOptions {
99
+ /** 输出格式,支持常用 YYYY/MM/DD/HH/mm/ss/SSS token,默认 YYYY-MM-DD HH:mm:ss。 */
100
+ format?: string;
101
+ /** 目标 IANA 时区;为空时读取当前客户端时区。 */
102
+ timeZone?: string | null;
103
+ /** Intl 本地化语言,默认 zh-CN。 */
104
+ locale?: string;
105
+ }
97
106
  export interface ApplyIanaTimeZoneOptions {
98
107
  /** 指定默认时区,后续 dayjs.tz(value) 可直接使用。 */
99
108
  defaultTimeZone?: string;
109
+ /** 写入运行期快照的数据来源,供 mframe 注入 iframe 首屏复用。 */
110
+ runtimeSource?: RuntimeIanaTimeZoneDataSource;
111
+ /** 是否同步 window.__UPF_IANA_TIMEZONE_DATA__ 并派发事件,默认 true。 */
112
+ syncRuntimeSnapshot?: boolean;
100
113
  }
101
114
  export interface LoadIanaTimeZoneOptions extends PreloadDayjsIanaOptions, ApplyIanaTimeZoneOptions {
102
115
  }
@@ -126,8 +139,20 @@ export interface SetClientTimeZoneOptions {
126
139
  source?: string;
127
140
  }
128
141
  export type ClientTimeZoneChangeHandler = (timeZone: string, detail: ClientTimeZoneChangeDetail) => void;
142
+ export type RuntimeIanaTimeZoneDataSource = 'iana' | 'fallback';
143
+ export interface RuntimeIanaTimeZoneDataSnapshot extends PackedIanaData {
144
+ /** 数据来源:接口 IANA 数据或降级兜底数据。 */
145
+ source: RuntimeIanaTimeZoneDataSource;
146
+ /** 写入快照时间,供宿主和 iframe 判断是否需要刷新。 */
147
+ timestamp: number;
148
+ }
129
149
  export declare const TIMEZONE_CHANGE_EVENT = "timezonechange";
130
150
  export declare const UPF_TIMEZONE_MESSAGE_TYPE = "__UPF_TIMEZONE_CHANGE__";
151
+ export declare const IANA_TIMEZONE_DATA_CHANGE_EVENT = "ianatimezonedatachange";
152
+ export declare const timeZoneDayjs: TimeZoneDayjsFactory;
153
+ export declare const setRuntimeIanaTimeZoneDataSnapshot: (data: Pick<PackedIanaData, "version" | "zones" | "links">, source?: RuntimeIanaTimeZoneDataSource) => RuntimeIanaTimeZoneDataSnapshot;
154
+ export declare const getRuntimeIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
155
+ export declare const getRuntimeNameZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
131
156
  export declare const clientTimeZone: any;
132
157
  export declare const isKnownTimeZone: (timeZone?: string | null) => any;
133
158
  export declare const rebuildKnownTimeZoneIds: (data: Pick<PackedIanaData, "zones" | "links">) => any;
@@ -144,9 +169,12 @@ export declare const initClientTimeZoneSync: () => boolean;
144
169
  export declare const getClientTimeZone: () => any;
145
170
  export declare const resolveTimeZone: (timeZone?: string | null) => any;
146
171
  export declare const normalizeLocaleCode: (locale?: string, supportedLocales?: string[]) => any;
172
+ export declare const getTimeZoneDayjs: () => TimeZoneDayjsFactory;
147
173
  export declare const getZoneUtcOffset: (value: TimeValue, timeZone?: string | null) => any;
148
174
  export declare const formatInTimeZone: (value?: TimeValue, timeZone?: string | null, format?: string) => any;
175
+ export declare const isMomentTimezoneFormatInstance: (moment?: unknown) => moment is MomentTimezoneFormatInstance;
149
176
  export declare const formatLocalDateTime: (value?: TimeValue, options?: FormatLocalDateTimeOptions | string) => string;
177
+ export declare const formatLocalDateTimeIntl: (value?: TimeValue, options?: FormatLocalDateTimeIntlOptions | string) => string;
150
178
  export declare const toLocalDate: (value?: TimeValue, format?: string, options?: Omit<FormatLocalDateTimeOptions, "format">) => string;
151
179
  export declare const formatTimeZoneOffsetLabel: (value?: TimeValue, timeZone?: string | null) => string;
152
180
  export declare const resolveUtcOffsetFallback: (option: Pick<TimeZoneOption, "timeZoneId" | "baseUtcOffsetText" | "currentUtcOffsetText">, referenceDate?: Date) => string;