asfur 1.0.120 → 1.0.122
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/index.d.ts +40 -0
- package/dist/index.js +15 -1
- package/dist/types.d.ts +30 -1
- package/dist/types.js +11 -1
- package/index.ts +18 -0
- package/package.json +1 -1
- package/types.ts +13 -1
package/dist/index.d.ts
CHANGED
|
@@ -738,3 +738,43 @@ export declare const MongoSendEmailSchema: Schema<any, import("mongoose").Model<
|
|
|
738
738
|
} & {
|
|
739
739
|
__v: number;
|
|
740
740
|
}>;
|
|
741
|
+
export declare const MongoSendWhatsappSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
742
|
+
versionKey: false;
|
|
743
|
+
toJSON: {
|
|
744
|
+
virtuals: true;
|
|
745
|
+
};
|
|
746
|
+
toObject: {
|
|
747
|
+
virtuals: true;
|
|
748
|
+
};
|
|
749
|
+
}, {
|
|
750
|
+
user_id: string;
|
|
751
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
752
|
+
to: string[];
|
|
753
|
+
timestamp?: number | null | undefined;
|
|
754
|
+
from_service?: string | null | undefined;
|
|
755
|
+
from?: string | null | undefined;
|
|
756
|
+
body?: string | null | undefined;
|
|
757
|
+
html?: string | null | undefined;
|
|
758
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
759
|
+
user_id: string;
|
|
760
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
761
|
+
to: string[];
|
|
762
|
+
timestamp?: number | null | undefined;
|
|
763
|
+
from_service?: string | null | undefined;
|
|
764
|
+
from?: string | null | undefined;
|
|
765
|
+
body?: string | null | undefined;
|
|
766
|
+
html?: string | null | undefined;
|
|
767
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
768
|
+
user_id: string;
|
|
769
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
770
|
+
to: string[];
|
|
771
|
+
timestamp?: number | null | undefined;
|
|
772
|
+
from_service?: string | null | undefined;
|
|
773
|
+
from?: string | null | undefined;
|
|
774
|
+
body?: string | null | undefined;
|
|
775
|
+
html?: string | null | undefined;
|
|
776
|
+
}> & {
|
|
777
|
+
_id: import("mongoose").Types.ObjectId;
|
|
778
|
+
} & {
|
|
779
|
+
__v: number;
|
|
780
|
+
}>;
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.MongoSendEmailSchema = exports.MongoMessageSchema = exports.MongoHeatmapSchema = exports.MongoScenarioScoreSchema = exports.MongoScenarioSchema = exports.MongoNotificationSchema = exports.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoInstructionsSchema = void 0;
|
|
17
|
+
exports.MongoSendWhatsappSchema = exports.MongoSendEmailSchema = exports.MongoMessageSchema = exports.MongoHeatmapSchema = exports.MongoScenarioScoreSchema = exports.MongoScenarioSchema = exports.MongoNotificationSchema = exports.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoInstructionsSchema = void 0;
|
|
18
18
|
// Export types for consumers
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
20
|
const mongoose_1 = require("mongoose");
|
|
@@ -297,3 +297,17 @@ exports.MongoSendEmailSchema = new mongoose_1.Schema({
|
|
|
297
297
|
toJSON: { virtuals: true },
|
|
298
298
|
toObject: { virtuals: true },
|
|
299
299
|
});
|
|
300
|
+
exports.MongoSendWhatsappSchema = new mongoose_1.Schema({
|
|
301
|
+
user_id: { type: String, required: true },
|
|
302
|
+
priority: { type: String, enum: types_1.notificationPriorityList, default: 'low' },
|
|
303
|
+
timestamp: { type: Number },
|
|
304
|
+
from_service: { type: String },
|
|
305
|
+
to: { type: [String] },
|
|
306
|
+
from: { type: String },
|
|
307
|
+
body: { type: String },
|
|
308
|
+
html: { type: String }, // optional message body in HTML format
|
|
309
|
+
}, {
|
|
310
|
+
versionKey: false,
|
|
311
|
+
toJSON: { virtuals: true },
|
|
312
|
+
toObject: { virtuals: true },
|
|
313
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1960,6 +1960,34 @@ export declare const zodSendEmailSchema: z.ZodObject<{
|
|
|
1960
1960
|
body?: string | undefined;
|
|
1961
1961
|
html?: string | undefined;
|
|
1962
1962
|
}>;
|
|
1963
|
+
export declare const zodSendWhatsappSchema: z.ZodObject<{
|
|
1964
|
+
user_id: z.ZodString;
|
|
1965
|
+
priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
1966
|
+
timestamp: z.ZodNumber;
|
|
1967
|
+
from_service: z.ZodString;
|
|
1968
|
+
to: z.ZodArray<z.ZodString, "many">;
|
|
1969
|
+
from: z.ZodString;
|
|
1970
|
+
body: z.ZodString;
|
|
1971
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1972
|
+
}, "strip", z.ZodTypeAny, {
|
|
1973
|
+
user_id: string;
|
|
1974
|
+
timestamp: number;
|
|
1975
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
1976
|
+
from_service: string;
|
|
1977
|
+
to: string[];
|
|
1978
|
+
from: string;
|
|
1979
|
+
body: string;
|
|
1980
|
+
html?: string | undefined;
|
|
1981
|
+
}, {
|
|
1982
|
+
user_id: string;
|
|
1983
|
+
timestamp: number;
|
|
1984
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
1985
|
+
from_service: string;
|
|
1986
|
+
to: string[];
|
|
1987
|
+
from: string;
|
|
1988
|
+
body: string;
|
|
1989
|
+
html?: string | undefined;
|
|
1990
|
+
}>;
|
|
1963
1991
|
/**
|
|
1964
1992
|
* 'approved' - active and approved sources,
|
|
1965
1993
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -1985,6 +2013,7 @@ export type AlertType = z.infer<typeof zodAlertSchema>;
|
|
|
1985
2013
|
export type MessageType = z.infer<typeof zodMessageSchema>;
|
|
1986
2014
|
export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
|
|
1987
2015
|
export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
2016
|
+
export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
|
|
1988
2017
|
export type UserPublicMetadata = {
|
|
1989
2018
|
is_admin?: boolean;
|
|
1990
2019
|
regions?: {
|
|
@@ -1993,7 +2022,7 @@ export type UserPublicMetadata = {
|
|
|
1993
2022
|
is_primary?: boolean;
|
|
1994
2023
|
}[];
|
|
1995
2024
|
notes?: string;
|
|
1996
|
-
};
|
|
2025
|
+
} & UserSettingsType;
|
|
1997
2026
|
export type MessageMetaData = {
|
|
1998
2027
|
geoLocations?: string[];
|
|
1999
2028
|
startDate?: string;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodSendEmailSchema = exports.zodScenarioSchema = exports.zodScenarioScoreSchema = exports.scenarioScoreTypeList = exports.zodNotificationSchema = exports.notificationPriorityList = exports.zodReportSchema = exports.reportProcessStatusList = exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodMessageSchema = exports.zodHeatmapSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAlertSchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.requestedContentList = exports.relativeTimeRangeList = exports.jobRunStatusList = exports.generalStatusList = void 0;
|
|
3
|
+
exports.zodSendWhatsappSchema = exports.zodSendEmailSchema = exports.zodScenarioSchema = exports.zodScenarioScoreSchema = exports.scenarioScoreTypeList = exports.zodNotificationSchema = exports.notificationPriorityList = exports.zodReportSchema = exports.reportProcessStatusList = exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodMessageSchema = exports.zodHeatmapSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAlertSchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.requestedContentList = exports.relativeTimeRangeList = exports.jobRunStatusList = exports.generalStatusList = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.generalStatusList = ['active', 'inactive'];
|
|
6
6
|
exports.jobRunStatusList = ['done', 'failed', 'in_progress'];
|
|
@@ -280,3 +280,13 @@ exports.zodSendEmailSchema = zod_1.z.object({
|
|
|
280
280
|
body: zod_1.z.string().optional(),
|
|
281
281
|
html: zod_1.z.string().optional(), // email body
|
|
282
282
|
});
|
|
283
|
+
exports.zodSendWhatsappSchema = zod_1.z.object({
|
|
284
|
+
user_id: zod_1.z.string(),
|
|
285
|
+
priority: zod_1.z.enum(exports.notificationPriorityList),
|
|
286
|
+
timestamp: zod_1.z.number(),
|
|
287
|
+
from_service: zod_1.z.string(),
|
|
288
|
+
to: zod_1.z.array(zod_1.z.string()),
|
|
289
|
+
from: zod_1.z.string(),
|
|
290
|
+
body: zod_1.z.string(),
|
|
291
|
+
html: zod_1.z.string().optional(), // optional message body in HTML format
|
|
292
|
+
});
|
package/index.ts
CHANGED
|
@@ -338,3 +338,21 @@ export const MongoSendEmailSchema = new Schema(
|
|
|
338
338
|
toObject: { virtuals: true },
|
|
339
339
|
},
|
|
340
340
|
);
|
|
341
|
+
|
|
342
|
+
export const MongoSendWhatsappSchema = new Schema(
|
|
343
|
+
{
|
|
344
|
+
user_id: { type: String, required: true }, // user identifier
|
|
345
|
+
priority: { type: String, enum: notificationPriorityList, default: 'low' }, // message priority
|
|
346
|
+
timestamp: { type: Number }, // timestamp for when the message should be sent
|
|
347
|
+
from_service: { type: String }, // name of the service sending the message
|
|
348
|
+
to: { type: [String] }, // recipient phone numbers
|
|
349
|
+
from: { type: String }, // sender phone number
|
|
350
|
+
body: { type: String }, // message body
|
|
351
|
+
html: { type: String }, // optional message body in HTML format
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
versionKey: false,
|
|
355
|
+
toJSON: { virtuals: true },
|
|
356
|
+
toObject: { virtuals: true },
|
|
357
|
+
},
|
|
358
|
+
);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -332,6 +332,17 @@ export const zodSendEmailSchema = z.object({
|
|
|
332
332
|
html: z.string().optional(), // email body
|
|
333
333
|
});
|
|
334
334
|
|
|
335
|
+
export const zodSendWhatsappSchema = z.object({
|
|
336
|
+
user_id: z.string(), // user identifier
|
|
337
|
+
priority: z.enum(notificationPriorityList), // priority of the message
|
|
338
|
+
timestamp: z.number(), // timestamp for when the message should be sent
|
|
339
|
+
from_service: z.string(), // name of the service sending the message
|
|
340
|
+
to: z.array(z.string()), // recipient phone number
|
|
341
|
+
from: z.string(), // sender phone number
|
|
342
|
+
body: z.string(), // message body
|
|
343
|
+
html: z.string().optional(), // optional message body in HTML format
|
|
344
|
+
});
|
|
345
|
+
|
|
335
346
|
/**
|
|
336
347
|
* 'approved' - active and approved sources,
|
|
337
348
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -362,6 +373,7 @@ export type AlertType = z.infer<typeof zodAlertSchema>;
|
|
|
362
373
|
export type MessageType = z.infer<typeof zodMessageSchema>;
|
|
363
374
|
export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
|
|
364
375
|
export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
376
|
+
export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
|
|
365
377
|
|
|
366
378
|
export type UserPublicMetadata = {
|
|
367
379
|
is_admin?: boolean;
|
|
@@ -371,7 +383,7 @@ export type UserPublicMetadata = {
|
|
|
371
383
|
is_primary?: boolean;
|
|
372
384
|
}[];
|
|
373
385
|
notes?: string;
|
|
374
|
-
};
|
|
386
|
+
} & UserSettingsType;
|
|
375
387
|
|
|
376
388
|
export type MessageMetaData = {
|
|
377
389
|
geoLocations?: string[];
|