@better-giving/endowment 4.0.10 → 4.0.12

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.
@@ -1,7 +1,7 @@
1
1
  import type { IPageKeyed } from "@better-giving/types/api";
2
2
  import type { Ensure } from "@better-giving/types/utils";
3
- import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
4
3
  import type { CloudsearchEndow } from "./cloudsearch.mjs";
4
+ import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
5
5
  export type { IAllocation, INpo, INpoFields, INposSearch, INpoUpdate, IIncrement, IMediaSearch, IMediaSearchObj, TMediaType, IMediaUpdate, IMilestone, IMilestoneUpdate, IMilestoneNew, IProgram, IProgramDb, IProgramNew, IProgramUpdate, ISocialMediaURLs, } from "./schema.mjs";
6
6
  export { type OrgDesignation as EndowDesignation, type Environment, type UnSdgNum, type DonateMethodId, https_url, } from "@better-giving/schemas";
7
7
  export interface INpoDb extends INpo {
@@ -34,6 +34,7 @@ export interface IMediaPage extends IPageKeyed<IMedia> {
34
34
  export type TNpoDbKeys = keyof INpoDb;
35
35
  export type TArrayValues<T extends readonly unknown[]> = T[number];
36
36
  export type TNpoDbProjectedTo<T> = T extends TNpoDbKeys[] ? Pick<INpoDb, TArrayValues<T>> : INpoDb;
37
+ /** 0 - true, 1 - false, 0 is lexicographically first */
37
38
  export type TBinFlag = "0" | "1";
38
39
  export interface INposPage<T extends keyof CloudsearchEndow = keyof CloudsearchEndow> {
39
40
  items: Pick<CloudsearchEndow, T>[];
package/dist/media.mjs CHANGED
@@ -44,5 +44,5 @@ export function med_key_filter(PK, params) {
44
44
  export const to_imedia = (d) => {
45
45
  const { gsi1SK, gsi1PK, PK, SK, ...rest } = d;
46
46
  const x = med_sk_attr(gsi1SK);
47
- return { ...rest, featured: x.featured === "1" };
47
+ return { ...rest, featured: x.featured === "0" };
48
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/endowment",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "dependencies": {
5
5
  "ksuid": "3.0.0"
6
6
  },
@@ -20,9 +20,7 @@
20
20
  ],
21
21
  "exports": {
22
22
  ".": "./dist/index.mjs",
23
- "./schema": "./dist/schema.mjs",
24
- "./db": "./dist/db.mjs",
25
- "./cloudsearch": "./dist/cloudsearch.mjs"
23
+ "./*": "./dist/*.mjs"
26
24
  },
27
25
  "scripts": {
28
26
  "build": "tsc --outDir dist"
@@ -1,7 +1,7 @@
1
1
  import type { IPageKeyed } from "@better-giving/types/api";
2
2
  import type { Ensure } from "@better-giving/types/utils";
3
- import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
4
3
  import type { CloudsearchEndow } from "./cloudsearch.mjs";
4
+ import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
5
5
  export type {
6
6
  IAllocation,
7
7
  INpo,
@@ -69,6 +69,7 @@ export type TNpoDbProjectedTo<T> = T extends TNpoDbKeys[]
69
69
  ? Pick<INpoDb, TArrayValues<T>>
70
70
  : INpoDb;
71
71
 
72
+ /** 0 - true, 1 - false, 0 is lexicographically first */
72
73
  export type TBinFlag = "0" | "1";
73
74
 
74
75
  export interface INposPage<
package/src/media.mts CHANGED
@@ -63,5 +63,5 @@ export function med_key_filter(
63
63
  export const to_imedia = (d: TRecord): IMedia => {
64
64
  const { gsi1SK, gsi1PK, PK, SK, ...rest } = d;
65
65
  const x = med_sk_attr(gsi1SK);
66
- return { ...rest, featured: x.featured === "1" } as any;
66
+ return { ...rest, featured: x.featured === "0" } as any;
67
67
  };