@api-client/core 0.19.31 → 0.19.33

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.
Files changed (232) hide show
  1. package/build/src/authorization/index.d.ts +10 -0
  2. package/build/src/authorization/index.d.ts.map +1 -0
  3. package/build/src/authorization/index.js +10 -0
  4. package/build/src/authorization/index.js.map +1 -0
  5. package/build/src/browser.d.ts +13 -143
  6. package/build/src/browser.d.ts.map +1 -1
  7. package/build/src/browser.js +10 -144
  8. package/build/src/browser.js.map +1 -1
  9. package/build/src/data/DataExtractor.d.ts +1 -2
  10. package/build/src/data/DataExtractor.d.ts.map +1 -1
  11. package/build/src/data/DataExtractor.js.map +1 -1
  12. package/build/src/data/index.d.ts +10 -0
  13. package/build/src/data/index.d.ts.map +1 -0
  14. package/build/src/data/index.js +10 -0
  15. package/build/src/data/index.js.map +1 -0
  16. package/build/src/events/Events.d.ts +3 -3
  17. package/build/src/events/index.d.ts +11 -0
  18. package/build/src/events/index.d.ts.map +1 -0
  19. package/build/src/events/index.js +4 -0
  20. package/build/src/events/index.js.map +1 -0
  21. package/build/src/exceptions/index.d.ts +8 -0
  22. package/build/src/exceptions/index.d.ts.map +1 -0
  23. package/build/src/exceptions/index.js +8 -0
  24. package/build/src/exceptions/index.js.map +1 -0
  25. package/build/src/index.d.ts +10 -138
  26. package/build/src/index.d.ts.map +1 -1
  27. package/build/src/index.js +11 -142
  28. package/build/src/index.js.map +1 -1
  29. package/build/src/mocking/lib/User.d.ts.map +1 -1
  30. package/build/src/mocking/lib/User.js +1 -1
  31. package/build/src/mocking/lib/User.js.map +1 -1
  32. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  33. package/build/src/modeling/ApiModel.js +0 -8
  34. package/build/src/modeling/ApiModel.js.map +1 -1
  35. package/build/src/modeling/RuntimeApiModel.d.ts +16 -0
  36. package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -1
  37. package/build/src/modeling/RuntimeApiModel.js +31 -0
  38. package/build/src/modeling/RuntimeApiModel.js.map +1 -1
  39. package/build/src/modeling/ai/DataDomainDelta.d.ts +3 -3
  40. package/build/src/modeling/ai/DataDomainDelta.d.ts.map +1 -1
  41. package/build/src/modeling/ai/DataDomainDelta.js +3 -3
  42. package/build/src/modeling/ai/DataDomainDelta.js.map +1 -1
  43. package/build/src/modeling/amf/index.d.ts +4 -0
  44. package/build/src/modeling/amf/index.d.ts.map +1 -0
  45. package/build/src/modeling/amf/index.js +4 -0
  46. package/build/src/modeling/amf/index.js.map +1 -0
  47. package/build/src/modeling/index.d.ts +18 -1
  48. package/build/src/modeling/index.d.ts.map +1 -1
  49. package/build/src/modeling/index.js +14 -1
  50. package/build/src/modeling/index.js.map +1 -1
  51. package/build/src/modeling/types.d.ts +0 -15
  52. package/build/src/modeling/types.d.ts.map +1 -1
  53. package/build/src/modeling/types.js.map +1 -1
  54. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
  55. package/build/src/modeling/validation/api_model_rules.js +49 -46
  56. package/build/src/modeling/validation/api_model_rules.js.map +1 -1
  57. package/build/src/models/index.d.ts +64 -0
  58. package/build/src/models/index.d.ts.map +1 -0
  59. package/build/src/models/index.js +68 -0
  60. package/build/src/models/index.js.map +1 -0
  61. package/build/src/models/store/CustomDomain.d.ts +1 -1
  62. package/build/src/models/store/CustomDomain.d.ts.map +1 -1
  63. package/build/src/models/store/CustomDomain.js +2 -2
  64. package/build/src/models/store/CustomDomain.js.map +1 -1
  65. package/build/src/models/store/{data_catalog.d.ts → DataCatalog.d.ts} +1 -1
  66. package/build/src/models/store/DataCatalog.d.ts.map +1 -0
  67. package/build/src/models/store/DataCatalog.js +2 -0
  68. package/build/src/models/store/DataCatalog.js.map +1 -0
  69. package/build/src/models/store/DeploymentCustomDomain.d.ts +1 -1
  70. package/build/src/models/store/DeploymentCustomDomain.d.ts.map +1 -1
  71. package/build/src/models/store/DeploymentCustomDomain.js +2 -2
  72. package/build/src/models/store/DeploymentCustomDomain.js.map +1 -1
  73. package/build/src/models/store/File.d.ts.map +1 -1
  74. package/build/src/models/store/File.js +1 -2
  75. package/build/src/models/store/File.js.map +1 -1
  76. package/build/src/models/store/User.d.ts +3 -3
  77. package/build/src/models/store/User.d.ts.map +1 -1
  78. package/build/src/models/store/User.js +1 -1
  79. package/build/src/models/store/User.js.map +1 -1
  80. package/build/src/models/store/index.d.ts +17 -0
  81. package/build/src/models/store/index.d.ts.map +1 -0
  82. package/build/src/models/store/index.js +10 -0
  83. package/build/src/models/store/index.js.map +1 -0
  84. package/build/src/patch/index.d.ts +3 -0
  85. package/build/src/patch/index.d.ts.map +1 -0
  86. package/build/src/patch/index.js +2 -0
  87. package/build/src/patch/index.js.map +1 -0
  88. package/build/src/sdk/GroupsSdk.d.ts +1 -1
  89. package/build/src/sdk/GroupsSdk.d.ts.map +1 -1
  90. package/build/src/sdk/GroupsSdk.js.map +1 -1
  91. package/build/src/sdk/StoreSdkNode.d.ts +0 -4
  92. package/build/src/sdk/StoreSdkNode.d.ts.map +1 -1
  93. package/build/src/sdk/StoreSdkNode.js.map +1 -1
  94. package/build/src/sdk/StoreSdkWeb.d.ts +1 -5
  95. package/build/src/sdk/StoreSdkWeb.d.ts.map +1 -1
  96. package/build/src/sdk/StoreSdkWeb.js +1 -1
  97. package/build/src/sdk/StoreSdkWeb.js.map +1 -1
  98. package/build/src/sdk/index.d.ts +8 -0
  99. package/build/src/sdk/index.d.ts.map +1 -0
  100. package/build/src/sdk/index.js +3 -0
  101. package/build/src/sdk/index.js.map +1 -0
  102. package/build/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +1 -1
  104. package/src/data/DataExtractor.ts +1 -1
  105. package/src/mocking/lib/User.ts +2 -1
  106. package/src/modeling/ApiModel.ts +0 -10
  107. package/src/modeling/RuntimeApiModel.ts +46 -0
  108. package/src/modeling/ai/DataDomainDelta.ts +5 -11
  109. package/src/modeling/readme.md +2 -2
  110. package/src/modeling/types.ts +0 -15
  111. package/src/modeling/validation/api_model_rules.ts +50 -48
  112. package/src/modeling/validation/api_model_validation_rules.md +2 -2
  113. package/src/models/store/CustomDomain.ts +2 -2
  114. package/src/models/store/DeploymentCustomDomain.ts +2 -2
  115. package/src/models/store/File.ts +2 -2
  116. package/src/models/store/User.ts +3 -4
  117. package/src/sdk/GroupsSdk.ts +1 -1
  118. package/src/sdk/StoreSdkNode.ts +0 -11
  119. package/src/sdk/StoreSdkWeb.ts +1 -12
  120. package/tests/unit/authorization/SecurityProcessor.spec.ts +2 -1
  121. package/tests/unit/data/JmesparthReader.spec.ts +1 -1
  122. package/tests/unit/data/JsonReader.spec.ts +1 -1
  123. package/tests/unit/data/PayloadPointer.spec.ts +1 -1
  124. package/tests/unit/data/RequestDataExtractor.spec.ts +9 -13
  125. package/tests/unit/data/UrlEncodedReader.spec.ts +1 -1
  126. package/tests/unit/data/XmlReader.spec.ts +1 -1
  127. package/tests/unit/mocking/current/Certificates.spec.ts +1 -1
  128. package/tests/unit/mocking/current/HostRules.spec.ts +1 -1
  129. package/tests/unit/mocking/current/Urls.spec.ts +1 -1
  130. package/tests/unit/mocking/current/User.spec.ts +2 -2
  131. package/tests/unit/modeling/RuntimeApiModel.spec.ts +31 -0
  132. package/tests/unit/modeling/ai/DataDomainDelta.spec.ts +1 -1
  133. package/tests/unit/modeling/ai/DomainSerialization.spec.ts +1 -1
  134. package/tests/unit/modeling/ai/tools/DataDomain.tools.spec.ts +1 -1
  135. package/tests/unit/modeling/amf/shape_generator.spec.ts +1 -1
  136. package/tests/unit/modeling/api_model.spec.ts +8 -9
  137. package/tests/unit/modeling/api_model_expose_entity.spec.ts +1 -1
  138. package/tests/unit/modeling/api_model_remove_entity.spec.ts +1 -1
  139. package/tests/unit/modeling/data_domain.spec.ts +2 -1
  140. package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
  141. package/tests/unit/modeling/data_domain_serialization.spec.ts +2 -2
  142. package/tests/unit/modeling/definitions/phone.spec.ts +1 -1
  143. package/tests/unit/modeling/domain_asociation.spec.ts +34 -34
  144. package/tests/unit/modeling/domain_asociation_targets.spec.ts +1 -1
  145. package/tests/unit/modeling/domain_entity.spec.ts +3 -9
  146. package/tests/unit/modeling/domain_entity_associations.spec.ts +1 -1
  147. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +1 -1
  148. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1 -1
  149. package/tests/unit/modeling/domain_entity_fields.spec.ts +1 -1
  150. package/tests/unit/modeling/domain_entity_generators.spec.ts +1 -1
  151. package/tests/unit/modeling/domain_entity_parents.spec.ts +1 -1
  152. package/tests/unit/modeling/domain_entity_properties.spec.ts +2 -1
  153. package/tests/unit/modeling/domain_file.spec.ts +2 -1
  154. package/tests/unit/modeling/domain_impact_analysis.spec.ts +5 -3
  155. package/tests/unit/modeling/domain_model.spec.ts +3 -8
  156. package/tests/unit/modeling/domain_model_entities.spec.ts +2 -1
  157. package/tests/unit/modeling/domain_namespace.spec.ts +3 -9
  158. package/tests/unit/modeling/domain_namespace_models.spec.ts +1 -1
  159. package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +1 -1
  160. package/tests/unit/modeling/domain_property.spec.ts +3 -1
  161. package/tests/unit/modeling/domain_validation.spec.ts +1 -1
  162. package/tests/unit/modeling/domain_versioning.spec.ts +1 -1
  163. package/tests/unit/modeling/exposed_entity.spec.ts +1 -1
  164. package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
  165. package/tests/unit/modeling/generators/OasGenerator.spec.ts +1 -3
  166. package/tests/unit/modeling/helpers/intellisense.spec.ts +1 -1
  167. package/tests/unit/modeling/importers/json_schema_importer.spec.ts +1 -1
  168. package/tests/unit/modeling/validation/api_model_rules.spec.ts +12 -12
  169. package/tests/unit/modeling/validation/association_validation.spec.ts +1 -1
  170. package/tests/unit/modeling/validation/entity_validation.spec.ts +1 -1
  171. package/tests/unit/modeling/validation/property_validation.spec.ts +1 -1
  172. package/tests/unit/models/Certificate/from_name.spec.ts +2 -1
  173. package/tests/unit/models/File/addLabel.spec.ts +1 -1
  174. package/tests/unit/models/File/constructor.spec.ts +2 -1
  175. package/tests/unit/models/File/createFileCapabilities.spec.ts +1 -1
  176. package/tests/unit/models/File/new.spec.ts +2 -1
  177. package/tests/unit/models/File/setDeleted.spec.ts +1 -1
  178. package/tests/unit/models/File/setLastModified.spec.ts +1 -1
  179. package/tests/unit/models/File/shortcutTo.spec.ts +1 -1
  180. package/tests/unit/models/File/toJSON.spec.ts +2 -1
  181. package/tests/unit/models/File/updateByMeMeta.spec.ts +1 -1
  182. package/tests/unit/models/Folder/consume.spec.ts +2 -1
  183. package/tests/unit/models/Folder/create.spec.ts +2 -1
  184. package/tests/unit/models/Permission/all.spec.ts +1 -1
  185. package/tests/unit/models/Project/consume.spec.ts +1 -1
  186. package/tests/unit/models/Project/create.spec.ts +1 -1
  187. package/tests/unit/models/certificate.spec.ts +2 -7
  188. package/tests/unit/models/host_rule.spec.ts +1 -1
  189. package/tests/unit/models/http_project.spec.ts +1 -1
  190. package/tests/unit/models/http_request.spec.ts +2 -9
  191. package/tests/unit/models/http_response.spec.ts +2 -1
  192. package/tests/unit/models/license.spec.ts +1 -1
  193. package/tests/unit/models/response.spec.ts +2 -2
  194. package/tests/unit/models/store/CustomDomain.spec.ts +8 -8
  195. package/tests/unit/models/store/DeploymentCustomDomain.spec.ts +9 -9
  196. package/tests/unit/models/store/Invitation.spec.ts +1 -1
  197. package/tests/unit/runtime/http-engine/abort.spec.ts +2 -8
  198. package/tests/unit/runtime/http-engine/auth.spec.ts +2 -1
  199. package/tests/unit/runtime/http-engine/certificates.spec.ts +2 -1
  200. package/tests/unit/runtime/http-engine/cleanup.spec.ts +2 -1
  201. package/tests/unit/runtime/http-engine/compression.spec.ts +2 -1
  202. package/tests/unit/runtime/http-engine/core_engine.spec.ts +7 -11
  203. package/tests/unit/runtime/http-engine/events.spec.ts +2 -1
  204. package/tests/unit/runtime/http-engine/headers.spec.ts +2 -9
  205. package/tests/unit/runtime/http-engine/hosts.spec.ts +2 -1
  206. package/tests/unit/runtime/http-engine/http-get.spec.ts +2 -1
  207. package/tests/unit/runtime/http-engine/http-post.spec.ts +2 -9
  208. package/tests/unit/runtime/http-engine/logger.spec.ts +2 -1
  209. package/tests/unit/runtime/http-engine/message.spec.ts +2 -8
  210. package/tests/unit/runtime/http-engine/params.spec.ts +2 -10
  211. package/tests/unit/runtime/http-engine/proxy.spec.ts +2 -10
  212. package/tests/unit/runtime/http-engine/redirects.spec.ts +4 -6
  213. package/tests/unit/runtime/http-engine/request_utils.spec.ts +2 -1
  214. package/tests/unit/runtime/http-engine/responses.spec.ts +2 -10
  215. package/tests/unit/runtime/http-engine/timeout.spec.ts +2 -8
  216. package/tests/unit/runtime/http-engine/timings.spec.ts +2 -1
  217. package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +3 -8
  218. package/tests/unit/runtime/proxy/RequestProxy.spec.ts +6 -7
  219. package/tests/unit/runtime/reporters/project_run_cli_reporter.spec.ts +2 -7
  220. package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +2 -2
  221. package/tests/unit/runtime/runners/http_flow_runner.spec.ts +2 -2
  222. package/tests/unit/runtime/runners/parallel_runner.spec.ts +2 -2
  223. package/tests/unit/runtime/runners/project_runner.spec.ts +2 -5
  224. package/tests/unit/runtime/runners/request_runner.spec.ts +2 -5
  225. package/tests/unit/runtime/runners/serial_runner.spec.ts +2 -3
  226. package/tests/unit/runtime/variables/variables_processor.spec.ts +2 -1
  227. package/tsconfig.browser.json +3 -4
  228. package/tsconfig.node.json +1 -3
  229. package/build/src/models/store/data_catalog.d.ts.map +0 -1
  230. package/build/src/models/store/data_catalog.js +0 -2
  231. package/build/src/models/store/data_catalog.js.map +0 -1
  232. /package/src/models/store/{data_catalog.ts → DataCatalog.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CustomDomain.js","sourceRoot":"","sources":["../../../../src/models/store/CustomDomain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,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,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\n\nexport interface CustomDomainSchema {\n /**\n * Primary key (nanoid)\n */\n id: string\n /**\n * ID of the organization\n */\n orgId: string\n /**\n * The custom domain\n */\n domain: string\n /**\n * The DNS target for the custom domain\n */\n dnsTarget: string\n /**\n * Whether the DNS has been verified\n */\n dnsVerified: boolean\n /**\n * Timestamp of last DNS verification\n */\n lastVerifiedAt?: number\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n}\n\nexport class CustomDomainModel implements CustomDomainSchema {\n id: string\n orgId: string\n domain: string\n dnsTarget: string\n dnsVerified: boolean\n lastVerifiedAt?: number\n createdAt: number\n updatedAt: number\n\n static createSchema(input: Partial<CustomDomainSchema> = {}): CustomDomainSchema {\n const id = input.id ?? nanoid()\n const result: CustomDomainSchema = {\n id,\n orgId: input.orgId || '',\n domain: input.domain || '',\n dnsTarget: input.dnsTarget || '',\n dnsVerified: input.dnsVerified ?? false,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n if (typeof input.lastVerifiedAt === 'number') {\n result.lastVerifiedAt = input.lastVerifiedAt\n }\n return result\n }\n\n constructor(state?: Partial<CustomDomainSchema>) {\n const init = CustomDomainModel.createSchema(state)\n this.id = init.id\n this.orgId = init.orgId\n this.domain = init.domain\n this.dnsTarget = init.dnsTarget\n this.dnsVerified = init.dnsVerified\n this.lastVerifiedAt = init.lastVerifiedAt\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n }\n\n toJSON(): CustomDomainSchema {\n const result: CustomDomainSchema = {\n id: this.id,\n orgId: this.orgId,\n domain: this.domain,\n dnsTarget: this.dnsTarget,\n dnsVerified: this.dnsVerified,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n if (typeof this.lastVerifiedAt === 'number') {\n result.lastVerifiedAt = this.lastVerifiedAt\n }\n return result\n }\n\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n if (!this.domain) {\n result.push({\n field: 'domain',\n message: 'Domain must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.orgId) {\n result.push({\n field: 'orgId',\n message: 'Org ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.dnsTarget) {\n result.push({\n field: 'dnsTarget',\n message: 'DNS target must not be empty',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"CustomDomain.js","sourceRoot":"","sources":["../../../../src/models/store/CustomDomain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAqCxC,MAAM,OAAO,YAAY;IACvB,EAAE,CAAQ;IACV,KAAK,CAAQ;IACb,MAAM,CAAQ;IACd,SAAS,CAAQ;IACjB,WAAW,CAAS;IACpB,cAAc,CAAS;IACvB,SAAS,CAAQ;IACjB,SAAS,CAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAAqC,EAAE;QACzD,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;QAC/B,MAAM,MAAM,GAAuB;YACjC,EAAE;YACF,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;YAChC,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK;YACvC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE;YACxC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE;SACzC,CAAA;QACD,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC7C,MAAM,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAA;QAC9C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EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,0BAA0B;gBACnC,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,WAAW;gBAClB,OAAO,EAAE,8BAA8B;gBACvC,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\n\nexport interface CustomDomainSchema {\n /**\n * Primary key (nanoid)\n */\n id: string\n /**\n * ID of the organization\n */\n orgId: string\n /**\n * The custom domain\n */\n domain: string\n /**\n * The DNS target for the custom domain\n */\n dnsTarget: string\n /**\n * Whether the DNS has been verified\n */\n dnsVerified: boolean\n /**\n * Timestamp of last DNS verification\n */\n lastVerifiedAt?: number\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n}\n\nexport class CustomDomain implements CustomDomainSchema {\n id: string\n orgId: string\n domain: string\n dnsTarget: string\n dnsVerified: boolean\n lastVerifiedAt?: number\n createdAt: number\n updatedAt: number\n\n static createSchema(input: Partial<CustomDomainSchema> = {}): CustomDomainSchema {\n const id = input.id ?? nanoid()\n const result: CustomDomainSchema = {\n id,\n orgId: input.orgId || '',\n domain: input.domain || '',\n dnsTarget: input.dnsTarget || '',\n dnsVerified: input.dnsVerified ?? false,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n if (typeof input.lastVerifiedAt === 'number') {\n result.lastVerifiedAt = input.lastVerifiedAt\n }\n return result\n }\n\n constructor(state?: Partial<CustomDomainSchema>) {\n const init = CustomDomain.createSchema(state)\n this.id = init.id\n this.orgId = init.orgId\n this.domain = init.domain\n this.dnsTarget = init.dnsTarget\n this.dnsVerified = init.dnsVerified\n this.lastVerifiedAt = init.lastVerifiedAt\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n }\n\n toJSON(): CustomDomainSchema {\n const result: CustomDomainSchema = {\n id: this.id,\n orgId: this.orgId,\n domain: this.domain,\n dnsTarget: this.dnsTarget,\n dnsVerified: this.dnsVerified,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n if (typeof this.lastVerifiedAt === 'number') {\n result.lastVerifiedAt = this.lastVerifiedAt\n }\n return result\n }\n\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n if (!this.domain) {\n result.push({\n field: 'domain',\n message: 'Domain must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.orgId) {\n result.push({\n field: 'orgId',\n message: 'Org ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.dnsTarget) {\n result.push({\n field: 'dnsTarget',\n message: 'DNS target must not be empty',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
@@ -69,4 +69,4 @@ export interface UnresolvedDependency {
69
69
  */
70
70
  reason: string;
71
71
  }
72
- //# sourceMappingURL=data_catalog.d.ts.map
72
+ //# sourceMappingURL=DataCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCatalog.d.ts","sourceRoot":"","sources":["../../../../src/models/store/DataCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,KAAK,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAA;IAC5C;;OAEG;IACH,SAAS,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IACpC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,wBAAwB,CAAA;IACrC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DataCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCatalog.js","sourceRoot":"","sources":["../../../../src/models/store/DataCatalog.ts"],"names":[],"mappings":"","sourcesContent":["import { UnresolvedDependencyKind } from '../kinds.js'\n\nexport interface PublishedDataDomain {\n /**\n * Globally unique key for the data domain.\n */\n key: string\n /**\n * The key of the owning organization.\n */\n oid: string\n /**\n * The access level for the published data domain.\n * The private access means that the item was unpublished.\n */\n scope: 'public' | 'organization' | 'private'\n /**\n * The lifecycle stage of the data domain.\n */\n lifecycle: 'stable' | 'beta' | 'dev'\n /**\n * The version of the published data domain.\n */\n version: string\n /**\n * Key of the referenced `DomainNamespace` document.\n * Essentially this is a document id.\n */\n fid: string\n /**\n * Human-readable name.\n */\n name: string\n /**\n * Detailed description. Text or markdown.\n */\n description: string\n /**\n * User ID of the publisher.\n */\n publishedBy: string\n /**\n * Timestamp of publication.\n */\n publishedAt: number\n unpublishedAt?: number\n /**\n * Keywords for discovery.\n */\n tags: string[]\n /**\n * Deprecation status.\n */\n isDeprecated?: boolean\n deprecatedAt?: number\n deprecationMessage?: string\n}\n\nexport interface UnresolvedDependency {\n kind: typeof UnresolvedDependencyKind\n /**\n * Key of the missing namespace.\n */\n key: string\n /**\n * The version of the missing namespace.\n */\n version: string\n /**\n * Explanation of the failure (e.g., \"Namespace unpublished\").\n */\n reason: string\n}\n"]}
@@ -36,7 +36,7 @@ export interface DeploymentCustomDomainSchema {
36
36
  */
37
37
  updatedAt: number;
38
38
  }
39
- export declare class DeploymentCustomDomainModel implements DeploymentCustomDomainSchema {
39
+ export declare class DeploymentCustomDomain implements DeploymentCustomDomainSchema {
40
40
  id: string;
41
41
  deploymentId: string;
42
42
  customDomainId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DeploymentCustomDomain.d.ts","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAGlF,oBAAY,SAAS;IACnB,YAAY,IAAI;IAChB,UAAU,IAAI;IACd,OAAO,IAAI;IACX,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,2BAA4B,YAAW,4BAA4B;IAC9E,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,CAAC,YAAY,CAAC,KAAK,GAAE,OAAO,CAAC,4BAA4B,CAAM,GAAG,4BAA4B;gBAaxF,KAAK,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC;IAWzD,MAAM,IAAI,4BAA4B;IAYtC,QAAQ,IAAI,sBAAsB,EAAE;CAgCrC"}
1
+ {"version":3,"file":"DeploymentCustomDomain.d.ts","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAGlF,oBAAY,SAAS;IACnB,YAAY,IAAI;IAChB,UAAU,IAAI;IACd,OAAO,IAAI;IACX,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,sBAAuB,YAAW,4BAA4B;IACzE,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,CAAC,YAAY,CAAC,KAAK,GAAE,OAAO,CAAC,4BAA4B,CAAM,GAAG,4BAA4B;gBAaxF,KAAK,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC;IAWzD,MAAM,IAAI,4BAA4B;IAYtC,QAAQ,IAAI,sBAAsB,EAAE;CAgCrC"}
@@ -7,7 +7,7 @@ export var SslStatus;
7
7
  SslStatus[SslStatus["Active"] = 3] = "Active";
8
8
  SslStatus[SslStatus["Error"] = 4] = "Error";
9
9
  })(SslStatus || (SslStatus = {}));
10
- export class DeploymentCustomDomainModel {
10
+ export class DeploymentCustomDomain {
11
11
  id;
12
12
  deploymentId;
13
13
  customDomainId;
@@ -28,7 +28,7 @@ export class DeploymentCustomDomainModel {
28
28
  };
29
29
  }
30
30
  constructor(state) {
31
- const init = DeploymentCustomDomainModel.createSchema(state);
31
+ const init = DeploymentCustomDomain.createSchema(state);
32
32
  this.id = init.id;
33
33
  this.deploymentId = init.deploymentId;
34
34
  this.customDomainId = init.customDomainId;
@@ -1 +1 @@
1
- {"version":3,"file":"DeploymentCustomDomain.js","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;IACd,+CAAW,CAAA;IACX,6CAAU,CAAA;IACV,2CAAS,CAAA;AACX,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAiCD,MAAM,OAAO,2BAA2B;IACtC,EAAE,CAAQ;IACV,YAAY,CAAQ;IACpB,cAAc,CAAQ;IACtB,QAAQ,CAAQ;IAChB,SAAS,CAAW;IACpB,SAAS,CAAQ;IACjB,SAAS,CAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAA+C,EAAE;QACnE,MAAM,EAAE,GAAG,K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AAM,MAAM,GAA6B,EAAE,CAAA;QAE3C,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,6BAA6B;gBACtC,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,mCAAmC;gBAC5C,IAAI,EAAE,iBAAiB;aACxB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,cAAc;gBACrB,OAAO,EAAE,iCAAiC;gBAC1C,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,oCAAoC;gBAC7C,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\n\nexport enum SslStatus {\n Initializing = 0,\n PendingDns = 1,\n Issuing = 2,\n Active = 3,\n Error = 4,\n}\n\nexport interface DeploymentCustomDomainSchema {\n /**\n * Primary key (nanoid)\n */\n id: string\n /**\n * ID of the deployment\n */\n deploymentId: string\n /**\n * ID of the custom domain\n */\n customDomainId: string\n /**\n * The base path for the deployment\n */\n basePath: string\n /**\n * Status of the SSL certificate\n */\n sslStatus: SslStatus\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n}\n\nexport class DeploymentCustomDomainModel implements DeploymentCustomDomainSchema {\n id: string\n deploymentId: string\n customDomainId: string\n basePath: string\n sslStatus: SslStatus\n createdAt: number\n updatedAt: number\n\n static createSchema(input: Partial<DeploymentCustomDomainSchema> = {}): DeploymentCustomDomainSchema {\n const id = input.id ?? nanoid()\n return {\n id,\n deploymentId: input.deploymentId || '',\n customDomainId: input.customDomainId || '',\n basePath: input.basePath ?? '/',\n sslStatus: input.sslStatus ?? SslStatus.PendingDns,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n }\n\n constructor(state?: Partial<DeploymentCustomDomainSchema>) {\n const init = DeploymentCustomDomainModel.createSchema(state)\n this.id = init.id\n this.deploymentId = init.deploymentId\n this.customDomainId = init.customDomainId\n this.basePath = init.basePath\n this.sslStatus = init.sslStatus\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n }\n\n toJSON(): DeploymentCustomDomainSchema {\n return {\n id: this.id,\n deploymentId: this.deploymentId,\n customDomainId: this.customDomainId,\n basePath: this.basePath,\n sslStatus: this.sslStatus,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n }\n\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n\n if (this.basePath === '') {\n result.push({\n field: 'basePath',\n message: 'Base path must not be empty',\n rule: 'notEmpty',\n })\n } else if (!this.basePath.startsWith('/')) {\n result.push({\n field: 'basePath',\n message: 'Base path must start with a slash',\n rule: 'startsWithSlash',\n })\n }\n if (!this.deploymentId) {\n result.push({\n field: 'deploymentId',\n message: 'Deployment ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.customDomainId) {\n result.push({\n field: 'customDomainId',\n message: 'Custom domain ID must not be empty',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"DeploymentCustomDomain.js","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.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CAAoC;gBAC7C,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\n\nexport enum SslStatus {\n Initializing = 0,\n PendingDns = 1,\n Issuing = 2,\n Active = 3,\n Error = 4,\n}\n\nexport interface DeploymentCustomDomainSchema {\n /**\n * Primary key (nanoid)\n */\n id: string\n /**\n * ID of the deployment\n */\n deploymentId: string\n /**\n * ID of the custom domain\n */\n customDomainId: string\n /**\n * The base path for the deployment\n */\n basePath: string\n /**\n * Status of the SSL certificate\n */\n sslStatus: SslStatus\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n}\n\nexport class DeploymentCustomDomain implements DeploymentCustomDomainSchema {\n id: string\n deploymentId: string\n customDomainId: string\n basePath: string\n sslStatus: SslStatus\n createdAt: number\n updatedAt: number\n\n static createSchema(input: Partial<DeploymentCustomDomainSchema> = {}): DeploymentCustomDomainSchema {\n const id = input.id ?? nanoid()\n return {\n id,\n deploymentId: input.deploymentId || '',\n customDomainId: input.customDomainId || '',\n basePath: input.basePath ?? '/',\n sslStatus: input.sslStatus ?? SslStatus.PendingDns,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n }\n\n constructor(state?: Partial<DeploymentCustomDomainSchema>) {\n const init = DeploymentCustomDomain.createSchema(state)\n this.id = init.id\n this.deploymentId = init.deploymentId\n this.customDomainId = init.customDomainId\n this.basePath = init.basePath\n this.sslStatus = init.sslStatus\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n }\n\n toJSON(): DeploymentCustomDomainSchema {\n return {\n id: this.id,\n deploymentId: this.deploymentId,\n customDomainId: this.customDomainId,\n basePath: this.basePath,\n sslStatus: this.sslStatus,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n }\n\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n\n if (this.basePath === '') {\n result.push({\n field: 'basePath',\n message: 'Base path must not be empty',\n rule: 'notEmpty',\n })\n } else if (!this.basePath.startsWith('/')) {\n result.push({\n field: 'basePath',\n message: 'Base path must start with a slash',\n rule: 'startsWithSlash',\n })\n }\n if (!this.deploymentId) {\n result.push({\n field: 'deploymentId',\n message: 'Deployment ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.customDomainId) {\n result.push({\n field: 'customDomainId',\n message: 'Custom domain ID must not be empty',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/models/store/File.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAoB,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAKtD,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG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
1
1
  import { nanoid } from '../../nanoid.js';
2
2
  import { Permission } from './Permission.js';
3
- import { Kind as UserKind } from './User.js';
4
3
  import { Thing } from '../Thing.js';
5
- import { FolderKind } from '../kinds.js';
4
+ import { FolderKind, UserKind } from '../kinds.js';
6
5
  const parentsSymbol = Symbol('parents');
7
6
  const deletedSymbol = Symbol('deleted');
8
7
  const deletedInfoSymbol = Symbol('deletedInfo');
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../src/models/store/File.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAoB,UAAU,EAAkB,MAAM,iBAAiB,CAAA;AAG9E,OAAO,EAAc,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAe,KAAK,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAyIxC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACvC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACvC,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC/C,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AACjD,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AACjD,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC/C,MAAM,mBAAmB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;AACnD,MAAM,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;AAErD,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,IAAI,GAAG,EAAE,CAAA;IACT;;OAEG;IACH,GAAG,GAAG,EAAE,CAAA;IACR;;OAEG;IACH,IAAI,GAAU,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CA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;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAClB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,OAAM;QACR,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,IAAgB;QACzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC3E,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,iBAAiB,CAAC,GAAG;YACxB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;YAChB,IAAI,EAAE,IAAI,CAAC,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;IACjC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;IACjC,CAAC;CACF","sourcesContent":["import { nanoid } from '../../nanoid.js'\nimport { PermissionSchema, Permission, PermissionRole } from './Permission.js'\nimport { ModificationSchema } from './Modification.js'\nimport { DeletionSchema } from './Deletion.js'\nimport { UserSchema, Kind as UserKind } from './User.js'\nimport { ThingSchema, Thing } from '../Thing.js'\nimport { CapabilitiesSchema } from './Capabilities.js'\nimport { FolderKind } from '../kinds.js'\n// this causes error\n// import { Kind as FolderKind } from '../Folder.js';\n\nexport interface FileAddOptions {\n /**\n * The parent folder where to put the file.\n * The `parents` array is always cleared from the file object before adding it to the store.\n */\n parent?: string\n}\n\nexport interface MediaReadOptions {\n /**\n * When set it reads the file that was marked as `_deleted`. By default it throws when file was deleted.\n */\n deleted?: boolean\n}\n\n/**\n * A breadcrumb when creating the breadcrumb list for a file.\n */\nexport interface FileBreadcrumb {\n /**\n * The datastore key of the object.\n */\n key: string\n /**\n * THe kind of the object.\n */\n kind: string\n /**\n * The name of the object.\n */\n name: string\n}\n\nexport interface StoredFileSchema {\n /**\n * The kind of the File\n */\n kind: string\n /**\n * The identifier of the entity\n */\n key: string\n /**\n * The file's meta info.\n */\n info: ThingSchema\n /**\n * The color of the icon to render for this file in the file explorer.\n * This should be a hex format, e.g.: #c00 for red.\n */\n iconColor?: string\n /**\n * Whether the file is a shortcut to another file.\n * Many properties cannot be changed of a shortcut, like, shortcuts cannot be shared.\n */\n isShortcut?: boolean\n /**\n * The ID of the target file.\n */\n shortcutTarget?: string\n}\n\n/**\n * @deprecated Use {@link StoredFileSchema} instead.\n */\nexport type IStoredFile = StoredFileSchema\n\n/**\n * An interface describing an object in the data store that\n * describes a file or an object that can be treated as a file or a folder.\n */\nexport interface FileSchema extends StoredFileSchema {\n /**\n * The list of parents of the object. It is an ordered list of parents\n * from the top (first element) to the lowest parent in the tree (last element).\n *\n * After creating the object, this property cannot be manipulated directly by the client.\n * Should be treated as opaque value.\n */\n parents: string[]\n /**\n * The list of permissions to this file object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n permissionIds: string[]\n /**\n * Whether the file object is deleted.\n */\n deleted?: boolean\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n deletedInfo?: DeletionSchema\n /**\n * The last modification made to this file.\n */\n lastModified: ModificationSchema\n /**\n * An arbitrary list of labels applied to the file.\n */\n labels?: string[]\n /**\n * This is populated when reading a file from the store.\n * A list of actions the user can perform on the file.\n *\n * This is a readonly field and it is ignored when creating / updating the file.\n */\n capabilities?: CapabilitiesSchema\n /**\n * Populated by the server when reading the file. The list of permissions to the object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n *\n * Data store implementation note, this is not stored in the store but it is populated\n * when reading the object.\n */\n permissions: PermissionSchema[]\n /**\n * Populated by the store in some situations. If it's missing then you should request\n * breadcrumbs from the store.\n */\n breadcrumb?: FileBreadcrumb[]\n}\n\n/**\n * @deprecated Use {@link FileSchema} instead.\n */\nexport type IFile = FileSchema\n\nconst parentsSymbol = Symbol('parents')\nconst deletedSymbol = Symbol('deleted')\nconst deletedInfoSymbol = Symbol('deletedInfo')\nconst lastModifiedSymbol = Symbol('lastModified')\nconst capabilitiesSymbol = Symbol('capabilities')\nconst permissionsSymbol = Symbol('permissions')\nconst permissionIdsSymbol = Symbol('permissionIds')\nconst shortcutTargetSymbol = Symbol('shortcutTarget')\n\nexport class StoredFile {\n /**\n * The kind of the File\n */\n kind = ''\n /**\n * The identifier of the entity\n */\n key = ''\n /**\n * The name of the environment.\n */\n info: Thing = Thing.fromName('')\n\n /**\n * The color of the icon to render for this file in the file explorer.\n */\n iconColor?: string\n\n /**\n * Whether the file is a shortcut to another file.\n * Many properties cannot be changed of a shortcut, like, shortcuts cannot be shared.\n */\n get isShortcut(): boolean {\n return !!this.shortcutTarget\n }\n\n [shortcutTargetSymbol]?: string\n\n /**\n * The ID of the target file.\n */\n get shortcutTarget(): string | undefined {\n return this[shortcutTargetSymbol]\n }\n\n set shortcutTarget(value: string | undefined) {\n this[shortcutTargetSymbol] = value\n }\n\n /**\n * Creates a file schema object with the given properties.\n * The `key` is generated if not set.\n *\n * @param input The input to create the file schema.\n * @returns The file schema object.\n */\n static createSchema(input: Partial<StoredFileSchema> = {}): StoredFileSchema {\n const { key = nanoid(), kind, iconColor, shortcutTarget } = input\n const result: StoredFileSchema = {\n key,\n kind: kind || '',\n info: Thing.fromJSON(input.info, { name: 'Unnamed file' }).toJSON(),\n }\n if (iconColor) {\n result.iconColor = iconColor\n }\n if (shortcutTarget) {\n result.isShortcut = true\n result.shortcutTarget = shortcutTarget\n }\n return result\n }\n\n constructor(state: StoredFileSchema) {\n this.kind = state.kind\n this.key = state.key\n this.info = new Thing(state.info)\n if (state.iconColor) {\n this.iconColor = state.iconColor\n }\n if (state.shortcutTarget) {\n this.shortcutTarget = state.shortcutTarget\n }\n }\n\n /**\n * @deprecated Use `createSchema()` and setup values in the constructor instead.\n */\n new(init: StoredFileSchema): this {\n const { key = nanoid(), info, kind, iconColor, shortcutTarget } = init\n this.key = key\n this.kind = kind\n if (info) {\n this.info = new Thing(info)\n } else {\n this.info = Thing.fromName('')\n }\n if (iconColor) {\n this.iconColor = iconColor\n } else {\n this.iconColor = undefined\n }\n if (shortcutTarget) {\n this.shortcutTarget = shortcutTarget\n } else {\n this.shortcutTarget = undefined\n }\n return this\n }\n\n toJSON(): StoredFileSchema {\n const result: StoredFileSchema = {\n key: this.key,\n kind: this.kind,\n info: this.info.toJSON(),\n }\n if (this.iconColor) {\n result.iconColor = this.iconColor\n }\n if (this.shortcutTarget) {\n result.isShortcut = true\n result.shortcutTarget = this.shortcutTarget\n }\n return result\n }\n\n /**\n * Creates the Capabilities object for a file giving user level.\n *\n * @param file The file object to create the capabilities to. The object is not mutated.\n * @param role The user role to the file.\n */\n static createFileCapabilities(file: StoredFileSchema | StoredFile, role?: PermissionRole): CapabilitiesSchema {\n const isCommenter = Permission.hasRole('commenter', role)\n const isOwner = Permission.hasRole('owner', role)\n const isReader = Permission.hasRole('reader', role)\n const isWriter = Permission.hasRole('writer', role)\n const isFolder = file.kind === FolderKind\n const result: CapabilitiesSchema = {\n canReadMedia: !isFolder && isReader,\n canListChildren: isFolder && isReader,\n canComment: !isFolder && isCommenter,\n canEditMedia: !isFolder && isWriter,\n canEditMeta: isWriter,\n canReadRevisions: isWriter,\n canAddChildren: isFolder && isWriter,\n canDelete: isOwner,\n canTrash: isOwner,\n canUntrash: isOwner,\n canShare: isWriter,\n canMove: isWriter,\n }\n return result\n }\n\n createFileCapabilities(role: PermissionRole): CapabilitiesSchema {\n return File.createFileCapabilities(this, role)\n }\n\n /**\n * Mutates the file object by setting the `byMe` properties (on deleted and modified info)\n *\n * Note, this can be done only on file schema (FileSchema). The `File` object has\n * this properties frozen.\n *\n * @param file The file to mutate\n * @param user The user key to compare.\n */\n static updateByMeMeta(file: FileSchema, user: string): void {\n if (file.deletedInfo) {\n file.deletedInfo.byMe = file.deletedInfo.user === user\n }\n if (file.lastModified) {\n file.lastModified.byMe = file.lastModified.user === user\n }\n }\n\n /**\n * Static method to set the `lastModified` property on a file without creating an instance of a file meta.\n * Useful when the meta kind is unknown.\n *\n * @param file The file to update. Note, this method mutates the file.\n * @param user The user that modifies the file.\n * @returns The same file.\n */\n static setLastModified(file: FileSchema, user: UserSchema): FileSchema {\n if (!file) {\n throw new Error(`The file is required.`)\n }\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"lastModified\".`)\n }\n file.lastModified = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n return file\n }\n\n /**\n * Similar to the instance method `setDeleted()` but without creating\n * an instance of the file when the type is unknown.\n *\n * @param file The file to change. Note, this operation mutates the file.\n * @param user The deleting user\n * @returns The same file reference.\n */\n static setDeleted(file: FileSchema, user: UserSchema): FileSchema {\n if (!file) {\n throw new Error(`The file is required.`)\n }\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"deletedInfo\".`)\n }\n file.deleted = true\n file.deletedInfo = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n return file\n }\n}\n\nexport class File extends StoredFile {\n [parentsSymbol]: string[] = []\n\n /**\n * The list of parents of the object. It is an ordered list of parents\n * from the top (first element) to the lowest parent in the tree (last element).\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get parents(): string[] {\n return this[parentsSymbol]\n }\n\n [permissionIdsSymbol]: readonly string[] = []\n\n /**\n * The list of permissions to this file object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get permissionIds(): readonly string[] {\n return this[permissionIdsSymbol]\n }\n\n [deletedSymbol]?: boolean\n\n /**\n * Whether the file object is deleted.\n */\n get deleted(): boolean {\n return this[deletedSymbol] || false\n }\n\n [deletedInfoSymbol]?: Readonly<DeletionSchema>\n\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n get deletedInfo(): Readonly<DeletionSchema> | undefined {\n return this[deletedInfoSymbol]\n }\n\n [lastModifiedSymbol]: Readonly<ModificationSchema> = { user: '', time: 0, byMe: false }\n\n /**\n * The last modification made to this file.\n */\n get lastModified(): Readonly<ModificationSchema> {\n return this[lastModifiedSymbol]\n }\n\n /**\n * An arbitrary list of labels applied to the file.\n */\n labels?: string[];\n\n [capabilitiesSymbol]?: Readonly<CapabilitiesSchema>\n\n /**\n * This is populated when reading a file from the store.\n * A list of actions the user can perform on the file.\n *\n * This is a readonly field and it is ignored when creating / updating the file.\n */\n get capabilities(): Readonly<CapabilitiesSchema> | undefined {\n return this[capabilitiesSymbol]\n }\n\n [permissionsSymbol]: readonly PermissionSchema[] = []\n\n /**\n * Populated by the server when reading the file. The list of permissions to the object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get permissions(): readonly PermissionSchema[] {\n return this[permissionsSymbol]\n }\n\n static override createSchema(input: Partial<FileSchema> = {}): FileSchema {\n const result = StoredFile.createSchema(input) as FileSchema\n if (Array.isArray(input.parents)) {\n result.parents = [...input.parents]\n } else {\n result.parents = []\n }\n if (Array.isArray(input.permissionIds)) {\n result.permissionIds = [...input.permissionIds]\n } else {\n result.permissionIds = []\n }\n if (Array.isArray(input.permissions)) {\n result.permissions = input.permissions.map((i) => ({ ...i }))\n } else {\n result.permissions = []\n }\n if (input.capabilities) {\n result.capabilities = { ...input.capabilities }\n }\n if (input.lastModified) {\n result.lastModified = { ...input.lastModified }\n } else {\n result.lastModified = { user: '', time: 0, byMe: false }\n }\n if (typeof input.deleted === 'boolean') {\n result.deleted = input.deleted\n result.deletedInfo = input.deletedInfo ? { ...input.deletedInfo } : undefined\n }\n if (Array.isArray(input.labels)) {\n result.labels = [...input.labels]\n }\n if (typeof input.shortcutTarget === 'string') {\n result.shortcutTarget = input.shortcutTarget\n }\n return result\n }\n\n constructor(state?: Partial<FileSchema>) {\n const init = File.createSchema(state)\n super(init)\n this[parentsSymbol] = [...init.parents]\n this[permissionIdsSymbol] = [...init.permissionIds]\n this[permissionsSymbol] = init.permissions.map((i) => ({ ...i }))\n this[capabilitiesSymbol] = init.capabilities ? { ...init.capabilities } : undefined\n this[lastModifiedSymbol] = Object.freeze({ ...init.lastModified })\n if (typeof init.deleted === 'boolean') {\n this[deletedSymbol] = init.deleted\n this[deletedInfoSymbol] = init.deletedInfo ? Object.freeze({ ...init.deletedInfo }) : undefined\n }\n if (Array.isArray(init.labels)) {\n this.labels = [...init.labels]\n }\n }\n\n /**\n * @deprecated Use `createSchema()` and setup values in the constructor instead.\n */\n override new(init: FileSchema): this {\n super.new(init)\n const { permissions = [], parents = [], permissionIds = [], deleted, deletedInfo, lastModified, labels } = init\n this[permissionsSymbol] = permissions.map((i) => ({ ...i }))\n this[parentsSymbol] = [...parents]\n this[permissionIdsSymbol] = [...permissionIds]\n this[lastModifiedSymbol] = lastModified\n ? Object.freeze({ ...lastModified })\n : Object.freeze({ user: '', time: 0, byMe: false })\n if (typeof deleted === 'boolean') {\n this[deletedSymbol] = deleted\n this[deletedInfoSymbol] = deletedInfo ? Object.freeze({ ...deletedInfo }) : undefined\n } else {\n this[deletedSymbol] = undefined\n this[deletedInfoSymbol] = undefined\n }\n if (Array.isArray(labels)) {\n this.labels = [...labels]\n } else {\n this.labels = undefined\n }\n return this\n }\n\n override toJSON(): FileSchema {\n const result: FileSchema = {\n ...super.toJSON(),\n parents: [...this.parents],\n permissionIds: [...this.permissionIds],\n lastModified: { ...this.lastModified },\n permissions: [...this.permissions],\n }\n if (this.deleted) {\n result.deleted = this.deleted\n result.deletedInfo = { ...this.deletedInfo } as DeletionSchema\n }\n if (Array.isArray(this.labels)) {\n result.labels = [...this.labels]\n }\n return result\n }\n\n /**\n * @param name The name to set.\n * @param kind The kind of the file to create.\n */\n static fromName(name: string, kind: string): File {\n const definition = new File({ kind, info: { name } })\n return definition\n }\n\n shortcutTo(fileId: string): this {\n this.shortcutTarget = fileId\n return this\n }\n\n /**\n * Updates the \"lastModified\" value.\n * A helper method for a common task.\n *\n * @param user The user that modifies the entity.\n */\n setLastModified(user: UserSchema): void {\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"lastModified\".`)\n }\n this[lastModifiedSymbol] = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n }\n\n /**\n * Adds a label to the list of labels.\n *\n * It makes sure the value is a valid, non-empty string and the `labels` array is set.\n *\n * It does nothing when the label already exists.\n *\n * @param label The label to set.\n */\n addLabel(label: string): void {\n if (typeof label !== 'string') {\n throw new Error(`The label must be a string.`)\n }\n if (!label.trim()) {\n throw new Error(`The label is required.`)\n }\n if (!Array.isArray(this.labels)) {\n this.labels = []\n }\n if (this.labels.includes(label)) {\n return\n }\n this.labels.push(label)\n }\n\n /**\n * Marks the entity as deleted.\n *\n * A helper method for a common task.\n *\n * @param user The user that deletes the entity.\n */\n setDeleted(user: UserSchema): void {\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"deletedInfo\".`)\n }\n this[deletedSymbol] = true\n this[deletedInfoSymbol] = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n }\n\n isFile(): boolean {\n return this.kind !== FolderKind\n }\n\n isFolder(): boolean {\n return this.kind === FolderKind\n }\n}\n"]}
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../src/models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,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC3E,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,iBAAiB,CAAC,GAAG;YACxB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;YAChB,IAAI,EAAE,IAAI,CAAC,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;IACjC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;IACjC,CAAC;CACF","sourcesContent":["import { nanoid } from '../../nanoid.js'\nimport { PermissionSchema, Permission, PermissionRole } from './Permission.js'\nimport { ModificationSchema } from './Modification.js'\nimport { DeletionSchema } from './Deletion.js'\nimport { UserSchema } from './User.js'\nimport { ThingSchema, Thing } from '../Thing.js'\nimport { CapabilitiesSchema } from './Capabilities.js'\nimport { FolderKind, UserKind } from '../kinds.js'\n// this causes error\n// import { Kind as FolderKind } from '../Folder.js';\n\nexport interface FileAddOptions {\n /**\n * The parent folder where to put the file.\n * The `parents` array is always cleared from the file object before adding it to the store.\n */\n parent?: string\n}\n\nexport interface MediaReadOptions {\n /**\n * When set it reads the file that was marked as `_deleted`. By default it throws when file was deleted.\n */\n deleted?: boolean\n}\n\n/**\n * A breadcrumb when creating the breadcrumb list for a file.\n */\nexport interface FileBreadcrumb {\n /**\n * The datastore key of the object.\n */\n key: string\n /**\n * THe kind of the object.\n */\n kind: string\n /**\n * The name of the object.\n */\n name: string\n}\n\nexport interface StoredFileSchema {\n /**\n * The kind of the File\n */\n kind: string\n /**\n * The identifier of the entity\n */\n key: string\n /**\n * The file's meta info.\n */\n info: ThingSchema\n /**\n * The color of the icon to render for this file in the file explorer.\n * This should be a hex format, e.g.: #c00 for red.\n */\n iconColor?: string\n /**\n * Whether the file is a shortcut to another file.\n * Many properties cannot be changed of a shortcut, like, shortcuts cannot be shared.\n */\n isShortcut?: boolean\n /**\n * The ID of the target file.\n */\n shortcutTarget?: string\n}\n\n/**\n * @deprecated Use {@link StoredFileSchema} instead.\n */\nexport type IStoredFile = StoredFileSchema\n\n/**\n * An interface describing an object in the data store that\n * describes a file or an object that can be treated as a file or a folder.\n */\nexport interface FileSchema extends StoredFileSchema {\n /**\n * The list of parents of the object. It is an ordered list of parents\n * from the top (first element) to the lowest parent in the tree (last element).\n *\n * After creating the object, this property cannot be manipulated directly by the client.\n * Should be treated as opaque value.\n */\n parents: string[]\n /**\n * The list of permissions to this file object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n permissionIds: string[]\n /**\n * Whether the file object is deleted.\n */\n deleted?: boolean\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n deletedInfo?: DeletionSchema\n /**\n * The last modification made to this file.\n */\n lastModified: ModificationSchema\n /**\n * An arbitrary list of labels applied to the file.\n */\n labels?: string[]\n /**\n * This is populated when reading a file from the store.\n * A list of actions the user can perform on the file.\n *\n * This is a readonly field and it is ignored when creating / updating the file.\n */\n capabilities?: CapabilitiesSchema\n /**\n * Populated by the server when reading the file. The list of permissions to the object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n *\n * Data store implementation note, this is not stored in the store but it is populated\n * when reading the object.\n */\n permissions: PermissionSchema[]\n /**\n * Populated by the store in some situations. If it's missing then you should request\n * breadcrumbs from the store.\n */\n breadcrumb?: FileBreadcrumb[]\n}\n\n/**\n * @deprecated Use {@link FileSchema} instead.\n */\nexport type IFile = FileSchema\n\nconst parentsSymbol = Symbol('parents')\nconst deletedSymbol = Symbol('deleted')\nconst deletedInfoSymbol = Symbol('deletedInfo')\nconst lastModifiedSymbol = Symbol('lastModified')\nconst capabilitiesSymbol = Symbol('capabilities')\nconst permissionsSymbol = Symbol('permissions')\nconst permissionIdsSymbol = Symbol('permissionIds')\nconst shortcutTargetSymbol = Symbol('shortcutTarget')\n\nexport class StoredFile {\n /**\n * The kind of the File\n */\n kind = ''\n /**\n * The identifier of the entity\n */\n key = ''\n /**\n * The name of the environment.\n */\n info: Thing = Thing.fromName('')\n\n /**\n * The color of the icon to render for this file in the file explorer.\n */\n iconColor?: string\n\n /**\n * Whether the file is a shortcut to another file.\n * Many properties cannot be changed of a shortcut, like, shortcuts cannot be shared.\n */\n get isShortcut(): boolean {\n return !!this.shortcutTarget\n }\n\n [shortcutTargetSymbol]?: string\n\n /**\n * The ID of the target file.\n */\n get shortcutTarget(): string | undefined {\n return this[shortcutTargetSymbol]\n }\n\n set shortcutTarget(value: string | undefined) {\n this[shortcutTargetSymbol] = value\n }\n\n /**\n * Creates a file schema object with the given properties.\n * The `key` is generated if not set.\n *\n * @param input The input to create the file schema.\n * @returns The file schema object.\n */\n static createSchema(input: Partial<StoredFileSchema> = {}): StoredFileSchema {\n const { key = nanoid(), kind, iconColor, shortcutTarget } = input\n const result: StoredFileSchema = {\n key,\n kind: kind || '',\n info: Thing.fromJSON(input.info, { name: 'Unnamed file' }).toJSON(),\n }\n if (iconColor) {\n result.iconColor = iconColor\n }\n if (shortcutTarget) {\n result.isShortcut = true\n result.shortcutTarget = shortcutTarget\n }\n return result\n }\n\n constructor(state: StoredFileSchema) {\n this.kind = state.kind\n this.key = state.key\n this.info = new Thing(state.info)\n if (state.iconColor) {\n this.iconColor = state.iconColor\n }\n if (state.shortcutTarget) {\n this.shortcutTarget = state.shortcutTarget\n }\n }\n\n /**\n * @deprecated Use `createSchema()` and setup values in the constructor instead.\n */\n new(init: StoredFileSchema): this {\n const { key = nanoid(), info, kind, iconColor, shortcutTarget } = init\n this.key = key\n this.kind = kind\n if (info) {\n this.info = new Thing(info)\n } else {\n this.info = Thing.fromName('')\n }\n if (iconColor) {\n this.iconColor = iconColor\n } else {\n this.iconColor = undefined\n }\n if (shortcutTarget) {\n this.shortcutTarget = shortcutTarget\n } else {\n this.shortcutTarget = undefined\n }\n return this\n }\n\n toJSON(): StoredFileSchema {\n const result: StoredFileSchema = {\n key: this.key,\n kind: this.kind,\n info: this.info.toJSON(),\n }\n if (this.iconColor) {\n result.iconColor = this.iconColor\n }\n if (this.shortcutTarget) {\n result.isShortcut = true\n result.shortcutTarget = this.shortcutTarget\n }\n return result\n }\n\n /**\n * Creates the Capabilities object for a file giving user level.\n *\n * @param file The file object to create the capabilities to. The object is not mutated.\n * @param role The user role to the file.\n */\n static createFileCapabilities(file: StoredFileSchema | StoredFile, role?: PermissionRole): CapabilitiesSchema {\n const isCommenter = Permission.hasRole('commenter', role)\n const isOwner = Permission.hasRole('owner', role)\n const isReader = Permission.hasRole('reader', role)\n const isWriter = Permission.hasRole('writer', role)\n const isFolder = file.kind === FolderKind\n const result: CapabilitiesSchema = {\n canReadMedia: !isFolder && isReader,\n canListChildren: isFolder && isReader,\n canComment: !isFolder && isCommenter,\n canEditMedia: !isFolder && isWriter,\n canEditMeta: isWriter,\n canReadRevisions: isWriter,\n canAddChildren: isFolder && isWriter,\n canDelete: isOwner,\n canTrash: isOwner,\n canUntrash: isOwner,\n canShare: isWriter,\n canMove: isWriter,\n }\n return result\n }\n\n createFileCapabilities(role: PermissionRole): CapabilitiesSchema {\n return File.createFileCapabilities(this, role)\n }\n\n /**\n * Mutates the file object by setting the `byMe` properties (on deleted and modified info)\n *\n * Note, this can be done only on file schema (FileSchema). The `File` object has\n * this properties frozen.\n *\n * @param file The file to mutate\n * @param user The user key to compare.\n */\n static updateByMeMeta(file: FileSchema, user: string): void {\n if (file.deletedInfo) {\n file.deletedInfo.byMe = file.deletedInfo.user === user\n }\n if (file.lastModified) {\n file.lastModified.byMe = file.lastModified.user === user\n }\n }\n\n /**\n * Static method to set the `lastModified` property on a file without creating an instance of a file meta.\n * Useful when the meta kind is unknown.\n *\n * @param file The file to update. Note, this method mutates the file.\n * @param user The user that modifies the file.\n * @returns The same file.\n */\n static setLastModified(file: FileSchema, user: UserSchema): FileSchema {\n if (!file) {\n throw new Error(`The file is required.`)\n }\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"lastModified\".`)\n }\n file.lastModified = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n return file\n }\n\n /**\n * Similar to the instance method `setDeleted()` but without creating\n * an instance of the file when the type is unknown.\n *\n * @param file The file to change. Note, this operation mutates the file.\n * @param user The deleting user\n * @returns The same file reference.\n */\n static setDeleted(file: FileSchema, user: UserSchema): FileSchema {\n if (!file) {\n throw new Error(`The file is required.`)\n }\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"deletedInfo\".`)\n }\n file.deleted = true\n file.deletedInfo = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n return file\n }\n}\n\nexport class File extends StoredFile {\n [parentsSymbol]: string[] = []\n\n /**\n * The list of parents of the object. It is an ordered list of parents\n * from the top (first element) to the lowest parent in the tree (last element).\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get parents(): string[] {\n return this[parentsSymbol]\n }\n\n [permissionIdsSymbol]: readonly string[] = []\n\n /**\n * The list of permissions to this file object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get permissionIds(): readonly string[] {\n return this[permissionIdsSymbol]\n }\n\n [deletedSymbol]?: boolean\n\n /**\n * Whether the file object is deleted.\n */\n get deleted(): boolean {\n return this[deletedSymbol] || false\n }\n\n [deletedInfoSymbol]?: Readonly<DeletionSchema>\n\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n get deletedInfo(): Readonly<DeletionSchema> | undefined {\n return this[deletedInfoSymbol]\n }\n\n [lastModifiedSymbol]: Readonly<ModificationSchema> = { user: '', time: 0, byMe: false }\n\n /**\n * The last modification made to this file.\n */\n get lastModified(): Readonly<ModificationSchema> {\n return this[lastModifiedSymbol]\n }\n\n /**\n * An arbitrary list of labels applied to the file.\n */\n labels?: string[];\n\n [capabilitiesSymbol]?: Readonly<CapabilitiesSchema>\n\n /**\n * This is populated when reading a file from the store.\n * A list of actions the user can perform on the file.\n *\n * This is a readonly field and it is ignored when creating / updating the file.\n */\n get capabilities(): Readonly<CapabilitiesSchema> | undefined {\n return this[capabilitiesSymbol]\n }\n\n [permissionsSymbol]: readonly PermissionSchema[] = []\n\n /**\n * Populated by the server when reading the file. The list of permissions to the object.\n *\n * This property cannot be manipulated directly by the client. Should be treated as\n * opaque value.\n */\n get permissions(): readonly PermissionSchema[] {\n return this[permissionsSymbol]\n }\n\n static override createSchema(input: Partial<FileSchema> = {}): FileSchema {\n const result = StoredFile.createSchema(input) as FileSchema\n if (Array.isArray(input.parents)) {\n result.parents = [...input.parents]\n } else {\n result.parents = []\n }\n if (Array.isArray(input.permissionIds)) {\n result.permissionIds = [...input.permissionIds]\n } else {\n result.permissionIds = []\n }\n if (Array.isArray(input.permissions)) {\n result.permissions = input.permissions.map((i) => ({ ...i }))\n } else {\n result.permissions = []\n }\n if (input.capabilities) {\n result.capabilities = { ...input.capabilities }\n }\n if (input.lastModified) {\n result.lastModified = { ...input.lastModified }\n } else {\n result.lastModified = { user: '', time: 0, byMe: false }\n }\n if (typeof input.deleted === 'boolean') {\n result.deleted = input.deleted\n result.deletedInfo = input.deletedInfo ? { ...input.deletedInfo } : undefined\n }\n if (Array.isArray(input.labels)) {\n result.labels = [...input.labels]\n }\n if (typeof input.shortcutTarget === 'string') {\n result.shortcutTarget = input.shortcutTarget\n }\n return result\n }\n\n constructor(state?: Partial<FileSchema>) {\n const init = File.createSchema(state)\n super(init)\n this[parentsSymbol] = [...init.parents]\n this[permissionIdsSymbol] = [...init.permissionIds]\n this[permissionsSymbol] = init.permissions.map((i) => ({ ...i }))\n this[capabilitiesSymbol] = init.capabilities ? { ...init.capabilities } : undefined\n this[lastModifiedSymbol] = Object.freeze({ ...init.lastModified })\n if (typeof init.deleted === 'boolean') {\n this[deletedSymbol] = init.deleted\n this[deletedInfoSymbol] = init.deletedInfo ? Object.freeze({ ...init.deletedInfo }) : undefined\n }\n if (Array.isArray(init.labels)) {\n this.labels = [...init.labels]\n }\n }\n\n /**\n * @deprecated Use `createSchema()` and setup values in the constructor instead.\n */\n override new(init: FileSchema): this {\n super.new(init)\n const { permissions = [], parents = [], permissionIds = [], deleted, deletedInfo, lastModified, labels } = init\n this[permissionsSymbol] = permissions.map((i) => ({ ...i }))\n this[parentsSymbol] = [...parents]\n this[permissionIdsSymbol] = [...permissionIds]\n this[lastModifiedSymbol] = lastModified\n ? Object.freeze({ ...lastModified })\n : Object.freeze({ user: '', time: 0, byMe: false })\n if (typeof deleted === 'boolean') {\n this[deletedSymbol] = deleted\n this[deletedInfoSymbol] = deletedInfo ? Object.freeze({ ...deletedInfo }) : undefined\n } else {\n this[deletedSymbol] = undefined\n this[deletedInfoSymbol] = undefined\n }\n if (Array.isArray(labels)) {\n this.labels = [...labels]\n } else {\n this.labels = undefined\n }\n return this\n }\n\n override toJSON(): FileSchema {\n const result: FileSchema = {\n ...super.toJSON(),\n parents: [...this.parents],\n permissionIds: [...this.permissionIds],\n lastModified: { ...this.lastModified },\n permissions: [...this.permissions],\n }\n if (this.deleted) {\n result.deleted = this.deleted\n result.deletedInfo = { ...this.deletedInfo } as DeletionSchema\n }\n if (Array.isArray(this.labels)) {\n result.labels = [...this.labels]\n }\n return result\n }\n\n /**\n * @param name The name to set.\n * @param kind The kind of the file to create.\n */\n static fromName(name: string, kind: string): File {\n const definition = new File({ kind, info: { name } })\n return definition\n }\n\n shortcutTo(fileId: string): this {\n this.shortcutTarget = fileId\n return this\n }\n\n /**\n * Updates the \"lastModified\" value.\n * A helper method for a common task.\n *\n * @param user The user that modifies the entity.\n */\n setLastModified(user: UserSchema): void {\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"lastModified\".`)\n }\n this[lastModifiedSymbol] = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n }\n\n /**\n * Adds a label to the list of labels.\n *\n * It makes sure the value is a valid, non-empty string and the `labels` array is set.\n *\n * It does nothing when the label already exists.\n *\n * @param label The label to set.\n */\n addLabel(label: string): void {\n if (typeof label !== 'string') {\n throw new Error(`The label must be a string.`)\n }\n if (!label.trim()) {\n throw new Error(`The label is required.`)\n }\n if (!Array.isArray(this.labels)) {\n this.labels = []\n }\n if (this.labels.includes(label)) {\n return\n }\n this.labels.push(label)\n }\n\n /**\n * Marks the entity as deleted.\n *\n * A helper method for a common task.\n *\n * @param user The user that deletes the entity.\n */\n setDeleted(user: UserSchema): void {\n if (!user) {\n throw new Error(`The user is required.`)\n }\n if (user.kind !== UserKind) {\n throw new Error(`Invalid value for the user when setting \"deletedInfo\".`)\n }\n this[deletedSymbol] = true\n this[deletedInfoSymbol] = {\n byMe: false,\n time: Date.now(),\n user: user.key,\n name: user.name,\n }\n }\n\n isFile(): boolean {\n return this.kind !== FolderKind\n }\n\n isFolder(): boolean {\n return this.kind === FolderKind\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { DeletionSchema } from './Deletion.js';
2
2
  import type { UserOrganizationGrantType } from './Organization.js';
3
+ import { UserKind } from '../kinds.js';
3
4
  export interface EmailSchema {
4
5
  /**
5
6
  * When available the email of the user.
@@ -29,7 +30,6 @@ export interface UserPictureSchema {
29
30
  * @deprecated Use {@link UserPictureSchema} instead.
30
31
  */
31
32
  export type IUserPicture = UserPictureSchema;
32
- export declare const Kind = "Core#User";
33
33
  export type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending';
34
34
  /**
35
35
  * Represents a user in the system.
@@ -40,7 +40,7 @@ export type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending';
40
40
  * identity providers. However, this is not exposed to the user through the API.
41
41
  */
42
42
  export interface UserSchema {
43
- kind: typeof Kind;
43
+ kind: typeof UserKind;
44
44
  /**
45
45
  * The data store key of the user.
46
46
  */
@@ -52,7 +52,7 @@ export interface UserSchema {
52
52
  /**
53
53
  * When available the email of the user.
54
54
  */
55
- email: IEmail[];
55
+ email: EmailSchema[];
56
56
  /**
57
57
  * The user picture to render.
58
58
  */
@@ -1 +1 @@
1
- {"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../../src/models/store/User.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAElE,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,WAAW,CAAA;AAEhC,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAA;AAE5C,eAAO,MAAM,IAAI,cAAc,CAAA;AAE/B,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAA;AAEvE;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,IAAI,CAAA;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;OAEG;IACH,IA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AAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAA;AAEvE;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,QAAQ,CAAA;IACrB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAA;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA"}
@@ -1,2 +1,2 @@
1
- export const Kind = 'Core#User';
1
+ export {};
2
2
  //# sourceMappingURL=User.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../../src/models/store/User.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAA","sourcesContent":["import type { DeletionSchema } from './Deletion.js'\nimport type { UserOrganizationGrantType } from './Organization.js'\n\nexport interface EmailSchema {\n /**\n * When available the email of the user.\n */\n email: string\n /**\n * Whether the `email` was verified.\n * Not verified emails should have limited use in the system.\n */\n verified?: boolean\n}\n\n/**\n * @deprecated Use {@link EmailSchema} instead.\n */\nexport type IEmail = EmailSchema\n\nexport interface UserPictureSchema {\n /**\n * When available, the URL to the user's picture image.\n */\n url?: string\n /**\n * Alternative to the `url`. When set it is a data URL value of the image.\n */\n data?: string\n}\n\n/**\n * @deprecated Use {@link UserPictureSchema} instead.\n */\nexport type IUserPicture = UserPictureSchema\n\nexport const Kind = 'Core#User'\n\nexport type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending'\n\n/**\n * Represents a user in the system.\n * This can be embedded in various situations like project's revision history,\n * ACL, Authorization, etc.\n *\n * Note, the store implementation may have additional fields that support external\n * identity providers. However, this is not exposed to the user through the API.\n */\nexport interface UserSchema {\n kind: typeof Kind\n /**\n * The data store key of the user.\n */\n key: string\n /**\n * The display name of the user.\n */\n name: string\n /**\n * When available the email of the user.\n */\n email: IEmail[]\n /**\n * The user picture to render.\n */\n picture?: UserPictureSchema\n /**\n * A general purpose tags field.\n */\n tags?: string[]\n /**\n * Optional user locale information.\n */\n locale?: string\n /**\n * Optional metadata related to the auth provider.\n */\n provider?: unknown\n /**\n * Whether the user is deleted from the system.\n * @deprecated Use `status` instead.\n */\n deleted?: boolean\n /**\n * The timestamp of when the user was deleted.\n * @deprecated\n */\n deletedTime?: number\n /**\n * The id of the user that deleted the user.\n * @deprecated\n */\n deletingUser?: string\n /**\n * The status of the user.\n * May not be populated in all cases.\n * @default 'active'\n */\n status?: UserStatus\n /**\n * Populated when the user object is considered in the context of an organization.\n * This is used to determine the user's role in the organization.\n */\n grantType?: UserOrganizationGrantType\n /**\n * Populated when the user object is considered in the context of an organization.\n * The timestamp of when the user joined the organization.\n */\n joined?: number\n /**\n * The timestamp of when the user was created.\n */\n created: number\n /**\n * The timestamp of when the user was last updated.\n */\n updated: number\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n deletedInfo?: DeletionSchema\n}\n\n/**\n * @deprecated Use {@link UserSchema} instead.\n */\nexport type IUser = UserSchema\n"]}
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../../src/models/store/User.ts"],"names":[],"mappings":"","sourcesContent":["import type { DeletionSchema } from './Deletion.js'\nimport type { UserOrganizationGrantType } from './Organization.js'\nimport { UserKind } from '../kinds.js'\n\nexport interface EmailSchema {\n /**\n * When available the email of the user.\n */\n email: string\n /**\n * Whether the `email` was verified.\n * Not verified emails should have limited use in the system.\n */\n verified?: boolean\n}\n\n/**\n * @deprecated Use {@link EmailSchema} instead.\n */\nexport type IEmail = EmailSchema\n\nexport interface UserPictureSchema {\n /**\n * When available, the URL to the user's picture image.\n */\n url?: string\n /**\n * Alternative to the `url`. When set it is a data URL value of the image.\n */\n data?: string\n}\n\n/**\n * @deprecated Use {@link UserPictureSchema} instead.\n */\nexport type IUserPicture = UserPictureSchema\n\nexport type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending'\n\n/**\n * Represents a user in the system.\n * This can be embedded in various situations like project's revision history,\n * ACL, Authorization, etc.\n *\n * Note, the store implementation may have additional fields that support external\n * identity providers. However, this is not exposed to the user through the API.\n */\nexport interface UserSchema {\n kind: typeof UserKind\n /**\n * The data store key of the user.\n */\n key: string\n /**\n * The display name of the user.\n */\n name: string\n /**\n * When available the email of the user.\n */\n email: EmailSchema[]\n /**\n * The user picture to render.\n */\n picture?: UserPictureSchema\n /**\n * A general purpose tags field.\n */\n tags?: string[]\n /**\n * Optional user locale information.\n */\n locale?: string\n /**\n * Optional metadata related to the auth provider.\n */\n provider?: unknown\n /**\n * Whether the user is deleted from the system.\n * @deprecated Use `status` instead.\n */\n deleted?: boolean\n /**\n * The timestamp of when the user was deleted.\n * @deprecated\n */\n deletedTime?: number\n /**\n * The id of the user that deleted the user.\n * @deprecated\n */\n deletingUser?: string\n /**\n * The status of the user.\n * May not be populated in all cases.\n * @default 'active'\n */\n status?: UserStatus\n /**\n * Populated when the user object is considered in the context of an organization.\n * This is used to determine the user's role in the organization.\n */\n grantType?: UserOrganizationGrantType\n /**\n * Populated when the user object is considered in the context of an organization.\n * The timestamp of when the user joined the organization.\n */\n joined?: number\n /**\n * The timestamp of when the user was created.\n */\n created: number\n /**\n * The timestamp of when the user was last updated.\n */\n updated: number\n /**\n * The information about the delete information.\n * Always set when the `delete` is true.\n */\n deletedInfo?: DeletionSchema\n}\n\n/**\n * @deprecated Use {@link UserSchema} instead.\n */\nexport type IUser = UserSchema\n"]}
@@ -0,0 +1,17 @@
1
+ export type { ServerEvent, ServerPatchEvent, ServerDeleteEvent } from './Backend.js';
2
+ export { type CapabilitiesSchema } from './Capabilities.js';
3
+ export { type CustomDomainSchema, CustomDomain } from './CustomDomain.js';
4
+ export type { PublishedDataDomain, UnresolvedDependency } from './DataCatalog.js';
5
+ export { type DeletionSchema } from './Deletion.js';
6
+ export { type DeploymentSchema, DeploymentStatus, DeploymentEnvironment, Deployment } from './Deployment.js';
7
+ export { type DeploymentCustomDomainSchema, SslStatus, DeploymentCustomDomain } from './DeploymentCustomDomain.js';
8
+ export { File, StoredFile, type FileSchema, type StoredFileSchema, type FileAddOptions, type FileBreadcrumb, type MediaReadOptions, } from './File.js';
9
+ export { type GroupSchema, Group } from './Group.js';
10
+ export { type InvitationSchema, type InvitationStatus, Invitation } from './Invitation.js';
11
+ export { type ModificationSchema } from './Modification.js';
12
+ export { type OrganizationSchema, type OrganizationSlugValidateResponse, Organization, type UserOrganizationGrantType, } from './Organization.js';
13
+ export { type IAccessAddOperation, type IAccessOperation, type IAccessUpdateOperation, type IAccessRemoveOperation, Permission, type IPermission, type PermissionSchema, type AccessOperation, Kind as PermissionKind, type PermissionRole, type PermissionType, type PermissionSourceRule, } from './Permission.js';
14
+ export { type IRevision, type IRevisionListItem } from './Revision.js';
15
+ export { type UserSchema, type EmailSchema, type UserPictureSchema, type UserStatus } from './User.js';
16
+ export { type UserIdentitySchema, Kind as UserIdentityKind, UserIdentity } from './UserIdentity.js';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/store/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACzE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAE,KAAK,4BAA4B,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,YAAY,EACZ,KAAK,yBAAyB,GAC/B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,IAAI,IAAI,cAAc,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AACtG,OAAO,EAAE,KAAK,kBAAkB,EAAE,IAAI,IAAI,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,10 @@
1
+ export { CustomDomain } from './CustomDomain.js';
2
+ export { DeploymentStatus, DeploymentEnvironment, Deployment } from './Deployment.js';
3
+ export { SslStatus, DeploymentCustomDomain } from './DeploymentCustomDomain.js';
4
+ export { File, StoredFile, } from './File.js';
5
+ export { Group } from './Group.js';
6
+ export { Invitation } from './Invitation.js';
7
+ export { Organization, } from './Organization.js';
8
+ export { Permission, Kind as PermissionKind, } from './Permission.js';
9
+ export { Kind as UserIdentityKind, UserIdentity } from './UserIdentity.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/store/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAyB,gBAAgB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAqC,SAAS,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,EACL,IAAI,EACJ,UAAU,GAMX,MAAM,WAAW,CAAA;AAClB,OAAO,EAAoB,KAAK,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAgD,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE1F,OAAO,EAGL,YAAY,GAEb,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKL,UAAU,EAIV,IAAI,IAAI,cAAc,GAIvB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAA2B,IAAI,IAAI,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["export type { ServerEvent, ServerPatchEvent, ServerDeleteEvent } from './Backend.js'\nexport { type CapabilitiesSchema } from './Capabilities.js'\nexport { type CustomDomainSchema, CustomDomain } from './CustomDomain.js'\nexport type { PublishedDataDomain, UnresolvedDependency } from './DataCatalog.js'\nexport { type DeletionSchema } from './Deletion.js'\nexport { type DeploymentSchema, DeploymentStatus, DeploymentEnvironment, Deployment } from './Deployment.js'\nexport { type DeploymentCustomDomainSchema, SslStatus, DeploymentCustomDomain } from './DeploymentCustomDomain.js'\nexport {\n File,\n StoredFile,\n type FileSchema,\n type StoredFileSchema,\n type FileAddOptions,\n type FileBreadcrumb,\n type MediaReadOptions,\n} from './File.js'\nexport { type GroupSchema, Group } from './Group.js'\nexport { type InvitationSchema, type InvitationStatus, Invitation } from './Invitation.js'\nexport { type ModificationSchema } from './Modification.js'\nexport {\n type OrganizationSchema,\n type OrganizationSlugValidateResponse,\n Organization,\n type UserOrganizationGrantType,\n} from './Organization.js'\nexport {\n type IAccessAddOperation,\n type IAccessOperation,\n type IAccessUpdateOperation,\n type IAccessRemoveOperation,\n Permission,\n type IPermission,\n type PermissionSchema,\n type AccessOperation,\n Kind as PermissionKind,\n type PermissionRole,\n type PermissionType,\n type PermissionSourceRule,\n} from './Permission.js'\nexport { type IRevision, type IRevisionListItem } from './Revision.js'\nexport { type UserSchema, type EmailSchema, type UserPictureSchema, type UserStatus } from './User.js'\nexport { type UserIdentitySchema, Kind as UserIdentityKind, UserIdentity } from './UserIdentity.js'\n"]}
@@ -0,0 +1,3 @@
1
+ export { type PatchClientOptions, PatchClient } from './PatchClient.js';
2
+ export type * from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACvE,mBAAmB,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { PatchClient } from './PatchClient.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,EAAE,MAAM,kBAAkB,CAAA","sourcesContent":["export { type PatchClientOptions, PatchClient } from './PatchClient.js'\nexport type * from './types.js'\n"]}
@@ -1,4 +1,4 @@
1
- import { ContextListOptions, ContextListResult } from '../browser.js';
1
+ import type { ContextListOptions, ContextListResult } from '../events/BaseEvents.js';
2
2
  import type { GroupSchema } from '../models/store/Group.js';
3
3
  import { SdkBase, type SdkOptions } from './SdkBase.js';
4
4
  export declare class GroupsSdk extends SdkBase {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupsSdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/GroupsSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAKL,OAAO,EACP,KAAK,UAAU,EAChB,MAAM,cAAc,CAAA;AAErB,qBAAa,SAAU,SAAQ,OAAO;IACpC;;;;;;OAMG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAiCrG;;;;;;;OAOG;IACG,IAAI,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,MAAM,CAAC,CAAA;YAC/B,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,QAAQ,GAAG,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QAC3F,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,mBAAmB,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAClH,CAAC;QACD,IAAI,IAAiB,CAAA;QACrB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACxG,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,kBAAkB,EAAE,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAChH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { ContextListOptions, ContextListResult } from '../browser.js'\nimport { Exception } from '../exceptions/exception.js'\nimport type { GroupSchema } from '../models/store/Group.js'\nimport { RouteBuilder } from './RouteBuilder.js'\nimport {\n E_INVALID_JSON,\n E_RESPONSE_NO_VALUE,\n E_RESPONSE_STATUS,\n E_RESPONSE_UNKNOWN,\n SdkBase,\n type SdkOptions,\n} from './SdkBase.js'\n\nexport class GroupsSdk extends SdkBase {\n /**\n * Creates a new group in the specified organization.\n * @param oid The organization ID where the group will be created.\n * @param info The information about the group to create. See the `GroupSchema` interface for required fields.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the created group.\n */\n async create(oid: string, info: Partial<GroupSchema>, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n const body = JSON.stringify(info)\n const result = await this.sdk.http.post(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 201) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Lists user groups in the specified organization.\n * If you want to list specific user groups, you can use the `uid` option to filter by user ID.\n * @param oid The organization ID to list groups from.\n * @param options Optional parameters for filtering, sorting, and pagination.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to a list of groups in the organization.\n */\n async list(\n oid: string,\n options: ContextListOptions = {},\n request: SdkOptions = {}\n ): Promise<ContextListResult<GroupSchema>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n this.sdk.appendListOptions(url, options)\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(E_PREFIX + E_RESPONSE_STATUS + result.status, result.body)\n }\n if (!result.body) {\n throw new Exception(E_PREFIX + E_RESPONSE_NO_VALUE, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: ContextListResult<GroupSchema>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(E_PREFIX + E_INVALID_JSON, { code: 'E_INVALID_JSON', status: result.status })\n }\n return data\n }\n\n /**\n * Updates an existing group in the specified organization.\n * Note that this method support PUT requests only. Some fields are ignored by the API and are set automatically.\n * @param oid The organization ID where the group exists.\n * @param updated The updated information for the group. Must include the `key` of the group to update.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the updated group.\n */\n async update(oid: string, updated: GroupSchema, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, updated.key))\n const body = JSON.stringify(updated)\n const result = await this.sdk.http.put(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to update a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Deletes a group in the specified organization.\n * The groups support soft deletion, meaning that the group is not immediately removed from the database.\n * @param oid The organization ID where the group exists.\n * @param gid The group ID to delete.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves when the group is deleted.\n */\n async delete(oid: string, gid: string, request: SdkOptions = {}): Promise<void> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, gid))\n const result = await this.sdk.http.delete(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to delete a group. '\n if (result.status !== 204) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n }\n\n async addUsers(oid: string, gid: string, uids: string[], request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groupUsers(oid, gid))\n const body = JSON.stringify({ ids: uids })\n const result = await this.sdk.http.post(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to add users to a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n async removeUsers(oid: string, gid: string, uids: string[], request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groupUsers(oid, gid))\n const body = JSON.stringify({ ids: uids })\n const result = await this.sdk.http.delete(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to remove users from a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n}\n"]}
1
+ {"version":3,"file":"GroupsSdk.js","sourceRoot":"","sources":["../../../src/sdk/GroupsSdk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,GAER,MAAM,cAAc,CAAA;AAErB,MAAM,OAAO,SAAU,SAAQ,OAAO;IACpC;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,UAAsB,EAAE;QAC5E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;YACtD,KAAK;YACL,IAAI;YACJ,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAA;QACF,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;QACrC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E,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAClH,CAAC;QACD,IAAI,IAAiB,CAAA;QACrB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACxG,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,kBAAkB,EAAE,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAChH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import type { ContextListOptions, ContextListResult } from '../events/BaseEvents.js'\nimport { Exception } from '../exceptions/exception.js'\nimport type { GroupSchema } from '../models/store/Group.js'\nimport { RouteBuilder } from './RouteBuilder.js'\nimport {\n E_INVALID_JSON,\n E_RESPONSE_NO_VALUE,\n E_RESPONSE_STATUS,\n E_RESPONSE_UNKNOWN,\n SdkBase,\n type SdkOptions,\n} from './SdkBase.js'\n\nexport class GroupsSdk extends SdkBase {\n /**\n * Creates a new group in the specified organization.\n * @param oid The organization ID where the group will be created.\n * @param info The information about the group to create. See the `GroupSchema` interface for required fields.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the created group.\n */\n async create(oid: string, info: Partial<GroupSchema>, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n const body = JSON.stringify(info)\n const result = await this.sdk.http.post(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 201) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Lists user groups in the specified organization.\n * If you want to list specific user groups, you can use the `uid` option to filter by user ID.\n * @param oid The organization ID to list groups from.\n * @param options Optional parameters for filtering, sorting, and pagination.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to a list of groups in the organization.\n */\n async list(\n oid: string,\n options: ContextListOptions = {},\n request: SdkOptions = {}\n ): Promise<ContextListResult<GroupSchema>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n this.sdk.appendListOptions(url, options)\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(E_PREFIX + E_RESPONSE_STATUS + result.status, result.body)\n }\n if (!result.body) {\n throw new Exception(E_PREFIX + E_RESPONSE_NO_VALUE, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: ContextListResult<GroupSchema>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(E_PREFIX + E_INVALID_JSON, { code: 'E_INVALID_JSON', status: result.status })\n }\n return data\n }\n\n /**\n * Updates an existing group in the specified organization.\n * Note that this method support PUT requests only. Some fields are ignored by the API and are set automatically.\n * @param oid The organization ID where the group exists.\n * @param updated The updated information for the group. Must include the `key` of the group to update.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the updated group.\n */\n async update(oid: string, updated: GroupSchema, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, updated.key))\n const body = JSON.stringify(updated)\n const result = await this.sdk.http.put(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to update a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Deletes a group in the specified organization.\n * The groups support soft deletion, meaning that the group is not immediately removed from the database.\n * @param oid The organization ID where the group exists.\n * @param gid The group ID to delete.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves when the group is deleted.\n */\n async delete(oid: string, gid: string, request: SdkOptions = {}): Promise<void> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, gid))\n const result = await this.sdk.http.delete(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to delete a group. '\n if (result.status !== 204) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n }\n\n async addUsers(oid: string, gid: string, uids: string[], request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groupUsers(oid, gid))\n const body = JSON.stringify({ ids: uids })\n const result = await this.sdk.http.post(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to add users to a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n async removeUsers(oid: string, gid: string, uids: string[], request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groupUsers(oid, gid))\n const body = JSON.stringify({ ids: uids })\n const result = await this.sdk.http.delete(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to remove users from a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n}\n"]}
@@ -1,10 +1,6 @@
1
1
  import { Sdk } from './Sdk.js';
2
2
  import { Http } from './Http.js';
3
3
  import { WsClient } from './WsClient.js';
4
- export type { IStoreResponse, IStoreRequestOptions } from './SdkBase.js';
5
- export type { IMetaCreateOptions, IMediaCreateOptions, IFileCreateOptions, ListFileKind } from './FilesSdk.js';
6
- export type { IJwtInfo, IJwtUser, RegistrationInfoSchema, OrganizationRegistrationInfoSchema, OrganizationAddUserInfoSchema, } from './UsersSdk.js';
7
- export type { DataCatalogListOptions } from './DataCatalogSdk.js';
8
4
  /**
9
5
  * NodeJS API for API Client's net-store module.
10
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StoreSdkNode.d.ts","sourceRoot":"","sources":["../../../src/sdk/StoreSdkNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9G,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,sBAAsB,EACtB,kCAAkC,EAClC,6BAA6B,GAC9B,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAqB;IAC/B,EAAE,EAAE,QAAQ,CAAyB;CACtC"}
1
+ {"version":3,"file":"StoreSdkNode.d.ts","sourceRoot":"","sources":["../../../src/sdk/StoreSdkNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAqB;IAC/B,EAAE,EAAE,QAAQ,CAAyB;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StoreSdkNode.js","sourceRoot":"","sources":["../../../src/sdk/StoreSdkNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAe9B;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,GAAG;IAC/B,IAAI,GAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC/B,EAAE,GAAa,IAAI,YAAY,CAAC,IAAI,CAAC,CAAA;CACtC","sourcesContent":["import { HttpNode } from './HttpNode.js'\nimport { WsClientNode } from './WsClientNode.js'\nimport { Sdk } from './Sdk.js'\nimport { Http } from './Http.js'\nimport { WsClient } from './WsClient.js'\n\nexport type { IStoreResponse, IStoreRequestOptions } from './SdkBase.js'\nexport type { IMetaCreateOptions, IMediaCreateOptions, IFileCreateOptions, ListFileKind } from './FilesSdk.js'\nexport type {\n IJwtInfo,\n IJwtUser,\n RegistrationInfoSchema,\n OrganizationRegistrationInfoSchema,\n OrganizationAddUserInfoSchema,\n} from './UsersSdk.js'\nexport type { DataCatalogListOptions } from './DataCatalogSdk.js'\n\n/**\n * NodeJS API for API Client's net-store module.\n */\nexport class StoreSdk extends Sdk {\n http: Http = new HttpNode(this)\n ws: WsClient = new WsClientNode(this)\n}\n"]}
1
+ {"version":3,"file":"StoreSdkNode.js","sourceRoot":"","sources":["../../../src/sdk/StoreSdkNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,GAAG;IAC/B,IAAI,GAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC/B,EAAE,GAAa,IAAI,YAAY,CAAC,IAAI,CAAC,CAAA;CACtC","sourcesContent":["import { HttpNode } from './HttpNode.js'\nimport { WsClientNode } from './WsClientNode.js'\nimport { Sdk } from './Sdk.js'\nimport { Http } from './Http.js'\nimport { WsClient } from './WsClient.js'\n\n/**\n * NodeJS API for API Client's net-store module.\n */\nexport class StoreSdk extends Sdk {\n http: Http = new HttpNode(this)\n ws: WsClient = new WsClientNode(this)\n}\n"]}
@@ -1,12 +1,8 @@
1
1
  import { Sdk } from './Sdk.js';
2
2
  import { Http } from './Http.js';
3
3
  import { WsClient } from './WsClient.js';
4
- export type { IStoreResponse, IStoreRequestOptions } from './SdkBase.js';
5
- export type { IMetaCreateOptions, IMediaCreateOptions, IFileCreateOptions, ListFileKind } from './FilesSdk.js';
6
- export type { IJwtInfo, IJwtUser, RegistrationInfoSchema, OrganizationRegistrationInfoSchema, OrganizationAddUserInfoSchema, } from './UsersSdk.js';
7
- export type { DataCatalogListOptions } from './DataCatalogSdk.js';
8
4
  /**
9
- * NodeJS API for API Client's net-store module.
5
+ * API Client's web store module.
10
6
  */
11
7
  export declare class StoreSdk extends Sdk {
12
8
  http: Http;
@@ -1 +1 @@
1
- {"version":3,"file":"StoreSdkWeb.d.ts","sourceRoot":"","sources":["../../../src/sdk/StoreSdkWeb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9G,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,sBAAsB,EACtB,kCAAkC,EAClC,6BAA6B,GAC9B,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAoB;IAC9B,EAAE,EAAE,QAAQ,CAAwB;CACrC"}
1
+ {"version":3,"file":"StoreSdkWeb.d.ts","sourceRoot":"","sources":["../../../src/sdk/StoreSdkWeb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAoB;IAC9B,EAAE,EAAE,QAAQ,CAAwB;CACrC"}