@c1m-public/channel-client 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -6
- package/dist/index.d.ts +26 -4
- package/dist/index.js +21 -2
- package/dist/next.d.ts +15 -0
- package/dist/types.d.ts +134 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,8 +13,14 @@ transport core.
|
|
|
13
13
|
- `@c1m-public/channel-client/webhooks` — framework-neutral webhook events and
|
|
14
14
|
signature verification.
|
|
15
15
|
|
|
16
|
-
Channel credentials resolve the tenant and
|
|
17
|
-
URLs never carry
|
|
16
|
+
Channel credentials resolve the tenant and scope at the API door (plus the
|
|
17
|
+
workspace for workspace-scoped channels), so site URLs never carry those
|
|
18
|
+
identifiers.
|
|
19
|
+
|
|
20
|
+
Managed C1M sites need one deployment secret: `C1M_CHANNEL_TOKEN`. The client
|
|
21
|
+
uses `https://api.saasdash.app` by default. Pass `baseUrl` directly only for
|
|
22
|
+
local development or private C1M infrastructure; it is not part of the normal
|
|
23
|
+
deployment contract.
|
|
18
24
|
|
|
19
25
|
### Next.js
|
|
20
26
|
|
|
@@ -22,7 +28,6 @@ URLs never carry either identifier.
|
|
|
22
28
|
import { createNextChannelClient } from "@c1m-public/channel-client/next";
|
|
23
29
|
|
|
24
30
|
const channel = createNextChannelClient({
|
|
25
|
-
baseUrl: process.env.C1M_API_URL!,
|
|
26
31
|
token: process.env.C1M_CHANNEL_TOKEN!,
|
|
27
32
|
cache: { revalidate: 60 },
|
|
28
33
|
});
|
|
@@ -48,12 +53,16 @@ const checkout = await channel.checkout.pay(
|
|
|
48
53
|
import { createChannelClient } from "@c1m-public/channel-client";
|
|
49
54
|
|
|
50
55
|
const channel = createChannelClient({
|
|
51
|
-
baseUrl: process.env.C1M_API_URL!,
|
|
52
56
|
token: process.env.C1M_CHANNEL_TOKEN!,
|
|
53
57
|
});
|
|
54
58
|
|
|
55
59
|
const category = await channel.categories.products("electric-cars");
|
|
56
60
|
|
|
61
|
+
// A dash-scoped token exposes the dash's own public site data through the
|
|
62
|
+
// same transport. Workspace-only calls return 404 for this token by design.
|
|
63
|
+
const dash = await channel.dash.init();
|
|
64
|
+
const directory = await channel.dash.directory.list({ region: "london" });
|
|
65
|
+
|
|
57
66
|
// Customer credentials are request-scoped and never stored on the shared
|
|
58
67
|
// channel client. Every account read is forced to no-store.
|
|
59
68
|
const account = channel.withCustomer(customerAccessToken);
|
|
@@ -61,6 +70,36 @@ const addresses = await account.addresses.list();
|
|
|
61
70
|
const subscriptions = await account.subscriptions.list({ status: "active" });
|
|
62
71
|
```
|
|
63
72
|
|
|
73
|
+
### Headless customer OTP
|
|
74
|
+
|
|
75
|
+
Customer OTP is available through the same end-user auth handler used by the
|
|
76
|
+
first-party workspace application. The channel token identifies the app and
|
|
77
|
+
workspace; the returned customer session must remain request-scoped.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { isChannelAPIError } from "@c1m-public/channel-client";
|
|
81
|
+
|
|
82
|
+
await channel.auth.sendCode("customer@example.com");
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
const session = await channel.auth.verifyCode({
|
|
86
|
+
email: "customer@example.com",
|
|
87
|
+
code: submittedCode,
|
|
88
|
+
});
|
|
89
|
+
// Store tokens in secure, HTTP-only host cookies owned by your application.
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (isChannelAPIError(error)) {
|
|
92
|
+
// invalid_code (401), too_many_attempts (429), account_disabled (403)
|
|
93
|
+
// are stable recovery states. Unknown failures include requestId for support.
|
|
94
|
+
console.error("customer sign-in failed", error.code, error.requestId);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Do not call Channel API auth directly from a browser: doing so would expose the
|
|
100
|
+
channel credential. Use a server action or route handler and return only safe
|
|
101
|
+
error code, status, and request reference to the UI.
|
|
102
|
+
|
|
64
103
|
The package must only be imported from server modules. Never expose the token in
|
|
65
104
|
`NEXT_PUBLIC_*`, Client Components, browser storage, HTML, source maps, logs, or
|
|
66
105
|
asset requests. The `/next` entry point enforces Next's `server-only` boundary;
|
|
@@ -86,7 +125,6 @@ other runtimes must enforce their own server-module boundary.
|
|
|
86
125
|
|
|
87
126
|
```ts
|
|
88
127
|
const channel = createChannelClient({
|
|
89
|
-
baseUrl: process.env.C1M_API_URL!,
|
|
90
128
|
token: process.env.C1M_CHANNEL_TOKEN!,
|
|
91
129
|
observe(event) {
|
|
92
130
|
console.info("c1m.channel", event);
|
|
@@ -155,7 +193,6 @@ price and a stale one at checkout.
|
|
|
155
193
|
```ts
|
|
156
194
|
// A client whose reads are filed under the catalog tag the webhook route busts.
|
|
157
195
|
const catalog = createNextChannelClient({
|
|
158
|
-
baseUrl: process.env.C1M_API_URL!,
|
|
159
196
|
token: process.env.C1M_CHANNEL_TOKEN!,
|
|
160
197
|
cache: { revalidate: 3600, tags: [CHANNEL_CATALOG_CACHE_TAG] },
|
|
161
198
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export * from "./webhooks.js";
|
|
2
2
|
export type * from "./types.js";
|
|
3
|
-
import type { CatalogBrand, CatalogCategory, CatalogCollection, CatalogProductsResponse, BlogPostResponse, DiningMenu, GivingEntry, GivingIntentListResponse, AddCartItemInput, CartResponse, CheckoutAddressesInput, CheckoutCustomerInput, CheckoutFulfillmentInput, CheckoutOptions, CheckoutPayInput, CheckoutPayResponse, CheckoutStatusResponse, ChannelPing, CustomerResponse, CustomerSession, CustomerSignupResponse, LeadResponse, LightInitResponse, ListResponse, Order, OrderSummary, MergeCartInput, SendCodeResponse, Product, ProductAsset, PrintIntakeInput, PrintJob, PrintOptionsSelection, PrintQuoteResponse, PrintSettingsResponse, PublicPage, PublicPageSummary, PublicSubmitReviewInput, PublicWorkspaceInit, MenuResponse, Review, ReviewSummaryResponse, SavedAddress, SavedAddressDefaultKind, SavedAddressInput, SavedAddressResponse, SavedAddressUpdateInput, SavedPaymentMethod, SiteDocument, StartGivingInput, StartGivingResponse, PaymentMethodConfirmInput, PaymentMethodMutationResponse, PaymentMethodSetupInput, PaymentMethodSetupResult, SubscriptionAgreementResponse, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, SubscriptionListResponse, SubscriptionSourceResponse, ThemeResponse, UpdateCartItemInput } from "./types.js";
|
|
3
|
+
import type { CatalogBrand, CatalogCategory, CatalogCollection, CatalogProductsResponse, BlogPostResponse, DiningMenu, DashDirectoryEntry, DashDirectoryProfileResponse, DashDirectoryRegion, DashInitResponse, DashLead, DashPlansResponse, DashProfileResponse, GivingEntry, GivingIntentListResponse, AddCartItemInput, CartResponse, CheckoutAddressesInput, CheckoutCustomerInput, CheckoutFulfillmentInput, CheckoutOptions, CheckoutPayInput, CheckoutPayResponse, CheckoutStatusResponse, ChannelPing, CustomerResponse, CustomerSession, CustomerSignupResponse, LeadResponse, LightInitResponse, ListResponse, Order, OrderSummary, MergeCartInput, SendCodeResponse, Product, ProductAsset, PrintIntakeInput, PrintJob, PrintOptionsSelection, PrintQuoteResponse, PrintSettingsResponse, PublicPage, PublicPageSummary, PublicSubmitReviewInput, PublicWorkspaceInit, MenuResponse, Review, ReviewSummaryResponse, SavedAddress, SavedAddressDefaultKind, SavedAddressInput, SavedAddressResponse, SavedAddressUpdateInput, SavedPaymentMethod, SiteDocument, StartGivingInput, StartGivingResponse, PaymentMethodConfirmInput, PaymentMethodMutationResponse, PaymentMethodSetupInput, PaymentMethodSetupResult, SubscriptionAgreementResponse, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, SubscriptionListResponse, SubscriptionSourceResponse, ThemeResponse, UpdateCartItemInput } from "./types.js";
|
|
4
|
+
export declare const DEFAULT_CHANNEL_API_URL = "https://api.saasdash.app";
|
|
4
5
|
export interface ChannelRetryPolicy {
|
|
5
6
|
attempts?: number;
|
|
6
7
|
maxDelayMs?: number;
|
|
7
8
|
}
|
|
8
9
|
export interface CreateChannelClientOptions {
|
|
9
|
-
|
|
10
|
+
/** Override only for local development or private C1M infrastructure. */
|
|
11
|
+
baseUrl?: string;
|
|
10
12
|
token: string;
|
|
11
13
|
fetch?: typeof globalThis.fetch;
|
|
12
14
|
timeoutMs?: number;
|
|
@@ -16,7 +18,7 @@ export interface CreateChannelClientOptions {
|
|
|
16
18
|
signal?: AbortSignal;
|
|
17
19
|
}
|
|
18
20
|
export type ChannelRequestOutcome = "success" | "api_error" | "network_error" | "timeout" | "invalid_response" | "cancelled";
|
|
19
|
-
export type ChannelOperation = "channel.ping" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "dining.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "growth.public_workspace.leads.capture.channel";
|
|
21
|
+
export type ChannelOperation = "channel.ping" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "dining.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "channel.dash.profile" | "channel.dash.init" | "channel.dash.plans" | "channel.dash.directory.regions" | "channel.dash.directory.browse" | "channel.dash.directory.get" | "channel.dash.leads.capture" | "growth.public_workspace.leads.capture.channel";
|
|
20
22
|
export interface ChannelRequestObservation {
|
|
21
23
|
operation: ChannelOperation;
|
|
22
24
|
method: string;
|
|
@@ -53,6 +55,10 @@ export interface ChannelLeadInput {
|
|
|
53
55
|
source?: string;
|
|
54
56
|
meta?: Record<string, unknown>;
|
|
55
57
|
}
|
|
58
|
+
export interface DashDirectoryListParams extends ChannelListParams {
|
|
59
|
+
category?: string;
|
|
60
|
+
region?: string;
|
|
61
|
+
}
|
|
56
62
|
export interface ChannelMutationOptions {
|
|
57
63
|
idempotencyKey?: string;
|
|
58
64
|
}
|
|
@@ -83,11 +89,27 @@ export declare function createChannelClient(options: CreateChannelClientOptions)
|
|
|
83
89
|
*
|
|
84
90
|
* The cheapest call on the door — it does no database work server-side. Use
|
|
85
91
|
* it as a deployment health check: a 200 means C1M_CHANNEL_TOKEN is right and
|
|
86
|
-
* aimed at the
|
|
92
|
+
* aimed at the scope you expect. A ChannelAPIError with status 401 means
|
|
87
93
|
* the token is bad, revoked, or the channel is disabled (the door will not
|
|
88
94
|
* say which). A 503 means C1M is unavailable — NOT that your token is wrong.
|
|
89
95
|
*/
|
|
90
96
|
readonly ping: () => Promise<ChannelPing>;
|
|
97
|
+
/** Tenant-level data exposed only to a dash-scoped channel token. */
|
|
98
|
+
readonly dash: {
|
|
99
|
+
readonly profile: () => Promise<DashProfileResponse>;
|
|
100
|
+
readonly init: () => Promise<DashInitResponse>;
|
|
101
|
+
readonly plans: () => Promise<DashPlansResponse>;
|
|
102
|
+
readonly directory: {
|
|
103
|
+
readonly regions: () => Promise<ListResponse<DashDirectoryRegion>>;
|
|
104
|
+
readonly list: (params?: DashDirectoryListParams) => Promise<ListResponse<DashDirectoryEntry>>;
|
|
105
|
+
readonly get: (idOrSlug: string) => Promise<DashDirectoryProfileResponse>;
|
|
106
|
+
};
|
|
107
|
+
readonly leads: {
|
|
108
|
+
readonly create: (input: ChannelLeadInput, mutation?: ChannelMutationOptions) => Promise<{
|
|
109
|
+
lead: DashLead;
|
|
110
|
+
}>;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
91
113
|
readonly assetUrl: (pathOrUrl: string) => string;
|
|
92
114
|
readonly site: {
|
|
93
115
|
readonly resolve: (params?: ChannelSiteResolveParams) => Promise<SiteDocument>;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./webhooks.js";
|
|
2
2
|
const CHANNEL_TOKEN_PREFIX = "sk_chan_";
|
|
3
|
+
export const DEFAULT_CHANNEL_API_URL = "https://api.saasdash.app";
|
|
3
4
|
const RETRYABLE_STATUSES = new Set([429, 502, 503, 504]);
|
|
4
5
|
export class ChannelAPIError extends Error {
|
|
5
6
|
status;
|
|
@@ -70,7 +71,9 @@ function isFormDataBody(body) {
|
|
|
70
71
|
return typeof FormData !== "undefined" && body instanceof FormData;
|
|
71
72
|
}
|
|
72
73
|
export function createChannelClient(options) {
|
|
73
|
-
const baseUrl =
|
|
74
|
+
const baseUrl = (options.baseUrl === undefined
|
|
75
|
+
? DEFAULT_CHANNEL_API_URL
|
|
76
|
+
: required(options.baseUrl, "baseUrl")).replace(/\/+$/, "");
|
|
74
77
|
const token = required(options.token, "token");
|
|
75
78
|
if (!token.startsWith(CHANNEL_TOKEN_PREFIX))
|
|
76
79
|
throw new Error("token must start with sk_chan_");
|
|
@@ -188,11 +191,27 @@ export function createChannelClient(options) {
|
|
|
188
191
|
*
|
|
189
192
|
* The cheapest call on the door — it does no database work server-side. Use
|
|
190
193
|
* it as a deployment health check: a 200 means C1M_CHANNEL_TOKEN is right and
|
|
191
|
-
* aimed at the
|
|
194
|
+
* aimed at the scope you expect. A ChannelAPIError with status 401 means
|
|
192
195
|
* the token is bad, revoked, or the channel is disabled (the door will not
|
|
193
196
|
* say which). A 503 means C1M is unavailable — NOT that your token is wrong.
|
|
194
197
|
*/
|
|
195
198
|
ping: () => request("channel.ping", "/ping"),
|
|
199
|
+
/** Tenant-level data exposed only to a dash-scoped channel token. */
|
|
200
|
+
dash: {
|
|
201
|
+
profile: () => request("channel.dash.profile", "/dash/profile"),
|
|
202
|
+
init: () => request("channel.dash.init", "/dash/init"),
|
|
203
|
+
plans: () => request("channel.dash.plans", "/dash/plans"),
|
|
204
|
+
directory: {
|
|
205
|
+
regions: () => request("channel.dash.directory.regions", "/dash/directory/regions"),
|
|
206
|
+
list: (params = {}) => request("channel.dash.directory.browse", appendQuery("/dash/directory", params)),
|
|
207
|
+
get: (idOrSlug) => request("channel.dash.directory.get", `/dash/directory/${encodePath(idOrSlug)}`),
|
|
208
|
+
},
|
|
209
|
+
leads: {
|
|
210
|
+
create: (input, mutation) => request("channel.dash.leads.capture", "/dash/leads", {
|
|
211
|
+
method: "POST", headers: mutationHeaders(mutation), body: JSON.stringify(input),
|
|
212
|
+
}),
|
|
213
|
+
},
|
|
214
|
+
},
|
|
196
215
|
assetUrl: (pathOrUrl) => new URL(required(pathOrUrl, "asset URL"), `${baseUrl}/`).toString(),
|
|
197
216
|
site: {
|
|
198
217
|
resolve: (params = {}) => request("channel.site.resolve", appendQuery("/site/resolve", params)),
|
package/dist/next.d.ts
CHANGED
|
@@ -16,6 +16,21 @@ export interface CreateNextChannelClientOptions extends Omit<CreateChannelClient
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function createNextChannelClient(options: CreateNextChannelClientOptions): {
|
|
18
18
|
readonly ping: () => Promise<import("./types.js").ChannelPing>;
|
|
19
|
+
readonly dash: {
|
|
20
|
+
readonly profile: () => Promise<import("./types.js").DashProfileResponse>;
|
|
21
|
+
readonly init: () => Promise<import("./types.js").DashInitResponse>;
|
|
22
|
+
readonly plans: () => Promise<import("./types.js").DashPlansResponse>;
|
|
23
|
+
readonly directory: {
|
|
24
|
+
readonly regions: () => Promise<import("./types.js").ListResponse<import("./types.js").DashDirectoryRegion>>;
|
|
25
|
+
readonly list: (params?: import("./index.js").DashDirectoryListParams) => Promise<import("./types.js").ListResponse<import("./types.js").DashDirectoryEntry>>;
|
|
26
|
+
readonly get: (idOrSlug: string) => Promise<import("./types.js").DashDirectoryProfileResponse>;
|
|
27
|
+
};
|
|
28
|
+
readonly leads: {
|
|
29
|
+
readonly create: (input: import("./index.js").ChannelLeadInput, mutation?: import("./index.js").ChannelMutationOptions) => Promise<{
|
|
30
|
+
lead: import("./types.js").DashLead;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
19
34
|
readonly assetUrl: (pathOrUrl: string) => string;
|
|
20
35
|
readonly site: {
|
|
21
36
|
readonly resolve: (params?: import("./index.js").ChannelSiteResolveParams) => Promise<import("./types.js").SiteDocument>;
|
package/dist/types.d.ts
CHANGED
|
@@ -40,6 +40,139 @@ export interface LightInitResponse {
|
|
|
40
40
|
enabled_features: string[];
|
|
41
41
|
etag?: string;
|
|
42
42
|
}
|
|
43
|
+
export interface DashTenantInfo {
|
|
44
|
+
id: string;
|
|
45
|
+
display_name: string;
|
|
46
|
+
managed_domain?: string;
|
|
47
|
+
status: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DashPublicProfileInfo {
|
|
50
|
+
discoverable: boolean;
|
|
51
|
+
category?: string;
|
|
52
|
+
headline?: string;
|
|
53
|
+
short_description?: string;
|
|
54
|
+
about?: string;
|
|
55
|
+
logo_url?: string;
|
|
56
|
+
header_media_url?: string;
|
|
57
|
+
pricing_summary?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface DashInitResponse {
|
|
60
|
+
tenant: DashTenantInfo;
|
|
61
|
+
public_profile: DashPublicProfileInfo;
|
|
62
|
+
}
|
|
63
|
+
export interface DashPublicPage {
|
|
64
|
+
profile: DashPublicProfileInfo & {
|
|
65
|
+
tenant_id: string;
|
|
66
|
+
status: string;
|
|
67
|
+
display_name?: string;
|
|
68
|
+
is_private: boolean;
|
|
69
|
+
allow_free_memberships: boolean;
|
|
70
|
+
primary_color?: string;
|
|
71
|
+
logo_square_url?: string;
|
|
72
|
+
favicon_url?: string;
|
|
73
|
+
cover_url?: string;
|
|
74
|
+
gallery_items?: Array<{
|
|
75
|
+
url: string;
|
|
76
|
+
kind: string;
|
|
77
|
+
alt_text?: string;
|
|
78
|
+
caption?: string;
|
|
79
|
+
}>;
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
owner_name?: string;
|
|
83
|
+
user_count: number;
|
|
84
|
+
workspace_counts: Record<string, number>;
|
|
85
|
+
media: Array<{
|
|
86
|
+
kind: string;
|
|
87
|
+
url: string;
|
|
88
|
+
alt_text?: string;
|
|
89
|
+
caption?: string;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface DashProfileResponse {
|
|
93
|
+
page: DashPublicPage;
|
|
94
|
+
}
|
|
95
|
+
export interface DashPlanPricing {
|
|
96
|
+
currency: string;
|
|
97
|
+
currency_symbol?: string;
|
|
98
|
+
monthly_price: number;
|
|
99
|
+
yearly_price: number;
|
|
100
|
+
}
|
|
101
|
+
export interface DashPlan {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
description: string;
|
|
105
|
+
level: number;
|
|
106
|
+
is_public: boolean;
|
|
107
|
+
is_free: boolean;
|
|
108
|
+
trial_days?: number;
|
|
109
|
+
highlights: string[];
|
|
110
|
+
limits: Record<string, number>;
|
|
111
|
+
pricing: Record<string, DashPlanPricing>;
|
|
112
|
+
}
|
|
113
|
+
export interface DashPlanRegion {
|
|
114
|
+
code: string;
|
|
115
|
+
name: string;
|
|
116
|
+
currency: string;
|
|
117
|
+
locale: string;
|
|
118
|
+
timezone: string;
|
|
119
|
+
market_code?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface DashPlansResponse {
|
|
122
|
+
plans: DashPlan[];
|
|
123
|
+
regions: DashPlanRegion[];
|
|
124
|
+
default_region: string;
|
|
125
|
+
}
|
|
126
|
+
export interface DashDirectoryRegion {
|
|
127
|
+
code: string;
|
|
128
|
+
label: string;
|
|
129
|
+
country_code?: string;
|
|
130
|
+
sort_order: number;
|
|
131
|
+
count: number;
|
|
132
|
+
}
|
|
133
|
+
export interface DashDirectoryEntry {
|
|
134
|
+
workspace_id: string;
|
|
135
|
+
slug: string;
|
|
136
|
+
name: string;
|
|
137
|
+
tagline?: string;
|
|
138
|
+
category?: string;
|
|
139
|
+
logo_url?: string;
|
|
140
|
+
logo_square_url?: string;
|
|
141
|
+
primary_color?: string;
|
|
142
|
+
review_count: number;
|
|
143
|
+
average_rating: number;
|
|
144
|
+
verified: boolean;
|
|
145
|
+
service_tags: unknown;
|
|
146
|
+
major_region_code?: string;
|
|
147
|
+
major_region_label?: string;
|
|
148
|
+
upcoming_events?: unknown[];
|
|
149
|
+
}
|
|
150
|
+
export interface DashDirectoryProfile extends DashDirectoryEntry {
|
|
151
|
+
display_name?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
logo_light_url?: string;
|
|
154
|
+
logo_dark_url?: string;
|
|
155
|
+
verified_at?: string;
|
|
156
|
+
created_at: string;
|
|
157
|
+
}
|
|
158
|
+
export interface DashDirectoryProfileResponse {
|
|
159
|
+
profile: DashDirectoryProfile;
|
|
160
|
+
}
|
|
161
|
+
export interface DashLead {
|
|
162
|
+
id: string;
|
|
163
|
+
owner_scope?: string;
|
|
164
|
+
owner_id?: string;
|
|
165
|
+
name?: string;
|
|
166
|
+
email?: string;
|
|
167
|
+
phone?: string;
|
|
168
|
+
message?: string;
|
|
169
|
+
source: string;
|
|
170
|
+
channel_id?: string;
|
|
171
|
+
status: string;
|
|
172
|
+
meta?: Record<string, unknown>;
|
|
173
|
+
created_at: string;
|
|
174
|
+
updated_at: string;
|
|
175
|
+
}
|
|
43
176
|
export interface PublicPageSummary {
|
|
44
177
|
id: string;
|
|
45
178
|
saas_app: string;
|
|
@@ -937,5 +1070,6 @@ export interface ChannelPing {
|
|
|
937
1070
|
channel_id: string;
|
|
938
1071
|
workspace_id: string;
|
|
939
1072
|
saas_app: string;
|
|
1073
|
+
scope: "workspace" | "dash";
|
|
940
1074
|
api_version: string;
|
|
941
1075
|
}
|