@sortlist/cli 0.32.0 → 0.33.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/package.json
CHANGED
package/src/commands/whoami.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
|
|
3
|
-
import { graphql } from '../graphql/client.ts';
|
|
3
|
+
import { graphql, GraphQLRequestError } from '../graphql/client.ts';
|
|
4
4
|
import { Me } from '../graphql/operations/common.ts';
|
|
5
5
|
import { loadConfig } from '../lib/config.ts';
|
|
6
6
|
import { error, hint, info, isJsonMode, printJson } from '../lib/output.ts';
|
|
@@ -17,14 +17,34 @@ export const whoamiCommand = new Command('whoami')
|
|
|
17
17
|
)
|
|
18
18
|
.action(async function (this: Command) {
|
|
19
19
|
const opts = this.optsWithGlobals();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
let data;
|
|
22
|
+
try {
|
|
23
|
+
data = await graphql(Me, undefined, {
|
|
24
|
+
endpoint: opts.endpoint,
|
|
25
|
+
throwOnError: true,
|
|
26
|
+
});
|
|
27
|
+
} catch (err) {
|
|
28
|
+
if (err instanceof GraphQLRequestError) {
|
|
29
|
+
error('Could not verify your identity — the API returned an error:');
|
|
30
|
+
const messages = err.graphqlErrors?.map((e) => e.message) ?? [err.message];
|
|
31
|
+
for (const message of messages) info(` ${message}`);
|
|
32
|
+
hint('This is a server-side or authorization error, not necessarily an expired session.');
|
|
33
|
+
hint('Retry in a moment; if it persists, re-run `sl login` or report it.');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
throw err;
|
|
37
|
+
}
|
|
23
38
|
|
|
24
39
|
const user = data.me;
|
|
25
40
|
if (!user) {
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
// A successful `me` for a logged-in user is never null — the resolver
|
|
42
|
+
// returns the calling user. Null here means the backend could not resolve
|
|
43
|
+
// the account (e.g. an upstream identity/profile lookup failed), not that
|
|
44
|
+
// the local session is invalid, so we do not tell the user to log in again.
|
|
45
|
+
error('The API did not return your user identity.');
|
|
46
|
+
hint('This is usually a temporary backend issue rather than an expired session.');
|
|
47
|
+
hint('Retry in a moment; if it persists, re-run `sl login` or report it.');
|
|
28
48
|
process.exit(1);
|
|
29
49
|
}
|
|
30
50
|
|
|
@@ -18,6 +18,8 @@ export type Scalars = {
|
|
|
18
18
|
ISO8601Date: { input: any; output: any; }
|
|
19
19
|
/** An ISO 8601-encoded datetime */
|
|
20
20
|
ISO8601DateTime: { input: any; output: any; }
|
|
21
|
+
/** An ISO 8601-encoded duration */
|
|
22
|
+
ISO8601Duration: { input: any; output: any; }
|
|
21
23
|
/** Represents untyped JSON */
|
|
22
24
|
JSON: { input: any; output: any; }
|
|
23
25
|
/** An integer range represented as a two-element array [min, max]. */
|
|
@@ -489,6 +491,11 @@ export type BillingCustomer = Node & {
|
|
|
489
491
|
invoices: BillingInvoiceConnection;
|
|
490
492
|
/** The customer's outstanding sales offer (a pre-negotiated custom plan awaiting checkout), or null when none is pending. */
|
|
491
493
|
pendingOffer?: Maybe<Offer>;
|
|
494
|
+
/**
|
|
495
|
+
* Product this customer belongs to. Decides the Stripe account and plan catalog;
|
|
496
|
+
* credits and subscriptions never cross products.
|
|
497
|
+
*/
|
|
498
|
+
product: BillingProduct;
|
|
492
499
|
/** Total seats the customer is paying for: plan default + extras. */
|
|
493
500
|
seats: Scalars['Int']['output'];
|
|
494
501
|
/** Customer's VAT number for EU customers, captured by Stripe at Checkout. */
|
|
@@ -659,6 +666,17 @@ export type BillingPlanName =
|
|
|
659
666
|
/** 1 seat, smallest credit allowance. */
|
|
660
667
|
| 'STARTER';
|
|
661
668
|
|
|
669
|
+
/**
|
|
670
|
+
* Sortlist product a billing customer belongs to. Each product runs on its own
|
|
671
|
+
* Stripe account with its own plan catalog; credits, subscriptions, and invoices
|
|
672
|
+
* never cross products.
|
|
673
|
+
*/
|
|
674
|
+
export type BillingProduct =
|
|
675
|
+
/** The original shared Stripe account — the old Max app's billing and the marketplace's Recurly payment-gateway traffic. */
|
|
676
|
+
| 'LEGACY'
|
|
677
|
+
/** The new Max product (rebuilt app replacing the old Max, keeping the name), on its own dedicated Stripe account. */
|
|
678
|
+
| 'MAX';
|
|
679
|
+
|
|
662
680
|
/**
|
|
663
681
|
* A mirrored Stripe subscription. Plan tier is identified by the subscription's
|
|
664
682
|
* plan-item Price (`PlanCatalog.find_by_stripe_price_id`).
|
|
@@ -753,6 +771,77 @@ export type CancelConversationPayload = Node & {
|
|
|
753
771
|
ok: Scalars['Boolean']['output'];
|
|
754
772
|
};
|
|
755
773
|
|
|
774
|
+
/** A single entry in a contact's career history: a work-experience role, degree, certification, award, or publication. */
|
|
775
|
+
export type CareerEntry = Node & {
|
|
776
|
+
__typename?: 'CareerEntry';
|
|
777
|
+
/** Free-text description of the entry as provided by the source. */
|
|
778
|
+
description?: Maybe<Scalars['String']['output']>;
|
|
779
|
+
/** End date of the entry (upper bound of its period), or null when the entry is ongoing or the source gave no end date. */
|
|
780
|
+
endedOn?: Maybe<Scalars['ISO8601Date']['output']>;
|
|
781
|
+
id: Scalars['ID']['output'];
|
|
782
|
+
/** Which kind of career entry this is. */
|
|
783
|
+
kind: CareerEntryKind;
|
|
784
|
+
/**
|
|
785
|
+
* The organization this entry links to (e.g. the employer or school), or null
|
|
786
|
+
* when it could not be resolved to a known record.
|
|
787
|
+
*/
|
|
788
|
+
organization?: Maybe<Organization>;
|
|
789
|
+
/** Start date of the entry (lower bound of its period), or null when the source gave no start date. */
|
|
790
|
+
startedOn?: Maybe<Scalars['ISO8601Date']['output']>;
|
|
791
|
+
/** The entry's headline — role title, degree, certification name, award title, or publication title depending on kind. */
|
|
792
|
+
title?: Maybe<Scalars['String']['output']>;
|
|
793
|
+
/** Source URL for the entry (e.g. the credential link), or null. */
|
|
794
|
+
url?: Maybe<Scalars['String']['output']>;
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
/** The connection type for CareerEntry. */
|
|
798
|
+
export type CareerEntryConnection = {
|
|
799
|
+
__typename?: 'CareerEntryConnection';
|
|
800
|
+
/** A list of edges. */
|
|
801
|
+
edges?: Maybe<Array<Maybe<CareerEntryEdge>>>;
|
|
802
|
+
/** A list of nodes. */
|
|
803
|
+
nodes?: Maybe<Array<Maybe<CareerEntry>>>;
|
|
804
|
+
/** Information to aid in pagination. */
|
|
805
|
+
pageInfo: PageInfo;
|
|
806
|
+
/** Total number of items across all pages. */
|
|
807
|
+
totalCount: Scalars['Int']['output'];
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
/** An edge in a connection. */
|
|
811
|
+
export type CareerEntryEdge = Node & {
|
|
812
|
+
__typename?: 'CareerEntryEdge';
|
|
813
|
+
/** A cursor for use in pagination. */
|
|
814
|
+
cursor: Scalars['String']['output'];
|
|
815
|
+
id: Scalars['ID']['output'];
|
|
816
|
+
/** The item at the end of the edge. */
|
|
817
|
+
node?: Maybe<CareerEntry>;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
/** The kind of entry in a contact's career history. */
|
|
821
|
+
export type CareerEntryKind =
|
|
822
|
+
/** An award or honor received. */
|
|
823
|
+
| 'AWARD'
|
|
824
|
+
/** A professional certification. */
|
|
825
|
+
| 'CERTIFICATION'
|
|
826
|
+
/** A degree or course of study. */
|
|
827
|
+
| 'EDUCATION'
|
|
828
|
+
/** A past or current work-experience role. */
|
|
829
|
+
| 'EXPERIENCE'
|
|
830
|
+
/** An authored publication. */
|
|
831
|
+
| 'PUBLICATION';
|
|
832
|
+
|
|
833
|
+
/** Filter on career-entry kind with schema-validated enum values. */
|
|
834
|
+
export type CareerEntryKindFilterInput = {
|
|
835
|
+
/** Exact match. */
|
|
836
|
+
eq?: InputMaybe<CareerEntryKind>;
|
|
837
|
+
/** Match any of these values. */
|
|
838
|
+
in?: InputMaybe<Array<CareerEntryKind>>;
|
|
839
|
+
/** Exclude exact match. */
|
|
840
|
+
notEq?: InputMaybe<CareerEntryKind>;
|
|
841
|
+
/** Exclude any of these values. */
|
|
842
|
+
notIn?: InputMaybe<Array<CareerEntryKind>>;
|
|
843
|
+
};
|
|
844
|
+
|
|
756
845
|
/** Autogenerated input type of ChangeBillingSubscription */
|
|
757
846
|
export type ChangeBillingSubscriptionInput = {
|
|
758
847
|
/** A unique identifier for the client performing the mutation. */
|
|
@@ -1193,6 +1282,8 @@ export type Contact = Node & {
|
|
|
1193
1282
|
* source provides one or the contact has no public photo.
|
|
1194
1283
|
*/
|
|
1195
1284
|
avatarUrl?: Maybe<Scalars['String']['output']>;
|
|
1285
|
+
/** Paginated career entries — experience, education, certifications, awards, and publications — most recent first. */
|
|
1286
|
+
careerEntries: CareerEntryConnection;
|
|
1196
1287
|
/** City where the contact is located. */
|
|
1197
1288
|
city?: Maybe<Scalars['String']['output']>;
|
|
1198
1289
|
/** Confidence score (0.0-1.0) from source quality, freshness, and diversity. */
|
|
@@ -1209,7 +1300,7 @@ export type Contact = Node & {
|
|
|
1209
1300
|
emailStatus?: Maybe<EmailStatus>;
|
|
1210
1301
|
/** First name. */
|
|
1211
1302
|
firstName?: Maybe<Scalars['String']['output']>;
|
|
1212
|
-
/** GlobalID-encoded
|
|
1303
|
+
/** GlobalID-encoded Contact id. */
|
|
1213
1304
|
id: Scalars['ID']['output'];
|
|
1214
1305
|
/** Functional department (e.g. marketing, sales, engineering). */
|
|
1215
1306
|
jobFunction?: Maybe<Scalars['String']['output']>;
|
|
@@ -1225,11 +1316,27 @@ export type Contact = Node & {
|
|
|
1225
1316
|
locations: LocationConnection;
|
|
1226
1317
|
/** The organization this contact belongs to. */
|
|
1227
1318
|
organization: Organization;
|
|
1319
|
+
/**
|
|
1320
|
+
* Profile completeness score (0.0-1.0) from the presence of identity fields,
|
|
1321
|
+
* experience, and the merged confidence score. Consumers gate low-quality
|
|
1322
|
+
* records on this instead of counting raw history entries.
|
|
1323
|
+
*/
|
|
1324
|
+
profileCompleteness: Scalars['Float']['output'];
|
|
1228
1325
|
/** When the contact record was last modified. */
|
|
1229
1326
|
updatedAt: Scalars['ISO8601DateTime']['output'];
|
|
1230
1327
|
};
|
|
1231
1328
|
|
|
1232
1329
|
|
|
1330
|
+
/** A business contact associated with an organization. */
|
|
1331
|
+
export type ContactCareerEntriesArgs = {
|
|
1332
|
+
after?: InputMaybe<Scalars['String']['input']>;
|
|
1333
|
+
before?: InputMaybe<Scalars['String']['input']>;
|
|
1334
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
1335
|
+
kind?: InputMaybe<CareerEntryKindFilterInput>;
|
|
1336
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
|
|
1233
1340
|
/** A business contact associated with an organization. */
|
|
1234
1341
|
export type ContactLocationsArgs = {
|
|
1235
1342
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -1524,6 +1631,13 @@ export type CreateBillingCustomerInput = {
|
|
|
1524
1631
|
email?: InputMaybe<Scalars['String']['input']>;
|
|
1525
1632
|
/** Customer's display name (typically `first last`). Stored on the Stripe Customer for Dashboard readability. */
|
|
1526
1633
|
name?: InputMaybe<Scalars['String']['input']>;
|
|
1634
|
+
/**
|
|
1635
|
+
* Product the customer belongs to — decides which Stripe account the customer is
|
|
1636
|
+
* created on and which plan catalog applies. Defaults to LEGACY for the old Max
|
|
1637
|
+
* app's callers; the account must be registered in the environment or the
|
|
1638
|
+
* mutation fails.
|
|
1639
|
+
*/
|
|
1640
|
+
product?: InputMaybe<BillingProduct>;
|
|
1527
1641
|
};
|
|
1528
1642
|
|
|
1529
1643
|
/** Autogenerated return type of CreateBillingCustomer. */
|
|
@@ -1964,6 +2078,13 @@ export type CreateWatcherInput = {
|
|
|
1964
2078
|
definitionSlug: Scalars['String']['input'];
|
|
1965
2079
|
/** Version of the Definition to subscribe to. */
|
|
1966
2080
|
definitionVersion: Scalars['Int']['input'];
|
|
2081
|
+
/**
|
|
2082
|
+
* Optional freshness-first per-period lead caps for this watcher. Omit or pass
|
|
2083
|
+
* an empty list to leave the watcher uncapped. Caps are a property of the
|
|
2084
|
+
* watcher (not the individual webhook), so they replace any caps already set on
|
|
2085
|
+
* a shared watcher.
|
|
2086
|
+
*/
|
|
2087
|
+
leadCaps?: InputMaybe<Array<LeadCapInput>>;
|
|
1967
2088
|
/** User-supplied watcher input validated against the Definition's `watcherInputSchema`. */
|
|
1968
2089
|
watcherInput: Scalars['JSON']['input'];
|
|
1969
2090
|
/** Delivery endpoint registered on this watcher. Multiple callers with the same definition and input share one watcher. */
|
|
@@ -3183,6 +3304,21 @@ export type LeadAcquisitionSourceEnum =
|
|
|
3183
3304
|
| 'MAX'
|
|
3184
3305
|
| 'SIGNALS';
|
|
3185
3306
|
|
|
3307
|
+
/**
|
|
3308
|
+
* A single freshness-first lead cap for a Watcher: at most `maximumLeads` events
|
|
3309
|
+
* are surfaced per `period`, counted from `startsAt` and reset at every period
|
|
3310
|
+
* boundary. Excess events are dropped, never buffered. Combine several caps to
|
|
3311
|
+
* constrain multiple periods at once — the most restrictive one wins.
|
|
3312
|
+
*/
|
|
3313
|
+
export type LeadCapInput = {
|
|
3314
|
+
/** Maximum number of events surfaced per period. Must be greater than zero. */
|
|
3315
|
+
maximumLeads: Scalars['Int']['input'];
|
|
3316
|
+
/** Length of the accumulation window as an ISO-8601 duration, e.g. P1D (one day) or P1W (one week). */
|
|
3317
|
+
period: Scalars['ISO8601Duration']['input'];
|
|
3318
|
+
/** Anchor at which the first period begins. Defaults to the moment the cap is created. */
|
|
3319
|
+
startsAt?: InputMaybe<Scalars['ISO8601DateTime']['input']>;
|
|
3320
|
+
};
|
|
3321
|
+
|
|
3186
3322
|
/** The connection type for Lead. */
|
|
3187
3323
|
export type LeadConnection = {
|
|
3188
3324
|
__typename?: 'LeadConnection';
|
|
@@ -3998,6 +4134,12 @@ export type Mutation = {
|
|
|
3998
4134
|
updateSource?: Maybe<Source>;
|
|
3999
4135
|
/** Update the calling user's preferred UI locale. */
|
|
4000
4136
|
updateUserLocale?: Maybe<UpdateUserLocalePayload>;
|
|
4137
|
+
/**
|
|
4138
|
+
* Replace the freshness-first per-period lead caps on a Watcher. The new caps
|
|
4139
|
+
* take effect in-house immediately and are propagated to Rodz-backed signals as
|
|
4140
|
+
* their per-day limit.
|
|
4141
|
+
*/
|
|
4142
|
+
updateWatcherLeadCaps?: Maybe<UpdateWatcherLeadCapsPayload>;
|
|
4001
4143
|
/**
|
|
4002
4144
|
* Asynchronously validate that the supplied name, email, and phone are internally consistent
|
|
4003
4145
|
* for a contact at the given organization.
|
|
@@ -4485,6 +4627,11 @@ export type MutationUpdateUserLocaleArgs = {
|
|
|
4485
4627
|
};
|
|
4486
4628
|
|
|
4487
4629
|
|
|
4630
|
+
export type MutationUpdateWatcherLeadCapsArgs = {
|
|
4631
|
+
input: UpdateWatcherLeadCapsInput;
|
|
4632
|
+
};
|
|
4633
|
+
|
|
4634
|
+
|
|
4488
4635
|
export type MutationValidateContactArgs = {
|
|
4489
4636
|
input: ValidateContactInput;
|
|
4490
4637
|
};
|
|
@@ -4584,7 +4731,7 @@ export type Organization = Node & {
|
|
|
4584
4731
|
domainReachableAt?: Maybe<Scalars['ISO8601DateTime']['output']>;
|
|
4585
4732
|
/** Year the company was founded. */
|
|
4586
4733
|
foundedYear?: Maybe<Scalars['Int']['output']>;
|
|
4587
|
-
/** GlobalID-encoded
|
|
4734
|
+
/** GlobalID-encoded Organization id. */
|
|
4588
4735
|
id: Scalars['ID']['output'];
|
|
4589
4736
|
/** Primary industry classification. */
|
|
4590
4737
|
industry?: Maybe<Scalars['String']['output']>;
|
|
@@ -4631,6 +4778,7 @@ export type OrganizationOrganizationAddressesArgs = {
|
|
|
4631
4778
|
before?: InputMaybe<Scalars['String']['input']>;
|
|
4632
4779
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
4633
4780
|
isHeadquarters?: InputMaybe<Scalars['Boolean']['input']>;
|
|
4781
|
+
kind?: InputMaybe<OrganizationAddressKind>;
|
|
4634
4782
|
last?: InputMaybe<Scalars['Int']['input']>;
|
|
4635
4783
|
};
|
|
4636
4784
|
|
|
@@ -4648,8 +4796,13 @@ export type OrganizationAddress = Node & {
|
|
|
4648
4796
|
/** When the address was created. */
|
|
4649
4797
|
createdAt: Scalars['ISO8601DateTime']['output'];
|
|
4650
4798
|
id: Scalars['ID']['output'];
|
|
4651
|
-
/**
|
|
4799
|
+
/**
|
|
4800
|
+
* Whether this is the organization's headquarters.
|
|
4801
|
+
* @deprecated Use `kind == HEADQUARTERS` instead.
|
|
4802
|
+
*/
|
|
4652
4803
|
isHeadquarters: Scalars['Boolean']['output'];
|
|
4804
|
+
/** Classification of this address: headquarters, office, or unattended. */
|
|
4805
|
+
kind: OrganizationAddressKind;
|
|
4653
4806
|
/** Mercator location divisions for this office address. Empty until the background enrichment job runs. */
|
|
4654
4807
|
locations: LocationConnection;
|
|
4655
4808
|
/** Postal or ZIP code. */
|
|
@@ -4694,6 +4847,15 @@ export type OrganizationAddressEdge = Node & {
|
|
|
4694
4847
|
node?: Maybe<OrganizationAddress>;
|
|
4695
4848
|
};
|
|
4696
4849
|
|
|
4850
|
+
/** Classification of an organization address. */
|
|
4851
|
+
export type OrganizationAddressKind =
|
|
4852
|
+
/** The organization's elected headquarters. */
|
|
4853
|
+
| 'HEADQUARTERS'
|
|
4854
|
+
/** A staffed office or branch location. */
|
|
4855
|
+
| 'OFFICE'
|
|
4856
|
+
/** A location with no on-site staff (e.g. an ATM or EV charging station). */
|
|
4857
|
+
| 'UNATTENDED';
|
|
4858
|
+
|
|
4697
4859
|
/** Parameters for an organization search by visitor IP address. */
|
|
4698
4860
|
export type OrganizationByIpInput = {
|
|
4699
4861
|
/** Visitor's ISO 3166-1 alpha-2 country code — boosts matching accuracy. */
|
|
@@ -5510,8 +5672,8 @@ export type Query = {
|
|
|
5510
5672
|
/** Liveness probe for the billing subgraph. */
|
|
5511
5673
|
billingPing: Scalars['String']['output'];
|
|
5512
5674
|
/**
|
|
5513
|
-
* Static catalog of plans (Starter / Growth / Scale × monthly / annual)
|
|
5514
|
-
* the upgrade ladder UI without round-tripping Stripe.
|
|
5675
|
+
* Static catalog of plans (Starter / Growth / Scale × monthly / annual) for one
|
|
5676
|
+
* product. Drives the upgrade ladder UI without round-tripping Stripe.
|
|
5515
5677
|
*/
|
|
5516
5678
|
billingPlanCatalog: Array<BillingPlanCatalogEntry>;
|
|
5517
5679
|
/**
|
|
@@ -5598,6 +5760,11 @@ export type QueryBillingCustomerArgs = {
|
|
|
5598
5760
|
};
|
|
5599
5761
|
|
|
5600
5762
|
|
|
5763
|
+
export type QueryBillingPlanCatalogArgs = {
|
|
5764
|
+
product?: InputMaybe<BillingProduct>;
|
|
5765
|
+
};
|
|
5766
|
+
|
|
5767
|
+
|
|
5601
5768
|
export type QueryContactsArgs = {
|
|
5602
5769
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
5603
5770
|
before?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -7472,6 +7639,26 @@ export type UpdateUserLocalePayload = Node & {
|
|
|
7472
7639
|
user: User;
|
|
7473
7640
|
};
|
|
7474
7641
|
|
|
7642
|
+
/** Autogenerated input type of UpdateWatcherLeadCaps */
|
|
7643
|
+
export type UpdateWatcherLeadCapsInput = {
|
|
7644
|
+
/** A unique identifier for the client performing the mutation. */
|
|
7645
|
+
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
|
7646
|
+
/** Global id of the Watcher whose caps are being replaced. */
|
|
7647
|
+
id: Scalars['ID']['input'];
|
|
7648
|
+
/** The full set of caps for the Watcher. Pass an empty list to remove all caps (leaving the Watcher uncapped). */
|
|
7649
|
+
leadCaps: Array<LeadCapInput>;
|
|
7650
|
+
};
|
|
7651
|
+
|
|
7652
|
+
/** Autogenerated return type of UpdateWatcherLeadCaps. */
|
|
7653
|
+
export type UpdateWatcherLeadCapsPayload = Node & {
|
|
7654
|
+
__typename?: 'UpdateWatcherLeadCapsPayload';
|
|
7655
|
+
/** A unique identifier for the client performing the mutation. */
|
|
7656
|
+
clientMutationId?: Maybe<Scalars['String']['output']>;
|
|
7657
|
+
id: Scalars['ID']['output'];
|
|
7658
|
+
/** The updated Watcher. */
|
|
7659
|
+
watcher: Watcher;
|
|
7660
|
+
};
|
|
7661
|
+
|
|
7475
7662
|
/** Federation reference to a User owned by another subgraph. */
|
|
7476
7663
|
export type User = Node & {
|
|
7477
7664
|
__typename?: 'User';
|
|
@@ -7726,6 +7913,8 @@ export type Watcher = AcquisitionerInterface & Node & {
|
|
|
7726
7913
|
* provider requires client-side setup.
|
|
7727
7914
|
*/
|
|
7728
7915
|
installations: Array<Scalars['JSON']['output']>;
|
|
7916
|
+
/** Freshness-first per-period lead caps applied to this Watcher. Empty when the Watcher is uncapped. */
|
|
7917
|
+
leadCaps: WatcherLeadCapConnection;
|
|
7729
7918
|
/** Human-readable display name of the Watcher, derived from the signal Definition it tracks. */
|
|
7730
7919
|
name: Scalars['String']['output'];
|
|
7731
7920
|
/** Timestamp of the most recent change to this Watcher. */
|
|
@@ -7743,6 +7932,59 @@ export type WatcherEventsArgs = {
|
|
|
7743
7932
|
last?: InputMaybe<Scalars['Int']['input']>;
|
|
7744
7933
|
};
|
|
7745
7934
|
|
|
7935
|
+
|
|
7936
|
+
/** Federation reference to a Watcher owned by another subgraph. */
|
|
7937
|
+
export type WatcherLeadCapsArgs = {
|
|
7938
|
+
after?: InputMaybe<Scalars['String']['input']>;
|
|
7939
|
+
before?: InputMaybe<Scalars['String']['input']>;
|
|
7940
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
7941
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
7942
|
+
};
|
|
7943
|
+
|
|
7944
|
+
/**
|
|
7945
|
+
* A freshness-first lead cap on a Watcher: at most `maximumLeads` events are
|
|
7946
|
+
* surfaced per `period`, counted from `startsAt` and reset at every period boundary.
|
|
7947
|
+
*/
|
|
7948
|
+
export type WatcherLeadCap = Node & {
|
|
7949
|
+
__typename?: 'WatcherLeadCap';
|
|
7950
|
+
/** Timestamp when the cap was created. */
|
|
7951
|
+
createdAt: Scalars['ISO8601DateTime']['output'];
|
|
7952
|
+
/** Start of the window currently accumulating; events are counted from here and the usage resets at the next boundary. */
|
|
7953
|
+
currentPeriodStartsAt: Scalars['ISO8601DateTime']['output'];
|
|
7954
|
+
/** Number of events already surfaced in the current window. The cap drops further events once this reaches `maximumLeads`. */
|
|
7955
|
+
currentUsage: Scalars['Int']['output'];
|
|
7956
|
+
id: Scalars['ID']['output'];
|
|
7957
|
+
/** Maximum number of events surfaced per period. */
|
|
7958
|
+
maximumLeads: Scalars['Int']['output'];
|
|
7959
|
+
/** Length of the accumulation window as an ISO-8601 duration, e.g. P1D or P1W. */
|
|
7960
|
+
period: Scalars['ISO8601Duration']['output'];
|
|
7961
|
+
/** Anchor at which the first period begins; each window is measured forward from here. */
|
|
7962
|
+
startsAt: Scalars['ISO8601DateTime']['output'];
|
|
7963
|
+
};
|
|
7964
|
+
|
|
7965
|
+
/** The connection type for WatcherLeadCap. */
|
|
7966
|
+
export type WatcherLeadCapConnection = {
|
|
7967
|
+
__typename?: 'WatcherLeadCapConnection';
|
|
7968
|
+
/** A list of edges. */
|
|
7969
|
+
edges?: Maybe<Array<Maybe<WatcherLeadCapEdge>>>;
|
|
7970
|
+
/** A list of nodes. */
|
|
7971
|
+
nodes?: Maybe<Array<Maybe<WatcherLeadCap>>>;
|
|
7972
|
+
/** Information to aid in pagination. */
|
|
7973
|
+
pageInfo: PageInfo;
|
|
7974
|
+
/** Total number of items across all pages. */
|
|
7975
|
+
totalCount: Scalars['Int']['output'];
|
|
7976
|
+
};
|
|
7977
|
+
|
|
7978
|
+
/** An edge in a connection. */
|
|
7979
|
+
export type WatcherLeadCapEdge = Node & {
|
|
7980
|
+
__typename?: 'WatcherLeadCapEdge';
|
|
7981
|
+
/** A cursor for use in pagination. */
|
|
7982
|
+
cursor: Scalars['String']['output'];
|
|
7983
|
+
id: Scalars['ID']['output'];
|
|
7984
|
+
/** The item at the end of the edge. */
|
|
7985
|
+
node?: Maybe<WatcherLeadCap>;
|
|
7986
|
+
};
|
|
7987
|
+
|
|
7746
7988
|
/** Delivery endpoint registered on a Watcher. Secrets are write-only — they are never returned by the API. */
|
|
7747
7989
|
export type WatcherWebhookInput = {
|
|
7748
7990
|
/**
|
|
@@ -62,10 +62,13 @@ function buildSelections(
|
|
|
62
62
|
const lines: string[] = [];
|
|
63
63
|
const isPayload = PAYLOAD_TYPE_PATTERN.test(type.name);
|
|
64
64
|
|
|
65
|
-
// Relay Connection pattern
|
|
65
|
+
// Relay Connection pattern. The connection/`nodes` wrapper is not a semantic
|
|
66
|
+
// nesting level, so the node type inherits the caller's `depth` unchanged —
|
|
67
|
+
// otherwise object fields on the node (e.g. Contact.organization) would never
|
|
68
|
+
// be selected regardless of --depth.
|
|
66
69
|
if (type.name.endsWith('Connection') && fields.nodes && fields.pageInfo) {
|
|
67
70
|
const nodesType = unwrap(fields.nodes.type);
|
|
68
|
-
const nodeSelections = buildSelections(nodesType, schema,
|
|
71
|
+
const nodeSelections = buildSelections(nodesType, schema, depth, exclude, `${prefix}nodes.`, new Set(visited));
|
|
69
72
|
if (nodeSelections.length === 0) return [];
|
|
70
73
|
lines.push(`nodes {`);
|
|
71
74
|
for (const sel of nodeSelections) lines.push(` ${sel}`);
|