@funnelsgrove/cli 0.1.295 → 0.1.297
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/cli.js +53 -0
- package/dist/offerSetCommands.d.ts +133 -0
- package/dist/offerSetCommands.js +405 -0
- package/funnel-contract-compatibility.json +28 -28
- package/package.json +1 -1
- package/template_docs/.funnelsgrove-docs.json +3 -3
- package/template_docs/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_docs/funnel-docs.config.json +1 -1
- package/template_scaffold/.funnelsgrove-docs.json +3 -3
- package/template_scaffold/.funnelsgrove-scaffold.json +5 -5
- package/template_scaffold/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_scaffold/funnel-docs.config.json +1 -1
package/README.md
CHANGED
|
@@ -205,6 +205,25 @@ Publishing creates new rows and updates rows already present in the file. It nev
|
|
|
205
205
|
deletes remote expenses that are absent from the file, and it refuses to overwrite
|
|
206
206
|
rows changed since the last pull. Pull again to resolve a concurrent edit.
|
|
207
207
|
|
|
208
|
+
Edit Offer Sets the same way. For discounted intro prices and two-stage discounts,
|
|
209
|
+
see the repository guide
|
|
210
|
+
`docs/guides/edit-offer-sets.md`:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
fgrove offer-sets pull --project claimbee # writes offer-sets.json
|
|
214
|
+
fgrove offer-sets prices --project claimbee --env live
|
|
215
|
+
# edit offer-sets.json; for a new set omit id/updatedAt, keep paymentProfileId
|
|
216
|
+
fgrove offer-sets publish --project claimbee --dry-run
|
|
217
|
+
fgrove offer-sets publish --project claimbee
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Only changed sets are sent. Set `isActive` to `false` to archive a set, which
|
|
221
|
+
fails while a funnel, route, domain or experiment still uses it. Sets absent
|
|
222
|
+
from the file are never deleted, and publishing refuses sets changed since the
|
|
223
|
+
last pull. Item `paymentProfileBindings` (for example a PayPal binding) are not
|
|
224
|
+
in the file; existing ones are kept, and a new set copied from another starts
|
|
225
|
+
without them.
|
|
226
|
+
|
|
208
227
|
Use `--api-url` or `FUNNELSGROVE_API_URL` for non-production APIs.
|
|
209
228
|
Use `--config` or `FUNNELSGROVE_CONFIG` to keep test credentials separate from the default `~/.funnelsgrove/config.json`.
|
|
210
229
|
|
package/dist/cli.js
CHANGED
|
@@ -19,6 +19,7 @@ import { pullEnvFile } from './envSync.js';
|
|
|
19
19
|
import { executeFastDraftPatchSync, uploadDirectAssetWithFetch } from './draftPatchSync.js';
|
|
20
20
|
import { updateCliInstallations } from './selfUpdate.js';
|
|
21
21
|
import { executeExpensePublish, executeExpensePull } from './expenseCommands.js';
|
|
22
|
+
import { executeOfferSetPrices, executeOfferSetPublish, executeOfferSetPull, formatOfferSetPriceCatalogs, } from './offerSetCommands.js';
|
|
22
23
|
import { executeEmailPull, executeEmailPush, executeEmailSend, executeEmailUpdateVariables, executeEmailSequenceAddStep, executeEmailSequenceCancel, executeEmailSequenceCreate, executeEmailSequencePublish, executeEmailSequenceSetActive, executeEmailLibraryAdd, executeEmailLibraryList, executeEmailTemplatePublish, executeEmailValidate, parseEmailVariablesJson, } from './emailCommands.js';
|
|
23
24
|
import { formatGitHubConnectRows, formatGitHubJobRows, formatGitHubStatusRows, } from './githubOutput.js';
|
|
24
25
|
import { GitHubSyncTimeoutError, syncGitHubDraftIfConnected, } from './githubSyncFlow.js';
|
|
@@ -2160,6 +2161,58 @@ templatesCommand.command('show <slug>')
|
|
|
2160
2161
|
? `${JSON.stringify(template)}\n`
|
|
2161
2162
|
: `${renderFunnelTemplate(template)}\n`);
|
|
2162
2163
|
});
|
|
2164
|
+
const offerSetsCommand = addExamples(program.command('offer-sets').alias('offers').description('Edit project offer sets'), [
|
|
2165
|
+
'fgrove offer-sets pull --project claimbee',
|
|
2166
|
+
'fgrove offer-sets prices --project claimbee --env live',
|
|
2167
|
+
'fgrove offer-sets publish --project claimbee --dry-run',
|
|
2168
|
+
'fgrove offer-sets publish --project claimbee',
|
|
2169
|
+
]);
|
|
2170
|
+
const addOfferSetScopeOptions = (command) => command
|
|
2171
|
+
.option('--workspace <id-or-slug-or-name>', 'Workspace id, slug, or name')
|
|
2172
|
+
.option('--project <id-or-slug-or-name>', 'Project id, slug, or name')
|
|
2173
|
+
.option('--file <path>', 'Offer set JSON file', 'offer-sets.json');
|
|
2174
|
+
addOfferSetScopeOptions(offerSetsCommand
|
|
2175
|
+
.command('pull')
|
|
2176
|
+
.description('Download every offer set, including archived ones, to an editable JSON file'))
|
|
2177
|
+
.action(async (options) => {
|
|
2178
|
+
const scope = await resolveExpenseCommandScope(options);
|
|
2179
|
+
const count = await executeOfferSetPull(scope);
|
|
2180
|
+
console.log(`Pulled ${count} offer set${count === 1 ? '' : 's'} to ${scope.filePath}.`);
|
|
2181
|
+
});
|
|
2182
|
+
addOfferSetScopeOptions(offerSetsCommand
|
|
2183
|
+
.command('publish')
|
|
2184
|
+
.description('Create, update, archive, and reactivate offer sets from an edited JSON file')
|
|
2185
|
+
.option('--dry-run', 'Print the changes without saving them'))
|
|
2186
|
+
.action(async (options) => {
|
|
2187
|
+
const scope = await resolveExpenseCommandScope(options);
|
|
2188
|
+
const changes = await executeOfferSetPublish({ ...scope, dryRun: options.dryRun });
|
|
2189
|
+
if (changes.length === 0) {
|
|
2190
|
+
console.log('No offer set changes to publish.');
|
|
2191
|
+
return;
|
|
2192
|
+
}
|
|
2193
|
+
console.log(options.dryRun ? 'Would publish:' : 'Published:');
|
|
2194
|
+
for (const change of changes)
|
|
2195
|
+
console.log(` ${change}`);
|
|
2196
|
+
});
|
|
2197
|
+
offerSetsCommand
|
|
2198
|
+
.command('prices')
|
|
2199
|
+
.description('List provider prices and coupons to map into offer set items (Stripe is read live)')
|
|
2200
|
+
.option('--workspace <id-or-slug-or-name>', 'Workspace id, slug, or name')
|
|
2201
|
+
.option('--project <id-or-slug-or-name>', 'Project id, slug, or name')
|
|
2202
|
+
.option('--payment-profile <id-or-name>', 'Only this payment profile')
|
|
2203
|
+
.option('--env <environment>', 'test or live (default: both)')
|
|
2204
|
+
.option('--json', 'Print machine-readable JSON')
|
|
2205
|
+
.action(async (options) => {
|
|
2206
|
+
if (options.env && options.env !== 'test' && options.env !== 'live')
|
|
2207
|
+
throw new Error('--env must be test or live.');
|
|
2208
|
+
const scope = await resolveExpenseCommandScope({ ...options, file: '.' });
|
|
2209
|
+
const catalogs = await executeOfferSetPrices({
|
|
2210
|
+
...scope,
|
|
2211
|
+
paymentProfile: options.paymentProfile,
|
|
2212
|
+
environment: options.env,
|
|
2213
|
+
});
|
|
2214
|
+
console.log(options.json ? JSON.stringify({ catalogs }, null, 2) : formatOfferSetPriceCatalogs(catalogs).join('\n'));
|
|
2215
|
+
});
|
|
2163
2216
|
const funnelsCommand = addExamples(program.command('funnels').description('Manage funnels'), [
|
|
2164
2217
|
'fgrove funnels list',
|
|
2165
2218
|
'fgrove funnels clone --funnel claimbee --name claimbee-ios',
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
type CallApi = <T>(input: {
|
|
2
|
+
path: string;
|
|
3
|
+
type: 'query' | 'mutation';
|
|
4
|
+
data?: unknown;
|
|
5
|
+
token?: string | null;
|
|
6
|
+
}) => Promise<T>;
|
|
7
|
+
export type OfferSetApiItem = {
|
|
8
|
+
id?: string;
|
|
9
|
+
funnel_plan_key: string;
|
|
10
|
+
title: string | null;
|
|
11
|
+
test_provider_plan_id: string | null;
|
|
12
|
+
live_provider_plan_id: string | null;
|
|
13
|
+
follow_up_test_provider_plan_id?: string | null;
|
|
14
|
+
follow_up_live_provider_plan_id?: string | null;
|
|
15
|
+
follow_up_title?: string | null;
|
|
16
|
+
follow_up_billing_interval?: string | null;
|
|
17
|
+
follow_up_billing_interval_count?: number | null;
|
|
18
|
+
intro_iterations?: number | null;
|
|
19
|
+
analytics_purchase_value: number | null;
|
|
20
|
+
is_default: boolean;
|
|
21
|
+
display_name_override: string | null;
|
|
22
|
+
featured_tag: string | null;
|
|
23
|
+
old_price_label: string | null;
|
|
24
|
+
metadata: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
export type OfferSetApiRow = {
|
|
27
|
+
id: string;
|
|
28
|
+
key: string;
|
|
29
|
+
display_name: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
is_active: boolean;
|
|
32
|
+
payment_profile_id: string | null;
|
|
33
|
+
items: OfferSetApiItem[];
|
|
34
|
+
metadata: Record<string, unknown>;
|
|
35
|
+
updated_at: string;
|
|
36
|
+
};
|
|
37
|
+
type PaymentProfileApiRow = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
provider: string;
|
|
41
|
+
};
|
|
42
|
+
export type OfferSetFileItem = {
|
|
43
|
+
id?: string;
|
|
44
|
+
funnelPlanKey: string;
|
|
45
|
+
title: string | null;
|
|
46
|
+
testProviderPlanId: string | null;
|
|
47
|
+
liveProviderPlanId: string | null;
|
|
48
|
+
followUpTestProviderPlanId: string | null;
|
|
49
|
+
followUpLiveProviderPlanId: string | null;
|
|
50
|
+
followUpTitle: string | null;
|
|
51
|
+
followUpBillingInterval: string | null;
|
|
52
|
+
followUpBillingIntervalCount: number | null;
|
|
53
|
+
introIterations: number | null;
|
|
54
|
+
analyticsPurchaseValue: number | null;
|
|
55
|
+
isDefault: boolean;
|
|
56
|
+
displayNameOverride: string | null;
|
|
57
|
+
featuredTag: string | null;
|
|
58
|
+
oldPriceLabel: string | null;
|
|
59
|
+
metadata: Record<string, unknown>;
|
|
60
|
+
};
|
|
61
|
+
export type OfferSetFileEntry = {
|
|
62
|
+
id?: string;
|
|
63
|
+
updatedAt?: string;
|
|
64
|
+
key?: string;
|
|
65
|
+
paymentProfileId: string;
|
|
66
|
+
displayName: string;
|
|
67
|
+
description: string | null;
|
|
68
|
+
isActive: boolean;
|
|
69
|
+
metadata: Record<string, unknown>;
|
|
70
|
+
items: OfferSetFileItem[];
|
|
71
|
+
};
|
|
72
|
+
export type OfferSetFile = {
|
|
73
|
+
schemaVersion: 1;
|
|
74
|
+
projectId: string;
|
|
75
|
+
paymentProfiles?: PaymentProfileApiRow[];
|
|
76
|
+
offerSets: OfferSetFileEntry[];
|
|
77
|
+
};
|
|
78
|
+
type OfferSetCommandScope = {
|
|
79
|
+
callApi: CallApi;
|
|
80
|
+
token: string;
|
|
81
|
+
workspaceId: string;
|
|
82
|
+
projectId: string;
|
|
83
|
+
};
|
|
84
|
+
export declare const parseOfferSetFile: (contents: string, expectedProjectId: string) => OfferSetFile;
|
|
85
|
+
export declare const executeOfferSetPull: (input: OfferSetCommandScope & {
|
|
86
|
+
filePath: string;
|
|
87
|
+
}) => Promise<number>;
|
|
88
|
+
export type OfferSetPublishPlan = {
|
|
89
|
+
replace: Map<string, number[]>;
|
|
90
|
+
archive: number[];
|
|
91
|
+
reactivate: number[];
|
|
92
|
+
};
|
|
93
|
+
export declare const planOfferSetPublish: (file: OfferSetFile, remote: OfferSetApiRow[]) => OfferSetPublishPlan;
|
|
94
|
+
export declare const describeOfferSetPublishPlan: (file: OfferSetFile, plan: OfferSetPublishPlan) => string[];
|
|
95
|
+
export declare const executeOfferSetPublish: (input: OfferSetCommandScope & {
|
|
96
|
+
filePath: string;
|
|
97
|
+
dryRun?: boolean;
|
|
98
|
+
}) => Promise<string[]>;
|
|
99
|
+
export type OfferSetPrice = {
|
|
100
|
+
providerPlanId: string;
|
|
101
|
+
displayName: string | null;
|
|
102
|
+
amountMinor: number | null;
|
|
103
|
+
currency: string | null;
|
|
104
|
+
interval: string | null;
|
|
105
|
+
intervalCount: number | null;
|
|
106
|
+
trialPeriodDays: number | null;
|
|
107
|
+
active: boolean;
|
|
108
|
+
};
|
|
109
|
+
export type OfferSetCoupon = {
|
|
110
|
+
providerCouponId: string;
|
|
111
|
+
displayName: string | null;
|
|
112
|
+
percentOff: number | null;
|
|
113
|
+
amountOffMinor: number | null;
|
|
114
|
+
currency: string | null;
|
|
115
|
+
duration: string | null;
|
|
116
|
+
active: boolean;
|
|
117
|
+
};
|
|
118
|
+
export type OfferSetPriceCatalog = {
|
|
119
|
+
paymentProfileId: string;
|
|
120
|
+
paymentProfileName: string;
|
|
121
|
+
provider: string;
|
|
122
|
+
environment: 'test' | 'live';
|
|
123
|
+
source: 'live' | 'synced' | 'unavailable';
|
|
124
|
+
reason: string | null;
|
|
125
|
+
prices: OfferSetPrice[];
|
|
126
|
+
coupons: OfferSetCoupon[];
|
|
127
|
+
};
|
|
128
|
+
export declare const executeOfferSetPrices: (input: OfferSetCommandScope & {
|
|
129
|
+
paymentProfile?: string;
|
|
130
|
+
environment?: "test" | "live";
|
|
131
|
+
}) => Promise<OfferSetPriceCatalog[]>;
|
|
132
|
+
export declare const formatOfferSetPriceCatalogs: (catalogs: OfferSetPriceCatalog[]) => string[];
|
|
133
|
+
export {};
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
3
|
+
const asObject = (value, label) => {
|
|
4
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
5
|
+
throw new Error(`${label} must be an object.`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
const requiredString = (value, label) => {
|
|
10
|
+
if (typeof value !== 'string' || !value.trim())
|
|
11
|
+
throw new Error(`${label} must be a non-empty string.`);
|
|
12
|
+
return value.trim();
|
|
13
|
+
};
|
|
14
|
+
const nullableString = (value, label) => {
|
|
15
|
+
if (value === null || value === undefined || value === '')
|
|
16
|
+
return null;
|
|
17
|
+
if (typeof value !== 'string')
|
|
18
|
+
throw new Error(`${label} must be a string or null.`);
|
|
19
|
+
return value.trim() || null;
|
|
20
|
+
};
|
|
21
|
+
const nullableNumber = (value, label, integer) => {
|
|
22
|
+
if (value === null || value === undefined)
|
|
23
|
+
return null;
|
|
24
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value < (integer ? 1 : 0) || (integer && !Number.isInteger(value))) {
|
|
25
|
+
throw new Error(`${label} must be ${integer ? 'a positive integer' : 'a non-negative number'} or null.`);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
};
|
|
29
|
+
const optionalUuid = (value, label) => {
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const id = requiredString(value, label);
|
|
33
|
+
if (!UUID_PATTERN.test(id))
|
|
34
|
+
throw new Error(`${label} must be a UUID.`);
|
|
35
|
+
return id;
|
|
36
|
+
};
|
|
37
|
+
const optionalMetadata = (value, label) => (value === undefined ? {} : asObject(value, label));
|
|
38
|
+
const itemToFile = (item) => ({
|
|
39
|
+
...(item.id ? { id: item.id } : {}),
|
|
40
|
+
funnelPlanKey: item.funnel_plan_key,
|
|
41
|
+
title: item.title ?? null,
|
|
42
|
+
testProviderPlanId: item.test_provider_plan_id ?? null,
|
|
43
|
+
liveProviderPlanId: item.live_provider_plan_id ?? null,
|
|
44
|
+
followUpTestProviderPlanId: item.follow_up_test_provider_plan_id ?? null,
|
|
45
|
+
followUpLiveProviderPlanId: item.follow_up_live_provider_plan_id ?? null,
|
|
46
|
+
followUpTitle: item.follow_up_title ?? null,
|
|
47
|
+
followUpBillingInterval: item.follow_up_billing_interval ?? null,
|
|
48
|
+
followUpBillingIntervalCount: item.follow_up_billing_interval_count ?? null,
|
|
49
|
+
introIterations: item.intro_iterations ?? null,
|
|
50
|
+
analyticsPurchaseValue: item.analytics_purchase_value ?? null,
|
|
51
|
+
isDefault: item.is_default === true,
|
|
52
|
+
displayNameOverride: item.display_name_override ?? null,
|
|
53
|
+
featuredTag: item.featured_tag ?? null,
|
|
54
|
+
oldPriceLabel: item.old_price_label ?? null,
|
|
55
|
+
metadata: item.metadata || {},
|
|
56
|
+
});
|
|
57
|
+
const rowToFileEntry = (row) => ({
|
|
58
|
+
id: row.id,
|
|
59
|
+
updatedAt: row.updated_at,
|
|
60
|
+
key: row.key,
|
|
61
|
+
paymentProfileId: row.payment_profile_id,
|
|
62
|
+
displayName: row.display_name,
|
|
63
|
+
description: row.description,
|
|
64
|
+
isActive: row.is_active,
|
|
65
|
+
metadata: row.metadata || {},
|
|
66
|
+
items: row.items.map(itemToFile),
|
|
67
|
+
});
|
|
68
|
+
const parseItem = (value, label) => {
|
|
69
|
+
const item = asObject(value, label);
|
|
70
|
+
const id = optionalUuid(item.id, `${label}.id`);
|
|
71
|
+
return {
|
|
72
|
+
...(id ? { id } : {}),
|
|
73
|
+
funnelPlanKey: requiredString(item.funnelPlanKey, `${label}.funnelPlanKey`),
|
|
74
|
+
title: nullableString(item.title, `${label}.title`),
|
|
75
|
+
testProviderPlanId: nullableString(item.testProviderPlanId, `${label}.testProviderPlanId`),
|
|
76
|
+
liveProviderPlanId: nullableString(item.liveProviderPlanId, `${label}.liveProviderPlanId`),
|
|
77
|
+
followUpTestProviderPlanId: nullableString(item.followUpTestProviderPlanId, `${label}.followUpTestProviderPlanId`),
|
|
78
|
+
followUpLiveProviderPlanId: nullableString(item.followUpLiveProviderPlanId, `${label}.followUpLiveProviderPlanId`),
|
|
79
|
+
followUpTitle: nullableString(item.followUpTitle, `${label}.followUpTitle`),
|
|
80
|
+
followUpBillingInterval: nullableString(item.followUpBillingInterval, `${label}.followUpBillingInterval`),
|
|
81
|
+
followUpBillingIntervalCount: nullableNumber(item.followUpBillingIntervalCount, `${label}.followUpBillingIntervalCount`, true),
|
|
82
|
+
introIterations: nullableNumber(item.introIterations, `${label}.introIterations`, true),
|
|
83
|
+
analyticsPurchaseValue: nullableNumber(item.analyticsPurchaseValue, `${label}.analyticsPurchaseValue`, false),
|
|
84
|
+
isDefault: item.isDefault === true,
|
|
85
|
+
displayNameOverride: nullableString(item.displayNameOverride, `${label}.displayNameOverride`),
|
|
86
|
+
featuredTag: nullableString(item.featuredTag, `${label}.featuredTag`),
|
|
87
|
+
oldPriceLabel: nullableString(item.oldPriceLabel, `${label}.oldPriceLabel`),
|
|
88
|
+
metadata: optionalMetadata(item.metadata, `${label}.metadata`),
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export const parseOfferSetFile = (contents, expectedProjectId) => {
|
|
92
|
+
let parsed;
|
|
93
|
+
try {
|
|
94
|
+
parsed = JSON.parse(contents);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
throw new Error('Offer set file is not valid JSON.');
|
|
98
|
+
}
|
|
99
|
+
const root = asObject(parsed, 'Offer set file');
|
|
100
|
+
if (root.schemaVersion !== 1)
|
|
101
|
+
throw new Error('Offer set file schemaVersion must be 1.');
|
|
102
|
+
const projectId = requiredString(root.projectId, 'projectId');
|
|
103
|
+
if (projectId !== expectedProjectId) {
|
|
104
|
+
throw new Error(`Offer set file belongs to project ${projectId}, not ${expectedProjectId}.`);
|
|
105
|
+
}
|
|
106
|
+
if (!Array.isArray(root.offerSets))
|
|
107
|
+
throw new Error('offerSets must be an array.');
|
|
108
|
+
const seenIds = new Set();
|
|
109
|
+
const offerSets = root.offerSets.map((value, index) => {
|
|
110
|
+
const label = `offerSets[${index}]`;
|
|
111
|
+
const entry = asObject(value, label);
|
|
112
|
+
const id = optionalUuid(entry.id, `${label}.id`);
|
|
113
|
+
if (id && seenIds.has(id))
|
|
114
|
+
throw new Error(`Duplicate offer set id ${id}.`);
|
|
115
|
+
if (id)
|
|
116
|
+
seenIds.add(id);
|
|
117
|
+
const updatedAt = entry.updatedAt === undefined ? undefined : requiredString(entry.updatedAt, `${label}.updatedAt`);
|
|
118
|
+
if (id && !updatedAt)
|
|
119
|
+
throw new Error(`${label}.updatedAt is required when id is present.`);
|
|
120
|
+
if (!id && updatedAt)
|
|
121
|
+
throw new Error(`${label}.updatedAt is only valid when id is present.`);
|
|
122
|
+
const paymentProfileId = optionalUuid(entry.paymentProfileId, `${label}.paymentProfileId`);
|
|
123
|
+
if (!paymentProfileId)
|
|
124
|
+
throw new Error(`${label}.paymentProfileId is required.`);
|
|
125
|
+
if (!Array.isArray(entry.items) || entry.items.length === 0)
|
|
126
|
+
throw new Error(`${label}.items must be a non-empty array.`);
|
|
127
|
+
const key = entry.key === undefined ? undefined : requiredString(entry.key, `${label}.key`);
|
|
128
|
+
return {
|
|
129
|
+
...(id ? { id, updatedAt } : {}),
|
|
130
|
+
...(key ? { key } : {}),
|
|
131
|
+
paymentProfileId,
|
|
132
|
+
displayName: requiredString(entry.displayName, `${label}.displayName`),
|
|
133
|
+
description: nullableString(entry.description, `${label}.description`),
|
|
134
|
+
isActive: entry.isActive !== false,
|
|
135
|
+
metadata: optionalMetadata(entry.metadata, `${label}.metadata`),
|
|
136
|
+
items: entry.items.map((item, itemIndex) => parseItem(item, `${label}.items[${itemIndex}]`)),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
return {
|
|
140
|
+
schemaVersion: 1,
|
|
141
|
+
projectId,
|
|
142
|
+
...(Array.isArray(root.paymentProfiles) ? { paymentProfiles: root.paymentProfiles } : {}),
|
|
143
|
+
offerSets,
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
const listOfferSets = async (scope) => {
|
|
147
|
+
const result = await scope.callApi({
|
|
148
|
+
path: 'projects.listOfferSets',
|
|
149
|
+
type: 'query',
|
|
150
|
+
token: scope.token,
|
|
151
|
+
data: { workspaceId: scope.workspaceId, projectId: scope.projectId, includeArchived: true },
|
|
152
|
+
});
|
|
153
|
+
return result.offerSets;
|
|
154
|
+
};
|
|
155
|
+
const listPaymentProfiles = async (scope) => {
|
|
156
|
+
const result = await scope.callApi({
|
|
157
|
+
path: 'projects.listPaymentProfiles',
|
|
158
|
+
type: 'query',
|
|
159
|
+
token: scope.token,
|
|
160
|
+
data: { workspaceId: scope.workspaceId, projectId: scope.projectId },
|
|
161
|
+
});
|
|
162
|
+
return result.profiles.map(({ id, name, provider }) => ({ id, name, provider }));
|
|
163
|
+
};
|
|
164
|
+
const serializeOfferSetFile = (file) => `${JSON.stringify(file, null, 2)}\n`;
|
|
165
|
+
export const executeOfferSetPull = async (input) => {
|
|
166
|
+
const [remote, paymentProfiles] = await Promise.all([listOfferSets(input), listPaymentProfiles(input)]);
|
|
167
|
+
// Legacy sets without a payment profile cannot be saved through replaceOfferSets.
|
|
168
|
+
const offerSets = remote.filter((row) => row.payment_profile_id);
|
|
169
|
+
await writeFile(input.filePath, serializeOfferSetFile({
|
|
170
|
+
schemaVersion: 1,
|
|
171
|
+
projectId: input.projectId,
|
|
172
|
+
paymentProfiles,
|
|
173
|
+
offerSets: offerSets.map(rowToFileEntry),
|
|
174
|
+
}), 'utf8');
|
|
175
|
+
return offerSets.length;
|
|
176
|
+
};
|
|
177
|
+
// Key order in hand-edited JSON must not count as a change.
|
|
178
|
+
const canonical = (value) => JSON.stringify(value, (_key, nested) => (nested && typeof nested === 'object' && !Array.isArray(nested)
|
|
179
|
+
? Object.fromEntries(Object.entries(nested).sort(([a], [b]) => a.localeCompare(b)))
|
|
180
|
+
: nested));
|
|
181
|
+
const editableContent = (entry) => ({
|
|
182
|
+
displayName: entry.displayName,
|
|
183
|
+
description: entry.description,
|
|
184
|
+
metadata: entry.metadata,
|
|
185
|
+
items: entry.items,
|
|
186
|
+
});
|
|
187
|
+
// Mirrors the server's key normalization so a new set's key is known before it is saved.
|
|
188
|
+
const toOfferSetKey = (value) => (value.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').replace(/-{2,}/g, '-') || 'offer-set');
|
|
189
|
+
const toReplaceInput = (entry, isActive) => ({
|
|
190
|
+
...(entry.id ? { id: entry.id } : {}),
|
|
191
|
+
...(entry.key ? { key: entry.key } : {}),
|
|
192
|
+
displayName: entry.displayName,
|
|
193
|
+
description: entry.description,
|
|
194
|
+
isActive,
|
|
195
|
+
metadata: entry.metadata,
|
|
196
|
+
// Provider and position are derived server-side from the payment profile and item order.
|
|
197
|
+
// A new set is often a copy of an existing one, so its item ids are dropped.
|
|
198
|
+
items: entry.id ? entry.items : entry.items.map(({ id: _id, ...item }) => item),
|
|
199
|
+
});
|
|
200
|
+
export const planOfferSetPublish = (file, remote) => {
|
|
201
|
+
const remoteById = new Map(remote.map((row) => [row.id, row]));
|
|
202
|
+
const takenKeys = new Set(remote.map((row) => row.key));
|
|
203
|
+
const plan = { replace: new Map(), archive: [], reactivate: [] };
|
|
204
|
+
for (const [index, entry] of file.offerSets.entries()) {
|
|
205
|
+
const current = entry.id ? remoteById.get(entry.id) : undefined;
|
|
206
|
+
if (entry.id && !current)
|
|
207
|
+
throw new Error(`Offer set ${entry.id} no longer exists. Pull offer sets again before publishing.`);
|
|
208
|
+
if (current) {
|
|
209
|
+
if (current.updated_at !== entry.updatedAt) {
|
|
210
|
+
throw new Error(`Offer set "${current.display_name}" changed remotely. Pull offer sets again before publishing.`);
|
|
211
|
+
}
|
|
212
|
+
if (current.payment_profile_id !== entry.paymentProfileId) {
|
|
213
|
+
throw new Error(`Offer set "${current.display_name}" cannot move to another payment profile; create a new offer set instead.`);
|
|
214
|
+
}
|
|
215
|
+
if (entry.key && entry.key !== current.key) {
|
|
216
|
+
throw new Error(`Offer set "${current.display_name}" key cannot be changed.`);
|
|
217
|
+
}
|
|
218
|
+
if (current.is_active !== entry.isActive) {
|
|
219
|
+
(entry.isActive ? plan.reactivate : plan.archive).push(index);
|
|
220
|
+
}
|
|
221
|
+
if (canonical(editableContent(entry)) === canonical(editableContent(rowToFileEntry(current))))
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// The server treats a known key as an update of that set, so a new entry must not reuse one.
|
|
226
|
+
entry.key = toOfferSetKey(entry.key || entry.displayName);
|
|
227
|
+
if (takenKeys.has(entry.key)) {
|
|
228
|
+
throw new Error(`Offer set key "${entry.key}" already exists. Set a unique "key" for new offer set "${entry.displayName}".`);
|
|
229
|
+
}
|
|
230
|
+
takenKeys.add(entry.key);
|
|
231
|
+
}
|
|
232
|
+
const group = plan.replace.get(entry.paymentProfileId) || [];
|
|
233
|
+
group.push(index);
|
|
234
|
+
plan.replace.set(entry.paymentProfileId, group);
|
|
235
|
+
}
|
|
236
|
+
return plan;
|
|
237
|
+
};
|
|
238
|
+
export const describeOfferSetPublishPlan = (file, plan) => {
|
|
239
|
+
const name = (index) => file.offerSets[index].displayName;
|
|
240
|
+
return [
|
|
241
|
+
...plan.reactivate.map((index) => `reactivate ${name(index)}`),
|
|
242
|
+
...[...plan.replace.values()].flat().map((index) => `${file.offerSets[index].id ? 'update' : 'create'} ${name(index)}`),
|
|
243
|
+
...plan.archive.map((index) => `archive ${name(index)}`),
|
|
244
|
+
];
|
|
245
|
+
};
|
|
246
|
+
export const executeOfferSetPublish = async (input) => {
|
|
247
|
+
const file = parseOfferSetFile(await readFile(input.filePath, 'utf8'), input.projectId);
|
|
248
|
+
const plan = planOfferSetPublish(file, await listOfferSets(input));
|
|
249
|
+
const changes = describeOfferSetPublishPlan(file, plan);
|
|
250
|
+
if (input.dryRun || changes.length === 0)
|
|
251
|
+
return changes;
|
|
252
|
+
// After each write, record the saved id and updatedAt so a later failure leaves a file that
|
|
253
|
+
// can be published again without losing the remaining edits.
|
|
254
|
+
const markSaved = async (indexes) => {
|
|
255
|
+
const latest = await listOfferSets(input);
|
|
256
|
+
for (const index of indexes) {
|
|
257
|
+
const entry = file.offerSets[index];
|
|
258
|
+
const row = latest.find((candidate) => (entry.id ? candidate.id === entry.id : candidate.key === entry.key));
|
|
259
|
+
if (row)
|
|
260
|
+
file.offerSets[index] = { ...entry, id: row.id, key: row.key, updatedAt: row.updated_at };
|
|
261
|
+
}
|
|
262
|
+
await writeFile(input.filePath, serializeOfferSetFile(file), 'utf8');
|
|
263
|
+
return latest;
|
|
264
|
+
};
|
|
265
|
+
const setLifecycle = async (path, index) => {
|
|
266
|
+
await input.callApi({
|
|
267
|
+
path,
|
|
268
|
+
type: 'mutation',
|
|
269
|
+
token: input.token,
|
|
270
|
+
data: { workspaceId: input.workspaceId, projectId: input.projectId, offerSetId: file.offerSets[index].id },
|
|
271
|
+
});
|
|
272
|
+
return markSaved([index]);
|
|
273
|
+
};
|
|
274
|
+
// Reactivate before editing and archive after editing; archiveOfferSet keeps the in-use guard.
|
|
275
|
+
for (const index of plan.reactivate)
|
|
276
|
+
await setLifecycle('projects.reactivateOfferSet', index);
|
|
277
|
+
for (const [paymentProfileId, indexes] of plan.replace) {
|
|
278
|
+
await input.callApi({
|
|
279
|
+
path: 'projects.replaceOfferSets',
|
|
280
|
+
type: 'mutation',
|
|
281
|
+
token: input.token,
|
|
282
|
+
data: {
|
|
283
|
+
workspaceId: input.workspaceId,
|
|
284
|
+
projectId: input.projectId,
|
|
285
|
+
paymentProfileId,
|
|
286
|
+
offerSets: indexes.map((index) => toReplaceInput(file.offerSets[index], file.offerSets[index].isActive || plan.archive.includes(index))),
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
await markSaved(indexes);
|
|
290
|
+
}
|
|
291
|
+
let latest = null;
|
|
292
|
+
for (const index of plan.archive)
|
|
293
|
+
latest = await setLifecycle('projects.archiveOfferSet', index);
|
|
294
|
+
// Everything succeeded: store the server-normalized content.
|
|
295
|
+
const byId = new Map((latest || await listOfferSets(input)).map((row) => [row.id, row]));
|
|
296
|
+
file.offerSets = file.offerSets.map((entry) => {
|
|
297
|
+
const row = entry.id ? byId.get(entry.id) : undefined;
|
|
298
|
+
return row ? rowToFileEntry(row) : entry;
|
|
299
|
+
});
|
|
300
|
+
await writeFile(input.filePath, serializeOfferSetFile(file), 'utf8');
|
|
301
|
+
return changes;
|
|
302
|
+
};
|
|
303
|
+
const formatMoney = (amountMinor, currency) => {
|
|
304
|
+
if (amountMinor === null || !currency)
|
|
305
|
+
return '-';
|
|
306
|
+
const code = currency.toUpperCase();
|
|
307
|
+
const digits = new Intl.NumberFormat('en', { style: 'currency', currency: code }).resolvedOptions().maximumFractionDigits ?? 2;
|
|
308
|
+
return `${(amountMinor / 10 ** digits).toFixed(digits)} ${code}`;
|
|
309
|
+
};
|
|
310
|
+
const formatInterval = (price) => {
|
|
311
|
+
if (!price.interval)
|
|
312
|
+
return 'one-time';
|
|
313
|
+
const count = price.intervalCount || 1;
|
|
314
|
+
const interval = count === 1 ? `/${price.interval}` : `/${count} ${price.interval}s`;
|
|
315
|
+
return price.trialPeriodDays ? `${interval}, ${price.trialPeriodDays}d trial` : interval;
|
|
316
|
+
};
|
|
317
|
+
const formatCoupon = (coupon) => (coupon.percentOff !== null ? `${coupon.percentOff}% off` : `${formatMoney(coupon.amountOffMinor, coupon.currency)} off`);
|
|
318
|
+
// Stripe prices come live from Stripe, exactly as the dashboard price picker shows them;
|
|
319
|
+
// other providers only expose the last synced catalog.
|
|
320
|
+
const loadPriceCatalogs = async (input, profile, environments) => {
|
|
321
|
+
const base = { paymentProfileId: profile.id, paymentProfileName: profile.name, provider: profile.provider };
|
|
322
|
+
const scopeData = { workspaceId: input.workspaceId, projectId: input.projectId, paymentProfileId: profile.id };
|
|
323
|
+
if (profile.provider === 'stripe') {
|
|
324
|
+
const { results } = await input.callApi({
|
|
325
|
+
path: 'projects.listStripeCatalog',
|
|
326
|
+
type: 'query',
|
|
327
|
+
token: input.token,
|
|
328
|
+
data: { ...scopeData, modes: environments },
|
|
329
|
+
});
|
|
330
|
+
return results.map((group) => ({
|
|
331
|
+
...base,
|
|
332
|
+
environment: group.environment,
|
|
333
|
+
source: group.status === 'ready' ? 'live' : 'unavailable',
|
|
334
|
+
reason: group.reason,
|
|
335
|
+
prices: group.plans.map((plan) => ({
|
|
336
|
+
providerPlanId: plan.providerPlanId,
|
|
337
|
+
displayName: plan.displayName || null,
|
|
338
|
+
amountMinor: plan.amountMinor,
|
|
339
|
+
currency: plan.currency?.toUpperCase() || null,
|
|
340
|
+
interval: plan.interval,
|
|
341
|
+
intervalCount: plan.interval ? plan.intervalCount || 1 : null,
|
|
342
|
+
trialPeriodDays: plan.trialPeriodDays,
|
|
343
|
+
active: plan.isActive && plan.isProductActive,
|
|
344
|
+
})),
|
|
345
|
+
coupons: group.discounts.map((discount) => ({
|
|
346
|
+
providerCouponId: discount.providerCouponId,
|
|
347
|
+
displayName: discount.displayName || null,
|
|
348
|
+
percentOff: discount.percentOff,
|
|
349
|
+
amountOffMinor: discount.amountOffMinor,
|
|
350
|
+
currency: discount.currency?.toUpperCase() || null,
|
|
351
|
+
duration: discount.duration,
|
|
352
|
+
active: discount.isActive,
|
|
353
|
+
})),
|
|
354
|
+
}));
|
|
355
|
+
}
|
|
356
|
+
return Promise.all(environments.map(async (environment) => {
|
|
357
|
+
const catalog = await input.callApi({
|
|
358
|
+
path: 'projects.getLatestPaymentProviderCatalog',
|
|
359
|
+
type: 'query',
|
|
360
|
+
token: input.token,
|
|
361
|
+
data: { ...scopeData, environment },
|
|
362
|
+
});
|
|
363
|
+
return {
|
|
364
|
+
...base,
|
|
365
|
+
environment,
|
|
366
|
+
source: catalog ? 'synced' : 'unavailable',
|
|
367
|
+
reason: catalog ? null : 'Catalog not synced yet; open the payment profile in the dashboard to sync it.',
|
|
368
|
+
prices: (catalog?.resources || []).filter((resource) => resource.resource_type === 'price').map((resource) => ({
|
|
369
|
+
providerPlanId: resource.provider_resource_id,
|
|
370
|
+
displayName: resource.display_name,
|
|
371
|
+
amountMinor: resource.amount_minor,
|
|
372
|
+
currency: resource.currency?.toUpperCase() || null,
|
|
373
|
+
interval: resource.product_type === 'one_time' ? null : resource.billing_interval,
|
|
374
|
+
intervalCount: resource.product_type === 'one_time' || !resource.billing_interval ? null : resource.billing_interval_count || 1,
|
|
375
|
+
trialPeriodDays: resource.trial_period_days,
|
|
376
|
+
active: resource.status === 'active',
|
|
377
|
+
})),
|
|
378
|
+
coupons: [],
|
|
379
|
+
};
|
|
380
|
+
}));
|
|
381
|
+
};
|
|
382
|
+
export const executeOfferSetPrices = async (input) => {
|
|
383
|
+
const profiles = (await listPaymentProfiles(input)).filter((profile) => (!input.paymentProfile || profile.id === input.paymentProfile || profile.name === input.paymentProfile));
|
|
384
|
+
if (input.paymentProfile && profiles.length === 0)
|
|
385
|
+
throw new Error(`Payment profile "${input.paymentProfile}" was not found.`);
|
|
386
|
+
const environments = input.environment ? [input.environment] : ['test', 'live'];
|
|
387
|
+
const catalogs = await Promise.all(profiles.map((profile) => loadPriceCatalogs(input, profile, environments)));
|
|
388
|
+
return catalogs.flat();
|
|
389
|
+
};
|
|
390
|
+
export const formatOfferSetPriceCatalogs = (catalogs) => catalogs.flatMap((catalog) => {
|
|
391
|
+
const lines = [`${catalog.paymentProfileName} (${catalog.provider}, ${catalog.paymentProfileId}) ${catalog.environment}`];
|
|
392
|
+
if (catalog.source === 'unavailable')
|
|
393
|
+
return [...lines, ` unavailable: ${catalog.reason || 'unknown reason'}`];
|
|
394
|
+
if (catalog.prices.length === 0)
|
|
395
|
+
lines.push(' no prices');
|
|
396
|
+
for (const price of catalog.prices) {
|
|
397
|
+
const label = [price.displayName, price.active ? null : '[inactive]'].filter(Boolean).join(' ');
|
|
398
|
+
lines.push(` ${price.providerPlanId} ${formatMoney(price.amountMinor, price.currency)} ${formatInterval(price)} ${label}`.trimEnd());
|
|
399
|
+
}
|
|
400
|
+
for (const coupon of catalog.coupons) {
|
|
401
|
+
const label = [coupon.displayName, coupon.active ? null : '[inactive]'].filter(Boolean).join(' ');
|
|
402
|
+
lines.push(` coupon ${coupon.providerCouponId} ${formatCoupon(coupon)}${coupon.duration ? `, ${coupon.duration}` : ''} ${label}`.trimEnd());
|
|
403
|
+
}
|
|
404
|
+
return lines;
|
|
405
|
+
});
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"minimumCliVersion": "0.1.20",
|
|
5
5
|
"entries": [
|
|
6
6
|
{
|
|
7
|
-
"repositoryCliVersion": "0.1.
|
|
7
|
+
"repositoryCliVersion": "0.1.297",
|
|
8
8
|
"manifest": {
|
|
9
9
|
"schemaVersion": 1,
|
|
10
|
-
"bundleVersion": "2.0.
|
|
10
|
+
"bundleVersion": "2.0.290",
|
|
11
11
|
"stepContractVersion": 3,
|
|
12
12
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
13
13
|
"managedFiles": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
48
|
-
"sha256": "
|
|
48
|
+
"sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -145,16 +145,16 @@
|
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
"path": "funnel-docs.config.json",
|
|
148
|
-
"sha256": "
|
|
148
|
+
"sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127"
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
|
-
"repositoryCliVersion": "0.1.
|
|
154
|
+
"repositoryCliVersion": "0.1.296",
|
|
155
155
|
"manifest": {
|
|
156
156
|
"schemaVersion": 1,
|
|
157
|
-
"bundleVersion": "2.0.
|
|
157
|
+
"bundleVersion": "2.0.289",
|
|
158
158
|
"stepContractVersion": 3,
|
|
159
159
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
160
160
|
"managedFiles": [
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
195
|
-
"sha256": "
|
|
195
|
+
"sha256": "f822b4943245eed41a35a42ec4e88712213d4f456d6bfeba73138168b292acb8"
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -292,16 +292,16 @@
|
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
"path": "funnel-docs.config.json",
|
|
295
|
-
"sha256": "
|
|
295
|
+
"sha256": "3e3cdfabee902dfdb2fe31dc439d71c9b3a2137ea4222fcc1a7169b431ab8680"
|
|
296
296
|
}
|
|
297
297
|
]
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
|
-
"repositoryCliVersion": "0.1.
|
|
301
|
+
"repositoryCliVersion": "0.1.295",
|
|
302
302
|
"manifest": {
|
|
303
303
|
"schemaVersion": 1,
|
|
304
|
-
"bundleVersion": "2.0.
|
|
304
|
+
"bundleVersion": "2.0.288",
|
|
305
305
|
"stepContractVersion": 3,
|
|
306
306
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
307
307
|
"managedFiles": [
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
},
|
|
340
340
|
{
|
|
341
341
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
342
|
-
"sha256": "
|
|
342
|
+
"sha256": "93b18e9d64291582895c0236b6dfb95c8b261f7fce375ed4163598891d2504e5"
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -439,16 +439,16 @@
|
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
"path": "funnel-docs.config.json",
|
|
442
|
-
"sha256": "
|
|
442
|
+
"sha256": "af0ab4eb198669c6a97291986a6f17b80ea93294f8e15633cfe58e71f6b172ed"
|
|
443
443
|
}
|
|
444
444
|
]
|
|
445
445
|
}
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
|
-
"repositoryCliVersion": "0.1.
|
|
448
|
+
"repositoryCliVersion": "0.1.294",
|
|
449
449
|
"manifest": {
|
|
450
450
|
"schemaVersion": 1,
|
|
451
|
-
"bundleVersion": "2.0.
|
|
451
|
+
"bundleVersion": "2.0.287",
|
|
452
452
|
"stepContractVersion": 3,
|
|
453
453
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
454
454
|
"managedFiles": [
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
488
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
489
|
-
"sha256": "
|
|
489
|
+
"sha256": "1f7f3d76856b2096ebde3bb0dd83dfabd131823476c8be151849e3bf57c91c28"
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
492
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -586,16 +586,16 @@
|
|
|
586
586
|
},
|
|
587
587
|
{
|
|
588
588
|
"path": "funnel-docs.config.json",
|
|
589
|
-
"sha256": "
|
|
589
|
+
"sha256": "8470d2655720e6c3bb6e210b98d61fb7222deeef9607db6d03cca40e3b06fec7"
|
|
590
590
|
}
|
|
591
591
|
]
|
|
592
592
|
}
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
|
-
"repositoryCliVersion": "0.1.
|
|
595
|
+
"repositoryCliVersion": "0.1.293",
|
|
596
596
|
"manifest": {
|
|
597
597
|
"schemaVersion": 1,
|
|
598
|
-
"bundleVersion": "2.0.
|
|
598
|
+
"bundleVersion": "2.0.286",
|
|
599
599
|
"stepContractVersion": 3,
|
|
600
600
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
601
601
|
"managedFiles": [
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
},
|
|
634
634
|
{
|
|
635
635
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
636
|
-
"sha256": "
|
|
636
|
+
"sha256": "f1831876670eae6a6029f8f48d12038de408d4fb31a3332f7cec5cb3c7e4ff1d"
|
|
637
637
|
},
|
|
638
638
|
{
|
|
639
639
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -733,16 +733,16 @@
|
|
|
733
733
|
},
|
|
734
734
|
{
|
|
735
735
|
"path": "funnel-docs.config.json",
|
|
736
|
-
"sha256": "
|
|
736
|
+
"sha256": "53e951dfdadfc634fa7bbd53615a5e2e3019cd1bce24b3a4d667e50557268dd7"
|
|
737
737
|
}
|
|
738
738
|
]
|
|
739
739
|
}
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
|
-
"repositoryCliVersion": "0.1.
|
|
742
|
+
"repositoryCliVersion": "0.1.292",
|
|
743
743
|
"manifest": {
|
|
744
744
|
"schemaVersion": 1,
|
|
745
|
-
"bundleVersion": "2.0.
|
|
745
|
+
"bundleVersion": "2.0.285",
|
|
746
746
|
"stepContractVersion": 3,
|
|
747
747
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
748
748
|
"managedFiles": [
|
|
@@ -780,7 +780,7 @@
|
|
|
780
780
|
},
|
|
781
781
|
{
|
|
782
782
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
783
|
-
"sha256": "
|
|
783
|
+
"sha256": "9f91fab6b6af7456e614811d75fc4007e35b0c26086135ddd6dbf5d0491253e7"
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -880,16 +880,16 @@
|
|
|
880
880
|
},
|
|
881
881
|
{
|
|
882
882
|
"path": "funnel-docs.config.json",
|
|
883
|
-
"sha256": "
|
|
883
|
+
"sha256": "2c4bd0e6e5677772fcb6889d63833d9fcdd9d66da167571219aa5145567b335f"
|
|
884
884
|
}
|
|
885
885
|
]
|
|
886
886
|
}
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
|
-
"repositoryCliVersion": "0.1.
|
|
889
|
+
"repositoryCliVersion": "0.1.291",
|
|
890
890
|
"manifest": {
|
|
891
891
|
"schemaVersion": 1,
|
|
892
|
-
"bundleVersion": "2.0.
|
|
892
|
+
"bundleVersion": "2.0.284",
|
|
893
893
|
"stepContractVersion": 3,
|
|
894
894
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
895
895
|
"managedFiles": [
|
|
@@ -927,7 +927,7 @@
|
|
|
927
927
|
},
|
|
928
928
|
{
|
|
929
929
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
930
|
-
"sha256": "
|
|
930
|
+
"sha256": "32c4dc6493b9195c1d0c601e593975bfbd029eb348e986c87f9823b7d390e406"
|
|
931
931
|
},
|
|
932
932
|
{
|
|
933
933
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
},
|
|
1028
1028
|
{
|
|
1029
1029
|
"path": "funnel-docs.config.json",
|
|
1030
|
-
"sha256": "
|
|
1030
|
+
"sha256": "bac474b7e4180ebc96f0b0ed2f1391b291d7065e3c626f90a7dac4aed4c567d8"
|
|
1031
1031
|
}
|
|
1032
1032
|
]
|
|
1033
1033
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.290",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
5
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
6
6
|
"managedFiles": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
41
|
-
"sha256": "
|
|
41
|
+
"sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"path": "funnel-docs.config.json",
|
|
141
|
-
"sha256": "
|
|
141
|
+
"sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
|
|
|
17
17
|
|
|
18
18
|
### Package release order
|
|
19
19
|
|
|
20
|
-
Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.34.0`, then `@funnelsgrove/analytics` `0.16.0`, then `@funnelsgrove/payments` `0.
|
|
20
|
+
Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.34.0`, then `@funnelsgrove/analytics` `0.16.0`, then `@funnelsgrove/payments` `0.44.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.297`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
|
|
21
21
|
<!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
|
|
22
22
|
|
|
23
23
|
## Version-last policy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.290",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
5
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
6
6
|
"managedFiles": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
41
|
-
"sha256": "
|
|
41
|
+
"sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"path": "funnel-docs.config.json",
|
|
141
|
-
"sha256": "
|
|
141
|
+
"sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sourceTreeHash": "
|
|
3
|
+
"sourceTreeHash": "7bcc09edcbb3204ab62980750096b26e3e13269b288b259e04b7cb053849983d",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
|
-
"docsBundleVersion": "2.0.
|
|
5
|
+
"docsBundleVersion": "2.0.290",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": ".env.example",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"path": ".funnelsgrove-docs.json",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "7f1b703dc48736009d4a16af7de6b233284b9ae5e5fb99ed502262f4c921afe4",
|
|
20
20
|
"mode": "100644"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
79
|
-
"sha256": "
|
|
79
|
+
"sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe",
|
|
80
80
|
"mode": "100644"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
"path": "funnel-docs.config.json",
|
|
209
|
-
"sha256": "
|
|
209
|
+
"sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127",
|
|
210
210
|
"mode": "100644"
|
|
211
211
|
},
|
|
212
212
|
{
|
|
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
|
|
|
17
17
|
|
|
18
18
|
### Package release order
|
|
19
19
|
|
|
20
|
-
Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.34.0`, then `@funnelsgrove/analytics` `0.16.0`, then `@funnelsgrove/payments` `0.
|
|
20
|
+
Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.34.0`, then `@funnelsgrove/analytics` `0.16.0`, then `@funnelsgrove/payments` `0.44.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.297`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
|
|
21
21
|
<!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
|
|
22
22
|
|
|
23
23
|
## Version-last policy
|