@crvouga/mockingbird-service-vibe 1.11.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/chunk-6XMERY63.js +325 -0
- package/dist/chunk-6XMERY63.js.map +7 -0
- package/dist/chunk-QOAFWR7M.js +36 -0
- package/dist/chunk-QOAFWR7M.js.map +7 -0
- package/dist/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +102 -94
- package/dist/index.js +1 -1
- package/dist/server.d.ts +147 -131
- package/dist/server.js +2 -2
- package/package.json +3 -2
- package/dist/chunk-EYDUWVHR.js +0 -5656
- package/dist/chunk-EYDUWVHR.js.map +0 -7
- package/dist/chunk-OFS3HC2V.js +0 -5083
- package/dist/chunk-OFS3HC2V.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-vibe
|
|
2
2
|
|
|
3
|
+
## 1.13.0 (2026-11-15)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- expand in-process emulation and resolve Plane and streaming gaps ([e6733fd](https://github.com/crvouga/mockingbird/commit/e6733fd00f5dd03259f36cc0f452780a7e0deea4))
|
|
8
|
+
- add browser runtime polyfills and edge-snapping app cycle ([815b739](https://github.com/crvouga/mockingbird/commit/815b7399f1e058b89b3fa025f79a5014172b3ab8))
|
|
9
|
+
- run lab systems in browser PR previews ([df14882](https://github.com/crvouga/mockingbird/commit/df148828ca66db1e20cf9fa2fdf38b56b5116da4))
|
|
10
|
+
- publish the shared runtime once; services depend on it instead of inlining it ([4903c4a](https://github.com/crvouga/mockingbird/commit/4903c4a748fd801001ad3fd34b6016b55e0f9953))
|
|
11
|
+
- add transcript storage, signature and meetings; tags, teams, messages, macros and calls ([ee21e12](https://github.com/crvouga/mockingbird/commit/ee21e12024768bd52c6902b1722fb35a94d2444b))
|
|
12
|
+
|
|
13
|
+
## 1.12.0 (2026-11-12)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- record delivered messages and show them in notifications ([b280c32](https://github.com/crvouga/mockingbird/commit/b280c32ec3e7f22f2c354747ab5193067290c26b))
|
|
18
|
+
|
|
3
19
|
## 1.11.1 (2026-11-12)
|
|
4
20
|
|
|
5
21
|
### Fixes and improvements
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// <define:__MOCKINGBIRD_ADMIN_BRAND__>
|
|
20
|
+
var define_MOCKINGBIRD_ADMIN_BRAND_default = { vendor: "Vibe", website: "https://www.vibe.co", docs: "https://developers.vibe.co/docs/getting-started", guide: "https://mockingbird.chrisvouga.dev/services/vibe", logo: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARn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NRV4E+1GJecZR0Dxwd/ASHvaZ5oisLxAAAAAElFTkSuQmCC", color: null, description: "Connected TV advertising and reporting." };
|
|
21
|
+
|
|
22
|
+
// mockingbird-service-runtime:@crvouga/mockingbird-runtime/service
|
|
23
|
+
var service_exports = {};
|
|
24
|
+
__export(service_exports, {
|
|
25
|
+
PACKAGE_VERSION: () => PACKAGE_VERSION,
|
|
26
|
+
createRuntime: () => createRuntime
|
|
27
|
+
});
|
|
28
|
+
__reExport(service_exports, service_star);
|
|
29
|
+
import * as service_star from "@crvouga/mockingbird-runtime/service";
|
|
30
|
+
import { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from "@crvouga/mockingbird-runtime/service";
|
|
31
|
+
var PACKAGE_VERSION = true ? "1.13.0" : SHARED_VERSION;
|
|
32
|
+
var ADMIN_BRAND = typeof define_MOCKINGBIRD_ADMIN_BRAND_default === "object" ? define_MOCKINGBIRD_ADMIN_BRAND_default : void 0;
|
|
33
|
+
var createRuntime = (options) => sharedRuntime({
|
|
34
|
+
...options,
|
|
35
|
+
version: options.version ?? PACKAGE_VERSION,
|
|
36
|
+
adminBrand: options.adminBrand ?? ADMIN_BRAND
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// src/generated/openapi.ts
|
|
40
|
+
var document = JSON.parse(`{"openapi":"3.1.0","paths":{"/reports":{"post":{"description":"Creates an asynchronous report and returns the report resource. Poll GET /reports/{report_id} until the report reaches a terminal state.\\n**Scopes:**\\n\`reporting:read\`\\n<br>*Rate limits*:<br>Burst: \`1/s\`<br>Steady: \`20/m\`\\n","operationId":"CreateReport","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"},"example":{"start_date":"2026-01-01","end_date":"2026-01-02","advertiser_ids":["00000000-0000-4000-8000-000000000001"],"dimensions":["impression_date","campaign_id"],"metrics":["spend"],"granularity":"DAY","format":"JSON"}}}},"responses":{"201":{"description":"Report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"401":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"403":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}}},"summary":"Create an async report","tags":["Reporting"],"x-rate-limit":{"rps":1,"rpm":20},"x-scopes":["reporting:read"],"x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}}}},"/reports/{report_id}":{"get":{"operationId":"GetReport","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"401":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"403":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"404":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}}},"x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}}}},"/oauth2/token":{"post":{"operationId":"OAuthToken","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"scope":{"type":"string","maxLength":100}}}}}},"responses":{"200":{"description":"Token","content":{"application/json":{"schema":{"type":"object","required":["access_token","token_type","expires_in"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"scope":{"type":"string"}}}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}},"x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}}}},"/__admin/blobs/{id}":{"x-mockingbird-internal":true,"get":{"operationId":"DownloadReport","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Synthetic JSON rows","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"403":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}},"404":{"description":"Vibe resource error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message","status","request_id"],"properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"request_id":{"type":"string"}}}}}}}}},"x-mockingbird":{"supported":true,"parity":{"enabled":false,"reason":"Emulator-only capability URL; exercised by acceptance tests."}}}}},"info":{"title":"Vibe Public API","description":"Vibe Public API revision 2026-06-01","version":"2026-06-01","contact":{},"x-mockingbird-upstream":{"url":"https://developers.vibe.co/reference/createreport-1"}},"tags":[{"name":"Reporting","description":"Aggregated delivery, spend, and outcome metrics, plus the purchase events attributed to Vibe campaigns.\\n\\nReports run asynchronously: create a report, poll it until its status is \`READY\`, then download it from the signed \`download_url\`, which is valid for 24 hours. Purchase events are pulled directly and are useful for reconciling Vibe reporting against e-commerce backends.\\n\\nDate windows are limited to the last 45 days. Reports typically complete within a few minutes \u2014 **do not poll more than once every 10 seconds**."}],"servers":[{"url":"https://api.vibe.co","description":"Production API"}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"ReportFilter":{"type":"object","properties":{"dimension":{"type":"string","description":"Dimension to filter on","enum":["event_source_id","campaign_id","strategy_id"]},"values":{"minItems":1,"description":"Values to include","type":"array","items":{"type":"string"}}},"required":["dimension"]},"ReportCreate":{"type":"object","properties":{"start_date":{"type":"string","description":"Minimum date (inclusive) for which to return data","format":"date"},"end_date":{"type":"string","description":"Maximum date (exclusive) for which to return data","format":"date"},"timezone":{"type":"string","description":"Timezone identifier for reported data","enum":["UTC","Europe/Amsterdam","Europe/Berlin","Europe/Helsinki","Europe/Istanbul","Europe/London","Europe/Stockholm","Asia/Seoul","Asia/Shanghai","Asia/Tel_Aviv","America/Denver","America/Los_Angeles","America/New_York","America/Phoenix"],"default":"UTC"},"advertiser_ids":{"minItems":1,"description":"Advertisers to include. Must be owned by the tenant.","type":"array","items":{"type":"string","format":"uuid"}},"dimensions":{"type":"array","description":"Dimensions to group rows by","items":{"type":"string","enum":["impression_date","advertiser_id","advertiser_name","campaign_id","campaign_name","strategy_id","strategy_name","creative_id","creative_name","event_source_id","event_source_platform","purchase_id","screen","channel_name","content_name","geo_region","geo_metro","geo_city","geo_zip","segment_ages","segment_career","segment_educations","segment_estimated_incomes","segment_estimated_net_worth","segment_ethnicity","segment_family_composition","segment_genders","segment_interests","segment_languages","segment_political_status","segment_retargeting","custom_audiences"]}},"metrics":{"type":"array","minItems":1,"description":"Metrics to compute","items":{"type":"string","enum":["spend","impressions","households","frequency","cpm","completed_views","cost_per_completed_view","view_through_rate","number_of_page_views","cost_per_page_view","number_of_sessions","cost_per_session","number_of_leads","cost_per_lead","installs","cost_per_install","number_of_purchases","cost_per_purchase","amount_of_purchases","number_of_signups","cost_per_signup","number_of_custom_1","cost_per_custom_1","number_of_custom_2","cost_per_custom_2","number_of_custom_3","cost_per_custom_3","roas"]}},"attribution_window":{"type":"string","enum":["1h","6h","12h","24h","48h","72h","7 days","30 days"],"default":"7 days"},"granularity":{"type":"string","default":"DAY","description":"Time aggregation granularity for rows in the report","enum":["HOUR","DAY","WEEK","MONTH"]},"filters":{"description":"Optional filters, combined with AND","type":"array","items":{"$ref":"#/components/schemas/ReportFilter"}},"format":{"type":"string","enum":["JSON","CSV"],"default":"JSON"}},"required":["start_date","end_date","advertiser_ids","metrics"]},"ReportFailureReason":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable error code"},"message":{"type":"string","description":"Human-readable explanation"},"details":{"type":"object","nullable":true,"description":"Additional context specific to the failure code"}},"required":["code","message"]},"Report":{"type":"object","properties":{"id":{"type":"string","description":"Stable identifier of the report","format":"uuid"},"status":{"type":"string","enum":["CREATED","PROCESSING","READY","FAILED"]},"download_url":{"type":["string","null"],"format":"uri","description":"Pre-signed URL to download the report. Populated only when status is READY."},"generated_url_time":{"type":["string","null"],"format":"date-time"},"url_expiration_time":{"type":["string","null"],"format":"date-time"},"failure_reason":{"oneOf":[{"$ref":"#/components/schemas/ReportFailureReason"},{"type":"null"}]},"created_at":{"type":"string","description":"Time at which the report was created","format":"date-time"},"completed_at":{"type":["string","null"],"description":"Time at which the report reached a terminal state","format":"date-time"}},"required":["id","status","created_at"]}}},"security":[{"bearer":[]}]}`);
|
|
41
|
+
var operationIds = ["CreateReport", "GetReport", "OAuthToken", "DownloadReport"];
|
|
42
|
+
var supportedOperationIds = ["CreateReport", "GetReport", "OAuthToken", "DownloadReport"];
|
|
43
|
+
|
|
44
|
+
// src/runtime.ts
|
|
45
|
+
var envelope = (status, type) => ({
|
|
46
|
+
error: {
|
|
47
|
+
type,
|
|
48
|
+
status,
|
|
49
|
+
message: "Scripted failure",
|
|
50
|
+
request_id: "mock_request",
|
|
51
|
+
detail: null,
|
|
52
|
+
doc_url: null
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var VIBE_PRESETS = {
|
|
56
|
+
rate_limited: {
|
|
57
|
+
description: "Scripted quota failure",
|
|
58
|
+
rules: [
|
|
59
|
+
{
|
|
60
|
+
operationId: "CreateReport",
|
|
61
|
+
status: 429,
|
|
62
|
+
body: envelope(429, "rate_limit_exceeded"),
|
|
63
|
+
headers: { "retry-after": "1" }
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
server_error: {
|
|
68
|
+
description: "Transient report error",
|
|
69
|
+
rules: [{ operationId: "CreateReport", status: 500, body: envelope(500, "internal_error") }]
|
|
70
|
+
},
|
|
71
|
+
connection_drop: { description: "Dropped connection", rules: [{ drop: true }] },
|
|
72
|
+
report_failed: {
|
|
73
|
+
description: "Report reaches FAILED",
|
|
74
|
+
rules: [{ operationId: "CreateReport", effect: "failed" }]
|
|
75
|
+
},
|
|
76
|
+
report_stuck: {
|
|
77
|
+
description: "Report remains PROCESSING",
|
|
78
|
+
rules: [{ operationId: "CreateReport", effect: "stuck" }]
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var createRuntime2 = (options = {}) => createRuntime({
|
|
82
|
+
name: VIBE_NAMESPACE,
|
|
83
|
+
document,
|
|
84
|
+
presets: VIBE_PRESETS,
|
|
85
|
+
credential: service_exports.bearerToken,
|
|
86
|
+
...options.sqlite ? { sqlite: options.sqlite } : {},
|
|
87
|
+
...options.clock ? { clock: options.clock } : {},
|
|
88
|
+
...options.seed !== void 0 ? { seed: options.seed } : {},
|
|
89
|
+
...options.adminPrefix ? { adminPrefix: options.adminPrefix } : {},
|
|
90
|
+
...options.adminKey ? { adminKey: options.adminKey } : {},
|
|
91
|
+
...options.adminControls !== void 0 ? { adminControls: options.adminControls } : {},
|
|
92
|
+
...options.onLog ? { onLog: options.onLog } : {},
|
|
93
|
+
create: ({ sqlite, namespace, clock, publicNamespace, adminPrefix }) => new VibeAPI({ ...options, sqlite, namespace, publicNamespace, adminPrefix, now: clock.now })
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// src/index.ts
|
|
97
|
+
var VIBE_NAMESPACE = "vibe";
|
|
98
|
+
var DEFAULT_ADVERTISER = "00000000-0000-4000-8000-000000000001";
|
|
99
|
+
var defaultClient = {
|
|
100
|
+
id: "mock_client",
|
|
101
|
+
secret: "mock_client_secret",
|
|
102
|
+
scopes: ["advertisers:read", "reporting:read"],
|
|
103
|
+
advertiserIds: [DEFAULT_ADVERTISER]
|
|
104
|
+
};
|
|
105
|
+
var record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
106
|
+
var failure = (status, type, message) => {
|
|
107
|
+
if (status === 401) {
|
|
108
|
+
const response = (0, service_exports.jsonRes)(401, {
|
|
109
|
+
error: {
|
|
110
|
+
type: "token_invalid",
|
|
111
|
+
message: "Authentication required.",
|
|
112
|
+
status: 401,
|
|
113
|
+
request_id: "mock_request"
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
response.headers.set("www-authenticate", "Bearer");
|
|
117
|
+
return response;
|
|
118
|
+
}
|
|
119
|
+
return (0, service_exports.jsonRes)(status, {
|
|
120
|
+
error: { type, message, status, detail: null, request_id: "mock_request", doc_url: null }
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var VibeAPI = class {
|
|
124
|
+
app;
|
|
125
|
+
clients;
|
|
126
|
+
tokens;
|
|
127
|
+
rows;
|
|
128
|
+
reports;
|
|
129
|
+
settings;
|
|
130
|
+
initialized;
|
|
131
|
+
ids;
|
|
132
|
+
service;
|
|
133
|
+
now;
|
|
134
|
+
seeds;
|
|
135
|
+
basePath;
|
|
136
|
+
prefix;
|
|
137
|
+
namespace;
|
|
138
|
+
constructor(options = {}) {
|
|
139
|
+
const sqlite = (0, service_exports.bootSqlite)(options.sqlite), namespace = options.namespace ?? VIBE_NAMESPACE;
|
|
140
|
+
this.namespace = namespace;
|
|
141
|
+
this.now = options.now ?? Date.now;
|
|
142
|
+
this.prefix = options.adminPrefix ?? "/__admin";
|
|
143
|
+
this.basePath = !options.publicNamespace || options.publicNamespace === "default" ? "" : `${this.prefix}/ns/${encodeURIComponent(options.publicNamespace)}`;
|
|
144
|
+
this.clients = new service_exports.Collection(sqlite, namespace, "clients");
|
|
145
|
+
this.tokens = new service_exports.Collection(sqlite, namespace, "tokens");
|
|
146
|
+
this.rows = new service_exports.Collection(sqlite, namespace, "rows");
|
|
147
|
+
this.reports = new service_exports.Collection(sqlite, namespace, "reports");
|
|
148
|
+
this.settings = new service_exports.Collection(sqlite, namespace, "settings");
|
|
149
|
+
this.initialized = new service_exports.Collection(sqlite, namespace, "initialized");
|
|
150
|
+
this.ids = new service_exports.IdSequence(sqlite, namespace);
|
|
151
|
+
this.seeds = structuredClone({
|
|
152
|
+
clients: options.clients ?? [defaultClient],
|
|
153
|
+
rows: options.rows ?? [],
|
|
154
|
+
settings: { processingMs: 1e3, readyMs: 2e3, tokenTtlSeconds: 3600, ...options.settings }
|
|
155
|
+
});
|
|
156
|
+
this.seed();
|
|
157
|
+
this.service = (0, service_exports.createService)({
|
|
158
|
+
sqlite,
|
|
159
|
+
namespace,
|
|
160
|
+
document,
|
|
161
|
+
now: this.now,
|
|
162
|
+
notFound: () => failure(404, "not_found", "Report not found"),
|
|
163
|
+
onError: (error) => {
|
|
164
|
+
throw error;
|
|
165
|
+
},
|
|
166
|
+
before: (context) => {
|
|
167
|
+
if (["OAuthToken", "DownloadReport"].includes(context.operation.operationId))
|
|
168
|
+
return void 0;
|
|
169
|
+
const token = this.tokens.get((0, service_exports.bearerToken)(context.request) ?? "");
|
|
170
|
+
if (!token || token.expiresAt <= this.now())
|
|
171
|
+
return failure(401, "invalid_token", "Unauthorized");
|
|
172
|
+
if (context.request.headers.get("x-vibe-revision") !== "2026-06-01")
|
|
173
|
+
return failure(400, "unknown_revision", "Unknown or missing revision");
|
|
174
|
+
if (!token.scopes.includes("reporting:read"))
|
|
175
|
+
return failure(403, "insufficient_scope", "Missing required scope");
|
|
176
|
+
return void 0;
|
|
177
|
+
},
|
|
178
|
+
handlers: (0, service_exports.defineOperations)({
|
|
179
|
+
OAuthToken: (context) => this.exchange(context),
|
|
180
|
+
CreateReport: (context) => this.create(context),
|
|
181
|
+
GetReport: (context) => this.get(context),
|
|
182
|
+
DownloadReport: (context) => this.download(context)
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
this.app = this.service.app;
|
|
186
|
+
}
|
|
187
|
+
seed() {
|
|
188
|
+
if (this.initialized.has("seed")) return;
|
|
189
|
+
for (const client2 of this.seeds.clients) this.clients.insert(client2.id, client2);
|
|
190
|
+
for (const [i, row] of this.seeds.rows.entries()) this.rows.insert(String(i), row);
|
|
191
|
+
this.settings.insert("default", this.seeds.settings);
|
|
192
|
+
const client = this.clients.get("mock_client");
|
|
193
|
+
if (client)
|
|
194
|
+
this.tokens.insert("mock_vibe_token", {
|
|
195
|
+
clientId: client.id,
|
|
196
|
+
scopes: client.scopes,
|
|
197
|
+
expiresAt: this.now() + this.seeds.settings.tokenTtlSeconds * 1e3
|
|
198
|
+
});
|
|
199
|
+
this.initialized.insert("seed", { value: true });
|
|
200
|
+
}
|
|
201
|
+
fetch(request) {
|
|
202
|
+
return this.service.fetch(request);
|
|
203
|
+
}
|
|
204
|
+
async reset() {
|
|
205
|
+
await this.service.reset();
|
|
206
|
+
this.seed();
|
|
207
|
+
}
|
|
208
|
+
exchange(context) {
|
|
209
|
+
const auth = (0, service_exports.basicAuth)(context.request);
|
|
210
|
+
let client;
|
|
211
|
+
try {
|
|
212
|
+
client = this.clients.get(decodeURIComponent(auth?.username ?? ""));
|
|
213
|
+
} catch {
|
|
214
|
+
return (0, service_exports.jsonRes)(401, { error: "invalid_client" });
|
|
215
|
+
}
|
|
216
|
+
let password;
|
|
217
|
+
try {
|
|
218
|
+
password = decodeURIComponent(auth?.password ?? "");
|
|
219
|
+
} catch {
|
|
220
|
+
return (0, service_exports.jsonRes)(401, { error: "invalid_client" });
|
|
221
|
+
}
|
|
222
|
+
if (!client || client.secret !== password) return (0, service_exports.jsonRes)(401, { error: "invalid_client" });
|
|
223
|
+
if ((0, service_exports.bodyIssues)(context).length || context.body.kind !== "form")
|
|
224
|
+
return (0, service_exports.jsonRes)(400, { error: "invalid_request" });
|
|
225
|
+
const form = context.body.value;
|
|
226
|
+
if (form.grant_type !== "client_credentials")
|
|
227
|
+
return (0, service_exports.jsonRes)(400, { error: "unsupported_grant_type" });
|
|
228
|
+
const scope = form.scope, scopes = typeof scope === "string" ? scope.split(/\s+/).filter(Boolean) : client.scopes;
|
|
229
|
+
if (scopes.some((value) => !client.scopes.includes(value)))
|
|
230
|
+
return (0, service_exports.jsonRes)(400, { error: "invalid_scope" });
|
|
231
|
+
const token = this.ids.next("mock_vibe_", 24), expires = this.settings.get("default")?.tokenTtlSeconds ?? 3600;
|
|
232
|
+
this.tokens.insert(token, {
|
|
233
|
+
clientId: client.id,
|
|
234
|
+
scopes,
|
|
235
|
+
expiresAt: this.now() + expires * 1e3
|
|
236
|
+
});
|
|
237
|
+
return (0, service_exports.jsonRes)(200, {
|
|
238
|
+
access_token: token,
|
|
239
|
+
token_type: "Bearer",
|
|
240
|
+
expires_in: expires,
|
|
241
|
+
scope: scopes.join(" ")
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
create(context) {
|
|
245
|
+
if ((0, service_exports.bodyIssues)(context).length || context.body.kind !== "json" || !record(context.body.value))
|
|
246
|
+
return failure(400, "validation", "Invalid report request");
|
|
247
|
+
const body = context.body.value, token = this.tokens.get((0, service_exports.bearerToken)(context.request) ?? ""), client = this.clients.get(token?.clientId ?? "");
|
|
248
|
+
if (!client) return failure(401, "invalid_token", "Unauthorized");
|
|
249
|
+
const start = String(body.start_date), end = String(body.end_date), duration = Date.parse(end) - Date.parse(start);
|
|
250
|
+
if (!Number.isFinite(duration) || duration <= 0 || duration > 45 * 864e5)
|
|
251
|
+
return failure(400, "validation", "Report window must be positive and at most 45 days");
|
|
252
|
+
const advertisers = body.advertiser_ids;
|
|
253
|
+
if (advertisers.some((id2) => !client.advertiserIds.includes(id2)))
|
|
254
|
+
return failure(403, "insufficient_scope", "Advertiser not accessible");
|
|
255
|
+
if (body.format && body.format !== "JSON" || body.granularity && body.granularity !== "DAY")
|
|
256
|
+
return failure(400, "validation", "This mock supports JSON/DAY fixtures only");
|
|
257
|
+
const columns = [
|
|
258
|
+
...Array.isArray(body.dimensions) ? body.dimensions : [],
|
|
259
|
+
...body.metrics
|
|
260
|
+
];
|
|
261
|
+
const rows = this.rows.list({ order: "oldest" }).map(({ value }) => value).filter(
|
|
262
|
+
(row) => advertisers.includes(row.advertiser_id) && row.impression_date >= start && row.impression_date < end
|
|
263
|
+
).map((row) => Object.fromEntries(columns.map((column) => [column, row[column] ?? null])));
|
|
264
|
+
const raw = Array.from(
|
|
265
|
+
this.ids.next("", 32),
|
|
266
|
+
(char) => (char.charCodeAt(0) % 16).toString(16)
|
|
267
|
+
).join(""), id = `${raw.slice(0, 8)}-${raw.slice(8, 12)}-4${raw.slice(13, 16)}-8${raw.slice(17, 20)}-${raw.slice(20)}`;
|
|
268
|
+
const now = this.now(), settings = this.settings.get("default") ?? this.seeds.settings;
|
|
269
|
+
const report = {
|
|
270
|
+
id,
|
|
271
|
+
clientId: client.id,
|
|
272
|
+
createdAt: now,
|
|
273
|
+
processingAt: now + settings.processingMs,
|
|
274
|
+
readyAt: (0, service_exports.faultEffect)(context.request, "stuck") ? null : now + settings.readyMs,
|
|
275
|
+
failure: (0, service_exports.faultEffect)(context.request, "failed") ? { code: "mock_report_failed", message: "Scripted report failure" } : null,
|
|
276
|
+
rows,
|
|
277
|
+
downloadToken: (0, service_exports.opaqueToken)(`${this.namespace}:${id}:${now}`, 24),
|
|
278
|
+
missingArtifact: false
|
|
279
|
+
};
|
|
280
|
+
this.reports.insert(id, report);
|
|
281
|
+
const response = (0, service_exports.jsonRes)(201, this.view(context, report));
|
|
282
|
+
(0, service_exports.annotateResponse)(response, { ids: { reportId: id } });
|
|
283
|
+
return response;
|
|
284
|
+
}
|
|
285
|
+
view(context, report) {
|
|
286
|
+
const terminal = report.readyAt !== null && this.now() >= report.readyAt;
|
|
287
|
+
const status = terminal ? report.failure ? "FAILED" : "READY" : this.now() >= report.processingAt ? "PROCESSING" : "CREATED";
|
|
288
|
+
const ready = status === "READY", completed = terminal ? new Date(report.readyAt ?? 0).toISOString() : null;
|
|
289
|
+
return {
|
|
290
|
+
id: report.id,
|
|
291
|
+
status,
|
|
292
|
+
created_at: new Date(report.createdAt).toISOString(),
|
|
293
|
+
completed_at: completed,
|
|
294
|
+
failure_reason: status === "FAILED" ? report.failure : null,
|
|
295
|
+
download_url: ready ? `${context.url.origin}${this.basePath}${this.prefix}/blobs/${report.id}?token=${encodeURIComponent(report.downloadToken)}` : null,
|
|
296
|
+
generated_url_time: ready ? completed : null,
|
|
297
|
+
url_expiration_time: ready ? new Date((report.readyAt ?? 0) + 864e5).toISOString() : null
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
get(context) {
|
|
301
|
+
const report = this.reports.get(context.params.report_id ?? ""), token = this.tokens.get((0, service_exports.bearerToken)(context.request) ?? "");
|
|
302
|
+
if (!report || report.clientId !== token?.clientId)
|
|
303
|
+
return failure(404, "not_found", "Report not found");
|
|
304
|
+
return (0, service_exports.jsonRes)(200, this.view(context, report));
|
|
305
|
+
}
|
|
306
|
+
download(context) {
|
|
307
|
+
const report = this.reports.get(context.params.id ?? "");
|
|
308
|
+
if (!report || report.missingArtifact) return failure(404, "not_found", "Artifact not found");
|
|
309
|
+
if (report.readyAt === null || this.now() < report.readyAt || report.failure || this.now() >= report.readyAt + 864e5 || context.url.searchParams.get("token") !== report.downloadToken)
|
|
310
|
+
return failure(403, "invalid_token", "Artifact capability unavailable or expired");
|
|
311
|
+
return (0, service_exports.jsonRes)(200, report.rows);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
export {
|
|
316
|
+
document,
|
|
317
|
+
operationIds,
|
|
318
|
+
supportedOperationIds,
|
|
319
|
+
VIBE_PRESETS,
|
|
320
|
+
createRuntime2 as createRuntime,
|
|
321
|
+
VIBE_NAMESPACE,
|
|
322
|
+
DEFAULT_ADVERTISER,
|
|
323
|
+
VibeAPI
|
|
324
|
+
};
|
|
325
|
+
//# sourceMappingURL=chunk-6XMERY63.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["<define:__MOCKINGBIRD_ADMIN_BRAND__>", "mockingbird-service-runtime:@crvouga/mockingbird-runtime/service", "../src/generated/openapi.ts", "../src/runtime.ts", "../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["{\"vendor\":\"Vibe\",\"website\":\"https://www.vibe.co\",\"docs\":\"https://developers.vibe.co/docs/getting-started\",\"guide\":\"https://mockingbird.chrisvouga.dev/services/vibe\",\"logo\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMiSURBVHgBxZdPSBRRHMd/b3bdsrU0My2wwDxoEBVBCHaxIPEiqR0S+qMgRHUIoj8QCOuC0MEi8FASSGod7JJLS2C7sBhE0C1lr9EhxewPbrmz6a7O6/3eNuPM7Jtpd3GdDyzLm/fe/P58f+/PEPhHW8t8E6XUB5QeZc0yKBSETBFFGQ2Eq0d4kxtvnvdRUPpgE6Eg9b0K7fWTttOz3ZSQp+AARFJOSiBJXeAQlLp8EtO9CZyC1ZsEzlLmtuv1eiVo7fBCzYEiqKxygSxTiIQSEAknMsYeOuyBzos7oKbWzefJsgIf3i/D+LMl+LawZmmDnGmeo6KOmtoiuOsr54bN4At7b//QXtxzpRRa271gxfjzJe6ICKEEaNTKuNrfP1DBI+28sN3WOGI3xlVfe7PP/LDnailL6RatHZ1J8tRX7nGBtyTtM/7vLGcStZdo4zDtL1/EIRiQIbaoQPV+N3g8fKuBunoPvHmdgFTKmHChBE/GqrToo9Mr0Hvnp9bXP7DL4Jyey5cWDHpjXWCmVIaHfkFwQjbMsZRAH72ewfsxHqkZLDhzseHc6MyK1sZiNiN0wBDFEU9G3/hYPGOOHFdADAE7hA5gNJoDLN3mAgoG4obIkIbGrbwo9WAmUQbQOZ+VA7hs9GnGKjavCLMUWJQPH+/mBlXDev0R0f4hXAWpJIUUC/DY8XSxYSXjvhAJ/9HG4KakH6M6cap5G18Z+K+uGCQ4EYd3b5chqwzwCSzN+UghAiMfHvot7LM9CwYfxHKWQs/nTynejz8rbB3AytZPxpRev2W8LIlWBab7fMdXuHHtu1D3rB1AUIZcpWhoLLbMSs4OINlIEQmtF6jVGZK3A9lIgaskH4TLUMTcl1VuuO5gemOprHJzox7WbDhRDGfPrR9K/PD6j/YqlvcBEXyzeVTBjdthPpTsyOlKhlLc8y+yl69ajsETL1vjSE4ZUMEiw0LEgwqzgQUanU7y5Wc+PQviwEaCEsTAQSRCyEdwCvadKAFZ84NDEKKMSoHJfVMElE13gn0M+wOT1SPafamtZbYbqNRV4E+1GJecZR0Dxwd/ASHvaZ5oisLxAAAAAElFTkSuQmCC\",\"color\":null,\"description\":\"Connected TV advertising and reporting.\"}", "export * from \"@crvouga/mockingbird-runtime/service\"\nimport { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from \"@crvouga/mockingbird-runtime/service\"\nexport const PACKAGE_VERSION =\n typeof __MOCKINGBIRD_PACKAGE_VERSION__ === \"string\" ? __MOCKINGBIRD_PACKAGE_VERSION__ : SHARED_VERSION\nconst ADMIN_BRAND =\n typeof __MOCKINGBIRD_ADMIN_BRAND__ === \"object\" ? __MOCKINGBIRD_ADMIN_BRAND__ : undefined\nexport const createRuntime = (options) =>\n sharedRuntime({\n ...options,\n version: options.version ?? PACKAGE_VERSION,\n adminBrand: options.adminBrand ?? ADMIN_BRAND,\n })\n", "// Generated by @crvouga/mockingbird-openapi-codegen from openapi.yaml. Do not edit.\n\nimport type { OpenAPIDocument } from \"@crvouga/mockingbird-openapi\"\n\nexport const document: OpenAPIDocument = JSON.parse(`{\"openapi\":\"3.1.0\",\"paths\":{\"/reports\":{\"post\":{\"description\":\"Creates an asynchronous report and returns the report resource. Poll GET /reports/{report_id} until the report reaches a terminal state.\\\\n**Scopes:**\\\\n\\`reporting:read\\`\\\\n<br>*Rate limits*:<br>Burst: \\`1/s\\`<br>Steady: \\`20/m\\`\\\\n\",\"operationId\":\"CreateReport\",\"parameters\":[],\"requestBody\":{\"required\":true,\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ReportCreate\"},\"example\":{\"start_date\":\"2026-01-01\",\"end_date\":\"2026-01-02\",\"advertiser_ids\":[\"00000000-0000-4000-8000-000000000001\"],\"dimensions\":[\"impression_date\",\"campaign_id\"],\"metrics\":[\"spend\"],\"granularity\":\"DAY\",\"format\":\"JSON\"}}}},\"responses\":{\"201\":{\"description\":\"Report\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Report\"}}}},\"400\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"401\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"403\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}}},\"summary\":\"Create an async report\",\"tags\":[\"Reporting\"],\"x-rate-limit\":{\"rps\":1,\"rpm\":20},\"x-scopes\":[\"reporting:read\"],\"x-mockingbird\":{\"supported\":true,\"parity\":{\"enabled\":true,\"safe\":false}}}},\"/reports/{report_id}\":{\"get\":{\"operationId\":\"GetReport\",\"parameters\":[{\"name\":\"report_id\",\"in\":\"path\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"description\":\"Report\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Report\"}}}},\"400\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"401\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"403\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"404\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}}},\"x-mockingbird\":{\"supported\":true,\"parity\":{\"enabled\":true,\"safe\":true}}}},\"/oauth2/token\":{\"post\":{\"operationId\":\"OAuthToken\",\"requestBody\":{\"required\":true,\"content\":{\"application/x-www-form-urlencoded\":{\"schema\":{\"type\":\"object\",\"required\":[\"grant_type\"],\"properties\":{\"grant_type\":{\"type\":\"string\",\"enum\":[\"client_credentials\"]},\"scope\":{\"type\":\"string\",\"maxLength\":100}}}}}},\"responses\":{\"200\":{\"description\":\"Token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"access_token\",\"token_type\",\"expires_in\"],\"properties\":{\"access_token\":{\"type\":\"string\"},\"token_type\":{\"type\":\"string\"},\"expires_in\":{\"type\":\"integer\"},\"scope\":{\"type\":\"string\"}}}}}},\"400\":{\"description\":\"OAuth error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"string\"}}}}}},\"401\":{\"description\":\"OAuth error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"string\"}}}}}}},\"x-mockingbird\":{\"supported\":true,\"parity\":{\"enabled\":true,\"safe\":false}}}},\"/__admin/blobs/{id}\":{\"x-mockingbird-internal\":true,\"get\":{\"operationId\":\"DownloadReport\",\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"token\",\"in\":\"query\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"description\":\"Synthetic JSON rows\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"array\",\"items\":{\"type\":\"object\"}}}}},\"403\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}},\"404\":{\"description\":\"Vibe resource error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"required\":[\"error\"],\"properties\":{\"error\":{\"type\":\"object\",\"required\":[\"type\",\"message\",\"status\",\"request_id\"],\"properties\":{\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"request_id\":{\"type\":\"string\"}}}}}}}}},\"x-mockingbird\":{\"supported\":true,\"parity\":{\"enabled\":false,\"reason\":\"Emulator-only capability URL; exercised by acceptance tests.\"}}}}},\"info\":{\"title\":\"Vibe Public API\",\"description\":\"Vibe Public API revision 2026-06-01\",\"version\":\"2026-06-01\",\"contact\":{},\"x-mockingbird-upstream\":{\"url\":\"https://developers.vibe.co/reference/createreport-1\"}},\"tags\":[{\"name\":\"Reporting\",\"description\":\"Aggregated delivery, spend, and outcome metrics, plus the purchase events attributed to Vibe campaigns.\\\\n\\\\nReports run asynchronously: create a report, poll it until its status is \\`READY\\`, then download it from the signed \\`download_url\\`, which is valid for 24 hours. Purchase events are pulled directly and are useful for reconciling Vibe reporting against e-commerce backends.\\\\n\\\\nDate windows are limited to the last 45 days. Reports typically complete within a few minutes \u2014 **do not poll more than once every 10 seconds**.\"}],\"servers\":[{\"url\":\"https://api.vibe.co\",\"description\":\"Production API\"}],\"components\":{\"securitySchemes\":{\"bearer\":{\"scheme\":\"bearer\",\"bearerFormat\":\"JWT\",\"type\":\"http\"}},\"schemas\":{\"ReportFilter\":{\"type\":\"object\",\"properties\":{\"dimension\":{\"type\":\"string\",\"description\":\"Dimension to filter on\",\"enum\":[\"event_source_id\",\"campaign_id\",\"strategy_id\"]},\"values\":{\"minItems\":1,\"description\":\"Values to include\",\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"dimension\"]},\"ReportCreate\":{\"type\":\"object\",\"properties\":{\"start_date\":{\"type\":\"string\",\"description\":\"Minimum date (inclusive) for which to return data\",\"format\":\"date\"},\"end_date\":{\"type\":\"string\",\"description\":\"Maximum date (exclusive) for which to return data\",\"format\":\"date\"},\"timezone\":{\"type\":\"string\",\"description\":\"Timezone identifier for reported data\",\"enum\":[\"UTC\",\"Europe/Amsterdam\",\"Europe/Berlin\",\"Europe/Helsinki\",\"Europe/Istanbul\",\"Europe/London\",\"Europe/Stockholm\",\"Asia/Seoul\",\"Asia/Shanghai\",\"Asia/Tel_Aviv\",\"America/Denver\",\"America/Los_Angeles\",\"America/New_York\",\"America/Phoenix\"],\"default\":\"UTC\"},\"advertiser_ids\":{\"minItems\":1,\"description\":\"Advertisers to include. Must be owned by the tenant.\",\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"uuid\"}},\"dimensions\":{\"type\":\"array\",\"description\":\"Dimensions to group rows by\",\"items\":{\"type\":\"string\",\"enum\":[\"impression_date\",\"advertiser_id\",\"advertiser_name\",\"campaign_id\",\"campaign_name\",\"strategy_id\",\"strategy_name\",\"creative_id\",\"creative_name\",\"event_source_id\",\"event_source_platform\",\"purchase_id\",\"screen\",\"channel_name\",\"content_name\",\"geo_region\",\"geo_metro\",\"geo_city\",\"geo_zip\",\"segment_ages\",\"segment_career\",\"segment_educations\",\"segment_estimated_incomes\",\"segment_estimated_net_worth\",\"segment_ethnicity\",\"segment_family_composition\",\"segment_genders\",\"segment_interests\",\"segment_languages\",\"segment_political_status\",\"segment_retargeting\",\"custom_audiences\"]}},\"metrics\":{\"type\":\"array\",\"minItems\":1,\"description\":\"Metrics to compute\",\"items\":{\"type\":\"string\",\"enum\":[\"spend\",\"impressions\",\"households\",\"frequency\",\"cpm\",\"completed_views\",\"cost_per_completed_view\",\"view_through_rate\",\"number_of_page_views\",\"cost_per_page_view\",\"number_of_sessions\",\"cost_per_session\",\"number_of_leads\",\"cost_per_lead\",\"installs\",\"cost_per_install\",\"number_of_purchases\",\"cost_per_purchase\",\"amount_of_purchases\",\"number_of_signups\",\"cost_per_signup\",\"number_of_custom_1\",\"cost_per_custom_1\",\"number_of_custom_2\",\"cost_per_custom_2\",\"number_of_custom_3\",\"cost_per_custom_3\",\"roas\"]}},\"attribution_window\":{\"type\":\"string\",\"enum\":[\"1h\",\"6h\",\"12h\",\"24h\",\"48h\",\"72h\",\"7 days\",\"30 days\"],\"default\":\"7 days\"},\"granularity\":{\"type\":\"string\",\"default\":\"DAY\",\"description\":\"Time aggregation granularity for rows in the report\",\"enum\":[\"HOUR\",\"DAY\",\"WEEK\",\"MONTH\"]},\"filters\":{\"description\":\"Optional filters, combined with AND\",\"type\":\"array\",\"items\":{\"$ref\":\"#/components/schemas/ReportFilter\"}},\"format\":{\"type\":\"string\",\"enum\":[\"JSON\",\"CSV\"],\"default\":\"JSON\"}},\"required\":[\"start_date\",\"end_date\",\"advertiser_ids\",\"metrics\"]},\"ReportFailureReason\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Stable machine-readable error code\"},\"message\":{\"type\":\"string\",\"description\":\"Human-readable explanation\"},\"details\":{\"type\":\"object\",\"nullable\":true,\"description\":\"Additional context specific to the failure code\"}},\"required\":[\"code\",\"message\"]},\"Report\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Stable identifier of the report\",\"format\":\"uuid\"},\"status\":{\"type\":\"string\",\"enum\":[\"CREATED\",\"PROCESSING\",\"READY\",\"FAILED\"]},\"download_url\":{\"type\":[\"string\",\"null\"],\"format\":\"uri\",\"description\":\"Pre-signed URL to download the report. Populated only when status is READY.\"},\"generated_url_time\":{\"type\":[\"string\",\"null\"],\"format\":\"date-time\"},\"url_expiration_time\":{\"type\":[\"string\",\"null\"],\"format\":\"date-time\"},\"failure_reason\":{\"oneOf\":[{\"$ref\":\"#/components/schemas/ReportFailureReason\"},{\"type\":\"null\"}]},\"created_at\":{\"type\":\"string\",\"description\":\"Time at which the report was created\",\"format\":\"date-time\"},\"completed_at\":{\"type\":[\"string\",\"null\"],\"description\":\"Time at which the report reached a terminal state\",\"format\":\"date-time\"}},\"required\":[\"id\",\"status\",\"created_at\"]}}},\"security\":[{\"bearer\":[]}]}`) as OpenAPIDocument\n\nexport type OperationId = \"CreateReport\" | \"GetReport\" | \"OAuthToken\" | \"DownloadReport\"\nexport type SupportedOperationId = \"CreateReport\" | \"GetReport\" | \"OAuthToken\" | \"DownloadReport\"\nexport const operationIds = [\"CreateReport\",\"GetReport\",\"OAuthToken\",\"DownloadReport\"] as const\nexport const supportedOperationIds = [\"CreateReport\",\"GetReport\",\"OAuthToken\",\"DownloadReport\"] as const\n", "import {\n bearerToken,\n type Clock,\n createRuntime as createServiceRuntime,\n type FaultPreset,\n type MockControls,\n type RequestLog,\n type ServiceRuntime,\n} from \"@crvouga/mockingbird-service\"\nimport { document } from \"./generated/openapi.js\"\nimport { VIBE_NAMESPACE, VibeAPI, type VibeAPIOptions } from \"./index.js\"\n\nconst envelope = (status: number, type: string) => ({\n error: {\n type,\n status,\n message: \"Scripted failure\",\n request_id: \"mock_request\",\n detail: null,\n doc_url: null,\n },\n})\nexport const VIBE_PRESETS: Record<string, FaultPreset> = {\n rate_limited: {\n description: \"Scripted quota failure\",\n rules: [\n {\n operationId: \"CreateReport\",\n status: 429,\n body: envelope(429, \"rate_limit_exceeded\"),\n headers: { \"retry-after\": \"1\" },\n },\n ],\n },\n server_error: {\n description: \"Transient report error\",\n rules: [{ operationId: \"CreateReport\", status: 500, body: envelope(500, \"internal_error\") }],\n },\n connection_drop: { description: \"Dropped connection\", rules: [{ drop: true }] },\n report_failed: {\n description: \"Report reaches FAILED\",\n rules: [{ operationId: \"CreateReport\", effect: \"failed\" }],\n },\n report_stuck: {\n description: \"Report remains PROCESSING\",\n rules: [{ operationId: \"CreateReport\", effect: \"stuck\" }],\n },\n}\nexport type VibeRuntimeOptions = Omit<VibeAPIOptions, \"now\" | \"namespace\" | \"publicNamespace\"> & {\n clock?: Clock\n seed?: string | number\n adminKey?: string\n /** Admin controls to boot with: clock, latency, faults, seed, a starting snapshot. */\n adminControls?: MockControls\n onLog?: (entry: RequestLog) => void\n}\nexport type VibeRuntime = ServiceRuntime<VibeAPI>\nexport const createRuntime = (options: VibeRuntimeOptions = {}): VibeRuntime =>\n createServiceRuntime({\n name: VIBE_NAMESPACE,\n document,\n presets: VIBE_PRESETS,\n credential: bearerToken,\n ...(options.sqlite ? { sqlite: options.sqlite } : {}),\n ...(options.clock ? { clock: options.clock } : {}),\n ...(options.seed !== undefined ? { seed: options.seed } : {}),\n ...(options.adminPrefix ? { adminPrefix: options.adminPrefix } : {}),\n ...(options.adminKey ? { adminKey: options.adminKey } : {}),\n ...(options.adminControls !== undefined ? { adminControls: options.adminControls } : {}),\n ...(options.onLog ? { onLog: options.onLog } : {}),\n create: ({ sqlite, namespace, clock, publicNamespace, adminPrefix }) =>\n new VibeAPI({ ...options, sqlite, namespace, publicNamespace, adminPrefix, now: clock.now }),\n })\n", "import type { FetchAPI } from \"@crvouga/mockingbird-core\"\nimport {\n type APIOptions,\n annotateResponse,\n basicAuth,\n bearerToken,\n bodyIssues,\n bootSqlite,\n Collection,\n createService,\n defineOperations,\n faultEffect,\n IdSequence,\n jsonRes,\n type OperationContext,\n opaqueToken,\n type Service,\n} from \"@crvouga/mockingbird-service\"\nimport type { Hono } from \"hono\"\nimport { document, type SupportedOperationId } from \"./generated/openapi.js\"\n\nexport type { OperationId, SupportedOperationId } from \"./generated/openapi.js\"\nexport { document, operationIds, supportedOperationIds } from \"./generated/openapi.js\"\nexport { createRuntime, VIBE_PRESETS } from \"./runtime.js\"\nexport const VIBE_NAMESPACE = \"vibe\"\nexport type Client = { id: string; secret: string; scopes: string[]; advertiserIds: string[] }\nexport type Token = { clientId: string; scopes: string[]; expiresAt: number }\nexport type Row = { advertiser_id: string; impression_date: string; [key: string]: unknown }\nexport type Report = {\n id: string\n clientId: string\n createdAt: number\n readyAt: number | null\n processingAt: number\n failure: { code: string; message: string } | null\n rows: Record<string, unknown>[]\n downloadToken: string\n missingArtifact: boolean\n}\nexport type Settings = { processingMs: number; readyMs: number; tokenTtlSeconds: number }\nexport type VibeAPIOptions = APIOptions & {\n clients?: Client[]\n rows?: Row[]\n settings?: Partial<Settings>\n publicNamespace?: string\n adminPrefix?: string\n}\nexport const DEFAULT_ADVERTISER = \"00000000-0000-4000-8000-000000000001\"\nconst defaultClient: Client = {\n id: \"mock_client\",\n secret: \"mock_client_secret\",\n scopes: [\"advertisers:read\", \"reporting:read\"],\n advertiserIds: [DEFAULT_ADVERTISER],\n}\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value)\nconst failure = (status: number, type: string, message: string) => {\n if (status === 401) {\n const response = jsonRes(401, {\n error: {\n type: \"token_invalid\",\n message: \"Authentication required.\",\n status: 401,\n request_id: \"mock_request\",\n },\n })\n response.headers.set(\"www-authenticate\", \"Bearer\")\n return response\n }\n return jsonRes(status, {\n error: { type, message, status, detail: null, request_id: \"mock_request\", doc_url: null },\n })\n}\nexport class VibeAPI implements FetchAPI {\n readonly app: Hono\n readonly clients: Collection<Client>\n readonly tokens: Collection<Token>\n readonly rows: Collection<Row>\n readonly reports: Collection<Report>\n readonly settings: Collection<Settings>\n private readonly initialized: Collection<{ value: boolean }>\n private readonly ids: IdSequence\n private readonly service: Service\n private readonly now: () => number\n private readonly seeds: { clients: Client[]; rows: Row[]; settings: Settings }\n private readonly basePath: string\n private readonly prefix: string\n private readonly namespace: string\n constructor(options: VibeAPIOptions = {}) {\n const sqlite = bootSqlite(options.sqlite),\n namespace = options.namespace ?? VIBE_NAMESPACE\n this.namespace = namespace\n this.now = options.now ?? Date.now\n this.prefix = options.adminPrefix ?? \"/__admin\"\n this.basePath =\n !options.publicNamespace || options.publicNamespace === \"default\"\n ? \"\"\n : `${this.prefix}/ns/${encodeURIComponent(options.publicNamespace)}`\n this.clients = new Collection(sqlite, namespace, \"clients\")\n this.tokens = new Collection(sqlite, namespace, \"tokens\")\n this.rows = new Collection(sqlite, namespace, \"rows\")\n this.reports = new Collection(sqlite, namespace, \"reports\")\n this.settings = new Collection(sqlite, namespace, \"settings\")\n this.initialized = new Collection(sqlite, namespace, \"initialized\")\n this.ids = new IdSequence(sqlite, namespace)\n this.seeds = structuredClone({\n clients: options.clients ?? [defaultClient],\n rows: options.rows ?? [],\n settings: { processingMs: 1000, readyMs: 2000, tokenTtlSeconds: 3600, ...options.settings },\n })\n this.seed()\n this.service = createService({\n sqlite,\n namespace,\n document,\n now: this.now,\n notFound: () => failure(404, \"not_found\", \"Report not found\"),\n onError: (error) => {\n throw error\n },\n before: (context) => {\n if ([\"OAuthToken\", \"DownloadReport\"].includes(context.operation.operationId))\n return undefined\n const token = this.tokens.get(bearerToken(context.request) ?? \"\")\n if (!token || token.expiresAt <= this.now())\n return failure(401, \"invalid_token\", \"Unauthorized\")\n if (context.request.headers.get(\"x-vibe-revision\") !== \"2026-06-01\")\n return failure(400, \"unknown_revision\", \"Unknown or missing revision\")\n if (!token.scopes.includes(\"reporting:read\"))\n return failure(403, \"insufficient_scope\", \"Missing required scope\")\n return undefined\n },\n handlers: defineOperations<SupportedOperationId>({\n OAuthToken: (context) => this.exchange(context),\n CreateReport: (context) => this.create(context),\n GetReport: (context) => this.get(context),\n DownloadReport: (context) => this.download(context),\n }),\n })\n this.app = this.service.app\n }\n private seed(): void {\n if (this.initialized.has(\"seed\")) return\n for (const client of this.seeds.clients) this.clients.insert(client.id, client)\n for (const [i, row] of this.seeds.rows.entries()) this.rows.insert(String(i), row)\n this.settings.insert(\"default\", this.seeds.settings)\n const client = this.clients.get(\"mock_client\")\n if (client)\n this.tokens.insert(\"mock_vibe_token\", {\n clientId: client.id,\n scopes: client.scopes,\n expiresAt: this.now() + this.seeds.settings.tokenTtlSeconds * 1000,\n })\n this.initialized.insert(\"seed\", { value: true })\n }\n fetch(request: Request): Promise<Response> {\n return this.service.fetch(request)\n }\n async reset(): Promise<void> {\n await this.service.reset()\n this.seed()\n }\n private exchange(context: OperationContext): Response {\n const auth = basicAuth(context.request)\n let client: Client | undefined\n try {\n client = this.clients.get(decodeURIComponent(auth?.username ?? \"\"))\n } catch {\n return jsonRes(401, { error: \"invalid_client\" })\n }\n let password: string\n try {\n password = decodeURIComponent(auth?.password ?? \"\")\n } catch {\n return jsonRes(401, { error: \"invalid_client\" })\n }\n if (!client || client.secret !== password) return jsonRes(401, { error: \"invalid_client\" })\n if (bodyIssues(context).length || context.body.kind !== \"form\")\n return jsonRes(400, { error: \"invalid_request\" })\n const form = context.body.value\n if (form.grant_type !== \"client_credentials\")\n return jsonRes(400, { error: \"unsupported_grant_type\" })\n const scope = form.scope,\n scopes = typeof scope === \"string\" ? scope.split(/\\s+/).filter(Boolean) : client.scopes\n if (scopes.some((value) => !client.scopes.includes(value)))\n return jsonRes(400, { error: \"invalid_scope\" })\n const token = this.ids.next(\"mock_vibe_\", 24),\n expires = this.settings.get(\"default\")?.tokenTtlSeconds ?? 3600\n this.tokens.insert(token, {\n clientId: client.id,\n scopes,\n expiresAt: this.now() + expires * 1000,\n })\n return jsonRes(200, {\n access_token: token,\n token_type: \"Bearer\",\n expires_in: expires,\n scope: scopes.join(\" \"),\n })\n }\n private create(context: OperationContext): Response {\n if (bodyIssues(context).length || context.body.kind !== \"json\" || !record(context.body.value))\n return failure(400, \"validation\", \"Invalid report request\")\n const body = context.body.value,\n token = this.tokens.get(bearerToken(context.request) ?? \"\"),\n client = this.clients.get(token?.clientId ?? \"\")\n if (!client) return failure(401, \"invalid_token\", \"Unauthorized\")\n const start = String(body.start_date),\n end = String(body.end_date),\n duration = Date.parse(end) - Date.parse(start)\n if (!Number.isFinite(duration) || duration <= 0 || duration > 45 * 86400000)\n return failure(400, \"validation\", \"Report window must be positive and at most 45 days\")\n const advertisers = body.advertiser_ids as string[]\n if (advertisers.some((id) => !client.advertiserIds.includes(id)))\n return failure(403, \"insufficient_scope\", \"Advertiser not accessible\")\n // The initial package deliberately serves pre-aggregated JSON/DAY fixtures only.\n if ((body.format && body.format !== \"JSON\") || (body.granularity && body.granularity !== \"DAY\"))\n return failure(400, \"validation\", \"This mock supports JSON/DAY fixtures only\")\n const columns = [\n ...(Array.isArray(body.dimensions) ? body.dimensions : []),\n ...(body.metrics as string[]),\n ] as string[]\n const rows = this.rows\n .list({ order: \"oldest\" })\n .map(({ value }) => value)\n .filter(\n (row) =>\n advertisers.includes(row.advertiser_id) &&\n row.impression_date >= start &&\n row.impression_date < end,\n )\n .map((row) => Object.fromEntries(columns.map((column) => [column, row[column] ?? null])))\n const raw = Array.from(this.ids.next(\"\", 32), (char) =>\n (char.charCodeAt(0) % 16).toString(16),\n ).join(\"\"),\n id = `${raw.slice(0, 8)}-${raw.slice(8, 12)}-4${raw.slice(13, 16)}-8${raw.slice(17, 20)}-${raw.slice(20)}`\n const now = this.now(),\n settings = this.settings.get(\"default\") ?? this.seeds.settings\n const report: Report = {\n id,\n clientId: client.id,\n createdAt: now,\n processingAt: now + settings.processingMs,\n readyAt: faultEffect(context.request, \"stuck\") ? null : now + settings.readyMs,\n failure: faultEffect(context.request, \"failed\")\n ? { code: \"mock_report_failed\", message: \"Scripted report failure\" }\n : null,\n rows,\n downloadToken: opaqueToken(`${this.namespace}:${id}:${now}`, 24),\n missingArtifact: false,\n }\n this.reports.insert(id, report)\n const response = jsonRes(201, this.view(context, report))\n annotateResponse(response, { ids: { reportId: id } })\n return response\n }\n private view(context: OperationContext, report: Report): Record<string, unknown> {\n const terminal = report.readyAt !== null && this.now() >= report.readyAt\n const status = terminal\n ? report.failure\n ? \"FAILED\"\n : \"READY\"\n : this.now() >= report.processingAt\n ? \"PROCESSING\"\n : \"CREATED\"\n const ready = status === \"READY\",\n completed = terminal ? new Date(report.readyAt ?? 0).toISOString() : null\n return {\n id: report.id,\n status,\n created_at: new Date(report.createdAt).toISOString(),\n completed_at: completed,\n failure_reason: status === \"FAILED\" ? report.failure : null,\n download_url: ready\n ? `${context.url.origin}${this.basePath}${this.prefix}/blobs/${report.id}?token=${encodeURIComponent(report.downloadToken)}`\n : null,\n generated_url_time: ready ? completed : null,\n url_expiration_time: ready ? new Date((report.readyAt ?? 0) + 86400000).toISOString() : null,\n }\n }\n private get(context: OperationContext): Response {\n const report = this.reports.get(context.params.report_id ?? \"\"),\n token = this.tokens.get(bearerToken(context.request) ?? \"\")\n if (!report || report.clientId !== token?.clientId)\n return failure(404, \"not_found\", \"Report not found\")\n return jsonRes(200, this.view(context, report))\n }\n private download(context: OperationContext): Response {\n const report = this.reports.get(context.params.id ?? \"\")\n if (!report || report.missingArtifact) return failure(404, \"not_found\", \"Artifact not found\")\n if (\n report.readyAt === null ||\n this.now() < report.readyAt ||\n report.failure ||\n this.now() >= report.readyAt + 86400000 ||\n context.url.searchParams.get(\"token\") !== report.downloadToken\n )\n return failure(403, \"invalid_token\", \"Artifact capability unavailable or expired\")\n return jsonRes(200, report.rows)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA,+CAAC,QAAS,QAAO,SAAU,uBAAsB,MAAO,mDAAkD,OAAQ,oDAAmD,MAAO,stCAAqtC,OAAQ,MAAK,aAAc,0CAAyC;;;ACAr8C;AAAA;AAAA;AAAA;AA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AAS,KAAK,QAAQ,IAAI,QAAQ,OAAO,aAAa,EAAE,GAC5D,QAAQ,KAAK,OAAO,QAAI,6BAAY,QAAQ,OAAO,KAAK,EAAE;AAC5D,QAAI,CAAC,UAAU,OAAO,aAAa,OAAO;AACxC,aAAO,QAAQ,KAAK,aAAa,kBAAkB;AACrD,eAAO,yBAAQ,KAAK,KAAK,KAAK,SAAS,MAAM,CAAC;AAAA,EAChD;AAAA,EACQ,SAAS,SAAqC;AACpD,UAAM,SAAS,KAAK,QAAQ,IAAI,QAAQ,OAAO,MAAM,EAAE;AACvD,QAAI,CAAC,UAAU,OAAO,gBAAiB,QAAO,QAAQ,KAAK,aAAa,oBAAoB;AAC5F,QACE,OAAO,YAAY,QACnB,KAAK,IAAI,IAAI,OAAO,WACpB,OAAO,WACP,KAAK,IAAI,KAAK,OAAO,UAAU,SAC/B,QAAQ,IAAI,aAAa,IAAI,OAAO,MAAM,OAAO;AAEjD,aAAO,QAAQ,KAAK,iBAAiB,4CAA4C;AACnF,eAAO,yBAAQ,KAAK,OAAO,IAAI;AAAA,EACjC;AACF;",
|
|
6
|
+
"names": ["createRuntime", "client", "id"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRuntime
|
|
3
|
+
} from "./chunk-6XMERY63.js";
|
|
4
|
+
|
|
5
|
+
// src/server.ts
|
|
6
|
+
import { listen } from "@crvouga/mockingbird-runtime/adapter-node";
|
|
7
|
+
var DEFAULT_PORT = 12128;
|
|
8
|
+
var createServer = async (options = {}) => {
|
|
9
|
+
const { port, host, ...rest } = options;
|
|
10
|
+
const runtime = createRuntime(rest);
|
|
11
|
+
const listening = await listen(runtime, { port: port ?? 0, ...host ? { host } : {} });
|
|
12
|
+
return { ...listening, runtime };
|
|
13
|
+
};
|
|
14
|
+
var serveTarget = {
|
|
15
|
+
name: "vibe",
|
|
16
|
+
defaultPort: DEFAULT_PORT,
|
|
17
|
+
options: {},
|
|
18
|
+
create: (_values, common) => createRuntime({
|
|
19
|
+
...common.adminPrefix !== void 0 ? { adminPrefix: common.adminPrefix } : {},
|
|
20
|
+
...common.adminKey !== void 0 ? { adminKey: common.adminKey } : {},
|
|
21
|
+
...common.adminControls !== void 0 ? { adminControls: common.adminControls } : {},
|
|
22
|
+
...common.seed !== void 0 ? { seed: common.seed } : {},
|
|
23
|
+
...common.onLog ? { onLog: common.onLog } : {}
|
|
24
|
+
}),
|
|
25
|
+
banner: () => [
|
|
26
|
+
"auth: Bearer mock_vibe_token; X-Vibe-Revision: 2026-06-01",
|
|
27
|
+
"reports: POST /reports"
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
DEFAULT_PORT,
|
|
33
|
+
createServer,
|
|
34
|
+
serveTarget
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-QOAFWR7M.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server.ts"],
|
|
4
|
+
"sourcesContent": ["/// <reference types=\"node\" />\nimport { type Listening, listen, type ServeTarget } from \"@crvouga/mockingbird-adapter-node\"\nimport { createRuntime, type VibeRuntime, type VibeRuntimeOptions } from \"./runtime.js\"\nexport const DEFAULT_PORT = 12128\nexport type VibeServerOptions = VibeRuntimeOptions & { port?: number; host?: string }\nexport type VibeServer = Listening & { runtime: VibeRuntime }\nexport const createServer = async (options: VibeServerOptions = {}): Promise<VibeServer> => {\n const { port, host, ...rest } = options\n const runtime = createRuntime(rest)\n const listening = await listen(runtime, { port: port ?? 0, ...(host ? { host } : {}) })\n return { ...listening, runtime }\n}\nexport const serveTarget: ServeTarget = {\n name: \"vibe\",\n defaultPort: DEFAULT_PORT,\n options: {},\n create: (_values, common) =>\n createRuntime({\n ...(common.adminPrefix !== undefined ? { adminPrefix: common.adminPrefix } : {}),\n ...(common.adminKey !== undefined ? { adminKey: common.adminKey } : {}),\n ...(common.adminControls !== undefined ? { adminControls: common.adminControls } : {}),\n ...(common.seed !== undefined ? { seed: common.seed } : {}),\n ...(common.onLog ? { onLog: common.onLog } : {}),\n }),\n banner: () => [\n \"auth: Bearer mock_vibe_token; X-Vibe-Revision: 2026-06-01\",\n \"reports: POST /reports\",\n ],\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AACA,SAAyB,cAAgC;AAElD,IAAM,eAAe;AAGrB,IAAM,eAAe,OAAO,UAA6B,CAAC,MAA2B;AAC1F,QAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,QAAM,UAAU,cAAc,IAAI;AAClC,QAAM,YAAY,MAAM,OAAO,SAAS,EAAE,MAAM,QAAQ,GAAG,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC,EAAG,CAAC;AACtF,SAAO,EAAE,GAAG,WAAW,QAAQ;AACjC;AACO,IAAM,cAA2B;AAAA,EACtC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,CAAC;AAAA,EACV,QAAQ,CAAC,SAAS,WAChB,cAAc;AAAA,IACZ,GAAI,OAAO,gBAAgB,SAAY,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;AAAA,IAC9E,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,IACrE,GAAI,OAAO,kBAAkB,SAAY,EAAE,eAAe,OAAO,cAAc,IAAI,CAAC;AAAA,IACpF,GAAI,OAAO,SAAS,SAAY,EAAE,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,IACzD,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,EAChD,CAAC;AAAA,EACH,QAAQ,MAAM;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
runCli,
|
|
4
|
-
serveCommand,
|
|
5
3
|
serveTarget
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-QOAFWR7M.js";
|
|
5
|
+
import "./chunk-6XMERY63.js";
|
|
8
6
|
|
|
9
7
|
// src/cli.ts
|
|
8
|
+
import { runCli, serveCommand } from "@crvouga/mockingbird-runtime/adapter-node";
|
|
10
9
|
var code = await runCli(
|
|
11
10
|
{
|
|
12
11
|
bin: "mockingbird-vibe",
|
package/dist/cli.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli.ts"],
|
|
4
4
|
"sourcesContent": ["#!/usr/bin/env node\n/// <reference types=\"node\" />\nimport { runCli, serveCommand } from \"@crvouga/mockingbird-adapter-node\"\nimport { serveTarget } from \"./server.js\"\n\nconst code = await runCli(\n {\n bin: \"mockingbird-vibe\",\n description: \"Local Vibe contacts mock\",\n commands: { serve: serveCommand(serveTarget) },\n },\n process.argv.slice(2),\n)\nif (code !== 0) process.exitCode = code\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;AAEA,SAAS,QAAQ,oBAAoB;AAGrC,IAAM,OAAO,MAAM;AAAA,EACjB;AAAA,IACE,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU,EAAE,OAAO,aAAa,WAAW,EAAE;AAAA,EAC/C;AAAA,EACA,QAAQ,KAAK,MAAM,CAAC;AACtB;AACA,IAAI,SAAS,EAAG,SAAQ,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|