skapi-js 2.2.6-beta.1 → 2.2.6-beta.2
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 +5 -5
- package/dist/skapi.browser.mjs.map +1 -1
- package/dist/skapi.cjs +2 -2
- package/dist/skapi.cjs.map +1 -1
- package/dist/skapi.d.mts +29 -28
- package/dist/skapi.d.ts +29 -28
- package/dist/skapi.js +5 -5
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.mjs +2 -2
- package/dist/skapi.mjs.map +1 -1
- package/package.json +1 -1
package/dist/skapi.d.mts
CHANGED
|
@@ -723,7 +723,7 @@ type TicketConditionRow = {
|
|
|
723
723
|
* Where the row looks, relative to its own list and written without `${ }`:
|
|
724
724
|
* - `data` rows: a path into the request body. "id" is the body's `id`, "order[id]" is `order.id`.
|
|
725
725
|
* - `params` rows: a path into the query string, read the same way.
|
|
726
|
-
* - `
|
|
726
|
+
* - `response` rows of a cond action: a path into the enclosing action's answer ("body[status]" is a response's body.status, "record_id" a posted record's id); "" is the whole answer as text.
|
|
727
727
|
* - `headers` rows: the header name, matched case-insensitively.
|
|
728
728
|
* - `user` rows: the consumer attribute name.
|
|
729
729
|
*
|
|
@@ -845,11 +845,10 @@ type TicketCondition = {
|
|
|
845
845
|
record_access?: string;
|
|
846
846
|
};
|
|
847
847
|
/**
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
* `headers` rows read the response headers and `data` row keys are paths into the
|
|
851
|
-
*
|
|
852
|
-
* signed requests. A response that is not 2xx fails before this is checked.
|
|
848
|
+
* Skapi's own billing rows only (the super master registers them): the response check a `req`
|
|
849
|
+
* carried before 2026-10-09. Anyone else checks a response with a cond action in the req's
|
|
850
|
+
* Then chain. `headers` rows read the response headers and `data` row keys are paths into the
|
|
851
|
+
* parsed body; `user` and `record_access` check the consumer.
|
|
853
852
|
*/
|
|
854
853
|
type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user' | 'record_access'>;
|
|
855
854
|
/**
|
|
@@ -871,7 +870,7 @@ type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user'
|
|
|
871
870
|
* | `${user}`, `${user[key]}` | The signed-in user's attributes. Signed requests only. |
|
|
872
871
|
* | `${ip}`, `${user_agent}`, `${method}` | The caller's IP address, User-Agent and HTTP method. |
|
|
873
872
|
* | `${record_access}` | The record ID the condition's `record_access` names. Signed requests only. |
|
|
874
|
-
* | `${response}`, `${response[key]}` | The answer of the enclosing action, in its Then chain (`actions`) and the `err` chains inside it: the record a pstr posted, the
|
|
873
|
+
* | `${response}`, `${response[key]}` | The answer of the enclosing action, in its Then chain (`actions`) and the `err` chains inside it: the record a pstr posted, the response of a req ({ status, headers, body }), the SUCCESS text of acsg, acsr, mail and nlsd. |
|
|
875
874
|
* | `${error}`, `${error[key]}` | In an `err` chain, the failure: `code`, `message`, `detail`, `action` (the act) and `path`. |
|
|
876
875
|
* | `${ticket}`, `${ticket[key]}` | This consumption: `id`, `service`, `owner`, `consume_id`, `timestamp` and `hash`. |
|
|
877
876
|
* | `${CLIENT_SECRET}` | Reserved. See `secretName` on the req action. |
|
|
@@ -886,7 +885,7 @@ type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user'
|
|
|
886
885
|
* PLACEHOLDER_MISSING for a placeholder that was never captured, or AUTH_REQUIRED for `${user}`
|
|
887
886
|
* on a request that is not signed in. Its `err` chain runs and the consumption stops.
|
|
888
887
|
*
|
|
889
|
-
* Every action but resp and cond answers something (the record, the response body, a SUCCESS
|
|
888
|
+
* Every action but resp and cond answers something (the record, the response as { status, headers, body }, a SUCCESS
|
|
890
889
|
* text) and may carry a Then chain (`actions`, reading the answer as `${response}`). A Condition
|
|
891
890
|
* action in that chain checks the answer: its `response` rows read it whole (key "") or by key,
|
|
892
891
|
* whatever its shape. `retry: true` on acsg, acsr, pstr, req, mail and nlsd tries a failure again,
|
|
@@ -947,7 +946,7 @@ type TicketAction = {
|
|
|
947
946
|
err?: TicketAction[];
|
|
948
947
|
retry?: boolean;
|
|
949
948
|
} | {
|
|
950
|
-
/** HTTP request with
|
|
949
|
+
/** HTTP request with a nested chain on its response. Answers the whole response: { status, headers, body }. */
|
|
951
950
|
act: 'req';
|
|
952
951
|
exe: {
|
|
953
952
|
/**
|
|
@@ -1015,9 +1014,11 @@ type TicketAction = {
|
|
|
1015
1014
|
/** Skapi's own billing rows only. A response check is a Condition action in `actions`, whose `response` rows read the answer. */
|
|
1016
1015
|
condition?: TicketResponseCondition;
|
|
1017
1016
|
/**
|
|
1018
|
-
* Nested chain, run
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1017
|
+
* Nested chain, run on an answer below 300. It reads the response as `${response}`:
|
|
1018
|
+
* `${response[status]}`, `${response[headers][content-type]}` (header names in
|
|
1019
|
+
* lowercase) and `${response[body][key]}`, while `${data}` is still the incoming
|
|
1020
|
+
* request body. A cond in it checks the response. Any action can nest, including
|
|
1021
|
+
* another req with its own `secretName`.
|
|
1021
1022
|
*/
|
|
1022
1023
|
actions?: TicketAction[];
|
|
1023
1024
|
};
|
|
@@ -1096,22 +1097,13 @@ type TicketAction = {
|
|
|
1096
1097
|
*/
|
|
1097
1098
|
act: 'cond';
|
|
1098
1099
|
exe: {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
placeholder?: {
|
|
1107
|
-
key: string;
|
|
1108
|
-
operator: TicketConditionOperator;
|
|
1109
|
-
value: any;
|
|
1110
|
-
}[];
|
|
1111
|
-
/** Rows on the enclosing action's answer, inside a Then chain only: a key reads a field, "" the whole answer as text. */
|
|
1112
|
-
response?: TicketConditionRow[];
|
|
1113
|
-
/** Rows on the failure, inside an err chain only: code, message, detail, action, path, or "" for the whole error as text. */
|
|
1114
|
-
error?: TicketConditionRow[];
|
|
1100
|
+
/**
|
|
1101
|
+
* Rows on the answer of the action whose Then chain this Condition is in, whatever its shape: a key is
|
|
1102
|
+
* a path in the answer ("record_id" on a posted record, "body[status]" or "headers[content-type]" on a
|
|
1103
|
+
* response), "" the whole answer as text. A row that does not pass fails the chain here with
|
|
1104
|
+
* CONDITION_FAILED. Inside a Then chain only; answers nothing.
|
|
1105
|
+
*/
|
|
1106
|
+
response: TicketConditionRow[];
|
|
1115
1107
|
};
|
|
1116
1108
|
err?: TicketAction[];
|
|
1117
1109
|
};
|
|
@@ -1153,6 +1145,15 @@ type Ticket = {
|
|
|
1153
1145
|
* https://docs.skapi.com/deprecated/deprecated.html#tickets-saved-before-this-release
|
|
1154
1146
|
*/
|
|
1155
1147
|
legacy?: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* The rules the ticket was saved under. 2: an HTTP request's answer is the whole response
|
|
1150
|
+
* ({ status, headers, body }). Absent on a ticket saved before 2026-10-09: its req actions
|
|
1151
|
+
* keep answering the body alone, as it was written to read them, until it is registered
|
|
1152
|
+
* again (the dashboard moves such references under [body] when the ticket is opened).
|
|
1153
|
+
* Returned to the project owner. See
|
|
1154
|
+
* https://docs.skapi.com/deprecated/deprecated.html#a-request-s-answer-was-its-body
|
|
1155
|
+
*/
|
|
1156
|
+
rules_version?: number;
|
|
1156
1157
|
};
|
|
1157
1158
|
type TicketErrorCode = 'INVALID_SERVICE' | 'SERVICE_DISABLED' | 'TICKET_NOT_FOUND' | 'TICKET_EXPIRED' | 'TICKET_EXHAUSTED' | 'USER_LIMIT_REACHED' | 'ISSUER_CANNOT_CONSUME' | 'AUTH_REQUIRED' | 'METHOD_NOT_ALLOWED' | 'CONDITION_FAILED' | 'PATH_NOT_FOUND' | 'PLACEHOLDER_MISSING' | 'REQUEST_FAILED' | 'TIMEOUT' | 'ACTION_FAILED' | 'ACTION_FORBIDDEN' | 'QUOTA_EXCEEDED' | 'ALREADY_RESPONDED' | 'INTERNAL_ERROR';
|
|
1158
1159
|
/**
|
package/dist/skapi.d.ts
CHANGED
|
@@ -723,7 +723,7 @@ type TicketConditionRow = {
|
|
|
723
723
|
* Where the row looks, relative to its own list and written without `${ }`:
|
|
724
724
|
* - `data` rows: a path into the request body. "id" is the body's `id`, "order[id]" is `order.id`.
|
|
725
725
|
* - `params` rows: a path into the query string, read the same way.
|
|
726
|
-
* - `
|
|
726
|
+
* - `response` rows of a cond action: a path into the enclosing action's answer ("body[status]" is a response's body.status, "record_id" a posted record's id); "" is the whole answer as text.
|
|
727
727
|
* - `headers` rows: the header name, matched case-insensitively.
|
|
728
728
|
* - `user` rows: the consumer attribute name.
|
|
729
729
|
*
|
|
@@ -845,11 +845,10 @@ type TicketCondition = {
|
|
|
845
845
|
record_access?: string;
|
|
846
846
|
};
|
|
847
847
|
/**
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
* `headers` rows read the response headers and `data` row keys are paths into the
|
|
851
|
-
*
|
|
852
|
-
* signed requests. A response that is not 2xx fails before this is checked.
|
|
848
|
+
* Skapi's own billing rows only (the super master registers them): the response check a `req`
|
|
849
|
+
* carried before 2026-10-09. Anyone else checks a response with a cond action in the req's
|
|
850
|
+
* Then chain. `headers` rows read the response headers and `data` row keys are paths into the
|
|
851
|
+
* parsed body; `user` and `record_access` check the consumer.
|
|
853
852
|
*/
|
|
854
853
|
type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user' | 'record_access'>;
|
|
855
854
|
/**
|
|
@@ -871,7 +870,7 @@ type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user'
|
|
|
871
870
|
* | `${user}`, `${user[key]}` | The signed-in user's attributes. Signed requests only. |
|
|
872
871
|
* | `${ip}`, `${user_agent}`, `${method}` | The caller's IP address, User-Agent and HTTP method. |
|
|
873
872
|
* | `${record_access}` | The record ID the condition's `record_access` names. Signed requests only. |
|
|
874
|
-
* | `${response}`, `${response[key]}` | The answer of the enclosing action, in its Then chain (`actions`) and the `err` chains inside it: the record a pstr posted, the
|
|
873
|
+
* | `${response}`, `${response[key]}` | The answer of the enclosing action, in its Then chain (`actions`) and the `err` chains inside it: the record a pstr posted, the response of a req ({ status, headers, body }), the SUCCESS text of acsg, acsr, mail and nlsd. |
|
|
875
874
|
* | `${error}`, `${error[key]}` | In an `err` chain, the failure: `code`, `message`, `detail`, `action` (the act) and `path`. |
|
|
876
875
|
* | `${ticket}`, `${ticket[key]}` | This consumption: `id`, `service`, `owner`, `consume_id`, `timestamp` and `hash`. |
|
|
877
876
|
* | `${CLIENT_SECRET}` | Reserved. See `secretName` on the req action. |
|
|
@@ -886,7 +885,7 @@ type TicketResponseCondition = Pick<TicketCondition, 'headers' | 'data' | 'user'
|
|
|
886
885
|
* PLACEHOLDER_MISSING for a placeholder that was never captured, or AUTH_REQUIRED for `${user}`
|
|
887
886
|
* on a request that is not signed in. Its `err` chain runs and the consumption stops.
|
|
888
887
|
*
|
|
889
|
-
* Every action but resp and cond answers something (the record, the response body, a SUCCESS
|
|
888
|
+
* Every action but resp and cond answers something (the record, the response as { status, headers, body }, a SUCCESS
|
|
890
889
|
* text) and may carry a Then chain (`actions`, reading the answer as `${response}`). A Condition
|
|
891
890
|
* action in that chain checks the answer: its `response` rows read it whole (key "") or by key,
|
|
892
891
|
* whatever its shape. `retry: true` on acsg, acsr, pstr, req, mail and nlsd tries a failure again,
|
|
@@ -947,7 +946,7 @@ type TicketAction = {
|
|
|
947
946
|
err?: TicketAction[];
|
|
948
947
|
retry?: boolean;
|
|
949
948
|
} | {
|
|
950
|
-
/** HTTP request with
|
|
949
|
+
/** HTTP request with a nested chain on its response. Answers the whole response: { status, headers, body }. */
|
|
951
950
|
act: 'req';
|
|
952
951
|
exe: {
|
|
953
952
|
/**
|
|
@@ -1015,9 +1014,11 @@ type TicketAction = {
|
|
|
1015
1014
|
/** Skapi's own billing rows only. A response check is a Condition action in `actions`, whose `response` rows read the answer. */
|
|
1016
1015
|
condition?: TicketResponseCondition;
|
|
1017
1016
|
/**
|
|
1018
|
-
* Nested chain, run
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1017
|
+
* Nested chain, run on an answer below 300. It reads the response as `${response}`:
|
|
1018
|
+
* `${response[status]}`, `${response[headers][content-type]}` (header names in
|
|
1019
|
+
* lowercase) and `${response[body][key]}`, while `${data}` is still the incoming
|
|
1020
|
+
* request body. A cond in it checks the response. Any action can nest, including
|
|
1021
|
+
* another req with its own `secretName`.
|
|
1021
1022
|
*/
|
|
1022
1023
|
actions?: TicketAction[];
|
|
1023
1024
|
};
|
|
@@ -1096,22 +1097,13 @@ type TicketAction = {
|
|
|
1096
1097
|
*/
|
|
1097
1098
|
act: 'cond';
|
|
1098
1099
|
exe: {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
placeholder?: {
|
|
1107
|
-
key: string;
|
|
1108
|
-
operator: TicketConditionOperator;
|
|
1109
|
-
value: any;
|
|
1110
|
-
}[];
|
|
1111
|
-
/** Rows on the enclosing action's answer, inside a Then chain only: a key reads a field, "" the whole answer as text. */
|
|
1112
|
-
response?: TicketConditionRow[];
|
|
1113
|
-
/** Rows on the failure, inside an err chain only: code, message, detail, action, path, or "" for the whole error as text. */
|
|
1114
|
-
error?: TicketConditionRow[];
|
|
1100
|
+
/**
|
|
1101
|
+
* Rows on the answer of the action whose Then chain this Condition is in, whatever its shape: a key is
|
|
1102
|
+
* a path in the answer ("record_id" on a posted record, "body[status]" or "headers[content-type]" on a
|
|
1103
|
+
* response), "" the whole answer as text. A row that does not pass fails the chain here with
|
|
1104
|
+
* CONDITION_FAILED. Inside a Then chain only; answers nothing.
|
|
1105
|
+
*/
|
|
1106
|
+
response: TicketConditionRow[];
|
|
1115
1107
|
};
|
|
1116
1108
|
err?: TicketAction[];
|
|
1117
1109
|
};
|
|
@@ -1153,6 +1145,15 @@ type Ticket = {
|
|
|
1153
1145
|
* https://docs.skapi.com/deprecated/deprecated.html#tickets-saved-before-this-release
|
|
1154
1146
|
*/
|
|
1155
1147
|
legacy?: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* The rules the ticket was saved under. 2: an HTTP request's answer is the whole response
|
|
1150
|
+
* ({ status, headers, body }). Absent on a ticket saved before 2026-10-09: its req actions
|
|
1151
|
+
* keep answering the body alone, as it was written to read them, until it is registered
|
|
1152
|
+
* again (the dashboard moves such references under [body] when the ticket is opened).
|
|
1153
|
+
* Returned to the project owner. See
|
|
1154
|
+
* https://docs.skapi.com/deprecated/deprecated.html#a-request-s-answer-was-its-body
|
|
1155
|
+
*/
|
|
1156
|
+
rules_version?: number;
|
|
1156
1157
|
};
|
|
1157
1158
|
type TicketErrorCode = 'INVALID_SERVICE' | 'SERVICE_DISABLED' | 'TICKET_NOT_FOUND' | 'TICKET_EXPIRED' | 'TICKET_EXHAUSTED' | 'USER_LIMIT_REACHED' | 'ISSUER_CANNOT_CONSUME' | 'AUTH_REQUIRED' | 'METHOD_NOT_ALLOWED' | 'CONDITION_FAILED' | 'PATH_NOT_FOUND' | 'PLACEHOLDER_MISSING' | 'REQUEST_FAILED' | 'TIMEOUT' | 'ACTION_FAILED' | 'ACTION_FORBIDDEN' | 'QUOTA_EXCEEDED' | 'ALREADY_RESPONDED' | 'INTERNAL_ERROR';
|
|
1158
1159
|
/**
|