@periskope/types 0.6.461 → 0.6.463

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.
@@ -0,0 +1,390 @@
1
+ import { Merge, OverrideProperties } from 'type-fest';
2
+ import { OrgPlanEnterprise, OrgPlanNonEnterprise } from './types';
3
+ export type BillingVersion = 'v1' | 'v2';
4
+ export declare enum AllPlansV2 {
5
+ FREE_TRIAL = "v2-free-trial",
6
+ MONTHLY_STARTER = "v2-monthly-starter",
7
+ YEARLY_STARTER = "v2-annual-starter",
8
+ MONTHLY_PRO = "v2-monthly-pro",
9
+ YEARLY_PRO = "v2-annual-pro"
10
+ }
11
+ export type AddonPackId = SeatAddonPackId | RecurringAddonPackId;
12
+ /** V2-only — per-seat user & phone add-ons (tier-specific). */
13
+ export type SeatAddonPackId = 'v2-additional-phone-pro' | 'v2-additional-user-pro' | 'v2-additional-phone-starter' | 'v2-additional-user-starter';
14
+ /** Shared by v1 and v2 — recurring optional add-ons. */
15
+ export type RecurringAddonPackId = 'priority-support-pack' | 'automation-pack';
16
+ /** Shared by v1 and v2 — one-time charge packs. */
17
+ export type ChargesPack = 'ai-pack' | 'bulk-message-credits' | 'guided-onboarding' | 'support-call' | 'support-call-pack';
18
+ /** Packs with no billing-version prefix — included under both v1 and v2. */
19
+ export type GenericPackId = RecurringAddonPackId | ChargesPack;
20
+ export declare const GENERIC_PACK_IDS: readonly GenericPackId[];
21
+ export type UsageType = 'ai_credits' | 'automation_rules';
22
+ export type UsageAllowances = Partial<Record<UsageType, number>>;
23
+ export type UsageConsumption = Partial<Record<UsageType, number>>;
24
+ /** Recurring add-on flags derived from subscription line items. */
25
+ export type V2AddonEntitlements = Partial<Record<RecurringAddonPackId, boolean>>;
26
+ export type OrgPlanV2 = Merge<OverrideProperties<OrgPlanEnterprise | OrgPlanNonEnterprise, {
27
+ plan_id: AllPlansV2;
28
+ }>, {
29
+ billing_version: 'v2';
30
+ usage_allowances?: UsageAllowances;
31
+ addon_entitlements?: V2AddonEntitlements;
32
+ }>;
33
+ export type OrgPlanV1 = (OrgPlanEnterprise | OrgPlanNonEnterprise) & {
34
+ billing_version?: 'v1';
35
+ };
36
+ export type AnyOrgPlan = OrgPlanV1 | OrgPlanV2;
37
+ export declare const isV2Plan: (plan: AnyOrgPlan) => plan is OrgPlanV2;
38
+ export type BillingEntity = 'IN' | 'US';
39
+ /** Line item passed to Chargebee item-price / subscription APIs. */
40
+ export type BillingV2LineItem = {
41
+ item_price_id: string;
42
+ quantity?: number;
43
+ unit_price?: number;
44
+ };
45
+ /** Headers required on all billing V2 requests. */
46
+ export type BillingV2RequestHeaders = {
47
+ org_id: string;
48
+ 'x-periskope-trace-id'?: string;
49
+ };
50
+ export type BillingFrequency = 'monthly' | 'yearly';
51
+ export type BillingPlanTier = 'starter' | 'pro';
52
+ /** Money in major currency units (e.g. 2400 = ₹2,400). */
53
+ export type BillingMoney = {
54
+ amount: number;
55
+ currency_code: string;
56
+ };
57
+ export type BillingPriceItem = {
58
+ item_price_id: string;
59
+ item_id: string;
60
+ lookup_key: string | null;
61
+ name: string;
62
+ description: string | null;
63
+ price: BillingMoney;
64
+ frequency: BillingFrequency | null;
65
+ period: number | null;
66
+ status: string;
67
+ };
68
+ export type BillingVersionPrices = {
69
+ plan: BillingPriceItem[];
70
+ addons: BillingPriceItem[];
71
+ charges: BillingPriceItem[];
72
+ };
73
+ export type GetPricesParams = {
74
+ currency: string;
75
+ };
76
+ export type GetPricesResponse = {
77
+ v1: BillingVersionPrices;
78
+ v2: BillingVersionPrices;
79
+ };
80
+ export type SeatAddonConfig = {
81
+ pack_id: SeatAddonPackId;
82
+ label: string;
83
+ unit_price: BillingMoney;
84
+ /** Included in base plan before add-on quantity applies (typically 1). */
85
+ included_quantity: number;
86
+ };
87
+ export type GetSeatAddonsParams = {
88
+ currency: string;
89
+ plan_key: AllPlansV2;
90
+ };
91
+ export type GetSeatAddonsResponse = {
92
+ users: SeatAddonConfig;
93
+ phones: SeatAddonConfig;
94
+ credits_per_seat_per_month: number;
95
+ };
96
+ export type RecurringAddonBillingModel = 'quantity' | 'flat';
97
+ export type RecurringAddonOption = {
98
+ pack_id: RecurringAddonPackId;
99
+ name: string;
100
+ description: string;
101
+ billing_model: RecurringAddonBillingModel;
102
+ unit_price: BillingMoney;
103
+ /** e.g. "pack" for automation rules. */
104
+ unit_label?: string;
105
+ rules_per_pack?: number;
106
+ };
107
+ export type GetRecurringAddonsParams = {
108
+ currency: string;
109
+ };
110
+ export type GetRecurringAddonsResponse = {
111
+ automation_pack: RecurringAddonOption;
112
+ priority_support: RecurringAddonOption;
113
+ };
114
+ export type OrderSummaryItemType = 'plan' | 'addon';
115
+ export type OrderSummaryItem = {
116
+ type: OrderSummaryItemType;
117
+ item_price_id: string;
118
+ lookup_key: string | null;
119
+ name: string;
120
+ description: string | null;
121
+ quantity: number;
122
+ unit_price: BillingMoney;
123
+ amount: BillingMoney;
124
+ /** null for one-time charge line items */
125
+ frequency: BillingFrequency | null;
126
+ };
127
+ export type GetOrderSummaryRequestBody = {
128
+ subscription_id?: string;
129
+ line_items: BillingV2LineItem[];
130
+ coupon_id?: string;
131
+ };
132
+ export type OrderSummaryNextCharge = {
133
+ /** Unix timestamp for the next recurring charge. */
134
+ date: number;
135
+ amount: BillingMoney;
136
+ };
137
+ export type GetOrderSummaryResponse = {
138
+ frequency: BillingFrequency;
139
+ currency_code: string;
140
+ items: OrderSummaryItem[];
141
+ /** Line items with quantity > 0 — for "Subtotal (N items)". */
142
+ item_count: number;
143
+ /** Pre-adjustment subtotal from Chargebee invoice_estimate.sub_total. */
144
+ subtotal: BillingMoney;
145
+ /** Promotional / account credits applied — null when none on estimate. */
146
+ credits_applied: BillingMoney | null;
147
+ /** null when no coupon on the estimate. */
148
+ coupon: AppliedCouponSummary | null;
149
+ /** Amount due after credits and coupon (invoice_estimate.total). */
150
+ total: BillingMoney;
151
+ /** Prorated amount due now (invoice_estimate.amount_due). */
152
+ due_today: BillingMoney;
153
+ /** Next full recurring charge — null when not available on estimate. */
154
+ next_charge: OrderSummaryNextCharge | null;
155
+ };
156
+ export type CouponDiscountType = 'fixed_amount' | 'percentage' | 'offer_quantity';
157
+ export type GetCouponDetailsRequestBody = {
158
+ coupon_code: string;
159
+ };
160
+ export type GetCouponDetailsResponse = {
161
+ coupon_id: string;
162
+ coupon_code: string;
163
+ name: string | null;
164
+ discount_type: CouponDiscountType;
165
+ /** Set when discount_type is percentage; otherwise null. */
166
+ discount_percentage: number | null;
167
+ /** Set when discount_type is fixed_amount; otherwise null. */
168
+ discount_amount: BillingMoney | null;
169
+ duration_type: 'one_time' | 'forever' | 'limited_period';
170
+ status: string;
171
+ };
172
+ export type AppliedCouponSummary = {
173
+ coupon_id: string;
174
+ name: string | null;
175
+ discount_type: CouponDiscountType;
176
+ discount_percentage: number | null;
177
+ discount_amount: BillingMoney | null;
178
+ /** Coupon discount applied on this estimate — null when coupon present but discount is zero. */
179
+ applied_amount: BillingMoney | null;
180
+ };
181
+ export type CreateCheckoutSessionRequestBody = {
182
+ success_url: string;
183
+ cancel_url: string;
184
+ line_items: BillingV2LineItem[];
185
+ subscription_id?: string;
186
+ /** Chargebee coupon ids — resolve via POST /get-coupon-details */
187
+ coupon_ids?: string[];
188
+ /** When upgrading an existing sub with coupons. Default `true`. */
189
+ replace_coupon_list?: boolean;
190
+ };
191
+ export type CreateCheckoutSessionResponse = {
192
+ url: string;
193
+ hosted_page_id: string | null;
194
+ expires_at: number | null;
195
+ };
196
+ export type CreateChargeCheckoutSessionRequestBody = {
197
+ line_items: BillingV2LineItem[];
198
+ currency?: string;
199
+ };
200
+ export type CreateChargeCheckoutSessionResponse = {
201
+ url: string;
202
+ hosted_page_id: string | null;
203
+ expires_at: number | null;
204
+ };
205
+ export type CreateCustomerPortalRequestBody = {
206
+ redirect_url: string;
207
+ };
208
+ export type CreateCustomerPortalResponse = {
209
+ url: string;
210
+ expires_at?: number;
211
+ };
212
+ export type UpdateSubscriptionRequestBody = {
213
+ subscription_id: string;
214
+ line_items: BillingV2LineItem[];
215
+ replace_addon_list?: boolean;
216
+ };
217
+ export type UpdateSubscriptionResponse = {
218
+ subscription_id: string;
219
+ status: string;
220
+ current_term_start: number | null;
221
+ current_term_end: number | null;
222
+ cancelled_at: number | null;
223
+ };
224
+ export type CancelSubscriptionRequestBody = {
225
+ subscription_id: string;
226
+ };
227
+ export type CancelSubscriptionResponse = {
228
+ subscription_id: string;
229
+ status: string;
230
+ cancelled_at?: number;
231
+ };
232
+ export type ResumeCancelledSubscriptionRequestBody = {
233
+ subscription_id: string;
234
+ };
235
+ export type ResumeCancelledSubscriptionResponse = {
236
+ subscription_id: string;
237
+ status: string;
238
+ };
239
+ export type BillingV2InvoiceSummary = {
240
+ invoice_id: string;
241
+ status: string;
242
+ amount_due: BillingMoney;
243
+ date: number;
244
+ };
245
+ export type GetUnpaidInvoicesResponse = BillingV2InvoiceSummary[];
246
+ export type GetLatestNextInvoiceResponse = {
247
+ latest_invoice: BillingV2InvoiceSummary | null;
248
+ next_invoice: {
249
+ amount: BillingMoney;
250
+ date: number;
251
+ } | null;
252
+ };
253
+ export type GetInvoiceLinkResponse = {
254
+ url: string;
255
+ } | null;
256
+ export type DownloadInvoiceParams = {
257
+ invoice_id: string;
258
+ };
259
+ export type DownloadInvoiceResponse = {
260
+ url: string;
261
+ valid_till?: number;
262
+ };
263
+ export type GetRecentInvoicesParams = {
264
+ /** Max invoices to return (default 10, max 50). Customer resolved from org_id — do not pass customer_id. */
265
+ limit?: number;
266
+ };
267
+ export type RecentInvoiceLineItem = {
268
+ description: string | null;
269
+ entity_description: string | null;
270
+ quantity: number;
271
+ amount: BillingMoney;
272
+ };
273
+ /** Chargebee invoice row — aligned with dashboard fields (ID, status, type, total, credits). */
274
+ export type ChargebeeInvoiceSummary = {
275
+ invoice_id: string;
276
+ /** Primary display title — first line item description from Chargebee. */
277
+ name: string;
278
+ description: string | null;
279
+ status: string;
280
+ /** `recurring` → "Recurring"; otherwise "One-time" on Chargebee. */
281
+ type: 'recurring' | 'one_time';
282
+ recurring: boolean;
283
+ /** Invoice created date (Chargebee `date`). */
284
+ date: number | null;
285
+ due_date: number | null;
286
+ paid_at: number | null;
287
+ subscription_id: string | null;
288
+ total: BillingMoney;
289
+ amount_due: BillingMoney;
290
+ amount_paid: BillingMoney;
291
+ /** Promotional / account credits applied ("Credits Issued" on Chargebee). */
292
+ credits_applied: BillingMoney | null;
293
+ line_items: RecentInvoiceLineItem[];
294
+ download_url: string | null;
295
+ download_valid_till: number | null;
296
+ };
297
+ export type RecentInvoice = ChargebeeInvoiceSummary;
298
+ export type GetRecentInvoicesResponse = RecentInvoice[];
299
+ /** Billing address fields accepted by Chargebee customer.updateBillingInfo. */
300
+ export type BillingAddress = {
301
+ first_name?: string;
302
+ last_name?: string;
303
+ email?: string;
304
+ company?: string;
305
+ phone?: string;
306
+ line1?: string;
307
+ line2?: string;
308
+ line3?: string;
309
+ city?: string;
310
+ state_code?: string;
311
+ state?: string;
312
+ country?: string;
313
+ zip?: string;
314
+ vat_number?: string;
315
+ };
316
+ export type UpdateBillingDetailsRequestBody = {
317
+ billing_address: BillingAddress;
318
+ /** When country is IN, optionally move free-trial customer to IN entity. Defaults to US behaviour otherwise. */
319
+ move_to_entity?: BillingEntity;
320
+ };
321
+ export type UpdateBillingDetailsResponse = {
322
+ customer_id: string;
323
+ billing_address: BillingAddress;
324
+ preferred_currency_code: string;
325
+ };
326
+ export type GetUsageResponse = {
327
+ allowances: UsageAllowances;
328
+ consumption: UsageConsumption;
329
+ };
330
+ /** Upcoming renewal charge — null when no subscription or estimate unavailable. */
331
+ export type PlanSummaryNextInvoice = {
332
+ amount: BillingMoney;
333
+ date: number;
334
+ /** e.g. "USD 56.00 on 18 Jul 2026" */
335
+ label: string;
336
+ };
337
+ export type PlanSummarySection = {
338
+ current_plan: string;
339
+ /** null when org_plan is not seeded yet */
340
+ plan_id: AllPlansV2 | string | null;
341
+ billing_frequency: BillingFrequency | 'weekly' | 'custom';
342
+ users: number;
343
+ phones: number;
344
+ /** null on free trial — no recurring rules allowance */
345
+ rules_allowance: number | null;
346
+ /** null on free trial — recurring BM only; free trial has top-up via charge_packs */
347
+ bm_credits_allowance: number | null;
348
+ /** null on free trial or when no upcoming renewal */
349
+ next_invoice: PlanSummaryNextInvoice | null;
350
+ };
351
+ export type PlanSummarySubscriptionStatus = 'active' | 'unpaid' | 'inactive';
352
+ export type PlanSummaryInvoice = ChargebeeInvoiceSummary & {
353
+ /** Hosted payment page — null unless status is payment_due / not_paid. */
354
+ payment_url: string | null;
355
+ };
356
+ export type PlanSummaryChargePack = {
357
+ pack_id: 'bulk-message-credits';
358
+ lookup_key: string;
359
+ name: string;
360
+ /** Current top-up balance — null when zero. */
361
+ remaining_credits: number | null;
362
+ };
363
+ export type GetPlanSummaryResponse = {
364
+ billing_version: BillingVersion;
365
+ summary: PlanSummarySection;
366
+ subscription_status: PlanSummarySubscriptionStatus;
367
+ /** Newest first — empty when customer has no invoices. */
368
+ last_5_invoices: PlanSummaryInvoice[];
369
+ /** BM top-up only — empty when top-up balance is zero. */
370
+ charge_packs: PlanSummaryChargePack[];
371
+ };
372
+ /** Raw Chargebee webhook POST body. */
373
+ export type ChargebeeWebhookEventPayload = {
374
+ id: string;
375
+ occurred_at: number;
376
+ event_type: string;
377
+ content: Record<string, unknown>;
378
+ source?: string;
379
+ webhook_status?: string;
380
+ };
381
+ export type ChargebeeV2EventHandleResult = {
382
+ received: true;
383
+ handled: boolean;
384
+ event_id: string;
385
+ event_type: string;
386
+ billing_version?: BillingVersion;
387
+ org_id?: string;
388
+ reason?: string;
389
+ };
390
+ //# sourceMappingURL=billing.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.types.d.ts","sourceRoot":"","sources":["../src/billing.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAA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AAqB,GAAG;IAClC,OAAO,EAAE,sBAAsB,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,EAAE,cAAc,CAAC;IAChC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,mBAAmB,EAAE,6BAA6B,CAAC;IACnD,0DAA0D;IAC1D,eAAe,EAAE,kBAAkB,EAAE,CAAC;IACtC,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,EAAE,CAAC;CACvC,CAAC;AAIF,uCAAuC;AACvC,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isV2Plan = exports.GENERIC_PACK_IDS = exports.AllPlansV2 = void 0;
4
+ var AllPlansV2;
5
+ (function (AllPlansV2) {
6
+ AllPlansV2["FREE_TRIAL"] = "v2-free-trial";
7
+ AllPlansV2["MONTHLY_STARTER"] = "v2-monthly-starter";
8
+ AllPlansV2["YEARLY_STARTER"] = "v2-annual-starter";
9
+ AllPlansV2["MONTHLY_PRO"] = "v2-monthly-pro";
10
+ AllPlansV2["YEARLY_PRO"] = "v2-annual-pro";
11
+ })(AllPlansV2 || (exports.AllPlansV2 = AllPlansV2 = {}));
12
+ exports.GENERIC_PACK_IDS = [
13
+ 'priority-support-pack',
14
+ 'automation-pack',
15
+ 'ai-pack',
16
+ 'bulk-message-credits',
17
+ 'guided-onboarding',
18
+ 'support-call',
19
+ 'support-call-pack',
20
+ ];
21
+ const isV2Plan = (plan) => plan.billing_version === 'v2';
22
+ exports.isV2Plan = isV2Plan;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './billing.types';
1
2
  export * from './object.types';
2
3
  export * from './rules.types';
3
4
  export * from './supabase.types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +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
+ __exportStar(require("./billing.types"), exports);
17
18
  __exportStar(require("./object.types"), exports);
18
19
  __exportStar(require("./rules.types"), exports);
19
20
  __exportStar(require("./supabase.types"), exports);
@@ -432,31 +432,31 @@ export type Rule = OverrideProperties<Tables<'tbl_automation_rules'>, {
432
432
  export declare const RuleInfoSchemaMap: {
433
433
  message: {
434
434
  triggers: readonly ["message.created", "message.updated", "message.flagged", "message.unflagged", "message.deleted"];
435
- variableMaps: (Record<"message.org_id" | "message.chat_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType>)[];
435
+ variableMaps: (Record<"message.chat_id" | "message.org_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType>)[];
436
436
  };
437
437
  ticket: {
438
438
  triggers: readonly ["ticket.created", "ticket.updated", "ticket.closed", "ticket.label.updated", "ticket.message.attached"];
439
- variableMaps: (Record<"message.org_id" | "message.chat_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"ticket.created_at" | "ticket.org_id" | "ticket.chat_id" | "ticket.ticket_id" | "ticket.assignee" | "ticket.due_date" | "ticket.priority" | "ticket.status" | "ticket.is_deleted" | "ticket.labels" | "ticket.custom_properties" | "ticket.subject" | "ticket.raised_by", VariableNameValueType>)[];
439
+ variableMaps: (Record<"message.chat_id" | "message.org_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"ticket.assignee" | "ticket.chat_id" | "ticket.created_at" | "ticket.due_date" | "ticket.org_id" | "ticket.priority" | "ticket.status" | "ticket.ticket_id" | "ticket.is_deleted" | "ticket.labels" | "ticket.custom_properties" | "ticket.subject" | "ticket.raised_by", VariableNameValueType>)[];
440
440
  };
441
441
  chat: {
442
442
  triggers: readonly ["chat.created", "chat.label.updated"];
443
- variableMaps: Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType>[];
443
+ variableMaps: Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType>[];
444
444
  };
445
445
  reaction: {
446
446
  triggers: readonly ["reaction.added"];
447
- variableMaps: (Record<"message.org_id" | "message.chat_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"reaction.chat_id" | "reaction.reaction" | "reaction.message_id" | "reaction.sender_id" | "reaction.reaction_id", VariableNameValueType>)[];
447
+ variableMaps: (Record<"message.chat_id" | "message.org_id" | "message.org_phone" | "message.author" | "message.body" | "message.flag_status" | "message.has_quoted_msg" | "message.media" | "message.message_id" | "message.message_ticket_id" | "message.message_type" | "message.performed_by" | "message.sender_phone" | "message.timestamp" | "message.is_last_message", VariableNameValueType> | Record<"sender.org_id" | "sender.contact_id" | "sender.contact_name" | "sender.is_internal" | "sender.is_admin" | "sender.labels", VariableNameValueType> | Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"reaction.chat_id" | "reaction.reaction" | "reaction.message_id" | "reaction.sender_id" | "reaction.reaction_id", VariableNameValueType>)[];
448
448
  };
449
449
  task: {
450
450
  triggers: readonly ["task.created", "task.assignee.updated"];
451
- variableMaps: (Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"task.created_at" | "task.org_id" | "task.assignee" | "task.due_date" | "task.notes" | "task.priority" | "task.status" | "task.task_id" | "task.title", VariableNameValueType>)[];
451
+ variableMaps: (Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"task.assignee" | "task.created_at" | "task.due_date" | "task.notes" | "task.org_id" | "task.priority" | "task.status" | "task.task_id" | "task.title", VariableNameValueType>)[];
452
452
  };
453
453
  call: {
454
454
  triggers: readonly ["call.created"];
455
- variableMaps: (Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"call_notification.org_id" | "call_notification.chat_id" | "call_notification.author" | "call_notification.timestamp" | "call_notification.notification_id" | "call_notification.isVideo" | "call_notification.isOutgoing" | "call_notification.call_result", VariableNameValueType>)[];
455
+ variableMaps: (Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"call_notification.chat_id" | "call_notification.org_id" | "call_notification.author" | "call_notification.timestamp" | "call_notification.notification_id" | "call_notification.isVideo" | "call_notification.isOutgoing" | "call_notification.call_result", VariableNameValueType>)[];
456
456
  };
457
457
  member: {
458
458
  triggers: readonly ["member.joined"];
459
- variableMaps: (Record<"chat.created_at" | "chat.org_id" | "chat.chat_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"member_notification.type" | "member_notification.org_id" | "member_notification.chat_id" | "member_notification.org_phone" | "member_notification.timestamp" | "member_notification.notification_id" | "member_notification.recipientids", VariableNameValueType>)[];
459
+ variableMaps: (Record<"chat.chat_id" | "chat.created_at" | "chat.org_id" | "chat.org_phone" | "chat.labels" | "chat.assigned_to" | "chat.chat_name" | "chat.chat_type" | "chat.group_description" | "chat.info_admins_only" | "chat.chat_org_phones" | "chat.messages_admins_only" | "chat.custom_properties" | "chat.initiated_by" | "chat.has_flagged_messages" | "chat.members" | "chat.assignee_name", VariableNameValueType> | Record<"member_notification.chat_id" | "member_notification.org_id" | "member_notification.type" | "member_notification.org_phone" | "member_notification.timestamp" | "member_notification.notification_id" | "member_notification.recipientids", VariableNameValueType>)[];
460
460
  };
461
461
  };
462
462
  export declare const additionalAssigneeOptions: {
@@ -2241,6 +2241,56 @@ export type Database = {
2241
2241
  }
2242
2242
  ];
2243
2243
  };
2244
+ tbl_api_tokens: {
2245
+ Row: {
2246
+ exp: string;
2247
+ iat: string;
2248
+ id: string;
2249
+ is_revealed: boolean;
2250
+ name: string;
2251
+ org_id: string;
2252
+ role: string;
2253
+ token: string;
2254
+ token_hash: string;
2255
+ token_metadata: Json;
2256
+ type: Database["public"]["Enums"]["enum_integration_type"];
2257
+ };
2258
+ Insert: {
2259
+ exp: string;
2260
+ iat: string;
2261
+ id: string;
2262
+ is_revealed?: boolean;
2263
+ name: string;
2264
+ org_id: string;
2265
+ role: string;
2266
+ token: string;
2267
+ token_hash: string;
2268
+ token_metadata?: Json;
2269
+ type: Database["public"]["Enums"]["enum_integration_type"];
2270
+ };
2271
+ Update: {
2272
+ exp?: string;
2273
+ iat?: string;
2274
+ id?: string;
2275
+ is_revealed?: boolean;
2276
+ name?: string;
2277
+ org_id?: string;
2278
+ role?: string;
2279
+ token?: string;
2280
+ token_hash?: string;
2281
+ token_metadata?: Json;
2282
+ type?: Database["public"]["Enums"]["enum_integration_type"];
2283
+ };
2284
+ Relationships: [
2285
+ {
2286
+ foreignKeyName: "tbl_api_tokens_org_id_fkey";
2287
+ columns: ["org_id"];
2288
+ isOneToOne: false;
2289
+ referencedRelation: "tbl_org";
2290
+ referencedColumns: ["org_id"];
2291
+ }
2292
+ ];
2293
+ };
2244
2294
  tbl_integration_tokens: {
2245
2295
  Row: {
2246
2296
  exp: string;