@yimingliao/cms 0.0.165 → 0.0.167

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.
@@ -44,7 +44,7 @@ function createFilePicker({
44
44
  duration: null
45
45
  }));
46
46
  return Object.assign(file2, {
47
- id: crypto.randomUUID(),
47
+ id: Math.random().toString(36).slice(2),
48
48
  width: mediaInfo.width,
49
49
  height: mediaInfo.height,
50
50
  duration: mediaInfo.duration
@@ -6,14 +6,14 @@ const DEFAULT_OPTIONS = {
6
6
  sameSite: "strict",
7
7
  path: "/"
8
8
  };
9
- function createCookieService(nextCookies, cryptoService) {
9
+ function createCookieService(nextCookies, cryptoService, options = DEFAULT_OPTIONS) {
10
10
  async function set({
11
11
  name,
12
12
  value,
13
13
  expireSeconds
14
14
  }) {
15
15
  const cookieStore = await nextCookies();
16
- cookieStore.set(name, value, { ...DEFAULT_OPTIONS, maxAge: expireSeconds });
16
+ cookieStore.set(name, value, { ...options, maxAge: expireSeconds });
17
17
  }
18
18
  async function setSignedCookie({
19
19
  name,
@@ -1,6 +1,11 @@
1
1
  import type { createCryptoService } from "../crypto";
2
2
  import type { cookies } from "next/headers";
3
- export declare function createCookieService(nextCookies: () => Promise<Awaited<ReturnType<typeof cookies>>>, cryptoService: ReturnType<typeof createCryptoService>): {
3
+ export declare function createCookieService(nextCookies: () => Promise<Awaited<ReturnType<typeof cookies>>>, cryptoService: ReturnType<typeof createCryptoService>, options?: {
4
+ httpOnly: boolean;
5
+ secure: boolean;
6
+ sameSite: "strict";
7
+ path: string;
8
+ }): {
4
9
  set: ({ name, value, expireSeconds, }: {
5
10
  name: string;
6
11
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cookie.service.d.ts","sourceRoot":"","sources":["../../../../../../src/server/infrastructure/cookie/cookie.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAU5C,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,EAC/D,aAAa,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC;2CASlD;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;KACvB;uDASE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;KACvB;oBAa4B;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;gCAMlC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;qCASjB;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE;uBA2ChC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;EAgBvD"}
1
+ {"version":3,"file":"cookie.service.d.ts","sourceRoot":"","sources":["../../../../../../src/server/infrastructure/cookie/cookie.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAU5C,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,EAC/D,aAAa,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EACrD,OAAO;;;;;CAAkB;2CAStB;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;KACvB;uDASE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;KACvB;oBAa4B;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;gCAMlC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;qCASjB;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE;uBA2ChC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;EAgBvD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.165",
3
+ "version": "0.0.167",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",