@thinkerchain/flipper-entities 2.0.0 → 2.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/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/types/billing-options.types.d.ts +14 -0
- package/dist/types/billing-options.types.d.ts.map +1 -0
- package/dist/types/billing-options.types.js +3 -0
- package/dist/types/billing-options.types.js.map +1 -0
- package/dist/types/plan.types.d.ts +47 -0
- package/dist/types/plan.types.d.ts.map +1 -0
- package/dist/types/plan.types.js +3 -0
- package/dist/types/plan.types.js.map +1 -0
- package/dist/types/product.types.d.ts +69 -0
- package/dist/types/product.types.d.ts.map +1 -0
- package/dist/types/product.types.js +3 -0
- package/dist/types/product.types.js.map +1 -0
- package/dist/types/search.types.d.ts +4 -0
- package/dist/types/search.types.d.ts.map +1 -1
- package/dist/types/subscription.types.d.ts +89 -0
- package/dist/types/subscription.types.d.ts.map +1 -0
- package/dist/types/subscription.types.js +3 -0
- package/dist/types/subscription.types.js.map +1 -0
- package/dist/types/usage.types.d.ts +33 -0
- package/dist/types/usage.types.d.ts.map +1 -0
- package/dist/types/usage.types.js +3 -0
- package/dist/types/usage.types.js.map +1 -0
- package/dist/types/user-channel.types.d.ts +4 -0
- package/dist/types/user-channel.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,5 +10,9 @@ export type { EngineSearchRequest, EngineEnv, EngineChildInput, EngineScrapeInpu
|
|
|
10
10
|
export type { ChannelEntity, TelegramChannelEntity, UserChannelEntity, } from './types/user-channel.types';
|
|
11
11
|
export type { CoreEntity, DefaultValueEntity, StringMatchAlgorithm, StringMatcherType, DefaultItemFilterEntity, MarketPlacePropEntity, FacebookMarketPlacePropEntity, EngineEntity, EngineOptions, OrchestratorOptions, ProxyOptions, } from './types/core-options.types';
|
|
12
12
|
export type { OptionEntity } from './types/option.types';
|
|
13
|
+
export type { ProductKind, ProductProfileKind, ProductFeature, ProductSearchProfileEntity, ProductChannelProfileEntity, ProductEntity, } from './types/product.types';
|
|
14
|
+
export type { SubscriptionStatus, SubscriptionSource, SubscriptionProfileKind, SubscriptionItemStatus, SubscriptionProfileEntity, SubscriptionItemEntity, SubscriptionProfileSnapshot, SubscriptionSnapshot, SubscriptionEntity, SubscriptionWithProduct, } from './types/subscription.types';
|
|
15
|
+
export type { BillingValueJSONB } from './types/billing-options.types';
|
|
16
|
+
export type { UsageProfileMetric, UsageMetric, SubscriptionUsageSummary, } from './types/usage.types';
|
|
13
17
|
export type { LocationJSONB, MarketPlacePropJSONB, ItemFilterImage, ItemFilterLink, ItemFilterLocation, ItemFilterName, ItemFilterPrice, ItemFilterYear, ItemFilterDescription, ItemFilterRating, ItemFilterScam, ItemFilterJSONB, CoreValueJSONB, } from './types/search-jsonb.types';
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAExE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEzE,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEzE,YAAY,EACV,mBAAmB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sB,CAAC;AAEzE,YAAY,EACV,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,YAAY,EACV,kBAAkB,EAClB,WAAW,EACX,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Nilai kolom `Option.value` untuk `name='billing'` (konfigurasi trial & enforcement). */
|
|
2
|
+
export interface BillingValueJSONB {
|
|
3
|
+
/** Produk yang dipakai untuk trial. */
|
|
4
|
+
trialProductKey: string;
|
|
5
|
+
/** Lama trial dalam hari. */
|
|
6
|
+
trialDays: number;
|
|
7
|
+
/** Toleransi hari setelah periode habis sebelum langganan dianggap mati. */
|
|
8
|
+
graceDays: number;
|
|
9
|
+
/** true = user tanpa langganan otomatis dapat trial saat register / pertama diakses. */
|
|
10
|
+
autoTrial: boolean;
|
|
11
|
+
/** true = kuota ditegakkan (create-time + runtime). false = mode aman/dry-run. */
|
|
12
|
+
enforcementEnabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=billing-options.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-options.types.d.ts","sourceRoot":"","sources":["../../src/types/billing-options.types.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,SAAS,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-options.types.js","sourceRoot":"","sources":["../../src/types/billing-options.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Katalog plan: `base` = langganan utama, `addon` = paket tambahan (mis. Extra Search). */
|
|
2
|
+
export type PlanKind = 'base' | 'addon';
|
|
3
|
+
/** Nilai limit per plan (kolom jsonb `Plan.limits`). */
|
|
4
|
+
export interface PlanLimits {
|
|
5
|
+
/** Jumlah search aktif maksimum untuk satu langganan. */
|
|
6
|
+
maxActiveSearches: number;
|
|
7
|
+
/** Jumlah user channel maksimum untuk satu langganan. */
|
|
8
|
+
maxChannels: number;
|
|
9
|
+
/** Delay minimum antar-scrape (ms) yang boleh dipakai search plan ini. */
|
|
10
|
+
minDelayMilis: number;
|
|
11
|
+
/** Jumlah marketplace maksimum per search. */
|
|
12
|
+
maxMarketplacesPerSearch: number;
|
|
13
|
+
/** Jumlah item maksimum yang disimpan per search. */
|
|
14
|
+
maxItemsPerSearch: number;
|
|
15
|
+
/** Slot search tambahan per unit, dipakai plan `kind='addon'`. */
|
|
16
|
+
addonSearchSlots?: number;
|
|
17
|
+
/** true = limit tidak dibatasi; menang atas angka lain. */
|
|
18
|
+
isUnlimited?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Benefit marketing untuk kartu pricing. */
|
|
21
|
+
export interface PlanFeature {
|
|
22
|
+
key: string;
|
|
23
|
+
label: string;
|
|
24
|
+
included: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Representasi tabel `Plan`. */
|
|
27
|
+
export type PlanEntity = {
|
|
28
|
+
id: number;
|
|
29
|
+
key: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string | null;
|
|
32
|
+
kind: PlanKind;
|
|
33
|
+
priceCents: number;
|
|
34
|
+
currency: string;
|
|
35
|
+
/** 'month' | 'year' | null (null = paket sekali beli seperti addon). */
|
|
36
|
+
interval: string | null;
|
|
37
|
+
sortOrder: number;
|
|
38
|
+
isActive: boolean;
|
|
39
|
+
features: PlanFeature[] | null;
|
|
40
|
+
limits: PlanLimits;
|
|
41
|
+
deleted: boolean;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
createdBy: string | null;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
updatedBy: string | null;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=plan.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.types.d.ts","sourceRoot":"","sources":["../../src/types/plan.types.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AA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ourceRoot":"","sources":["../../src/types/plan.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Katalog produk. Nilai yang dipakai saat ini: `plan` (langganan utama) dan
|
|
3
|
+
* `addon` (paket tambahan, mis. Extra Search). Sengaja bertipe string supaya
|
|
4
|
+
* jenis produk baru tidak butuh perubahan tipe.
|
|
5
|
+
*/
|
|
6
|
+
export type ProductKind = 'plan' | 'addon';
|
|
7
|
+
/** Peran profil di dalam sebuah produk. */
|
|
8
|
+
export type ProductProfileKind = 'base' | 'delta';
|
|
9
|
+
/** Benefit marketing untuk kartu pricing. */
|
|
10
|
+
export interface ProductFeature {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
included: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Profil search yang dijual sebuah produk (tabel `ProductSearchProfile`). */
|
|
16
|
+
export interface ProductSearchProfileEntity {
|
|
17
|
+
id: number;
|
|
18
|
+
productId: number;
|
|
19
|
+
/** Slug stabil, dipakai baris langganan untuk menunjuk profil ini. */
|
|
20
|
+
key: string;
|
|
21
|
+
name: string;
|
|
22
|
+
/** `delta` = profil ini menambah slot ke profil `base` dengan key yang sama. */
|
|
23
|
+
kind: ProductProfileKind;
|
|
24
|
+
/** Jumlah search aktif yang boleh menempel ke profil ini. */
|
|
25
|
+
slot: number;
|
|
26
|
+
/** Delay antar-scrape (ms) yang dipakai search di profil ini. */
|
|
27
|
+
delayMilis: number;
|
|
28
|
+
/** Marketplace yang boleh dipakai search di profil ini. */
|
|
29
|
+
allowedMarketPlaces: string[];
|
|
30
|
+
deleted: boolean;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
}
|
|
34
|
+
/** Profil channel yang dijual sebuah produk (tabel `ProductChannelProfile`). */
|
|
35
|
+
export interface ProductChannelProfileEntity {
|
|
36
|
+
id: number;
|
|
37
|
+
productId: number;
|
|
38
|
+
key: string;
|
|
39
|
+
name: string;
|
|
40
|
+
slot: number;
|
|
41
|
+
/** Jenis channel; harus punya adapter di flipper-notification. */
|
|
42
|
+
type: string;
|
|
43
|
+
deleted: boolean;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
/** Representasi tabel `Product` — satu katalog untuk semua yang dijual. */
|
|
48
|
+
export type ProductEntity = {
|
|
49
|
+
id: number;
|
|
50
|
+
key: string;
|
|
51
|
+
name: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
kind: string;
|
|
54
|
+
priceCents: number;
|
|
55
|
+
currency: string;
|
|
56
|
+
/** 'month' | 'year' | null (null = sekali beli seperti addon). */
|
|
57
|
+
interval: string | null;
|
|
58
|
+
sortOrder: number;
|
|
59
|
+
isActive: boolean;
|
|
60
|
+
features: ProductFeature[] | null;
|
|
61
|
+
searchProfiles: ProductSearchProfileEntity[];
|
|
62
|
+
channelProfiles: ProductChannelProfileEntity[];
|
|
63
|
+
deleted: boolean;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
createdBy: string | null;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
updatedBy: string | null;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=product.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.types.d.ts","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,2CAA2C;AAC3C,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,8EAA8E;AAC9E,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;I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C/C,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":""}
|
|
@@ -13,6 +13,10 @@ export type SearchEntity = {
|
|
|
13
13
|
delayMilis: number;
|
|
14
14
|
lastScrappedEpoch: string | null;
|
|
15
15
|
filter: ItemFilterJSONB | null;
|
|
16
|
+
/** Langganan yang membayar search ini; null = search lama, tidak dieksekusi. */
|
|
17
|
+
subscriptionId?: number | null;
|
|
18
|
+
/** Profil langganan (scanner) yang dipakai search ini; null = tidak dieksekusi. */
|
|
19
|
+
subscriptionProfileId?: number | null;
|
|
16
20
|
deleted: boolean;
|
|
17
21
|
createdAt: string;
|
|
18
22
|
createdBy: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.types.d.ts","sourceRoot":"","sources":["../../src/types/search.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,mCAAmC;AACnC,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,M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AM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,gCAAgC;AAChC,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ProductEntity } from './product.types';
|
|
2
|
+
export type SubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'expired';
|
|
3
|
+
export type SubscriptionSource = 'manual' | 'trial' | 'payment';
|
|
4
|
+
export type SubscriptionProfileKind = 'search' | 'channel';
|
|
5
|
+
export type SubscriptionItemStatus = 'active' | 'cancelled';
|
|
6
|
+
/**
|
|
7
|
+
* Baris beku entitlement milik satu langganan (tabel `SubscriptionProfile`).
|
|
8
|
+
* Dibuat sekali saat langganan dibuat; search/channel menempel ke baris ini,
|
|
9
|
+
* bukan ke katalog — jadi edit katalog tidak pernah mengubah relasi.
|
|
10
|
+
*/
|
|
11
|
+
export interface SubscriptionProfileEntity {
|
|
12
|
+
id: number;
|
|
13
|
+
subscriptionId: number;
|
|
14
|
+
kind: SubscriptionProfileKind;
|
|
15
|
+
/** Jejak asal profil di katalog; null kalau produknya sudah dihapus. */
|
|
16
|
+
productProfileId: number | null;
|
|
17
|
+
key: string;
|
|
18
|
+
name: string;
|
|
19
|
+
/** Slot dasar dari plan saat langganan dibuat. */
|
|
20
|
+
slot: number;
|
|
21
|
+
delayMilis: number | null;
|
|
22
|
+
allowedMarketPlaces: string[] | null;
|
|
23
|
+
type: string | null;
|
|
24
|
+
deleted: boolean;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
}
|
|
27
|
+
/** Pembelian produk addon (tabel `SubscriptionItem`). */
|
|
28
|
+
export interface SubscriptionItemEntity {
|
|
29
|
+
id: number;
|
|
30
|
+
subscriptionId: number;
|
|
31
|
+
productId: number;
|
|
32
|
+
quantity: number;
|
|
33
|
+
/** Harga satuan saat pembelian. */
|
|
34
|
+
unitPriceCents: number;
|
|
35
|
+
/** Profil langganan yang mendapat slot tambahan. */
|
|
36
|
+
targetSubscriptionProfileId: number | null;
|
|
37
|
+
extraSlots: number;
|
|
38
|
+
status: SubscriptionItemStatus;
|
|
39
|
+
startedAt: string;
|
|
40
|
+
endedAt: string | null;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
}
|
|
43
|
+
/** Copy profil untuk audit; angka yang dipakai logika ada di `SubscriptionProfile`. */
|
|
44
|
+
export interface SubscriptionProfileSnapshot {
|
|
45
|
+
profileId: number;
|
|
46
|
+
kind: SubscriptionProfileKind;
|
|
47
|
+
key: string;
|
|
48
|
+
name: string;
|
|
49
|
+
slot: number;
|
|
50
|
+
delayMilis?: number | null;
|
|
51
|
+
allowedMarketPlaces?: string[] | null;
|
|
52
|
+
type?: string | null;
|
|
53
|
+
}
|
|
54
|
+
/** Snapshot saat langganan dibuat; audit/display saja, bukan sumber logika. */
|
|
55
|
+
export interface SubscriptionSnapshot {
|
|
56
|
+
productKey: string;
|
|
57
|
+
productName: string;
|
|
58
|
+
priceCents: number;
|
|
59
|
+
interval: string | null;
|
|
60
|
+
profiles: SubscriptionProfileSnapshot[];
|
|
61
|
+
}
|
|
62
|
+
/** Representasi tabel `Subscription`. */
|
|
63
|
+
export type SubscriptionEntity = {
|
|
64
|
+
id: number;
|
|
65
|
+
userId: number;
|
|
66
|
+
productId: number;
|
|
67
|
+
/** Copy beku dari katalog untuk tampilan; katalog bisa berubah. */
|
|
68
|
+
productKey: string | null;
|
|
69
|
+
productName: string | null;
|
|
70
|
+
status: SubscriptionStatus;
|
|
71
|
+
currentPeriodStart: string;
|
|
72
|
+
currentPeriodEnd: string;
|
|
73
|
+
cancelAtPeriodEnd: boolean;
|
|
74
|
+
source: SubscriptionSource;
|
|
75
|
+
snapshot: SubscriptionSnapshot | null;
|
|
76
|
+
assignedBy: string | null;
|
|
77
|
+
deleted: boolean;
|
|
78
|
+
createdAt: string;
|
|
79
|
+
createdBy: string | null;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
updatedBy: string | null;
|
|
82
|
+
};
|
|
83
|
+
/** Langganan + produk, profil beku, dan pembelian addon-nya. */
|
|
84
|
+
export type SubscriptionWithProduct = SubscriptionEntity & {
|
|
85
|
+
product?: ProductEntity;
|
|
86
|
+
profiles?: SubscriptionProfileEntity[];
|
|
87
|
+
items?: SubscriptionItemEntity[];
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=subscription.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.d.ts","sourceRoot":"","sources":["../../src/types/subscription.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhE,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mBAAmB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,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C;IAClB,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,GAAG;IACzD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.js","sourceRoot":"","sources":["../../src/types/subscription.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SubscriptionProfileKind, SubscriptionStatus } from './subscription.types';
|
|
2
|
+
/** Pemakaian satu profil langganan (search atau channel). */
|
|
3
|
+
export interface UsageProfileMetric {
|
|
4
|
+
subscriptionProfileId: number;
|
|
5
|
+
kind: SubscriptionProfileKind;
|
|
6
|
+
key: string;
|
|
7
|
+
name: string;
|
|
8
|
+
used: number;
|
|
9
|
+
/** Slot efektif = slot dasar + total addon yang menempel ke profil ini. */
|
|
10
|
+
slot: number;
|
|
11
|
+
baseSlot: number;
|
|
12
|
+
addOnSlots: number;
|
|
13
|
+
}
|
|
14
|
+
/** Satu kelompok metrik: total pemakaian + rincian per profil. */
|
|
15
|
+
export interface UsageMetric {
|
|
16
|
+
used: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
profiles: UsageProfileMetric[];
|
|
19
|
+
}
|
|
20
|
+
/** Respons `GET /plans/usage`: langganan aktif + pemakaian berjalan. */
|
|
21
|
+
export interface SubscriptionUsageSummary {
|
|
22
|
+
productKey: string;
|
|
23
|
+
productName: string;
|
|
24
|
+
status: SubscriptionStatus;
|
|
25
|
+
currentPeriodStart: string;
|
|
26
|
+
currentPeriodEnd: string;
|
|
27
|
+
remainingDays: number;
|
|
28
|
+
/** Total slot search tambahan dari pembelian addon aktif. */
|
|
29
|
+
addOnSlots: number;
|
|
30
|
+
searches: UsageMetric;
|
|
31
|
+
channels: UsageMetric;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=usage.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.types.d.ts","sourceRoot":"","sources":["../../src/types/usage.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.types.js","sourceRoot":"","sources":["../../src/types/usage.types.ts"],"names":[],"mappings":""}
|
|
@@ -11,6 +11,10 @@ export type UserChannelEntity = {
|
|
|
11
11
|
userId: number;
|
|
12
12
|
name: string;
|
|
13
13
|
other: Record<string, unknown> | null;
|
|
14
|
+
/** Langganan yang membayar channel ini; null = channel lama, tidak dipakai kirim notifikasi. */
|
|
15
|
+
subscriptionId?: number | null;
|
|
16
|
+
/** Profil langganan (jenis channel) yang dipakai channel ini; null = tidak dipakai. */
|
|
17
|
+
subscriptionProfileId?: number | null;
|
|
14
18
|
deleted: boolean;
|
|
15
19
|
createdAt: string;
|
|
16
20
|
createdBy: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-channel.types.d.ts","sourceRoot":"","sources":["../../src/types/user-channel.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,wCAAwC;AACxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,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