@noodleseed/one 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/billing-ops.d.ts.map +1 -1
- package/dist/commands/billing-ops.js +5 -0
- package/dist/commands/billing-ops.js.map +1 -1
- package/dist/commands/billing-read-ops.d.ts +3 -0
- package/dist/commands/billing-read-ops.d.ts.map +1 -0
- package/dist/commands/billing-read-ops.js +289 -0
- package/dist/commands/billing-read-ops.js.map +1 -0
- package/dist/commands/catalog-data-resources.d.ts.map +1 -1
- package/dist/commands/catalog-data-resources.js +19 -2
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +1 -0
- package/dist/commands/catalog.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.d.ts +34 -0
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.d.ts.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.js +225 -0
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts +5 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +22 -15
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.d.ts +4 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.js +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.js +55 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js +8 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts +268 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js +138 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/store.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/billing/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +1 -0
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js +202 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js +34 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +25 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.d.ts +4 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js +10 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// The globally-installable Noodle Seed authoring plugin for Claude Code and Codex. It fixes the
|
|
2
|
+
// cold-start gap: a developer installs the plugin into their coding agent once, and from the first
|
|
3
|
+
// prompt in any directory the agent knows to reach for the `noodle` CLI (`npx @noodleseed/one`),
|
|
4
|
+
// scaffold with `noodle init`, and then defer to the project-local `noodle-seed` skill that init
|
|
5
|
+
// installs. One shared plugin directory serves both hosts (`.claude-plugin/plugin.json` +
|
|
6
|
+
// `.codex-plugin/plugin.json`); the `references/**` payload is byte-identical to the project skill
|
|
7
|
+
// (rendered from the same `SKILL_REFERENCES`), and only the router SKILL.md is plugin-specific.
|
|
8
|
+
// The bundle deliberately excludes the project-local extras: no bundled examples (project-local
|
|
9
|
+
// rationale; `noodle init` ships them), no `.mcp.json` (docs endpoint not yet live; Codex documents
|
|
10
|
+
// stdio-only), no legacy `commands/` (official docs: use `skills/` for new plugins).
|
|
11
|
+
import { AGENT_KIT_VERSION, contentHash } from './index.js';
|
|
12
|
+
import { REFERENCE_INDEX_LINES, SKILL_REFERENCES } from './skill-content.js';
|
|
13
|
+
/** The plugin identifier — matches the skill name so the defer-to-project rule reads coherently. */
|
|
14
|
+
export const PLUGIN_NAME = 'noodle-seed';
|
|
15
|
+
/** The public marketplace identifier (`/plugin install noodle-seed@noodleseed`). */
|
|
16
|
+
export const MARKETPLACE_NAME = 'noodleseed';
|
|
17
|
+
/** Where the plugin lives inside the marketplace repo (relative sources must start with "./"). */
|
|
18
|
+
export const PLUGIN_SOURCE_PATH = './plugins/noodle-seed';
|
|
19
|
+
const HOMEPAGE = 'https://noodleseed.dev';
|
|
20
|
+
const AUTHOR = { name: 'Noodle Seed', url: HOMEPAGE };
|
|
21
|
+
const OWNER = { name: 'Noodle Seed' };
|
|
22
|
+
const PLUGIN_DESCRIPTION = 'Build production MCP servers and apps with Noodle Seed: author one TypeScript server.ts with ' +
|
|
23
|
+
'the noodle CLI, validate and test locally, then deploy to a governed hosted MCP endpoint that ' +
|
|
24
|
+
'works in ChatGPT, Claude, Codex, Cursor, Gemini, and every MCP client.';
|
|
25
|
+
/**
|
|
26
|
+
* The skill frontmatter description. It must auto-trigger on cold intents ("build an MCP app",
|
|
27
|
+
* "make a ChatGPT app", "ship a Claude Code plugin") from developers who have never heard of
|
|
28
|
+
* Noodle Seed — this is the whole point of the global plugin.
|
|
29
|
+
*/
|
|
30
|
+
export const BOOTSTRAP_SKILL_DESCRIPTION = 'Use when asked to build, create, or ship an MCP server or MCP app, a ChatGPT app, a Claude or ' +
|
|
31
|
+
'Gemini connector, a Codex plugin or Claude Code plugin, or to make a product, API, or SaaS ' +
|
|
32
|
+
'reachable by AI agents. Bootstraps Noodle Seed — TypeScript authoring with the noodle CLI, ' +
|
|
33
|
+
'local validation and testing, and governed hosted deployment.';
|
|
34
|
+
/** Starter prompts surfaced by the Codex install UI (mirrors the website starter intents). */
|
|
35
|
+
const DEFAULT_PROMPTS = [
|
|
36
|
+
'Create a ChatGPT app for my support workflow',
|
|
37
|
+
'Create a Claude connector for my SaaS',
|
|
38
|
+
'Create an MCP app with a small UI',
|
|
39
|
+
'Create a Codex or Claude Code plugin for this repo',
|
|
40
|
+
];
|
|
41
|
+
function bootstrapRouterBody() {
|
|
42
|
+
return [
|
|
43
|
+
'# Noodle Seed bootstrap',
|
|
44
|
+
'',
|
|
45
|
+
'Noodle Seed turns one TypeScript file (`server.ts`) into a production MCP server or app: authored locally with the `noodle` CLI, validated and tested offline, and deployed to a governed hosted MCP endpoint reachable from ChatGPT, Claude, Codex, Cursor, Gemini, and every MCP client. Use this skill whenever the user wants an MCP server or app, a ChatGPT app, a Claude connector, a Codex or Claude Code plugin, or wants their product, API, or SaaS reachable by AI agents.',
|
|
46
|
+
'',
|
|
47
|
+
'## Defer to the project-local skill',
|
|
48
|
+
'',
|
|
49
|
+
'`noodle init` and `noodle agents setup --write` install a fuller, project-configured `noodle-seed` skill into the project (`.claude/skills/noodle-seed/` for Claude Code, `.agents/skills/noodle-seed/` for Codex) plus a managed context block in `CLAUDE.md`/`AGENTS.md`. When that project-local skill exists, read it and follow it instead of this one — it is self-updating (`noodle agents doctor --json`) and carries project defaults plus bundled flagship examples. This plugin skill is only the cold-start bootstrap.',
|
|
50
|
+
'',
|
|
51
|
+
'## Cold start (no project yet)',
|
|
52
|
+
'',
|
|
53
|
+
'1. **Get the CLI.** Check `noodle --version`. If it is missing, run commands zero-install via `npx @noodleseed/one@latest <command>`, or install once with `npm install -g @noodleseed/one@latest` (Node 24+). Never assume the CLI is present.',
|
|
54
|
+
'2. **Scaffold or reconcile.**',
|
|
55
|
+
' - New or empty directory: `noodle init` — scaffolds `noodle.json`, `src/server.ts`, tests, and the project-local agent files (the full skill + managed context).',
|
|
56
|
+
' - Existing project: run `noodle setup --write` and `noodle agents setup --write` instead of overwriting unrelated files.',
|
|
57
|
+
'3. **Switch to the project skill.** Read the newly installed project-local `noodle-seed` `SKILL.md` and follow its golden path end to end.',
|
|
58
|
+
'',
|
|
59
|
+
'## The loop (summary — the project skill owns the detail)',
|
|
60
|
+
'',
|
|
61
|
+
'Author TypeScript in `src/server.ts` with the `@noodleseed/one` SDK → `noodle validate --json` (fix each `error.errors[]` entry at its `path`; never freeform re-edit) → `noodle test --json` → `noodle dev` for a local loopback MCP endpoint → only after explicit approval `noodle deploy` → `noodle connect <claude-code|codex|chatgpt>` to wire the deployed endpoint into a host. The CLI is agent-native: every cold-path command speaks `--json`, so parse machine state, not prose. Discover the full verb surface with `noodle commands --json`.',
|
|
62
|
+
'',
|
|
63
|
+
'## References',
|
|
64
|
+
'',
|
|
65
|
+
'The same reference set the project-local skill ships, readable before any project exists:',
|
|
66
|
+
'',
|
|
67
|
+
...REFERENCE_INDEX_LINES,
|
|
68
|
+
'',
|
|
69
|
+
'## Safety',
|
|
70
|
+
'',
|
|
71
|
+
'- Keep secrets, bearer tokens, refresh tokens, static access keys, `.env.noodle` values, and `~/.noodle/config.json` out of prompts, logs, docs, tests, and generated files. Reference managed secrets as `secret("NAME")` in TypeScript and set them with `noodle secrets set`.',
|
|
72
|
+
'- Do not hand-author manifest JSON/YAML, runtime artifacts, connector IR, or hosted asset metadata — the SDK emits them.',
|
|
73
|
+
'- Do not add static data-plane credential paths; hosted access is identity-based.',
|
|
74
|
+
].join('\n');
|
|
75
|
+
}
|
|
76
|
+
function stampBootstrapRouter(version) {
|
|
77
|
+
const body = bootstrapRouterBody();
|
|
78
|
+
return [
|
|
79
|
+
'---',
|
|
80
|
+
`name: ${PLUGIN_NAME}`,
|
|
81
|
+
`description: ${BOOTSTRAP_SKILL_DESCRIPTION}`,
|
|
82
|
+
`version: ${version}`,
|
|
83
|
+
`hash: ${contentHash(body)}`,
|
|
84
|
+
'---',
|
|
85
|
+
'',
|
|
86
|
+
body,
|
|
87
|
+
'',
|
|
88
|
+
].join('\n');
|
|
89
|
+
}
|
|
90
|
+
function json(value) {
|
|
91
|
+
return `${JSON.stringify(value, null, 2)}\n`;
|
|
92
|
+
}
|
|
93
|
+
/** The shared plugin directory: two host manifests, the bootstrap router, and the references. */
|
|
94
|
+
export function renderPluginBundle(options = {}) {
|
|
95
|
+
const version = options.version ?? AGENT_KIT_VERSION;
|
|
96
|
+
const shared = {
|
|
97
|
+
name: PLUGIN_NAME,
|
|
98
|
+
displayName: 'Noodle Seed',
|
|
99
|
+
version,
|
|
100
|
+
description: PLUGIN_DESCRIPTION,
|
|
101
|
+
author: AUTHOR,
|
|
102
|
+
homepage: HOMEPAGE,
|
|
103
|
+
repository: 'https://github.com/NoodleSeed-com/plugins',
|
|
104
|
+
license: 'Apache-2.0',
|
|
105
|
+
keywords: ['mcp', 'mcp-server', 'chatgpt-apps', 'claude', 'codex', 'noodleseed'],
|
|
106
|
+
};
|
|
107
|
+
return [
|
|
108
|
+
{ path: '.claude-plugin/plugin.json', content: json(shared) },
|
|
109
|
+
{
|
|
110
|
+
path: '.codex-plugin/plugin.json',
|
|
111
|
+
content: json({
|
|
112
|
+
...shared,
|
|
113
|
+
interface: {
|
|
114
|
+
displayName: 'Noodle Seed',
|
|
115
|
+
shortDescription: 'Build and deploy MCP servers and apps from one TypeScript file.',
|
|
116
|
+
longDescription: PLUGIN_DESCRIPTION,
|
|
117
|
+
developerName: 'Noodle Seed',
|
|
118
|
+
category: 'Developer Tools',
|
|
119
|
+
websiteURL: HOMEPAGE,
|
|
120
|
+
defaultPrompt: DEFAULT_PROMPTS,
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
},
|
|
124
|
+
{ path: `skills/${PLUGIN_NAME}/SKILL.md`, content: stampBootstrapRouter(version) },
|
|
125
|
+
...SKILL_REFERENCES.map((ref) => ({
|
|
126
|
+
path: `skills/${PLUGIN_NAME}/${ref.relPath}`,
|
|
127
|
+
content: ref.render(),
|
|
128
|
+
})),
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Both marketplace catalogs, rendered from one entry: the Claude format (relative-string source;
|
|
133
|
+
* Codex also reads it for legacy compat) and the native Codex format (object source + policy).
|
|
134
|
+
*/
|
|
135
|
+
export function renderMarketplaceCatalogs(options = {}) {
|
|
136
|
+
const version = options.version ?? AGENT_KIT_VERSION;
|
|
137
|
+
const entryMetadata = {
|
|
138
|
+
name: PLUGIN_NAME,
|
|
139
|
+
description: PLUGIN_DESCRIPTION,
|
|
140
|
+
version,
|
|
141
|
+
author: OWNER,
|
|
142
|
+
homepage: HOMEPAGE,
|
|
143
|
+
license: 'Apache-2.0',
|
|
144
|
+
category: 'developer-tools',
|
|
145
|
+
};
|
|
146
|
+
return [
|
|
147
|
+
{
|
|
148
|
+
path: '.claude-plugin/marketplace.json',
|
|
149
|
+
content: json({
|
|
150
|
+
name: MARKETPLACE_NAME,
|
|
151
|
+
owner: OWNER,
|
|
152
|
+
description: 'Official Noodle Seed plugins for coding agents.',
|
|
153
|
+
plugins: [{ ...entryMetadata, source: PLUGIN_SOURCE_PATH }],
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
path: '.agents/plugins/marketplace.json',
|
|
158
|
+
content: json({
|
|
159
|
+
name: MARKETPLACE_NAME,
|
|
160
|
+
interface: { displayName: 'Noodle Seed' },
|
|
161
|
+
plugins: [
|
|
162
|
+
{
|
|
163
|
+
...entryMetadata,
|
|
164
|
+
source: { source: 'local', path: PLUGIN_SOURCE_PATH },
|
|
165
|
+
policy: { installation: 'AVAILABLE' },
|
|
166
|
+
category: 'Developer Tools',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
}),
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
function marketplaceReadme(version) {
|
|
174
|
+
return [
|
|
175
|
+
'# Noodle Seed plugins',
|
|
176
|
+
'',
|
|
177
|
+
'The official [Noodle Seed](https://noodleseed.dev) plugin marketplace for AI coding agents.',
|
|
178
|
+
`Install the \`${PLUGIN_NAME}\` plugin once and your coding agent knows how to build, validate,`,
|
|
179
|
+
'and deploy production MCP servers and apps with the `noodle` CLI from the very first prompt.',
|
|
180
|
+
'',
|
|
181
|
+
'## Install',
|
|
182
|
+
'',
|
|
183
|
+
'**Claude Code**',
|
|
184
|
+
'',
|
|
185
|
+
'```text',
|
|
186
|
+
'/plugin marketplace add NoodleSeed-com/plugins',
|
|
187
|
+
`/plugin install ${PLUGIN_NAME}@${MARKETPLACE_NAME}`,
|
|
188
|
+
'```',
|
|
189
|
+
'',
|
|
190
|
+
'**Codex**',
|
|
191
|
+
'',
|
|
192
|
+
'```text',
|
|
193
|
+
'codex plugin marketplace add NoodleSeed-com/plugins',
|
|
194
|
+
'```',
|
|
195
|
+
'',
|
|
196
|
+
`Then install \`${PLUGIN_NAME}\` from the \`${MARKETPLACE_NAME}\` marketplace.`,
|
|
197
|
+
'',
|
|
198
|
+
'## What you get',
|
|
199
|
+
'',
|
|
200
|
+
`- The \`${PLUGIN_NAME}\` skill: the cold-start bootstrap plus the full Noodle Seed reference`,
|
|
201
|
+
' set (SDK surface, CLI commands, compile-error fixes, authoring workflow, widgets, deploy).',
|
|
202
|
+
'- After `noodle init`, projects carry their own self-updating project-local skill; the plugin',
|
|
203
|
+
' defers to it.',
|
|
204
|
+
'',
|
|
205
|
+
'## About this repository',
|
|
206
|
+
'',
|
|
207
|
+
`This repository is **generated** from \`@noodleseed/agent-kit@${version}\` by the Noodle Seed`,
|
|
208
|
+
'release process. Do not edit it by hand — changes land through <https://noodleseed.dev>',
|
|
209
|
+
'releases. Docs: <https://docs.noodleseed.dev>.',
|
|
210
|
+
'',
|
|
211
|
+
].join('\n');
|
|
212
|
+
}
|
|
213
|
+
/** The full public marketplace repo layout: catalogs + README + the plugin under plugins/<name>/. */
|
|
214
|
+
export function renderMarketplaceRepo(options = {}) {
|
|
215
|
+
const version = options.version ?? AGENT_KIT_VERSION;
|
|
216
|
+
return [
|
|
217
|
+
...renderMarketplaceCatalogs(options),
|
|
218
|
+
{ path: 'README.md', content: marketplaceReadme(version) },
|
|
219
|
+
...renderPluginBundle(options).map((file) => ({
|
|
220
|
+
path: `plugins/${PLUGIN_NAME}/${file.path}`,
|
|
221
|
+
content: file.content,
|
|
222
|
+
})),
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=plugin-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-bundle.js","sourceRoot":"","sources":["../src/plugin-bundle.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,mGAAmG;AACnG,iGAAiG;AACjG,iGAAiG;AACjG,0FAA0F;AAC1F,mGAAmG;AACnG,gGAAgG;AAChG,gGAAgG;AAChG,oGAAoG;AACpG,qFAAqF;AACrF,OAAO,EAAE,iB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IAAI,EAAE;YAC3C,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -5,6 +5,11 @@ export interface SkillReference {
|
|
|
5
5
|
readonly relPath: string;
|
|
6
6
|
readonly render: () => string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* The one-line routing index for every reference file, shared verbatim by the project-local router
|
|
10
|
+
* and the global authoring-plugin bootstrap router so the two cannot drift.
|
|
11
|
+
*/
|
|
12
|
+
export declare const REFERENCE_INDEX_LINES: readonly string[];
|
|
8
13
|
export declare function skillRouterBody(target: AgentTarget): string;
|
|
9
14
|
export declare function renderSdkSurfaceReference(): string;
|
|
10
15
|
export declare function renderCliCommandsReference(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-content.d.ts","sourceRoot":"","sources":["../src/skill-content.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkB9C,eAAO,MAAM,iBAAiB,QAEmC,CAAC;AAElE,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC;CAC/B;AAMD,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"skill-content.d.ts","sourceRoot":"","sources":["../src/skill-content.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkB9C,eAAO,MAAM,iBAAiB,QAEmC,CAAC;AAElE,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC;CAC/B;AAMD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAgBlD,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CA+C3D;AAoOD,wBAAgB,yBAAyB,IAAI,MAAM,CA2ClD;AAMD,wBAAgB,0BAA0B,IAAI,MAAM,CA+BnD;AAMD,wBAAgB,4BAA4B,IAAI,MAAM,CAiDrD;AAMD,wBAAgB,4BAA4B,IAAI,MAAM,CAoBrD;AAMD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAgBrD,CAAC"}
|
|
@@ -20,6 +20,27 @@ export const SKILL_DESCRIPTION = 'Use when building, validating, testing, deploy
|
|
|
20
20
|
// ----------------------------------------------------------------------------
|
|
21
21
|
// SKILL.md router (target-aware preamble; references are shared across targets)
|
|
22
22
|
// ----------------------------------------------------------------------------
|
|
23
|
+
/**
|
|
24
|
+
* The one-line routing index for every reference file, shared verbatim by the project-local router
|
|
25
|
+
* and the global authoring-plugin bootstrap router so the two cannot drift.
|
|
26
|
+
*/
|
|
27
|
+
export const REFERENCE_INDEX_LINES = [
|
|
28
|
+
'- `references/agent-contract.md` — the `--json` envelope, exit codes, and the three output modes.',
|
|
29
|
+
'- `references/sdk-surface.md` — what to import from `@noodleseed/one` and which builder to use.',
|
|
30
|
+
'- `references/cli-commands.md` — every `noodle` command, grouped by area.',
|
|
31
|
+
'- `references/compile-errors.md` — fix `noodle validate` errors by code.',
|
|
32
|
+
'- `references/authoring-workflow.md` — input paths (scrape / OpenAPI import / user interview), the fit check, the validate→test→dev repair loop, connectors, and secrets/variables.',
|
|
33
|
+
'- `references/embedded-assistant.md` — HTTPS origins, managed model config, deploy-before-client sequencing, backend session exchange, browser mounting, and credential boundaries.',
|
|
34
|
+
'- `references/connect-an-api.md` — given an API key: secure it, probe the live API to learn the real shape, model the connector, and prove real output before building.',
|
|
35
|
+
'- `references/experience-design.md` — design the app experience before authoring: funnel/handoff boundary, grounding, two-users, display modes, and the wireframe/UX spec.',
|
|
36
|
+
'- `references/widgets-and-apps.md` — MCP Apps, React `view` widgets, the widget hook surface, output shaping, and CSP.',
|
|
37
|
+
'- `references/test-in-hosts.md` — connect and test in ChatGPT (developer mode), Claude, agent hosts, and MCP Inspector.',
|
|
38
|
+
'- `references/troubleshooting.md` — runtime symptom → cause → fix, in-host and hosted.',
|
|
39
|
+
'- `references/deploy-and-ops.md` — login/link/deploy/status/access and hosted operations.',
|
|
40
|
+
'- `references/publishing.md` — submit to the ChatGPT apps directory and Claude connectors directory.',
|
|
41
|
+
'- `references/chatgpt-compliance.md` — the OpenAI Apps SDK pre-submission checklist (beyond the metadata gate): conversational value, helpful-UI-only, in-chat completion, UI guidelines, domain guardrails, privacy.',
|
|
42
|
+
'- `references/examples.md` — flagship example index and a canonical `server.ts`.',
|
|
43
|
+
];
|
|
23
44
|
export function skillRouterBody(target) {
|
|
24
45
|
const preamble = target === 'codex'
|
|
25
46
|
? 'Use this skill for local Noodle Seed project work in Codex.'
|
|
@@ -54,21 +75,7 @@ export function skillRouterBody(target) {
|
|
|
54
75
|
'',
|
|
55
76
|
'Scan all of these during discovery; open in full the ones your task touches:',
|
|
56
77
|
'',
|
|
57
|
-
|
|
58
|
-
'- `references/sdk-surface.md` — what to import from `@noodleseed/one` and which builder to use.',
|
|
59
|
-
'- `references/cli-commands.md` — every `noodle` command, grouped by area.',
|
|
60
|
-
'- `references/compile-errors.md` — fix `noodle validate` errors by code.',
|
|
61
|
-
'- `references/authoring-workflow.md` — input paths (scrape / OpenAPI import / user interview), the fit check, the validate→test→dev repair loop, connectors, and secrets/variables.',
|
|
62
|
-
'- `references/embedded-assistant.md` — HTTPS origins, managed model config, deploy-before-client sequencing, backend session exchange, browser mounting, and credential boundaries.',
|
|
63
|
-
'- `references/connect-an-api.md` — given an API key: secure it, probe the live API to learn the real shape, model the connector, and prove real output before building.',
|
|
64
|
-
'- `references/experience-design.md` — design the app experience before authoring: funnel/handoff boundary, grounding, two-users, display modes, and the wireframe/UX spec.',
|
|
65
|
-
'- `references/widgets-and-apps.md` — MCP Apps, React `view` widgets, the widget hook surface, output shaping, and CSP.',
|
|
66
|
-
'- `references/test-in-hosts.md` — connect and test in ChatGPT (developer mode), Claude, agent hosts, and MCP Inspector.',
|
|
67
|
-
'- `references/troubleshooting.md` — runtime symptom → cause → fix, in-host and hosted.',
|
|
68
|
-
'- `references/deploy-and-ops.md` — login/link/deploy/status/access and hosted operations.',
|
|
69
|
-
'- `references/publishing.md` — submit to the ChatGPT apps directory and Claude connectors directory.',
|
|
70
|
-
'- `references/chatgpt-compliance.md` — the OpenAI Apps SDK pre-submission checklist (beyond the metadata gate): conversational value, helpful-UI-only, in-chat completion, UI guidelines, domain guardrails, privacy.',
|
|
71
|
-
'- `references/examples.md` — flagship example index and a canonical `server.ts`.',
|
|
78
|
+
...REFERENCE_INDEX_LINES,
|
|
72
79
|
'',
|
|
73
80
|
'## Safety',
|
|
74
81
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-content.js","sourceRoot":"","sources":["../src/skill-content.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iGAAiG;AACjG,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,8FAA8F;AAC9F,4FAA4F;AAC5F,wEAAwE;AACxE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MA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,EAAE,MAAM,EAAE,gCAAgC,EAAE;IACzF,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,EAAE,2BAA2B,EAAE;IAChF,EAAE,OAAO,EAAE,iCAAiC,EAAE,MAAM,EAAE,+BAA+B,EAAE;IACvF,EAAE,OAAO,EAAE,gCAAgC,EAAE,MAAM,EAAE,6BAA6B,EAAE;IACpF,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,EAAE,0BAA0B,EAAE;IAC9E,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,EAAE,8BAA8B,EAAE;IACpF,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,EAAE,2BAA2B,EAAE;IAChF,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,EAAE,yBAAyB,EAAE;IAC1E,EAAE,OAAO,EAAE,kCAAkC,EAAE,MAAM,EAAE,gCAAgC,EAAE;IACzF,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,uBAAuB,EAAE;CACvE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BillingAccountMemberRecord, type BillingAccountRecord, type BillingIdentityRef, type EntitlementSnapshotRecord, type OrgBillingLinkRecord, type PlanVersionRecord } from './model.js';
|
|
2
|
-
import type { BillingAccountStore, EnsureDefaultBillingAccountInput, EnsureOrgBillingLinkInput } from './store.js';
|
|
2
|
+
import type { BillingAccountStore, EnsureDefaultBillingAccountInput, EnsureOrgBillingLinkInput, LegacyBillingAccountPreparationRecord } from './store.js';
|
|
3
3
|
export declare abstract class InMemoryBillingAccountStore implements BillingAccountStore {
|
|
4
4
|
#private;
|
|
5
5
|
protected constructor(options: {
|
|
@@ -20,6 +20,7 @@ export declare abstract class InMemoryBillingAccountStore implements BillingAcco
|
|
|
20
20
|
ensureDefaultBillingAccount(input: EnsureDefaultBillingAccountInput): Promise<BillingAccountRecord>;
|
|
21
21
|
getBillingAccount(id: string): Promise<BillingAccountRecord | undefined>;
|
|
22
22
|
getDefaultBillingAccount(identity: BillingIdentityRef): Promise<BillingAccountRecord | undefined>;
|
|
23
|
+
listBillingAccountMemberships(identity: BillingIdentityRef): Promise<readonly BillingAccountMemberRecord[]>;
|
|
23
24
|
listBillingAccountMembers(id: string): Promise<readonly BillingAccountMemberRecord[]>;
|
|
24
25
|
removeBillingAccountMember(input: BillingIdentityRef & {
|
|
25
26
|
readonly billingAccountId: string;
|
|
@@ -28,5 +29,7 @@ export declare abstract class InMemoryBillingAccountStore implements BillingAcco
|
|
|
28
29
|
getActiveEntitlementSnapshot(billingAccountId: string): Promise<EntitlementSnapshotRecord | undefined>;
|
|
29
30
|
ensureOrgBillingLink(input: EnsureOrgBillingLinkInput): Promise<OrgBillingLinkRecord>;
|
|
30
31
|
getOrgBillingLink(org: string): Promise<OrgBillingLinkRecord | undefined>;
|
|
32
|
+
listOrgBillingLinksForAccount(id: string): Promise<readonly OrgBillingLinkRecord[]>;
|
|
33
|
+
getLegacyBillingMigrationPreparationForAccount(id: string): Promise<LegacyBillingAccountPreparationRecord | undefined>;
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=in-memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../src/billing/in-memory.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAIvB,KAAK,yBAAyB,EAK9B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAGvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,mBAAmB,EACnB,gCAAgC,EAChC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../src/billing/in-memory.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAIvB,KAAK,yBAAyB,EAK9B,KAAK,oBAA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EAAE,CAAC;IAc/E,0BAA0B,CAC9B,KAAK,EAAE,kBAAkB,GAAG;QAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,GAChE,OAAO,CAAC,OAAO,CAAC;IAoBnB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAIlE,4BAA4B,CAC1B,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAM3C,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA0D3F,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAIzE,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC;IASnF,8CAA8C,CAC5C,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,qCAAqC,GAAG,SAAS,CAAC;CAI9D"}
|
|
@@ -89,6 +89,14 @@ export class InMemoryBillingAccountStore {
|
|
|
89
89
|
const id = this.#defaults.get(billingIdentityKey(normalizeBillingIdentity(identity)));
|
|
90
90
|
return Promise.resolve(id === undefined ? undefined : this.#accounts.get(id));
|
|
91
91
|
}
|
|
92
|
+
listBillingAccountMemberships(identity) {
|
|
93
|
+
const normalized = normalizeBillingIdentity(identity);
|
|
94
|
+
return Promise.resolve([...this.#members.values()]
|
|
95
|
+
.filter((member) => member.identityIssuer === normalized.identityIssuer &&
|
|
96
|
+
member.subject === normalized.subject)
|
|
97
|
+
.sort((a, b) => a.createdAt.localeCompare(b.createdAt) ||
|
|
98
|
+
a.billingAccountId.localeCompare(b.billingAccountId)));
|
|
99
|
+
}
|
|
92
100
|
listBillingAccountMembers(id) {
|
|
93
101
|
const billingAccountId = validateBillingAccountId(id);
|
|
94
102
|
return Promise.resolve([...this.#members.values()]
|
|
@@ -176,6 +184,16 @@ export class InMemoryBillingAccountStore {
|
|
|
176
184
|
getOrgBillingLink(org) {
|
|
177
185
|
return Promise.resolve(this.#orgLinks.get(validateSlug('org', org)));
|
|
178
186
|
}
|
|
187
|
+
listOrgBillingLinksForAccount(id) {
|
|
188
|
+
const billingAccountId = validateBillingAccountId(id);
|
|
189
|
+
return Promise.resolve([...this.#orgLinks.values()]
|
|
190
|
+
.filter((link) => link.billingAccountId === billingAccountId)
|
|
191
|
+
.sort((a, b) => a.orgSlug.localeCompare(b.orgSlug)));
|
|
192
|
+
}
|
|
193
|
+
getLegacyBillingMigrationPreparationForAccount(id) {
|
|
194
|
+
validateBillingAccountId(id);
|
|
195
|
+
return Promise.resolve(undefined);
|
|
196
|
+
}
|
|
179
197
|
}
|
|
180
198
|
function restoreMap(target, source) {
|
|
181
199
|
target.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory.js","sourceRoot":"","sources":["../../src/billing/in-memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAIL,kBAAkB,EAClB,gBAAgB,EAChB,+BAA+B,EAE/B,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EAGxB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory.js","sourceRoot":"","sources":["../../src/billing/in-memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAIL,kBAAkB,EAClB,gBAAgB,EAChB,+BAA+B,EAE/B,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EAGxB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAgB,2BAA2B;IACtC,SAAS,GAAG,IAAI,GAAG,EAAgC,CAAC;IACpD,SAAS,GAAG,IA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,gBAAgB,GAAG,wBAAwB,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,OAAO,CAAC,OAAO,CACpB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;aACzB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,CAAC;aAC5D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CACtD,CAAC;IACJ,CAAC;IAED,8CAA8C,CAC5C,EAAU;QAEV,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF;AAED,SAAS,UAAU,CAAO,MAAiB,EAAE,MAAyB;IACpE,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Pool } from 'pg';
|
|
2
|
+
import { type BillingAccountMemberRecord, type BillingIdentityRef, type OrgBillingLinkRecord } from './model.js';
|
|
3
|
+
import type { LegacyBillingAccountPreparationRecord } from './store.js';
|
|
4
|
+
export declare function listBillingAccountMembershipRows(pool: Pool, identity: BillingIdentityRef): Promise<readonly BillingAccountMemberRecord[]>;
|
|
5
|
+
export declare function listOrgBillingLinkRowsForAccount(pool: Pool, id: string): Promise<readonly OrgBillingLinkRecord[]>;
|
|
6
|
+
export declare function getLegacyBillingMigrationPreparationForAccountRow(pool: Pool, id: string): Promise<LegacyBillingAccountPreparationRecord | undefined>;
|
|
7
|
+
//# sourceMappingURL=postgres-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-read.d.ts","sourceRoot":"","sources":["../../src/billing/postgres-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAE1B,MAAM,YAAY,CAAC;AAOpB,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,YAAY,CAAC;AAExE,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,SAAS,0BAA0B,EAAE,CAAC,CAShD;AAED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAY1C;AAED,wBAAsB,iDAAiD,CACrE,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,qCAAqC,GAAG,SAAS,CAAC,CAiC5D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { normalizeBillingIdentity, validateBillingAccountId, } from './model.js';
|
|
2
|
+
import { memberRowToRecord, orgBillingLinkRowToRecord, } from './postgres-records.js';
|
|
3
|
+
export async function listBillingAccountMembershipRows(pool, identity) {
|
|
4
|
+
const normalized = normalizeBillingIdentity(identity);
|
|
5
|
+
const { rows } = await pool.query(`SELECT * FROM billing_account_members
|
|
6
|
+
WHERE identity_issuer = $1 AND subject = $2
|
|
7
|
+
ORDER BY created_at, billing_account_id`, [normalized.identityIssuer, normalized.subject]);
|
|
8
|
+
return rows.map(memberRowToRecord);
|
|
9
|
+
}
|
|
10
|
+
export async function listOrgBillingLinkRowsForAccount(pool, id) {
|
|
11
|
+
const { rows } = await pool.query(`SELECT links.*,
|
|
12
|
+
home.home_owner_identity_issuer,
|
|
13
|
+
home.home_owner_subject
|
|
14
|
+
FROM org_billing_links AS links
|
|
15
|
+
JOIN org_billing_home_accounts AS home ON home.org_slug = links.org_slug
|
|
16
|
+
WHERE links.billing_account_id = $1
|
|
17
|
+
ORDER BY links.org_slug`, [validateBillingAccountId(id)]);
|
|
18
|
+
return rows.map(orgBillingLinkRowToRecord);
|
|
19
|
+
}
|
|
20
|
+
export async function getLegacyBillingMigrationPreparationForAccountRow(pool, id) {
|
|
21
|
+
const { rows } = await pool.query(`SELECT migrated.billing_account_id,
|
|
22
|
+
preparation.prepared_at,
|
|
23
|
+
migrated.organization_count,
|
|
24
|
+
migrated.production_app_count,
|
|
25
|
+
migrated.production_capacity,
|
|
26
|
+
migrated.grant_candidate_at_preparation
|
|
27
|
+
FROM billing_legacy_migration_accounts AS migrated
|
|
28
|
+
JOIN billing_legacy_migration_preparations AS preparation
|
|
29
|
+
ON preparation.id = migrated.migration_id
|
|
30
|
+
WHERE migrated.billing_account_id = $1`, [validateBillingAccountId(id)]);
|
|
31
|
+
const row = rows[0];
|
|
32
|
+
if (row === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
return {
|
|
35
|
+
billingAccountId: validateBillingAccountId(row.billing_account_id),
|
|
36
|
+
preparedAt: persistedTimestamp('legacy billing preparation', row.prepared_at),
|
|
37
|
+
organizationCount: persistedNonNegativeInteger('legacy billing organization count', row.organization_count),
|
|
38
|
+
productionAppCount: persistedNonNegativeInteger('legacy billing production app count', row.production_app_count),
|
|
39
|
+
productionCapacity: persistedNonNegativeInteger('legacy billing production capacity', row.production_capacity),
|
|
40
|
+
grantCandidateAtPreparation: row.grant_candidate_at_preparation,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function persistedTimestamp(name, value) {
|
|
44
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
45
|
+
if (!Number.isFinite(date.getTime()))
|
|
46
|
+
throw new Error(`persisted ${name} timestamp is invalid`);
|
|
47
|
+
return date.toISOString();
|
|
48
|
+
}
|
|
49
|
+
function persistedNonNegativeInteger(name, value) {
|
|
50
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
51
|
+
throw new Error(`persisted ${name} must be a non-negative integer`);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=postgres-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-read.js","sourceRoot":"","sources":["../../src/billing/postgres-read.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,wBAAwB,EAExB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,iBAAiB,EAEjB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,IAAU,EACV,QAA4B;IAE5B,MAAM,UAAU,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAC/B;;6CAEyC,EACzC,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,CAChD,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,IAAU,EACV,EAAU;IAEV,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAC/B;;;;;;6BAMyB,EACzB,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAC/B,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iDAAiD,CACrE,IAAU,EACV,EAAU;IAEV,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAC/B;;;;;;;;;4CASwC,EACxC,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAC/B,CAAC;IACF,MAAM,GAAG,GAAG,IAA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":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAI/B,2FAA2F;AAC3F,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"postgres-schema.d.ts","sourceRoot":"","sources":["../../src/billing/postgres-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAI/B,2FAA2F;AAC3F,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA+NnE"}
|
|
@@ -125,6 +125,10 @@ export async function ensureBillingSchema(pool) {
|
|
|
125
125
|
FOREIGN KEY (org_slug, home_free_billing_account_id)
|
|
126
126
|
REFERENCES org_billing_home_accounts(org_slug, billing_account_id) ON DELETE RESTRICT
|
|
127
127
|
)
|
|
128
|
+
`);
|
|
129
|
+
await pool.query(`
|
|
130
|
+
CREATE INDEX IF NOT EXISTS org_billing_links_billing_account_org_idx
|
|
131
|
+
ON org_billing_links (billing_account_id, org_slug)
|
|
128
132
|
`);
|
|
129
133
|
await pool.query(`
|
|
130
134
|
CREATE TABLE IF NOT EXISTS billing_legacy_migration_preparations (
|
|
@@ -156,6 +160,10 @@ export async function ensureBillingSchema(pool) {
|
|
|
156
160
|
grant_candidate_at_preparation boolean NOT NULL,
|
|
157
161
|
PRIMARY KEY (migration_id, billing_account_id)
|
|
158
162
|
)
|
|
163
|
+
`);
|
|
164
|
+
await pool.query(`
|
|
165
|
+
CREATE INDEX IF NOT EXISTS billing_legacy_migration_accounts_billing_account_idx
|
|
166
|
+
ON billing_legacy_migration_accounts (billing_account_id)
|
|
159
167
|
`);
|
|
160
168
|
await pool.query(`
|
|
161
169
|
CREATE TABLE IF NOT EXISTS billing_legacy_migration_organizations (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-schema.js","sourceRoot":"","sources":["../../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