skapi-js 1.5.9 → 1.6.1
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/skapi.browser.mjs +6 -6
- package/dist/skapi.browser.mjs.map +1 -1
- package/dist/skapi.cjs +6 -6
- package/dist/skapi.cjs.map +1 -1
- package/dist/skapi.d.mts +64 -16
- package/dist/skapi.d.ts +64 -16
- package/dist/skapi.js +6 -6
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.mjs +6 -6
- package/dist/skapi.mjs.map +1 -1
- package/package.json +2 -2
package/dist/skapi.d.mts
CHANGED
|
@@ -467,14 +467,21 @@ type FetchOptions = {
|
|
|
467
467
|
/** Callback for database request progress. Useful when building progress bar. */
|
|
468
468
|
progress?: ProgressCallback;
|
|
469
469
|
};
|
|
470
|
-
type
|
|
470
|
+
type RequestHistory = {
|
|
471
|
+
id: string;
|
|
472
|
+
status_code: number;
|
|
471
473
|
response_body: any;
|
|
472
|
-
error
|
|
474
|
+
error?: any;
|
|
473
475
|
updated: number;
|
|
474
476
|
request_body: any;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
expires?: number;
|
|
478
|
+
status: 'pending' | 'running' | 'resolved' | 'failed';
|
|
479
|
+
queue_name?: string;
|
|
480
|
+
poll?: (arg?: {
|
|
481
|
+
latency?: number;
|
|
482
|
+
onResponse?: (res: any) => void;
|
|
483
|
+
onError?: (err: any) => void;
|
|
484
|
+
}) => Promise<any>;
|
|
478
485
|
};
|
|
479
486
|
type DatabaseResponse<T> = {
|
|
480
487
|
list: T[];
|
|
@@ -502,6 +509,12 @@ type ConnectionInfo = {
|
|
|
502
509
|
service_description: string;
|
|
503
510
|
version: string;
|
|
504
511
|
ai_agent: string;
|
|
512
|
+
conf: {
|
|
513
|
+
freeze_database: boolean;
|
|
514
|
+
prevent_signup: boolean;
|
|
515
|
+
prevent_inquiry: boolean;
|
|
516
|
+
prevent_anonymous: boolean;
|
|
517
|
+
};
|
|
505
518
|
};
|
|
506
519
|
type Table = {
|
|
507
520
|
table: string;
|
|
@@ -556,7 +569,6 @@ type Types_Form<T> = Form<T>;
|
|
|
556
569
|
type Types_GetRecordQuery = GetRecordQuery;
|
|
557
570
|
type Types_Index = Index;
|
|
558
571
|
type Types_Newsletter = Newsletter;
|
|
559
|
-
type Types_PollingResult = PollingResult;
|
|
560
572
|
type Types_PostRecordConfig = PostRecordConfig;
|
|
561
573
|
type Types_ProgressCallback = ProgressCallback;
|
|
562
574
|
type Types_RTCConnector = RTCConnector;
|
|
@@ -566,6 +578,7 @@ type Types_RTCReceiverParams = RTCReceiverParams;
|
|
|
566
578
|
type Types_RTCResolved = RTCResolved;
|
|
567
579
|
type Types_RealtimeCallback = RealtimeCallback;
|
|
568
580
|
type Types_RecordData = RecordData;
|
|
581
|
+
type Types_RequestHistory = RequestHistory;
|
|
569
582
|
type Types_Subscription = Subscription;
|
|
570
583
|
type Types_Table = Table;
|
|
571
584
|
type Types_Tag = Tag;
|
|
@@ -575,7 +588,7 @@ type Types_UserProfile = UserProfile;
|
|
|
575
588
|
type Types_UserPublic = UserPublic;
|
|
576
589
|
type Types_WebSocketMessage = WebSocketMessage;
|
|
577
590
|
declare namespace Types {
|
|
578
|
-
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter,
|
|
591
|
+
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
579
592
|
}
|
|
580
593
|
|
|
581
594
|
declare function terminatePendingRequests(): void;
|
|
@@ -861,14 +874,11 @@ declare class Skapi {
|
|
|
861
874
|
/**
|
|
862
875
|
* Sends a secure outbound request using a Skapi client secret key.
|
|
863
876
|
* @param params Request parameters.
|
|
864
|
-
* @returns A promise that resolves to
|
|
877
|
+
* @returns A promise that resolves to the final API response, or to a status object when the request is queued.
|
|
865
878
|
*/
|
|
866
879
|
clientSecretRequest(params: {
|
|
867
880
|
url: string;
|
|
868
881
|
clientSecretName: string;
|
|
869
|
-
poll?: number;
|
|
870
|
-
expires?: number;
|
|
871
|
-
queue?: string;
|
|
872
882
|
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
873
883
|
headers?: {
|
|
874
884
|
[key: string]: string;
|
|
@@ -879,20 +889,58 @@ declare class Skapi {
|
|
|
879
889
|
params?: {
|
|
880
890
|
[key: string]: string;
|
|
881
891
|
};
|
|
882
|
-
|
|
892
|
+
poll?: number;
|
|
893
|
+
queue?: string;
|
|
894
|
+
expires?: number;
|
|
895
|
+
onResponse?: (res: any) => void;
|
|
896
|
+
onError?: (err: any) => void;
|
|
897
|
+
}): Promise<any | {
|
|
898
|
+
id: string;
|
|
899
|
+
status: 'running' | 'pending';
|
|
900
|
+
queue_name: string;
|
|
901
|
+
in_queue: number;
|
|
902
|
+
poll?: (arg?: {
|
|
903
|
+
latency?: number;
|
|
904
|
+
}) => void;
|
|
905
|
+
}>;
|
|
883
906
|
/**
|
|
884
907
|
* Retrieves the history of client secret requests for a given URL and method.
|
|
885
908
|
* @param params Request parameters.
|
|
886
909
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
887
|
-
* @returns A promise that resolves to
|
|
910
|
+
* @returns A promise that resolves to a paginated list of request history items.
|
|
888
911
|
*/
|
|
889
912
|
clientSecretRequestHistory(params: {
|
|
890
913
|
url: string;
|
|
891
914
|
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
892
|
-
poll?: number;
|
|
893
915
|
queue?: string;
|
|
894
|
-
|
|
895
|
-
|
|
916
|
+
status?: 'pending' | 'running' | 'resolved' | 'failed';
|
|
917
|
+
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RequestHistory[]>>;
|
|
918
|
+
/**
|
|
919
|
+
* Cancels a pending client secret request and removes it from the client-side queue if applicable.
|
|
920
|
+
* @param params Request parameters.
|
|
921
|
+
* @returns A promise that resolves to a result object with removed status and message.
|
|
922
|
+
*/
|
|
923
|
+
cancelClientSecretRequest(params: {
|
|
924
|
+
url: string;
|
|
925
|
+
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
926
|
+
id: string;
|
|
927
|
+
queue?: string;
|
|
928
|
+
}): Promise<{
|
|
929
|
+
removed: boolean;
|
|
930
|
+
message: string;
|
|
931
|
+
}>;
|
|
932
|
+
/**
|
|
933
|
+
* Returns the number of requests currently waiting in a named client secret request queue.
|
|
934
|
+
* @param params Request parameters.
|
|
935
|
+
* @returns A promise that resolves to queue count information.
|
|
936
|
+
*/
|
|
937
|
+
clientSecretRequestQueueCount(params: {
|
|
938
|
+
queue: string;
|
|
939
|
+
service?: string;
|
|
940
|
+
owner?: string;
|
|
941
|
+
}): Promise<{
|
|
942
|
+
queue_name: string;
|
|
943
|
+
in_queue: number;
|
|
896
944
|
}>;
|
|
897
945
|
/**
|
|
898
946
|
* Consumes a one-time ticket and executes the ticketed request payload.
|
package/dist/skapi.d.ts
CHANGED
|
@@ -467,14 +467,21 @@ type FetchOptions = {
|
|
|
467
467
|
/** Callback for database request progress. Useful when building progress bar. */
|
|
468
468
|
progress?: ProgressCallback;
|
|
469
469
|
};
|
|
470
|
-
type
|
|
470
|
+
type RequestHistory = {
|
|
471
|
+
id: string;
|
|
472
|
+
status_code: number;
|
|
471
473
|
response_body: any;
|
|
472
|
-
error
|
|
474
|
+
error?: any;
|
|
473
475
|
updated: number;
|
|
474
476
|
request_body: any;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
expires?: number;
|
|
478
|
+
status: 'pending' | 'running' | 'resolved' | 'failed';
|
|
479
|
+
queue_name?: string;
|
|
480
|
+
poll?: (arg?: {
|
|
481
|
+
latency?: number;
|
|
482
|
+
onResponse?: (res: any) => void;
|
|
483
|
+
onError?: (err: any) => void;
|
|
484
|
+
}) => Promise<any>;
|
|
478
485
|
};
|
|
479
486
|
type DatabaseResponse<T> = {
|
|
480
487
|
list: T[];
|
|
@@ -502,6 +509,12 @@ type ConnectionInfo = {
|
|
|
502
509
|
service_description: string;
|
|
503
510
|
version: string;
|
|
504
511
|
ai_agent: string;
|
|
512
|
+
conf: {
|
|
513
|
+
freeze_database: boolean;
|
|
514
|
+
prevent_signup: boolean;
|
|
515
|
+
prevent_inquiry: boolean;
|
|
516
|
+
prevent_anonymous: boolean;
|
|
517
|
+
};
|
|
505
518
|
};
|
|
506
519
|
type Table = {
|
|
507
520
|
table: string;
|
|
@@ -556,7 +569,6 @@ type Types_Form<T> = Form<T>;
|
|
|
556
569
|
type Types_GetRecordQuery = GetRecordQuery;
|
|
557
570
|
type Types_Index = Index;
|
|
558
571
|
type Types_Newsletter = Newsletter;
|
|
559
|
-
type Types_PollingResult = PollingResult;
|
|
560
572
|
type Types_PostRecordConfig = PostRecordConfig;
|
|
561
573
|
type Types_ProgressCallback = ProgressCallback;
|
|
562
574
|
type Types_RTCConnector = RTCConnector;
|
|
@@ -566,6 +578,7 @@ type Types_RTCReceiverParams = RTCReceiverParams;
|
|
|
566
578
|
type Types_RTCResolved = RTCResolved;
|
|
567
579
|
type Types_RealtimeCallback = RealtimeCallback;
|
|
568
580
|
type Types_RecordData = RecordData;
|
|
581
|
+
type Types_RequestHistory = RequestHistory;
|
|
569
582
|
type Types_Subscription = Subscription;
|
|
570
583
|
type Types_Table = Table;
|
|
571
584
|
type Types_Tag = Tag;
|
|
@@ -575,7 +588,7 @@ type Types_UserProfile = UserProfile;
|
|
|
575
588
|
type Types_UserPublic = UserPublic;
|
|
576
589
|
type Types_WebSocketMessage = WebSocketMessage;
|
|
577
590
|
declare namespace Types {
|
|
578
|
-
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter,
|
|
591
|
+
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
579
592
|
}
|
|
580
593
|
|
|
581
594
|
declare function terminatePendingRequests(): void;
|
|
@@ -861,14 +874,11 @@ declare class Skapi {
|
|
|
861
874
|
/**
|
|
862
875
|
* Sends a secure outbound request using a Skapi client secret key.
|
|
863
876
|
* @param params Request parameters.
|
|
864
|
-
* @returns A promise that resolves to
|
|
877
|
+
* @returns A promise that resolves to the final API response, or to a status object when the request is queued.
|
|
865
878
|
*/
|
|
866
879
|
clientSecretRequest(params: {
|
|
867
880
|
url: string;
|
|
868
881
|
clientSecretName: string;
|
|
869
|
-
poll?: number;
|
|
870
|
-
expires?: number;
|
|
871
|
-
queue?: string;
|
|
872
882
|
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
873
883
|
headers?: {
|
|
874
884
|
[key: string]: string;
|
|
@@ -879,20 +889,58 @@ declare class Skapi {
|
|
|
879
889
|
params?: {
|
|
880
890
|
[key: string]: string;
|
|
881
891
|
};
|
|
882
|
-
|
|
892
|
+
poll?: number;
|
|
893
|
+
queue?: string;
|
|
894
|
+
expires?: number;
|
|
895
|
+
onResponse?: (res: any) => void;
|
|
896
|
+
onError?: (err: any) => void;
|
|
897
|
+
}): Promise<any | {
|
|
898
|
+
id: string;
|
|
899
|
+
status: 'running' | 'pending';
|
|
900
|
+
queue_name: string;
|
|
901
|
+
in_queue: number;
|
|
902
|
+
poll?: (arg?: {
|
|
903
|
+
latency?: number;
|
|
904
|
+
}) => void;
|
|
905
|
+
}>;
|
|
883
906
|
/**
|
|
884
907
|
* Retrieves the history of client secret requests for a given URL and method.
|
|
885
908
|
* @param params Request parameters.
|
|
886
909
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
887
|
-
* @returns A promise that resolves to
|
|
910
|
+
* @returns A promise that resolves to a paginated list of request history items.
|
|
888
911
|
*/
|
|
889
912
|
clientSecretRequestHistory(params: {
|
|
890
913
|
url: string;
|
|
891
914
|
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
892
|
-
poll?: number;
|
|
893
915
|
queue?: string;
|
|
894
|
-
|
|
895
|
-
|
|
916
|
+
status?: 'pending' | 'running' | 'resolved' | 'failed';
|
|
917
|
+
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<RequestHistory[]>>;
|
|
918
|
+
/**
|
|
919
|
+
* Cancels a pending client secret request and removes it from the client-side queue if applicable.
|
|
920
|
+
* @param params Request parameters.
|
|
921
|
+
* @returns A promise that resolves to a result object with removed status and message.
|
|
922
|
+
*/
|
|
923
|
+
cancelClientSecretRequest(params: {
|
|
924
|
+
url: string;
|
|
925
|
+
method: 'GET' | 'POST' | 'DELETE' | 'PUT';
|
|
926
|
+
id: string;
|
|
927
|
+
queue?: string;
|
|
928
|
+
}): Promise<{
|
|
929
|
+
removed: boolean;
|
|
930
|
+
message: string;
|
|
931
|
+
}>;
|
|
932
|
+
/**
|
|
933
|
+
* Returns the number of requests currently waiting in a named client secret request queue.
|
|
934
|
+
* @param params Request parameters.
|
|
935
|
+
* @returns A promise that resolves to queue count information.
|
|
936
|
+
*/
|
|
937
|
+
clientSecretRequestQueueCount(params: {
|
|
938
|
+
queue: string;
|
|
939
|
+
service?: string;
|
|
940
|
+
owner?: string;
|
|
941
|
+
}): Promise<{
|
|
942
|
+
queue_name: string;
|
|
943
|
+
in_queue: number;
|
|
896
944
|
}>;
|
|
897
945
|
/**
|
|
898
946
|
* Consumes a one-time ticket and executes the ticketed request payload.
|