@coinlist-co/react 0.12.2-rc.8a0d02a → 0.12.2-rc.99b1bd5
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/README.md +10 -0
- package/dist/{chunk-IZJ4JSSC.js → chunk-IQAJ3L25.js} +173 -253
- package/dist/chunk-IQAJ3L25.js.map +1 -0
- package/dist/{chunk-3WW5FLT7.js → chunk-J45AY2FX.js} +10 -10
- package/dist/chunk-J45AY2FX.js.map +1 -0
- package/dist/{chunk-C6GF7MDF.js → chunk-M2TURNJH.js} +876 -800
- package/dist/chunk-M2TURNJH.js.map +1 -0
- package/dist/chunk-MJ6YXZWH.js +22 -0
- package/dist/chunk-MJ6YXZWH.js.map +1 -0
- package/dist/client/index.d.ts +2836 -5619
- package/dist/client/index.js +7157 -8250
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +2 -32
- package/dist/server/index.js +6 -4
- package/dist/server/index.js.map +1 -1
- package/dist/{time-CVZpAkGY.d.cts → time-DkU7jivQ.d.ts} +1907 -3185
- package/dist/{token-registry-snapshot-BkwA8KmD.d.ts → token-registry-snapshot-D0OWXMe4.d.ts} +22 -58
- package/dist/universal/index.d.ts +81 -1067
- package/dist/universal/index.js +22 -46
- package/package.json +18 -14
- package/dist/chunk-3WW5FLT7.js.map +0 -1
- package/dist/chunk-C6GF7MDF.js.map +0 -1
- package/dist/chunk-IZJ4JSSC.js.map +0 -1
- package/dist/client/index.cjs +0 -20460
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -8195
- package/dist/server/index.cjs +0 -4525
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -382
- package/dist/time-CVZpAkGY.d.ts +0 -3987
- package/dist/token-registry-snapshot-bR14QehS.d.cts +0 -245
- package/dist/universal/index.cjs +0 -4562
- package/dist/universal/index.cjs.map +0 -1
- package/dist/universal/index.d.cts +0 -1362
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/universal/types/oauth-session.ts
|
|
2
|
+
var ClientCredentialsOAuth = (value) => value;
|
|
3
|
+
var OAuthRefreshToken = (value) => value;
|
|
4
|
+
var OAuthSession = {
|
|
5
|
+
fromDto: (dto) => {
|
|
6
|
+
const expiresAt = new Date(Date.now() + dto.expires_in * 1e3);
|
|
7
|
+
return {
|
|
8
|
+
accessToken: {
|
|
9
|
+
value: dto.access_token,
|
|
10
|
+
expiresAt
|
|
11
|
+
},
|
|
12
|
+
...dto.refresh_token != null && dto.refresh_token !== "" ? { refreshToken: OAuthRefreshToken(dto.refresh_token) } : void 0
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
ClientCredentialsOAuth,
|
|
19
|
+
OAuthRefreshToken,
|
|
20
|
+
OAuthSession
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-MJ6YXZWH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/universal/types/oauth-session.ts"],"sourcesContent":["import type { OAuthSessionDto } from '@/universal/types/dto/oauth-session';\nimport type { Newtype } from '@/universal/types/newtype';\n\nexport type ClientCredentialsOAuth = Newtype<\n OAuthAccessToken,\n 'ClientCredentialsOAuth'\n>;\nexport const ClientCredentialsOAuth = (value: OAuthAccessToken) =>\n value as ClientCredentialsOAuth;\n\nexport type OAuthAccessToken = {\n value: string;\n expiresAt: Date;\n};\n\nexport type OAuthRefreshToken = Newtype<string, 'OAuthRefreshToken'>;\nexport const OAuthRefreshToken = (value: string) => value as OAuthRefreshToken;\n\nexport type OAuthSession = {\n accessToken: OAuthAccessToken;\n refreshToken?: OAuthRefreshToken;\n};\n\n/** @internal */\nexport const OAuthSession = {\n fromDto: (dto: OAuthSessionDto): OAuthSession => {\n const expiresAt = new Date(Date.now() + dto.expires_in * 1000);\n return {\n accessToken: {\n value: dto.access_token,\n expiresAt,\n },\n ...(dto.refresh_token != null && dto.refresh_token !== ''\n ? { refreshToken: OAuthRefreshToken(dto.refresh_token) }\n : undefined),\n };\n },\n};\n"],"mappings":";AAOO,IAAM,yBAAyB,CAAC,UACrC;AAQK,IAAM,oBAAoB,CAAC,UAAkB;AAQ7C,IAAM,eAAe;AAAA,EAC1B,SAAS,CAAC,QAAuC;AAC/C,UAAM,YAAY,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,aAAa,GAAI;AAC7D,WAAO;AAAA,MACL,aAAa;AAAA,QACX,OAAO,IAAI;AAAA,QACX;AAAA,MACF;AAAA,MACA,GAAI,IAAI,iBAAiB,QAAQ,IAAI,kBAAkB,KACnD,EAAE,cAAc,kBAAkB,IAAI,aAAa,EAAE,IACrD;AAAA,IACN;AAAA,EACF;AACF;","names":[]}
|