@spoketech/hub-client 0.1.27 → 0.1.28
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/dist/index.d.ts +568 -35
- package/dist/index.js +217 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104,7 +104,8 @@ var organizationMemberSourceCommandKinds = [
|
|
|
104
104
|
"update_preferences",
|
|
105
105
|
"renew_member",
|
|
106
106
|
"lookup_member",
|
|
107
|
-
"list_custom_fields"
|
|
107
|
+
"list_custom_fields",
|
|
108
|
+
"lookup_reference_data"
|
|
108
109
|
];
|
|
109
110
|
var ensureActiveMembershipOutcomes = [
|
|
110
111
|
"created",
|
|
@@ -919,6 +920,12 @@ var OrganizationMembersListUrlParamsSchema = Schema2.Struct({
|
|
|
919
920
|
description: "Partial member name match against the display name."
|
|
920
921
|
})
|
|
921
922
|
),
|
|
923
|
+
email: Schema2.optional(
|
|
924
|
+
Schema2.String.annotate({
|
|
925
|
+
description: "Exact member email match. Case-insensitive, after trimming whitespace.",
|
|
926
|
+
example: "jane@example.com"
|
|
927
|
+
})
|
|
928
|
+
),
|
|
922
929
|
mobilePhone: Schema2.optional(
|
|
923
930
|
MobilePhoneSchema.annotate({
|
|
924
931
|
description: "Exact mobile phone match after phone-number normalization."
|
|
@@ -3953,6 +3960,9 @@ var OnsiteAgentMemberLookupCommandSchema = Schema2.Struct({
|
|
|
3953
3960
|
config: JsonObjectSchema,
|
|
3954
3961
|
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3955
3962
|
});
|
|
3963
|
+
var NexusReferenceDataRequestSchema = Schema2.Struct({
|
|
3964
|
+
resource: Schema2.Literals(["rates", "promotions", "memberTiers", "memberGroups", "titles"])
|
|
3965
|
+
});
|
|
3956
3966
|
var OnsiteAgentCustomFieldsCommandSchema = Schema2.Struct({
|
|
3957
3967
|
commandId: Schema2.String,
|
|
3958
3968
|
organizationId: Schema2.String,
|
|
@@ -3964,6 +3974,17 @@ var OnsiteAgentCustomFieldsCommandSchema = Schema2.Struct({
|
|
|
3964
3974
|
config: JsonObjectSchema,
|
|
3965
3975
|
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3966
3976
|
});
|
|
3977
|
+
var OnsiteAgentReferenceDataCommandSchema = Schema2.Struct({
|
|
3978
|
+
commandId: Schema2.String,
|
|
3979
|
+
organizationId: Schema2.String,
|
|
3980
|
+
organizationMemberSourceId: Schema2.String,
|
|
3981
|
+
vendor: Schema2.Literals([...organizationMemberSourceVendors]),
|
|
3982
|
+
connectorType: Schema2.Literals([...organizationMemberSourceVendors]),
|
|
3983
|
+
requestedAt: TimestampSchema,
|
|
3984
|
+
payload: NexusReferenceDataRequestSchema,
|
|
3985
|
+
config: JsonObjectSchema,
|
|
3986
|
+
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3987
|
+
});
|
|
3967
3988
|
var OnsiteAgentHeartbeatSchema = Schema2.Struct({
|
|
3968
3989
|
version: Schema2.String,
|
|
3969
3990
|
pollingIntervalSeconds: Schema2.optional(Schema2.Number),
|
|
@@ -4093,6 +4114,10 @@ var OnsiteAgentCompleteCustomFieldsSchema = Schema2.Struct({
|
|
|
4093
4114
|
rawRecord: Schema2.optional(JsonObjectSchema),
|
|
4094
4115
|
errorMessage: OptionalNullableString
|
|
4095
4116
|
});
|
|
4117
|
+
var OnsiteAgentCompleteReferenceDataSchema = Schema2.Struct({
|
|
4118
|
+
items: Schema2.optional(Schema2.Array(JsonObjectSchema)),
|
|
4119
|
+
errorMessage: OptionalNullableString
|
|
4120
|
+
});
|
|
4096
4121
|
var OnsiteAgentIngestLiveFbiBatchSchema = Schema2.Struct({
|
|
4097
4122
|
sourceFileName: OptionalNullableString,
|
|
4098
4123
|
metadata: Schema2.optional(JsonObjectSchema),
|
|
@@ -4759,6 +4784,23 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
4759
4784
|
summary: "Request upstream custom field definitions from the configured source"
|
|
4760
4785
|
})
|
|
4761
4786
|
)
|
|
4787
|
+
).add(
|
|
4788
|
+
HttpApiEndpoint.post(
|
|
4789
|
+
"requestSourceManagedReferenceData",
|
|
4790
|
+
"/organizations/:organizationId/member-source/reference-data",
|
|
4791
|
+
{
|
|
4792
|
+
params: OrganizationIdParams,
|
|
4793
|
+
payload: NexusReferenceDataRequestSchema,
|
|
4794
|
+
success: OrganizationMemberSourceCommandSchema.pipe(
|
|
4795
|
+
HttpApiSchema2.status(202)
|
|
4796
|
+
),
|
|
4797
|
+
error: CommonErrorSchemas
|
|
4798
|
+
}
|
|
4799
|
+
).annotateMerge(
|
|
4800
|
+
OpenApi.annotations({
|
|
4801
|
+
summary: "Request upstream Nexus reference data from the configured source"
|
|
4802
|
+
})
|
|
4803
|
+
)
|
|
4762
4804
|
).add(
|
|
4763
4805
|
HttpApiEndpoint.patch(
|
|
4764
4806
|
"updateOrganizationMember",
|
|
@@ -5655,6 +5697,22 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
5655
5697
|
summary: "Poll for the next pending onsite custom-fields command"
|
|
5656
5698
|
})
|
|
5657
5699
|
)
|
|
5700
|
+
).add(
|
|
5701
|
+
HttpApiEndpoint.post(
|
|
5702
|
+
"pollOnsiteAgentReferenceDataCommand",
|
|
5703
|
+
"/onsite-agent/reference-data-commands/poll",
|
|
5704
|
+
{
|
|
5705
|
+
success: Schema2.Union([
|
|
5706
|
+
OnsiteAgentReferenceDataCommandSchema,
|
|
5707
|
+
Schema2.Null
|
|
5708
|
+
]),
|
|
5709
|
+
error: CommonErrorSchemas
|
|
5710
|
+
}
|
|
5711
|
+
).annotateMerge(
|
|
5712
|
+
OpenApi.annotations({
|
|
5713
|
+
summary: "Poll for the next pending onsite reference-data command"
|
|
5714
|
+
})
|
|
5715
|
+
)
|
|
5658
5716
|
).add(
|
|
5659
5717
|
HttpApiEndpoint.post(
|
|
5660
5718
|
"refreshOnsiteAgentRunCsvUpload",
|
|
@@ -5859,6 +5917,23 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
5859
5917
|
summary: "Submit onsite agent custom field definitions for a claimed command"
|
|
5860
5918
|
})
|
|
5861
5919
|
)
|
|
5920
|
+
).add(
|
|
5921
|
+
HttpApiEndpoint.post(
|
|
5922
|
+
"completeOnsiteAgentReferenceData",
|
|
5923
|
+
"/onsite-agent/reference-data-commands/:commandId/complete",
|
|
5924
|
+
{
|
|
5925
|
+
params: Schema2.Struct({
|
|
5926
|
+
commandId: Schema2.String
|
|
5927
|
+
}),
|
|
5928
|
+
payload: OnsiteAgentCompleteReferenceDataSchema,
|
|
5929
|
+
success: OrganizationMemberSourceCommandSchema,
|
|
5930
|
+
error: CommonErrorSchemas
|
|
5931
|
+
}
|
|
5932
|
+
).annotateMerge(
|
|
5933
|
+
OpenApi.annotations({
|
|
5934
|
+
summary: "Submit onsite agent Nexus reference data for a claimed command"
|
|
5935
|
+
})
|
|
5936
|
+
)
|
|
5862
5937
|
);
|
|
5863
5938
|
var guestsGroup = HttpApiGroup.make("guests").add(
|
|
5864
5939
|
HttpApiEndpoint.get("listGuests", "/organizations/:organizationId/guests", {
|
|
@@ -5986,7 +6061,141 @@ var serviceClientsGroup = HttpApiGroup.make("serviceClients").add(
|
|
|
5986
6061
|
})
|
|
5987
6062
|
)
|
|
5988
6063
|
);
|
|
5989
|
-
var
|
|
6064
|
+
var MailchimpSettingsInputSchema = Schema2.Struct({
|
|
6065
|
+
enabled: Schema2.Boolean,
|
|
6066
|
+
audienceId: Schema2.String,
|
|
6067
|
+
welcomeTag: Schema2.String,
|
|
6068
|
+
firstNameField: Schema2.String,
|
|
6069
|
+
lastNameField: Schema2.String,
|
|
6070
|
+
phoneField: Schema2.String,
|
|
6071
|
+
dobField: Schema2.String
|
|
6072
|
+
});
|
|
6073
|
+
var MailchimpSettingsSchema = Schema2.Struct({
|
|
6074
|
+
connected: Schema2.Boolean,
|
|
6075
|
+
enabled: Schema2.Boolean,
|
|
6076
|
+
audienceId: Schema2.NullOr(Schema2.String),
|
|
6077
|
+
welcomeTag: Schema2.String,
|
|
6078
|
+
firstNameField: Schema2.String,
|
|
6079
|
+
lastNameField: Schema2.String,
|
|
6080
|
+
phoneField: Schema2.String,
|
|
6081
|
+
dobField: Schema2.String,
|
|
6082
|
+
pending: Schema2.Number,
|
|
6083
|
+
failed: Schema2.Number,
|
|
6084
|
+
lastSuccessAt: Schema2.NullOr(Schema2.String),
|
|
6085
|
+
lastError: Schema2.NullOr(Schema2.String)
|
|
6086
|
+
});
|
|
6087
|
+
var mailchimpGroup = HttpApiGroup.make("mailchimp").add(
|
|
6088
|
+
HttpApiEndpoint.post(
|
|
6089
|
+
"createMailchimpLinkSession",
|
|
6090
|
+
"/organizations/:organizationId/mailchimp/link-sessions",
|
|
6091
|
+
{
|
|
6092
|
+
params: OrganizationIdParams,
|
|
6093
|
+
payload: Schema2.Struct({ returnUrl: Schema2.String }),
|
|
6094
|
+
success: Schema2.Struct({ url: Schema2.String }),
|
|
6095
|
+
error: CommonErrorSchemas
|
|
6096
|
+
}
|
|
6097
|
+
)
|
|
6098
|
+
).add(
|
|
6099
|
+
HttpApiEndpoint.post("startMailchimpLinkSession", "/mailchimp/link-sessions/start", {
|
|
6100
|
+
payload: Schema2.Struct({ session: Schema2.String }),
|
|
6101
|
+
success: Schema2.Struct({ url: Schema2.String, browserToken: Schema2.String }),
|
|
6102
|
+
error: CommonErrorSchemas
|
|
6103
|
+
})
|
|
6104
|
+
).add(
|
|
6105
|
+
HttpApiEndpoint.post("completeMailchimpLinkSession", "/mailchimp/link-sessions/complete", {
|
|
6106
|
+
payload: Schema2.Struct({
|
|
6107
|
+
state: Schema2.String,
|
|
6108
|
+
browserToken: Schema2.String,
|
|
6109
|
+
code: Schema2.optional(Schema2.String),
|
|
6110
|
+
error: Schema2.optional(Schema2.String)
|
|
6111
|
+
}),
|
|
6112
|
+
success: Schema2.Struct({ returnUrl: Schema2.String }),
|
|
6113
|
+
error: CommonErrorSchemas
|
|
6114
|
+
})
|
|
6115
|
+
).add(
|
|
6116
|
+
HttpApiEndpoint.get("getMailchimp", "/organizations/:organizationId/mailchimp", {
|
|
6117
|
+
params: OrganizationIdParams,
|
|
6118
|
+
success: MailchimpSettingsSchema,
|
|
6119
|
+
error: CommonErrorSchemas
|
|
6120
|
+
})
|
|
6121
|
+
).add(
|
|
6122
|
+
HttpApiEndpoint.put("saveMailchimp", "/organizations/:organizationId/mailchimp", {
|
|
6123
|
+
params: OrganizationIdParams,
|
|
6124
|
+
payload: MailchimpSettingsInputSchema,
|
|
6125
|
+
success: MailchimpSettingsSchema,
|
|
6126
|
+
error: CommonErrorSchemas
|
|
6127
|
+
})
|
|
6128
|
+
).add(
|
|
6129
|
+
HttpApiEndpoint.post("connectMailchimp", "/organizations/:organizationId/mailchimp/connect", {
|
|
6130
|
+
params: OrganizationIdParams,
|
|
6131
|
+
success: Schema2.Struct({ url: Schema2.String }),
|
|
6132
|
+
error: CommonErrorSchemas
|
|
6133
|
+
})
|
|
6134
|
+
).add(
|
|
6135
|
+
HttpApiEndpoint.post("completeMailchimp", "/organizations/:organizationId/mailchimp/complete", {
|
|
6136
|
+
params: OrganizationIdParams,
|
|
6137
|
+
payload: Schema2.Struct({ code: Schema2.String, state: Schema2.String }),
|
|
6138
|
+
success: MailchimpSettingsSchema,
|
|
6139
|
+
error: CommonErrorSchemas
|
|
6140
|
+
})
|
|
6141
|
+
).add(
|
|
6142
|
+
HttpApiEndpoint.get(
|
|
6143
|
+
"mailchimpAudiences",
|
|
6144
|
+
"/organizations/:organizationId/mailchimp/audiences",
|
|
6145
|
+
{
|
|
6146
|
+
params: OrganizationIdParams,
|
|
6147
|
+
success: Schema2.Struct({
|
|
6148
|
+
audiences: Schema2.Array(Schema2.Struct({ id: Schema2.String, name: Schema2.String }))
|
|
6149
|
+
}),
|
|
6150
|
+
error: CommonErrorSchemas
|
|
6151
|
+
}
|
|
6152
|
+
)
|
|
6153
|
+
).add(
|
|
6154
|
+
HttpApiEndpoint.get("mailchimpTags", "/organizations/:organizationId/mailchimp/audiences/:audienceId/tags", {
|
|
6155
|
+
params: Schema2.Struct({ organizationId: Schema2.String, audienceId: Schema2.String }),
|
|
6156
|
+
success: Schema2.Struct({ tags: Schema2.Array(Schema2.Struct({ id: Schema2.Number, name: Schema2.String })) }),
|
|
6157
|
+
error: CommonErrorSchemas
|
|
6158
|
+
})
|
|
6159
|
+
).add(
|
|
6160
|
+
HttpApiEndpoint.get(
|
|
6161
|
+
"mailchimpFields",
|
|
6162
|
+
"/organizations/:organizationId/mailchimp/audiences/:audienceId/fields",
|
|
6163
|
+
{
|
|
6164
|
+
params: Schema2.Struct({ organizationId: Schema2.String, audienceId: Schema2.String }),
|
|
6165
|
+
success: Schema2.Struct({
|
|
6166
|
+
fields: Schema2.Array(
|
|
6167
|
+
Schema2.Struct({ tag: Schema2.String, name: Schema2.String, type: Schema2.String })
|
|
6168
|
+
)
|
|
6169
|
+
}),
|
|
6170
|
+
error: CommonErrorSchemas
|
|
6171
|
+
}
|
|
6172
|
+
)
|
|
6173
|
+
).add(
|
|
6174
|
+
HttpApiEndpoint.post("testMailchimp", "/organizations/:organizationId/mailchimp/test", {
|
|
6175
|
+
params: OrganizationIdParams,
|
|
6176
|
+
success: Schema2.Struct({ ok: Schema2.Boolean }),
|
|
6177
|
+
error: CommonErrorSchemas
|
|
6178
|
+
})
|
|
6179
|
+
).add(
|
|
6180
|
+
HttpApiEndpoint.post("backfillMailchimp", "/organizations/:organizationId/mailchimp/backfill", {
|
|
6181
|
+
params: OrganizationIdParams,
|
|
6182
|
+
success: Schema2.Struct({ queued: Schema2.Number }),
|
|
6183
|
+
error: CommonErrorSchemas
|
|
6184
|
+
})
|
|
6185
|
+
).add(
|
|
6186
|
+
HttpApiEndpoint.post("retryMailchimp", "/organizations/:organizationId/mailchimp/retry", {
|
|
6187
|
+
params: OrganizationIdParams,
|
|
6188
|
+
success: Schema2.Struct({ queued: Schema2.Number }),
|
|
6189
|
+
error: CommonErrorSchemas
|
|
6190
|
+
})
|
|
6191
|
+
).add(
|
|
6192
|
+
HttpApiEndpoint.delete("disconnectMailchimp", "/organizations/:organizationId/mailchimp", {
|
|
6193
|
+
params: OrganizationIdParams,
|
|
6194
|
+
success: Schema2.Struct({ ok: Schema2.Boolean }),
|
|
6195
|
+
error: CommonErrorSchemas
|
|
6196
|
+
})
|
|
6197
|
+
);
|
|
6198
|
+
var HubApi = HttpApi.make("hub").add(mailchimpGroup).add(authGroup).add(organizationsGroup).add(membersGroup).add(memberPointsGroup).add(vouchersGroup).add(pointProvidersGroup).add(onsiteCallsGroup).add(memberSourcesGroup).add(onsiteAgentsGroup).add(guestsGroup).add(serviceClientsGroup).prefix("/v1").annotateMerge(
|
|
5990
6199
|
OpenApi.annotations({
|
|
5991
6200
|
title: "Spoke Hub API",
|
|
5992
6201
|
version: "1.0.0",
|
|
@@ -6592,6 +6801,7 @@ function makeSpokeClient(hubClient) {
|
|
|
6592
6801
|
searchField: input.searchField,
|
|
6593
6802
|
searchValue: input.searchValue,
|
|
6594
6803
|
name: input.name,
|
|
6804
|
+
email: input.email,
|
|
6595
6805
|
mobilePhone: input.mobilePhone,
|
|
6596
6806
|
memberNumber: input.memberNumber,
|
|
6597
6807
|
dob: input.dob,
|
|
@@ -7078,6 +7288,8 @@ export {
|
|
|
7078
7288
|
ImportedMemberRecordSchema,
|
|
7079
7289
|
InternalServerErrorSchema,
|
|
7080
7290
|
IssuedPrivateKeySchema,
|
|
7291
|
+
MailchimpSettingsInputSchema,
|
|
7292
|
+
MailchimpSettingsSchema,
|
|
7081
7293
|
MarketingPreferencesSchema,
|
|
7082
7294
|
MemberBasicResponseSchema,
|
|
7083
7295
|
MemberBasicSchema,
|
|
@@ -7094,6 +7306,7 @@ export {
|
|
|
7094
7306
|
MemberSeedBatchSchema,
|
|
7095
7307
|
MemberSourceSecretNameSchema,
|
|
7096
7308
|
MemberStatusCreditsSchema,
|
|
7309
|
+
NexusReferenceDataRequestSchema,
|
|
7097
7310
|
NotFoundErrorSchema,
|
|
7098
7311
|
OnsiteAgentCommandSchema,
|
|
7099
7312
|
OnsiteAgentCompleteCustomFieldsSchema,
|
|
@@ -7102,6 +7315,7 @@ export {
|
|
|
7102
7315
|
OnsiteAgentCompleteMemberLookupSchema,
|
|
7103
7316
|
OnsiteAgentCompleteMemberRenewalSchema,
|
|
7104
7317
|
OnsiteAgentCompleteMemberUpdateSchema,
|
|
7318
|
+
OnsiteAgentCompleteReferenceDataSchema,
|
|
7105
7319
|
OnsiteAgentCompleteRunErrorSchema,
|
|
7106
7320
|
OnsiteAgentCompleteRunSchema,
|
|
7107
7321
|
OnsiteAgentCsvUploadTargetSchema,
|
|
@@ -7119,6 +7333,7 @@ export {
|
|
|
7119
7333
|
OnsiteAgentMemberPreferenceUpdateCommandSchema,
|
|
7120
7334
|
OnsiteAgentMemberRenewalCommandSchema,
|
|
7121
7335
|
OnsiteAgentMemberUpdateCommandSchema,
|
|
7336
|
+
OnsiteAgentReferenceDataCommandSchema,
|
|
7122
7337
|
OnsiteAgentRunProgressSchema,
|
|
7123
7338
|
OnsitePointCommandSchema,
|
|
7124
7339
|
OnsiteResourceCallRequestSchema,
|