@solar-kit/planets 1.0.1 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-kit/planets",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/sun/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './entity';
2
2
  export * from './model';
3
3
  export * from './operator';
4
4
  export * from './pagination';
5
+ export * from './wx';
package/sun/index.js CHANGED
@@ -2,4 +2,5 @@ export * from './entity.js';
2
2
  export * from './model.js';
3
3
  export * from './operator.js';
4
4
  export * from './pagination.js';
5
+ export * from './wx.js';
5
6
  //# sourceMappingURL=index.js.map
package/sun/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/planets/src/sun/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/planets/src/sun/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,MAAM,CAAA"}
package/sun/model.d.ts CHANGED
@@ -7,3 +7,8 @@ export declare const enum Gender {
7
7
  Woman = 0,
8
8
  Man = 1
9
9
  }
10
+ export interface AuthTokens {
11
+ accessToken: string;
12
+ refreshToken?: string;
13
+ expiresIn?: number;
14
+ }
package/sun/operator.d.ts CHANGED
@@ -1,10 +1,13 @@
1
+ import { MonoTypeOperatorFunction } from 'rxjs';
1
2
  import { Result } from './model';
2
3
  /**
3
4
  * 根据 code 过滤 result
4
5
  * @param code 默认为 0
5
6
  */
6
- export declare function filterResult<T extends Result<any>>(code?: number): import("rxjs").MonoTypeOperatorFunction<T>;
7
+ export declare function filterResult<T extends Result<any>>(code?: number): MonoTypeOperatorFunction<T>;
7
8
  /**
8
9
  * 解包 result 里的 data 出来
9
10
  */
10
11
  export declare function unpackResult<T extends Result<any>>(): import("rxjs").OperatorFunction<T, T["data"]>;
12
+ export declare function tapResult<T extends Result<any>>(next: (value: T) => void): MonoTypeOperatorFunction<T>;
13
+ export declare function tapResult<T extends Result<any>>(code: number, next: (value: T) => void): MonoTypeOperatorFunction<T>;
package/sun/operator.js CHANGED
@@ -1,4 +1,4 @@
1
- import { filter, map } from 'rxjs';
1
+ import { filter, map, tap } from 'rxjs';
2
2
  /**
3
3
  * 根据 code 过滤 result
4
4
  * @param code 默认为 0
@@ -12,4 +12,20 @@ export function filterResult(code = 0) {
12
12
  export function unpackResult() {
13
13
  return map(({ data }) => data);
14
14
  }
15
+ export function tapResult(codeOrNext, next) {
16
+ let code = 0;
17
+ let callback;
18
+ if (typeof codeOrNext === 'number') {
19
+ code = codeOrNext;
20
+ callback = next;
21
+ }
22
+ else {
23
+ callback = codeOrNext;
24
+ }
25
+ return tap(value => {
26
+ if (value.code === code) {
27
+ callback(value);
28
+ }
29
+ });
30
+ }
15
31
  //# sourceMappingURL=operator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operator.js","sourceRoot":"","sources":["../../../../packages/planets/src/sun/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAGnC;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAwB,IAAI,GAAG,CAAC;IAC1D,OAAO,MAAM,CAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,GAAG,CAAe,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"file":"operator.js","sourceRoot":"","sources":["../../../../packages/planets/src/sun/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAA4B,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAwB,IAAI,GAAG,CAAC;IAC1D,OAAO,MAAM,CAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,GAAG,CAAe,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAID,MAAM,UAAU,SAAS,CAAwB,UAAyC,EAAE,IAAyB;IACnH,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,QAA4B,CAAA;IAEhC,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,IAAI,GAAG,UAAU,CAAA;QACjB,QAAQ,GAAG,IAAK,CAAA;IAClB,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,UAAU,CAAA;IACvB,CAAC;IAED,OAAO,GAAG,CAAI,KAAK,CAAC,EAAE;QACpB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACxB,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/sun/wx.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /** 微信支付参数 */
2
+ export interface WxPayment {
3
+ nonceStr: string;
4
+ paySign: string;
5
+ prepayId: string;
6
+ signType: 'HMAC-SHA256' | 'MD5';
7
+ timeStamp: string;
8
+ }
package/sun/wx.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wx.js.map
package/sun/wx.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wx.js","sourceRoot":"","sources":["../../../../packages/planets/src/sun/wx.ts"],"names":[],"mappings":""}