@better-giving/endowment 1.1.6 → 1.1.8
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.d.mts +16 -7
- package/dist/db.mjs +0 -3
- package/package.json +1 -1
- package/src/db.mts +22 -7
package/dist/db.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Ensure } from "@better-giving/types/utils";
|
|
1
2
|
import type { EndowId, Endowment as EndowmentShape, Environment, MediaId, MediaType, Milestone as MilestoneShape, MilestoneId, Program as ProgramShape, ProgramId } from "./schema.mjs";
|
|
2
3
|
export type { EndowId, SocialMediaURLs, Allocation, Increment, EndowDesignation, Environment, ProgramId, } from "./schema.mjs";
|
|
3
4
|
export declare const endowGsi: {
|
|
@@ -19,6 +20,10 @@ export declare namespace Endow {
|
|
|
19
20
|
SK: Environment;
|
|
20
21
|
};
|
|
21
22
|
type NonKeyAttributes = EndowmentShape & {
|
|
23
|
+
/** referral id */
|
|
24
|
+
gsi1PK?: `ReferredBy#${string}`;
|
|
25
|
+
/** npo id */
|
|
26
|
+
gsi1SK?: string;
|
|
22
27
|
/** will only be present for unclaimed NPOs */
|
|
23
28
|
updated_at_auto?: string;
|
|
24
29
|
/** in USD @deprecated */
|
|
@@ -65,9 +70,6 @@ export declare namespace Milestone {
|
|
|
65
70
|
interface DbRecord extends Keys, MilestoneShape {
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
|
-
export declare const mediaGsi: {
|
|
69
|
-
readonly 1: "gsi1";
|
|
70
|
-
};
|
|
71
73
|
export declare namespace Media {
|
|
72
74
|
interface Keys {
|
|
73
75
|
PK: `Endow#${EndowId}#${Environment}`;
|
|
@@ -89,11 +91,18 @@ export declare namespace Media {
|
|
|
89
91
|
interface VideoDbRecord extends Keys, VideoAttributes {
|
|
90
92
|
}
|
|
91
93
|
type DbRecord = VideoDbRecord;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
}
|
|
95
|
+
export declare namespace Gsi1 {
|
|
96
|
+
namespace MediaList {
|
|
97
|
+
interface Keys extends Pick<Media.NonKeyAttributes, "gsi1PK" | "gsi1SK"> {
|
|
98
|
+
}
|
|
99
|
+
interface DbRecord extends Media.DbRecord {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
namespace ReferredNpos {
|
|
103
|
+
interface Keys extends Required<Pick<Endow.NonKeyAttributes, "gsi1PK" | "gsi1SK">> {
|
|
95
104
|
}
|
|
96
|
-
interface DbRecord extends
|
|
105
|
+
interface DbRecord extends Ensure<Endow.DbRecord, "gsi1PK" | "gsi1SK" | "referrer" | "referrer_expiry"> {
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
}
|
package/dist/db.mjs
CHANGED
package/package.json
CHANGED
package/src/db.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Ensure } from "@better-giving/types/utils";
|
|
1
2
|
import type {
|
|
2
3
|
EndowId,
|
|
3
4
|
Endowment as EndowmentShape,
|
|
@@ -41,6 +42,11 @@ export namespace Endow {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export type NonKeyAttributes = EndowmentShape & {
|
|
45
|
+
/** referral id */
|
|
46
|
+
gsi1PK?: `ReferredBy#${string}`;
|
|
47
|
+
/** npo id */
|
|
48
|
+
gsi1SK?: string;
|
|
49
|
+
|
|
44
50
|
/** will only be present for unclaimed NPOs */
|
|
45
51
|
updated_at_auto?: string;
|
|
46
52
|
/** in USD @deprecated */
|
|
@@ -90,9 +96,6 @@ export namespace Milestone {
|
|
|
90
96
|
export interface DbRecord extends Keys, MilestoneShape {}
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
export const mediaGsi = {
|
|
94
|
-
1: "gsi1",
|
|
95
|
-
} as const;
|
|
96
99
|
export namespace Media {
|
|
97
100
|
export interface Keys {
|
|
98
101
|
PK: `Endow#${EndowId}#${Environment}`;
|
|
@@ -116,11 +119,23 @@ export namespace Media {
|
|
|
116
119
|
|
|
117
120
|
export interface VideoDbRecord extends Keys, VideoAttributes {}
|
|
118
121
|
export type DbRecord = VideoDbRecord; // | album | article
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export namespace Gsi1 {
|
|
125
|
+
export namespace MediaList {
|
|
126
|
+
export interface Keys
|
|
127
|
+
extends Pick<Media.NonKeyAttributes, "gsi1PK" | "gsi1SK"> {}
|
|
128
|
+
export interface DbRecord extends Media.DbRecord {}
|
|
129
|
+
}
|
|
119
130
|
|
|
120
|
-
export namespace
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
export interface DbRecord
|
|
131
|
+
export namespace ReferredNpos {
|
|
132
|
+
export interface Keys
|
|
133
|
+
extends Required<Pick<Endow.NonKeyAttributes, "gsi1PK" | "gsi1SK">> {}
|
|
134
|
+
export interface DbRecord
|
|
135
|
+
extends Ensure<
|
|
136
|
+
Endow.DbRecord,
|
|
137
|
+
"gsi1PK" | "gsi1SK" | "referrer" | "referrer_expiry"
|
|
138
|
+
> {}
|
|
124
139
|
}
|
|
125
140
|
}
|
|
126
141
|
|