smartletter 1.0.0 → 1.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/README.md +40 -0
- package/dist/index.cjs +35 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2317 -1016
- package/dist/index.d.mts +2317 -1016
- package/dist/index.mjs +35 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,7 @@ var Client = class {
|
|
|
43
43
|
}
|
|
44
44
|
this.key = resolved;
|
|
45
45
|
this.baseUrl = (options.baseUrl || env("SMARTLETTER_BASE_URL") || DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
46
|
-
this.userAgent = options.userAgent ?? `smartletter-node/${"1.
|
|
46
|
+
this.userAgent = options.userAgent ?? `smartletter-node/${"1.2.0"}`;
|
|
47
47
|
}
|
|
48
48
|
async call(op, args, options = {}) {
|
|
49
49
|
const headers = new Headers(options.headers);
|
|
@@ -200,6 +200,9 @@ var OPERATIONS = {
|
|
|
200
200
|
scheduledAt: {
|
|
201
201
|
wire: "scheduled_at"
|
|
202
202
|
},
|
|
203
|
+
topicId: {
|
|
204
|
+
wire: "topic_id"
|
|
205
|
+
},
|
|
203
206
|
attachments: {
|
|
204
207
|
wire: "attachments",
|
|
205
208
|
items: {
|
|
@@ -282,6 +285,9 @@ var OPERATIONS = {
|
|
|
282
285
|
},
|
|
283
286
|
scheduledAt: {
|
|
284
287
|
wire: "scheduled_at"
|
|
288
|
+
},
|
|
289
|
+
topicId: {
|
|
290
|
+
wire: "topic_id"
|
|
285
291
|
}
|
|
286
292
|
}
|
|
287
293
|
},
|
|
@@ -2067,14 +2073,20 @@ var OPERATIONS = {
|
|
|
2067
2073
|
method: "GET",
|
|
2068
2074
|
path: "/sequences/{id}/enrollments",
|
|
2069
2075
|
pathParams: ["id"],
|
|
2070
|
-
paginated:
|
|
2076
|
+
paginated: true,
|
|
2071
2077
|
idempotent: false,
|
|
2072
2078
|
query: {
|
|
2073
|
-
status: {
|
|
2074
|
-
wire: "status"
|
|
2075
|
-
},
|
|
2076
2079
|
limit: {
|
|
2077
2080
|
wire: "limit"
|
|
2081
|
+
},
|
|
2082
|
+
after: {
|
|
2083
|
+
wire: "after"
|
|
2084
|
+
},
|
|
2085
|
+
before: {
|
|
2086
|
+
wire: "before"
|
|
2087
|
+
},
|
|
2088
|
+
status: {
|
|
2089
|
+
wire: "status"
|
|
2078
2090
|
}
|
|
2079
2091
|
}
|
|
2080
2092
|
},
|
|
@@ -2331,9 +2343,18 @@ var OPERATIONS = {
|
|
|
2331
2343
|
method: "GET",
|
|
2332
2344
|
path: "/threads",
|
|
2333
2345
|
pathParams: [],
|
|
2334
|
-
paginated:
|
|
2346
|
+
paginated: true,
|
|
2335
2347
|
idempotent: false,
|
|
2336
2348
|
query: {
|
|
2349
|
+
limit: {
|
|
2350
|
+
wire: "limit"
|
|
2351
|
+
},
|
|
2352
|
+
after: {
|
|
2353
|
+
wire: "after"
|
|
2354
|
+
},
|
|
2355
|
+
before: {
|
|
2356
|
+
wire: "before"
|
|
2357
|
+
},
|
|
2337
2358
|
inboxId: {
|
|
2338
2359
|
wire: "inbox_id"
|
|
2339
2360
|
},
|
|
@@ -2351,12 +2372,6 @@ var OPERATIONS = {
|
|
|
2351
2372
|
},
|
|
2352
2373
|
unread: {
|
|
2353
2374
|
wire: "unread"
|
|
2354
|
-
},
|
|
2355
|
-
limit: {
|
|
2356
|
-
wire: "limit"
|
|
2357
|
-
},
|
|
2358
|
-
after: {
|
|
2359
|
-
wire: "after"
|
|
2360
2375
|
}
|
|
2361
2376
|
}
|
|
2362
2377
|
},
|
|
@@ -2526,7 +2541,14 @@ async function prepare(email) {
|
|
|
2526
2541
|
const out = { ...rest };
|
|
2527
2542
|
if (react) out.html = await renderReact(react);
|
|
2528
2543
|
if (attachments) {
|
|
2529
|
-
out.attachments = attachments.map((a) =>
|
|
2544
|
+
out.attachments = attachments.map((a) => {
|
|
2545
|
+
const { filename, ...file } = a;
|
|
2546
|
+
return {
|
|
2547
|
+
...file,
|
|
2548
|
+
...filename === false ? {} : { filename },
|
|
2549
|
+
...a.content instanceof Uint8Array ? { content: toBase64(a.content) } : {}
|
|
2550
|
+
};
|
|
2551
|
+
});
|
|
2530
2552
|
}
|
|
2531
2553
|
return out;
|
|
2532
2554
|
}
|