@spoketech/hub-client 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +2980 -352
- package/dist/index.js +135 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,8 +91,10 @@ var organizationMemberSyncTransports = [
|
|
|
91
91
|
var organizationMemberSourceCommandKinds = [
|
|
92
92
|
"create_member",
|
|
93
93
|
"update_member",
|
|
94
|
+
"update_preferences",
|
|
94
95
|
"renew_member",
|
|
95
|
-
"lookup_member"
|
|
96
|
+
"lookup_member",
|
|
97
|
+
"list_custom_fields"
|
|
96
98
|
];
|
|
97
99
|
var organizationMemberSourceCommandStatuses = [
|
|
98
100
|
"requested",
|
|
@@ -205,12 +207,16 @@ var MarketingPreferencesSchema = Schema2.Struct({
|
|
|
205
207
|
email: Schema2.Boolean,
|
|
206
208
|
sms: Schema2.Boolean,
|
|
207
209
|
post: Schema2.Boolean,
|
|
210
|
+
gamingEmail: Schema2.Boolean,
|
|
211
|
+
gamingSms: Schema2.Boolean,
|
|
208
212
|
gamingOptOut: Schema2.Boolean
|
|
209
213
|
});
|
|
210
214
|
var MarketingPreferencesInputSchema = Schema2.Struct({
|
|
211
215
|
email: Schema2.optional(Schema2.Boolean),
|
|
212
216
|
sms: Schema2.optional(Schema2.Boolean),
|
|
213
217
|
post: Schema2.optional(Schema2.Boolean),
|
|
218
|
+
gamingEmail: Schema2.optional(Schema2.Boolean),
|
|
219
|
+
gamingSms: Schema2.optional(Schema2.Boolean),
|
|
214
220
|
gamingOptOut: Schema2.optional(Schema2.Boolean)
|
|
215
221
|
});
|
|
216
222
|
var OrganizationSchema = Schema2.Struct({
|
|
@@ -2503,7 +2509,7 @@ var OrganizationMemberSourceCommandSchema = Schema2.Struct({
|
|
|
2503
2509
|
organizationId: Schema2.String,
|
|
2504
2510
|
organizationMemberSourceId: Schema2.String,
|
|
2505
2511
|
organizationMemberSourceAgentId: Schema2.Union(Schema2.String, Schema2.Null),
|
|
2506
|
-
kind: Schema2.Literal(
|
|
2512
|
+
kind: Schema2.Literal(...organizationMemberSourceCommandKinds),
|
|
2507
2513
|
status: Schema2.Literal(...organizationMemberSourceCommandStatuses),
|
|
2508
2514
|
payload: JsonObjectSchema,
|
|
2509
2515
|
result: Schema2.Union(JsonObjectSchema, Schema2.Null),
|
|
@@ -2575,6 +2581,8 @@ var CsvMemberFieldMappingSchema = Schema2.Struct({
|
|
|
2575
2581
|
marketingEmail: OptionalNullableString,
|
|
2576
2582
|
marketingSms: OptionalNullableString,
|
|
2577
2583
|
marketingPost: OptionalNullableString,
|
|
2584
|
+
gamingEmail: OptionalNullableString,
|
|
2585
|
+
gamingSms: OptionalNullableString,
|
|
2578
2586
|
expiresAt: OptionalNullableString,
|
|
2579
2587
|
sourceUpdatedAt: OptionalNullableString
|
|
2580
2588
|
});
|
|
@@ -2848,6 +2856,10 @@ var TriggerOrganizationMemberSyncSchema = Schema2.Struct({
|
|
|
2848
2856
|
});
|
|
2849
2857
|
var RequestSourceManagedMemberCreateSchema = CreateMemberSchema;
|
|
2850
2858
|
var RequestSourceManagedMemberUpdateSchema = UpdateMemberSchema;
|
|
2859
|
+
var RequestSourceManagedMemberPreferenceUpdateSchema = Schema2.Struct({
|
|
2860
|
+
expectedUpdatedAt: TimestampSchema,
|
|
2861
|
+
marketingPreferences: MarketingPreferencesInputSchema
|
|
2862
|
+
});
|
|
2851
2863
|
var RequestSourceManagedMemberRenewalSchema = Schema2.Struct({
|
|
2852
2864
|
expectedUpdatedAt: Schema2.optional(Schema2.Union(TimestampSchema, Schema2.Null))
|
|
2853
2865
|
});
|
|
@@ -2858,7 +2870,8 @@ var SourceManagedMemberLookupBySchema = Schema2.Literal(
|
|
|
2858
2870
|
);
|
|
2859
2871
|
var SourceManagedMemberLookupCommandPayloadSchema = Schema2.Struct({
|
|
2860
2872
|
lookupBy: SourceManagedMemberLookupBySchema,
|
|
2861
|
-
lookupValue: Schema2.String
|
|
2873
|
+
lookupValue: Schema2.String,
|
|
2874
|
+
refreshStoredMember: Schema2.optional(Schema2.Boolean)
|
|
2862
2875
|
});
|
|
2863
2876
|
var SourceManagedMemberRenewalCommandPayloadSchema = Schema2.Struct({
|
|
2864
2877
|
memberId: Schema2.String,
|
|
@@ -2866,6 +2879,12 @@ var SourceManagedMemberRenewalCommandPayloadSchema = Schema2.Struct({
|
|
|
2866
2879
|
memberNumber: OptionalNullableString,
|
|
2867
2880
|
previousExpiresAt: Schema2.optional(Schema2.Union(TimestampSchema, Schema2.Null))
|
|
2868
2881
|
});
|
|
2882
|
+
var SourceManagedMemberPreferenceUpdateCommandPayloadSchema = Schema2.Struct({
|
|
2883
|
+
memberId: Schema2.String,
|
|
2884
|
+
externalSystemMemberId: Schema2.String,
|
|
2885
|
+
expectedUpdatedAt: TimestampSchema,
|
|
2886
|
+
marketingPreferences: MarketingPreferencesInputSchema
|
|
2887
|
+
});
|
|
2869
2888
|
var OnsiteResourceCallWaitMsSchema = Schema2.optional(
|
|
2870
2889
|
Schema2.Number.annotations({
|
|
2871
2890
|
description: "How long Hub should wait for the onsite client to complete the command before returning the accepted command.",
|
|
@@ -3074,6 +3093,17 @@ var OnsiteAgentMemberUpdateCommandSchema = Schema2.Struct({
|
|
|
3074
3093
|
config: JsonObjectSchema,
|
|
3075
3094
|
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3076
3095
|
});
|
|
3096
|
+
var OnsiteAgentMemberPreferenceUpdateCommandSchema = Schema2.Struct({
|
|
3097
|
+
commandId: Schema2.String,
|
|
3098
|
+
organizationId: Schema2.String,
|
|
3099
|
+
organizationMemberSourceId: Schema2.String,
|
|
3100
|
+
vendor: Schema2.Literal(...organizationMemberSourceVendors),
|
|
3101
|
+
connectorType: Schema2.Literal(...organizationMemberSourceVendors),
|
|
3102
|
+
requestedAt: TimestampSchema,
|
|
3103
|
+
payload: SourceManagedMemberPreferenceUpdateCommandPayloadSchema,
|
|
3104
|
+
config: JsonObjectSchema,
|
|
3105
|
+
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3106
|
+
});
|
|
3077
3107
|
var OnsiteAgentMemberRenewalCommandSchema = Schema2.Struct({
|
|
3078
3108
|
commandId: Schema2.String,
|
|
3079
3109
|
organizationId: Schema2.String,
|
|
@@ -3096,6 +3126,17 @@ var OnsiteAgentMemberLookupCommandSchema = Schema2.Struct({
|
|
|
3096
3126
|
config: JsonObjectSchema,
|
|
3097
3127
|
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3098
3128
|
});
|
|
3129
|
+
var OnsiteAgentCustomFieldsCommandSchema = Schema2.Struct({
|
|
3130
|
+
commandId: Schema2.String,
|
|
3131
|
+
organizationId: Schema2.String,
|
|
3132
|
+
organizationMemberSourceId: Schema2.String,
|
|
3133
|
+
vendor: Schema2.Literal(...organizationMemberSourceVendors),
|
|
3134
|
+
connectorType: Schema2.Literal(...organizationMemberSourceVendors),
|
|
3135
|
+
requestedAt: TimestampSchema,
|
|
3136
|
+
payload: JsonObjectSchema,
|
|
3137
|
+
config: JsonObjectSchema,
|
|
3138
|
+
secrets: Schema2.Array(OrganizationMemberSourceSecretInputSchema)
|
|
3139
|
+
});
|
|
3099
3140
|
var OnsiteAgentHeartbeatSchema = Schema2.Struct({
|
|
3100
3141
|
version: Schema2.String,
|
|
3101
3142
|
pollingIntervalSeconds: Schema2.optional(Schema2.Number),
|
|
@@ -3165,6 +3206,11 @@ var OnsiteAgentCompleteMemberLookupSchema = Schema2.Struct({
|
|
|
3165
3206
|
rawRecord: Schema2.optional(JsonObjectSchema),
|
|
3166
3207
|
errorMessage: OptionalNullableString
|
|
3167
3208
|
});
|
|
3209
|
+
var OnsiteAgentCompleteCustomFieldsSchema = Schema2.Struct({
|
|
3210
|
+
customFields: Schema2.optional(Schema2.Array(JsonObjectSchema)),
|
|
3211
|
+
rawRecord: Schema2.optional(JsonObjectSchema),
|
|
3212
|
+
errorMessage: OptionalNullableString
|
|
3213
|
+
});
|
|
3168
3214
|
var OnsiteAgentIngestLiveFbiBatchSchema = Schema2.Struct({
|
|
3169
3215
|
sourceFileName: OptionalNullableString,
|
|
3170
3216
|
metadata: Schema2.optional(JsonObjectSchema),
|
|
@@ -3437,6 +3483,15 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
3437
3483
|
transform: sourceManagedUpdateExamplesTransform
|
|
3438
3484
|
})
|
|
3439
3485
|
)
|
|
3486
|
+
).add(
|
|
3487
|
+
HttpApiEndpoint.post(
|
|
3488
|
+
"requestSourceManagedMemberPreferenceUpdate",
|
|
3489
|
+
"/organizations/:organizationId/members/:memberId/source-preferences"
|
|
3490
|
+
).setPath(OrganizationMemberParams).setPayload(RequestSourceManagedMemberPreferenceUpdateSchema).addSuccess(OrganizationMemberSourceCommandSchema, { status: 202 }).annotateContext(
|
|
3491
|
+
OpenApi.annotations({
|
|
3492
|
+
summary: "Request member marketing preference update via the configured upstream source"
|
|
3493
|
+
})
|
|
3494
|
+
)
|
|
3440
3495
|
).add(
|
|
3441
3496
|
HttpApiEndpoint.post(
|
|
3442
3497
|
"requestSourceManagedMemberLookupById",
|
|
@@ -3464,6 +3519,15 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
3464
3519
|
summary: "Request upstream member lookup by card number"
|
|
3465
3520
|
})
|
|
3466
3521
|
)
|
|
3522
|
+
).add(
|
|
3523
|
+
HttpApiEndpoint.post(
|
|
3524
|
+
"requestSourceManagedCustomFields",
|
|
3525
|
+
"/organizations/:organizationId/member-source/custom-fields"
|
|
3526
|
+
).setPath(OrganizationIdParams).addSuccess(OrganizationMemberSourceCommandSchema, { status: 202 }).annotateContext(
|
|
3527
|
+
OpenApi.annotations({
|
|
3528
|
+
summary: "Request upstream custom field definitions from the configured source"
|
|
3529
|
+
})
|
|
3530
|
+
)
|
|
3467
3531
|
).add(
|
|
3468
3532
|
HttpApiEndpoint.patch(
|
|
3469
3533
|
"updateOrganizationMember",
|
|
@@ -3813,6 +3877,15 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3813
3877
|
summary: "Poll for the next pending onsite member-renewal command"
|
|
3814
3878
|
})
|
|
3815
3879
|
)
|
|
3880
|
+
).add(
|
|
3881
|
+
HttpApiEndpoint.post(
|
|
3882
|
+
"pollOnsiteAgentMemberPreferenceUpdateCommand",
|
|
3883
|
+
"/onsite-agent/member-preference-commands/poll"
|
|
3884
|
+
).addSuccess(Schema2.Union(OnsiteAgentMemberPreferenceUpdateCommandSchema, Schema2.Null)).annotateContext(
|
|
3885
|
+
OpenApi.annotations({
|
|
3886
|
+
summary: "Poll for the next pending onsite member preference update command"
|
|
3887
|
+
})
|
|
3888
|
+
)
|
|
3816
3889
|
).add(
|
|
3817
3890
|
HttpApiEndpoint.post(
|
|
3818
3891
|
"pollOnsiteAgentMemberLookupCommand",
|
|
@@ -3822,6 +3895,15 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3822
3895
|
summary: "Poll for the next pending onsite member-lookup command"
|
|
3823
3896
|
})
|
|
3824
3897
|
)
|
|
3898
|
+
).add(
|
|
3899
|
+
HttpApiEndpoint.post(
|
|
3900
|
+
"pollOnsiteAgentCustomFieldsCommand",
|
|
3901
|
+
"/onsite-agent/custom-fields-commands/poll"
|
|
3902
|
+
).addSuccess(Schema2.Union(OnsiteAgentCustomFieldsCommandSchema, Schema2.Null)).annotateContext(
|
|
3903
|
+
OpenApi.annotations({
|
|
3904
|
+
summary: "Poll for the next pending onsite custom-fields command"
|
|
3905
|
+
})
|
|
3906
|
+
)
|
|
3825
3907
|
).add(
|
|
3826
3908
|
HttpApiEndpoint.post("completeOnsiteAgentRun", "/onsite-agent/runs/:runId/complete").setPath(OrganizationMemberSyncRunParams).setPayload(OnsiteAgentCompleteRunSchema).addSuccess(OrganizationMemberSyncRunSchema).annotateContext(
|
|
3827
3909
|
OpenApi.annotations({ summary: "Submit onsite agent sync results for a claimed run" })
|
|
@@ -3852,6 +3934,19 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3852
3934
|
summary: "Submit onsite agent member-update results for a claimed command"
|
|
3853
3935
|
})
|
|
3854
3936
|
)
|
|
3937
|
+
).add(
|
|
3938
|
+
HttpApiEndpoint.post(
|
|
3939
|
+
"completeOnsiteAgentMemberPreferenceUpdate",
|
|
3940
|
+
"/onsite-agent/member-preference-commands/:commandId/complete"
|
|
3941
|
+
).setPath(
|
|
3942
|
+
Schema2.Struct({
|
|
3943
|
+
commandId: HttpApiSchema2.param("commandId", Schema2.String)
|
|
3944
|
+
})
|
|
3945
|
+
).setPayload(OnsiteAgentCompleteMemberUpdateSchema).addSuccess(OrganizationMemberSourceCommandSchema).annotateContext(
|
|
3946
|
+
OpenApi.annotations({
|
|
3947
|
+
summary: "Submit onsite agent member preference update results for a claimed command"
|
|
3948
|
+
})
|
|
3949
|
+
)
|
|
3855
3950
|
).add(
|
|
3856
3951
|
HttpApiEndpoint.post(
|
|
3857
3952
|
"completeOnsiteAgentMemberLookup",
|
|
@@ -3878,6 +3973,19 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
3878
3973
|
summary: "Submit onsite agent member-renewal results for a claimed command"
|
|
3879
3974
|
})
|
|
3880
3975
|
)
|
|
3976
|
+
).add(
|
|
3977
|
+
HttpApiEndpoint.post(
|
|
3978
|
+
"completeOnsiteAgentCustomFields",
|
|
3979
|
+
"/onsite-agent/custom-fields-commands/:commandId/complete"
|
|
3980
|
+
).setPath(
|
|
3981
|
+
Schema2.Struct({
|
|
3982
|
+
commandId: HttpApiSchema2.param("commandId", Schema2.String)
|
|
3983
|
+
})
|
|
3984
|
+
).setPayload(OnsiteAgentCompleteCustomFieldsSchema).addSuccess(OrganizationMemberSourceCommandSchema).annotateContext(
|
|
3985
|
+
OpenApi.annotations({
|
|
3986
|
+
summary: "Submit onsite agent custom field definitions for a claimed command"
|
|
3987
|
+
})
|
|
3988
|
+
)
|
|
3881
3989
|
);
|
|
3882
3990
|
var guestsGroup = HttpApiGroup.make("guests").add(
|
|
3883
3991
|
HttpApiEndpoint.get("listGuests", "/organizations/:organizationId/guests").setPath(OrganizationIdParams).setUrlParams(GuestsListUrlParamsSchema).addSuccess(PaginatedGuestsSchema).annotateContext(
|
|
@@ -4357,7 +4465,8 @@ function makeOnsiteResourceClient(client) {
|
|
|
4357
4465
|
operation: "member.lookup",
|
|
4358
4466
|
payload: {
|
|
4359
4467
|
lookupBy: input.lookupBy,
|
|
4360
|
-
lookupValue: input.lookupValue
|
|
4468
|
+
lookupValue: input.lookupValue,
|
|
4469
|
+
refreshStoredMember: input.refreshStoredMember === true ? true : void 0
|
|
4361
4470
|
}
|
|
4362
4471
|
})
|
|
4363
4472
|
},
|
|
@@ -4613,6 +4722,15 @@ function makeSpokeClient(hubClient) {
|
|
|
4613
4722
|
payload: input.payload
|
|
4614
4723
|
})
|
|
4615
4724
|
),
|
|
4725
|
+
updatePreferences: (input) => unwrap(
|
|
4726
|
+
hubClient.members.requestSourceManagedMemberPreferenceUpdate({
|
|
4727
|
+
path: {
|
|
4728
|
+
organizationId: input.organizationId,
|
|
4729
|
+
memberId: input.memberId
|
|
4730
|
+
},
|
|
4731
|
+
payload: input.payload
|
|
4732
|
+
})
|
|
4733
|
+
),
|
|
4616
4734
|
renew: (input) => unwrap(
|
|
4617
4735
|
hubClient.members.requestSourceManagedMemberRenewal({
|
|
4618
4736
|
path: {
|
|
@@ -4651,7 +4769,14 @@ function makeSpokeClient(hubClient) {
|
|
|
4651
4769
|
}
|
|
4652
4770
|
})
|
|
4653
4771
|
);
|
|
4654
|
-
}
|
|
4772
|
+
},
|
|
4773
|
+
customFields: (input) => unwrap(
|
|
4774
|
+
hubClient.members.requestSourceManagedCustomFields({
|
|
4775
|
+
path: {
|
|
4776
|
+
organizationId: input.organizationId
|
|
4777
|
+
}
|
|
4778
|
+
})
|
|
4779
|
+
)
|
|
4655
4780
|
}
|
|
4656
4781
|
},
|
|
4657
4782
|
memberSources: {
|
|
@@ -4931,6 +5056,7 @@ export {
|
|
|
4931
5056
|
MemberStatusCreditsSchema,
|
|
4932
5057
|
NotFoundErrorSchema,
|
|
4933
5058
|
OnsiteAgentCommandSchema,
|
|
5059
|
+
OnsiteAgentCompleteCustomFieldsSchema,
|
|
4934
5060
|
OnsiteAgentCompleteMemberCreateSchema,
|
|
4935
5061
|
OnsiteAgentCompleteMemberLookupSchema,
|
|
4936
5062
|
OnsiteAgentCompleteMemberRenewalSchema,
|
|
@@ -4938,11 +5064,13 @@ export {
|
|
|
4938
5064
|
OnsiteAgentCompleteRunErrorSchema,
|
|
4939
5065
|
OnsiteAgentCompleteRunSchema,
|
|
4940
5066
|
OnsiteAgentCsvUploadTargetSchema,
|
|
5067
|
+
OnsiteAgentCustomFieldsCommandSchema,
|
|
4941
5068
|
OnsiteAgentHeartbeatResponseSchema,
|
|
4942
5069
|
OnsiteAgentHeartbeatSchema,
|
|
4943
5070
|
OnsiteAgentIngestLiveFbiBatchSchema,
|
|
4944
5071
|
OnsiteAgentMemberCreateCommandSchema,
|
|
4945
5072
|
OnsiteAgentMemberLookupCommandSchema,
|
|
5073
|
+
OnsiteAgentMemberPreferenceUpdateCommandSchema,
|
|
4946
5074
|
OnsiteAgentMemberRenewalCommandSchema,
|
|
4947
5075
|
OnsiteAgentMemberUpdateCommandSchema,
|
|
4948
5076
|
OnsitePointCommandSchema,
|
|
@@ -5006,6 +5134,7 @@ export {
|
|
|
5006
5134
|
RequestPointDebitSchema,
|
|
5007
5135
|
RequestPointLookupSchema,
|
|
5008
5136
|
RequestSourceManagedMemberCreateSchema,
|
|
5137
|
+
RequestSourceManagedMemberPreferenceUpdateSchema,
|
|
5009
5138
|
RequestSourceManagedMemberRenewalSchema,
|
|
5010
5139
|
RequestSourceManagedMemberUpdateSchema,
|
|
5011
5140
|
RequestVoucherIssueSchema,
|
|
@@ -5014,6 +5143,7 @@ export {
|
|
|
5014
5143
|
SortDirectionSchema,
|
|
5015
5144
|
SourceManagedMemberLookupBySchema,
|
|
5016
5145
|
SourceManagedMemberLookupCommandPayloadSchema,
|
|
5146
|
+
SourceManagedMemberPreferenceUpdateCommandPayloadSchema,
|
|
5017
5147
|
SourceManagedMemberRenewalCommandPayloadSchema,
|
|
5018
5148
|
SourceManagedMemberUpdateCommandPayloadSchema,
|
|
5019
5149
|
SpokeHubApiError,
|