@better-giving/endowment 4.0.9 → 4.0.11

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/dist/db.mjs CHANGED
@@ -187,7 +187,7 @@ export class NpoDb extends Db {
187
187
  return i && to_imedia(i);
188
188
  }
189
189
  async npo_med_update(npo, prev, update) {
190
- const new_sk = med_sk(prev.id, prev.type, (update.featured ?? prev.featured) ? "0" : "1");
190
+ const new_sk = med_sk(prev.id, prev.type, (update.featured ?? prev.featured) ? "1" : "0");
191
191
  const cmd = new UpdateCommand({
192
192
  TableName: NpoDb.name,
193
193
  Key: this.key_npo_med(prev.id, npo),
@@ -1,5 +1,6 @@
1
1
  import type { IPageKeyed } from "@better-giving/types/api";
2
2
  import type { Ensure } from "@better-giving/types/utils";
3
+ import type { CloudsearchEndow } from "./cloudsearch.mjs";
3
4
  import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
4
5
  export type { IAllocation, INpo, INpoFields, INposSearch, INpoUpdate, IIncrement, IMediaSearch, IMediaSearchObj, TMediaType, IMediaUpdate, IMilestone, IMilestoneUpdate, IMilestoneNew, IProgram, IProgramDb, IProgramNew, IProgramUpdate, ISocialMediaURLs, } from "./schema.mjs";
5
6
  export { type OrgDesignation as EndowDesignation, type Environment, type UnSdgNum, type DonateMethodId, https_url, } from "@better-giving/schemas";
@@ -34,8 +35,8 @@ export type TNpoDbKeys = keyof INpoDb;
34
35
  export type TArrayValues<T extends readonly unknown[]> = T[number];
35
36
  export type TNpoDbProjectedTo<T> = T extends TNpoDbKeys[] ? Pick<INpoDb, TArrayValues<T>> : INpoDb;
36
37
  export type TBinFlag = "0" | "1";
37
- export interface INposPage<T extends keyof INpoDb = keyof INpoDb> {
38
- items: Pick<INpoDb, T>[];
38
+ export interface INposPage<T extends keyof CloudsearchEndow = keyof CloudsearchEndow> {
39
+ items: Pick<CloudsearchEndow, T>[];
39
40
  page: number;
40
41
  pages: number;
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/endowment",
3
- "version": "4.0.9",
3
+ "version": "4.0.11",
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"
package/src/db.mts CHANGED
@@ -251,7 +251,7 @@ export class NpoDb extends Db {
251
251
  const new_sk = med_sk(
252
252
  prev.id,
253
253
  prev.type,
254
- (update.featured ?? prev.featured) ? "0" : "1"
254
+ (update.featured ?? prev.featured) ? "1" : "0"
255
255
  );
256
256
 
257
257
  const cmd = new UpdateCommand({
@@ -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 { CloudsearchEndow } from "./cloudsearch.mjs";
3
4
  import type { IMediaUpdate, INpo, TMediaType } from "./schema.mjs";
4
-
5
5
  export type {
6
6
  IAllocation,
7
7
  INpo,
@@ -71,8 +71,10 @@ export type TNpoDbProjectedTo<T> = T extends TNpoDbKeys[]
71
71
 
72
72
  export type TBinFlag = "0" | "1";
73
73
 
74
- export interface INposPage<T extends keyof INpoDb = keyof INpoDb> {
75
- items: Pick<INpoDb, T>[];
74
+ export interface INposPage<
75
+ T extends keyof CloudsearchEndow = keyof CloudsearchEndow,
76
+ > {
77
+ items: Pick<CloudsearchEndow, T>[];
76
78
  page: number;
77
79
  pages: number;
78
80
  }