@step-func-emailer/shared 0.2.0
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/__tests__/constants.test.d.ts +2 -0
- package/dist/__tests__/constants.test.d.ts.map +1 -0
- package/dist/__tests__/constants.test.js +42 -0
- package/dist/__tests__/constants.test.js.map +1 -0
- package/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +22 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +186 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/constants.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_js_1 = require("../constants.js");
|
|
4
|
+
describe("subscriberPK", () => {
|
|
5
|
+
it("prefixes email with SUB#", () => {
|
|
6
|
+
expect((0, constants_js_1.subscriberPK)("user@example.com")).toBe("SUB#user@example.com");
|
|
7
|
+
});
|
|
8
|
+
it("handles empty string", () => {
|
|
9
|
+
expect((0, constants_js_1.subscriberPK)("")).toBe("SUB#");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe("executionSK", () => {
|
|
13
|
+
it("prefixes sequenceId with EXEC#", () => {
|
|
14
|
+
expect((0, constants_js_1.executionSK)("onboarding")).toBe("EXEC#onboarding");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe("sentSK", () => {
|
|
18
|
+
it("prefixes timestamp with SENT#", () => {
|
|
19
|
+
const ts = "2026-01-15T10:00:00.000Z";
|
|
20
|
+
expect((0, constants_js_1.sentSK)(ts)).toBe(`SENT#${ts}`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe("eventSK", () => {
|
|
24
|
+
it("builds EVT#timestamp#eventType", () => {
|
|
25
|
+
const ts = "2026-01-15T10:00:00.000Z";
|
|
26
|
+
expect((0, constants_js_1.eventSK)(ts, "open")).toBe(`EVT#${ts}#open`);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe("constants", () => {
|
|
30
|
+
it("exports expected static values", () => {
|
|
31
|
+
expect(constants_js_1.PROFILE_SK).toBe("PROFILE");
|
|
32
|
+
expect(constants_js_1.EXEC_SK_PREFIX).toBe("EXEC#");
|
|
33
|
+
expect(constants_js_1.SENT_SK_PREFIX).toBe("SENT#");
|
|
34
|
+
expect(constants_js_1.SUPPRESSION_SK).toBe("SUPPRESSION");
|
|
35
|
+
expect(constants_js_1.EVT_SK_PREFIX).toBe("EVT#");
|
|
36
|
+
expect(constants_js_1.TEMPLATE_INDEX).toBe("TemplateIndex");
|
|
37
|
+
expect(constants_js_1.SEND_LOG_TTL_DAYS).toBe(90);
|
|
38
|
+
expect(constants_js_1.EVENT_TTL_DAYS).toBe(365);
|
|
39
|
+
expect(constants_js_1.TEMPLATE_CACHE_TTL_MS).toBe(600_000);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=constants.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.test.js","sourceRoot":"","sources":["../../src/__tests__/constants.test.ts"],"names":[],"mappings":";;AAAA,kDAcyB;AAEzB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,IAAA,2BAAY,EAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAs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AAO,CAAC,CAAC;QACrC,MAAM,CAAC,6BAAc,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3C,MAAM,CAAC,4BAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,6BAAc,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7C,MAAM,CAAC,gCAAiB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,6BAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,oCAAqB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PROFILE_SK: "PROFILE";
|
|
2
|
+
export declare const EXEC_SK_PREFIX: "EXEC#";
|
|
3
|
+
export declare const SENT_SK_PREFIX: "SENT#";
|
|
4
|
+
export declare const SUPPRESSION_SK: "SUPPRESSION";
|
|
5
|
+
export declare const subscriberPK: (email: string) => string;
|
|
6
|
+
export declare const executionSK: (sequenceId: string) => string;
|
|
7
|
+
export declare const sentSK: (isoTimestamp: string) => string;
|
|
8
|
+
export declare const SEND_LOG_TTL_DAYS = 90;
|
|
9
|
+
export declare const TEMPLATE_CACHE_TTL_MS: number;
|
|
10
|
+
export declare const EVT_SK_PREFIX: "EVT#";
|
|
11
|
+
export declare const TEMPLATE_INDEX: "TemplateIndex";
|
|
12
|
+
export declare const eventSK: (isoTimestamp: string, eventType: string) => string;
|
|
13
|
+
export declare const EVENT_TTL_DAYS = 365;
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAG,SAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,EAAG,OAAgB,CAAC;AAC/C,eAAO,MAAM,cAAc,EAAG,OAAgB,CAAC;AAC/C,eAAO,MAAM,cAAc,EAAG,aAAsB,CAAC;AAErD,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAAwB,CAAC;AACtE,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,KAAG,MAA0C,CAAC;AAC5F,eAAO,MAAM,MAAM,GAAI,cAAc,MAAM,KAAG,MAA4C,CAAC;AAE3F,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,qBAAqB,QAAiB,CAAC;AAIpD,eAAO,MAAM,aAAa,EAAG,MAAe,CAAC;AAC7C,eAAO,MAAM,cAAc,EAAG,eAAwB,CAAC;AAEvD,eAAO,MAAM,OAAO,GAAI,cAAc,MAAM,EAAE,WAAW,MAAM,KAAG,MAClB,CAAC;AAEjD,eAAO,MAAM,cAAc,MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVENT_TTL_DAYS = exports.eventSK = exports.TEMPLATE_INDEX = exports.EVT_SK_PREFIX = exports.TEMPLATE_CACHE_TTL_MS = exports.SEND_LOG_TTL_DAYS = exports.sentSK = exports.executionSK = exports.subscriberPK = exports.SUPPRESSION_SK = exports.SENT_SK_PREFIX = exports.EXEC_SK_PREFIX = exports.PROFILE_SK = void 0;
|
|
4
|
+
exports.PROFILE_SK = "PROFILE";
|
|
5
|
+
exports.EXEC_SK_PREFIX = "EXEC#";
|
|
6
|
+
exports.SENT_SK_PREFIX = "SENT#";
|
|
7
|
+
exports.SUPPRESSION_SK = "SUPPRESSION";
|
|
8
|
+
const subscriberPK = (email) => `SUB#${email}`;
|
|
9
|
+
exports.subscriberPK = subscriberPK;
|
|
10
|
+
const executionSK = (sequenceId) => `${exports.EXEC_SK_PREFIX}${sequenceId}`;
|
|
11
|
+
exports.executionSK = executionSK;
|
|
12
|
+
const sentSK = (isoTimestamp) => `${exports.SENT_SK_PREFIX}${isoTimestamp}`;
|
|
13
|
+
exports.sentSK = sentSK;
|
|
14
|
+
exports.SEND_LOG_TTL_DAYS = 90;
|
|
15
|
+
exports.TEMPLATE_CACHE_TTL_MS = 10 * 60 * 1000; // 10 minutes
|
|
16
|
+
// ── Events table ───────────────────────────────────────────────────────────
|
|
17
|
+
exports.EVT_SK_PREFIX = "EVT#";
|
|
18
|
+
exports.TEMPLATE_INDEX = "TemplateIndex";
|
|
19
|
+
const eventSK = (isoTimestamp, eventType) => `${exports.EVT_SK_PREFIX}${isoTimestamp}#${eventType}`;
|
|
20
|
+
exports.eventSK = eventSK;
|
|
21
|
+
exports.EVENT_TTL_DAYS = 365;
|
|
22
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,SAAkB,CAAC;AAChC,QAAA,cAAc,GAAG,OAAgB,CAAC;AAClC,QAAA,cAAc,GAAG,OAAgB,CAAC;AAClC,QAAA,cAAc,GAAG,aAAsB,CAAC;AAE9C,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC;AAAzD,QAAA,YAAY,gBAA6C;AAC/D,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAU,EAAE,CAAC,GAAG,sBAAc,GAAG,UAAU,EAAE,CAAC;AAA/E,QAAA,WAAW,eAAoE;AACrF,MAAM,MAAM,GAAG,CAAC,YAAoB,EAAU,EAAE,CAAC,GAAG,sBAAc,GAAG,YAAY,EAAE,CAAC;AAA9E,QAAA,MAAM,UAAwE;AAE9E,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAEvB,QAAA,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAElE,8EAA8E;AAEjE,QAAA,aAAa,GAAG,MAAe,CAAC;AAChC,QAAA,cAAc,GAAG,eAAwB,CAAC;AAEhD,MAAM,OAAO,GAAG,CAAC,YAAoB,EAAE,SAAiB,EAAU,EAAE,CACzE,GAAG,qBAAa,GAAG,YAAY,IAAI,SAAS,EAAE,CAAC;AADpC,QAAA,OAAO,WAC6B;AAEpC,QAAA,cAAc,GAAG,GAAG,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types.js"), exports);
|
|
18
|
+
__exportStar(require("./constants.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,iDAA+B"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
export interface Subscriber {
|
|
2
|
+
email: string;
|
|
3
|
+
firstName: string;
|
|
4
|
+
attributes?: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface SubscriberProfile {
|
|
7
|
+
PK: string;
|
|
8
|
+
SK: "PROFILE";
|
|
9
|
+
email: string;
|
|
10
|
+
firstName: string;
|
|
11
|
+
unsubscribed: boolean;
|
|
12
|
+
suppressed: boolean;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface ActiveExecution {
|
|
18
|
+
PK: string;
|
|
19
|
+
SK: string;
|
|
20
|
+
executionArn: string;
|
|
21
|
+
sequenceId: string;
|
|
22
|
+
startedAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SendLog {
|
|
25
|
+
PK: string;
|
|
26
|
+
SK: string;
|
|
27
|
+
templateKey: string;
|
|
28
|
+
sequenceId: string;
|
|
29
|
+
subject: string;
|
|
30
|
+
sesMessageId: string;
|
|
31
|
+
ttl: number;
|
|
32
|
+
}
|
|
33
|
+
export interface SuppressionRecord {
|
|
34
|
+
PK: string;
|
|
35
|
+
SK: "SUPPRESSION";
|
|
36
|
+
reason: "bounce" | "complaint";
|
|
37
|
+
bounceType?: string;
|
|
38
|
+
sesNotificationId: string;
|
|
39
|
+
recordedAt: string;
|
|
40
|
+
}
|
|
41
|
+
export interface RegisterInput {
|
|
42
|
+
action: "register";
|
|
43
|
+
sequenceId: string;
|
|
44
|
+
subscriber: Subscriber;
|
|
45
|
+
executionArn: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SendInput {
|
|
48
|
+
action: "send";
|
|
49
|
+
templateKey: string;
|
|
50
|
+
subject: string;
|
|
51
|
+
sequenceId?: string;
|
|
52
|
+
subscriber: Subscriber;
|
|
53
|
+
}
|
|
54
|
+
export interface FireAndForgetInput {
|
|
55
|
+
action: "fire_and_forget";
|
|
56
|
+
templateKey: string;
|
|
57
|
+
subject: string;
|
|
58
|
+
subscriber: Subscriber;
|
|
59
|
+
}
|
|
60
|
+
export interface CompleteInput {
|
|
61
|
+
action: "complete";
|
|
62
|
+
sequenceId: string;
|
|
63
|
+
subscriber: Pick<Subscriber, "email">;
|
|
64
|
+
executionArn: string;
|
|
65
|
+
}
|
|
66
|
+
export type SendEmailInput = RegisterInput | SendInput | FireAndForgetInput | CompleteInput;
|
|
67
|
+
export interface RegisterOutput {
|
|
68
|
+
registered: true;
|
|
69
|
+
}
|
|
70
|
+
export interface SendSuccessOutput {
|
|
71
|
+
sent: true;
|
|
72
|
+
messageId: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SendSkippedOutput {
|
|
75
|
+
sent: false;
|
|
76
|
+
reason: "unsubscribed" | "suppressed";
|
|
77
|
+
}
|
|
78
|
+
export type SendOutput = SendSuccessOutput | SendSkippedOutput;
|
|
79
|
+
export interface CheckConditionInput {
|
|
80
|
+
check: "subscriber_field_exists" | "subscriber_field_equals" | "has_been_sent";
|
|
81
|
+
field?: string;
|
|
82
|
+
value?: string;
|
|
83
|
+
templateKey?: string;
|
|
84
|
+
subscriber: Pick<Subscriber, "email">;
|
|
85
|
+
}
|
|
86
|
+
export interface CheckConditionOutput {
|
|
87
|
+
result: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface UnsubscribeTokenPayload {
|
|
90
|
+
email: string;
|
|
91
|
+
sendTimestamp: string;
|
|
92
|
+
expiryTimestamp: string;
|
|
93
|
+
}
|
|
94
|
+
export interface SsmParameterPaths {
|
|
95
|
+
tableName: string;
|
|
96
|
+
templateBucket: string;
|
|
97
|
+
defaultFromEmail: string;
|
|
98
|
+
defaultFromName: string;
|
|
99
|
+
sesConfigSet: string;
|
|
100
|
+
unsubscribeBaseUrl: string;
|
|
101
|
+
unsubscribeSecret: string;
|
|
102
|
+
}
|
|
103
|
+
export type EmailEventType = "delivery" | "open" | "click" | "bounce" | "complaint";
|
|
104
|
+
export interface EmailEvent {
|
|
105
|
+
PK: string;
|
|
106
|
+
SK: string;
|
|
107
|
+
eventType: EmailEventType;
|
|
108
|
+
templateKey: string;
|
|
109
|
+
sequenceId: string;
|
|
110
|
+
subject: string;
|
|
111
|
+
linkUrl?: string;
|
|
112
|
+
userAgent?: string;
|
|
113
|
+
sesMessageId: string;
|
|
114
|
+
timestamp: string;
|
|
115
|
+
ttl: number;
|
|
116
|
+
}
|
|
117
|
+
export interface SubscriberMapping {
|
|
118
|
+
email: string;
|
|
119
|
+
firstName: string;
|
|
120
|
+
attributes?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface SequenceTrigger {
|
|
123
|
+
detailType: string;
|
|
124
|
+
subscriberMapping: SubscriberMapping;
|
|
125
|
+
}
|
|
126
|
+
export interface SendStep {
|
|
127
|
+
type: "send";
|
|
128
|
+
templateKey: string;
|
|
129
|
+
subject: string;
|
|
130
|
+
}
|
|
131
|
+
export interface WaitStep {
|
|
132
|
+
type: "wait";
|
|
133
|
+
days?: number;
|
|
134
|
+
hours?: number;
|
|
135
|
+
minutes?: number;
|
|
136
|
+
}
|
|
137
|
+
export interface ConditionStep {
|
|
138
|
+
type: "condition";
|
|
139
|
+
check: "subscriber_field_exists" | "subscriber_field_equals" | "has_been_sent";
|
|
140
|
+
field?: string;
|
|
141
|
+
value?: string;
|
|
142
|
+
templateKey?: string;
|
|
143
|
+
then: SequenceStep[];
|
|
144
|
+
else?: SequenceStep[];
|
|
145
|
+
}
|
|
146
|
+
export interface ChoiceBranch {
|
|
147
|
+
value: string;
|
|
148
|
+
steps: SequenceStep[];
|
|
149
|
+
}
|
|
150
|
+
export interface ChoiceStep {
|
|
151
|
+
type: "choice";
|
|
152
|
+
field: string;
|
|
153
|
+
branches: ChoiceBranch[];
|
|
154
|
+
default?: SequenceStep[];
|
|
155
|
+
}
|
|
156
|
+
export type SequenceStep = SendStep | WaitStep | ConditionStep | ChoiceStep;
|
|
157
|
+
export interface EventEmail {
|
|
158
|
+
detailType: string;
|
|
159
|
+
templateKey: string;
|
|
160
|
+
subject: string;
|
|
161
|
+
subscriberMapping?: SubscriberMapping;
|
|
162
|
+
}
|
|
163
|
+
export interface SequenceDefinition {
|
|
164
|
+
id: string;
|
|
165
|
+
trigger: SequenceTrigger;
|
|
166
|
+
timeoutMinutes: number;
|
|
167
|
+
steps: SequenceStep[];
|
|
168
|
+
events?: EventEmail[];
|
|
169
|
+
}
|
|
170
|
+
export interface StepFuncEmailerConfig {
|
|
171
|
+
account: string;
|
|
172
|
+
region: string;
|
|
173
|
+
stackName: string;
|
|
174
|
+
tableName: string;
|
|
175
|
+
eventsTableName: string;
|
|
176
|
+
templateBucketName: string;
|
|
177
|
+
eventBusName: string;
|
|
178
|
+
sesConfigSetName: string;
|
|
179
|
+
snsTopicName: string;
|
|
180
|
+
defaultFromEmail: string;
|
|
181
|
+
defaultFromName: string;
|
|
182
|
+
replyToEmail?: string;
|
|
183
|
+
unsubscribeSecret: string;
|
|
184
|
+
ssmPrefix: string;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,C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AAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,+EAA+E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@step-func-emailer/shared",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Shared types and constants for step-func-emailer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/mdwt/step-func-emailer.git",
|
|
18
|
+
"directory": "packages/shared"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"lint": "eslint src"
|
|
25
|
+
}
|
|
26
|
+
}
|