@spoketech/hub-client 0.1.14 → 0.1.16
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 +47 -1
- package/dist/index.d.ts +9799 -1646
- package/dist/index.js +493 -12
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var memberPreferredContactMethods = ["sms", "email"];
|
|
|
23
23
|
var memberCreatedOrigins = [
|
|
24
24
|
"hub_admin",
|
|
25
25
|
"service_api",
|
|
26
|
+
"seed",
|
|
26
27
|
"source_sync",
|
|
27
28
|
"source_create"
|
|
28
29
|
];
|
|
@@ -39,6 +40,7 @@ var organizationMemberSourceManualTransports = ["csv_bucket"];
|
|
|
39
40
|
var organizationMemberSourceLiveTransports = ["fbi"];
|
|
40
41
|
var organizationMemberSourceStatuses = ["active", "paused", "disabled"];
|
|
41
42
|
var organizationMemberSourceAgentStatuses = ["active", "paused", "disabled"];
|
|
43
|
+
var organizationMemberSourceAgentCapabilities = ["ensure_active_membership"];
|
|
42
44
|
var organizationMemberSourceWebhookStatuses = ["active", "disabled"];
|
|
43
45
|
var organizationMemberSourceWebhookDeliveryStatuses = ["success", "failure"];
|
|
44
46
|
var organizationProductWebhookStatuses = ["active", "disabled"];
|
|
@@ -90,12 +92,23 @@ var organizationMemberSyncTransports = [
|
|
|
90
92
|
];
|
|
91
93
|
var organizationMemberSourceCommandKinds = [
|
|
92
94
|
"create_member",
|
|
95
|
+
"ensure_active_membership",
|
|
93
96
|
"update_member",
|
|
94
97
|
"update_preferences",
|
|
95
98
|
"renew_member",
|
|
96
99
|
"lookup_member",
|
|
97
100
|
"list_custom_fields"
|
|
98
101
|
];
|
|
102
|
+
var ensureActiveMembershipOutcomes = [
|
|
103
|
+
"created",
|
|
104
|
+
"matched_active",
|
|
105
|
+
"renewed_existing",
|
|
106
|
+
"ambiguous_identity_match",
|
|
107
|
+
"unsupported_source_status",
|
|
108
|
+
"indeterminate_membership_expiry",
|
|
109
|
+
"manual_review_required",
|
|
110
|
+
"failed"
|
|
111
|
+
];
|
|
99
112
|
var organizationMemberSourceCommandStatuses = [
|
|
100
113
|
"requested",
|
|
101
114
|
"accepted",
|
|
@@ -125,6 +138,7 @@ var ForbiddenErrorSchema = makeErrorSchema("forbidden", 403);
|
|
|
125
138
|
var NotFoundErrorSchema = makeErrorSchema("not_found", 404);
|
|
126
139
|
var ConflictErrorSchema = makeErrorSchema("conflict", 409);
|
|
127
140
|
var BadRequestErrorSchema = makeErrorSchema("bad_request", 400);
|
|
141
|
+
var InternalServerErrorSchema = makeErrorSchema("internal_error", 500);
|
|
128
142
|
function makeUnauthorized(message = "Authentication required") {
|
|
129
143
|
return { code: "unauthorized", message };
|
|
130
144
|
}
|
|
@@ -140,6 +154,9 @@ function makeConflict(message) {
|
|
|
140
154
|
function makeBadRequest(message) {
|
|
141
155
|
return { code: "bad_request", message };
|
|
142
156
|
}
|
|
157
|
+
function makeInternalServerError() {
|
|
158
|
+
return { code: "internal_error", message: "Internal server error" };
|
|
159
|
+
}
|
|
143
160
|
|
|
144
161
|
// ../contracts/src/contracts.ts
|
|
145
162
|
var NullableString = Schema2.Union(Schema2.String, Schema2.Null);
|
|
@@ -521,6 +538,17 @@ var UpsertMemberPointBalanceSchema = Schema2.Struct({
|
|
|
521
538
|
example: 1200
|
|
522
539
|
})
|
|
523
540
|
});
|
|
541
|
+
var SourceMembershipObservationFields = {
|
|
542
|
+
sourceStatus: NullableString.annotations({
|
|
543
|
+
description: "Latest normalized lifecycle status confirmed by the Member Source."
|
|
544
|
+
}),
|
|
545
|
+
sourceStatusObservedAt: Schema2.Union(TimestampSchema, Schema2.Null).annotations({
|
|
546
|
+
description: "Time Spoke Hub last observed a non-empty Source Membership Status."
|
|
547
|
+
}),
|
|
548
|
+
renewalRequired: Schema2.Union(Schema2.Boolean, Schema2.Null).annotations({
|
|
549
|
+
description: "Whether a confirmed Active source membership is past its paid-until instant. Null when the source membership or expiry is indeterminate."
|
|
550
|
+
})
|
|
551
|
+
};
|
|
524
552
|
var MemberSchema = Schema2.Struct({
|
|
525
553
|
id: Schema2.String,
|
|
526
554
|
organizationId: Schema2.String,
|
|
@@ -532,9 +560,13 @@ var MemberSchema = Schema2.Struct({
|
|
|
532
560
|
recordMode: Schema2.Literal(...memberRecordModes),
|
|
533
561
|
createdOrigin: Schema2.Literal(...memberCreatedOrigins),
|
|
534
562
|
createdOriginName: NullableString,
|
|
563
|
+
seedBatchId: NullableString.annotations({
|
|
564
|
+
description: "Seed batch identifier when this member was generated by an admin seed operation."
|
|
565
|
+
}),
|
|
535
566
|
archivedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
536
567
|
joinedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
537
568
|
sourceUpdatedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
569
|
+
...SourceMembershipObservationFields,
|
|
538
570
|
email: NullableString,
|
|
539
571
|
title: NullableString,
|
|
540
572
|
firstName: Schema2.String,
|
|
@@ -589,6 +621,7 @@ var MemberMedSchema = Schema2.Struct({
|
|
|
589
621
|
organizationId: Schema2.String,
|
|
590
622
|
status: Schema2.Literal(...memberComputedStatuses),
|
|
591
623
|
isSuspended: Schema2.Boolean,
|
|
624
|
+
...SourceMembershipObservationFields,
|
|
592
625
|
displayName: Schema2.String,
|
|
593
626
|
dob: Schema2.Union(DateOnlySchema, Schema2.Null),
|
|
594
627
|
email: NullableString,
|
|
@@ -614,6 +647,7 @@ var MemberBasicSchema = Schema2.Struct({
|
|
|
614
647
|
id: Schema2.String,
|
|
615
648
|
displayName: Schema2.String,
|
|
616
649
|
dob: Schema2.Union(DateOnlySchema, Schema2.Null),
|
|
650
|
+
...SourceMembershipObservationFields,
|
|
617
651
|
statusCredits: Schema2.Number,
|
|
618
652
|
memberNumber: NullableString
|
|
619
653
|
});
|
|
@@ -626,9 +660,11 @@ var MemberFullResponseSchema = Schema2.Struct({
|
|
|
626
660
|
recordMode: Schema2.Literal(...memberRecordModes),
|
|
627
661
|
createdOrigin: Schema2.Literal(...memberCreatedOrigins),
|
|
628
662
|
createdOriginName: NullableString,
|
|
663
|
+
seedBatchId: NullableString,
|
|
629
664
|
archivedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
630
665
|
joinedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
631
666
|
sourceUpdatedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
667
|
+
...SourceMembershipObservationFields,
|
|
632
668
|
email: NullableString,
|
|
633
669
|
title: NullableString,
|
|
634
670
|
firstName: Schema2.String,
|
|
@@ -670,6 +706,7 @@ var MemberMedResponseSchema = Schema2.Struct({
|
|
|
670
706
|
organizationId: Schema2.String,
|
|
671
707
|
status: Schema2.Literal(...memberComputedStatuses),
|
|
672
708
|
isSuspended: Schema2.Boolean,
|
|
709
|
+
...SourceMembershipObservationFields,
|
|
673
710
|
displayName: Schema2.String,
|
|
674
711
|
dob: Schema2.Union(DateOnlySchema, Schema2.Null),
|
|
675
712
|
email: NullableString,
|
|
@@ -696,6 +733,7 @@ var MemberBasicResponseSchema = Schema2.Struct({
|
|
|
696
733
|
id: Schema2.String,
|
|
697
734
|
displayName: Schema2.String,
|
|
698
735
|
dob: Schema2.Union(DateOnlySchema, Schema2.Null),
|
|
736
|
+
...SourceMembershipObservationFields,
|
|
699
737
|
statusCredits: Schema2.Number,
|
|
700
738
|
memberNumber: NullableString,
|
|
701
739
|
responseMode: Schema2.Literal("basic")
|
|
@@ -779,7 +817,7 @@ var OrganizationMembersListUrlParamsSchema = Schema2.Struct({
|
|
|
779
817
|
),
|
|
780
818
|
searchValue: Schema2.optional(
|
|
781
819
|
Schema2.String.annotations({
|
|
782
|
-
description: "
|
|
820
|
+
description: "Partial match used with searchField to filter members. Display-name searches match every whitespace-separated term in any order."
|
|
783
821
|
})
|
|
784
822
|
),
|
|
785
823
|
name: Schema2.optional(
|
|
@@ -1066,6 +1104,9 @@ var organizationMembersListExamples = {
|
|
|
1066
1104
|
createdOriginName: "Odyssey Gaming",
|
|
1067
1105
|
archivedAt: null,
|
|
1068
1106
|
sourceUpdatedAt: "2026-04-02T01:23:45.000Z",
|
|
1107
|
+
sourceStatus: "ACTIVE",
|
|
1108
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1109
|
+
renewalRequired: null,
|
|
1069
1110
|
email: "jane@example.com",
|
|
1070
1111
|
title: "Ms",
|
|
1071
1112
|
firstName: "Jane",
|
|
@@ -1136,6 +1177,9 @@ var organizationMembersListExamples = {
|
|
|
1136
1177
|
organizationId: "org_1",
|
|
1137
1178
|
status: "active",
|
|
1138
1179
|
isSuspended: false,
|
|
1180
|
+
sourceStatus: "ACTIVE",
|
|
1181
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1182
|
+
renewalRequired: null,
|
|
1139
1183
|
displayName: "Jane Smith",
|
|
1140
1184
|
dob: "1988-06-14",
|
|
1141
1185
|
email: "jane@example.com",
|
|
@@ -1180,6 +1224,9 @@ var organizationMembersListExamples = {
|
|
|
1180
1224
|
id: "mem_123",
|
|
1181
1225
|
displayName: "Jane Smith",
|
|
1182
1226
|
dob: "1988-06-14",
|
|
1227
|
+
sourceStatus: "ACTIVE",
|
|
1228
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1229
|
+
renewalRequired: null,
|
|
1183
1230
|
memberNumber: "12345"
|
|
1184
1231
|
}
|
|
1185
1232
|
],
|
|
@@ -1232,6 +1279,9 @@ var memberExamples = {
|
|
|
1232
1279
|
createdOriginName: "Odyssey Gaming",
|
|
1233
1280
|
archivedAt: null,
|
|
1234
1281
|
sourceUpdatedAt: "2026-04-02T01:23:45.000Z",
|
|
1282
|
+
sourceStatus: "ACTIVE",
|
|
1283
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1284
|
+
renewalRequired: null,
|
|
1235
1285
|
email: "jane@example.com",
|
|
1236
1286
|
title: "Ms",
|
|
1237
1287
|
firstName: "Jane",
|
|
@@ -1290,6 +1340,9 @@ var memberExamples = {
|
|
|
1290
1340
|
organizationId: "org_1",
|
|
1291
1341
|
status: "active",
|
|
1292
1342
|
isSuspended: false,
|
|
1343
|
+
sourceStatus: "ACTIVE",
|
|
1344
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1345
|
+
renewalRequired: null,
|
|
1293
1346
|
displayName: "Jane Smith",
|
|
1294
1347
|
dob: "1988-06-14",
|
|
1295
1348
|
email: "jane@example.com",
|
|
@@ -1322,6 +1375,9 @@ var memberExamples = {
|
|
|
1322
1375
|
id: "mem_123",
|
|
1323
1376
|
displayName: "Jane Smith",
|
|
1324
1377
|
dob: "1988-06-14",
|
|
1378
|
+
sourceStatus: "ACTIVE",
|
|
1379
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1380
|
+
renewalRequired: null,
|
|
1325
1381
|
memberNumber: "12345",
|
|
1326
1382
|
responseMode: "basic"
|
|
1327
1383
|
}
|
|
@@ -1349,6 +1405,9 @@ var bulkMemberExamples = {
|
|
|
1349
1405
|
organizationId: "org_1",
|
|
1350
1406
|
status: "active",
|
|
1351
1407
|
isSuspended: false,
|
|
1408
|
+
sourceStatus: "ACTIVE",
|
|
1409
|
+
sourceStatusObservedAt: "2026-04-02T01:25:00.000Z",
|
|
1410
|
+
renewalRequired: null,
|
|
1352
1411
|
displayName: "Jane Smith",
|
|
1353
1412
|
dob: "1988-06-14",
|
|
1354
1413
|
email: "jane@example.com",
|
|
@@ -1378,6 +1437,9 @@ var bulkMemberExamples = {
|
|
|
1378
1437
|
organizationId: "org_1",
|
|
1379
1438
|
status: "expired",
|
|
1380
1439
|
isSuspended: false,
|
|
1440
|
+
sourceStatus: null,
|
|
1441
|
+
sourceStatusObservedAt: null,
|
|
1442
|
+
renewalRequired: null,
|
|
1381
1443
|
displayName: "Howard Sorrell",
|
|
1382
1444
|
dob: "1967-05-09",
|
|
1383
1445
|
email: null,
|
|
@@ -1755,6 +1817,9 @@ var createMemberExamplesTransform = withOpenApiExamples({
|
|
|
1755
1817
|
createdOriginName: null,
|
|
1756
1818
|
archivedAt: null,
|
|
1757
1819
|
sourceUpdatedAt: null,
|
|
1820
|
+
sourceStatus: null,
|
|
1821
|
+
sourceStatusObservedAt: null,
|
|
1822
|
+
renewalRequired: null,
|
|
1758
1823
|
email: "jane@example.com",
|
|
1759
1824
|
title: "Ms",
|
|
1760
1825
|
firstName: "Jane",
|
|
@@ -1839,6 +1904,9 @@ var updateMemberExamplesTransform = withOpenApiExamples({
|
|
|
1839
1904
|
createdOriginName: null,
|
|
1840
1905
|
archivedAt: null,
|
|
1841
1906
|
sourceUpdatedAt: null,
|
|
1907
|
+
sourceStatus: null,
|
|
1908
|
+
sourceStatusObservedAt: null,
|
|
1909
|
+
renewalRequired: null,
|
|
1842
1910
|
email: "jane@example.com",
|
|
1843
1911
|
title: "Ms",
|
|
1844
1912
|
firstName: "Jane",
|
|
@@ -1926,6 +1994,109 @@ var sourceManagedCreateExamplesTransform = withOpenApiExamples({
|
|
|
1926
1994
|
},
|
|
1927
1995
|
responseStatus: "202"
|
|
1928
1996
|
});
|
|
1997
|
+
var ensureActiveMembershipExamplesTransform = withOpenApiExamples({
|
|
1998
|
+
requestExamples: {
|
|
1999
|
+
accepted: {
|
|
2000
|
+
summary: "Ensure an Odyssey membership is active",
|
|
2001
|
+
value: {
|
|
2002
|
+
idempotencyKey: "venue-join-123",
|
|
2003
|
+
member: {
|
|
2004
|
+
firstName: "Jane",
|
|
2005
|
+
lastName: "Smith",
|
|
2006
|
+
dob: "1988-06-14",
|
|
2007
|
+
membershipTypeId: "12",
|
|
2008
|
+
mobilePhone: "+61490451502"
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
boundedWait: {
|
|
2013
|
+
summary: "Wait briefly for a terminal business outcome",
|
|
2014
|
+
value: {
|
|
2015
|
+
idempotencyKey: "venue-join-124",
|
|
2016
|
+
waitMs: 1e4,
|
|
2017
|
+
member: {
|
|
2018
|
+
firstName: "Jane",
|
|
2019
|
+
lastName: "Smith",
|
|
2020
|
+
dob: "1988-06-14",
|
|
2021
|
+
membershipTypeId: "12"
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
},
|
|
2026
|
+
responseExamples: {
|
|
2027
|
+
accepted: {
|
|
2028
|
+
summary: "Accepted command",
|
|
2029
|
+
value: {
|
|
2030
|
+
settled: false,
|
|
2031
|
+
timedOut: false,
|
|
2032
|
+
command: {
|
|
2033
|
+
id: "cmd_123",
|
|
2034
|
+
organizationId: "org_1",
|
|
2035
|
+
organizationMemberSourceId: "src_9",
|
|
2036
|
+
organizationMemberSourceAgentId: "agt_1",
|
|
2037
|
+
kind: "ensure_active_membership",
|
|
2038
|
+
status: "accepted",
|
|
2039
|
+
payload: {
|
|
2040
|
+
idempotencyKey: "venue-join-123",
|
|
2041
|
+
member: {
|
|
2042
|
+
firstName: "Jane",
|
|
2043
|
+
lastName: "Smith",
|
|
2044
|
+
dob: "1988-06-14",
|
|
2045
|
+
membershipTypeId: "12"
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
result: null,
|
|
2049
|
+
errorMessage: null,
|
|
2050
|
+
requestedAt: "2026-08-20T01:02:05.123Z",
|
|
2051
|
+
acceptedAt: "2026-08-20T01:02:05.200Z",
|
|
2052
|
+
completedAt: null,
|
|
2053
|
+
createdAt: "2026-08-20T01:02:05.123Z",
|
|
2054
|
+
updatedAt: "2026-08-20T01:02:05.200Z",
|
|
2055
|
+
deletedAt: null
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2059
|
+
completed: {
|
|
2060
|
+
summary: "Completed within the bounded wait",
|
|
2061
|
+
value: {
|
|
2062
|
+
settled: true,
|
|
2063
|
+
timedOut: false,
|
|
2064
|
+
command: {
|
|
2065
|
+
id: "cmd_124",
|
|
2066
|
+
organizationId: "org_1",
|
|
2067
|
+
organizationMemberSourceId: "src_9",
|
|
2068
|
+
organizationMemberSourceAgentId: "agt_1",
|
|
2069
|
+
kind: "ensure_active_membership",
|
|
2070
|
+
status: "completed",
|
|
2071
|
+
payload: {
|
|
2072
|
+
idempotencyKey: "venue-join-124",
|
|
2073
|
+
member: {
|
|
2074
|
+
firstName: "Jane",
|
|
2075
|
+
lastName: "Smith",
|
|
2076
|
+
dob: "1988-06-14",
|
|
2077
|
+
membershipTypeId: "12"
|
|
2078
|
+
}
|
|
2079
|
+
},
|
|
2080
|
+
result: {
|
|
2081
|
+
outcome: "matched_active",
|
|
2082
|
+
memberId: "mem_123",
|
|
2083
|
+
sourceStatus: "ACTIVE",
|
|
2084
|
+
membershipTypeId: "12",
|
|
2085
|
+
membershipExpiry: "2027-08-20T00:00:00.000Z"
|
|
2086
|
+
},
|
|
2087
|
+
errorMessage: null,
|
|
2088
|
+
requestedAt: "2026-08-20T01:02:05.123Z",
|
|
2089
|
+
acceptedAt: "2026-08-20T01:02:05.200Z",
|
|
2090
|
+
completedAt: "2026-08-20T01:02:05.500Z",
|
|
2091
|
+
createdAt: "2026-08-20T01:02:05.123Z",
|
|
2092
|
+
updatedAt: "2026-08-20T01:02:05.500Z",
|
|
2093
|
+
deletedAt: null
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
responseStatus: "202"
|
|
2099
|
+
});
|
|
1929
2100
|
var sourceManagedRenewalExamplesTransform = withOpenApiExamples({
|
|
1930
2101
|
requestExamples: {
|
|
1931
2102
|
default: {
|
|
@@ -2390,6 +2561,10 @@ var OrganizationMemberSourceAgentSchema = Schema2.Struct({
|
|
|
2390
2561
|
lastHeartbeatAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
2391
2562
|
lastVersion: NullableString,
|
|
2392
2563
|
lastError: NullableString,
|
|
2564
|
+
capabilities: Schema2.optionalWith(
|
|
2565
|
+
Schema2.Array(Schema2.Literal(...organizationMemberSourceAgentCapabilities)),
|
|
2566
|
+
{ default: () => [] }
|
|
2567
|
+
),
|
|
2393
2568
|
metadata: JsonObjectSchema,
|
|
2394
2569
|
createdAt: TimestampSchema,
|
|
2395
2570
|
updatedAt: TimestampSchema,
|
|
@@ -2521,6 +2696,35 @@ var OrganizationMemberSourceCommandSchema = Schema2.Struct({
|
|
|
2521
2696
|
updatedAt: TimestampSchema,
|
|
2522
2697
|
deletedAt: Schema2.Union(TimestampSchema, Schema2.Null)
|
|
2523
2698
|
});
|
|
2699
|
+
var EnsureActiveMembershipSuccessOutcomeSchema = Schema2.Literal(
|
|
2700
|
+
"created",
|
|
2701
|
+
"matched_active",
|
|
2702
|
+
"renewed_existing"
|
|
2703
|
+
);
|
|
2704
|
+
var EnsureActiveMembershipNonSuccessOutcomeSchema = Schema2.Literal(
|
|
2705
|
+
"ambiguous_identity_match",
|
|
2706
|
+
"unsupported_source_status",
|
|
2707
|
+
"indeterminate_membership_expiry",
|
|
2708
|
+
"manual_review_required",
|
|
2709
|
+
"failed"
|
|
2710
|
+
);
|
|
2711
|
+
var EnsureActiveMembershipOutcomeSchema = Schema2.Literal(
|
|
2712
|
+
...ensureActiveMembershipOutcomes
|
|
2713
|
+
);
|
|
2714
|
+
var EnsureActiveMembershipSuccessResultSchema = Schema2.Struct({
|
|
2715
|
+
outcome: EnsureActiveMembershipSuccessOutcomeSchema,
|
|
2716
|
+
memberId: Schema2.String,
|
|
2717
|
+
sourceStatus: Schema2.Literal("ACTIVE"),
|
|
2718
|
+
membershipTypeId: Schema2.String,
|
|
2719
|
+
membershipExpiry: TimestampSchema
|
|
2720
|
+
});
|
|
2721
|
+
var EnsureActiveMembershipNonSuccessResultSchema = Schema2.Struct({
|
|
2722
|
+
outcome: EnsureActiveMembershipNonSuccessOutcomeSchema
|
|
2723
|
+
});
|
|
2724
|
+
var EnsureActiveMembershipResultSchema = Schema2.Union(
|
|
2725
|
+
EnsureActiveMembershipSuccessResultSchema,
|
|
2726
|
+
EnsureActiveMembershipNonSuccessResultSchema
|
|
2727
|
+
);
|
|
2524
2728
|
var PaginatedOrganizationMemberSourceCommandsSchema = Schema2.Struct({
|
|
2525
2729
|
items: Schema2.Array(OrganizationMemberSourceCommandSchema),
|
|
2526
2730
|
total: Schema2.Number,
|
|
@@ -2657,6 +2861,15 @@ var CreateOrganizationSchema = Schema2.Struct({
|
|
|
2657
2861
|
description: "Number of days after membership expiry that members are still counted as active.",
|
|
2658
2862
|
example: 7
|
|
2659
2863
|
})
|
|
2864
|
+
),
|
|
2865
|
+
demo: Schema2.optional(
|
|
2866
|
+
Schema2.Struct({
|
|
2867
|
+
apiClient: Schema2.Literal("odyssey_nexus"),
|
|
2868
|
+
randomFailuresEnabled: Schema2.optional(Schema2.Boolean),
|
|
2869
|
+
timeZone: Schema2.optional(Schema2.String),
|
|
2870
|
+
minLatencyMs: Schema2.optional(Schema2.Number),
|
|
2871
|
+
maxLatencyMs: Schema2.optional(Schema2.Number)
|
|
2872
|
+
})
|
|
2660
2873
|
)
|
|
2661
2874
|
});
|
|
2662
2875
|
var UpdateOrganizationSchema = Schema2.Struct({
|
|
@@ -2738,6 +2951,19 @@ var CreateMemberSchema = Schema2.Struct({
|
|
|
2738
2951
|
cardId: OptionalNullableString,
|
|
2739
2952
|
customFields: Schema2.optional(JsonObjectSchema)
|
|
2740
2953
|
});
|
|
2954
|
+
var SeedOrganizationMembersSchema = Schema2.Struct({
|
|
2955
|
+
amount: Schema2.Number.annotations({
|
|
2956
|
+
description: "Number of synthetic members to create. Must be an integer between 1 and 1000.",
|
|
2957
|
+
example: 100
|
|
2958
|
+
})
|
|
2959
|
+
});
|
|
2960
|
+
var MemberSeedBatchSchema = Schema2.Struct({
|
|
2961
|
+
id: Schema2.String,
|
|
2962
|
+
organizationId: Schema2.String,
|
|
2963
|
+
amount: Schema2.Number,
|
|
2964
|
+
memberIds: Schema2.Array(Schema2.String),
|
|
2965
|
+
createdAt: TimestampSchema
|
|
2966
|
+
});
|
|
2741
2967
|
var UpdateMemberSchema = Schema2.Struct({
|
|
2742
2968
|
expectedUpdatedAt: TimestampSchema,
|
|
2743
2969
|
email: OptionalNullableString,
|
|
@@ -2838,6 +3064,14 @@ var UpsertOrganizationMemberSourceSchema = Schema2.Struct({
|
|
|
2838
3064
|
config: JsonObjectSchema,
|
|
2839
3065
|
secrets: Schema2.optional(Schema2.Array(OrganizationMemberSourceSecretInputSchema))
|
|
2840
3066
|
});
|
|
3067
|
+
var ConvertOrganizationToDemoSchema = Schema2.Struct({
|
|
3068
|
+
apiClient: Schema2.Literal("odyssey_nexus"),
|
|
3069
|
+
randomFailuresEnabled: Schema2.optional(Schema2.Boolean),
|
|
3070
|
+
failureRate: Schema2.optional(Schema2.Number),
|
|
3071
|
+
timeZone: Schema2.optional(Schema2.String),
|
|
3072
|
+
minLatencyMs: Schema2.optional(Schema2.Number),
|
|
3073
|
+
maxLatencyMs: Schema2.optional(Schema2.Number)
|
|
3074
|
+
});
|
|
2841
3075
|
var UpsertOrganizationMemberSourceWebhookSchema = Schema2.Struct({
|
|
2842
3076
|
url: Schema2.String.annotations({
|
|
2843
3077
|
description: "Destination URL to notify when source-managed create, update, renewal, or lookup commands reach a terminal state.",
|
|
@@ -2854,7 +3088,57 @@ var TriggerOrganizationMemberSyncSchema = Schema2.Struct({
|
|
|
2854
3088
|
mode: Schema2.optional(Schema2.Literal(...organizationMemberSyncModes)),
|
|
2855
3089
|
inputReference: OptionalNullableString
|
|
2856
3090
|
});
|
|
3091
|
+
var OnsiteResourceCallWaitMsSchema = Schema2.optional(
|
|
3092
|
+
Schema2.Number.annotations({
|
|
3093
|
+
description: "How long Hub should wait for the onsite client to complete the command before returning the accepted command.",
|
|
3094
|
+
example: 1e4
|
|
3095
|
+
})
|
|
3096
|
+
);
|
|
2857
3097
|
var RequestSourceManagedMemberCreateSchema = CreateMemberSchema;
|
|
3098
|
+
var EnsureActiveMembershipMemberSchema = Schema2.Struct({
|
|
3099
|
+
email: OptionalNullableString,
|
|
3100
|
+
title: OptionalNullableString,
|
|
3101
|
+
firstName: Schema2.String,
|
|
3102
|
+
middleName: OptionalNullableString,
|
|
3103
|
+
lastName: Schema2.String,
|
|
3104
|
+
dob: DateOnlySchema,
|
|
3105
|
+
gender: OptionalNullableString,
|
|
3106
|
+
mobilePhone: OptionalNullableMobilePhoneSchema,
|
|
3107
|
+
homePhone: OptionalNullableString,
|
|
3108
|
+
preferredContactMethod: OptionalNullablePreferredContactMethodSchema,
|
|
3109
|
+
occupation: OptionalNullableOccupationSchema,
|
|
3110
|
+
address: Schema2.optional(Schema2.Union(AddressInputSchema, Schema2.Null)),
|
|
3111
|
+
postalAddress: Schema2.optional(Schema2.Union(AddressInputSchema, Schema2.Null)),
|
|
3112
|
+
membershipTypeId: Schema2.String,
|
|
3113
|
+
marketingPreferences: Schema2.optional(MarketingPreferencesInputSchema)
|
|
3114
|
+
});
|
|
3115
|
+
var EnsureActiveMembershipIdempotencyKeySchema = Schema2.String.pipe(
|
|
3116
|
+
Schema2.nonEmptyString(),
|
|
3117
|
+
Schema2.maxLength(64)
|
|
3118
|
+
).annotations({
|
|
3119
|
+
description: "Caller-provided key used to replay this operation safely.",
|
|
3120
|
+
example: "venue-join-123"
|
|
3121
|
+
});
|
|
3122
|
+
var EnsureActiveMembershipCommandPayloadSchema = Schema2.Struct({
|
|
3123
|
+
idempotencyKey: EnsureActiveMembershipIdempotencyKeySchema,
|
|
3124
|
+
member: EnsureActiveMembershipMemberSchema
|
|
3125
|
+
});
|
|
3126
|
+
var RequestEnsureActiveMembershipSchema = Schema2.Struct({
|
|
3127
|
+
idempotencyKey: EnsureActiveMembershipIdempotencyKeySchema,
|
|
3128
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
3129
|
+
member: EnsureActiveMembershipMemberSchema
|
|
3130
|
+
});
|
|
3131
|
+
var EnsureActiveMembershipCommandSchema = Schema2.Struct({
|
|
3132
|
+
...OrganizationMemberSourceCommandSchema.fields,
|
|
3133
|
+
kind: Schema2.Literal("ensure_active_membership"),
|
|
3134
|
+
payload: EnsureActiveMembershipCommandPayloadSchema,
|
|
3135
|
+
result: Schema2.Union(EnsureActiveMembershipResultSchema, Schema2.Null)
|
|
3136
|
+
});
|
|
3137
|
+
var EnsureActiveMembershipResponseSchema = Schema2.Struct({
|
|
3138
|
+
settled: Schema2.Boolean,
|
|
3139
|
+
timedOut: Schema2.Boolean,
|
|
3140
|
+
command: EnsureActiveMembershipCommandSchema
|
|
3141
|
+
});
|
|
2858
3142
|
var RequestSourceManagedMemberUpdateSchema = UpdateMemberSchema;
|
|
2859
3143
|
var RequestSourceManagedMemberPreferenceUpdateSchema = Schema2.Struct({
|
|
2860
3144
|
expectedUpdatedAt: TimestampSchema,
|
|
@@ -2882,16 +3166,17 @@ var SourceManagedMemberRenewalCommandPayloadSchema = Schema2.Struct({
|
|
|
2882
3166
|
var SourceManagedMemberPreferenceUpdateCommandPayloadSchema = Schema2.Struct({
|
|
2883
3167
|
memberId: Schema2.String,
|
|
2884
3168
|
externalSystemMemberId: Schema2.String,
|
|
3169
|
+
sourceSiteId: OptionalNullableString,
|
|
2885
3170
|
expectedUpdatedAt: TimestampSchema,
|
|
2886
3171
|
marketingPreferences: MarketingPreferencesInputSchema
|
|
2887
3172
|
});
|
|
2888
|
-
var OnsiteResourceCallWaitMsSchema = Schema2.optional(
|
|
2889
|
-
Schema2.Number.annotations({
|
|
2890
|
-
description: "How long Hub should wait for the onsite client to complete the command before returning the accepted command.",
|
|
2891
|
-
example: 1e4
|
|
2892
|
-
})
|
|
2893
|
-
);
|
|
2894
3173
|
var OnsiteResourceCallRequestSchema = Schema2.Union(
|
|
3174
|
+
Schema2.Struct({
|
|
3175
|
+
operation: Schema2.Literal("member.ensure_active"),
|
|
3176
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
3177
|
+
idempotencyKey: EnsureActiveMembershipIdempotencyKeySchema,
|
|
3178
|
+
member: EnsureActiveMembershipMemberSchema
|
|
3179
|
+
}),
|
|
2895
3180
|
Schema2.Struct({
|
|
2896
3181
|
operation: Schema2.Literal("member.create"),
|
|
2897
3182
|
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
@@ -2952,6 +3237,13 @@ var OnsiteResourceMemberCallResponseSchema = Schema2.Struct({
|
|
|
2952
3237
|
timedOut: Schema2.Boolean,
|
|
2953
3238
|
command: OrganizationMemberSourceCommandSchema
|
|
2954
3239
|
});
|
|
3240
|
+
var OnsiteResourceEnsureActiveMembershipCallResponseSchema = Schema2.Struct({
|
|
3241
|
+
kind: Schema2.Literal("member"),
|
|
3242
|
+
operation: Schema2.Literal("member.ensure_active"),
|
|
3243
|
+
settled: Schema2.Boolean,
|
|
3244
|
+
timedOut: Schema2.Boolean,
|
|
3245
|
+
command: EnsureActiveMembershipCommandSchema
|
|
3246
|
+
});
|
|
2955
3247
|
var OnsiteResourceVoucherCallResponseSchema = Schema2.Struct({
|
|
2956
3248
|
kind: Schema2.Literal("voucher"),
|
|
2957
3249
|
operation: Schema2.Literal("voucher.issue", "voucher.lookup"),
|
|
@@ -2967,6 +3259,7 @@ var OnsiteResourcePointCallResponseSchema = Schema2.Struct({
|
|
|
2967
3259
|
command: OrganizationPointCommandSchema
|
|
2968
3260
|
});
|
|
2969
3261
|
var OnsiteResourceCallResponseSchema = Schema2.Union(
|
|
3262
|
+
OnsiteResourceEnsureActiveMembershipCallResponseSchema,
|
|
2970
3263
|
OnsiteResourceMemberCallResponseSchema,
|
|
2971
3264
|
OnsiteResourceVoucherCallResponseSchema,
|
|
2972
3265
|
OnsiteResourcePointCallResponseSchema
|
|
@@ -3057,6 +3350,17 @@ var ImportedMemberRecordSchema = Schema2.Struct({
|
|
|
3057
3350
|
expiresAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
3058
3351
|
sourceUpdatedAt: Schema2.Union(TimestampSchema, Schema2.Null)
|
|
3059
3352
|
});
|
|
3353
|
+
var SourceContactPreferenceSchema = Schema2.Struct({
|
|
3354
|
+
externalSystemMemberId: Schema2.String,
|
|
3355
|
+
siteId: Schema2.String,
|
|
3356
|
+
email: Schema2.Boolean,
|
|
3357
|
+
sms: Schema2.Boolean,
|
|
3358
|
+
post: Schema2.Boolean,
|
|
3359
|
+
isDefaultSite: Schema2.optional(Schema2.Boolean),
|
|
3360
|
+
sourceCreatedAt: Schema2.optional(Schema2.Union(TimestampSchema, Schema2.Null)),
|
|
3361
|
+
sourceUpdatedAt: Schema2.optional(Schema2.Union(TimestampSchema, Schema2.Null)),
|
|
3362
|
+
metadata: Schema2.optional(JsonObjectSchema)
|
|
3363
|
+
});
|
|
3060
3364
|
var OnsiteAgentCommandSchema = Schema2.Struct({
|
|
3061
3365
|
runId: Schema2.String,
|
|
3062
3366
|
organizationId: Schema2.String,
|
|
@@ -3082,6 +3386,17 @@ var OnsiteAgentMemberCreateCommandSchema = Schema2.Struct({
|
|
|
3082
3386
|
config: JsonObjectSchema,
|
|
3083
3387
|
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3084
3388
|
});
|
|
3389
|
+
var OnsiteAgentEnsureActiveMembershipCommandSchema = Schema2.Struct({
|
|
3390
|
+
commandId: Schema2.String,
|
|
3391
|
+
organizationId: Schema2.String,
|
|
3392
|
+
organizationMemberSourceId: Schema2.String,
|
|
3393
|
+
vendor: Schema2.Literal("odyssey_gaming"),
|
|
3394
|
+
connectorType: Schema2.Literal("odyssey_gaming"),
|
|
3395
|
+
requestedAt: TimestampSchema,
|
|
3396
|
+
payload: EnsureActiveMembershipCommandPayloadSchema,
|
|
3397
|
+
config: JsonObjectSchema,
|
|
3398
|
+
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3399
|
+
});
|
|
3085
3400
|
var OnsiteAgentMemberUpdateCommandSchema = Schema2.Struct({
|
|
3086
3401
|
commandId: Schema2.String,
|
|
3087
3402
|
organizationId: Schema2.String,
|
|
@@ -3140,6 +3455,9 @@ var OnsiteAgentCustomFieldsCommandSchema = Schema2.Struct({
|
|
|
3140
3455
|
var OnsiteAgentHeartbeatSchema = Schema2.Struct({
|
|
3141
3456
|
version: Schema2.String,
|
|
3142
3457
|
pollingIntervalSeconds: Schema2.optional(Schema2.Number),
|
|
3458
|
+
capabilities: Schema2.optional(
|
|
3459
|
+
Schema2.Array(Schema2.Literal(...organizationMemberSourceAgentCapabilities))
|
|
3460
|
+
),
|
|
3143
3461
|
metadata: Schema2.optional(JsonObjectSchema),
|
|
3144
3462
|
lastError: OptionalNullableString
|
|
3145
3463
|
});
|
|
@@ -3183,17 +3501,51 @@ var OnsiteAgentCompleteRunErrorSchema = Schema2.Struct({
|
|
|
3183
3501
|
});
|
|
3184
3502
|
var OnsiteAgentCompleteRunSchema = Schema2.Struct({
|
|
3185
3503
|
records: Schema2.Array(ImportedMemberRecordSchema),
|
|
3504
|
+
contactPreferences: Schema2.optional(Schema2.Array(SourceContactPreferenceSchema)),
|
|
3186
3505
|
cursorAfter: Schema2.optional(Schema2.Union(JsonObjectSchema, Schema2.Null)),
|
|
3187
3506
|
rowErrors: Schema2.optional(Schema2.Array(OnsiteAgentCompleteRunErrorSchema)),
|
|
3188
3507
|
csvImportUploaded: Schema2.optional(Schema2.Boolean),
|
|
3189
3508
|
errorMessage: OptionalNullableString
|
|
3190
3509
|
});
|
|
3510
|
+
var OnsiteAgentMemberCreationResultSchema = Schema2.Literal(
|
|
3511
|
+
"created",
|
|
3512
|
+
"recovered_create",
|
|
3513
|
+
"matched_existing"
|
|
3514
|
+
);
|
|
3191
3515
|
var OnsiteAgentCompleteMemberCreateSchema = Schema2.Struct({
|
|
3192
3516
|
record: Schema2.optional(ImportedMemberRecordSchema),
|
|
3517
|
+
contactPreferences: Schema2.optional(Schema2.Array(SourceContactPreferenceSchema)),
|
|
3518
|
+
creationResult: Schema2.optional(OnsiteAgentMemberCreationResultSchema),
|
|
3519
|
+
ensureOutcome: Schema2.optional(EnsureActiveMembershipOutcomeSchema),
|
|
3520
|
+
errorMessage: OptionalNullableString
|
|
3521
|
+
});
|
|
3522
|
+
var OnsiteAgentEnsureActiveMembershipRecordSchema = Schema2.Struct({
|
|
3523
|
+
...ImportedMemberRecordSchema.fields,
|
|
3524
|
+
sourceStatus: Schema2.Literal("ACTIVE"),
|
|
3525
|
+
membershipTypeId: Schema2.String,
|
|
3526
|
+
expiresAt: TimestampSchema
|
|
3527
|
+
});
|
|
3528
|
+
var OnsiteAgentEnsureActiveMembershipCreatedResultSchema = Schema2.Struct({
|
|
3529
|
+
outcome: Schema2.Literal("created"),
|
|
3530
|
+
record: OnsiteAgentEnsureActiveMembershipRecordSchema,
|
|
3531
|
+
creationResult: Schema2.Literal("created", "recovered_create")
|
|
3532
|
+
});
|
|
3533
|
+
var OnsiteAgentEnsureActiveMembershipExistingResultSchema = Schema2.Struct({
|
|
3534
|
+
outcome: Schema2.Literal("matched_active", "renewed_existing"),
|
|
3535
|
+
record: OnsiteAgentEnsureActiveMembershipRecordSchema
|
|
3536
|
+
});
|
|
3537
|
+
var OnsiteAgentEnsureActiveMembershipCompletionResultSchema = Schema2.Union(
|
|
3538
|
+
OnsiteAgentEnsureActiveMembershipCreatedResultSchema,
|
|
3539
|
+
OnsiteAgentEnsureActiveMembershipExistingResultSchema,
|
|
3540
|
+
EnsureActiveMembershipNonSuccessResultSchema
|
|
3541
|
+
);
|
|
3542
|
+
var OnsiteAgentCompleteEnsureActiveMembershipSchema = Schema2.Struct({
|
|
3543
|
+
result: Schema2.optional(OnsiteAgentEnsureActiveMembershipCompletionResultSchema),
|
|
3193
3544
|
errorMessage: OptionalNullableString
|
|
3194
3545
|
});
|
|
3195
3546
|
var OnsiteAgentCompleteMemberUpdateSchema = Schema2.Struct({
|
|
3196
3547
|
record: Schema2.optional(ImportedMemberRecordSchema),
|
|
3548
|
+
contactPreferences: Schema2.optional(Schema2.Array(SourceContactPreferenceSchema)),
|
|
3197
3549
|
errorMessage: OptionalNullableString
|
|
3198
3550
|
});
|
|
3199
3551
|
var OnsiteAgentCompleteMemberRenewalSchema = Schema2.Struct({
|
|
@@ -3226,6 +3578,15 @@ var OrganizationProductOptionParams = Schema2.Struct({
|
|
|
3226
3578
|
var OrganizationProductWebhookParams = Schema2.Struct({
|
|
3227
3579
|
organizationProductWebhookId: HttpApiSchema2.param("organizationProductWebhookId", Schema2.String)
|
|
3228
3580
|
});
|
|
3581
|
+
var OrganizationProductWebhookOperationParams = Schema2.Struct({
|
|
3582
|
+
organizationProductOptionId: HttpApiSchema2.param("organizationProductOptionId", Schema2.String),
|
|
3583
|
+
idempotencyKey: HttpApiSchema2.param("idempotencyKey", Schema2.String)
|
|
3584
|
+
});
|
|
3585
|
+
var RequiredWebhookOperationHeaders = Schema2.Struct({
|
|
3586
|
+
"idempotency-key": Schema2.String.annotations({
|
|
3587
|
+
description: "Requester-scoped operation key used to replay or recover the original one-time-secret response."
|
|
3588
|
+
})
|
|
3589
|
+
});
|
|
3229
3590
|
var OrganizationMemberSourceCommandParams = Schema2.Struct({
|
|
3230
3591
|
organizationId: HttpApiSchema2.param("organizationId", Schema2.String),
|
|
3231
3592
|
commandId: HttpApiSchema2.param("commandId", Schema2.String)
|
|
@@ -3312,7 +3673,7 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3312
3673
|
HttpApiEndpoint.post(
|
|
3313
3674
|
"createOrganizationProductWebhook",
|
|
3314
3675
|
"/organization-products/:organizationProductOptionId/webhooks"
|
|
3315
|
-
).setPath(OrganizationProductOptionParams).setPayload(CreateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema, { status: 201 }).annotateContext(
|
|
3676
|
+
).setPath(OrganizationProductOptionParams).setHeaders(RequiredWebhookOperationHeaders).setPayload(CreateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema, { status: 201 }).annotateContext(
|
|
3316
3677
|
OpenApi.annotations({ summary: "Create a webhook for an organization product option" })
|
|
3317
3678
|
)
|
|
3318
3679
|
).add(
|
|
@@ -3324,11 +3685,20 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3324
3685
|
summary: "Legacy single-webhook lookup for an organization product option"
|
|
3325
3686
|
})
|
|
3326
3687
|
)
|
|
3688
|
+
).add(
|
|
3689
|
+
HttpApiEndpoint.get(
|
|
3690
|
+
"getOrganizationProductWebhookOperationResult",
|
|
3691
|
+
"/organization-products/:organizationProductOptionId/webhook-operations/:idempotencyKey"
|
|
3692
|
+
).setPath(OrganizationProductWebhookOperationParams).addSuccess(Schema2.Union(OrganizationProductWebhookUpsertResponseSchema, Schema2.Null)).annotateContext(
|
|
3693
|
+
OpenApi.annotations({
|
|
3694
|
+
summary: "Recover an idempotent organization product webhook operation result"
|
|
3695
|
+
})
|
|
3696
|
+
)
|
|
3327
3697
|
).add(
|
|
3328
3698
|
HttpApiEndpoint.put(
|
|
3329
3699
|
"upsertOrganizationProductWebhook",
|
|
3330
3700
|
"/organization-products/:organizationProductOptionId/webhook"
|
|
3331
|
-
).setPath(OrganizationProductOptionParams).setPayload(UpsertOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(
|
|
3701
|
+
).setPath(OrganizationProductOptionParams).setHeaders(RequiredWebhookOperationHeaders).setPayload(UpsertOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(
|
|
3332
3702
|
OpenApi.annotations({
|
|
3333
3703
|
summary: "Legacy single-webhook create-or-update helper for an organization product option"
|
|
3334
3704
|
})
|
|
@@ -3337,7 +3707,7 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3337
3707
|
HttpApiEndpoint.put(
|
|
3338
3708
|
"updateOrganizationProductWebhook",
|
|
3339
3709
|
"/organization-product-webhooks/:organizationProductWebhookId"
|
|
3340
|
-
).setPath(OrganizationProductWebhookParams).setPayload(UpdateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(OpenApi.annotations({ summary: "Update an organization product webhook" }))
|
|
3710
|
+
).setPath(OrganizationProductWebhookParams).setHeaders(RequiredWebhookOperationHeaders).setPayload(UpdateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(OpenApi.annotations({ summary: "Update an organization product webhook" }))
|
|
3341
3711
|
).add(
|
|
3342
3712
|
HttpApiEndpoint.del(
|
|
3343
3713
|
"deleteOrganizationProductWebhook",
|
|
@@ -3453,6 +3823,12 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
3453
3823
|
transform: createMemberExamplesTransform
|
|
3454
3824
|
})
|
|
3455
3825
|
)
|
|
3826
|
+
).add(
|
|
3827
|
+
HttpApiEndpoint.post("seedOrganizationMembers", "/organizations/:organizationId/members/seed").setPath(OrganizationIdParams).setPayload(SeedOrganizationMembersSchema).addSuccess(MemberSeedBatchSchema, { status: 201 }).annotateContext(
|
|
3828
|
+
OpenApi.annotations({
|
|
3829
|
+
summary: "Seed synthetic members for an organization"
|
|
3830
|
+
})
|
|
3831
|
+
)
|
|
3456
3832
|
).add(
|
|
3457
3833
|
HttpApiEndpoint.post(
|
|
3458
3834
|
"requestSourceManagedMemberCreate",
|
|
@@ -3463,6 +3839,16 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
3463
3839
|
transform: sourceManagedCreateExamplesTransform
|
|
3464
3840
|
})
|
|
3465
3841
|
)
|
|
3842
|
+
).add(
|
|
3843
|
+
HttpApiEndpoint.post(
|
|
3844
|
+
"ensureActiveMembership",
|
|
3845
|
+
"/organizations/:organizationId/members/ensure-active"
|
|
3846
|
+
).setPath(OrganizationIdParams).setPayload(RequestEnsureActiveMembershipSchema).addSuccess(EnsureActiveMembershipResponseSchema, { status: 202 }).annotateContext(
|
|
3847
|
+
OpenApi.annotations({
|
|
3848
|
+
summary: "Ensure an Odyssey membership is active",
|
|
3849
|
+
transform: ensureActiveMembershipExamplesTransform
|
|
3850
|
+
})
|
|
3851
|
+
)
|
|
3466
3852
|
).add(
|
|
3467
3853
|
HttpApiEndpoint.post(
|
|
3468
3854
|
"requestSourceManagedMemberRenewal",
|
|
@@ -3738,6 +4124,15 @@ var memberSourcesGroup = HttpApiGroup.make("memberSources").add(
|
|
|
3738
4124
|
).setPath(OrganizationIdParams).setPayload(UpsertOrganizationMemberSourceSchema).addSuccess(OrganizationMemberSourceSchema).annotateContext(
|
|
3739
4125
|
OpenApi.annotations({ summary: "Create or update the member source for an organization" })
|
|
3740
4126
|
)
|
|
4127
|
+
).add(
|
|
4128
|
+
HttpApiEndpoint.post(
|
|
4129
|
+
"convertOrganizationToDemo",
|
|
4130
|
+
"/organizations/:organizationId/member-source/demo"
|
|
4131
|
+
).setPath(OrganizationIdParams).setPayload(ConvertOrganizationToDemoSchema).addSuccess(OrganizationMemberSourceSchema).annotateContext(
|
|
4132
|
+
OpenApi.annotations({
|
|
4133
|
+
summary: "Convert an existing organization to an Odyssey Nexus demo source"
|
|
4134
|
+
})
|
|
4135
|
+
)
|
|
3741
4136
|
).add(
|
|
3742
4137
|
HttpApiEndpoint.post(
|
|
3743
4138
|
"bootstrapOrganizationMemberSourceAgent",
|
|
@@ -3859,6 +4254,15 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3859
4254
|
HttpApiEndpoint.post("pollOnsiteAgentMemberCreateCommand", "/onsite-agent/member-commands/poll").addSuccess(Schema2.Union(OnsiteAgentMemberCreateCommandSchema, Schema2.Null)).annotateContext(
|
|
3860
4255
|
OpenApi.annotations({ summary: "Poll for the next pending onsite member-create command" })
|
|
3861
4256
|
)
|
|
4257
|
+
).add(
|
|
4258
|
+
HttpApiEndpoint.post(
|
|
4259
|
+
"pollOnsiteAgentEnsureActiveMembershipCommand",
|
|
4260
|
+
"/onsite-agent/ensure-active-membership-commands/poll"
|
|
4261
|
+
).addSuccess(Schema2.Union(OnsiteAgentEnsureActiveMembershipCommandSchema, Schema2.Null)).annotateContext(
|
|
4262
|
+
OpenApi.annotations({
|
|
4263
|
+
summary: "Poll for the next Ensure Active Membership command"
|
|
4264
|
+
})
|
|
4265
|
+
)
|
|
3862
4266
|
).add(
|
|
3863
4267
|
HttpApiEndpoint.post(
|
|
3864
4268
|
"pollOnsiteAgentMemberUpdateCommand",
|
|
@@ -3904,6 +4308,12 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3904
4308
|
summary: "Poll for the next pending onsite custom-fields command"
|
|
3905
4309
|
})
|
|
3906
4310
|
)
|
|
4311
|
+
).add(
|
|
4312
|
+
HttpApiEndpoint.post("refreshOnsiteAgentRunCsvUpload", "/onsite-agent/runs/:runId/csv-upload").setPath(OrganizationMemberSyncRunParams).addSuccess(OnsiteAgentCsvUploadTargetSchema).annotateContext(
|
|
4313
|
+
OpenApi.annotations({
|
|
4314
|
+
summary: "Issue a fresh presigned CSV upload target for a claimed onsite sync run"
|
|
4315
|
+
})
|
|
4316
|
+
)
|
|
3907
4317
|
).add(
|
|
3908
4318
|
HttpApiEndpoint.post("completeOnsiteAgentRun", "/onsite-agent/runs/:runId/complete").setPath(OrganizationMemberSyncRunParams).setPayload(OnsiteAgentCompleteRunSchema).addSuccess(OrganizationMemberSyncRunSchema).annotateContext(
|
|
3909
4319
|
OpenApi.annotations({ summary: "Submit onsite agent sync results for a claimed run" })
|
|
@@ -3921,6 +4331,19 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3921
4331
|
summary: "Submit onsite agent member-create results for a claimed command"
|
|
3922
4332
|
})
|
|
3923
4333
|
)
|
|
4334
|
+
).add(
|
|
4335
|
+
HttpApiEndpoint.post(
|
|
4336
|
+
"completeOnsiteAgentEnsureActiveMembership",
|
|
4337
|
+
"/onsite-agent/ensure-active-membership-commands/:commandId/complete"
|
|
4338
|
+
).setPath(
|
|
4339
|
+
Schema2.Struct({
|
|
4340
|
+
commandId: HttpApiSchema2.param("commandId", Schema2.String)
|
|
4341
|
+
})
|
|
4342
|
+
).setPayload(OnsiteAgentCompleteEnsureActiveMembershipSchema).addSuccess(EnsureActiveMembershipCommandSchema).annotateContext(
|
|
4343
|
+
OpenApi.annotations({
|
|
4344
|
+
summary: "Submit an Ensure Active Membership terminal outcome"
|
|
4345
|
+
})
|
|
4346
|
+
)
|
|
3924
4347
|
).add(
|
|
3925
4348
|
HttpApiEndpoint.post(
|
|
3926
4349
|
"completeOnsiteAgentMemberUpdate",
|
|
@@ -4052,7 +4475,7 @@ var serviceClientsGroup = HttpApiGroup.make("serviceClients").add(
|
|
|
4052
4475
|
})
|
|
4053
4476
|
)
|
|
4054
4477
|
);
|
|
4055
|
-
var HubApi = HttpApi.make("hub").add(authGroup).add(organizationsGroup).add(membersGroup).add(memberPointsGroup).add(vouchersGroup).add(pointProvidersGroup).add(onsiteCallsGroup).add(memberSourcesGroup).add(onsiteAgentsGroup).add(guestsGroup).add(serviceClientsGroup).prefix("/v1").addError(UnauthorizedErrorSchema).addError(ForbiddenErrorSchema).addError(NotFoundErrorSchema).addError(ConflictErrorSchema).addError(BadRequestErrorSchema).annotateContext(
|
|
4478
|
+
var HubApi = HttpApi.make("hub").add(authGroup).add(organizationsGroup).add(membersGroup).add(memberPointsGroup).add(vouchersGroup).add(pointProvidersGroup).add(onsiteCallsGroup).add(memberSourcesGroup).add(onsiteAgentsGroup).add(guestsGroup).add(serviceClientsGroup).prefix("/v1").addError(UnauthorizedErrorSchema).addError(ForbiddenErrorSchema).addError(NotFoundErrorSchema).addError(ConflictErrorSchema).addError(BadRequestErrorSchema).addError(InternalServerErrorSchema).annotateContext(
|
|
4056
4479
|
OpenApi.annotations({
|
|
4057
4480
|
title: "Spoke Hub API",
|
|
4058
4481
|
version: "1.0.0",
|
|
@@ -4306,6 +4729,24 @@ function apiErrorBodyFromUnknown(value) {
|
|
|
4306
4729
|
}
|
|
4307
4730
|
return null;
|
|
4308
4731
|
}
|
|
4732
|
+
function statusFromApiErrorBody(body) {
|
|
4733
|
+
switch (body.code) {
|
|
4734
|
+
case "bad_request":
|
|
4735
|
+
return 400;
|
|
4736
|
+
case "unauthorized":
|
|
4737
|
+
return 401;
|
|
4738
|
+
case "forbidden":
|
|
4739
|
+
return 403;
|
|
4740
|
+
case "not_found":
|
|
4741
|
+
return 404;
|
|
4742
|
+
case "conflict":
|
|
4743
|
+
return 409;
|
|
4744
|
+
case "internal_error":
|
|
4745
|
+
return 500;
|
|
4746
|
+
default:
|
|
4747
|
+
return void 0;
|
|
4748
|
+
}
|
|
4749
|
+
}
|
|
4309
4750
|
function errorMessageFromUnknown(value) {
|
|
4310
4751
|
for (const candidate of errorCandidatesFromUnknown(value)) {
|
|
4311
4752
|
if (candidate instanceof Error && candidate.message.length > 0) {
|
|
@@ -4335,7 +4776,10 @@ function clientErrorFromUnknown(value) {
|
|
|
4335
4776
|
const body = apiErrorBodyFromUnknown(value);
|
|
4336
4777
|
const context = httpContextFromUnknown(value);
|
|
4337
4778
|
if (body) {
|
|
4338
|
-
return new SpokeHubApiError(body, value,
|
|
4779
|
+
return new SpokeHubApiError(body, value, {
|
|
4780
|
+
...context,
|
|
4781
|
+
status: context.status ?? statusFromApiErrorBody(body)
|
|
4782
|
+
});
|
|
4339
4783
|
}
|
|
4340
4784
|
const statusCode = context.status ? `http_${context.status}` : void 0;
|
|
4341
4785
|
return new SpokeHubClientError({
|
|
@@ -4439,6 +4883,12 @@ function makeOnsiteResourceClient(client) {
|
|
|
4439
4883
|
return {
|
|
4440
4884
|
call,
|
|
4441
4885
|
members: {
|
|
4886
|
+
ensureActive: (input) => call({
|
|
4887
|
+
organizationId: input.organizationId,
|
|
4888
|
+
waitMs: input.waitMs,
|
|
4889
|
+
operation: "member.ensure_active",
|
|
4890
|
+
...input.payload
|
|
4891
|
+
}),
|
|
4442
4892
|
create: (input) => call({
|
|
4443
4893
|
organizationId: input.organizationId,
|
|
4444
4894
|
waitMs: input.waitMs,
|
|
@@ -4594,6 +5044,7 @@ function makeSpokeClient(hubClient) {
|
|
|
4594
5044
|
path: {
|
|
4595
5045
|
organizationProductOptionId: input.organizationProductOptionId
|
|
4596
5046
|
},
|
|
5047
|
+
headers: { "idempotency-key": input.idempotencyKey },
|
|
4597
5048
|
payload: input.payload
|
|
4598
5049
|
})
|
|
4599
5050
|
)
|
|
@@ -4707,6 +5158,12 @@ function makeSpokeClient(hubClient) {
|
|
|
4707
5158
|
)
|
|
4708
5159
|
},
|
|
4709
5160
|
sourceRequests: {
|
|
5161
|
+
ensureActive: (input) => unwrap(
|
|
5162
|
+
hubClient.members.ensureActiveMembership({
|
|
5163
|
+
path: { organizationId: input.organizationId },
|
|
5164
|
+
payload: input.payload
|
|
5165
|
+
})
|
|
5166
|
+
),
|
|
4710
5167
|
create: (input) => unwrap(
|
|
4711
5168
|
hubClient.members.requestSourceManagedMemberCreate({
|
|
4712
5169
|
path: { organizationId: input.organizationId },
|
|
@@ -5021,6 +5478,7 @@ export {
|
|
|
5021
5478
|
CompleteOnsitePointCommandSchema,
|
|
5022
5479
|
CompleteOnsiteVoucherCommandSchema,
|
|
5023
5480
|
ConflictErrorSchema,
|
|
5481
|
+
ConvertOrganizationToDemoSchema,
|
|
5024
5482
|
CreateGuestSchema,
|
|
5025
5483
|
CreateMemberSchema,
|
|
5026
5484
|
CreateOrganizationMemberSourceCsvUploadResponseSchema,
|
|
@@ -5034,11 +5492,22 @@ export {
|
|
|
5034
5492
|
DateOnlySchema,
|
|
5035
5493
|
DeletePayloadSchema,
|
|
5036
5494
|
DeleteServiceClientSchema,
|
|
5495
|
+
EnsureActiveMembershipCommandPayloadSchema,
|
|
5496
|
+
EnsureActiveMembershipCommandSchema,
|
|
5497
|
+
EnsureActiveMembershipMemberSchema,
|
|
5498
|
+
EnsureActiveMembershipNonSuccessOutcomeSchema,
|
|
5499
|
+
EnsureActiveMembershipNonSuccessResultSchema,
|
|
5500
|
+
EnsureActiveMembershipOutcomeSchema,
|
|
5501
|
+
EnsureActiveMembershipResponseSchema,
|
|
5502
|
+
EnsureActiveMembershipResultSchema,
|
|
5503
|
+
EnsureActiveMembershipSuccessOutcomeSchema,
|
|
5504
|
+
EnsureActiveMembershipSuccessResultSchema,
|
|
5037
5505
|
ForbiddenErrorSchema,
|
|
5038
5506
|
GuestContactMatchSchema,
|
|
5039
5507
|
GuestSchema,
|
|
5040
5508
|
HubApi,
|
|
5041
5509
|
ImportedMemberRecordSchema,
|
|
5510
|
+
InternalServerErrorSchema,
|
|
5042
5511
|
IssuedPrivateKeySchema,
|
|
5043
5512
|
MarketingPreferencesSchema,
|
|
5044
5513
|
MemberBasicResponseSchema,
|
|
@@ -5052,11 +5521,13 @@ export {
|
|
|
5052
5521
|
MemberResponseModeSchema,
|
|
5053
5522
|
MemberResponseSchema,
|
|
5054
5523
|
MemberSchema,
|
|
5524
|
+
MemberSeedBatchSchema,
|
|
5055
5525
|
MemberSourceSecretNameSchema,
|
|
5056
5526
|
MemberStatusCreditsSchema,
|
|
5057
5527
|
NotFoundErrorSchema,
|
|
5058
5528
|
OnsiteAgentCommandSchema,
|
|
5059
5529
|
OnsiteAgentCompleteCustomFieldsSchema,
|
|
5530
|
+
OnsiteAgentCompleteEnsureActiveMembershipSchema,
|
|
5060
5531
|
OnsiteAgentCompleteMemberCreateSchema,
|
|
5061
5532
|
OnsiteAgentCompleteMemberLookupSchema,
|
|
5062
5533
|
OnsiteAgentCompleteMemberRenewalSchema,
|
|
@@ -5065,10 +5536,13 @@ export {
|
|
|
5065
5536
|
OnsiteAgentCompleteRunSchema,
|
|
5066
5537
|
OnsiteAgentCsvUploadTargetSchema,
|
|
5067
5538
|
OnsiteAgentCustomFieldsCommandSchema,
|
|
5539
|
+
OnsiteAgentEnsureActiveMembershipCommandSchema,
|
|
5540
|
+
OnsiteAgentEnsureActiveMembershipCompletionResultSchema,
|
|
5068
5541
|
OnsiteAgentHeartbeatResponseSchema,
|
|
5069
5542
|
OnsiteAgentHeartbeatSchema,
|
|
5070
5543
|
OnsiteAgentIngestLiveFbiBatchSchema,
|
|
5071
5544
|
OnsiteAgentMemberCreateCommandSchema,
|
|
5545
|
+
OnsiteAgentMemberCreationResultSchema,
|
|
5072
5546
|
OnsiteAgentMemberLookupCommandSchema,
|
|
5073
5547
|
OnsiteAgentMemberPreferenceUpdateCommandSchema,
|
|
5074
5548
|
OnsiteAgentMemberRenewalCommandSchema,
|
|
@@ -5076,6 +5550,7 @@ export {
|
|
|
5076
5550
|
OnsitePointCommandSchema,
|
|
5077
5551
|
OnsiteResourceCallRequestSchema,
|
|
5078
5552
|
OnsiteResourceCallResponseSchema,
|
|
5553
|
+
OnsiteResourceEnsureActiveMembershipCallResponseSchema,
|
|
5079
5554
|
OnsiteResourceMemberCallResponseSchema,
|
|
5080
5555
|
OnsiteResourcePointCallResponseSchema,
|
|
5081
5556
|
OnsiteResourceVoucherCallResponseSchema,
|
|
@@ -5131,6 +5606,7 @@ export {
|
|
|
5131
5606
|
PaginatedOrganizationsSchema,
|
|
5132
5607
|
PaginatedServiceClientsSchema,
|
|
5133
5608
|
PresignedPostSchema,
|
|
5609
|
+
RequestEnsureActiveMembershipSchema,
|
|
5134
5610
|
RequestPointDebitSchema,
|
|
5135
5611
|
RequestPointLookupSchema,
|
|
5136
5612
|
RequestSourceManagedMemberCreateSchema,
|
|
@@ -5139,8 +5615,10 @@ export {
|
|
|
5139
5615
|
RequestSourceManagedMemberUpdateSchema,
|
|
5140
5616
|
RequestVoucherIssueSchema,
|
|
5141
5617
|
RequestVoucherLookupSchema,
|
|
5618
|
+
SeedOrganizationMembersSchema,
|
|
5142
5619
|
ServiceClientSchema,
|
|
5143
5620
|
SortDirectionSchema,
|
|
5621
|
+
SourceContactPreferenceSchema,
|
|
5144
5622
|
SourceManagedMemberLookupBySchema,
|
|
5145
5623
|
SourceManagedMemberLookupCommandPayloadSchema,
|
|
5146
5624
|
SourceManagedMemberPreferenceUpdateCommandPayloadSchema,
|
|
@@ -5166,11 +5644,13 @@ export {
|
|
|
5166
5644
|
UpsertOrganizationProductWebhookSchema,
|
|
5167
5645
|
UpsertOrganizationVoucherProviderSchema,
|
|
5168
5646
|
adminRoles,
|
|
5647
|
+
ensureActiveMembershipOutcomes,
|
|
5169
5648
|
guestStatuses,
|
|
5170
5649
|
makeBadRequest,
|
|
5171
5650
|
makeConflict,
|
|
5172
5651
|
makeForbidden,
|
|
5173
5652
|
makeHubApiClient,
|
|
5653
|
+
makeInternalServerError,
|
|
5174
5654
|
makeNotFound,
|
|
5175
5655
|
makeOnsiteResourceClient,
|
|
5176
5656
|
makePromiseHubApiClient,
|
|
@@ -5185,6 +5665,7 @@ export {
|
|
|
5185
5665
|
memberPreferredContactMethods,
|
|
5186
5666
|
memberRecordModes,
|
|
5187
5667
|
memberStatuses,
|
|
5668
|
+
organizationMemberSourceAgentCapabilities,
|
|
5188
5669
|
organizationMemberSourceAgentStatuses,
|
|
5189
5670
|
organizationMemberSourceBatchTransports,
|
|
5190
5671
|
organizationMemberSourceCommandKinds,
|