@eva_solutions/auth-sdk 0.0.0-stage → 3.0.0-dev-20261109133200
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/CHANGELOG.md +290 -0
- package/LICENSE +21 -0
- package/README.md +481 -2
- package/dist/admin/index.cjs +4 -0
- package/dist/admin/index.d.cts +2 -0
- package/dist/admin/index.d.ts +2 -0
- package/dist/admin/index.js +1 -0
- package/dist/admin-DjvuvuI8.js +408 -0
- package/dist/admin-DjvuvuI8.js.map +1 -0
- package/dist/admin-Q6lbWqLM.cjs +419 -0
- package/dist/admin-Q6lbWqLM.cjs.map +1 -0
- package/dist/api-path-2Ulruz7R.cjs +34 -0
- package/dist/api-path-2Ulruz7R.cjs.map +1 -0
- package/dist/api-path-B-vSkL2H.js +29 -0
- package/dist/api-path-B-vSkL2H.js.map +1 -0
- package/dist/auth-19r-Q6X2.js +84 -0
- package/dist/auth-19r-Q6X2.js.map +1 -0
- package/dist/auth-DX1N5JA4.cjs +131 -0
- package/dist/auth-DX1N5JA4.cjs.map +1 -0
- package/dist/auth-handlers-B3iJaPln.js +343 -0
- package/dist/auth-handlers-B3iJaPln.js.map +1 -0
- package/dist/auth-handlers-BTbXKJms.d.ts +15 -0
- package/dist/auth-handlers-BTbXKJms.d.ts.map +1 -0
- package/dist/auth-handlers-CDzGFDTu.cjs +404 -0
- package/dist/auth-handlers-CDzGFDTu.cjs.map +1 -0
- package/dist/auth-handlers-DRUUTEtW.d.cts +15 -0
- package/dist/auth-handlers-DRUUTEtW.d.cts.map +1 -0
- package/dist/catalog-CHPqldcj.cjs +172 -0
- package/dist/catalog-CHPqldcj.cjs.map +1 -0
- package/dist/catalog-CIqpzgsM.d.cts +75 -0
- package/dist/catalog-CIqpzgsM.d.cts.map +1 -0
- package/dist/catalog-CIqpzgsM.d.ts +75 -0
- package/dist/catalog-CIqpzgsM.d.ts.map +1 -0
- package/dist/catalog-DqPhtCKZ.js +95 -0
- package/dist/catalog-DqPhtCKZ.js.map +1 -0
- package/dist/config-3avoUa9e.d.cts +95 -0
- package/dist/config-3avoUa9e.d.cts.map +1 -0
- package/dist/config-COX7rGAP.d.ts +95 -0
- package/dist/config-COX7rGAP.d.ts.map +1 -0
- package/dist/constants-BE1_9Tod.cjs +52 -0
- package/dist/constants-BE1_9Tod.cjs.map +1 -0
- package/dist/constants-BY7QZokc.js +29 -0
- package/dist/constants-BY7QZokc.js.map +1 -0
- package/dist/constants-CcbhOaAP.cjs +153 -0
- package/dist/constants-CcbhOaAP.cjs.map +1 -0
- package/dist/constants-rNuD5qJn.js +94 -0
- package/dist/constants-rNuD5qJn.js.map +1 -0
- package/dist/contracts/index.cjs +1006 -0
- package/dist/contracts/index.cjs.map +1 -0
- package/dist/contracts/index.d.cts +488 -0
- package/dist/contracts/index.d.cts.map +1 -0
- package/dist/contracts/index.d.ts +488 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +817 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/cookies-DCIcr7uy.cjs +94 -0
- package/dist/cookies-DCIcr7uy.cjs.map +1 -0
- package/dist/cookies-DKEC7AWv.js +71 -0
- package/dist/cookies-DKEC7AWv.js.map +1 -0
- package/dist/delegated-token-CVNbMNfy.js +426 -0
- package/dist/delegated-token-CVNbMNfy.js.map +1 -0
- package/dist/delegated-token-DHSK4rHI.cjs +461 -0
- package/dist/delegated-token-DHSK4rHI.cjs.map +1 -0
- package/dist/error-helpers-0woh13Wd.d.cts +105 -0
- package/dist/error-helpers-0woh13Wd.d.cts.map +1 -0
- package/dist/error-helpers-Ct3AUK1I.d.ts +105 -0
- package/dist/error-helpers-Ct3AUK1I.d.ts.map +1 -0
- package/dist/error-helpers-XCh4ZJ-g.cjs +282 -0
- package/dist/error-helpers-XCh4ZJ-g.cjs.map +1 -0
- package/dist/error-helpers-lnwgNOw9.js +145 -0
- package/dist/error-helpers-lnwgNOw9.js.map +1 -0
- package/dist/error-messages-CGpW1fsg.d.cts +48 -0
- package/dist/error-messages-CGpW1fsg.d.cts.map +1 -0
- package/dist/error-messages-CGpW1fsg.d.ts +48 -0
- package/dist/error-messages-CGpW1fsg.d.ts.map +1 -0
- package/dist/event-codes-BBJHon-I.cjs +48 -0
- package/dist/event-codes-BBJHon-I.cjs.map +1 -0
- package/dist/event-codes-BgcJWsov.d.cts +42 -0
- package/dist/event-codes-BgcJWsov.d.cts.map +1 -0
- package/dist/event-codes-BgcJWsov.d.ts +42 -0
- package/dist/event-codes-BgcJWsov.d.ts.map +1 -0
- package/dist/event-codes-DR5_VlaR.js +43 -0
- package/dist/event-codes-DR5_VlaR.js.map +1 -0
- package/dist/generic/index.cjs +91 -0
- package/dist/generic/index.cjs.map +1 -0
- package/dist/generic/index.d.cts +27 -0
- package/dist/generic/index.d.cts.map +1 -0
- package/dist/generic/index.d.ts +27 -0
- package/dist/generic/index.d.ts.map +1 -0
- package/dist/generic/index.js +80 -0
- package/dist/generic/index.js.map +1 -0
- package/dist/hono/index.cjs +309 -0
- package/dist/hono/index.cjs.map +1 -0
- package/dist/hono/index.d.cts +272 -0
- package/dist/hono/index.d.cts.map +1 -0
- package/dist/hono/index.d.ts +272 -0
- package/dist/hono/index.d.ts.map +1 -0
- package/dist/hono/index.js +290 -0
- package/dist/hono/index.js.map +1 -0
- package/dist/hono-openapi/index.cjs +326 -0
- package/dist/hono-openapi/index.cjs.map +1 -0
- package/dist/hono-openapi/index.d.cts +14 -0
- package/dist/hono-openapi/index.d.cts.map +1 -0
- package/dist/hono-openapi/index.d.ts +14 -0
- package/dist/hono-openapi/index.d.ts.map +1 -0
- package/dist/hono-openapi/index.js +307 -0
- package/dist/hono-openapi/index.js.map +1 -0
- package/dist/http-client-BVF3iktR.cjs +211 -0
- package/dist/http-client-BVF3iktR.cjs.map +1 -0
- package/dist/http-client-Da0-OMfc.js +206 -0
- package/dist/http-client-Da0-OMfc.js.map +1 -0
- package/dist/index-CIH_2t7Y.d.ts +240 -0
- package/dist/index-CIH_2t7Y.d.ts.map +1 -0
- package/dist/index-CZru7c5T.d.cts +1711 -0
- package/dist/index-CZru7c5T.d.cts.map +1 -0
- package/dist/index-CZru7c5T.d.ts +1711 -0
- package/dist/index-CZru7c5T.d.ts.map +1 -0
- package/dist/index-DMVe5IJA.d.cts +240 -0
- package/dist/index-DMVe5IJA.d.cts.map +1 -0
- package/dist/index-DRWKobSp.d.ts +312 -0
- package/dist/index-DRWKobSp.d.ts.map +1 -0
- package/dist/index-DU9wJ-P2.d.cts +312 -0
- package/dist/index-DU9wJ-P2.d.cts.map +1 -0
- package/dist/index-DbiXllNy.d.cts +66 -0
- package/dist/index-DbiXllNy.d.cts.map +1 -0
- package/dist/index-z9r98qlk.d.ts +66 -0
- package/dist/index-z9r98qlk.d.ts.map +1 -0
- package/dist/index.cjs +89 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +114 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/jwt-BBNqk0TV.cjs +155 -0
- package/dist/jwt-BBNqk0TV.cjs.map +1 -0
- package/dist/jwt-DhqgH94B.js +150 -0
- package/dist/jwt-DhqgH94B.js.map +1 -0
- package/dist/key-resolver-CESqj4-P.cjs +45 -0
- package/dist/key-resolver-CESqj4-P.cjs.map +1 -0
- package/dist/key-resolver-D56I2Zpz.js +34 -0
- package/dist/key-resolver-D56I2Zpz.js.map +1 -0
- package/dist/parse-error-response-6qOQS5y9.cjs +316 -0
- package/dist/parse-error-response-6qOQS5y9.cjs.map +1 -0
- package/dist/parse-error-response-BM9-kjs0.js +239 -0
- package/dist/parse-error-response-BM9-kjs0.js.map +1 -0
- package/dist/path-segment-C25i6aaH.cjs +29 -0
- package/dist/path-segment-C25i6aaH.cjs.map +1 -0
- package/dist/path-segment-CyqnaFrP.js +24 -0
- package/dist/path-segment-CyqnaFrP.js.map +1 -0
- package/dist/react/index.cjs +336 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +151 -0
- package/dist/react/index.d.cts.map +1 -0
- package/dist/react/index.d.ts +151 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +300 -0
- package/dist/react/index.js.map +1 -0
- package/dist/refresh-dedup-CKaHHe7m.js +14 -0
- package/dist/refresh-dedup-CKaHHe7m.js.map +1 -0
- package/dist/refresh-dedup-CLdACQXR.cjs +19 -0
- package/dist/refresh-dedup-CLdACQXR.cjs.map +1 -0
- package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
- package/dist/routes-DpAzgY1V.cjs +424 -0
- package/dist/routes-DpAzgY1V.cjs.map +1 -0
- package/dist/routes-F1g5aVqP.js +347 -0
- package/dist/routes-F1g5aVqP.js.map +1 -0
- package/dist/s2s/index.cjs +24 -0
- package/dist/s2s/index.d.cts +5 -0
- package/dist/s2s/index.d.ts +5 -0
- package/dist/s2s/index.js +5 -0
- package/dist/s2s-6wbotr78.cjs +926 -0
- package/dist/s2s-6wbotr78.cjs.map +1 -0
- package/dist/s2s-B_0SIQzn.js +897 -0
- package/dist/s2s-B_0SIQzn.js.map +1 -0
- package/dist/sign-C7y6xdvT.cjs +324 -0
- package/dist/sign-C7y6xdvT.cjs.map +1 -0
- package/dist/sign-HFtcYwa-.js +259 -0
- package/dist/sign-HFtcYwa-.js.map +1 -0
- package/dist/tokens-C1nzkn21.cjs +232 -0
- package/dist/tokens-C1nzkn21.cjs.map +1 -0
- package/dist/tokens-C3Z40qd7.js +107 -0
- package/dist/tokens-C3Z40qd7.js.map +1 -0
- package/dist/types-Ai3iIFlB.d.cts +538 -0
- package/dist/types-Ai3iIFlB.d.cts.map +1 -0
- package/dist/types-Bxg4hCMc.d.cts +52 -0
- package/dist/types-Bxg4hCMc.d.cts.map +1 -0
- package/dist/types-CEABh1Zf.d.ts +96 -0
- package/dist/types-CEABh1Zf.d.ts.map +1 -0
- package/dist/types-Ci0Jq0xB.d.cts +96 -0
- package/dist/types-Ci0Jq0xB.d.cts.map +1 -0
- package/dist/types-DXg8BvEh.d.ts +52 -0
- package/dist/types-DXg8BvEh.d.ts.map +1 -0
- package/dist/types-_zY7QbM5.d.ts +538 -0
- package/dist/types-_zY7QbM5.d.ts.map +1 -0
- package/dist/webhooks/index.cjs +8 -0
- package/dist/webhooks/index.d.cts +5 -0
- package/dist/webhooks/index.d.ts +5 -0
- package/dist/webhooks/index.js +4 -0
- package/dist/webhooks-B5sAWC9W.js +74 -0
- package/dist/webhooks-B5sAWC9W.js.map +1 -0
- package/dist/webhooks-Cx11psg1.cjs +79 -0
- package/dist/webhooks-Cx11psg1.cjs.map +1 -0
- package/package.json +192 -3
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// ../auth-contracts/dist/constants.js
|
|
2
|
+
/**
|
|
3
|
+
* PURE module: it must never reference `zod` or any schema module of this package. The SDK
|
|
4
|
+
* `react` entry imports these values, and a schema module reached from there would drag its
|
|
5
|
+
* load-time metadata registration into the react bundle (enforced by a test in this package and
|
|
6
|
+
* by the SDK closure gate).
|
|
7
|
+
*
|
|
8
|
+
* Wire values only: error codes and header NAMES. Nothing here is configuration.
|
|
9
|
+
*/
|
|
10
|
+
/** Core error codes of the wire error body; each key equals its value. The catalog is open. */
|
|
11
|
+
const ERROR_CODES = {
|
|
12
|
+
account_state_locked: "account_state_locked",
|
|
13
|
+
unauthorized: "unauthorized",
|
|
14
|
+
validation_error: "validation_error",
|
|
15
|
+
not_found: "not_found",
|
|
16
|
+
conflict: "conflict",
|
|
17
|
+
forbidden: "forbidden",
|
|
18
|
+
rate_limited: "rate_limited",
|
|
19
|
+
gone: "gone",
|
|
20
|
+
unprocessable_entity: "unprocessable_entity",
|
|
21
|
+
bad_request: "bad_request",
|
|
22
|
+
internal_error: "internal_error",
|
|
23
|
+
service_unavailable: "service_unavailable"
|
|
24
|
+
};
|
|
25
|
+
/** Names of the session headers exchanged with browser clients. */
|
|
26
|
+
const HEADERS = {
|
|
27
|
+
AUTHORIZATION: "authorization",
|
|
28
|
+
REFRESH_TOKEN: "x-eva-refresh-token",
|
|
29
|
+
NEW_ACCESS_TOKEN: "x-eva-new-access-token",
|
|
30
|
+
NEW_REFRESH_TOKEN: "x-eva-new-refresh-token"
|
|
31
|
+
};
|
|
32
|
+
/** Names of the headers of the service-to-service signed requests and responses. */
|
|
33
|
+
const INTERNAL_HEADERS = {
|
|
34
|
+
X_EVA_CLIENT_ID: "x-eva-client-id",
|
|
35
|
+
X_EVA_TIMESTAMP: "x-eva-timestamp",
|
|
36
|
+
X_EVA_NONCE: "x-eva-nonce",
|
|
37
|
+
X_EVA_SIGNATURE: "x-eva-signature",
|
|
38
|
+
X_EVA_SERVER_TIME: "x-eva-server-time"
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Account states, as an OBJECT with each key equal to its value: it is the public shape of the SDK
|
|
42
|
+
* (`ACCOUNT_STATES.suspendido`), unlike the two tuples below.
|
|
43
|
+
*/
|
|
44
|
+
const ACCOUNT_STATES = {
|
|
45
|
+
no_verificado: "no_verificado",
|
|
46
|
+
verificado: "verificado",
|
|
47
|
+
pendiente_de_verificacion: "pendiente_de_verificacion",
|
|
48
|
+
suspendido: "suspendido",
|
|
49
|
+
baneado: "baneado",
|
|
50
|
+
eliminado: "eliminado"
|
|
51
|
+
};
|
|
52
|
+
/** Presence states of a user. A tuple so that schemas can build an enum straight from it. */
|
|
53
|
+
const ACTIVITY_STATES = [
|
|
54
|
+
"activo",
|
|
55
|
+
"ausente",
|
|
56
|
+
"ocupado",
|
|
57
|
+
"desconectado"
|
|
58
|
+
];
|
|
59
|
+
/** Privacy states of a user profile. A tuple, like {@link ACTIVITY_STATES}. */
|
|
60
|
+
const PRIVACY_STATES = [
|
|
61
|
+
"publico",
|
|
62
|
+
"amigos",
|
|
63
|
+
"invisible"
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Most ids accepted by one users batch call. The batch request schema does NOT carry this limit
|
|
67
|
+
* (a schema maximum would change the published OpenAPI document): whoever applies the limit reads
|
|
68
|
+
* this constant. It lives here, in a PURE module, so the SDK client can import it by value.
|
|
69
|
+
*/
|
|
70
|
+
const USERS_BATCH_MAX_IDS = 100;
|
|
71
|
+
/**
|
|
72
|
+
* Names of the headers a webhook receiver reads (lower case, as receivers see them): the signature,
|
|
73
|
+
* the event id and the timestamp. Names only, never values.
|
|
74
|
+
*/
|
|
75
|
+
const WEBHOOK_HEADERS = {
|
|
76
|
+
SIGNATURE: "x-eva-webhook-signature",
|
|
77
|
+
ID: "x-eva-webhook-id",
|
|
78
|
+
TIMESTAMP: "x-eva-webhook-timestamp"
|
|
79
|
+
};
|
|
80
|
+
/** Seconds around "now" within which a receiver accepts the timestamp of a webhook. */
|
|
81
|
+
const WEBHOOK_TIMESTAMP_WINDOW_SECONDS = 300;
|
|
82
|
+
/**
|
|
83
|
+
* Delivery states of a webhook. A tuple, like the other enums: the API database enum is checked
|
|
84
|
+
* against it at compile time.
|
|
85
|
+
*/
|
|
86
|
+
const DELIVERY_STATUSES = [
|
|
87
|
+
"pending",
|
|
88
|
+
"delivering",
|
|
89
|
+
"success",
|
|
90
|
+
"expired"
|
|
91
|
+
];
|
|
92
|
+
Object.defineProperty(exports, "ACCOUNT_STATES", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function() {
|
|
95
|
+
return ACCOUNT_STATES;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "ACTIVITY_STATES", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function() {
|
|
101
|
+
return ACTIVITY_STATES;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "DELIVERY_STATUSES", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function() {
|
|
107
|
+
return DELIVERY_STATUSES;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "ERROR_CODES", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function() {
|
|
113
|
+
return ERROR_CODES;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "HEADERS", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function() {
|
|
119
|
+
return HEADERS;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "INTERNAL_HEADERS", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function() {
|
|
125
|
+
return INTERNAL_HEADERS;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, "PRIVACY_STATES", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function() {
|
|
131
|
+
return PRIVACY_STATES;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "USERS_BATCH_MAX_IDS", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return USERS_BATCH_MAX_IDS;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(exports, "WEBHOOK_HEADERS", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: function() {
|
|
143
|
+
return WEBHOOK_HEADERS;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "WEBHOOK_TIMESTAMP_WINDOW_SECONDS", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function() {
|
|
149
|
+
return WEBHOOK_TIMESTAMP_WINDOW_SECONDS;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=constants-CcbhOaAP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CcbhOaAP.cjs","names":[],"sources":["../../auth-contracts/dist/constants.js"],"sourcesContent":["// src/constants.ts\n/**\n* PURE module: it must never reference `zod` or any schema module of this package. The SDK\n* `react` entry imports these values, and a schema module reached from there would drag its\n* load-time metadata registration into the react bundle (enforced by a test in this package and\n* by the SDK closure gate).\n*\n* Wire values only: error codes and header NAMES. Nothing here is configuration.\n*/\n/** Core error codes of the wire error body; each key equals its value. The catalog is open. */\nconst ERROR_CODES = {\n\taccount_state_locked: \"account_state_locked\",\n\tunauthorized: \"unauthorized\",\n\tvalidation_error: \"validation_error\",\n\tnot_found: \"not_found\",\n\tconflict: \"conflict\",\n\tforbidden: \"forbidden\",\n\trate_limited: \"rate_limited\",\n\tgone: \"gone\",\n\tunprocessable_entity: \"unprocessable_entity\",\n\tbad_request: \"bad_request\",\n\tinternal_error: \"internal_error\",\n\tservice_unavailable: \"service_unavailable\"\n};\n/** Names of the session headers exchanged with browser clients. */\nconst HEADERS = {\n\tAUTHORIZATION: \"authorization\",\n\tREFRESH_TOKEN: \"x-eva-refresh-token\",\n\tNEW_ACCESS_TOKEN: \"x-eva-new-access-token\",\n\tNEW_REFRESH_TOKEN: \"x-eva-new-refresh-token\"\n};\n/** Names of the headers of the service-to-service signed requests and responses. */\nconst INTERNAL_HEADERS = {\n\tX_EVA_CLIENT_ID: \"x-eva-client-id\",\n\tX_EVA_TIMESTAMP: \"x-eva-timestamp\",\n\tX_EVA_NONCE: \"x-eva-nonce\",\n\tX_EVA_SIGNATURE: \"x-eva-signature\",\n\tX_EVA_SERVER_TIME: \"x-eva-server-time\"\n};\n/**\n* Account states, as an OBJECT with each key equal to its value: it is the public shape of the SDK\n* (`ACCOUNT_STATES.suspendido`), unlike the two tuples below.\n*/\nconst ACCOUNT_STATES = {\n\tno_verificado: \"no_verificado\",\n\tverificado: \"verificado\",\n\tpendiente_de_verificacion: \"pendiente_de_verificacion\",\n\tsuspendido: \"suspendido\",\n\tbaneado: \"baneado\",\n\teliminado: \"eliminado\"\n};\n/** Presence states of a user. A tuple so that schemas can build an enum straight from it. */\nconst ACTIVITY_STATES = [\n\t\"activo\",\n\t\"ausente\",\n\t\"ocupado\",\n\t\"desconectado\"\n];\n/** Privacy states of a user profile. A tuple, like {@link ACTIVITY_STATES}. */\nconst PRIVACY_STATES = [\n\t\"publico\",\n\t\"amigos\",\n\t\"invisible\"\n];\n/**\n* Most ids accepted by one users batch call. The batch request schema does NOT carry this limit\n* (a schema maximum would change the published OpenAPI document): whoever applies the limit reads\n* this constant. It lives here, in a PURE module, so the SDK client can import it by value.\n*/\nconst USERS_BATCH_MAX_IDS = 100;\n/**\n* Names of the headers a webhook receiver reads (lower case, as receivers see them): the signature,\n* the event id and the timestamp. Names only, never values.\n*/\nconst WEBHOOK_HEADERS = {\n\tSIGNATURE: \"x-eva-webhook-signature\",\n\tID: \"x-eva-webhook-id\",\n\tTIMESTAMP: \"x-eva-webhook-timestamp\"\n};\n/** Seconds around \"now\" within which a receiver accepts the timestamp of a webhook. */\nconst WEBHOOK_TIMESTAMP_WINDOW_SECONDS = 300;\n/**\n* Delivery states of a webhook. A tuple, like the other enums: the API database enum is checked\n* against it at compile time.\n*/\nconst DELIVERY_STATUSES = [\n\t\"pending\",\n\t\"delivering\",\n\t\"success\",\n\t\"expired\"\n];\nexport { ACCOUNT_STATES, ACTIVITY_STATES, DELIVERY_STATUSES, ERROR_CODES, HEADERS, INTERNAL_HEADERS, PRIVACY_STATES, USERS_BATCH_MAX_IDS, WEBHOOK_HEADERS, WEBHOOK_TIMESTAMP_WINDOW_SECONDS };\n\n//# sourceMappingURL=constants.js.map"],"mappings":";;;;;;;;;;AAUA,MAAM,cAAc;CACnB,sBAAsB;CACtB,cAAc;CACd,kBAAkB;CAClB,WAAW;CACX,UAAU;CACV,WAAW;CACX,cAAc;CACd,MAAM;CACN,sBAAsB;CACtB,aAAa;CACb,gBAAgB;CAChB,qBAAqB;AACtB;;AAEA,MAAM,UAAU;CACf,eAAe;CACf,eAAe;CACf,kBAAkB;CAClB,mBAAmB;AACpB;;AAEA,MAAM,mBAAmB;CACxB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,iBAAiB;CACjB,mBAAmB;AACpB;;;;;AAKA,MAAM,iBAAiB;CACtB,eAAe;CACf,YAAY;CACZ,2BAA2B;CAC3B,YAAY;CACZ,SAAS;CACT,WAAW;AACZ;;AAEA,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;AACD;;AAEA,MAAM,iBAAiB;CACtB;CACA;CACA;AACD;;;;;;AAMA,MAAM,sBAAsB;;;;;AAK5B,MAAM,kBAAkB;CACvB,WAAW;CACX,IAAI;CACJ,WAAW;AACZ;;AAEA,MAAM,mCAAmC;;;;;AAKzC,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;AACD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// ../auth-contracts/dist/constants.js
|
|
2
|
+
/**
|
|
3
|
+
* PURE module: it must never reference `zod` or any schema module of this package. The SDK
|
|
4
|
+
* `react` entry imports these values, and a schema module reached from there would drag its
|
|
5
|
+
* load-time metadata registration into the react bundle (enforced by a test in this package and
|
|
6
|
+
* by the SDK closure gate).
|
|
7
|
+
*
|
|
8
|
+
* Wire values only: error codes and header NAMES. Nothing here is configuration.
|
|
9
|
+
*/
|
|
10
|
+
/** Core error codes of the wire error body; each key equals its value. The catalog is open. */
|
|
11
|
+
const ERROR_CODES = {
|
|
12
|
+
account_state_locked: "account_state_locked",
|
|
13
|
+
unauthorized: "unauthorized",
|
|
14
|
+
validation_error: "validation_error",
|
|
15
|
+
not_found: "not_found",
|
|
16
|
+
conflict: "conflict",
|
|
17
|
+
forbidden: "forbidden",
|
|
18
|
+
rate_limited: "rate_limited",
|
|
19
|
+
gone: "gone",
|
|
20
|
+
unprocessable_entity: "unprocessable_entity",
|
|
21
|
+
bad_request: "bad_request",
|
|
22
|
+
internal_error: "internal_error",
|
|
23
|
+
service_unavailable: "service_unavailable"
|
|
24
|
+
};
|
|
25
|
+
/** Names of the session headers exchanged with browser clients. */
|
|
26
|
+
const HEADERS = {
|
|
27
|
+
AUTHORIZATION: "authorization",
|
|
28
|
+
REFRESH_TOKEN: "x-eva-refresh-token",
|
|
29
|
+
NEW_ACCESS_TOKEN: "x-eva-new-access-token",
|
|
30
|
+
NEW_REFRESH_TOKEN: "x-eva-new-refresh-token"
|
|
31
|
+
};
|
|
32
|
+
/** Names of the headers of the service-to-service signed requests and responses. */
|
|
33
|
+
const INTERNAL_HEADERS = {
|
|
34
|
+
X_EVA_CLIENT_ID: "x-eva-client-id",
|
|
35
|
+
X_EVA_TIMESTAMP: "x-eva-timestamp",
|
|
36
|
+
X_EVA_NONCE: "x-eva-nonce",
|
|
37
|
+
X_EVA_SIGNATURE: "x-eva-signature",
|
|
38
|
+
X_EVA_SERVER_TIME: "x-eva-server-time"
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Account states, as an OBJECT with each key equal to its value: it is the public shape of the SDK
|
|
42
|
+
* (`ACCOUNT_STATES.suspendido`), unlike the two tuples below.
|
|
43
|
+
*/
|
|
44
|
+
const ACCOUNT_STATES = {
|
|
45
|
+
no_verificado: "no_verificado",
|
|
46
|
+
verificado: "verificado",
|
|
47
|
+
pendiente_de_verificacion: "pendiente_de_verificacion",
|
|
48
|
+
suspendido: "suspendido",
|
|
49
|
+
baneado: "baneado",
|
|
50
|
+
eliminado: "eliminado"
|
|
51
|
+
};
|
|
52
|
+
/** Presence states of a user. A tuple so that schemas can build an enum straight from it. */
|
|
53
|
+
const ACTIVITY_STATES = [
|
|
54
|
+
"activo",
|
|
55
|
+
"ausente",
|
|
56
|
+
"ocupado",
|
|
57
|
+
"desconectado"
|
|
58
|
+
];
|
|
59
|
+
/** Privacy states of a user profile. A tuple, like {@link ACTIVITY_STATES}. */
|
|
60
|
+
const PRIVACY_STATES = [
|
|
61
|
+
"publico",
|
|
62
|
+
"amigos",
|
|
63
|
+
"invisible"
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Most ids accepted by one users batch call. The batch request schema does NOT carry this limit
|
|
67
|
+
* (a schema maximum would change the published OpenAPI document): whoever applies the limit reads
|
|
68
|
+
* this constant. It lives here, in a PURE module, so the SDK client can import it by value.
|
|
69
|
+
*/
|
|
70
|
+
const USERS_BATCH_MAX_IDS = 100;
|
|
71
|
+
/**
|
|
72
|
+
* Names of the headers a webhook receiver reads (lower case, as receivers see them): the signature,
|
|
73
|
+
* the event id and the timestamp. Names only, never values.
|
|
74
|
+
*/
|
|
75
|
+
const WEBHOOK_HEADERS = {
|
|
76
|
+
SIGNATURE: "x-eva-webhook-signature",
|
|
77
|
+
ID: "x-eva-webhook-id",
|
|
78
|
+
TIMESTAMP: "x-eva-webhook-timestamp"
|
|
79
|
+
};
|
|
80
|
+
/** Seconds around "now" within which a receiver accepts the timestamp of a webhook. */
|
|
81
|
+
const WEBHOOK_TIMESTAMP_WINDOW_SECONDS = 300;
|
|
82
|
+
/**
|
|
83
|
+
* Delivery states of a webhook. A tuple, like the other enums: the API database enum is checked
|
|
84
|
+
* against it at compile time.
|
|
85
|
+
*/
|
|
86
|
+
const DELIVERY_STATUSES = [
|
|
87
|
+
"pending",
|
|
88
|
+
"delivering",
|
|
89
|
+
"success",
|
|
90
|
+
"expired"
|
|
91
|
+
];
|
|
92
|
+
export { HEADERS as a, USERS_BATCH_MAX_IDS as c, ERROR_CODES as i, WEBHOOK_HEADERS as l, ACTIVITY_STATES as n, INTERNAL_HEADERS as o, DELIVERY_STATUSES as r, PRIVACY_STATES as s, ACCOUNT_STATES as t, WEBHOOK_TIMESTAMP_WINDOW_SECONDS as u };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=constants-rNuD5qJn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-rNuD5qJn.js","names":[],"sources":["../../auth-contracts/dist/constants.js"],"sourcesContent":["// src/constants.ts\n/**\n* PURE module: it must never reference `zod` or any schema module of this package. The SDK\n* `react` entry imports these values, and a schema module reached from there would drag its\n* load-time metadata registration into the react bundle (enforced by a test in this package and\n* by the SDK closure gate).\n*\n* Wire values only: error codes and header NAMES. Nothing here is configuration.\n*/\n/** Core error codes of the wire error body; each key equals its value. The catalog is open. */\nconst ERROR_CODES = {\n\taccount_state_locked: \"account_state_locked\",\n\tunauthorized: \"unauthorized\",\n\tvalidation_error: \"validation_error\",\n\tnot_found: \"not_found\",\n\tconflict: \"conflict\",\n\tforbidden: \"forbidden\",\n\trate_limited: \"rate_limited\",\n\tgone: \"gone\",\n\tunprocessable_entity: \"unprocessable_entity\",\n\tbad_request: \"bad_request\",\n\tinternal_error: \"internal_error\",\n\tservice_unavailable: \"service_unavailable\"\n};\n/** Names of the session headers exchanged with browser clients. */\nconst HEADERS = {\n\tAUTHORIZATION: \"authorization\",\n\tREFRESH_TOKEN: \"x-eva-refresh-token\",\n\tNEW_ACCESS_TOKEN: \"x-eva-new-access-token\",\n\tNEW_REFRESH_TOKEN: \"x-eva-new-refresh-token\"\n};\n/** Names of the headers of the service-to-service signed requests and responses. */\nconst INTERNAL_HEADERS = {\n\tX_EVA_CLIENT_ID: \"x-eva-client-id\",\n\tX_EVA_TIMESTAMP: \"x-eva-timestamp\",\n\tX_EVA_NONCE: \"x-eva-nonce\",\n\tX_EVA_SIGNATURE: \"x-eva-signature\",\n\tX_EVA_SERVER_TIME: \"x-eva-server-time\"\n};\n/**\n* Account states, as an OBJECT with each key equal to its value: it is the public shape of the SDK\n* (`ACCOUNT_STATES.suspendido`), unlike the two tuples below.\n*/\nconst ACCOUNT_STATES = {\n\tno_verificado: \"no_verificado\",\n\tverificado: \"verificado\",\n\tpendiente_de_verificacion: \"pendiente_de_verificacion\",\n\tsuspendido: \"suspendido\",\n\tbaneado: \"baneado\",\n\teliminado: \"eliminado\"\n};\n/** Presence states of a user. A tuple so that schemas can build an enum straight from it. */\nconst ACTIVITY_STATES = [\n\t\"activo\",\n\t\"ausente\",\n\t\"ocupado\",\n\t\"desconectado\"\n];\n/** Privacy states of a user profile. A tuple, like {@link ACTIVITY_STATES}. */\nconst PRIVACY_STATES = [\n\t\"publico\",\n\t\"amigos\",\n\t\"invisible\"\n];\n/**\n* Most ids accepted by one users batch call. The batch request schema does NOT carry this limit\n* (a schema maximum would change the published OpenAPI document): whoever applies the limit reads\n* this constant. It lives here, in a PURE module, so the SDK client can import it by value.\n*/\nconst USERS_BATCH_MAX_IDS = 100;\n/**\n* Names of the headers a webhook receiver reads (lower case, as receivers see them): the signature,\n* the event id and the timestamp. Names only, never values.\n*/\nconst WEBHOOK_HEADERS = {\n\tSIGNATURE: \"x-eva-webhook-signature\",\n\tID: \"x-eva-webhook-id\",\n\tTIMESTAMP: \"x-eva-webhook-timestamp\"\n};\n/** Seconds around \"now\" within which a receiver accepts the timestamp of a webhook. */\nconst WEBHOOK_TIMESTAMP_WINDOW_SECONDS = 300;\n/**\n* Delivery states of a webhook. A tuple, like the other enums: the API database enum is checked\n* against it at compile time.\n*/\nconst DELIVERY_STATUSES = [\n\t\"pending\",\n\t\"delivering\",\n\t\"success\",\n\t\"expired\"\n];\nexport { ACCOUNT_STATES, ACTIVITY_STATES, DELIVERY_STATUSES, ERROR_CODES, HEADERS, INTERNAL_HEADERS, PRIVACY_STATES, USERS_BATCH_MAX_IDS, WEBHOOK_HEADERS, WEBHOOK_TIMESTAMP_WINDOW_SECONDS };\n\n//# sourceMappingURL=constants.js.map"],"mappings":";;;;;;;;;;AAUA,MAAM,cAAc;CACnB,sBAAsB;CACtB,cAAc;CACd,kBAAkB;CAClB,WAAW;CACX,UAAU;CACV,WAAW;CACX,cAAc;CACd,MAAM;CACN,sBAAsB;CACtB,aAAa;CACb,gBAAgB;CAChB,qBAAqB;AACtB;;AAEA,MAAM,UAAU;CACf,eAAe;CACf,eAAe;CACf,kBAAkB;CAClB,mBAAmB;AACpB;;AAEA,MAAM,mBAAmB;CACxB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,iBAAiB;CACjB,mBAAmB;AACpB;;;;;AAKA,MAAM,iBAAiB;CACtB,eAAe;CACf,YAAY;CACZ,2BAA2B;CAC3B,YAAY;CACZ,SAAS;CACT,WAAW;AACZ;;AAEA,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;AACD;;AAEA,MAAM,iBAAiB;CACtB;CACA;CACA;AACD;;;;;;AAMA,MAAM,sBAAsB;;;;;AAK5B,MAAM,kBAAkB;CACvB,WAAW;CACX,IAAI;CACJ,WAAW;AACZ;;AAEA,MAAM,mCAAmC;;;;;AAKzC,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;AACD"}
|