0
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 /*
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 * Copyright (C) 2010 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 *
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 * This file is part of PSĜS, a PubSub server written in JavaScript.
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 *
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 * PSĜS is free software: you can redistribute it and/or modify
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 * it under the terms of the GNU Affero General Public License as
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 * published by the Free Software Foundation, either version 3 of the
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 * License.
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 *
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 * PSĜS is distributed in the hope that it will be useful,
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 * GNU Affero General Public License for more details.
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 *
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU Affero General Public License
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 * along with PSĜS. If not, see <http://www.gnu.org/licenses/>.
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 */
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
19
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 var errors = exports;
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 errors.success = true;
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 errors.feature_not_implemented = {n: 1, type: 'cancel', error: 'feature-not-implemented'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 errors.node_does_not_exist = {n: 2, type: 'cancel', error: 'item-not-found'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 errors.bad_request = {n: 3, type: 'modify', error: 'bad-request'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 errors.nodeid_required = {n: 4, type: 'modify', error: 'bad-request', reason: 'nodeid-required'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
27 errors.itemid_required = {n: 5, type: 'modify', error: 'bad-request', reason: 'item-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
28 errors.forbidden = {n: 6, type: 'auth', error: 'forbidden'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
29 errors.subscriptions_retrieval_not_supported = {n: 23, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'retrieve-subscriptions'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
30 errors.affiliations_retrieval_not_supported = {n: 29, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'retrieve-affiliations'};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
31
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
32 errors.sub = {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 subscribe: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
34 jids_do_not_match: {n: 34, type: 'modify', error: 'bad-request', reason: 'invalid-jid'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
35 presence_subscription_required: {n: 35, type: 'auth', error: 'not-authorized', reason: 'presence-subscription-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
36 not_in_roster_group: {n: 36, type: 'auth', error: 'not-authorized', reason: 'not-in-roster-group'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
37 not_on_whitelist: {n: 37, type: 'cancel', error: 'not-allowed', reason: 'closed-node'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
38 payment_required: {n: 38, type: 'auth', error: 'payment-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
39 anonymous_subscriptions_not_allowed: {n: 39, type: 'cancel', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 subscription_pending: {n: 40, type: 'auth', error: 'not-authorized', reason: 'pending-subscription'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
41 blocked: {n: 41, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
42 too_many_subscriptions: {n: 42, type: 'wait', error: 'policy-violation', reason: 'too-many-subscriptions'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
43 not_supported: {n: 43, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'subscribe'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 node_has_moved: {n: 44, type: 'modify', error: 'gone', text: true},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
45 node_does_not_exist: {n: 45, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
46 configuration_required: {n: 48, type: 'modify', error: 'not-acceptable', reason: 'configuration-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
47 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
48 unsubscribe: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
49 no_subscription_id: {n: 53, type: 'modify', error: 'bad-request', reason: 'subid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
50 no_such_subscriber: {n: 54, type: 'cancel', error: 'unexpected-request', reason: 'not-subscribed'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
51 insufficient_privileges: {n: 55, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
52 node_does_not_exist: {n: 56, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
53 bad_subscription_id: {n: 57, type: 'modify', error: 'not-acceptable', reason: 'invalid-subid'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
54 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
55 configure: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
56 insufficient_privileges: {n: 61, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
57 no_such_subscriber: {n: 62, type: 'modify', error: 'unexpected-request', reason: 'not-subscribed'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
58 subscriber_jid_required: {n: 63, type: 'modify', error: 'bad-request', reason: 'jid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
59 subscription_id_required: {n: 64, type: 'modify', error: 'bad-request', reason: 'subid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
60 invalid_subscription_id: {n: 65, type: 'modify', error: 'not-acceptable', reason: 'invalid-subid'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
61 subscription_options_not_supported: {n: 66, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'subscription-options'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
62 node_does_not_exist: {n: 67, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
63 form_processing_failure: {n: 70, type: 'modify', error: 'bad-request', reason: 'invalid-options'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
64 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
65 default_options: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
66 node_configuration_not_supported: {n: 76, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'subscription-options'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
67 default_subscription_configuration_retrieval_not_supported: {n: 77, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'retrieve-default-sub'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
68 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
69 retrieve: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
70 subscription_id_required: {n: 87, type: 'modify', error: 'bad-request', reason: 'subid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
71 invalid_subscription_id: {n: 88, type: 'modify', error: 'not-acceptable', reason: 'invalid-subid xmlns'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
72 entity_not_subscribed: {n: 89, type: 'auth', error: 'not-authorized', reason: 'not-subscribed'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
73 persistent_items_not_supported: {n: 90, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'persistent-items'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 item_retrieval_not_supported: {n: 91, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'retrieve-items'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
75 presence_subscription_required: {n: 92, type: 'auth', error: 'not-authorized', reason: 'presence-subscription-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
76 not_in_roster_group: {n: 93, type: 'auth', error: 'not-authorized', reason: 'not-in-roster-group'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
77 not_on_whitelist: {n: 94, type: 'cancel', error: 'not-allowed', reason: 'closed-node'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
78 payment_required: {n: 95, type: 'auth', error: 'payment-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
79 blocked: {n: 96, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
80 node_does_not_exist: {n: 97, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
81 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
82 };
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
83
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
84 errors.pub = {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
85 publish: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
86 insufficient_privileges: {n: 105, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
87 item_publication_not_supported: {n: 106, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'publish'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
88 node_does_not_exist: {n: 107, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
89 payload_too_big: {n: 108, type: 'modify', error: 'not-acceptable', reason: 'payload-too-big'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
90 bad_payload: {n: 109, type: 'modify', error: 'bad-request', reason: 'invalid-payload'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
91 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
92 configuration: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
93 no_item: {n: 110, type: 'modify', error: 'bad-request', reason: 'item-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
94 no_payload: {n: 111, type: 'modify', error: 'bad-request', reason: 'payload-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
95 transient_item: {n: 112, type: 'modify', error: 'bad-request', reason: 'item-forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
96 precondition: {n: 113, type: 'modify', error: 'conflict', reason: 'precondition-not-met'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
97
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 retract: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
100 insufficient_privileges: {n: 118, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
101 node_does_not_exist: {n: 119, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
102 nodeid_required: {n: 120, type: 'modify', error: 'bad-request', reason: 'nodeid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
103 item_or_itemid_required: {n: 121, type: 'modify', error: 'bad-request', reason: 'item-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
104 persistent_items_not_supported: {n: 122, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'persistent-items'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
105 item_deletion_not_supported: {n: 123, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'delete-items'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
106 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
107 };
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
108
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
109 errors.owner = {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
110 create: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 node_creation_not_supported: {n: 125, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'create-nodes'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
112 service_requires_registration: {n: 126, type: 'auth', error: 'registration-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
113 prohibited: {n: 127, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
114 nodeid_already_exists: {n: 128, type: 'cancel', error: 'conflict'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
115 instant_nodes_not_supported: {n: 129, type: 'modify', error: 'not-acceptable', reason: 'nodeid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
116 specified_access_model_not_supported: {n: 135, type: 'modify', error: 'not-acceptable', reason: 'unsupported-access-model'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
117 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
118 configure: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
119 node_configuration_not_supported: {n: 140, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'config-node'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
120 insufficient_privileges: {n: 141, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
121 nodeid_required: {n: 142, type: 'modify', error: 'bad-request', reason: 'nodeid-required'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
122 no_configuration_options: {n: 143, type: 'cancel', error: 'not-allowed'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
123 node_does_not_exist: {n: 144, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
124 form_processing_failure: {n: 148, type: 'modify', error: 'not-acceptable'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
125 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
126 default_options: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
127 node_configuration_not_supported: {n: 153, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'config-node'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
128 default_node_configuration_retrieval_not_supported: {n: 154, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'retrieve-default'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
129 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
130 delete_node: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
131 insufficient_privileges: {n: 159, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
132 node_does_not_exist: {n: 160, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
133 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
134 purge: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
135 node_purging_not_supported: {n: 164, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'purge-nodes'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
136 insufficient_privileges: {n: 165, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
137 node_does_not_persist_items: {n: 166, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'persistent-items'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
138 node_does_not_exist: {n: 167, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
139 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
140 //manage_subscription_requests: {},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
141 pending_subscription_requests: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
142 ad_hoc_commands_not_supported: {n: 176, type: 'cancel', error: 'service-unavailable'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
143 get_pending_not_supported: {n: 177, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'get-pending'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
144 insufficient_privileges: {n: 178, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
145 node_does_not_exist: {n: 179, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
146 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
147 manage_subscriptions: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
148 not_supported: {n: 184, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'manage-subscriptions'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
149 retrieve_list: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
150 entity_is_not_an_owner: {n: 185, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
151 node_does_not_exist: {n: 186, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
152 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
153 modify: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
154 entity_is_not_an_owner: {n: 190, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
155 node_does_not_exist: {n: 191, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
156 multiple_simultaneous_modifications: {n: 193, type: 'modify', error: 'not-acceptable'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
157 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
158 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
159 manage_affiliations: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
160 not_supported: {n: 197, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'modify-affiliations'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
161 retrieve_list: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
162 entity_is_not_an_owner: {n: 198, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
163 node_does_not_exist: {n: 199, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
164 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
165 modify: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
166 requested_affiliation_not_supported: {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
167 publisher: {n: 203, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'publisher-affiliation'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
168 'publish-only': {n: 203, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'publish-only-affiliation'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
169 member: {n: 203, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'member-affiliation'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
170 outcast: {n: 203, type: 'cancel', error: 'feature-not-implemented', reason: 'unsupported', feature: 'outcast-affiliation'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
171 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
172 entity_is_not_an_owner: {n: 204, type: 'auth', error: 'forbidden'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
173 node_does_not_exist: {n: 205, type: 'cancel', error: 'item-not-found'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
174 multiple_simultaneous_modifications: {n: 207, type: 'modify', error: 'not-acceptable'},
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
175 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
176 },
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
177 };
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
178
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
179 errors.reverse = {};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
180
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
181 function reverseError(o) {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
182 for (var i in o) {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
183 if (i == 'reverse' || typeof (o[i]) == 'number');
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
184 else if (!o[i].n)
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
185 reverseError(o[i]);
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
186 else {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
187 var k = {};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
188 //var k = {name: i};
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
189 for (var j in o[i]) {
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
190 if (j != 'n')
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
191 k[j] = o[i][j];
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
192 }
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
193 errors.reverse[o[i].n] = k;
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
194 }
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
195 }
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
196 }
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
197
|
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
198 reverseError(errors);
|