@mountaya/client 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1260 -2
- package/dist/admin/index.cjs +3521 -0
- package/dist/admin/index.cjs.map +1 -0
- package/dist/admin/index.d.cts +1070 -0
- package/dist/admin/index.d.ts +1070 -0
- package/dist/admin/index.js +301 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/browser.cjs +8073 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +106 -0
- package/dist/browser.d.ts +106 -0
- package/dist/browser.js +53 -0
- package/dist/browser.js.map +1 -0
- package/dist/chunk-BM526BHG.js +342 -0
- package/dist/chunk-BM526BHG.js.map +1 -0
- package/dist/chunk-D2YEVTG7.js +327 -0
- package/dist/chunk-D2YEVTG7.js.map +1 -0
- package/dist/chunk-OHKVUREN.js +3500 -0
- package/dist/chunk-OHKVUREN.js.map +1 -0
- package/dist/chunk-TDTK2L5H.js +3842 -0
- package/dist/chunk-TDTK2L5H.js.map +1 -0
- package/dist/coreOperations.gen-BMYPoBbz.d.ts +1760 -0
- package/dist/coreOperations.gen-BxX5xRxw.d.cts +1760 -0
- package/dist/errors-B-GqAtQv.d.cts +75960 -0
- package/dist/errors-B-GqAtQv.d.ts +75960 -0
- package/dist/events/index.cjs +1972 -0
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +781 -0
- package/dist/events/index.d.ts +781 -0
- package/dist/events/index.js +826 -0
- package/dist/events/index.js.map +1 -0
- package/dist/index.cjs +8072 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/operations.gen-CvTyzKNF.d.cts +3993 -0
- package/dist/operations.gen-DUD406TV.d.ts +3993 -0
- package/package.json +127 -4
- package/src/admin/index.ts +47 -0
- package/src/admin/rules/mountayaAdmin.ts +102 -0
- package/src/browser.ts +232 -0
- package/src/core/engines/sessionToken.ts +870 -0
- package/src/core/rules/auth.ts +1017 -0
- package/src/core/rules/clientHeader.ts +28 -0
- package/src/core/rules/dates.ts +200 -0
- package/src/core/rules/decode.ts +154 -0
- package/src/core/rules/envelope.ts +41 -0
- package/src/core/rules/errors.ts +1486 -0
- package/src/core/rules/graphql.ts +576 -0
- package/src/core/rules/headerValue.ts +42 -0
- package/src/core/rules/idempotencyKey.ts +64 -0
- package/src/core/rules/nullMask.ts +127 -0
- package/src/core/rules/nullMasks.gen.ts +416 -0
- package/src/core/rules/paginate.ts +316 -0
- package/src/core/rules/rateLimit.ts +507 -0
- package/src/core/rules/redaction.ts +219 -0
- package/src/core/rules/resourceRef.ts +110 -0
- package/src/core/rules/responseBody.ts +492 -0
- package/src/core/rules/retry.ts +386 -0
- package/src/core/rules/selection.ts +416 -0
- package/src/core/rules/sessionAnswer.ts +90 -0
- package/src/core/rules/sessionSchedule.ts +131 -0
- package/src/core/rules/sessionWait.ts +112 -0
- package/src/core/rules/transport.ts +2386 -0
- package/src/core/rules/version.gen.ts +16 -0
- package/src/core/rules/webAddress.ts +165 -0
- package/src/core/rules/webAddresses.gen.ts +30 -0
- package/src/data/operations.gen.ts +603 -0
- package/src/data/schema.gen.ts +8078 -0
- package/src/data/selection.gen.ts +472 -0
- package/src/events/index.ts +67 -0
- package/src/events/rules/agent.ts +439 -0
- package/src/events/rules/collab.ts +554 -0
- package/src/events/rules/collabNulls.gen.ts +17 -0
- package/src/events/rules/eventStream.ts +94 -0
- package/src/events/rules/openSseStream.ts +594 -0
- package/src/events/rules/sse.ts +349 -0
- package/src/index.ts +231 -0
- package/src/rest/adminOperations.gen.ts +70 -0
- package/src/rest/adminResources.gen.ts +136 -0
- package/src/rest/coreOperations.gen.ts +74 -0
- package/src/rest/coreResources.gen.ts +244 -0
- package/src/rest/dates.gen.ts +217 -0
- package/src/rest/operations.gen.ts +4341 -0
- package/src/rest/resources.gen.ts +369 -0
- package/src/rest/schema.gen.ts +56840 -0
- package/src/tiles/operations.gen.ts +206 -0
- package/src/tiles/schema.gen.ts +8408 -0
- package/src/webhooks/rules/constructWebhookEvent.ts +482 -0
- package/src/webhooks/rules/webhookEvent.ts +38 -0
- package/src/webhooks/rules/webhookEvents.gen.ts +732 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The members a value may leave out that read null.
|
|
3
|
+
*
|
|
4
|
+
* The contract types a member required where every value states it, and nullable where its value
|
|
5
|
+
* may be null, and a member that is both is one whose type a caller reads as `T | null`. A value
|
|
6
|
+
* that leaves it out would hand that caller `undefined`, a value its type does not hold, so such a
|
|
7
|
+
* member left out reads null: in an answer, in a webhook event, in a collaboration frame and in the
|
|
8
|
+
* JSON `decodeRestSchema` decodes. A member the contract types optional is left out as it arrived,
|
|
9
|
+
* and so is every member it does not type at all.
|
|
10
|
+
*
|
|
11
|
+
* Which members of which schema, and of which operation's answer, are required and nullable is the
|
|
12
|
+
* contract's, printed from its model into `nullMasks.gen.ts` by `scripts/generate-null-masks.mjs`,
|
|
13
|
+
* and for a collaboration frame into `events/rules/collabNulls.gen.ts`. This module reads neither,
|
|
14
|
+
* so the feed's entry carries the walk and its own masks without the rest.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* NullableMask names, in a JSON value, the members that read null where the value leaves them out.
|
|
19
|
+
*
|
|
20
|
+
* An object marks each member it names by that member's own mask: `true` for a member the contract
|
|
21
|
+
* types required and nullable, a mask of what the member holds for one that holds such members
|
|
22
|
+
* itself, and `[true, mask]` for a member that is both. A one-element array marks every element of
|
|
23
|
+
* a list by that element's mask, as a `DateMask` does. `[discriminator, variants]` marks an object
|
|
24
|
+
* of a union by the mask of its variant, the one `variants` names by the value the object holds at
|
|
25
|
+
* `discriminator`: a member that reads null in one variant is no member of another.
|
|
26
|
+
*/
|
|
27
|
+
export type NullableMask =
|
|
28
|
+
| true
|
|
29
|
+
| { readonly [member: string]: NullableMask }
|
|
30
|
+
| readonly [NullableMask]
|
|
31
|
+
| readonly [true, NullableMask]
|
|
32
|
+
| readonly [string, { readonly [value: string]: NullableMask }];
|
|
33
|
+
|
|
34
|
+
/** isHolding reports a mask that marks a member both nullable and holding what its second names. */
|
|
35
|
+
const isHolding = (mask: NullableMask): mask is readonly [true, NullableMask] =>
|
|
36
|
+
Array.isArray(mask) && mask.length === 2 && mask[0] === true;
|
|
37
|
+
|
|
38
|
+
/** isVariants reports a mask that reads an object of a union by the variant it names. */
|
|
39
|
+
const isVariants = (
|
|
40
|
+
mask: NullableMask,
|
|
41
|
+
): mask is readonly [string, { readonly [value: string]: NullableMask }] =>
|
|
42
|
+
Array.isArray(mask) && mask.length === 2 && typeof mask[0] === "string";
|
|
43
|
+
|
|
44
|
+
/** isListMask reports a mask that marks every element of a list. */
|
|
45
|
+
const isListMask = (mask: NullableMask): mask is readonly [NullableMask] =>
|
|
46
|
+
Array.isArray(mask) && mask.length === 1;
|
|
47
|
+
|
|
48
|
+
/** isMembers reports a value whose members a mask can name: an object that is no list. */
|
|
49
|
+
const isMembers = (value: unknown): value is Readonly<Record<string, unknown>> =>
|
|
50
|
+
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* withAbsentNulls answers `value` with null at each member `mask` marks required and nullable that
|
|
54
|
+
* it leaves out, at whatever depth the mask reaches, and never writes to `value`.
|
|
55
|
+
*
|
|
56
|
+
* It copies on the way back up, as `decodeRestSchema` copies an instant it decodes: an object or a
|
|
57
|
+
* list is copied, one level, only where something under it was written, and is answered as itself
|
|
58
|
+
* otherwise. So the answer shares with `value` everything that leaves out no such member, and a
|
|
59
|
+
* value that leaves out none is its own answer.
|
|
60
|
+
*
|
|
61
|
+
* A member is left out where the value holds no member of its own by that name. A value whose shape
|
|
62
|
+
* differs from its mask, a list where the mask names members or a string where it names a list, is
|
|
63
|
+
* left as it arrived: a body that disagrees with its declaration in shape is the server's to answer
|
|
64
|
+
* for, as its instants are read.
|
|
65
|
+
*
|
|
66
|
+
* @param value - The parsed JSON.
|
|
67
|
+
* @param mask - The members that read null where they are left out, or undefined for none.
|
|
68
|
+
* @returns The value, with null at each member the mask marks that it leaves out.
|
|
69
|
+
*/
|
|
70
|
+
export const withAbsentNulls = (value: unknown, mask: NullableMask | undefined): unknown => {
|
|
71
|
+
if (mask === undefined || mask === true || isHolding(mask)) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isListMask(mask)) {
|
|
76
|
+
if (!Array.isArray(value)) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let copy: unknown[] | undefined;
|
|
81
|
+
for (const [index, element] of value.entries()) {
|
|
82
|
+
const written = withAbsentNulls(element, mask[0]);
|
|
83
|
+
if (written !== element) {
|
|
84
|
+
copy ??= [...value];
|
|
85
|
+
copy[index] = written;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return copy ?? value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!isMembers(value)) {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (isVariants(mask)) {
|
|
97
|
+
const [discriminator, variants] = mask;
|
|
98
|
+
const variant = value[discriminator];
|
|
99
|
+
|
|
100
|
+
// A variant the build does not know is read as it arrived, and so is one that holds no member
|
|
101
|
+
// that reads null.
|
|
102
|
+
return typeof variant === "string" && Object.hasOwn(variants, variant)
|
|
103
|
+
? withAbsentNulls(value, variants[variant])
|
|
104
|
+
: value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let copy: Record<string, unknown> | undefined;
|
|
108
|
+
for (const [member, inner] of Object.entries(mask)) {
|
|
109
|
+
if (!Object.hasOwn(value, member)) {
|
|
110
|
+
if (inner === true || isHolding(inner)) {
|
|
111
|
+
copy ??= { ...value };
|
|
112
|
+
copy[member] = null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const held = value[member];
|
|
119
|
+
const written = withAbsentNulls(held, isHolding(inner) ? inner[1] : inner);
|
|
120
|
+
if (written !== held) {
|
|
121
|
+
copy ??= { ...value };
|
|
122
|
+
copy[member] = written;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return copy ?? value;
|
|
127
|
+
};
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
// GENERATED FILE. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// The members a value of each Map Studio API schema, and the answer of each of its operations,
|
|
4
|
+
// reads null where it leaves them out, generated from the mountaya/schemas contract
|
|
5
|
+
// (sdk/model.json, `rest`) by scripts/generate-null-masks.mjs: every member a schema types
|
|
6
|
+
// required whose value may be null, which the types beside this file declare as `T | null`.
|
|
7
|
+
//
|
|
8
|
+
// Edit the contract in mountaya/schemas, not this file.
|
|
9
|
+
|
|
10
|
+
import type { NullableMask } from "./nullMask.js";
|
|
11
|
+
|
|
12
|
+
/** The members of `Locales` that read null where a value leaves them out. */
|
|
13
|
+
export const localesNulls = { de: true, en: true, es: true, fr: true, it: true, ja: true, zh: true } as const;
|
|
14
|
+
|
|
15
|
+
/** The members of `Activity` that read null where a value leaves them out. */
|
|
16
|
+
export const activityNulls = { locales: localesNulls } as const;
|
|
17
|
+
|
|
18
|
+
/** The members of `AiProviderConfig` that read null where a value leaves them out. */
|
|
19
|
+
export const aiProviderConfigNulls = { base_url: true } as const;
|
|
20
|
+
|
|
21
|
+
/** The members of `BillingPricing` that read null where a value leaves them out. */
|
|
22
|
+
export const billingPricingNulls = { unit_amount: true } as const;
|
|
23
|
+
|
|
24
|
+
/** The members of `BillingProduct` that read null where a value leaves them out. */
|
|
25
|
+
export const billingProductNulls = { prices: [billingPricingNulls] } as const;
|
|
26
|
+
|
|
27
|
+
/** The members of `CategoryActivities` that read null where a value leaves them out. */
|
|
28
|
+
export const categoryActivitiesNulls = { children: [activityNulls], locales: localesNulls } as const;
|
|
29
|
+
|
|
30
|
+
/** The members of `TileLegend` that read null where a value leaves them out. */
|
|
31
|
+
export const tileLegendNulls = { locales: localesNulls } as const;
|
|
32
|
+
|
|
33
|
+
/** The members of `TileLayer` that read null where a value leaves them out. */
|
|
34
|
+
export const tileLayerNulls = { layout: true, legend: tileLegendNulls, paint: true } as const;
|
|
35
|
+
|
|
36
|
+
/** The members of `TileSource` that read null where a value leaves them out. */
|
|
37
|
+
export const tileSourceNulls = { layers: [tileLayerNulls] } as const;
|
|
38
|
+
|
|
39
|
+
/** The members of `Overlay` that read null where a value leaves them out. */
|
|
40
|
+
export const overlayNulls = { locales: localesNulls, sources: [tileSourceNulls] } as const;
|
|
41
|
+
|
|
42
|
+
/** The members of `CategoryOverlays` that read null where a value leaves them out. */
|
|
43
|
+
export const categoryOverlaysNulls = { children: [overlayNulls], locales: localesNulls } as const;
|
|
44
|
+
|
|
45
|
+
/** The members of `CollabCursorEvent` that read null where a value leaves them out. */
|
|
46
|
+
export const collabCursorEventNulls = { position: true } as const;
|
|
47
|
+
|
|
48
|
+
/** The members of `CollabCursorSignal` that read null where a value leaves them out. */
|
|
49
|
+
export const collabCursorSignalNulls = { position: true } as const;
|
|
50
|
+
|
|
51
|
+
/** The members of `CollabSelectionEvent` that read null where a value leaves them out. */
|
|
52
|
+
export const collabSelectionEventNulls = { selection: true } as const;
|
|
53
|
+
|
|
54
|
+
/** The members of `CollabSelectionSignal` that read null where a value leaves them out. */
|
|
55
|
+
export const collabSelectionSignalNulls = { selection: true } as const;
|
|
56
|
+
|
|
57
|
+
/** The members of `CollabSignalParams` that read null where a value leaves them out. */
|
|
58
|
+
export const collabSignalParamsNulls = ["type", { cursor: collabCursorSignalNulls, selection: collabSelectionSignalNulls }] as const;
|
|
59
|
+
|
|
60
|
+
/** The members of `CollabStreamEvent` that read null where a value leaves them out. */
|
|
61
|
+
export const collabStreamEventNulls = ["type", { cursor: collabCursorEventNulls, selection: collabSelectionEventNulls }] as const;
|
|
62
|
+
|
|
63
|
+
/** The members of `Collection` that read null where a value leaves them out. */
|
|
64
|
+
export const collectionNulls = { description: true, organization_id: true, sources: [tileSourceNulls] } as const;
|
|
65
|
+
|
|
66
|
+
/** The members of `CollectionEventObject` that read null where a value leaves them out. */
|
|
67
|
+
export const collectionEventObjectNulls = { description: true } as const;
|
|
68
|
+
|
|
69
|
+
/** The members of `Itinerary` that read null where a value leaves them out. */
|
|
70
|
+
export const itineraryNulls = { ascent: true, description: true, distance: true, organization_id: true } as const;
|
|
71
|
+
|
|
72
|
+
/** The members of `ItineraryDirectionsStep` that read null where a value leaves them out. */
|
|
73
|
+
export const itineraryDirectionsStepNulls = { exit_number: true } as const;
|
|
74
|
+
|
|
75
|
+
/** The members of `ItineraryEventObject` that read null where a value leaves them out. */
|
|
76
|
+
export const itineraryEventObjectNulls = { description: true } as const;
|
|
77
|
+
|
|
78
|
+
/** The members of `ProposedSegment` that read null where a value leaves them out. */
|
|
79
|
+
export const proposedSegmentNulls = { recommendation_reason: true } as const;
|
|
80
|
+
|
|
81
|
+
/** The members of `ItineraryImportPreview` that read null where a value leaves them out. */
|
|
82
|
+
export const itineraryImportPreviewNulls = { segments: [proposedSegmentNulls] } as const;
|
|
83
|
+
|
|
84
|
+
/** The members of `ItinerarySegment` that read null where a value leaves them out. */
|
|
85
|
+
export const itinerarySegmentNulls = { altitude_max: true, altitude_min: true, ascent: true, color: true, descent: true, description: true, distance: true, duration: true, geojson: true, gradient_max: true, gradient_min: true, group_id: true, road_access_info: true, slope_info: true, speed: true, speed_info: true, start_at: true, steps: [true, [itineraryDirectionsStepNulls]], surface_info: true, trail_difficulty_info: true, way_type_info: true } as const;
|
|
86
|
+
|
|
87
|
+
/** The members of `ItinerarySegmentGroup` that read null where a value leaves them out. */
|
|
88
|
+
export const itinerarySegmentGroupNulls = { speed: true } as const;
|
|
89
|
+
|
|
90
|
+
/** The members of `ItineraryWaypoint` that read null where a value leaves them out. */
|
|
91
|
+
export const itineraryWaypointNulls = { color: true, contact: true, description: true, geojson: true, icon: true, media: true, name: true, properties: true, timing: true } as const;
|
|
92
|
+
|
|
93
|
+
/** The members of `ItineraryWaypointEventObject` that read null where a value leaves them out. */
|
|
94
|
+
export const itineraryWaypointEventObjectNulls = { name: true } as const;
|
|
95
|
+
|
|
96
|
+
/** The members of `ItineraryWithDetails` that read null where a value leaves them out. */
|
|
97
|
+
export const itineraryWithDetailsNulls = { ascent: true, description: true, distance: true, groups: [itinerarySegmentGroupNulls], organization_id: true, published_at: true, segments: [itinerarySegmentNulls], waypoints: [itineraryWaypointNulls] } as const;
|
|
98
|
+
|
|
99
|
+
/** The members of `Terrain` that read null where a value leaves them out. */
|
|
100
|
+
export const terrainNulls = { locales: localesNulls } as const;
|
|
101
|
+
|
|
102
|
+
/** The members of `Layers` that read null where a value leaves them out. */
|
|
103
|
+
export const layersNulls = { itineraries: overlayNulls, overlays: [categoryOverlaysNulls], terrains: [terrainNulls], zones: overlayNulls } as const;
|
|
104
|
+
|
|
105
|
+
/** The members of `PaginationMetadata` that read null where a value leaves them out. */
|
|
106
|
+
export const paginationMetadataNulls = { next_cursor: true } as const;
|
|
107
|
+
|
|
108
|
+
/** The members of `ListMetadata` that read null where a value leaves them out. */
|
|
109
|
+
export const listMetadataNulls = { pagination: paginationMetadataNulls } as const;
|
|
110
|
+
|
|
111
|
+
/** The members of `NotificationPreference` that read null where a value leaves them out. */
|
|
112
|
+
export const notificationPreferenceNulls = { locked_reason: true } as const;
|
|
113
|
+
|
|
114
|
+
/** The members of `NotificationPreferences` that read null where a value leaves them out. */
|
|
115
|
+
export const notificationPreferencesNulls = { notifications: [notificationPreferenceNulls] } as const;
|
|
116
|
+
|
|
117
|
+
/** The members of `SubscriptionDiscount` that read null where a value leaves them out. */
|
|
118
|
+
export const subscriptionDiscountNulls = { ends_at: true } as const;
|
|
119
|
+
|
|
120
|
+
/** The members of `OrganizationSubscription` that read null where a value leaves them out. */
|
|
121
|
+
export const organizationSubscriptionNulls = { discount: subscriptionDiscountNulls } as const;
|
|
122
|
+
|
|
123
|
+
/** The members of `OrganizationSubscriptionSummary` that read null where a value leaves them out. */
|
|
124
|
+
export const organizationSubscriptionSummaryNulls = { api: organizationSubscriptionNulls } as const;
|
|
125
|
+
|
|
126
|
+
/** The members of `Session` that read null where a value leaves them out. */
|
|
127
|
+
export const sessionNulls = { user_id: true } as const;
|
|
128
|
+
|
|
129
|
+
/** The members of `WebhookDelivery` that read null where a value leaves them out. */
|
|
130
|
+
export const webhookDeliveryNulls = { next_attempt_at: true } as const;
|
|
131
|
+
|
|
132
|
+
/** The members of `WebhookDeliveryTrigger` that read null where a value leaves them out. */
|
|
133
|
+
export const webhookDeliveryTriggerNulls = { delivery_id: true } as const;
|
|
134
|
+
|
|
135
|
+
/** The members of `WebhookDeliveryWithAttempts` that read null where a value leaves them out. */
|
|
136
|
+
export const webhookDeliveryWithAttemptsNulls = { next_attempt_at: true } as const;
|
|
137
|
+
|
|
138
|
+
/** The members of `WebhookEndpoint` that read null where a value leaves them out. */
|
|
139
|
+
export const webhookEndpointNulls = { created_by: true, description: true, disabled_at: true, disabled_reason: true, failing_since: true } as const;
|
|
140
|
+
|
|
141
|
+
/** The members of `WebhookEndpointEventObject` that read null where a value leaves them out. */
|
|
142
|
+
export const webhookEndpointEventObjectNulls = { failing_since: true } as const;
|
|
143
|
+
|
|
144
|
+
/** The members of `WebhookEndpointWithSecret` that read null where a value leaves them out. */
|
|
145
|
+
export const webhookEndpointWithSecretNulls = { created_by: true, description: true, disabled_at: true, disabled_reason: true, failing_since: true } as const;
|
|
146
|
+
|
|
147
|
+
/** The members of `ZoneEventObject` that read null where a value leaves them out. */
|
|
148
|
+
export const zoneEventObjectNulls = { description: true, end_at: true, start_at: true } as const;
|
|
149
|
+
|
|
150
|
+
/** The members of `WebhookEventObject` that read null where a value leaves them out. */
|
|
151
|
+
export const webhookEventObjectNulls = ["object", { collection: collectionEventObjectNulls, itinerary: itineraryEventObjectNulls, "itinerary.waypoint": itineraryWaypointEventObjectNulls, "organization.webhook_endpoint": webhookEndpointEventObjectNulls, zone: zoneEventObjectNulls }] as const;
|
|
152
|
+
|
|
153
|
+
/** The members of `WebhookEventData` that read null where a value leaves them out. */
|
|
154
|
+
export const webhookEventDataNulls = { object: webhookEventObjectNulls } as const;
|
|
155
|
+
|
|
156
|
+
/** The members of `WebhookEvent` that read null where a value leaves them out. */
|
|
157
|
+
export const webhookEventNulls = { data: webhookEventDataNulls, request: true } as const;
|
|
158
|
+
|
|
159
|
+
/** The members of `WebhookEventWithDeliveries` that read null where a value leaves them out. */
|
|
160
|
+
export const webhookEventWithDeliveriesNulls = { data: webhookEventDataNulls, deliveries: [webhookDeliveryNulls], request: true } as const;
|
|
161
|
+
|
|
162
|
+
/** The members of `WebhookHealthDestination` that read null where a value leaves them out. */
|
|
163
|
+
export const webhookHealthDestinationNulls = { eventual_success_rate: true, first_attempt_success_rate: true, last_success_at: true } as const;
|
|
164
|
+
|
|
165
|
+
/** The members of `WebhookHealthFigures` that read null where a value leaves them out. */
|
|
166
|
+
export const webhookHealthFiguresNulls = { availability: true, dispatch_delay_p50_ms: true, dispatch_delay_p95_ms: true, dispatched_within_60s: true, eventual_success_rate: true, first_attempt_success_rate: true, response_time_p50_ms: true, response_time_p95_ms: true } as const;
|
|
167
|
+
|
|
168
|
+
/** The members of `WebhookHealthPoint` that read null where a value leaves them out. */
|
|
169
|
+
export const webhookHealthPointNulls = { availability: true, dispatch_delay_p50_ms: true, dispatch_delay_p95_ms: true, dispatched_within_60s: true, eventual_success_rate: true, first_attempt_success_rate: true, response_time_p50_ms: true, response_time_p95_ms: true } as const;
|
|
170
|
+
|
|
171
|
+
/** The members of `WebhookHealth` that read null where a value leaves them out. */
|
|
172
|
+
export const webhookHealthNulls = { destinations: [webhookHealthDestinationNulls], series: [webhookHealthPointNulls], totals: webhookHealthFiguresNulls } as const;
|
|
173
|
+
|
|
174
|
+
/** The members of `Zone` that read null where a value leaves them out. */
|
|
175
|
+
export const zoneNulls = { description: true, end_at: true, organization_id: true, published_at: true, source: true, start_at: true } as const;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* restSchemaNulls names, by the schema's name, the members a value of each schema reads null
|
|
179
|
+
* where it leaves them out, as a {@link NullableMask}. A schema whose values hold none is left
|
|
180
|
+
* out.
|
|
181
|
+
*/
|
|
182
|
+
export const restSchemaNulls: { readonly [schema: string]: NullableMask } = {
|
|
183
|
+
Activity: activityNulls,
|
|
184
|
+
AiProviderConfig: aiProviderConfigNulls,
|
|
185
|
+
BillingPricing: billingPricingNulls,
|
|
186
|
+
BillingProduct: billingProductNulls,
|
|
187
|
+
CategoryActivities: categoryActivitiesNulls,
|
|
188
|
+
CategoryOverlays: categoryOverlaysNulls,
|
|
189
|
+
CollabCursorEvent: collabCursorEventNulls,
|
|
190
|
+
CollabCursorSignal: collabCursorSignalNulls,
|
|
191
|
+
CollabSelectionEvent: collabSelectionEventNulls,
|
|
192
|
+
CollabSelectionSignal: collabSelectionSignalNulls,
|
|
193
|
+
CollabSignalParams: collabSignalParamsNulls,
|
|
194
|
+
CollabStreamEvent: collabStreamEventNulls,
|
|
195
|
+
Collection: collectionNulls,
|
|
196
|
+
CollectionEventObject: collectionEventObjectNulls,
|
|
197
|
+
Itinerary: itineraryNulls,
|
|
198
|
+
ItineraryDirectionsStep: itineraryDirectionsStepNulls,
|
|
199
|
+
ItineraryEventObject: itineraryEventObjectNulls,
|
|
200
|
+
ItineraryImportPreview: itineraryImportPreviewNulls,
|
|
201
|
+
ItinerarySegment: itinerarySegmentNulls,
|
|
202
|
+
ItinerarySegmentGroup: itinerarySegmentGroupNulls,
|
|
203
|
+
ItineraryWaypoint: itineraryWaypointNulls,
|
|
204
|
+
ItineraryWaypointEventObject: itineraryWaypointEventObjectNulls,
|
|
205
|
+
ItineraryWithDetails: itineraryWithDetailsNulls,
|
|
206
|
+
Layers: layersNulls,
|
|
207
|
+
ListMetadata: listMetadataNulls,
|
|
208
|
+
Locales: localesNulls,
|
|
209
|
+
NotificationPreference: notificationPreferenceNulls,
|
|
210
|
+
NotificationPreferences: notificationPreferencesNulls,
|
|
211
|
+
OrganizationSubscription: organizationSubscriptionNulls,
|
|
212
|
+
OrganizationSubscriptionSummary: organizationSubscriptionSummaryNulls,
|
|
213
|
+
Overlay: overlayNulls,
|
|
214
|
+
PaginationMetadata: paginationMetadataNulls,
|
|
215
|
+
ProposedSegment: proposedSegmentNulls,
|
|
216
|
+
Session: sessionNulls,
|
|
217
|
+
SubscriptionDiscount: subscriptionDiscountNulls,
|
|
218
|
+
Terrain: terrainNulls,
|
|
219
|
+
TileLayer: tileLayerNulls,
|
|
220
|
+
TileLegend: tileLegendNulls,
|
|
221
|
+
TileSource: tileSourceNulls,
|
|
222
|
+
WebhookDelivery: webhookDeliveryNulls,
|
|
223
|
+
WebhookDeliveryTrigger: webhookDeliveryTriggerNulls,
|
|
224
|
+
WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsNulls,
|
|
225
|
+
WebhookEndpoint: webhookEndpointNulls,
|
|
226
|
+
WebhookEndpointEventObject: webhookEndpointEventObjectNulls,
|
|
227
|
+
WebhookEndpointWithSecret: webhookEndpointWithSecretNulls,
|
|
228
|
+
WebhookEvent: webhookEventNulls,
|
|
229
|
+
WebhookEventData: webhookEventDataNulls,
|
|
230
|
+
WebhookEventObject: webhookEventObjectNulls,
|
|
231
|
+
WebhookEventWithDeliveries: webhookEventWithDeliveriesNulls,
|
|
232
|
+
WebhookHealth: webhookHealthNulls,
|
|
233
|
+
WebhookHealthDestination: webhookHealthDestinationNulls,
|
|
234
|
+
WebhookHealthFigures: webhookHealthFiguresNulls,
|
|
235
|
+
WebhookHealthPoint: webhookHealthPointNulls,
|
|
236
|
+
Zone: zoneNulls,
|
|
237
|
+
ZoneEventObject: zoneEventObjectNulls,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* responseNulls names, by operation id, the members the answer each operation succeeds with
|
|
242
|
+
* reads null where it leaves them out, as a {@link NullableMask}. An operation whose answer holds
|
|
243
|
+
* none is left out.
|
|
244
|
+
*/
|
|
245
|
+
export const responseNulls: { readonly [operationId: string]: NullableMask } = {
|
|
246
|
+
/** DELETE /v1/collections/{collection_id} */
|
|
247
|
+
deleteCollection: { data: true },
|
|
248
|
+
/** DELETE /v1/collections/{collection_id}/itineraries/{itinerary_id} */
|
|
249
|
+
deleteCollectionItinerary: { data: collectionNulls },
|
|
250
|
+
/** DELETE /v1/collections/{collection_id}/share-link */
|
|
251
|
+
deleteCollectionShareLink: { data: true },
|
|
252
|
+
/** DELETE /v1/collections/{collection_id}/zones/{zone_id} */
|
|
253
|
+
deleteCollectionZone: { data: collectionNulls },
|
|
254
|
+
/** DELETE /v1/itineraries/{itinerary_id} */
|
|
255
|
+
deleteItinerary: { data: true },
|
|
256
|
+
/** DELETE /v1/itineraries/{itinerary_id}/publication */
|
|
257
|
+
deleteItineraryPublication: { data: itineraryWithDetailsNulls },
|
|
258
|
+
/** DELETE /v1/itineraries/{itinerary_id}/segments/{segment_id} */
|
|
259
|
+
deleteItinerarySegment: { data: itineraryWithDetailsNulls },
|
|
260
|
+
/** DELETE /v1/itineraries/{itinerary_id}/segment-groups/{group_id} */
|
|
261
|
+
deleteItinerarySegmentGroup: { data: itineraryWithDetailsNulls },
|
|
262
|
+
/** DELETE /v1/itineraries/{itinerary_id}/share-link */
|
|
263
|
+
deleteItineraryShareLink: { data: true },
|
|
264
|
+
/** DELETE /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id} */
|
|
265
|
+
deleteItineraryWaypoint: { data: itineraryWithDetailsNulls },
|
|
266
|
+
/** DELETE /v1/me/invitations/{invitation_id} */
|
|
267
|
+
deleteMyInvitation: { data: true },
|
|
268
|
+
/** DELETE /v1/organizations/{organization_id}/ai-provider-config */
|
|
269
|
+
deleteOrganizationAiProviderConfig: { data: true },
|
|
270
|
+
/** DELETE /v1/organizations/{organization_id}/billing/payment-methods/{payment_method_id} */
|
|
271
|
+
deleteOrganizationBillingPaymentMethod: { data: true },
|
|
272
|
+
/** DELETE /v1/organizations/{organization_id}/billing/subscription */
|
|
273
|
+
deleteOrganizationBillingSubscription: { data: [true, organizationSubscriptionSummaryNulls] },
|
|
274
|
+
/** DELETE /v1/organizations/{organization_id}/invitations/{invitation_id} */
|
|
275
|
+
deleteOrganizationInvitation: { data: true },
|
|
276
|
+
/** DELETE /v1/organizations/{organization_id}/members/{user_id} */
|
|
277
|
+
deleteOrganizationMember: { data: true },
|
|
278
|
+
/** DELETE /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id} */
|
|
279
|
+
deleteOrganizationWebhookEndpoint: { data: true },
|
|
280
|
+
/** DELETE /v1/zones/{zone_id} */
|
|
281
|
+
deleteZone: { data: true },
|
|
282
|
+
/** DELETE /v1/zones/{zone_id}/publication */
|
|
283
|
+
deleteZonePublication: { data: zoneNulls },
|
|
284
|
+
/** GET /v1/activities */
|
|
285
|
+
getActivities: { data: [categoryActivitiesNulls] },
|
|
286
|
+
/** GET /v1/billing/products */
|
|
287
|
+
getBillingProducts: { data: [billingProductNulls] },
|
|
288
|
+
/** GET /v1/collections/{collection_id} */
|
|
289
|
+
getCollection: { data: collectionNulls },
|
|
290
|
+
/** GET /v1/collections/{collection_id}/itineraries */
|
|
291
|
+
getCollectionItineraries: { data: [itineraryNulls], extensions: { metadata: listMetadataNulls } },
|
|
292
|
+
/** GET /v1/collections/{collection_id}/share-link */
|
|
293
|
+
getCollectionShareLink: { data: true },
|
|
294
|
+
/** GET /v1/collections/{collection_id}/zones */
|
|
295
|
+
getCollectionZones: { data: [zoneNulls], extensions: { metadata: listMetadataNulls } },
|
|
296
|
+
/** GET /v1/collections */
|
|
297
|
+
getCollections: { data: [collectionNulls], extensions: { metadata: listMetadataNulls } },
|
|
298
|
+
/** GET /v1/itineraries */
|
|
299
|
+
getItineraries: { data: [itineraryNulls], extensions: { metadata: listMetadataNulls } },
|
|
300
|
+
/** GET /v1/itineraries/{itinerary_id} */
|
|
301
|
+
getItinerary: { data: itineraryWithDetailsNulls },
|
|
302
|
+
/** GET /v1/itineraries/{itinerary_id}/share-link */
|
|
303
|
+
getItineraryShareLink: { data: true },
|
|
304
|
+
/** GET /v1/layers */
|
|
305
|
+
getLayers: { data: layersNulls },
|
|
306
|
+
/** GET /v1/me/invitations */
|
|
307
|
+
getMyInvitations: { extensions: { metadata: listMetadataNulls } },
|
|
308
|
+
/** GET /v1/me/organizations/{organization_id}/notification-preferences */
|
|
309
|
+
getMyOrganizationNotificationPreferences: { data: notificationPreferencesNulls },
|
|
310
|
+
/** GET /v1/me/organizations */
|
|
311
|
+
getMyOrganizations: { extensions: { metadata: listMetadataNulls } },
|
|
312
|
+
/** GET /v1/organizations/{organization_id}/ai-provider-config */
|
|
313
|
+
getOrganizationAiProviderConfig: { data: [true, aiProviderConfigNulls] },
|
|
314
|
+
/** GET /v1/organizations/{organization_id}/billing/info */
|
|
315
|
+
getOrganizationBillingInfo: { data: true },
|
|
316
|
+
/** GET /v1/organizations/{organization_id}/billing/invoices */
|
|
317
|
+
getOrganizationBillingInvoices: { extensions: { metadata: listMetadataNulls } },
|
|
318
|
+
/** GET /v1/organizations/{organization_id}/billing/payment-methods */
|
|
319
|
+
getOrganizationBillingPaymentMethods: { extensions: { metadata: listMetadataNulls } },
|
|
320
|
+
/** GET /v1/organizations/{organization_id}/billing/subscription */
|
|
321
|
+
getOrganizationBillingSubscription: { data: [true, organizationSubscriptionSummaryNulls] },
|
|
322
|
+
/** GET /v1/organizations/{organization_id}/invitations */
|
|
323
|
+
getOrganizationInvitations: { extensions: { metadata: listMetadataNulls } },
|
|
324
|
+
/** GET /v1/organizations/{organization_id}/members */
|
|
325
|
+
getOrganizationMembers: { extensions: { metadata: listMetadataNulls } },
|
|
326
|
+
/** GET /v1/organizations/{organization_id}/publishable-keys */
|
|
327
|
+
getOrganizationPublishableKeys: { extensions: { metadata: listMetadataNulls } },
|
|
328
|
+
/** GET /v1/organizations/{organization_id}/webhook-deliveries */
|
|
329
|
+
getOrganizationWebhookDeliveries: { data: [webhookDeliveryNulls], extensions: { metadata: listMetadataNulls } },
|
|
330
|
+
/** GET /v1/organizations/{organization_id}/webhook-deliveries/{delivery_id} */
|
|
331
|
+
getOrganizationWebhookDelivery: { data: webhookDeliveryWithAttemptsNulls },
|
|
332
|
+
/** GET /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id} */
|
|
333
|
+
getOrganizationWebhookEndpoint: { data: webhookEndpointNulls },
|
|
334
|
+
/** GET /v1/organizations/{organization_id}/webhook-endpoints */
|
|
335
|
+
getOrganizationWebhookEndpoints: { data: [webhookEndpointNulls], extensions: { metadata: listMetadataNulls } },
|
|
336
|
+
/** GET /v1/organizations/{organization_id}/webhook-events/{event_id} */
|
|
337
|
+
getOrganizationWebhookEvent: { data: webhookEventWithDeliveriesNulls },
|
|
338
|
+
/** GET /v1/organizations/{organization_id}/webhook-events */
|
|
339
|
+
getOrganizationWebhookEvents: { data: [webhookEventNulls], extensions: { metadata: listMetadataNulls } },
|
|
340
|
+
/** GET /v1/organizations/{organization_id}/webhook-health */
|
|
341
|
+
getOrganizationWebhookHealth: { data: webhookHealthNulls },
|
|
342
|
+
/** GET /v1/zones/{zone_id} */
|
|
343
|
+
getZone: { data: zoneNulls },
|
|
344
|
+
/** GET /v1/zones */
|
|
345
|
+
getZones: { data: [zoneNulls], extensions: { metadata: listMetadataNulls } },
|
|
346
|
+
/** PATCH /v1/collections/{collection_id} */
|
|
347
|
+
patchCollection: { data: collectionNulls },
|
|
348
|
+
/** PATCH /v1/collections/{collection_id}/itineraries/{itinerary_id} */
|
|
349
|
+
patchCollectionItinerary: { data: collectionNulls },
|
|
350
|
+
/** PATCH /v1/itineraries/{itinerary_id} */
|
|
351
|
+
patchItinerary: { data: itineraryWithDetailsNulls },
|
|
352
|
+
/** PATCH /v1/itineraries/{itinerary_id}/segments/{segment_id} */
|
|
353
|
+
patchItinerarySegment: { data: itineraryWithDetailsNulls },
|
|
354
|
+
/** PATCH /v1/itineraries/{itinerary_id}/segment-groups/{group_id} */
|
|
355
|
+
patchItinerarySegmentGroup: { data: itineraryWithDetailsNulls },
|
|
356
|
+
/** PATCH /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id} */
|
|
357
|
+
patchItineraryWaypoint: { data: itineraryWithDetailsNulls },
|
|
358
|
+
/** PATCH /v1/me/organizations/{organization_id}/notification-preferences */
|
|
359
|
+
patchMyOrganizationNotificationPreferences: { data: notificationPreferencesNulls },
|
|
360
|
+
/** PATCH /v1/organizations/{organization_id}/ai-provider-config */
|
|
361
|
+
patchOrganizationAiProviderConfig: { data: aiProviderConfigNulls },
|
|
362
|
+
/** PATCH /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id} */
|
|
363
|
+
patchOrganizationWebhookEndpoint: { data: webhookEndpointNulls },
|
|
364
|
+
/** PATCH /v1/zones/{zone_id} */
|
|
365
|
+
patchZone: { data: zoneNulls },
|
|
366
|
+
/** POST /v1/agent/runs/{run_id}/feedback */
|
|
367
|
+
postAgentRunFeedback: { data: true },
|
|
368
|
+
/** POST /v1/agent/runs/{run_id}/input */
|
|
369
|
+
postAgentRunInput: { data: true },
|
|
370
|
+
/** POST /v1/collections */
|
|
371
|
+
postCollection: { data: collectionNulls },
|
|
372
|
+
/** POST /v1/collections/{collection_id}/itineraries */
|
|
373
|
+
postCollectionItineraries: { data: collectionNulls },
|
|
374
|
+
/** POST /v1/collections/{collection_id}/zones */
|
|
375
|
+
postCollectionZones: { data: collectionNulls },
|
|
376
|
+
/** POST /v1/itineraries */
|
|
377
|
+
postItinerary: { data: itineraryWithDetailsNulls },
|
|
378
|
+
/** POST /v1/itineraries/{itinerary_id}/collab */
|
|
379
|
+
postItineraryCollab: { data: true },
|
|
380
|
+
/** POST /v1/itineraries/{itinerary_id}/duplicate */
|
|
381
|
+
postItineraryDuplicate: { data: itineraryWithDetailsNulls },
|
|
382
|
+
/** POST /v1/itineraries/import */
|
|
383
|
+
postItineraryImport: { data: itineraryWithDetailsNulls },
|
|
384
|
+
/** POST /v1/itineraries/preview */
|
|
385
|
+
postItineraryPreview: { data: itineraryImportPreviewNulls },
|
|
386
|
+
/** POST /v1/itineraries/{itinerary_id}/publication */
|
|
387
|
+
postItineraryPublication: { data: itineraryWithDetailsNulls },
|
|
388
|
+
/** POST /v1/itineraries/{itinerary_id}/segments */
|
|
389
|
+
postItinerarySegment: { data: itineraryWithDetailsNulls },
|
|
390
|
+
/** POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/convert */
|
|
391
|
+
postItinerarySegmentConvert: { data: itineraryWithDetailsNulls },
|
|
392
|
+
/** POST /v1/itineraries/{itinerary_id}/segment-groups */
|
|
393
|
+
postItinerarySegmentGroup: { data: itineraryWithDetailsNulls },
|
|
394
|
+
/** POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/merge */
|
|
395
|
+
postItinerarySegmentMerge: { data: itineraryWithDetailsNulls },
|
|
396
|
+
/** POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/split */
|
|
397
|
+
postItinerarySegmentSplit: { data: itineraryWithDetailsNulls },
|
|
398
|
+
/** POST /v1/itineraries/{itinerary_id}/waypoints */
|
|
399
|
+
postItineraryWaypoint: { data: itineraryWithDetailsNulls },
|
|
400
|
+
/** POST /v1/organizations/{organization_id}/ai-provider-config */
|
|
401
|
+
postOrganizationAiProviderConfig: { data: aiProviderConfigNulls },
|
|
402
|
+
/** POST /v1/organizations/{organization_id}/billing/subscription */
|
|
403
|
+
postOrganizationBillingSubscription: { data: organizationSubscriptionSummaryNulls },
|
|
404
|
+
/** POST /v1/organizations/{organization_id}/webhook-deliveries */
|
|
405
|
+
postOrganizationWebhookDelivery: { data: webhookDeliveryTriggerNulls },
|
|
406
|
+
/** POST /v1/organizations/{organization_id}/webhook-endpoints */
|
|
407
|
+
postOrganizationWebhookEndpoint: { data: webhookEndpointWithSecretNulls },
|
|
408
|
+
/** POST /v1/sessions */
|
|
409
|
+
postSession: { data: sessionNulls },
|
|
410
|
+
/** POST /v1/zones */
|
|
411
|
+
postZone: { data: zoneNulls },
|
|
412
|
+
/** POST /v1/zones/{zone_id}/collab */
|
|
413
|
+
postZoneCollab: { data: true },
|
|
414
|
+
/** POST /v1/zones/{zone_id}/publication */
|
|
415
|
+
postZonePublication: { data: zoneNulls },
|
|
416
|
+
};
|