@diagonal-hq/cli 0.30.0 → 0.30.2
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 +2 -1
- package/dist/cli.mjs +17 -8
- package/dist/index.d.ts +9 -2
- package/dist/sdk-contract.d.ts +35 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1177,7 +1177,8 @@ export type NotificationScheduleTiming = 'day' | 'exact';
|
|
|
1177
1177
|
* `notifications/<folder>/<handle>.schedule.ts` file. A schedule sends one
|
|
1178
1178
|
* template of its type on dates of a resource, for example 7 days after each
|
|
1179
1179
|
* member's `joined_on`. The deployed schedule is a System Notification: it
|
|
1180
|
-
* sends with no staff identity
|
|
1180
|
+
* sends with no staff identity. `filters` decides who gets it, and
|
|
1181
|
+
* `automaticFilters` decides who gets it without a staff action. The file
|
|
1181
1182
|
* holds the rule. The workspace keeps the generated notifications, their edits
|
|
1182
1183
|
* and holds, and the pause state. `diagonal check` writes a missing `uid`. No
|
|
1183
1184
|
* file refers to a schedule, so a schedule has a uid but no slug.
|
|
@@ -1200,8 +1201,14 @@ export type NotificationScheduleDefinition = UidOption & {
|
|
|
1200
1201
|
* before in exact timing). A duration without a sign counts after the date.
|
|
1201
1202
|
*/
|
|
1202
1203
|
offsets: readonly string[];
|
|
1203
|
-
/** Only the source records that match. */
|
|
1204
|
+
/** Only the source records that match, for automatic and staff sends. */
|
|
1204
1205
|
filters?: FilterGroup;
|
|
1206
|
+
/**
|
|
1207
|
+
* Of the records that match `filters`, the ones whose notifications the
|
|
1208
|
+
* schedule makes and sends on its own. Staff can still send to the other
|
|
1209
|
+
* records. Leave it out to send to every record that matches `filters`.
|
|
1210
|
+
*/
|
|
1211
|
+
automaticFilters?: FilterGroup;
|
|
1205
1212
|
/**
|
|
1206
1213
|
* The path of single-record relations from the source record to the type's
|
|
1207
1214
|
* recipient, for example `'member'` on a `memberships` source. Leave it out
|
package/dist/sdk-contract.d.ts
CHANGED
|
@@ -4494,6 +4494,11 @@ type SdkDisplayFormatOptions = {
|
|
|
4494
4494
|
durationUnit?: 'milliseconds' | 'seconds' | 'minutes' | 'hours';
|
|
4495
4495
|
};
|
|
4496
4496
|
|
|
4497
|
+
type SdkDisplayPriceOptions = {
|
|
4498
|
+
/** Use a short suffix or a long billing phrase. Defaults to `short`. */
|
|
4499
|
+
style?: 'short' | 'long';
|
|
4500
|
+
};
|
|
4501
|
+
|
|
4497
4502
|
type SdkRecordInput<TRecord extends ResourceRecord = ResourceRecord> =
|
|
4498
4503
|
| TRecord
|
|
4499
4504
|
| { fields?: TRecord | null }
|
|
@@ -4537,6 +4542,29 @@ type SdkDisplayUtils = {
|
|
|
4537
4542
|
options?: SdkDisplayFormatOptions
|
|
4538
4543
|
) => string | null;
|
|
4539
4544
|
|
|
4545
|
+
/**
|
|
4546
|
+
* Format money with its billing recurrence for string contexts such as template
|
|
4547
|
+
* literals and `<option>` labels. Pass the recurrence select field handle so an
|
|
4548
|
+
* unknown value can use its option label, or its raw value if no label exists.
|
|
4549
|
+
* Uses the existing money formatter. The default style is `short`.
|
|
4550
|
+
* `one_time`, nullish, and empty recurrence values return the amount alone.
|
|
4551
|
+
* Invalid money, malformed fields, and invalid styles return `null` and report
|
|
4552
|
+
* the standard SDK diagnostic.
|
|
4553
|
+
*
|
|
4554
|
+
* @example
|
|
4555
|
+
* const recurrence = prices.fields.recurrence;
|
|
4556
|
+
* const amount = { amount: 5000, currency: 'USD' };
|
|
4557
|
+
* Sdk.utils.display.price(recurrence, 'monthly', amount); // '$50.00/mo'
|
|
4558
|
+
* Sdk.utils.display.price(recurrence, 'monthly', amount, { style: 'long' }); // '$50.00 per month'
|
|
4559
|
+
* Sdk.utils.display.price(recurrence, 'weekly', amount); // '$50.00 (Weekly)' with an option label
|
|
4560
|
+
*/
|
|
4561
|
+
price: (
|
|
4562
|
+
field: SdkResourceField | null | undefined,
|
|
4563
|
+
recurrence: any,
|
|
4564
|
+
amount: any,
|
|
4565
|
+
options?: SdkDisplayPriceOptions
|
|
4566
|
+
) => string | null;
|
|
4567
|
+
|
|
4540
4568
|
/**
|
|
4541
4569
|
* Build initials from the first `count` whitespace-delimited name parts.
|
|
4542
4570
|
* `count` defaults to `2`. Nullish/blank names or an invalid count return `''`
|
|
@@ -4654,11 +4682,17 @@ type SdkUtils = Omit<TaskUtils, 'workspace' | 'workflow' | 'tiptap'> & {
|
|
|
4654
4682
|
* @remarks
|
|
4655
4683
|
* `format` delegates date, time, money, number, phone, and location rendering to the
|
|
4656
4684
|
* existing SDK formatters so their current locale and timezone behavior remains consistent.
|
|
4685
|
+
* Use `price` for billing recurrence wording in template literals and `<option>` labels.
|
|
4657
4686
|
* Nullish or malformed values return `null` with the standard SDK diagnostic;
|
|
4658
4687
|
* `fieldValue` returns `null`.
|
|
4659
4688
|
*
|
|
4660
4689
|
* @example
|
|
4661
4690
|
* const status = Sdk.utils.display.format(tasks.fields.status, task.status);
|
|
4691
|
+
* const recurrence = prices.fields.recurrence;
|
|
4692
|
+
* const amount = { amount: 5000, currency: 'USD' };
|
|
4693
|
+
* Sdk.utils.display.price(recurrence, 'monthly', amount); // '$50.00/mo'
|
|
4694
|
+
* Sdk.utils.display.price(recurrence, 'monthly', amount, { style: 'long' }); // '$50.00 per month'
|
|
4695
|
+
* Sdk.utils.display.price(recurrence, 'weekly', amount); // '$50.00 (Weekly)' with an option label
|
|
4662
4696
|
*/
|
|
4663
4697
|
display: SdkDisplayUtils;
|
|
4664
4698
|
};
|
|
@@ -14731,6 +14765,7 @@ declare namespace Sdk {
|
|
|
14731
14765
|
export type NotifyVariant = import("diagonal:sdk-internal").SdkNotifyVariant;
|
|
14732
14766
|
export type BadgeVariant = import("diagonal:sdk-internal").SdkBadgeVariant;
|
|
14733
14767
|
export type DisplayFormatOptions = import("diagonal:sdk-internal").SdkDisplayFormatOptions;
|
|
14768
|
+
export type DisplayPriceOptions = import("diagonal:sdk-internal").SdkDisplayPriceOptions;
|
|
14734
14769
|
export type FieldSelector<TKey extends string = string> = import("diagonal:sdk-internal").SdkFieldSelector<TKey>;
|
|
14735
14770
|
export type RecordInput<TRecord extends import("diagonal:sdk-internal").ResourceRecord = import("diagonal:sdk-internal").ResourceRecord> = import("diagonal:sdk-internal").SdkRecordInput<TRecord>;
|
|
14736
14771
|
export type FieldValue<TRecord extends import("diagonal:sdk-internal").ResourceRecord, TSelector extends import("diagonal:sdk-internal").SdkFieldSelector> = import("diagonal:sdk-internal").SdkFieldValue<TRecord, TSelector>;
|