@knocklabs/node 1.27.0 → 1.29.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/CHANGELOG.md +62 -0
- package/LICENSE +1 -1
- package/client.d.mts +3 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -2
- package/client.d.ts.map +1 -1
- package/client.js +18 -3
- package/client.js.map +1 -1
- package/client.mjs +18 -3
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audiences.d.mts +25 -31
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +25 -31
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js +9 -3
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs +9 -3
- package/resources/audiences.mjs.map +1 -1
- package/resources/messages/messages.d.mts +4 -4
- package/resources/messages/messages.d.ts +4 -4
- package/resources/objects/objects.d.mts +4 -4
- package/resources/objects/objects.d.ts +4 -4
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/users/feeds.d.mts +37 -0
- package/resources/users/feeds.d.mts.map +1 -1
- package/resources/users/feeds.d.ts +37 -0
- package/resources/users/feeds.d.ts.map +1 -1
- package/resources/users/feeds.js +3 -0
- package/resources/users/feeds.js.map +1 -1
- package/resources/users/feeds.mjs +3 -0
- package/resources/users/feeds.mjs.map +1 -1
- package/resources/users/guides.d.mts +23 -1
- package/resources/users/guides.d.mts.map +1 -1
- package/resources/users/guides.d.ts +23 -1
- package/resources/users/guides.d.ts.map +1 -1
- package/resources/users/users.d.mts +4 -4
- package/resources/users/users.d.ts +4 -4
- package/src/client.ts +26 -6
- package/src/internal/parse.ts +6 -0
- package/src/resources/audiences.ts +28 -33
- package/src/resources/messages/messages.ts +4 -4
- package/src/resources/objects/objects.ts +4 -4
- package/src/resources/shared.ts +5 -1
- package/src/resources/users/feeds.ts +44 -0
- package/src/resources/users/guides.ts +32 -1
- package/src/resources/users/users.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/users/feeds.js
CHANGED
|
@@ -35,6 +35,9 @@ class Feeds extends resource_1.APIResource {
|
|
|
35
35
|
* along with a user token.
|
|
36
36
|
* - This endpoint’s rate limit is always scoped per-user and per-environment. This
|
|
37
37
|
* is true even for requests made without a signed user token.
|
|
38
|
+
* - Any [attachments](/integrations/email/attachments) present in trigger data are
|
|
39
|
+
* automatically excluded from both the `data` and `activities` fields of
|
|
40
|
+
* `UserInAppFeedResponse`.
|
|
38
41
|
*
|
|
39
42
|
* @example
|
|
40
43
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeds.js","sourceRoot":"","sources":["../../src/resources/users/feeds.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,yDAA6F;AAE7F,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAc,EAAE,EAAU,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"feeds.js","sourceRoot":"","sources":["../../src/resources/users/feeds.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,yDAA6F;AAE7F,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAc,EAAE,EAAU,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,CACP,MAAc,EACd,EAAU,EACV,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,aAAa,MAAM,UAAU,EAAE,EAAE,EACrC,CAAA,0BAAoC,CAAA,EACpC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA1DD,sBA0DC"}
|
|
@@ -32,6 +32,9 @@ export class Feeds extends APIResource {
|
|
|
32
32
|
* along with a user token.
|
|
33
33
|
* - This endpoint’s rate limit is always scoped per-user and per-environment. This
|
|
34
34
|
* is true even for requests made without a signed user token.
|
|
35
|
+
* - Any [attachments](/integrations/email/attachments) present in trigger data are
|
|
36
|
+
* automatically excluded from both the `data` and `activities` fields of
|
|
37
|
+
* `UserInAppFeedResponse`.
|
|
35
38
|
*
|
|
36
39
|
* @example
|
|
37
40
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeds.mjs","sourceRoot":"","sources":["../../src/resources/users/feeds.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,aAAa,EAAyC;OAExD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAc,EAAE,EAAU,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"feeds.mjs","sourceRoot":"","sources":["../../src/resources/users/feeds.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,aAAa,EAAyC;OAExD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAc,EAAE,EAAU,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,CACP,MAAc,EACd,EAAU,EACV,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,aAAa,MAAM,UAAU,EAAE,EAAE,EACrC,CAAA,aAAoC,CAAA,EACpC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -108,6 +108,10 @@ export interface GuideGetChannelResponse {
|
|
|
108
108
|
* A list of guide groups with their display sequences and intervals.
|
|
109
109
|
*/
|
|
110
110
|
guide_groups: Array<GuideGetChannelResponse.GuideGroup>;
|
|
111
|
+
/**
|
|
112
|
+
* Markers for guides the user is not eligible to see.
|
|
113
|
+
*/
|
|
114
|
+
ineligible_guides: Array<GuideGetChannelResponse.IneligibleGuide>;
|
|
111
115
|
}
|
|
112
116
|
export declare namespace GuideGetChannelResponse {
|
|
113
117
|
interface Entry {
|
|
@@ -158,6 +162,10 @@ export declare namespace GuideGetChannelResponse {
|
|
|
158
162
|
* The pathname pattern to match (supports wildcards like /\*)
|
|
159
163
|
*/
|
|
160
164
|
pathname?: string;
|
|
165
|
+
/**
|
|
166
|
+
* The search query params to match
|
|
167
|
+
*/
|
|
168
|
+
search?: string;
|
|
161
169
|
}
|
|
162
170
|
interface ActivationURLRule {
|
|
163
171
|
/**
|
|
@@ -165,7 +173,7 @@ export declare namespace GuideGetChannelResponse {
|
|
|
165
173
|
*/
|
|
166
174
|
argument?: string;
|
|
167
175
|
/**
|
|
168
|
-
* The directive for the URL
|
|
176
|
+
* The directive for the URL rule ('allow' or 'block')
|
|
169
177
|
*/
|
|
170
178
|
directive?: string;
|
|
171
179
|
/**
|
|
@@ -206,6 +214,20 @@ export declare namespace GuideGetChannelResponse {
|
|
|
206
214
|
key?: string;
|
|
207
215
|
updated_at?: string;
|
|
208
216
|
}
|
|
217
|
+
interface IneligibleGuide {
|
|
218
|
+
/**
|
|
219
|
+
* The guide's key identifier
|
|
220
|
+
*/
|
|
221
|
+
key: string;
|
|
222
|
+
/**
|
|
223
|
+
* Human-readable explanation of ineligibility
|
|
224
|
+
*/
|
|
225
|
+
message: string;
|
|
226
|
+
/**
|
|
227
|
+
* Reason code for ineligibility
|
|
228
|
+
*/
|
|
229
|
+
reason: 'guide_not_active' | 'marked_as_archived' | 'target_conditions_not_met' | 'not_in_target_audience';
|
|
230
|
+
}
|
|
209
231
|
}
|
|
210
232
|
/**
|
|
211
233
|
* A response for a guide action.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.d.mts","sourceRoot":"","sources":["../../src/resources/users/guides.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;OAUG;IACH,UAAU,CACR,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;IAItC;;;;;;;;;;;;;;;;;;OAkBG;IACH,qBAAqB,CACnB,MAAM,EAAE,MAA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;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -108,6 +108,10 @@ export interface GuideGetChannelResponse {
|
|
|
108
108
|
* A list of guide groups with their display sequences and intervals.
|
|
109
109
|
*/
|
|
110
110
|
guide_groups: Array<GuideGetChannelResponse.GuideGroup>;
|
|
111
|
+
/**
|
|
112
|
+
* Markers for guides the user is not eligible to see.
|
|
113
|
+
*/
|
|
114
|
+
ineligible_guides: Array<GuideGetChannelResponse.IneligibleGuide>;
|
|
111
115
|
}
|
|
112
116
|
export declare namespace GuideGetChannelResponse {
|
|
113
117
|
interface Entry {
|
|
@@ -158,6 +162,10 @@ export declare namespace GuideGetChannelResponse {
|
|
|
158
162
|
* The pathname pattern to match (supports wildcards like /\*)
|
|
159
163
|
*/
|
|
160
164
|
pathname?: string;
|
|
165
|
+
/**
|
|
166
|
+
* The search query params to match
|
|
167
|
+
*/
|
|
168
|
+
search?: string;
|
|
161
169
|
}
|
|
162
170
|
interface ActivationURLRule {
|
|
163
171
|
/**
|
|
@@ -165,7 +173,7 @@ export declare namespace GuideGetChannelResponse {
|
|
|
165
173
|
*/
|
|
166
174
|
argument?: string;
|
|
167
175
|
/**
|
|
168
|
-
* The directive for the URL
|
|
176
|
+
* The directive for the URL rule ('allow' or 'block')
|
|
169
177
|
*/
|
|
170
178
|
directive?: string;
|
|
171
179
|
/**
|
|
@@ -206,6 +214,20 @@ export declare namespace GuideGetChannelResponse {
|
|
|
206
214
|
key?: string;
|
|
207
215
|
updated_at?: string;
|
|
208
216
|
}
|
|
217
|
+
interface IneligibleGuide {
|
|
218
|
+
/**
|
|
219
|
+
* The guide's key identifier
|
|
220
|
+
*/
|
|
221
|
+
key: string;
|
|
222
|
+
/**
|
|
223
|
+
* Human-readable explanation of ineligibility
|
|
224
|
+
*/
|
|
225
|
+
message: string;
|
|
226
|
+
/**
|
|
227
|
+
* Reason code for ineligibility
|
|
228
|
+
*/
|
|
229
|
+
reason: 'guide_not_active' | 'marked_as_archived' | 'target_conditions_not_met' | 'not_in_target_audience';
|
|
230
|
+
}
|
|
209
231
|
}
|
|
210
232
|
/**
|
|
211
233
|
* A response for a guide action.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.d.ts","sourceRoot":"","sources":["../../src/resources/users/guides.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;OAUG;IACH,UAAU,CACR,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,E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AC;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -510,19 +510,19 @@ export interface UserListMessagesParams extends ItemsCursorParams {
|
|
|
510
510
|
export declare namespace UserListMessagesParams {
|
|
511
511
|
interface InsertedAt {
|
|
512
512
|
/**
|
|
513
|
-
* Limits the results to
|
|
513
|
+
* Limits the results to items inserted after the given date.
|
|
514
514
|
*/
|
|
515
515
|
gt?: string;
|
|
516
516
|
/**
|
|
517
|
-
* Limits the results to
|
|
517
|
+
* Limits the results to items inserted after or on the given date.
|
|
518
518
|
*/
|
|
519
519
|
gte?: string;
|
|
520
520
|
/**
|
|
521
|
-
* Limits the results to
|
|
521
|
+
* Limits the results to items inserted before the given date.
|
|
522
522
|
*/
|
|
523
523
|
lt?: string;
|
|
524
524
|
/**
|
|
525
|
-
* Limits the results to
|
|
525
|
+
* Limits the results to items inserted before or on the given date.
|
|
526
526
|
*/
|
|
527
527
|
lte?: string;
|
|
528
528
|
}
|
|
@@ -510,19 +510,19 @@ export interface UserListMessagesParams extends ItemsCursorParams {
|
|
|
510
510
|
export declare namespace UserListMessagesParams {
|
|
511
511
|
interface InsertedAt {
|
|
512
512
|
/**
|
|
513
|
-
* Limits the results to
|
|
513
|
+
* Limits the results to items inserted after the given date.
|
|
514
514
|
*/
|
|
515
515
|
gt?: string;
|
|
516
516
|
/**
|
|
517
|
-
* Limits the results to
|
|
517
|
+
* Limits the results to items inserted after or on the given date.
|
|
518
518
|
*/
|
|
519
519
|
gte?: string;
|
|
520
520
|
/**
|
|
521
|
-
* Limits the results to
|
|
521
|
+
* Limits the results to items inserted before the given date.
|
|
522
522
|
*/
|
|
523
523
|
lt?: string;
|
|
524
524
|
/**
|
|
525
|
-
* Limits the results to
|
|
525
|
+
* Limits the results to items inserted before or on the given date.
|
|
526
526
|
*/
|
|
527
527
|
lte?: string;
|
|
528
528
|
}
|
package/src/client.ts
CHANGED
|
@@ -593,7 +593,7 @@ export class Knock {
|
|
|
593
593
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
594
594
|
|
|
595
595
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
596
|
-
const errJSON = safeJSON(errText);
|
|
596
|
+
const errJSON = safeJSON(errText) as any;
|
|
597
597
|
const errMessage = errJSON ? undefined : errText;
|
|
598
598
|
|
|
599
599
|
loggerFor(this).debug(
|
|
@@ -630,9 +630,14 @@ export class Knock {
|
|
|
630
630
|
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
631
631
|
path: string,
|
|
632
632
|
Page: new (...args: any[]) => PageClass,
|
|
633
|
-
opts?: RequestOptions
|
|
633
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
634
634
|
): Pagination.PagePromise<PageClass, Item> {
|
|
635
|
-
return this.requestAPIList(
|
|
635
|
+
return this.requestAPIList(
|
|
636
|
+
Page,
|
|
637
|
+
opts && 'then' in opts ?
|
|
638
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
639
|
+
: { method: 'get', path, ...opts },
|
|
640
|
+
);
|
|
636
641
|
}
|
|
637
642
|
|
|
638
643
|
requestAPIList<
|
|
@@ -640,7 +645,7 @@ export class Knock {
|
|
|
640
645
|
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
641
646
|
>(
|
|
642
647
|
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
643
|
-
options: FinalRequestOptions
|
|
648
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
644
649
|
): Pagination.PagePromise<PageClass, Item> {
|
|
645
650
|
const request = this.makeRequest(options, null, undefined);
|
|
646
651
|
return new Pagination.PagePromise<PageClass, Item>(this as any as Knock, request, Page);
|
|
@@ -653,9 +658,10 @@ export class Knock {
|
|
|
653
658
|
controller: AbortController,
|
|
654
659
|
): Promise<Response> {
|
|
655
660
|
const { signal, method, ...options } = init || {};
|
|
656
|
-
|
|
661
|
+
const abort = this._makeAbort(controller);
|
|
662
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
657
663
|
|
|
658
|
-
const timeout = setTimeout(
|
|
664
|
+
const timeout = setTimeout(abort, ms);
|
|
659
665
|
|
|
660
666
|
const isReadableBody =
|
|
661
667
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -823,6 +829,12 @@ export class Knock {
|
|
|
823
829
|
return headers.values;
|
|
824
830
|
}
|
|
825
831
|
|
|
832
|
+
private _makeAbort(controller: AbortController) {
|
|
833
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
834
|
+
// would capture all request options, and cause a memory leak.
|
|
835
|
+
return () => controller.abort();
|
|
836
|
+
}
|
|
837
|
+
|
|
826
838
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
827
839
|
bodyHeaders: HeadersLike;
|
|
828
840
|
body: BodyInit | undefined;
|
|
@@ -855,6 +867,14 @@ export class Knock {
|
|
|
855
867
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
856
868
|
) {
|
|
857
869
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
870
|
+
} else if (
|
|
871
|
+
typeof body === 'object' &&
|
|
872
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
873
|
+
) {
|
|
874
|
+
return {
|
|
875
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
876
|
+
body: this.stringifyQuery(body as Record<string, unknown>),
|
|
877
|
+
};
|
|
858
878
|
} else {
|
|
859
879
|
return this.#encoder({ body, headers });
|
|
860
880
|
}
|
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Knock, props: APIResponseP
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
|
@@ -18,14 +18,20 @@ export class Audiences extends APIResource {
|
|
|
18
18
|
* members: [
|
|
19
19
|
* {
|
|
20
20
|
* tenant: 'ingen_isla_nublar',
|
|
21
|
-
* user: {
|
|
21
|
+
* user: {
|
|
22
|
+
* email: 'ellie@ingen.net',
|
|
23
|
+
* id: 'dr_sattler',
|
|
24
|
+
* name: 'Dr. Ellie Sattler',
|
|
25
|
+
* },
|
|
22
26
|
* },
|
|
23
27
|
* ],
|
|
24
28
|
* });
|
|
25
29
|
* ```
|
|
26
30
|
*/
|
|
27
|
-
addMembers(key: string,
|
|
31
|
+
addMembers(key: string, params: AudienceAddMembersParams, options?: RequestOptions): APIPromise<void> {
|
|
32
|
+
const { create_audience, ...body } = params;
|
|
28
33
|
return this._client.post(path`/v1/audiences/${key}/members`, {
|
|
34
|
+
query: { create_audience },
|
|
29
35
|
body,
|
|
30
36
|
...options,
|
|
31
37
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
@@ -50,7 +56,7 @@ export class Audiences extends APIResource {
|
|
|
50
56
|
* @example
|
|
51
57
|
* ```ts
|
|
52
58
|
* await client.audiences.removeMembers('key', {
|
|
53
|
-
* members: [{ user: {} }],
|
|
59
|
+
* members: [{ user: { id: 'dr_sattler' } }],
|
|
54
60
|
* });
|
|
55
61
|
* ```
|
|
56
62
|
*/
|
|
@@ -112,9 +118,15 @@ export interface AudienceListMembersResponse {
|
|
|
112
118
|
|
|
113
119
|
export interface AudienceAddMembersParams {
|
|
114
120
|
/**
|
|
115
|
-
* A list of audience members to add.
|
|
121
|
+
* Body param: A list of audience members to add. You can add up to 1,000 members
|
|
122
|
+
* per request.
|
|
116
123
|
*/
|
|
117
124
|
members: Array<AudienceAddMembersParams.Member>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Query param: Create the audience if it does not exist.
|
|
128
|
+
*/
|
|
129
|
+
create_audience?: boolean;
|
|
118
130
|
}
|
|
119
131
|
|
|
120
132
|
export namespace AudienceAddMembersParams {
|
|
@@ -123,32 +135,24 @@ export namespace AudienceAddMembersParams {
|
|
|
123
135
|
*/
|
|
124
136
|
export interface Member {
|
|
125
137
|
/**
|
|
126
|
-
*
|
|
138
|
+
* A set of parameters to inline-identify a user with. Inline identifying the user
|
|
139
|
+
* will ensure that the user is available before the request is executed in Knock.
|
|
140
|
+
* It will perform an upsert for the user you're supplying, replacing any
|
|
141
|
+
* properties specified.
|
|
127
142
|
*/
|
|
128
|
-
user:
|
|
143
|
+
user: UsersAPI.InlineIdentifyUserRequest;
|
|
129
144
|
|
|
130
145
|
/**
|
|
131
146
|
* The unique identifier for the tenant.
|
|
132
147
|
*/
|
|
133
148
|
tenant?: string | null;
|
|
134
149
|
}
|
|
135
|
-
|
|
136
|
-
export namespace Member {
|
|
137
|
-
/**
|
|
138
|
-
* An object containing the user's ID.
|
|
139
|
-
*/
|
|
140
|
-
export interface User {
|
|
141
|
-
/**
|
|
142
|
-
* The unique identifier of the user.
|
|
143
|
-
*/
|
|
144
|
-
id?: string;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
export interface AudienceRemoveMembersParams {
|
|
150
153
|
/**
|
|
151
|
-
* A list of audience members to remove.
|
|
154
|
+
* A list of audience members to remove. You can remove up to 1,000 members per
|
|
155
|
+
* request.
|
|
152
156
|
*/
|
|
153
157
|
members: Array<AudienceRemoveMembersParams.Member>;
|
|
154
158
|
}
|
|
@@ -159,27 +163,18 @@ export namespace AudienceRemoveMembersParams {
|
|
|
159
163
|
*/
|
|
160
164
|
export interface Member {
|
|
161
165
|
/**
|
|
162
|
-
*
|
|
166
|
+
* A set of parameters to inline-identify a user with. Inline identifying the user
|
|
167
|
+
* will ensure that the user is available before the request is executed in Knock.
|
|
168
|
+
* It will perform an upsert for the user you're supplying, replacing any
|
|
169
|
+
* properties specified.
|
|
163
170
|
*/
|
|
164
|
-
user:
|
|
171
|
+
user: UsersAPI.InlineIdentifyUserRequest;
|
|
165
172
|
|
|
166
173
|
/**
|
|
167
174
|
* The unique identifier for the tenant.
|
|
168
175
|
*/
|
|
169
176
|
tenant?: string | null;
|
|
170
177
|
}
|
|
171
|
-
|
|
172
|
-
export namespace Member {
|
|
173
|
-
/**
|
|
174
|
-
* An object containing the user's ID.
|
|
175
|
-
*/
|
|
176
|
-
export interface User {
|
|
177
|
-
/**
|
|
178
|
-
* The unique identifier of the user.
|
|
179
|
-
*/
|
|
180
|
-
id?: string;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
export declare namespace Audiences {
|
|
@@ -1031,22 +1031,22 @@ export interface MessageListParams extends ItemsCursorParams {
|
|
|
1031
1031
|
export namespace MessageListParams {
|
|
1032
1032
|
export interface InsertedAt {
|
|
1033
1033
|
/**
|
|
1034
|
-
* Limits the results to
|
|
1034
|
+
* Limits the results to items inserted after the given date.
|
|
1035
1035
|
*/
|
|
1036
1036
|
gt?: string;
|
|
1037
1037
|
|
|
1038
1038
|
/**
|
|
1039
|
-
* Limits the results to
|
|
1039
|
+
* Limits the results to items inserted after or on the given date.
|
|
1040
1040
|
*/
|
|
1041
1041
|
gte?: string;
|
|
1042
1042
|
|
|
1043
1043
|
/**
|
|
1044
|
-
* Limits the results to
|
|
1044
|
+
* Limits the results to items inserted before the given date.
|
|
1045
1045
|
*/
|
|
1046
1046
|
lt?: string;
|
|
1047
1047
|
|
|
1048
1048
|
/**
|
|
1049
|
-
* Limits the results to
|
|
1049
|
+
* Limits the results to items inserted before or on the given date.
|
|
1050
1050
|
*/
|
|
1051
1051
|
lte?: string;
|
|
1052
1052
|
}
|
|
@@ -609,22 +609,22 @@ export interface ObjectListMessagesParams extends ItemsCursorParams {
|
|
|
609
609
|
export namespace ObjectListMessagesParams {
|
|
610
610
|
export interface InsertedAt {
|
|
611
611
|
/**
|
|
612
|
-
* Limits the results to
|
|
612
|
+
* Limits the results to items inserted after the given date.
|
|
613
613
|
*/
|
|
614
614
|
gt?: string;
|
|
615
615
|
|
|
616
616
|
/**
|
|
617
|
-
* Limits the results to
|
|
617
|
+
* Limits the results to items inserted after or on the given date.
|
|
618
618
|
*/
|
|
619
619
|
gte?: string;
|
|
620
620
|
|
|
621
621
|
/**
|
|
622
|
-
* Limits the results to
|
|
622
|
+
* Limits the results to items inserted before the given date.
|
|
623
623
|
*/
|
|
624
624
|
lt?: string;
|
|
625
625
|
|
|
626
626
|
/**
|
|
627
|
-
* Limits the results to
|
|
627
|
+
* Limits the results to items inserted before or on the given date.
|
|
628
628
|
*/
|
|
629
629
|
lte?: string;
|
|
630
630
|
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -23,11 +23,15 @@ export interface Condition {
|
|
|
23
23
|
| 'not_contains'
|
|
24
24
|
| 'empty'
|
|
25
25
|
| 'not_empty'
|
|
26
|
+
| 'exists'
|
|
27
|
+
| 'not_exists'
|
|
26
28
|
| 'contains_all'
|
|
27
29
|
| 'is_timestamp'
|
|
28
30
|
| 'is_not_timestamp'
|
|
29
|
-
| '
|
|
31
|
+
| 'is_timestamp_on_or_after'
|
|
30
32
|
| 'is_timestamp_before'
|
|
33
|
+
| 'is_timestamp_on_or_after_date'
|
|
34
|
+
| 'is_timestamp_before_date'
|
|
31
35
|
| 'is_timestamp_between'
|
|
32
36
|
| 'is_audience_member'
|
|
33
37
|
| 'is_not_audience_member';
|
|
@@ -39,6 +39,9 @@ export class Feeds extends APIResource {
|
|
|
39
39
|
* along with a user token.
|
|
40
40
|
* - This endpoint’s rate limit is always scoped per-user and per-environment. This
|
|
41
41
|
* is true even for requests made without a signed user token.
|
|
42
|
+
* - Any [attachments](/integrations/email/attachments) present in trigger data are
|
|
43
|
+
* automatically excluded from both the `data` and `activities` fields of
|
|
44
|
+
* `UserInAppFeedResponse`.
|
|
42
45
|
*
|
|
43
46
|
* @example
|
|
44
47
|
* ```ts
|
|
@@ -286,11 +289,20 @@ export interface FeedListItemsParams extends EntriesCursorParams {
|
|
|
286
289
|
*/
|
|
287
290
|
archived?: 'exclude' | 'include' | 'only';
|
|
288
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Comma-separated list of field paths to exclude from the response. Use dot
|
|
294
|
+
* notation for nested fields (e.g., `entries.archived_at`). Limited to 3 levels
|
|
295
|
+
* deep.
|
|
296
|
+
*/
|
|
297
|
+
exclude?: string;
|
|
298
|
+
|
|
289
299
|
/**
|
|
290
300
|
* Whether the feed items have a tenant.
|
|
291
301
|
*/
|
|
292
302
|
has_tenant?: boolean;
|
|
293
303
|
|
|
304
|
+
inserted_at?: FeedListItemsParams.InsertedAt;
|
|
305
|
+
|
|
294
306
|
/**
|
|
295
307
|
* The locale to render the feed items in. Must be in the IETF 5646 format (e.g.
|
|
296
308
|
* `en-US`). When not provided, will default to the locale that the feed items were
|
|
@@ -299,6 +311,14 @@ export interface FeedListItemsParams extends EntriesCursorParams {
|
|
|
299
311
|
*/
|
|
300
312
|
locale?: string;
|
|
301
313
|
|
|
314
|
+
/**
|
|
315
|
+
* The mode to render the feed items in. Can be `compact` or `rich`. Defaults to
|
|
316
|
+
* `rich`. When `mode` is `compact`, feed items will not have `activities` and
|
|
317
|
+
* `total_activities` fields; the `data` field will not include nested arrays and
|
|
318
|
+
* objects; and the `actors` field will only have up to one actor.
|
|
319
|
+
*/
|
|
320
|
+
mode?: 'compact' | 'rich';
|
|
321
|
+
|
|
302
322
|
/**
|
|
303
323
|
* The workflow key associated with the message in the feed.
|
|
304
324
|
*/
|
|
@@ -325,6 +345,30 @@ export interface FeedListItemsParams extends EntriesCursorParams {
|
|
|
325
345
|
workflow_categories?: Array<string>;
|
|
326
346
|
}
|
|
327
347
|
|
|
348
|
+
export namespace FeedListItemsParams {
|
|
349
|
+
export interface InsertedAt {
|
|
350
|
+
/**
|
|
351
|
+
* Limits the results to items inserted after the given date.
|
|
352
|
+
*/
|
|
353
|
+
gt?: string;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Limits the results to items inserted after or on the given date.
|
|
357
|
+
*/
|
|
358
|
+
gte?: string;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Limits the results to items inserted before the given date.
|
|
362
|
+
*/
|
|
363
|
+
lt?: string;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Limits the results to items inserted before or on the given date.
|
|
367
|
+
*/
|
|
368
|
+
lte?: string;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
328
372
|
export declare namespace Feeds {
|
|
329
373
|
export {
|
|
330
374
|
type FeedGetSettingsResponse as FeedGetSettingsResponse,
|
|
@@ -153,6 +153,11 @@ export interface GuideGetChannelResponse {
|
|
|
153
153
|
* A list of guide groups with their display sequences and intervals.
|
|
154
154
|
*/
|
|
155
155
|
guide_groups: Array<GuideGetChannelResponse.GuideGroup>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Markers for guides the user is not eligible to see.
|
|
159
|
+
*/
|
|
160
|
+
ineligible_guides: Array<GuideGetChannelResponse.IneligibleGuide>;
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
export namespace GuideGetChannelResponse {
|
|
@@ -218,6 +223,11 @@ export namespace GuideGetChannelResponse {
|
|
|
218
223
|
* The pathname pattern to match (supports wildcards like /\*)
|
|
219
224
|
*/
|
|
220
225
|
pathname?: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The search query params to match
|
|
229
|
+
*/
|
|
230
|
+
search?: string;
|
|
221
231
|
}
|
|
222
232
|
|
|
223
233
|
export interface ActivationURLRule {
|
|
@@ -227,7 +237,7 @@ export namespace GuideGetChannelResponse {
|
|
|
227
237
|
argument?: string;
|
|
228
238
|
|
|
229
239
|
/**
|
|
230
|
-
* The directive for the URL
|
|
240
|
+
* The directive for the URL rule ('allow' or 'block')
|
|
231
241
|
*/
|
|
232
242
|
directive?: string;
|
|
233
243
|
|
|
@@ -286,6 +296,27 @@ export namespace GuideGetChannelResponse {
|
|
|
286
296
|
|
|
287
297
|
updated_at?: string;
|
|
288
298
|
}
|
|
299
|
+
|
|
300
|
+
export interface IneligibleGuide {
|
|
301
|
+
/**
|
|
302
|
+
* The guide's key identifier
|
|
303
|
+
*/
|
|
304
|
+
key: string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Human-readable explanation of ineligibility
|
|
308
|
+
*/
|
|
309
|
+
message: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Reason code for ineligibility
|
|
313
|
+
*/
|
|
314
|
+
reason:
|
|
315
|
+
| 'guide_not_active'
|
|
316
|
+
| 'marked_as_archived'
|
|
317
|
+
| 'target_conditions_not_met'
|
|
318
|
+
| 'not_in_target_audience';
|
|
319
|
+
}
|
|
289
320
|
}
|
|
290
321
|
|
|
291
322
|
/**
|