@line-harness/sdk 0.2.1 → 0.2.3

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.cjs CHANGED
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  BroadcastsResource: () => BroadcastsResource,
25
25
  FormsResource: () => FormsResource,
26
26
  FriendsResource: () => FriendsResource,
27
+ ImagesResource: () => ImagesResource,
27
28
  LineHarness: () => LineHarness,
28
29
  LineHarnessError: () => LineHarnessError,
29
30
  RichMenusResource: () => RichMenusResource,
@@ -130,10 +131,11 @@ var FriendsResource = class {
130
131
  async removeTag(friendId, tagId) {
131
132
  await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`);
132
133
  }
133
- async sendMessage(friendId, content, messageType = "text") {
134
+ async sendMessage(friendId, content, messageType = "text", altText) {
134
135
  const res = await this.http.post(`/api/friends/${friendId}/messages`, {
135
136
  messageType,
136
- content
137
+ content,
138
+ ...altText ? { altText } : {}
137
139
  });
138
140
  return res.data;
139
141
  }
@@ -405,6 +407,20 @@ var StaffResource = class {
405
407
  }
406
408
  };
407
409
 
410
+ // src/resources/images.ts
411
+ var ImagesResource = class {
412
+ constructor(http) {
413
+ this.http = http;
414
+ }
415
+ async upload(input) {
416
+ const res = await this.http.post("/api/images", input);
417
+ return res.data;
418
+ }
419
+ async delete(key) {
420
+ await this.http.delete(`/api/images/${key}`);
421
+ }
422
+ };
423
+
408
424
  // src/delay.ts
409
425
  var MULTIPLIERS = {
410
426
  m: 1,
@@ -487,6 +503,7 @@ var LineHarness = class {
487
503
  forms;
488
504
  adPlatforms;
489
505
  staff;
506
+ images;
490
507
  apiUrl;
491
508
  defaultAccountId;
492
509
  workflows;
@@ -513,6 +530,7 @@ var LineHarness = class {
513
530
  this.forms = new FormsResource(http);
514
531
  this.adPlatforms = new AdPlatformsResource(http);
515
532
  this.staff = new StaffResource(http);
533
+ this.images = new ImagesResource(http);
516
534
  this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts);
517
535
  this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows);
518
536
  this.broadcastText = this.workflows.broadcastText.bind(this.workflows);
@@ -541,6 +559,7 @@ var LineHarness = class {
541
559
  BroadcastsResource,
542
560
  FormsResource,
543
561
  FriendsResource,
562
+ ImagesResource,
544
563
  LineHarness,
545
564
  LineHarnessError,
546
565
  RichMenusResource,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/http.ts","../src/resources/friends.ts","../src/resources/tags.ts","../src/resources/scenarios.ts","../src/resources/broadcasts.ts","../src/resources/rich-menus.ts","../src/resources/tracked-links.ts","../src/resources/forms.ts","../src/resources/ad-platforms.ts","../src/resources/staff.ts","../src/delay.ts","../src/workflows.ts","../src/client.ts"],"sourcesContent":["export { LineHarness } from './client.js'\nexport { LineHarnessError } from './errors.js'\nexport { parseDelay } from './delay.js'\n\n// Resource classes (for advanced usage / type narrowing)\nexport { FriendsResource } from './resources/friends.js'\nexport { TagsResource } from './resources/tags.js'\nexport { ScenariosResource } from './resources/scenarios.js'\nexport { BroadcastsResource } from './resources/broadcasts.js'\nexport { RichMenusResource } from './resources/rich-menus.js'\nexport { TrackedLinksResource } from './resources/tracked-links.js'\nexport { FormsResource } from './resources/forms.js'\nexport { AdPlatformsResource } from './resources/ad-platforms.js'\nexport { StaffResource } from './resources/staff.js'\n\n// All types\nexport type {\n LineHarnessConfig,\n ApiResponse,\n PaginatedData,\n ScenarioTriggerType,\n MessageType,\n BroadcastStatus,\n Friend,\n FriendListParams,\n Tag,\n CreateTagInput,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n Broadcast,\n CreateBroadcastInput,\n UpdateBroadcastInput,\n SegmentRule,\n SegmentCondition,\n StepDefinition,\n RichMenu,\n RichMenuBounds,\n RichMenuAction,\n RichMenuArea,\n CreateRichMenuInput,\n TrackedLink,\n LinkClick,\n TrackedLinkWithClicks,\n CreateTrackedLinkInput,\n FormField,\n Form,\n CreateFormInput,\n UpdateFormInput,\n FormSubmission,\n StaffRole,\n StaffMember,\n StaffProfile,\n CreateStaffInput,\n UpdateStaffInput,\n} from './types.js'\n\nexport type {\n AdPlatform,\n AdConversionLog,\n CreateAdPlatformInput,\n UpdateAdPlatformInput,\n} from './resources/ad-platforms.js'\n","export class LineHarnessError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly endpoint: string,\n ) {\n super(message)\n this.name = 'LineHarnessError'\n }\n}\n","import { LineHarnessError } from './errors.js'\n\ninterface HttpClientConfig {\n baseUrl: string\n apiKey: string\n timeout: number\n}\n\nexport class HttpClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n private readonly timeout: number\n\n constructor(config: HttpClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, '')\n this.apiKey = config.apiKey\n this.timeout = config.timeout\n }\n\n async get<T = unknown>(path: string): Promise<T> {\n return this.request<T>('GET', path)\n }\n\n async post<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('POST', path, body)\n }\n\n async put<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PUT', path, body)\n }\n\n async patch<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PATCH', path, body)\n }\n\n async delete<T = unknown>(path: string): Promise<T> {\n return this.request<T>('DELETE', path)\n }\n\n private async request<T>(method: string, path: string, body?: unknown): Promise<T> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n }\n\n const options: RequestInit = {\n method,\n headers,\n signal: AbortSignal.timeout(this.timeout),\n }\n\n if (body !== undefined) {\n options.body = JSON.stringify(body)\n }\n\n const res = await fetch(url, options)\n\n if (!res.ok) {\n let errorMessage = `HTTP ${res.status}`\n try {\n const errorBody = (await res.json()) as { error?: string }\n if (errorBody.error) errorMessage = errorBody.error\n } catch {\n // ignore parse errors\n }\n throw new LineHarnessError(errorMessage, res.status, `${method} ${path}`)\n }\n\n return res.json() as Promise<T>\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, PaginatedData, Friend, FriendListParams, MessageType } from '../types.js'\n\nexport class FriendsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: FriendListParams): Promise<PaginatedData<Friend>> {\n const query = new URLSearchParams()\n if (params?.limit !== undefined) query.set('limit', String(params.limit))\n if (params?.offset !== undefined) query.set('offset', String(params.offset))\n if (params?.tagId) query.set('tagId', params.tagId)\n const accountId = params?.accountId ?? this.defaultAccountId\n if (accountId) query.set('lineAccountId', accountId)\n const qs = query.toString()\n const path = qs ? `/api/friends?${qs}` : '/api/friends'\n const res = await this.http.get<ApiResponse<PaginatedData<Friend>>>(path)\n return res.data\n }\n\n async get(id: string): Promise<Friend> {\n const res = await this.http.get<ApiResponse<Friend>>(`/api/friends/${id}`)\n return res.data\n }\n\n async count(): Promise<number> {\n const res = await this.http.get<ApiResponse<{ count: number }>>('/api/friends/count')\n return res.data.count\n }\n\n async addTag(friendId: string, tagId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/tags`, { tagId })\n }\n\n async removeTag(friendId: string, tagId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`)\n }\n\n async sendMessage(friendId: string, content: string, messageType: MessageType = 'text'): Promise<{ messageId: string }> {\n const res = await this.http.post<ApiResponse<{ messageId: string }>>(`/api/friends/${friendId}/messages`, {\n messageType,\n content,\n })\n return res.data\n }\n\n async setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend> {\n const res = await this.http.put<ApiResponse<Friend>>(`/api/friends/${friendId}/metadata`, fields)\n return res.data\n }\n\n async setRichMenu(friendId: string, richMenuId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/rich-menu`, { richMenuId })\n }\n\n async removeRichMenu(friendId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/rich-menu`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Tag, CreateTagInput } from '../types.js'\n\nexport class TagsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Tag[]> {\n const res = await this.http.get<ApiResponse<Tag[]>>('/api/tags')\n return res.data\n }\n\n async create(input: CreateTagInput): Promise<Tag> {\n const res = await this.http.post<ApiResponse<Tag>>('/api/tags', input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tags/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n} from '../types.js'\n\nexport class ScenariosResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<ScenarioListItem[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<ScenarioListItem[]>>(`/api/scenarios${query}`)\n return res.data\n }\n\n async get(id: string): Promise<ScenarioWithSteps> {\n const res = await this.http.get<ApiResponse<ScenarioWithSteps>>(`/api/scenarios/${id}`)\n return res.data\n }\n\n async create(input: CreateScenarioInput & { lineAccountId?: string }): Promise<Scenario> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Scenario>>('/api/scenarios', body)\n return res.data\n }\n\n async update(id: string, input: UpdateScenarioInput): Promise<Scenario> {\n const res = await this.http.put<ApiResponse<Scenario>>(`/api/scenarios/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${id}`)\n }\n\n async addStep(scenarioId: string, input: CreateStepInput): Promise<ScenarioStep> {\n const res = await this.http.post<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps`, input)\n return res.data\n }\n\n async updateStep(scenarioId: string, stepId: string, input: UpdateStepInput): Promise<ScenarioStep> {\n const res = await this.http.put<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps/${stepId}`, input)\n return res.data\n }\n\n async deleteStep(scenarioId: string, stepId: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${scenarioId}/steps/${stepId}`)\n }\n\n async enroll(scenarioId: string, friendId: string): Promise<FriendScenarioEnrollment> {\n const res = await this.http.post<ApiResponse<FriendScenarioEnrollment>>(\n `/api/scenarios/${scenarioId}/enroll/${friendId}`\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Broadcast, CreateBroadcastInput, UpdateBroadcastInput, SegmentCondition } from '../types.js'\n\nexport class BroadcastsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<Broadcast[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<Broadcast[]>>(`/api/broadcasts${query}`)\n return res.data\n }\n\n async get(id: string): Promise<Broadcast> {\n const res = await this.http.get<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`)\n return res.data\n }\n\n async create(input: CreateBroadcastInput & { lineAccountId?: string }): Promise<Broadcast> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Broadcast>>('/api/broadcasts', body)\n return res.data\n }\n\n async update(id: string, input: UpdateBroadcastInput): Promise<Broadcast> {\n const res = await this.http.put<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/broadcasts/${id}`)\n }\n\n async send(id: string): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(`/api/broadcasts/${id}/send`)\n return res.data\n }\n\n async sendToSegment(id: string, conditions: SegmentCondition): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(\n `/api/broadcasts/${id}/send-segment`,\n { conditions },\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, RichMenu, CreateRichMenuInput } from '../types.js'\n\nexport class RichMenusResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<RichMenu[]> {\n const res = await this.http.get<ApiResponse<RichMenu[]>>('/api/rich-menus')\n return res.data\n }\n\n async create(menu: CreateRichMenuInput): Promise<{ richMenuId: string }> {\n const res = await this.http.post<ApiResponse<{ richMenuId: string }>>('/api/rich-menus', menu)\n return res.data\n }\n\n async delete(richMenuId: string): Promise<void> {\n await this.http.delete(`/api/rich-menus/${encodeURIComponent(richMenuId)}`)\n }\n\n async setDefault(richMenuId: string): Promise<void> {\n await this.http.post(`/api/rich-menus/${encodeURIComponent(richMenuId)}/default`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, TrackedLink, TrackedLinkWithClicks, CreateTrackedLinkInput } from '../types.js'\n\nexport class TrackedLinksResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<TrackedLink[]> {\n const res = await this.http.get<ApiResponse<TrackedLink[]>>('/api/tracked-links')\n return res.data\n }\n\n async create(input: CreateTrackedLinkInput): Promise<TrackedLink> {\n const res = await this.http.post<ApiResponse<TrackedLink>>('/api/tracked-links', input)\n return res.data\n }\n\n async get(id: string): Promise<TrackedLinkWithClicks> {\n const res = await this.http.get<ApiResponse<TrackedLinkWithClicks>>(`/api/tracked-links/${id}`)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tracked-links/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Form,\n FormSubmission,\n CreateFormInput,\n UpdateFormInput,\n} from '../types.js'\n\nexport class FormsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Form[]> {\n const res = await this.http.get<ApiResponse<Form[]>>('/api/forms')\n return res.data\n }\n\n async get(id: string): Promise<Form> {\n const res = await this.http.get<ApiResponse<Form>>(`/api/forms/${id}`)\n return res.data\n }\n\n async create(input: CreateFormInput): Promise<Form> {\n const res = await this.http.post<ApiResponse<Form>>('/api/forms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateFormInput): Promise<Form> {\n const res = await this.http.put<ApiResponse<Form>>(`/api/forms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/forms/${id}`)\n }\n\n async getSubmissions(formId: string): Promise<FormSubmission[]> {\n const res = await this.http.get<ApiResponse<FormSubmission[]>>(\n `/api/forms/${formId}/submissions`,\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse } from '../types.js'\n\nexport interface AdPlatform {\n id: string\n name: string\n displayName: string | null\n config: Record<string, unknown>\n isActive: boolean\n createdAt: string\n updatedAt: string\n}\n\nexport interface AdConversionLog {\n id: string\n adPlatformId: string\n friendId: string\n eventName: string\n clickId: string | null\n clickIdType: string | null\n status: string\n errorMessage: string | null\n createdAt: string\n}\n\nexport interface CreateAdPlatformInput {\n name: 'meta' | 'x' | 'google' | 'tiktok'\n displayName?: string\n config: Record<string, unknown>\n}\n\nexport interface UpdateAdPlatformInput {\n name?: string\n displayName?: string | null\n config?: Record<string, unknown>\n isActive?: boolean\n}\n\nexport class AdPlatformsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<AdPlatform[]> {\n const res = await this.http.get<ApiResponse<AdPlatform[]>>('/api/ad-platforms')\n return res.data\n }\n\n async create(input: CreateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.post<ApiResponse<AdPlatform>>('/api/ad-platforms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.put<ApiResponse<AdPlatform>>(`/api/ad-platforms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/ad-platforms/${id}`)\n }\n\n async getLogs(id: string, limit?: number): Promise<AdConversionLog[]> {\n const path = limit\n ? `/api/ad-platforms/${id}/logs?limit=${limit}`\n : `/api/ad-platforms/${id}/logs`\n const res = await this.http.get<ApiResponse<AdConversionLog[]>>(path)\n return res.data\n }\n\n async test(platform: string, eventName: string, friendId?: string): Promise<{ message: string }> {\n const res = await this.http.post<ApiResponse<{ message: string }>>('/api/ad-platforms/test', {\n platform,\n eventName,\n friendId,\n })\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, StaffMember, StaffProfile, CreateStaffInput, UpdateStaffInput } from '../types.js'\n\nexport class StaffResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<StaffMember[]> {\n const res = await this.http.get<ApiResponse<StaffMember[]>>('/api/staff')\n return res.data\n }\n\n async get(id: string): Promise<StaffMember> {\n const res = await this.http.get<ApiResponse<StaffMember>>(`/api/staff/${id}`)\n return res.data\n }\n\n async me(): Promise<StaffProfile> {\n const res = await this.http.get<ApiResponse<StaffProfile>>('/api/staff/me')\n return res.data\n }\n\n async create(input: CreateStaffInput): Promise<StaffMember> {\n const res = await this.http.post<ApiResponse<StaffMember>>('/api/staff', input)\n return res.data\n }\n\n async update(id: string, input: UpdateStaffInput): Promise<StaffMember> {\n const res = await this.http.patch<ApiResponse<StaffMember>>(`/api/staff/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/staff/${id}`)\n }\n\n async regenerateKey(id: string): Promise<{ apiKey: string }> {\n const res = await this.http.post<ApiResponse<{ apiKey: string }>>(`/api/staff/${id}/regenerate-key`)\n return res.data\n }\n}\n","const MULTIPLIERS: Record<string, number> = {\n m: 1,\n h: 60,\n d: 1440,\n w: 10080,\n}\n\nexport function parseDelay(input: string): number {\n const match = input.match(/^(\\d+)([mhdw])$/)\n if (!match) {\n throw new Error(`Invalid delay format: \"${input}\". Use format like \"30m\", \"1h\", \"1d\", \"1w\".`)\n }\n return Number(match[1]) * MULTIPLIERS[match[2]]\n}\n","import type { FriendsResource } from './resources/friends.js'\nimport type { ScenariosResource } from './resources/scenarios.js'\nimport type { BroadcastsResource } from './resources/broadcasts.js'\nimport type { StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\nimport { parseDelay } from './delay.js'\n\nexport class Workflows {\n constructor(\n private readonly friends: FriendsResource,\n private readonly scenarios: ScenariosResource,\n private readonly broadcasts: BroadcastsResource,\n ) {}\n\n async createStepScenario(\n name: string,\n triggerType: ScenarioTriggerType,\n steps: StepDefinition[],\n ): Promise<ScenarioWithSteps> {\n const scenario = await this.scenarios.create({ name, triggerType })\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i]\n await this.scenarios.addStep(scenario.id, {\n stepOrder: i + 1,\n delayMinutes: parseDelay(step.delay),\n messageType: step.type,\n messageContent: step.content,\n })\n }\n\n return this.scenarios.get(scenario.id)\n }\n\n async broadcastText(text: string): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: text.slice(0, 50),\n messageType: 'text',\n messageContent: text,\n targetType: 'all',\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToTag(\n tagId: string,\n messageType: MessageType,\n content: string,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'tag',\n targetTagId: tagId,\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToSegment(\n messageType: MessageType,\n content: string,\n conditions: SegmentCondition,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'all',\n })\n return this.broadcasts.sendToSegment(broadcast.id, conditions)\n }\n\n async sendTextToFriend(friendId: string, text: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, text, 'text')\n }\n\n async sendFlexToFriend(friendId: string, flexJson: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, flexJson, 'flex')\n }\n}\n","import { HttpClient } from './http.js'\nimport { FriendsResource } from './resources/friends.js'\nimport { TagsResource } from './resources/tags.js'\nimport { ScenariosResource } from './resources/scenarios.js'\nimport { BroadcastsResource } from './resources/broadcasts.js'\nimport { RichMenusResource } from './resources/rich-menus.js'\nimport { TrackedLinksResource } from './resources/tracked-links.js'\nimport { FormsResource } from './resources/forms.js'\nimport { AdPlatformsResource } from './resources/ad-platforms.js'\nimport { StaffResource } from './resources/staff.js'\nimport { Workflows } from './workflows.js'\nimport type { LineHarnessConfig, StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\n\nexport class LineHarness {\n readonly friends: FriendsResource\n readonly tags: TagsResource\n readonly scenarios: ScenariosResource\n readonly broadcasts: BroadcastsResource\n readonly richMenus: RichMenusResource\n readonly trackedLinks: TrackedLinksResource\n readonly forms: FormsResource\n readonly adPlatforms: AdPlatformsResource\n readonly staff: StaffResource\n\n private readonly apiUrl: string\n private readonly defaultAccountId: string | undefined\n private readonly workflows: Workflows\n\n readonly createStepScenario: (name: string, triggerType: ScenarioTriggerType, steps: StepDefinition[]) => Promise<ScenarioWithSteps>\n readonly broadcastText: (text: string) => Promise<Broadcast>\n readonly broadcastToTag: (tagId: string, messageType: MessageType, content: string) => Promise<Broadcast>\n readonly broadcastToSegment: (messageType: MessageType, content: string, conditions: SegmentCondition) => Promise<Broadcast>\n readonly sendTextToFriend: (friendId: string, text: string) => Promise<{ messageId: string }>\n readonly sendFlexToFriend: (friendId: string, flexJson: string) => Promise<{ messageId: string }>\n\n constructor(config: LineHarnessConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/$/, '')\n this.defaultAccountId = config.lineAccountId\n\n const http = new HttpClient({\n baseUrl: this.apiUrl,\n apiKey: config.apiKey,\n timeout: config.timeout ?? 30_000,\n })\n\n this.friends = new FriendsResource(http, this.defaultAccountId)\n this.tags = new TagsResource(http)\n this.scenarios = new ScenariosResource(http, this.defaultAccountId)\n this.broadcasts = new BroadcastsResource(http, this.defaultAccountId)\n this.richMenus = new RichMenusResource(http)\n this.trackedLinks = new TrackedLinksResource(http)\n this.forms = new FormsResource(http)\n this.adPlatforms = new AdPlatformsResource(http)\n this.staff = new StaffResource(http)\n this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts)\n\n this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows)\n this.broadcastText = this.workflows.broadcastText.bind(this.workflows)\n this.broadcastToTag = this.workflows.broadcastToTag.bind(this.workflows)\n this.broadcastToSegment = this.workflows.broadcastToSegment.bind(this.workflows)\n this.sendTextToFriend = this.workflows.sendTextToFriend.bind(this.workflows)\n this.sendFlexToFriend = this.workflows.sendFlexToFriend.bind(this.workflows)\n }\n\n /**\n * Generate friend-add URL with OAuth (bot_prompt=aggressive)\n * This URL does friend-add + UUID in one step.\n *\n * @param ref - Attribution code (e.g., 'lp-a', 'instagram', 'seminar-0322')\n * @param redirect - URL to redirect after completion\n */\n getAuthUrl(options?: { ref?: string; redirect?: string }): string {\n const url = new URL(`${this.apiUrl}/auth/line`)\n if (options?.ref) url.searchParams.set('ref', options.ref)\n if (options?.redirect) url.searchParams.set('redirect', options.redirect)\n return url.toString()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YACE,SACgB,QACA,UAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;;;ACDO,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA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B,KAAK,KAAK,SAAS;AAC/E,SAAK,gBAAgB,KAAK,UAAU,cAAc,KAAK,KAAK,SAAS;AACrE,SAAK,iBAAiB,KAAK,UAAU,eAAe,KAAK,KAAK,SAAS;AACvE,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAC3E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,SAAuD;AAChE,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,MAAM,YAAY;AAC9C,QAAI,SAAS,IAAK,KAAI,aAAa,IAAI,OAAO,QAAQ,GAAG;AACzD,QAAI,SAAS,SAAU,KAAI,aAAa,IAAI,YAAY,QAAQ,QAAQ;AACxE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/http.ts","../src/resources/friends.ts","../src/resources/tags.ts","../src/resources/scenarios.ts","../src/resources/broadcasts.ts","../src/resources/rich-menus.ts","../src/resources/tracked-links.ts","../src/resources/forms.ts","../src/resources/ad-platforms.ts","../src/resources/staff.ts","../src/resources/images.ts","../src/delay.ts","../src/workflows.ts","../src/client.ts"],"sourcesContent":["export { LineHarness } from './client.js'\nexport { LineHarnessError } from './errors.js'\nexport { parseDelay } from './delay.js'\n\n// Resource classes (for advanced usage / type narrowing)\nexport { FriendsResource } from './resources/friends.js'\nexport { TagsResource } from './resources/tags.js'\nexport { ScenariosResource } from './resources/scenarios.js'\nexport { BroadcastsResource } from './resources/broadcasts.js'\nexport { RichMenusResource } from './resources/rich-menus.js'\nexport { TrackedLinksResource } from './resources/tracked-links.js'\nexport { FormsResource } from './resources/forms.js'\nexport { AdPlatformsResource } from './resources/ad-platforms.js'\nexport { StaffResource } from './resources/staff.js'\nexport { ImagesResource } from './resources/images.js'\n\n// All types\nexport type {\n LineHarnessConfig,\n ApiResponse,\n PaginatedData,\n ScenarioTriggerType,\n MessageType,\n BroadcastStatus,\n Friend,\n FriendListParams,\n Tag,\n CreateTagInput,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n Broadcast,\n CreateBroadcastInput,\n UpdateBroadcastInput,\n SegmentRule,\n SegmentCondition,\n StepDefinition,\n RichMenu,\n RichMenuBounds,\n RichMenuAction,\n RichMenuArea,\n CreateRichMenuInput,\n TrackedLink,\n LinkClick,\n TrackedLinkWithClicks,\n CreateTrackedLinkInput,\n FormField,\n Form,\n CreateFormInput,\n UpdateFormInput,\n FormSubmission,\n StaffRole,\n StaffMember,\n StaffProfile,\n CreateStaffInput,\n UpdateStaffInput,\n UploadedImage,\n UploadImageInput,\n} from './types.js'\n\nexport type {\n AdPlatform,\n AdConversionLog,\n CreateAdPlatformInput,\n UpdateAdPlatformInput,\n} from './resources/ad-platforms.js'\n","export class LineHarnessError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly endpoint: string,\n ) {\n super(message)\n this.name = 'LineHarnessError'\n }\n}\n","import { LineHarnessError } from './errors.js'\n\ninterface HttpClientConfig {\n baseUrl: string\n apiKey: string\n timeout: number\n}\n\nexport class HttpClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n private readonly timeout: number\n\n constructor(config: HttpClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, '')\n this.apiKey = config.apiKey\n this.timeout = config.timeout\n }\n\n async get<T = unknown>(path: string): Promise<T> {\n return this.request<T>('GET', path)\n }\n\n async post<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('POST', path, body)\n }\n\n async put<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PUT', path, body)\n }\n\n async patch<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PATCH', path, body)\n }\n\n async delete<T = unknown>(path: string): Promise<T> {\n return this.request<T>('DELETE', path)\n }\n\n private async request<T>(method: string, path: string, body?: unknown): Promise<T> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n }\n\n const options: RequestInit = {\n method,\n headers,\n signal: AbortSignal.timeout(this.timeout),\n }\n\n if (body !== undefined) {\n options.body = JSON.stringify(body)\n }\n\n const res = await fetch(url, options)\n\n if (!res.ok) {\n let errorMessage = `HTTP ${res.status}`\n try {\n const errorBody = (await res.json()) as { error?: string }\n if (errorBody.error) errorMessage = errorBody.error\n } catch {\n // ignore parse errors\n }\n throw new LineHarnessError(errorMessage, res.status, `${method} ${path}`)\n }\n\n return res.json() as Promise<T>\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, PaginatedData, Friend, FriendListParams, MessageType } from '../types.js'\n\nexport class FriendsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: FriendListParams): Promise<PaginatedData<Friend>> {\n const query = new URLSearchParams()\n if (params?.limit !== undefined) query.set('limit', String(params.limit))\n if (params?.offset !== undefined) query.set('offset', String(params.offset))\n if (params?.tagId) query.set('tagId', params.tagId)\n const accountId = params?.accountId ?? this.defaultAccountId\n if (accountId) query.set('lineAccountId', accountId)\n const qs = query.toString()\n const path = qs ? `/api/friends?${qs}` : '/api/friends'\n const res = await this.http.get<ApiResponse<PaginatedData<Friend>>>(path)\n return res.data\n }\n\n async get(id: string): Promise<Friend> {\n const res = await this.http.get<ApiResponse<Friend>>(`/api/friends/${id}`)\n return res.data\n }\n\n async count(): Promise<number> {\n const res = await this.http.get<ApiResponse<{ count: number }>>('/api/friends/count')\n return res.data.count\n }\n\n async addTag(friendId: string, tagId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/tags`, { tagId })\n }\n\n async removeTag(friendId: string, tagId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`)\n }\n\n async sendMessage(friendId: string, content: string, messageType: MessageType = 'text', altText?: string): Promise<{ messageId: string }> {\n const res = await this.http.post<ApiResponse<{ messageId: string }>>(`/api/friends/${friendId}/messages`, {\n messageType,\n content,\n ...(altText ? { altText } : {}),\n })\n return res.data\n }\n\n async setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend> {\n const res = await this.http.put<ApiResponse<Friend>>(`/api/friends/${friendId}/metadata`, fields)\n return res.data\n }\n\n async setRichMenu(friendId: string, richMenuId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/rich-menu`, { richMenuId })\n }\n\n async removeRichMenu(friendId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/rich-menu`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Tag, CreateTagInput } from '../types.js'\n\nexport class TagsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Tag[]> {\n const res = await this.http.get<ApiResponse<Tag[]>>('/api/tags')\n return res.data\n }\n\n async create(input: CreateTagInput): Promise<Tag> {\n const res = await this.http.post<ApiResponse<Tag>>('/api/tags', input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tags/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n} from '../types.js'\n\nexport class ScenariosResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<ScenarioListItem[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<ScenarioListItem[]>>(`/api/scenarios${query}`)\n return res.data\n }\n\n async get(id: string): Promise<ScenarioWithSteps> {\n const res = await this.http.get<ApiResponse<ScenarioWithSteps>>(`/api/scenarios/${id}`)\n return res.data\n }\n\n async create(input: CreateScenarioInput & { lineAccountId?: string }): Promise<Scenario> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Scenario>>('/api/scenarios', body)\n return res.data\n }\n\n async update(id: string, input: UpdateScenarioInput): Promise<Scenario> {\n const res = await this.http.put<ApiResponse<Scenario>>(`/api/scenarios/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${id}`)\n }\n\n async addStep(scenarioId: string, input: CreateStepInput): Promise<ScenarioStep> {\n const res = await this.http.post<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps`, input)\n return res.data\n }\n\n async updateStep(scenarioId: string, stepId: string, input: UpdateStepInput): Promise<ScenarioStep> {\n const res = await this.http.put<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps/${stepId}`, input)\n return res.data\n }\n\n async deleteStep(scenarioId: string, stepId: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${scenarioId}/steps/${stepId}`)\n }\n\n async enroll(scenarioId: string, friendId: string): Promise<FriendScenarioEnrollment> {\n const res = await this.http.post<ApiResponse<FriendScenarioEnrollment>>(\n `/api/scenarios/${scenarioId}/enroll/${friendId}`\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Broadcast, CreateBroadcastInput, UpdateBroadcastInput, SegmentCondition } from '../types.js'\n\nexport class BroadcastsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<Broadcast[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<Broadcast[]>>(`/api/broadcasts${query}`)\n return res.data\n }\n\n async get(id: string): Promise<Broadcast> {\n const res = await this.http.get<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`)\n return res.data\n }\n\n async create(input: CreateBroadcastInput & { lineAccountId?: string }): Promise<Broadcast> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Broadcast>>('/api/broadcasts', body)\n return res.data\n }\n\n async update(id: string, input: UpdateBroadcastInput): Promise<Broadcast> {\n const res = await this.http.put<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/broadcasts/${id}`)\n }\n\n async send(id: string): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(`/api/broadcasts/${id}/send`)\n return res.data\n }\n\n async sendToSegment(id: string, conditions: SegmentCondition): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(\n `/api/broadcasts/${id}/send-segment`,\n { conditions },\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, RichMenu, CreateRichMenuInput } from '../types.js'\n\nexport class RichMenusResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<RichMenu[]> {\n const res = await this.http.get<ApiResponse<RichMenu[]>>('/api/rich-menus')\n return res.data\n }\n\n async create(menu: CreateRichMenuInput): Promise<{ richMenuId: string }> {\n const res = await this.http.post<ApiResponse<{ richMenuId: string }>>('/api/rich-menus', menu)\n return res.data\n }\n\n async delete(richMenuId: string): Promise<void> {\n await this.http.delete(`/api/rich-menus/${encodeURIComponent(richMenuId)}`)\n }\n\n async setDefault(richMenuId: string): Promise<void> {\n await this.http.post(`/api/rich-menus/${encodeURIComponent(richMenuId)}/default`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, TrackedLink, TrackedLinkWithClicks, CreateTrackedLinkInput } from '../types.js'\n\nexport class TrackedLinksResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<TrackedLink[]> {\n const res = await this.http.get<ApiResponse<TrackedLink[]>>('/api/tracked-links')\n return res.data\n }\n\n async create(input: CreateTrackedLinkInput): Promise<TrackedLink> {\n const res = await this.http.post<ApiResponse<TrackedLink>>('/api/tracked-links', input)\n return res.data\n }\n\n async get(id: string): Promise<TrackedLinkWithClicks> {\n const res = await this.http.get<ApiResponse<TrackedLinkWithClicks>>(`/api/tracked-links/${id}`)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tracked-links/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Form,\n FormSubmission,\n CreateFormInput,\n UpdateFormInput,\n} from '../types.js'\n\nexport class FormsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Form[]> {\n const res = await this.http.get<ApiResponse<Form[]>>('/api/forms')\n return res.data\n }\n\n async get(id: string): Promise<Form> {\n const res = await this.http.get<ApiResponse<Form>>(`/api/forms/${id}`)\n return res.data\n }\n\n async create(input: CreateFormInput): Promise<Form> {\n const res = await this.http.post<ApiResponse<Form>>('/api/forms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateFormInput): Promise<Form> {\n const res = await this.http.put<ApiResponse<Form>>(`/api/forms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/forms/${id}`)\n }\n\n async getSubmissions(formId: string): Promise<FormSubmission[]> {\n const res = await this.http.get<ApiResponse<FormSubmission[]>>(\n `/api/forms/${formId}/submissions`,\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse } from '../types.js'\n\nexport interface AdPlatform {\n id: string\n name: string\n displayName: string | null\n config: Record<string, unknown>\n isActive: boolean\n createdAt: string\n updatedAt: string\n}\n\nexport interface AdConversionLog {\n id: string\n adPlatformId: string\n friendId: string\n eventName: string\n clickId: string | null\n clickIdType: string | null\n status: string\n errorMessage: string | null\n createdAt: string\n}\n\nexport interface CreateAdPlatformInput {\n name: 'meta' | 'x' | 'google' | 'tiktok'\n displayName?: string\n config: Record<string, unknown>\n}\n\nexport interface UpdateAdPlatformInput {\n name?: string\n displayName?: string | null\n config?: Record<string, unknown>\n isActive?: boolean\n}\n\nexport class AdPlatformsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<AdPlatform[]> {\n const res = await this.http.get<ApiResponse<AdPlatform[]>>('/api/ad-platforms')\n return res.data\n }\n\n async create(input: CreateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.post<ApiResponse<AdPlatform>>('/api/ad-platforms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.put<ApiResponse<AdPlatform>>(`/api/ad-platforms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/ad-platforms/${id}`)\n }\n\n async getLogs(id: string, limit?: number): Promise<AdConversionLog[]> {\n const path = limit\n ? `/api/ad-platforms/${id}/logs?limit=${limit}`\n : `/api/ad-platforms/${id}/logs`\n const res = await this.http.get<ApiResponse<AdConversionLog[]>>(path)\n return res.data\n }\n\n async test(platform: string, eventName: string, friendId?: string): Promise<{ message: string }> {\n const res = await this.http.post<ApiResponse<{ message: string }>>('/api/ad-platforms/test', {\n platform,\n eventName,\n friendId,\n })\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, StaffMember, StaffProfile, CreateStaffInput, UpdateStaffInput } from '../types.js'\n\nexport class StaffResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<StaffMember[]> {\n const res = await this.http.get<ApiResponse<StaffMember[]>>('/api/staff')\n return res.data\n }\n\n async get(id: string): Promise<StaffMember> {\n const res = await this.http.get<ApiResponse<StaffMember>>(`/api/staff/${id}`)\n return res.data\n }\n\n async me(): Promise<StaffProfile> {\n const res = await this.http.get<ApiResponse<StaffProfile>>('/api/staff/me')\n return res.data\n }\n\n async create(input: CreateStaffInput): Promise<StaffMember> {\n const res = await this.http.post<ApiResponse<StaffMember>>('/api/staff', input)\n return res.data\n }\n\n async update(id: string, input: UpdateStaffInput): Promise<StaffMember> {\n const res = await this.http.patch<ApiResponse<StaffMember>>(`/api/staff/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/staff/${id}`)\n }\n\n async regenerateKey(id: string): Promise<{ apiKey: string }> {\n const res = await this.http.post<ApiResponse<{ apiKey: string }>>(`/api/staff/${id}/regenerate-key`)\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, UploadedImage, UploadImageInput } from '../types.js'\n\nexport class ImagesResource {\n constructor(private readonly http: HttpClient) {}\n\n async upload(input: UploadImageInput): Promise<UploadedImage> {\n const res = await this.http.post<ApiResponse<UploadedImage>>('/api/images', input)\n return res.data\n }\n\n async delete(key: string): Promise<void> {\n await this.http.delete(`/api/images/${key}`)\n }\n}\n","const MULTIPLIERS: Record<string, number> = {\n m: 1,\n h: 60,\n d: 1440,\n w: 10080,\n}\n\nexport function parseDelay(input: string): number {\n const match = input.match(/^(\\d+)([mhdw])$/)\n if (!match) {\n throw new Error(`Invalid delay format: \"${input}\". Use format like \"30m\", \"1h\", \"1d\", \"1w\".`)\n }\n return Number(match[1]) * MULTIPLIERS[match[2]]\n}\n","import type { FriendsResource } from './resources/friends.js'\nimport type { ScenariosResource } from './resources/scenarios.js'\nimport type { BroadcastsResource } from './resources/broadcasts.js'\nimport type { StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\nimport { parseDelay } from './delay.js'\n\nexport class Workflows {\n constructor(\n private readonly friends: FriendsResource,\n private readonly scenarios: ScenariosResource,\n private readonly broadcasts: BroadcastsResource,\n ) {}\n\n async createStepScenario(\n name: string,\n triggerType: ScenarioTriggerType,\n steps: StepDefinition[],\n ): Promise<ScenarioWithSteps> {\n const scenario = await this.scenarios.create({ name, triggerType })\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i]\n await this.scenarios.addStep(scenario.id, {\n stepOrder: i + 1,\n delayMinutes: parseDelay(step.delay),\n messageType: step.type,\n messageContent: step.content,\n })\n }\n\n return this.scenarios.get(scenario.id)\n }\n\n async broadcastText(text: string): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: text.slice(0, 50),\n messageType: 'text',\n messageContent: text,\n targetType: 'all',\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToTag(\n tagId: string,\n messageType: MessageType,\n content: string,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'tag',\n targetTagId: tagId,\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToSegment(\n messageType: MessageType,\n content: string,\n conditions: SegmentCondition,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'all',\n })\n return this.broadcasts.sendToSegment(broadcast.id, conditions)\n }\n\n async sendTextToFriend(friendId: string, text: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, text, 'text')\n }\n\n async sendFlexToFriend(friendId: string, flexJson: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, flexJson, 'flex')\n }\n}\n","import { HttpClient } from './http.js'\nimport { FriendsResource } from './resources/friends.js'\nimport { TagsResource } from './resources/tags.js'\nimport { ScenariosResource } from './resources/scenarios.js'\nimport { BroadcastsResource } from './resources/broadcasts.js'\nimport { RichMenusResource } from './resources/rich-menus.js'\nimport { TrackedLinksResource } from './resources/tracked-links.js'\nimport { FormsResource } from './resources/forms.js'\nimport { AdPlatformsResource } from './resources/ad-platforms.js'\nimport { StaffResource } from './resources/staff.js'\nimport { ImagesResource } from './resources/images.js'\nimport { Workflows } from './workflows.js'\nimport type { LineHarnessConfig, StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\n\nexport class LineHarness {\n readonly friends: FriendsResource\n readonly tags: TagsResource\n readonly scenarios: ScenariosResource\n readonly broadcasts: BroadcastsResource\n readonly richMenus: RichMenusResource\n readonly trackedLinks: TrackedLinksResource\n readonly forms: FormsResource\n readonly adPlatforms: AdPlatformsResource\n readonly staff: StaffResource\n readonly images: ImagesResource\n\n private readonly apiUrl: string\n private readonly defaultAccountId: string | undefined\n private readonly workflows: Workflows\n\n readonly createStepScenario: (name: string, triggerType: ScenarioTriggerType, steps: StepDefinition[]) => Promise<ScenarioWithSteps>\n readonly broadcastText: (text: string) => Promise<Broadcast>\n readonly broadcastToTag: (tagId: string, messageType: MessageType, content: string) => Promise<Broadcast>\n readonly broadcastToSegment: (messageType: MessageType, content: string, conditions: SegmentCondition) => Promise<Broadcast>\n readonly sendTextToFriend: (friendId: string, text: string) => Promise<{ messageId: string }>\n readonly sendFlexToFriend: (friendId: string, flexJson: string) => Promise<{ messageId: string }>\n\n constructor(config: LineHarnessConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/$/, '')\n this.defaultAccountId = config.lineAccountId\n\n const http = new HttpClient({\n baseUrl: this.apiUrl,\n apiKey: config.apiKey,\n timeout: config.timeout ?? 30_000,\n })\n\n this.friends = new FriendsResource(http, this.defaultAccountId)\n this.tags = new TagsResource(http)\n this.scenarios = new ScenariosResource(http, this.defaultAccountId)\n this.broadcasts = new BroadcastsResource(http, this.defaultAccountId)\n this.richMenus = new RichMenusResource(http)\n this.trackedLinks = new TrackedLinksResource(http)\n this.forms = new FormsResource(http)\n this.adPlatforms = new AdPlatformsResource(http)\n this.staff = new StaffResource(http)\n this.images = new ImagesResource(http)\n this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts)\n\n this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows)\n this.broadcastText = this.workflows.broadcastText.bind(this.workflows)\n this.broadcastToTag = this.workflows.broadcastToTag.bind(this.workflows)\n this.broadcastToSegment = this.workflows.broadcastToSegment.bind(this.workflows)\n this.sendTextToFriend = this.workflows.sendTextToFriend.bind(this.workflows)\n this.sendFlexToFriend = this.workflows.sendFlexToFriend.bind(this.workflows)\n }\n\n /**\n * Generate friend-add URL with OAuth (bot_prompt=aggressive)\n * This URL does friend-add + UUID in one step.\n *\n * @param ref - Attribution code (e.g., 'lp-a', 'instagram', 'seminar-0322')\n * @param redirect - URL to redirect after completion\n */\n getAuthUrl(options?: { ref?: string; redirect?: string }): string {\n const url = new URL(`${this.apiUrl}/auth/line`)\n if (options?.ref) url.searchParams.set('ref', options.ref)\n if (options?.redirect) url.searchParams.set('redirect', options.redirect)\n return url.toString()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YACE,SACgB,QACA,UAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;;;ACDO,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,QAA0B;AACpC,SAAK,UAAU,OAAO,QAAQ,QAAQ,OAAO,EAAE;AAC/C,SAAK,SAAS,OAAO;AACrB,SAAK,UAAU,OAAO;AAAA,EACxB;AAAA,EAEA,MAAM,IAAiB,MAA0B;AAC/C,WAAO,KAAK,QAAW,OAAO,IAAI;AAAA,EACpC;AAAA,EAEA,MAAM,KAAkB,MAAc,MAA4B;AAChE,WAAO,KAAK,QAAW,QAAQ,MAAM,IAAI;AAAA,EAC3C;AAAA,EAEA,MAAM,IAAiB,MAAc,MAA4B;AAC/D,WAAO,KAAK,QAAW,OAAO,MAAM,IAAI;AAAA,EAC1C;AAAA,EAEA,MAAM,MAAmB,MAAc,MAA4B;AACjE,WAAO,KAAK,QA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KAAK,SAAS;AACrE,SAAK,iBAAiB,KAAK,UAAU,eAAe,KAAK,KAAK,SAAS;AACvE,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAC3E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,SAAuD;AAChE,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,MAAM,YAAY;AAC9C,QAAI,SAAS,IAAK,KAAI,aAAa,IAAI,OAAO,QAAQ,GAAG;AACzD,QAAI,SAAS,SAAU,KAAI,aAAa,IAAI,YAAY,QAAQ,QAAQ;AACxE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF;","names":[]}
package/dist/index.d.cts CHANGED
@@ -340,6 +340,21 @@ interface StepDefinition {
340
340
  type: MessageType;
341
341
  content: string;
342
342
  }
343
+ interface UploadedImage {
344
+ id: string;
345
+ key: string;
346
+ url: string;
347
+ mimeType: string;
348
+ size: number;
349
+ }
350
+ interface UploadImageInput {
351
+ /** Base64-encoded image data (with or without data URI prefix) */
352
+ data: string;
353
+ /** MIME type, e.g. "image/png". Defaults to "image/png" */
354
+ mimeType?: string;
355
+ /** Optional original filename */
356
+ filename?: string;
357
+ }
343
358
 
344
359
  declare class FriendsResource {
345
360
  private readonly http;
@@ -350,7 +365,7 @@ declare class FriendsResource {
350
365
  count(): Promise<number>;
351
366
  addTag(friendId: string, tagId: string): Promise<void>;
352
367
  removeTag(friendId: string, tagId: string): Promise<void>;
353
- sendMessage(friendId: string, content: string, messageType?: MessageType): Promise<{
368
+ sendMessage(friendId: string, content: string, messageType?: MessageType, altText?: string): Promise<{
354
369
  messageId: string;
355
370
  }>;
356
371
  setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend>;
@@ -491,6 +506,13 @@ declare class StaffResource {
491
506
  }>;
492
507
  }
493
508
 
509
+ declare class ImagesResource {
510
+ private readonly http;
511
+ constructor(http: HttpClient);
512
+ upload(input: UploadImageInput): Promise<UploadedImage>;
513
+ delete(key: string): Promise<void>;
514
+ }
515
+
494
516
  declare class LineHarness {
495
517
  readonly friends: FriendsResource;
496
518
  readonly tags: TagsResource;
@@ -501,6 +523,7 @@ declare class LineHarness {
501
523
  readonly forms: FormsResource;
502
524
  readonly adPlatforms: AdPlatformsResource;
503
525
  readonly staff: StaffResource;
526
+ readonly images: ImagesResource;
504
527
  private readonly apiUrl;
505
528
  private readonly defaultAccountId;
506
529
  private readonly workflows;
@@ -536,4 +559,4 @@ declare class LineHarnessError extends Error {
536
559
 
537
560
  declare function parseDelay(input: string): number;
538
561
 
539
- export { type AdConversionLog, type AdPlatform, AdPlatformsResource, type ApiResponse, type Broadcast, type BroadcastStatus, BroadcastsResource, type CreateAdPlatformInput, type CreateBroadcastInput, type CreateFormInput, type CreateRichMenuInput, type CreateScenarioInput, type CreateStaffInput, type CreateStepInput, type CreateTagInput, type CreateTrackedLinkInput, type Form, type FormField, type FormSubmission, FormsResource, type Friend, type FriendListParams, type FriendScenarioEnrollment, FriendsResource, LineHarness, type LineHarnessConfig, LineHarnessError, type LinkClick, type MessageType, type PaginatedData, type RichMenu, type RichMenuAction, type RichMenuArea, type RichMenuBounds, RichMenusResource, type Scenario, type ScenarioListItem, type ScenarioStep, type ScenarioTriggerType, type ScenarioWithSteps, ScenariosResource, type SegmentCondition, type SegmentRule, type StaffMember, type StaffProfile, StaffResource, type StaffRole, type StepDefinition, type Tag, TagsResource, type TrackedLink, type TrackedLinkWithClicks, TrackedLinksResource, type UpdateAdPlatformInput, type UpdateBroadcastInput, type UpdateFormInput, type UpdateScenarioInput, type UpdateStaffInput, type UpdateStepInput, parseDelay };
562
+ export { type AdConversionLog, type AdPlatform, AdPlatformsResource, type ApiResponse, type Broadcast, type BroadcastStatus, BroadcastsResource, type CreateAdPlatformInput, type CreateBroadcastInput, type CreateFormInput, type CreateRichMenuInput, type CreateScenarioInput, type CreateStaffInput, type CreateStepInput, type CreateTagInput, type CreateTrackedLinkInput, type Form, type FormField, type FormSubmission, FormsResource, type Friend, type FriendListParams, type FriendScenarioEnrollment, FriendsResource, ImagesResource, LineHarness, type LineHarnessConfig, LineHarnessError, type LinkClick, type MessageType, type PaginatedData, type RichMenu, type RichMenuAction, type RichMenuArea, type RichMenuBounds, RichMenusResource, type Scenario, type ScenarioListItem, type ScenarioStep, type ScenarioTriggerType, type ScenarioWithSteps, ScenariosResource, type SegmentCondition, type SegmentRule, type StaffMember, type StaffProfile, StaffResource, type StaffRole, type StepDefinition, type Tag, TagsResource, type TrackedLink, type TrackedLinkWithClicks, TrackedLinksResource, type UpdateAdPlatformInput, type UpdateBroadcastInput, type UpdateFormInput, type UpdateScenarioInput, type UpdateStaffInput, type UpdateStepInput, type UploadImageInput, type UploadedImage, parseDelay };
package/dist/index.d.ts CHANGED
@@ -340,6 +340,21 @@ interface StepDefinition {
340
340
  type: MessageType;
341
341
  content: string;
342
342
  }
343
+ interface UploadedImage {
344
+ id: string;
345
+ key: string;
346
+ url: string;
347
+ mimeType: string;
348
+ size: number;
349
+ }
350
+ interface UploadImageInput {
351
+ /** Base64-encoded image data (with or without data URI prefix) */
352
+ data: string;
353
+ /** MIME type, e.g. "image/png". Defaults to "image/png" */
354
+ mimeType?: string;
355
+ /** Optional original filename */
356
+ filename?: string;
357
+ }
343
358
 
344
359
  declare class FriendsResource {
345
360
  private readonly http;
@@ -350,7 +365,7 @@ declare class FriendsResource {
350
365
  count(): Promise<number>;
351
366
  addTag(friendId: string, tagId: string): Promise<void>;
352
367
  removeTag(friendId: string, tagId: string): Promise<void>;
353
- sendMessage(friendId: string, content: string, messageType?: MessageType): Promise<{
368
+ sendMessage(friendId: string, content: string, messageType?: MessageType, altText?: string): Promise<{
354
369
  messageId: string;
355
370
  }>;
356
371
  setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend>;
@@ -491,6 +506,13 @@ declare class StaffResource {
491
506
  }>;
492
507
  }
493
508
 
509
+ declare class ImagesResource {
510
+ private readonly http;
511
+ constructor(http: HttpClient);
512
+ upload(input: UploadImageInput): Promise<UploadedImage>;
513
+ delete(key: string): Promise<void>;
514
+ }
515
+
494
516
  declare class LineHarness {
495
517
  readonly friends: FriendsResource;
496
518
  readonly tags: TagsResource;
@@ -501,6 +523,7 @@ declare class LineHarness {
501
523
  readonly forms: FormsResource;
502
524
  readonly adPlatforms: AdPlatformsResource;
503
525
  readonly staff: StaffResource;
526
+ readonly images: ImagesResource;
504
527
  private readonly apiUrl;
505
528
  private readonly defaultAccountId;
506
529
  private readonly workflows;
@@ -536,4 +559,4 @@ declare class LineHarnessError extends Error {
536
559
 
537
560
  declare function parseDelay(input: string): number;
538
561
 
539
- export { type AdConversionLog, type AdPlatform, AdPlatformsResource, type ApiResponse, type Broadcast, type BroadcastStatus, BroadcastsResource, type CreateAdPlatformInput, type CreateBroadcastInput, type CreateFormInput, type CreateRichMenuInput, type CreateScenarioInput, type CreateStaffInput, type CreateStepInput, type CreateTagInput, type CreateTrackedLinkInput, type Form, type FormField, type FormSubmission, FormsResource, type Friend, type FriendListParams, type FriendScenarioEnrollment, FriendsResource, LineHarness, type LineHarnessConfig, LineHarnessError, type LinkClick, type MessageType, type PaginatedData, type RichMenu, type RichMenuAction, type RichMenuArea, type RichMenuBounds, RichMenusResource, type Scenario, type ScenarioListItem, type ScenarioStep, type ScenarioTriggerType, type ScenarioWithSteps, ScenariosResource, type SegmentCondition, type SegmentRule, type StaffMember, type StaffProfile, StaffResource, type StaffRole, type StepDefinition, type Tag, TagsResource, type TrackedLink, type TrackedLinkWithClicks, TrackedLinksResource, type UpdateAdPlatformInput, type UpdateBroadcastInput, type UpdateFormInput, type UpdateScenarioInput, type UpdateStaffInput, type UpdateStepInput, parseDelay };
562
+ export { type AdConversionLog, type AdPlatform, AdPlatformsResource, type ApiResponse, type Broadcast, type BroadcastStatus, BroadcastsResource, type CreateAdPlatformInput, type CreateBroadcastInput, type CreateFormInput, type CreateRichMenuInput, type CreateScenarioInput, type CreateStaffInput, type CreateStepInput, type CreateTagInput, type CreateTrackedLinkInput, type Form, type FormField, type FormSubmission, FormsResource, type Friend, type FriendListParams, type FriendScenarioEnrollment, FriendsResource, ImagesResource, LineHarness, type LineHarnessConfig, LineHarnessError, type LinkClick, type MessageType, type PaginatedData, type RichMenu, type RichMenuAction, type RichMenuArea, type RichMenuBounds, RichMenusResource, type Scenario, type ScenarioListItem, type ScenarioStep, type ScenarioTriggerType, type ScenarioWithSteps, ScenariosResource, type SegmentCondition, type SegmentRule, type StaffMember, type StaffProfile, StaffResource, type StaffRole, type StepDefinition, type Tag, TagsResource, type TrackedLink, type TrackedLinkWithClicks, TrackedLinksResource, type UpdateAdPlatformInput, type UpdateBroadcastInput, type UpdateFormInput, type UpdateScenarioInput, type UpdateStaffInput, type UpdateStepInput, type UploadImageInput, type UploadedImage, parseDelay };
package/dist/index.mjs CHANGED
@@ -93,10 +93,11 @@ var FriendsResource = class {
93
93
  async removeTag(friendId, tagId) {
94
94
  await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`);
95
95
  }
96
- async sendMessage(friendId, content, messageType = "text") {
96
+ async sendMessage(friendId, content, messageType = "text", altText) {
97
97
  const res = await this.http.post(`/api/friends/${friendId}/messages`, {
98
98
  messageType,
99
- content
99
+ content,
100
+ ...altText ? { altText } : {}
100
101
  });
101
102
  return res.data;
102
103
  }
@@ -368,6 +369,20 @@ var StaffResource = class {
368
369
  }
369
370
  };
370
371
 
372
+ // src/resources/images.ts
373
+ var ImagesResource = class {
374
+ constructor(http) {
375
+ this.http = http;
376
+ }
377
+ async upload(input) {
378
+ const res = await this.http.post("/api/images", input);
379
+ return res.data;
380
+ }
381
+ async delete(key) {
382
+ await this.http.delete(`/api/images/${key}`);
383
+ }
384
+ };
385
+
371
386
  // src/delay.ts
372
387
  var MULTIPLIERS = {
373
388
  m: 1,
@@ -450,6 +465,7 @@ var LineHarness = class {
450
465
  forms;
451
466
  adPlatforms;
452
467
  staff;
468
+ images;
453
469
  apiUrl;
454
470
  defaultAccountId;
455
471
  workflows;
@@ -476,6 +492,7 @@ var LineHarness = class {
476
492
  this.forms = new FormsResource(http);
477
493
  this.adPlatforms = new AdPlatformsResource(http);
478
494
  this.staff = new StaffResource(http);
495
+ this.images = new ImagesResource(http);
479
496
  this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts);
480
497
  this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows);
481
498
  this.broadcastText = this.workflows.broadcastText.bind(this.workflows);
@@ -503,6 +520,7 @@ export {
503
520
  BroadcastsResource,
504
521
  FormsResource,
505
522
  FriendsResource,
523
+ ImagesResource,
506
524
  LineHarness,
507
525
  LineHarnessError,
508
526
  RichMenusResource,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/resources/friends.ts","../src/resources/tags.ts","../src/resources/scenarios.ts","../src/resources/broadcasts.ts","../src/resources/rich-menus.ts","../src/resources/tracked-links.ts","../src/resources/forms.ts","../src/resources/ad-platforms.ts","../src/resources/staff.ts","../src/delay.ts","../src/workflows.ts","../src/client.ts"],"sourcesContent":["export class LineHarnessError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly endpoint: string,\n ) {\n super(message)\n this.name = 'LineHarnessError'\n }\n}\n","import { LineHarnessError } from './errors.js'\n\ninterface HttpClientConfig {\n baseUrl: string\n apiKey: string\n timeout: number\n}\n\nexport class HttpClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n private readonly timeout: number\n\n constructor(config: HttpClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, '')\n this.apiKey = config.apiKey\n this.timeout = config.timeout\n }\n\n async get<T = unknown>(path: string): Promise<T> {\n return this.request<T>('GET', path)\n }\n\n async post<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('POST', path, body)\n }\n\n async put<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PUT', path, body)\n }\n\n async patch<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PATCH', path, body)\n }\n\n async delete<T = unknown>(path: string): Promise<T> {\n return this.request<T>('DELETE', path)\n }\n\n private async request<T>(method: string, path: string, body?: unknown): Promise<T> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n }\n\n const options: RequestInit = {\n method,\n headers,\n signal: AbortSignal.timeout(this.timeout),\n }\n\n if (body !== undefined) {\n options.body = JSON.stringify(body)\n }\n\n const res = await fetch(url, options)\n\n if (!res.ok) {\n let errorMessage = `HTTP ${res.status}`\n try {\n const errorBody = (await res.json()) as { error?: string }\n if (errorBody.error) errorMessage = errorBody.error\n } catch {\n // ignore parse errors\n }\n throw new LineHarnessError(errorMessage, res.status, `${method} ${path}`)\n }\n\n return res.json() as Promise<T>\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, PaginatedData, Friend, FriendListParams, MessageType } from '../types.js'\n\nexport class FriendsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: FriendListParams): Promise<PaginatedData<Friend>> {\n const query = new URLSearchParams()\n if (params?.limit !== undefined) query.set('limit', String(params.limit))\n if (params?.offset !== undefined) query.set('offset', String(params.offset))\n if (params?.tagId) query.set('tagId', params.tagId)\n const accountId = params?.accountId ?? this.defaultAccountId\n if (accountId) query.set('lineAccountId', accountId)\n const qs = query.toString()\n const path = qs ? `/api/friends?${qs}` : '/api/friends'\n const res = await this.http.get<ApiResponse<PaginatedData<Friend>>>(path)\n return res.data\n }\n\n async get(id: string): Promise<Friend> {\n const res = await this.http.get<ApiResponse<Friend>>(`/api/friends/${id}`)\n return res.data\n }\n\n async count(): Promise<number> {\n const res = await this.http.get<ApiResponse<{ count: number }>>('/api/friends/count')\n return res.data.count\n }\n\n async addTag(friendId: string, tagId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/tags`, { tagId })\n }\n\n async removeTag(friendId: string, tagId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`)\n }\n\n async sendMessage(friendId: string, content: string, messageType: MessageType = 'text'): Promise<{ messageId: string }> {\n const res = await this.http.post<ApiResponse<{ messageId: string }>>(`/api/friends/${friendId}/messages`, {\n messageType,\n content,\n })\n return res.data\n }\n\n async setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend> {\n const res = await this.http.put<ApiResponse<Friend>>(`/api/friends/${friendId}/metadata`, fields)\n return res.data\n }\n\n async setRichMenu(friendId: string, richMenuId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/rich-menu`, { richMenuId })\n }\n\n async removeRichMenu(friendId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/rich-menu`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Tag, CreateTagInput } from '../types.js'\n\nexport class TagsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Tag[]> {\n const res = await this.http.get<ApiResponse<Tag[]>>('/api/tags')\n return res.data\n }\n\n async create(input: CreateTagInput): Promise<Tag> {\n const res = await this.http.post<ApiResponse<Tag>>('/api/tags', input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tags/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n} from '../types.js'\n\nexport class ScenariosResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<ScenarioListItem[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<ScenarioListItem[]>>(`/api/scenarios${query}`)\n return res.data\n }\n\n async get(id: string): Promise<ScenarioWithSteps> {\n const res = await this.http.get<ApiResponse<ScenarioWithSteps>>(`/api/scenarios/${id}`)\n return res.data\n }\n\n async create(input: CreateScenarioInput & { lineAccountId?: string }): Promise<Scenario> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Scenario>>('/api/scenarios', body)\n return res.data\n }\n\n async update(id: string, input: UpdateScenarioInput): Promise<Scenario> {\n const res = await this.http.put<ApiResponse<Scenario>>(`/api/scenarios/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${id}`)\n }\n\n async addStep(scenarioId: string, input: CreateStepInput): Promise<ScenarioStep> {\n const res = await this.http.post<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps`, input)\n return res.data\n }\n\n async updateStep(scenarioId: string, stepId: string, input: UpdateStepInput): Promise<ScenarioStep> {\n const res = await this.http.put<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps/${stepId}`, input)\n return res.data\n }\n\n async deleteStep(scenarioId: string, stepId: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${scenarioId}/steps/${stepId}`)\n }\n\n async enroll(scenarioId: string, friendId: string): Promise<FriendScenarioEnrollment> {\n const res = await this.http.post<ApiResponse<FriendScenarioEnrollment>>(\n `/api/scenarios/${scenarioId}/enroll/${friendId}`\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Broadcast, CreateBroadcastInput, UpdateBroadcastInput, SegmentCondition } from '../types.js'\n\nexport class BroadcastsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<Broadcast[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<Broadcast[]>>(`/api/broadcasts${query}`)\n return res.data\n }\n\n async get(id: string): Promise<Broadcast> {\n const res = await this.http.get<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`)\n return res.data\n }\n\n async create(input: CreateBroadcastInput & { lineAccountId?: string }): Promise<Broadcast> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Broadcast>>('/api/broadcasts', body)\n return res.data\n }\n\n async update(id: string, input: UpdateBroadcastInput): Promise<Broadcast> {\n const res = await this.http.put<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/broadcasts/${id}`)\n }\n\n async send(id: string): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(`/api/broadcasts/${id}/send`)\n return res.data\n }\n\n async sendToSegment(id: string, conditions: SegmentCondition): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(\n `/api/broadcasts/${id}/send-segment`,\n { conditions },\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, RichMenu, CreateRichMenuInput } from '../types.js'\n\nexport class RichMenusResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<RichMenu[]> {\n const res = await this.http.get<ApiResponse<RichMenu[]>>('/api/rich-menus')\n return res.data\n }\n\n async create(menu: CreateRichMenuInput): Promise<{ richMenuId: string }> {\n const res = await this.http.post<ApiResponse<{ richMenuId: string }>>('/api/rich-menus', menu)\n return res.data\n }\n\n async delete(richMenuId: string): Promise<void> {\n await this.http.delete(`/api/rich-menus/${encodeURIComponent(richMenuId)}`)\n }\n\n async setDefault(richMenuId: string): Promise<void> {\n await this.http.post(`/api/rich-menus/${encodeURIComponent(richMenuId)}/default`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, TrackedLink, TrackedLinkWithClicks, CreateTrackedLinkInput } from '../types.js'\n\nexport class TrackedLinksResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<TrackedLink[]> {\n const res = await this.http.get<ApiResponse<TrackedLink[]>>('/api/tracked-links')\n return res.data\n }\n\n async create(input: CreateTrackedLinkInput): Promise<TrackedLink> {\n const res = await this.http.post<ApiResponse<TrackedLink>>('/api/tracked-links', input)\n return res.data\n }\n\n async get(id: string): Promise<TrackedLinkWithClicks> {\n const res = await this.http.get<ApiResponse<TrackedLinkWithClicks>>(`/api/tracked-links/${id}`)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tracked-links/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Form,\n FormSubmission,\n CreateFormInput,\n UpdateFormInput,\n} from '../types.js'\n\nexport class FormsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Form[]> {\n const res = await this.http.get<ApiResponse<Form[]>>('/api/forms')\n return res.data\n }\n\n async get(id: string): Promise<Form> {\n const res = await this.http.get<ApiResponse<Form>>(`/api/forms/${id}`)\n return res.data\n }\n\n async create(input: CreateFormInput): Promise<Form> {\n const res = await this.http.post<ApiResponse<Form>>('/api/forms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateFormInput): Promise<Form> {\n const res = await this.http.put<ApiResponse<Form>>(`/api/forms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/forms/${id}`)\n }\n\n async getSubmissions(formId: string): Promise<FormSubmission[]> {\n const res = await this.http.get<ApiResponse<FormSubmission[]>>(\n `/api/forms/${formId}/submissions`,\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse } from '../types.js'\n\nexport interface AdPlatform {\n id: string\n name: string\n displayName: string | null\n config: Record<string, unknown>\n isActive: boolean\n createdAt: string\n updatedAt: string\n}\n\nexport interface AdConversionLog {\n id: string\n adPlatformId: string\n friendId: string\n eventName: string\n clickId: string | null\n clickIdType: string | null\n status: string\n errorMessage: string | null\n createdAt: string\n}\n\nexport interface CreateAdPlatformInput {\n name: 'meta' | 'x' | 'google' | 'tiktok'\n displayName?: string\n config: Record<string, unknown>\n}\n\nexport interface UpdateAdPlatformInput {\n name?: string\n displayName?: string | null\n config?: Record<string, unknown>\n isActive?: boolean\n}\n\nexport class AdPlatformsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<AdPlatform[]> {\n const res = await this.http.get<ApiResponse<AdPlatform[]>>('/api/ad-platforms')\n return res.data\n }\n\n async create(input: CreateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.post<ApiResponse<AdPlatform>>('/api/ad-platforms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.put<ApiResponse<AdPlatform>>(`/api/ad-platforms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/ad-platforms/${id}`)\n }\n\n async getLogs(id: string, limit?: number): Promise<AdConversionLog[]> {\n const path = limit\n ? `/api/ad-platforms/${id}/logs?limit=${limit}`\n : `/api/ad-platforms/${id}/logs`\n const res = await this.http.get<ApiResponse<AdConversionLog[]>>(path)\n return res.data\n }\n\n async test(platform: string, eventName: string, friendId?: string): Promise<{ message: string }> {\n const res = await this.http.post<ApiResponse<{ message: string }>>('/api/ad-platforms/test', {\n platform,\n eventName,\n friendId,\n })\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, StaffMember, StaffProfile, CreateStaffInput, UpdateStaffInput } from '../types.js'\n\nexport class StaffResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<StaffMember[]> {\n const res = await this.http.get<ApiResponse<StaffMember[]>>('/api/staff')\n return res.data\n }\n\n async get(id: string): Promise<StaffMember> {\n const res = await this.http.get<ApiResponse<StaffMember>>(`/api/staff/${id}`)\n return res.data\n }\n\n async me(): Promise<StaffProfile> {\n const res = await this.http.get<ApiResponse<StaffProfile>>('/api/staff/me')\n return res.data\n }\n\n async create(input: CreateStaffInput): Promise<StaffMember> {\n const res = await this.http.post<ApiResponse<StaffMember>>('/api/staff', input)\n return res.data\n }\n\n async update(id: string, input: UpdateStaffInput): Promise<StaffMember> {\n const res = await this.http.patch<ApiResponse<StaffMember>>(`/api/staff/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/staff/${id}`)\n }\n\n async regenerateKey(id: string): Promise<{ apiKey: string }> {\n const res = await this.http.post<ApiResponse<{ apiKey: string }>>(`/api/staff/${id}/regenerate-key`)\n return res.data\n }\n}\n","const MULTIPLIERS: Record<string, number> = {\n m: 1,\n h: 60,\n d: 1440,\n w: 10080,\n}\n\nexport function parseDelay(input: string): number {\n const match = input.match(/^(\\d+)([mhdw])$/)\n if (!match) {\n throw new Error(`Invalid delay format: \"${input}\". Use format like \"30m\", \"1h\", \"1d\", \"1w\".`)\n }\n return Number(match[1]) * MULTIPLIERS[match[2]]\n}\n","import type { FriendsResource } from './resources/friends.js'\nimport type { ScenariosResource } from './resources/scenarios.js'\nimport type { BroadcastsResource } from './resources/broadcasts.js'\nimport type { StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\nimport { parseDelay } from './delay.js'\n\nexport class Workflows {\n constructor(\n private readonly friends: FriendsResource,\n private readonly scenarios: ScenariosResource,\n private readonly broadcasts: BroadcastsResource,\n ) {}\n\n async createStepScenario(\n name: string,\n triggerType: ScenarioTriggerType,\n steps: StepDefinition[],\n ): Promise<ScenarioWithSteps> {\n const scenario = await this.scenarios.create({ name, triggerType })\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i]\n await this.scenarios.addStep(scenario.id, {\n stepOrder: i + 1,\n delayMinutes: parseDelay(step.delay),\n messageType: step.type,\n messageContent: step.content,\n })\n }\n\n return this.scenarios.get(scenario.id)\n }\n\n async broadcastText(text: string): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: text.slice(0, 50),\n messageType: 'text',\n messageContent: text,\n targetType: 'all',\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToTag(\n tagId: string,\n messageType: MessageType,\n content: string,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'tag',\n targetTagId: tagId,\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToSegment(\n messageType: MessageType,\n content: string,\n conditions: SegmentCondition,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'all',\n })\n return this.broadcasts.sendToSegment(broadcast.id, conditions)\n }\n\n async sendTextToFriend(friendId: string, text: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, text, 'text')\n }\n\n async sendFlexToFriend(friendId: string, flexJson: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, flexJson, 'flex')\n }\n}\n","import { HttpClient } from './http.js'\nimport { FriendsResource } from './resources/friends.js'\nimport { TagsResource } from './resources/tags.js'\nimport { ScenariosResource } from './resources/scenarios.js'\nimport { BroadcastsResource } from './resources/broadcasts.js'\nimport { RichMenusResource } from './resources/rich-menus.js'\nimport { TrackedLinksResource } from './resources/tracked-links.js'\nimport { FormsResource } from './resources/forms.js'\nimport { AdPlatformsResource } from './resources/ad-platforms.js'\nimport { StaffResource } from './resources/staff.js'\nimport { Workflows } from './workflows.js'\nimport type { LineHarnessConfig, StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\n\nexport class LineHarness {\n readonly friends: FriendsResource\n readonly tags: TagsResource\n readonly scenarios: ScenariosResource\n readonly broadcasts: BroadcastsResource\n readonly richMenus: RichMenusResource\n readonly trackedLinks: TrackedLinksResource\n readonly forms: FormsResource\n readonly adPlatforms: AdPlatformsResource\n readonly staff: StaffResource\n\n private readonly apiUrl: string\n private readonly defaultAccountId: string | undefined\n private readonly workflows: Workflows\n\n readonly createStepScenario: (name: string, triggerType: ScenarioTriggerType, steps: StepDefinition[]) => Promise<ScenarioWithSteps>\n readonly broadcastText: (text: string) => Promise<Broadcast>\n readonly broadcastToTag: (tagId: string, messageType: MessageType, content: string) => Promise<Broadcast>\n readonly broadcastToSegment: (messageType: MessageType, content: string, conditions: SegmentCondition) => Promise<Broadcast>\n readonly sendTextToFriend: (friendId: string, text: string) => Promise<{ messageId: string }>\n readonly sendFlexToFriend: (friendId: string, flexJson: string) => Promise<{ messageId: string }>\n\n constructor(config: LineHarnessConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/$/, '')\n this.defaultAccountId = config.lineAccountId\n\n const http = new HttpClient({\n baseUrl: this.apiUrl,\n apiKey: config.apiKey,\n timeout: config.timeout ?? 30_000,\n })\n\n this.friends = new FriendsResource(http, this.defaultAccountId)\n this.tags = new TagsResource(http)\n this.scenarios = new ScenariosResource(http, this.defaultAccountId)\n this.broadcasts = new BroadcastsResource(http, this.defaultAccountId)\n this.richMenus = new RichMenusResource(http)\n this.trackedLinks = new TrackedLinksResource(http)\n this.forms = new FormsResource(http)\n this.adPlatforms = new AdPlatformsResource(http)\n this.staff = new StaffResource(http)\n this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts)\n\n this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows)\n this.broadcastText = this.workflows.broadcastText.bind(this.workflows)\n this.broadcastToTag = this.workflows.broadcastToTag.bind(this.workflows)\n this.broadcastToSegment = this.workflows.broadcastToSegment.bind(this.workflows)\n this.sendTextToFriend = this.workflows.sendTextToFriend.bind(this.workflows)\n this.sendFlexToFriend = this.workflows.sendFlexToFriend.bind(this.workflows)\n }\n\n /**\n * Generate friend-add URL with OAuth (bot_prompt=aggressive)\n * This URL does friend-add + UUID in one step.\n *\n * @param ref - Attribution code (e.g., 'lp-a', 'instagram', 'seminar-0322')\n * @param redirect - URL to redirect after completion\n */\n getAuthUrl(options?: { ref?: string; redirect?: string }): string {\n const url = new URL(`${this.apiUrl}/auth/line`)\n if (options?.ref) url.searchParams.set('ref', options.ref)\n if (options?.redirect) url.searchParams.set('redirect', options.redirect)\n return url.toString()\n }\n}\n"],"mappings":";AAAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YACE,SACgB,QACA,UAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;;;ACDO,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,QAA0B;AACpC,SAAK,UAAU,OAAO,QAAQ,QAAQ,OAAO,EAAE;AAC/C,SAAK,SAAS,OAAO;AACrB,SAAK,UAAU,OAAO;AAAA,EACxB;AAAA,EAEA,MAAM,IAAiB,MAA0B;AAC/C,WAAO,KAAK,QAAW,OAAO,IAAI;AAAA,EACpC;AAAA,EAEA,MAAM,KAAkB,MAAc,MAA4B;AAChE,WAAO,KAAK,QAAW,QAAQ,MAAM,IAAI;AAAA,EAC3C;AAAA,EAEA,MAAM,IAAiB,MAAc,MAA4B;AAC/D,WAAO,KAAK,QAAW,OAAO,MAAM,IAAI;AAAA,EAC1C;AAAA,EAEA,MAAM,MAAmB,MAAc,MAA4B;AACjE,WAAO,KAAK,QAAW,SAAS,MAAM,IAAI;AAAA,EAC5C;AAAA,EAEA,MAAM,OAAoB,MAA0B;AAClD,WAAO,KAAK,QAAW,UAAU,IAAI;AAAA,EACvC;AAAA,EAEA,MAAc,QAAW,QAAgB,MAAc,MAA4B;AACjF,UAAM,MAAM,GAAG,KAAK,OAAO,GAAG,IAAI;AAClC,UAAM,UAAkC;AAAA,MACtC,eAAe,UAAU,KAAK,MAAM;AAAA,MACpC,gBAAgB;AAAA,IAClB;AAEA,UAAM,UAAuB;AAAA,MAC3B;AAAA,MACA;AAAA,MACA,QAAQ,YAAY,QAAQ,KAAK,OAAO;AAAA,IAC1C;AAEA,QAAI,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gBAAgB;AAClE,SAAK,aAAa,IAAI,mBAAmB,MAAM,KAAK,gBAAgB;AACpE,SAAK,YAAY,IAAI,kBAAkB,IAAI;AAC3C,SAAK,eAAe,IAAI,qBAAqB,IAAI;AACjD,SAAK,QAAQ,IAAI,cAAc,IAAI;AACnC,SAAK,cAAc,IAAI,oBAAoB,IAAI;AAC/C,SAAK,QAAQ,IAAI,cAAc,IAAI;AACnC,SAAK,YAAY,IAAI,UAAU,KAAK,SAAS,KAAK,WAAW,KAAK,UAAU;AAE5E,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,gBAAgB,KAAK,UAAU,cAAc,KAAK,KAAK,SAAS;AACrE,SAAK,iBAAiB,KAAK,UAAU,eAAe,KAAK,KAAK,SAAS;AACvE,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAC3E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,SAAuD;AAChE,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,MAAM,YAAY;AAC9C,QAAI,SAAS,IAAK,KAAI,aAAa,IAAI,OAAO,QAAQ,GAAG;AACzD,QAAI,SAAS,SAAU,KAAI,aAAa,IAAI,YAAY,QAAQ,QAAQ;AACxE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/resources/friends.ts","../src/resources/tags.ts","../src/resources/scenarios.ts","../src/resources/broadcasts.ts","../src/resources/rich-menus.ts","../src/resources/tracked-links.ts","../src/resources/forms.ts","../src/resources/ad-platforms.ts","../src/resources/staff.ts","../src/resources/images.ts","../src/delay.ts","../src/workflows.ts","../src/client.ts"],"sourcesContent":["export class LineHarnessError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly endpoint: string,\n ) {\n super(message)\n this.name = 'LineHarnessError'\n }\n}\n","import { LineHarnessError } from './errors.js'\n\ninterface HttpClientConfig {\n baseUrl: string\n apiKey: string\n timeout: number\n}\n\nexport class HttpClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n private readonly timeout: number\n\n constructor(config: HttpClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, '')\n this.apiKey = config.apiKey\n this.timeout = config.timeout\n }\n\n async get<T = unknown>(path: string): Promise<T> {\n return this.request<T>('GET', path)\n }\n\n async post<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('POST', path, body)\n }\n\n async put<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PUT', path, body)\n }\n\n async patch<T = unknown>(path: string, body?: unknown): Promise<T> {\n return this.request<T>('PATCH', path, body)\n }\n\n async delete<T = unknown>(path: string): Promise<T> {\n return this.request<T>('DELETE', path)\n }\n\n private async request<T>(method: string, path: string, body?: unknown): Promise<T> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n }\n\n const options: RequestInit = {\n method,\n headers,\n signal: AbortSignal.timeout(this.timeout),\n }\n\n if (body !== undefined) {\n options.body = JSON.stringify(body)\n }\n\n const res = await fetch(url, options)\n\n if (!res.ok) {\n let errorMessage = `HTTP ${res.status}`\n try {\n const errorBody = (await res.json()) as { error?: string }\n if (errorBody.error) errorMessage = errorBody.error\n } catch {\n // ignore parse errors\n }\n throw new LineHarnessError(errorMessage, res.status, `${method} ${path}`)\n }\n\n return res.json() as Promise<T>\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, PaginatedData, Friend, FriendListParams, MessageType } from '../types.js'\n\nexport class FriendsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: FriendListParams): Promise<PaginatedData<Friend>> {\n const query = new URLSearchParams()\n if (params?.limit !== undefined) query.set('limit', String(params.limit))\n if (params?.offset !== undefined) query.set('offset', String(params.offset))\n if (params?.tagId) query.set('tagId', params.tagId)\n const accountId = params?.accountId ?? this.defaultAccountId\n if (accountId) query.set('lineAccountId', accountId)\n const qs = query.toString()\n const path = qs ? `/api/friends?${qs}` : '/api/friends'\n const res = await this.http.get<ApiResponse<PaginatedData<Friend>>>(path)\n return res.data\n }\n\n async get(id: string): Promise<Friend> {\n const res = await this.http.get<ApiResponse<Friend>>(`/api/friends/${id}`)\n return res.data\n }\n\n async count(): Promise<number> {\n const res = await this.http.get<ApiResponse<{ count: number }>>('/api/friends/count')\n return res.data.count\n }\n\n async addTag(friendId: string, tagId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/tags`, { tagId })\n }\n\n async removeTag(friendId: string, tagId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/tags/${tagId}`)\n }\n\n async sendMessage(friendId: string, content: string, messageType: MessageType = 'text', altText?: string): Promise<{ messageId: string }> {\n const res = await this.http.post<ApiResponse<{ messageId: string }>>(`/api/friends/${friendId}/messages`, {\n messageType,\n content,\n ...(altText ? { altText } : {}),\n })\n return res.data\n }\n\n async setMetadata(friendId: string, fields: Record<string, unknown>): Promise<Friend> {\n const res = await this.http.put<ApiResponse<Friend>>(`/api/friends/${friendId}/metadata`, fields)\n return res.data\n }\n\n async setRichMenu(friendId: string, richMenuId: string): Promise<void> {\n await this.http.post(`/api/friends/${friendId}/rich-menu`, { richMenuId })\n }\n\n async removeRichMenu(friendId: string): Promise<void> {\n await this.http.delete(`/api/friends/${friendId}/rich-menu`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Tag, CreateTagInput } from '../types.js'\n\nexport class TagsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Tag[]> {\n const res = await this.http.get<ApiResponse<Tag[]>>('/api/tags')\n return res.data\n }\n\n async create(input: CreateTagInput): Promise<Tag> {\n const res = await this.http.post<ApiResponse<Tag>>('/api/tags', input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tags/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Scenario,\n ScenarioListItem,\n ScenarioWithSteps,\n ScenarioStep,\n CreateScenarioInput,\n CreateStepInput,\n UpdateScenarioInput,\n UpdateStepInput,\n FriendScenarioEnrollment,\n} from '../types.js'\n\nexport class ScenariosResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<ScenarioListItem[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<ScenarioListItem[]>>(`/api/scenarios${query}`)\n return res.data\n }\n\n async get(id: string): Promise<ScenarioWithSteps> {\n const res = await this.http.get<ApiResponse<ScenarioWithSteps>>(`/api/scenarios/${id}`)\n return res.data\n }\n\n async create(input: CreateScenarioInput & { lineAccountId?: string }): Promise<Scenario> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Scenario>>('/api/scenarios', body)\n return res.data\n }\n\n async update(id: string, input: UpdateScenarioInput): Promise<Scenario> {\n const res = await this.http.put<ApiResponse<Scenario>>(`/api/scenarios/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${id}`)\n }\n\n async addStep(scenarioId: string, input: CreateStepInput): Promise<ScenarioStep> {\n const res = await this.http.post<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps`, input)\n return res.data\n }\n\n async updateStep(scenarioId: string, stepId: string, input: UpdateStepInput): Promise<ScenarioStep> {\n const res = await this.http.put<ApiResponse<ScenarioStep>>(`/api/scenarios/${scenarioId}/steps/${stepId}`, input)\n return res.data\n }\n\n async deleteStep(scenarioId: string, stepId: string): Promise<void> {\n await this.http.delete(`/api/scenarios/${scenarioId}/steps/${stepId}`)\n }\n\n async enroll(scenarioId: string, friendId: string): Promise<FriendScenarioEnrollment> {\n const res = await this.http.post<ApiResponse<FriendScenarioEnrollment>>(\n `/api/scenarios/${scenarioId}/enroll/${friendId}`\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, Broadcast, CreateBroadcastInput, UpdateBroadcastInput, SegmentCondition } from '../types.js'\n\nexport class BroadcastsResource {\n constructor(\n private readonly http: HttpClient,\n private readonly defaultAccountId?: string,\n ) {}\n\n async list(params?: { accountId?: string }): Promise<Broadcast[]> {\n const accountId = params?.accountId ?? this.defaultAccountId\n const query = accountId ? `?lineAccountId=${accountId}` : ''\n const res = await this.http.get<ApiResponse<Broadcast[]>>(`/api/broadcasts${query}`)\n return res.data\n }\n\n async get(id: string): Promise<Broadcast> {\n const res = await this.http.get<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`)\n return res.data\n }\n\n async create(input: CreateBroadcastInput & { lineAccountId?: string }): Promise<Broadcast> {\n const body = { ...input }\n if (!body.lineAccountId && this.defaultAccountId) {\n body.lineAccountId = this.defaultAccountId\n }\n const res = await this.http.post<ApiResponse<Broadcast>>('/api/broadcasts', body)\n return res.data\n }\n\n async update(id: string, input: UpdateBroadcastInput): Promise<Broadcast> {\n const res = await this.http.put<ApiResponse<Broadcast>>(`/api/broadcasts/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/broadcasts/${id}`)\n }\n\n async send(id: string): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(`/api/broadcasts/${id}/send`)\n return res.data\n }\n\n async sendToSegment(id: string, conditions: SegmentCondition): Promise<Broadcast> {\n const res = await this.http.post<ApiResponse<Broadcast>>(\n `/api/broadcasts/${id}/send-segment`,\n { conditions },\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, RichMenu, CreateRichMenuInput } from '../types.js'\n\nexport class RichMenusResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<RichMenu[]> {\n const res = await this.http.get<ApiResponse<RichMenu[]>>('/api/rich-menus')\n return res.data\n }\n\n async create(menu: CreateRichMenuInput): Promise<{ richMenuId: string }> {\n const res = await this.http.post<ApiResponse<{ richMenuId: string }>>('/api/rich-menus', menu)\n return res.data\n }\n\n async delete(richMenuId: string): Promise<void> {\n await this.http.delete(`/api/rich-menus/${encodeURIComponent(richMenuId)}`)\n }\n\n async setDefault(richMenuId: string): Promise<void> {\n await this.http.post(`/api/rich-menus/${encodeURIComponent(richMenuId)}/default`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, TrackedLink, TrackedLinkWithClicks, CreateTrackedLinkInput } from '../types.js'\n\nexport class TrackedLinksResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<TrackedLink[]> {\n const res = await this.http.get<ApiResponse<TrackedLink[]>>('/api/tracked-links')\n return res.data\n }\n\n async create(input: CreateTrackedLinkInput): Promise<TrackedLink> {\n const res = await this.http.post<ApiResponse<TrackedLink>>('/api/tracked-links', input)\n return res.data\n }\n\n async get(id: string): Promise<TrackedLinkWithClicks> {\n const res = await this.http.get<ApiResponse<TrackedLinkWithClicks>>(`/api/tracked-links/${id}`)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/tracked-links/${id}`)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n ApiResponse,\n Form,\n FormSubmission,\n CreateFormInput,\n UpdateFormInput,\n} from '../types.js'\n\nexport class FormsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<Form[]> {\n const res = await this.http.get<ApiResponse<Form[]>>('/api/forms')\n return res.data\n }\n\n async get(id: string): Promise<Form> {\n const res = await this.http.get<ApiResponse<Form>>(`/api/forms/${id}`)\n return res.data\n }\n\n async create(input: CreateFormInput): Promise<Form> {\n const res = await this.http.post<ApiResponse<Form>>('/api/forms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateFormInput): Promise<Form> {\n const res = await this.http.put<ApiResponse<Form>>(`/api/forms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/forms/${id}`)\n }\n\n async getSubmissions(formId: string): Promise<FormSubmission[]> {\n const res = await this.http.get<ApiResponse<FormSubmission[]>>(\n `/api/forms/${formId}/submissions`,\n )\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse } from '../types.js'\n\nexport interface AdPlatform {\n id: string\n name: string\n displayName: string | null\n config: Record<string, unknown>\n isActive: boolean\n createdAt: string\n updatedAt: string\n}\n\nexport interface AdConversionLog {\n id: string\n adPlatformId: string\n friendId: string\n eventName: string\n clickId: string | null\n clickIdType: string | null\n status: string\n errorMessage: string | null\n createdAt: string\n}\n\nexport interface CreateAdPlatformInput {\n name: 'meta' | 'x' | 'google' | 'tiktok'\n displayName?: string\n config: Record<string, unknown>\n}\n\nexport interface UpdateAdPlatformInput {\n name?: string\n displayName?: string | null\n config?: Record<string, unknown>\n isActive?: boolean\n}\n\nexport class AdPlatformsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<AdPlatform[]> {\n const res = await this.http.get<ApiResponse<AdPlatform[]>>('/api/ad-platforms')\n return res.data\n }\n\n async create(input: CreateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.post<ApiResponse<AdPlatform>>('/api/ad-platforms', input)\n return res.data\n }\n\n async update(id: string, input: UpdateAdPlatformInput): Promise<AdPlatform> {\n const res = await this.http.put<ApiResponse<AdPlatform>>(`/api/ad-platforms/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/ad-platforms/${id}`)\n }\n\n async getLogs(id: string, limit?: number): Promise<AdConversionLog[]> {\n const path = limit\n ? `/api/ad-platforms/${id}/logs?limit=${limit}`\n : `/api/ad-platforms/${id}/logs`\n const res = await this.http.get<ApiResponse<AdConversionLog[]>>(path)\n return res.data\n }\n\n async test(platform: string, eventName: string, friendId?: string): Promise<{ message: string }> {\n const res = await this.http.post<ApiResponse<{ message: string }>>('/api/ad-platforms/test', {\n platform,\n eventName,\n friendId,\n })\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, StaffMember, StaffProfile, CreateStaffInput, UpdateStaffInput } from '../types.js'\n\nexport class StaffResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(): Promise<StaffMember[]> {\n const res = await this.http.get<ApiResponse<StaffMember[]>>('/api/staff')\n return res.data\n }\n\n async get(id: string): Promise<StaffMember> {\n const res = await this.http.get<ApiResponse<StaffMember>>(`/api/staff/${id}`)\n return res.data\n }\n\n async me(): Promise<StaffProfile> {\n const res = await this.http.get<ApiResponse<StaffProfile>>('/api/staff/me')\n return res.data\n }\n\n async create(input: CreateStaffInput): Promise<StaffMember> {\n const res = await this.http.post<ApiResponse<StaffMember>>('/api/staff', input)\n return res.data\n }\n\n async update(id: string, input: UpdateStaffInput): Promise<StaffMember> {\n const res = await this.http.patch<ApiResponse<StaffMember>>(`/api/staff/${id}`, input)\n return res.data\n }\n\n async delete(id: string): Promise<void> {\n await this.http.delete(`/api/staff/${id}`)\n }\n\n async regenerateKey(id: string): Promise<{ apiKey: string }> {\n const res = await this.http.post<ApiResponse<{ apiKey: string }>>(`/api/staff/${id}/regenerate-key`)\n return res.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { ApiResponse, UploadedImage, UploadImageInput } from '../types.js'\n\nexport class ImagesResource {\n constructor(private readonly http: HttpClient) {}\n\n async upload(input: UploadImageInput): Promise<UploadedImage> {\n const res = await this.http.post<ApiResponse<UploadedImage>>('/api/images', input)\n return res.data\n }\n\n async delete(key: string): Promise<void> {\n await this.http.delete(`/api/images/${key}`)\n }\n}\n","const MULTIPLIERS: Record<string, number> = {\n m: 1,\n h: 60,\n d: 1440,\n w: 10080,\n}\n\nexport function parseDelay(input: string): number {\n const match = input.match(/^(\\d+)([mhdw])$/)\n if (!match) {\n throw new Error(`Invalid delay format: \"${input}\". Use format like \"30m\", \"1h\", \"1d\", \"1w\".`)\n }\n return Number(match[1]) * MULTIPLIERS[match[2]]\n}\n","import type { FriendsResource } from './resources/friends.js'\nimport type { ScenariosResource } from './resources/scenarios.js'\nimport type { BroadcastsResource } from './resources/broadcasts.js'\nimport type { StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\nimport { parseDelay } from './delay.js'\n\nexport class Workflows {\n constructor(\n private readonly friends: FriendsResource,\n private readonly scenarios: ScenariosResource,\n private readonly broadcasts: BroadcastsResource,\n ) {}\n\n async createStepScenario(\n name: string,\n triggerType: ScenarioTriggerType,\n steps: StepDefinition[],\n ): Promise<ScenarioWithSteps> {\n const scenario = await this.scenarios.create({ name, triggerType })\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i]\n await this.scenarios.addStep(scenario.id, {\n stepOrder: i + 1,\n delayMinutes: parseDelay(step.delay),\n messageType: step.type,\n messageContent: step.content,\n })\n }\n\n return this.scenarios.get(scenario.id)\n }\n\n async broadcastText(text: string): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: text.slice(0, 50),\n messageType: 'text',\n messageContent: text,\n targetType: 'all',\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToTag(\n tagId: string,\n messageType: MessageType,\n content: string,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'tag',\n targetTagId: tagId,\n })\n return this.broadcasts.send(broadcast.id)\n }\n\n async broadcastToSegment(\n messageType: MessageType,\n content: string,\n conditions: SegmentCondition,\n ): Promise<Broadcast> {\n const broadcast = await this.broadcasts.create({\n title: content.slice(0, 50),\n messageType,\n messageContent: content,\n targetType: 'all',\n })\n return this.broadcasts.sendToSegment(broadcast.id, conditions)\n }\n\n async sendTextToFriend(friendId: string, text: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, text, 'text')\n }\n\n async sendFlexToFriend(friendId: string, flexJson: string): Promise<{ messageId: string }> {\n return this.friends.sendMessage(friendId, flexJson, 'flex')\n }\n}\n","import { HttpClient } from './http.js'\nimport { FriendsResource } from './resources/friends.js'\nimport { TagsResource } from './resources/tags.js'\nimport { ScenariosResource } from './resources/scenarios.js'\nimport { BroadcastsResource } from './resources/broadcasts.js'\nimport { RichMenusResource } from './resources/rich-menus.js'\nimport { TrackedLinksResource } from './resources/tracked-links.js'\nimport { FormsResource } from './resources/forms.js'\nimport { AdPlatformsResource } from './resources/ad-platforms.js'\nimport { StaffResource } from './resources/staff.js'\nimport { ImagesResource } from './resources/images.js'\nimport { Workflows } from './workflows.js'\nimport type { LineHarnessConfig, StepDefinition, ScenarioTriggerType, ScenarioWithSteps, Broadcast, MessageType, SegmentCondition } from './types.js'\n\nexport class LineHarness {\n readonly friends: FriendsResource\n readonly tags: TagsResource\n readonly scenarios: ScenariosResource\n readonly broadcasts: BroadcastsResource\n readonly richMenus: RichMenusResource\n readonly trackedLinks: TrackedLinksResource\n readonly forms: FormsResource\n readonly adPlatforms: AdPlatformsResource\n readonly staff: StaffResource\n readonly images: ImagesResource\n\n private readonly apiUrl: string\n private readonly defaultAccountId: string | undefined\n private readonly workflows: Workflows\n\n readonly createStepScenario: (name: string, triggerType: ScenarioTriggerType, steps: StepDefinition[]) => Promise<ScenarioWithSteps>\n readonly broadcastText: (text: string) => Promise<Broadcast>\n readonly broadcastToTag: (tagId: string, messageType: MessageType, content: string) => Promise<Broadcast>\n readonly broadcastToSegment: (messageType: MessageType, content: string, conditions: SegmentCondition) => Promise<Broadcast>\n readonly sendTextToFriend: (friendId: string, text: string) => Promise<{ messageId: string }>\n readonly sendFlexToFriend: (friendId: string, flexJson: string) => Promise<{ messageId: string }>\n\n constructor(config: LineHarnessConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/$/, '')\n this.defaultAccountId = config.lineAccountId\n\n const http = new HttpClient({\n baseUrl: this.apiUrl,\n apiKey: config.apiKey,\n timeout: config.timeout ?? 30_000,\n })\n\n this.friends = new FriendsResource(http, this.defaultAccountId)\n this.tags = new TagsResource(http)\n this.scenarios = new ScenariosResource(http, this.defaultAccountId)\n this.broadcasts = new BroadcastsResource(http, this.defaultAccountId)\n this.richMenus = new RichMenusResource(http)\n this.trackedLinks = new TrackedLinksResource(http)\n this.forms = new FormsResource(http)\n this.adPlatforms = new AdPlatformsResource(http)\n this.staff = new StaffResource(http)\n this.images = new ImagesResource(http)\n this.workflows = new Workflows(this.friends, this.scenarios, this.broadcasts)\n\n this.createStepScenario = this.workflows.createStepScenario.bind(this.workflows)\n this.broadcastText = this.workflows.broadcastText.bind(this.workflows)\n this.broadcastToTag = this.workflows.broadcastToTag.bind(this.workflows)\n this.broadcastToSegment = this.workflows.broadcastToSegment.bind(this.workflows)\n this.sendTextToFriend = this.workflows.sendTextToFriend.bind(this.workflows)\n this.sendFlexToFriend = this.workflows.sendFlexToFriend.bind(this.workflows)\n }\n\n /**\n * Generate friend-add URL with OAuth (bot_prompt=aggressive)\n * This URL does friend-add + UUID in one step.\n *\n * @param ref - Attribution code (e.g., 'lp-a', 'instagram', 'seminar-0322')\n * @param redirect - URL to redirect after completion\n */\n getAuthUrl(options?: { ref?: string; redirect?: string }): string {\n const url = new URL(`${this.apiUrl}/auth/line`)\n if (options?.ref) url.searchParams.set('ref', options.ref)\n if (options?.redirect) url.searchParams.set('redirect', options.redirect)\n return url.toString()\n }\n}\n"],"mappings":";AAAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YACE,SACgB,QACA,UAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;;;ACDO,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,QAA0B;AACpC,SAAK,UAAU,OAAO,QAAQ,QAAQ,OAAO,E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E,SAAK,YAAY,IAAI,kBAAkB,IAAI;AAC3C,SAAK,eAAe,IAAI,qBAAqB,IAAI;AACjD,SAAK,QAAQ,IAAI,cAAc,IAAI;AACnC,SAAK,cAAc,IAAI,oBAAoB,IAAI;AAC/C,SAAK,QAAQ,IAAI,cAAc,IAAI;AACnC,SAAK,SAAS,IAAI,eAAe,IAAI;AACrC,SAAK,YAAY,IAAI,UAAU,KAAK,SAAS,KAAK,WAAW,KAAK,UAAU;AAE5E,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,gBAAgB,KAAK,UAAU,cAAc,KAAK,KAAK,SAAS;AACrE,SAAK,iBAAiB,KAAK,UAAU,eAAe,KAAK,KAAK,SAAS;AACvE,SAAK,qBAAqB,KAAK,UAAU,mBAAmB,KAAK,KAAK,SAAS;AAC/E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAC3E,SAAK,mBAAmB,KAAK,UAAU,iBAAiB,KAAK,KAAK,SAAS;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,SAAuD;AAChE,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,MAAM,YAAY;AAC9C,QAAI,SAAS,IAAK,KAAI,aAAa,IAAI,OAAO,QAAQ,GAAG;AACzD,QAAI,SAAS,SAAU,KAAI,aAAa,IAAI,YAAY,QAAQ,QAAQ;AACxE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@line-harness/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "AI-native SDK for LINE Harness — programmatic LINE official account automation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,7 +13,9 @@
13
13
  "main": "./dist/index.cjs",
14
14
  "module": "./dist/index.mjs",
15
15
  "types": "./dist/index.d.ts",
16
- "files": ["dist"],
16
+ "files": [
17
+ "dist"
18
+ ],
17
19
  "publishConfig": {
18
20
  "access": "public"
19
21
  },
@@ -23,7 +25,13 @@
23
25
  "test:watch": "vitest",
24
26
  "typecheck": "tsc --noEmit"
25
27
  },
26
- "keywords": ["line", "crm", "marketing-automation", "sdk", "ai"],
28
+ "keywords": [
29
+ "line",
30
+ "crm",
31
+ "marketing-automation",
32
+ "sdk",
33
+ "ai"
34
+ ],
27
35
  "license": "MIT",
28
36
  "devDependencies": {
29
37
  "tsup": "^8.0.0",