ODP Node SDK / z
z
Const
object
{
configure: (newConfig: null | InternalConfig | Config) => void;
customer: (payload: CustomerPayload | CustomerPayload[], opts?: PayloadOptions) => Promise<HttpResponse<CustomerResponse>>;
event: (payload: EventPayload | EventPayload[]) => Promise<HttpResponse<EventResponse>>;
graphql: <T>(query: string, variables?: {}) => Promise<GqlHttpResponse<T>>;
identifier: {
getConsent: (identifierName: string, identifierValue: string) => Promise<HttpResponse<GetConsentResponse>>;
getMetadata: (identifierFieldName: string, identifierValue: string) => Promise<HttpResponse<IdentifierMetadataResponse>>;
getReachability: (identifierName: string, value: string) => Promise<HttpResponse<GetReachabilityResponse>>;
updateConsent: (updates: ConsentUpdate | ConsentUpdate[]) => Promise<HttpResponse<V3SuccessResponse>>;
updateMetadata: (updates: IdentifierMetadata | IdentifierMetadata[]) => Promise<HttpResponse<V3SuccessResponse>>;
updateReachability: (updates: ReachabilityUpdate | ReachabilityUpdate[]) => Promise<HttpResponse<V3SuccessResponse>>;
};
list: {
createList: (listName: string) => Promise<HttpResponse<CreateListResponse>>;
getLists: () => Promise<HttpResponse<GetListsResponse>>;
subscribe: (listId: string, identifiers: Identifiers | Identifiers[]) => Promise<HttpResponse<ListUpdateResponse>>;
unsubscribe: (listId: string, identifiers: Identifiers | Identifiers[]) => Promise<HttpResponse<ListUpdateResponse>>;
updateSubscriptions: (listId: string, updates: ListUpdateRequest[]) => Promise<HttpResponse<ListUpdateResponse>>;
};
object: (type: string, payload: ObjectPayload | ObjectPayload[], opts?: PayloadOptions) => Promise<HttpResponse<ObjectResponse>>;
schema: {
ApiFieldExistsError: typeof ApiFieldExistsError;
ApiIdentifierExistsError: typeof ApiIdentifierExistsError;
ApiObjectExistsError: typeof ApiObjectExistsError;
ApiRelationExistsError: typeof ApiRelationExistsError;
ApiSchemaValidationError: typeof ApiSchemaValidationError;
createField: (object: string, field: FieldDefinition) => Promise<HttpResponse<FieldDefinition>>;
createIdentifier: (identifier: IdentifierDefinition) => Promise<HttpResponse<CreateIdentifierResponse>>;
createObject: (object: ObjectDefinition) => Promise<HttpResponse<ObjectDefinition>>;
createRelation: (object: string, relation: RelationDefinition) => Promise<HttpResponse<RelationDefinition>>;
enableModule: (module: string) => Promise<HttpResponse<ModulesResponse>>;
getAllObjects: () => Promise<HttpResponse<ObjectDefinition[]>>;
getEnabledModules: () => Promise<HttpResponse<ModulesResponse>>;
getObject: (name: string) => Promise<HttpResponse<ObjectDefinition>>;
};
v3Api: typeof ApiV3;
}
The preferred export for utilizing the Zaius Node SDK.
Usage
import {z} from '@zaiusinc/node-sdk';
// Send an event to Zaius
await z.event(...);
// Subscribe a customer by an identifier to a list
await z.list.subscribe(...);
// etc
Type declaration
Member | Type | Description |
---|---|---|
configure | (newConfig : null | InternalConfig | Config ) => void | Exposed method to set the configuration options This handled automatically in a Zaius Integration Platform App usage z.configure({...}) |
customer | (payload : CustomerPayload | CustomerPayload [], opts? : PayloadOptions ) => Promise <HttpResponse <CustomerResponse >> | Send a customer or a batch of customers to Zaius.Throws if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
event | (payload : EventPayload | EventPayload []) => Promise <HttpResponse <EventResponse >> | Send an event or a batch of events to ZaiusThrows if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
graphql | <T>(query : string , variables? : {}) => Promise <GqlHttpResponse <T >> | Queries the GraphQL API.Throws if it receives a non-2XX result |
identifier | object | - |
identifier.getConsent | (identifierName : string , identifierValue : string ) => Promise <HttpResponse <GetConsentResponse >> | Get consent information about an identifierThrows if it receives any non-2XX result |
identifier.getMetadata | (identifierFieldName : string , identifierValue : string ) => Promise <HttpResponse <IdentifierMetadataResponse >> | Get metadata for a customer's identifierThrows if it receives any non-2XX result |
identifier.getReachability | (identifierName : string , value : string ) => Promise <HttpResponse <GetReachabilityResponse >> | Get reachability information about an identifier |
identifier.updateConsent | (updates : ConsentUpdate | ConsentUpdate []) => Promise <HttpResponse <V3SuccessResponse >> | Update consent of a messaging identifierThrows if it receives any non-2XX result |
identifier.updateMetadata | (updates : IdentifierMetadata | IdentifierMetadata []) => Promise <HttpResponse <V3SuccessResponse >> | Update metadata for a customer's identifierThrows if it receives any non-2XX result |
identifier.updateReachability | (updates : ReachabilityUpdate | ReachabilityUpdate []) => Promise <HttpResponse <V3SuccessResponse >> | Update reachability of a messaging identifierThrows if it receives any non-2XX result |
list | object | - |
list.createList | (listName : string ) => Promise <HttpResponse <CreateListResponse >> | Create a Zaius marketing list. If the list already exists, you will receive a 400.Throws if it receives any non-2XX result |
list.getLists | () => Promise <HttpResponse <GetListsResponse >> | Get all Zaius marketing lists for the current accountThrows if it receives any non-2XX result |
list.subscribe | (listId : string , identifiers : Identifiers | Identifiers []) => Promise <HttpResponse <ListUpdateResponse >> | Subscribe a customer or array of customers to a listThrows if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
list.unsubscribe | (listId : string , identifiers : Identifiers | Identifiers []) => Promise <HttpResponse <ListUpdateResponse >> | Unsubscribe a customer or array of customers from a listThrows if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
list.updateSubscriptions | (listId : string , updates : ListUpdateRequest []) => Promise <HttpResponse <ListUpdateResponse >> | Bulk update subscriptions for multiple customers to a list (or multiple lists).Throws if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
object | (type : string , payload : ObjectPayload | ObjectPayload [], opts? : PayloadOptions ) => Promise <HttpResponse <ObjectResponse >> | Send an object or a batch of objects to ZaiusThrows if it receives a non-2XX result or if the batch size is > BATCH_LIMIT |
schema | object | - |
schema.ApiFieldExistsError | typeof ApiFieldExistsError | - |
schema.ApiIdentifierExistsError | typeof ApiIdentifierExistsError | - |
schema.ApiObjectExistsError | typeof ApiObjectExistsError | - |
schema.ApiRelationExistsError | typeof ApiRelationExistsError | - |
schema.ApiSchemaValidationError | typeof ApiSchemaValidationError | - |
schema.createField | (object : string , field : FieldDefinition ) => Promise <HttpResponse <FieldDefinition >> | Create a custom field on a Zaius objectThrows if the field name already exists Throws if it receives any other non-2XX result |
schema.createIdentifier | (identifier : IdentifierDefinition ) => Promise <HttpResponse <CreateIdentifierResponse >> | Create a customer identifierThrows if the identifier already exists Throws if it receives any other non-2XX result |
schema.createObject | (object : ObjectDefinition ) => Promise <HttpResponse <ObjectDefinition >> | Create a custom Zaius objectThrows if the object name already exists Throws if it receives any other non-2XX result |
schema.createRelation | (object : string , relation : RelationDefinition ) => Promise <HttpResponse <RelationDefinition >> | Create a custom Zaius relation between two objectsThrows if the relation name is already in use by another field or relation Throws if it receives any other non-2XX result |
schema.enableModule | (module : string ) => Promise <HttpResponse <ModulesResponse >> | Enables a schema module.Throws if the module was already enabled Throws if it receives any other non-2XX result |
schema.getAllObjects | () => Promise <HttpResponse <ObjectDefinition []>> | Gets the definitions of all Zaius objects.Throws if it receives a non-2XX result |
schema.getEnabledModules | () => Promise <HttpResponse <ModulesResponse >> | Gets the list of enabled schema modules.Throws if it receives a non-2XX result |
schema.getObject | (name : string ) => Promise <HttpResponse <ObjectDefinition >> | Gets the definition of a Zaius object.Throws if there is no object with the given name Throws if it receives any other non-2XX result |
v3Api | typeof ApiV3 | Direct access to query any API by path using the v3 API helper |
Defined in: src/Api/index.ts:26
Updated about 1 month ago