@walde.ai/walde-sdk 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/sdk/contracts/frontend-content/v1/content-format-v1.js +2 -1
- package/dist/sdk/contracts/frontend-content/v1/content-part-v1.js +2 -1
- package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.js +2 -1
- package/dist/sdk/contracts/manifest/v1/manifest-content-v1.js +2 -1
- package/dist/sdk/contracts/manifest/v1/manifest-v1.js +2 -1
- package/dist/sdk/domain/entities/content-format.js +5 -1
- package/dist/sdk/domain/entities/content-format.js.map +1 -1
- package/dist/sdk/domain/entities/content-part.js +5 -1
- package/dist/sdk/domain/entities/content-part.js.map +1 -1
- package/dist/sdk/domain/entities/content-state.js +5 -2
- package/dist/sdk/domain/entities/content-state.js.map +1 -1
- package/dist/sdk/domain/entities/content-version.js +5 -1
- package/dist/sdk/domain/entities/content-version.js.map +1 -1
- package/dist/sdk/domain/entities/content.js +5 -1
- package/dist/sdk/domain/entities/content.js.map +1 -1
- package/dist/sdk/domain/entities/credentials.js +5 -1
- package/dist/sdk/domain/entities/credentials.js.map +1 -1
- package/dist/sdk/domain/entities/dns-entry.js +5 -1
- package/dist/sdk/domain/entities/dns-entry.js.map +1 -1
- package/dist/sdk/domain/entities/file.js +5 -1
- package/dist/sdk/domain/entities/file.js.map +1 -1
- package/dist/sdk/domain/entities/format-part.js +2 -1
- package/dist/sdk/domain/entities/format.js +5 -1
- package/dist/sdk/domain/entities/format.js.map +1 -1
- package/dist/sdk/domain/entities/frontend-content.js +5 -1
- package/dist/sdk/domain/entities/frontend-content.js.map +1 -1
- package/dist/sdk/domain/entities/key-value-part.js +5 -1
- package/dist/sdk/domain/entities/key-value-part.js.map +1 -1
- package/dist/sdk/domain/entities/manifest-content.js +5 -1
- package/dist/sdk/domain/entities/manifest-content.js.map +1 -1
- package/dist/sdk/domain/entities/manifest.js +5 -1
- package/dist/sdk/domain/entities/manifest.js.map +1 -1
- package/dist/sdk/domain/entities/markdown-part.js +5 -1
- package/dist/sdk/domain/entities/markdown-part.js.map +1 -1
- package/dist/sdk/domain/entities/site.js +7 -3
- package/dist/sdk/domain/entities/site.js.map +1 -1
- package/dist/sdk/domain/entities/string-part.js +5 -1
- package/dist/sdk/domain/entities/string-part.js.map +1 -1
- package/dist/sdk/domain/entities/ui-upload-credentials.js +5 -1
- package/dist/sdk/domain/entities/ui-upload-credentials.js.map +1 -1
- package/dist/sdk/domain/entities/walde-admin-config.d.ts +1 -1
- package/dist/sdk/domain/entities/walde-admin-config.js +8 -4
- package/dist/sdk/domain/entities/walde-admin-config.js.map +1 -1
- package/dist/sdk/domain/entities/workspace-config.js +5 -1
- package/dist/sdk/domain/entities/workspace-config.js.map +1 -1
- package/dist/sdk/domain/errors/index.js +23 -10
- package/dist/sdk/domain/errors/index.js.map +1 -1
- package/dist/sdk/domain/errors/walde-authentication-error.js +6 -2
- package/dist/sdk/domain/errors/walde-authentication-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-configuration-error.js +6 -2
- package/dist/sdk/domain/errors/walde-configuration-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-error.js +5 -1
- package/dist/sdk/domain/errors/walde-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-local-error.js +6 -2
- package/dist/sdk/domain/errors/walde-local-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-network-error.js +6 -2
- package/dist/sdk/domain/errors/walde-network-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-system-error.js +6 -2
- package/dist/sdk/domain/errors/walde-system-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-unexpected-error.js +6 -2
- package/dist/sdk/domain/errors/walde-unexpected-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-usage-error.js +6 -2
- package/dist/sdk/domain/errors/walde-usage-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-user-error.js +6 -2
- package/dist/sdk/domain/errors/walde-user-error.js.map +1 -1
- package/dist/sdk/domain/errors/walde-validation-error.js +6 -2
- package/dist/sdk/domain/errors/walde-validation-error.js.map +1 -1
- package/dist/sdk/domain/interactors/api-call.d.ts +1 -1
- package/dist/sdk/domain/interactors/api-call.js +7 -3
- package/dist/sdk/domain/interactors/api-call.js.map +1 -1
- package/dist/sdk/domain/interactors/associate-site-certificates.d.ts +2 -2
- package/dist/sdk/domain/interactors/associate-site-certificates.js +8 -4
- package/dist/sdk/domain/interactors/associate-site-certificates.js.map +1 -1
- package/dist/sdk/domain/interactors/content/list-contents.d.ts +2 -2
- package/dist/sdk/domain/interactors/content/list-contents.js +5 -1
- package/dist/sdk/domain/interactors/content/list-contents.js.map +1 -1
- package/dist/sdk/domain/interactors/content/parse-content-file.d.ts +2 -2
- package/dist/sdk/domain/interactors/content/parse-content-file.js +24 -20
- package/dist/sdk/domain/interactors/content/parse-content-file.js.map +1 -1
- package/dist/sdk/domain/interactors/content/push-content.d.ts +4 -4
- package/dist/sdk/domain/interactors/content/push-content.js +7 -3
- package/dist/sdk/domain/interactors/content/push-content.js.map +1 -1
- package/dist/sdk/domain/interactors/create-site.d.ts +3 -3
- package/dist/sdk/domain/interactors/create-site.js +10 -6
- package/dist/sdk/domain/interactors/create-site.js.map +1 -1
- package/dist/sdk/domain/interactors/get-credentials.d.ts +2 -2
- package/dist/sdk/domain/interactors/get-credentials.js +5 -1
- package/dist/sdk/domain/interactors/get-credentials.js.map +1 -1
- package/dist/sdk/domain/interactors/get-token.d.ts +1 -1
- package/dist/sdk/domain/interactors/get-token.js +7 -3
- package/dist/sdk/domain/interactors/get-token.js.map +1 -1
- package/dist/sdk/domain/interactors/list-sites.d.ts +3 -3
- package/dist/sdk/domain/interactors/list-sites.js +8 -4
- package/dist/sdk/domain/interactors/list-sites.js.map +1 -1
- package/dist/sdk/domain/interactors/refresh-credentials.d.ts +3 -3
- package/dist/sdk/domain/interactors/refresh-credentials.js +7 -3
- package/dist/sdk/domain/interactors/refresh-credentials.js.map +1 -1
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.d.ts +4 -4
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js +11 -7
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js.map +1 -1
- package/dist/sdk/domain/interactors/update-site.d.ts +3 -3
- package/dist/sdk/domain/interactors/update-site.js +10 -6
- package/dist/sdk/domain/interactors/update-site.js.map +1 -1
- package/dist/sdk/domain/interactors/workspace/init-workspace.d.ts +3 -3
- package/dist/sdk/domain/interactors/workspace/init-workspace.js +10 -6
- package/dist/sdk/domain/interactors/workspace/init-workspace.js.map +1 -1
- package/dist/sdk/domain/ports/backend/backend-client.js +2 -1
- package/dist/sdk/domain/ports/in/content-file-reader.js +2 -1
- package/dist/sdk/domain/ports/in/token-provider.js +2 -1
- package/dist/sdk/domain/ports/out/backend-communication.js +2 -1
- package/dist/sdk/domain/ports/out/content-file-writer.js +2 -1
- package/dist/sdk/domain/ports/out/content-repo.d.ts +2 -2
- package/dist/sdk/domain/ports/out/content-repo.js +2 -1
- package/dist/sdk/domain/ports/out/credentials-provider.d.ts +1 -1
- package/dist/sdk/domain/ports/out/credentials-provider.js +2 -1
- package/dist/sdk/domain/ports/out/file-system-reader.d.ts +1 -1
- package/dist/sdk/domain/ports/out/file-system-reader.js +2 -1
- package/dist/sdk/domain/ports/out/remote-files-repo.d.ts +2 -2
- package/dist/sdk/domain/ports/out/remote-files-repo.js +2 -1
- package/dist/sdk/domain/ports/out/site-repository.d.ts +1 -1
- package/dist/sdk/domain/ports/out/site-repository.js +2 -1
- package/dist/sdk/domain/ports/out/token-refresh-provider.d.ts +1 -1
- package/dist/sdk/domain/ports/out/token-refresh-provider.js +2 -1
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.d.ts +1 -1
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.js +2 -1
- package/dist/sdk/domain/ports/out/upload-progress-callback.js +2 -1
- package/dist/sdk/domain/ports/out/workspace-config-repo.d.ts +1 -1
- package/dist/sdk/domain/ports/out/workspace-config-repo.js +2 -1
- package/dist/sdk/index.js +62 -29
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/infra/adapters/api-client.d.ts +1 -1
- package/dist/sdk/infra/adapters/api-client.js +5 -1
- package/dist/sdk/infra/adapters/api-client.js.map +1 -1
- package/dist/sdk/infra/adapters/base-http-client.js +15 -11
- package/dist/sdk/infra/adapters/base-http-client.js.map +1 -1
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.d.ts +2 -2
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js +15 -11
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js.map +1 -1
- package/dist/sdk/infra/adapters/default-http-client.js +51 -14
- package/dist/sdk/infra/adapters/default-http-client.js.map +1 -1
- package/dist/sdk/infra/adapters/default-token-provider.d.ts +1 -1
- package/dist/sdk/infra/adapters/default-token-provider.js +7 -3
- package/dist/sdk/infra/adapters/default-token-provider.js.map +1 -1
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.d.ts +1 -1
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.js +14 -7
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.js.map +1 -1
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.d.ts +1 -1
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.js +16 -9
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.js.map +1 -1
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.d.ts +2 -2
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js +16 -12
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js.map +1 -1
- package/dist/sdk/infra/adapters/frontend-http-client.js +6 -2
- package/dist/sdk/infra/adapters/frontend-http-client.js.map +1 -1
- package/dist/sdk/infra/adapters/http/http-content-repo.d.ts +4 -4
- package/dist/sdk/infra/adapters/http/http-content-repo.js +10 -6
- package/dist/sdk/infra/adapters/http/http-content-repo.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.d.ts +3 -3
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js +10 -6
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.d.ts +2 -2
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js +43 -6
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js +7 -3
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.d.ts +1 -1
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js +40 -3
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.d.ts +2 -2
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js +23 -16
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/http-site-repo.d.ts +3 -3
- package/dist/sdk/infra/adapters/repositories/http-site-repo.js +13 -9
- package/dist/sdk/infra/adapters/repositories/http-site-repo.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.d.ts +1 -1
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js +6 -2
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js.map +1 -1
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.d.ts +3 -3
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js +9 -5
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js.map +1 -1
- package/dist/sdk/infra/backend/walde-client.d.ts +2 -2
- package/dist/sdk/infra/backend/walde-client.js +5 -1
- package/dist/sdk/infra/backend/walde-client.js.map +1 -1
- package/dist/sdk/infra/factories/s3-files-repo-factory.d.ts +2 -2
- package/dist/sdk/infra/factories/s3-files-repo-factory.js +7 -3
- package/dist/sdk/infra/factories/s3-files-repo-factory.js.map +1 -1
- package/dist/sdk/infra/factories/walde-admin-config-factory.d.ts +1 -1
- package/dist/sdk/infra/factories/walde-admin-config-factory.js +52 -15
- package/dist/sdk/infra/factories/walde-admin-config-factory.js.map +1 -1
- package/dist/sdk/infra/factories/walde-admin-factory.d.ts +2 -2
- package/dist/sdk/infra/factories/walde-admin-factory.js +25 -21
- package/dist/sdk/infra/factories/walde-admin-factory.js.map +1 -1
- package/dist/sdk/infra/factories/walde-factory.d.ts +1 -1
- package/dist/sdk/infra/factories/walde-factory.js +13 -9
- package/dist/sdk/infra/factories/walde-factory.js.map +1 -1
- package/dist/sdk/infra/futures/api-future.d.ts +3 -3
- package/dist/sdk/infra/futures/api-future.js +11 -7
- package/dist/sdk/infra/futures/api-future.js.map +1 -1
- package/dist/sdk/infra/futures/content-future.d.ts +3 -3
- package/dist/sdk/infra/futures/content-future.js +22 -18
- package/dist/sdk/infra/futures/content-future.js.map +1 -1
- package/dist/sdk/infra/futures/content-item-future.d.ts +6 -6
- package/dist/sdk/infra/futures/content-item-future.js +12 -8
- package/dist/sdk/infra/futures/content-item-future.js.map +1 -1
- package/dist/sdk/infra/futures/content-iterator.d.ts +3 -3
- package/dist/sdk/infra/futures/content-iterator.js +27 -23
- package/dist/sdk/infra/futures/content-iterator.js.map +1 -1
- package/dist/sdk/infra/futures/content-list-future.d.ts +4 -4
- package/dist/sdk/infra/futures/content-list-future.js +8 -4
- package/dist/sdk/infra/futures/content-list-future.js.map +1 -1
- package/dist/sdk/infra/futures/contents-future.d.ts +3 -3
- package/dist/sdk/infra/futures/contents-future.js +10 -6
- package/dist/sdk/infra/futures/contents-future.js.map +1 -1
- package/dist/sdk/infra/futures/credentials-future.d.ts +2 -2
- package/dist/sdk/infra/futures/credentials-future.js +23 -19
- package/dist/sdk/infra/futures/credentials-future.js.map +1 -1
- package/dist/sdk/infra/futures/frontend-contents-future.d.ts +5 -5
- package/dist/sdk/infra/futures/frontend-contents-future.js +18 -14
- package/dist/sdk/infra/futures/frontend-contents-future.js.map +1 -1
- package/dist/sdk/infra/futures/manifest-future.d.ts +5 -5
- package/dist/sdk/infra/futures/manifest-future.js +9 -5
- package/dist/sdk/infra/futures/manifest-future.js.map +1 -1
- package/dist/sdk/infra/futures/site-future.d.ts +3 -3
- package/dist/sdk/infra/futures/site-future.js +35 -31
- package/dist/sdk/infra/futures/site-future.js.map +1 -1
- package/dist/sdk/infra/futures/sites-future.d.ts +3 -3
- package/dist/sdk/infra/futures/sites-future.js +12 -8
- package/dist/sdk/infra/futures/sites-future.js.map +1 -1
- package/dist/sdk/infra/futures/ui-future.d.ts +4 -4
- package/dist/sdk/infra/futures/ui-future.js +13 -9
- package/dist/sdk/infra/futures/ui-future.js.map +1 -1
- package/dist/sdk/infra/futures/walde-admin-future.d.ts +9 -9
- package/dist/sdk/infra/futures/walde-admin-future.js +22 -18
- package/dist/sdk/infra/futures/walde-admin-future.js.map +1 -1
- package/dist/sdk/infra/futures/walde-future.d.ts +5 -5
- package/dist/sdk/infra/futures/walde-future.js +16 -12
- package/dist/sdk/infra/futures/walde-future.js.map +1 -1
- package/dist/sdk/infra/futures/workspace-future.d.ts +4 -4
- package/dist/sdk/infra/futures/workspace-future.js +10 -5
- package/dist/sdk/infra/futures/workspace-future.js.map +1 -1
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.d.ts +2 -2
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js +13 -9
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js.map +1 -1
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.d.ts +2 -2
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js +11 -7
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js.map +1 -1
- package/dist/sdk/make-walde-admin.js +6 -3
- package/dist/sdk/make-walde-admin.js.map +1 -1
- package/dist/sdk/make-walde.js +6 -3
- package/dist/sdk/make-walde.js.map +1 -1
- package/dist/std/domain/entities/future.js +5 -1
- package/dist/std/domain/entities/future.js.map +1 -1
- package/dist/std/domain/entities/option.js +11 -4
- package/dist/std/domain/entities/option.js.map +1 -1
- package/dist/std/domain/entities/result.js +11 -4
- package/dist/std/domain/entities/result.js.map +1 -1
- package/dist/std/index.js +15 -3
- package/dist/std/index.js.map +1 -1
- package/package.json +7 -6
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriterApiAwsUiUploadCredentialsRepo = void 0;
|
|
4
|
+
const ui_upload_credentials_1 = require("../../../../sdk/domain/entities/ui-upload-credentials");
|
|
5
|
+
const errors_1 = require("../../../../sdk/domain/errors");
|
|
3
6
|
/**
|
|
4
7
|
* Repository for requesting AWS UI upload credentials from Writer API
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
class WriterApiAwsUiUploadCredentialsRepo {
|
|
7
10
|
apiClient;
|
|
8
11
|
constructor(apiClient) {
|
|
9
12
|
this.apiClient = apiClient;
|
|
@@ -15,11 +18,12 @@ export class WriterApiAwsUiUploadCredentialsRepo {
|
|
|
15
18
|
try {
|
|
16
19
|
const response = await this.apiClient.post(`/v1/sites/${siteId}/request-ui-upload`, {});
|
|
17
20
|
// Map AWS temporary credentials response to domain entity
|
|
18
|
-
return new UiUploadCredentials(response.accessKeyId, response.secretAccessKey, response.sessionToken, new Date(response.expiration), response.region, response.bucketName);
|
|
21
|
+
return new ui_upload_credentials_1.UiUploadCredentials(response.accessKeyId, response.secretAccessKey, response.sessionToken, new Date(response.expiration), response.region, response.bucketName);
|
|
19
22
|
}
|
|
20
23
|
catch (error) {
|
|
21
|
-
throw new WaldeUnexpectedError('Failed to request UI upload credentials', error);
|
|
24
|
+
throw new errors_1.WaldeUnexpectedError('Failed to request UI upload credentials', error);
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
}
|
|
28
|
+
exports.WriterApiAwsUiUploadCredentialsRepo = WriterApiAwsUiUploadCredentialsRepo;
|
|
25
29
|
//# sourceMappingURL=writer-api-aws-ui-upload-credentials-repo.js.map
|
package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer-api-aws-ui-upload-credentials-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"writer-api-aws-ui-upload-credentials-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.ts"],"names":[],"mappings":";;;AACA,uFAAkF;AAElF,gDAA2D;AAc3D;;GAEG;AACH,MAAa,mCAAmC;IACjB;IAA7B,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAErD;;OAEG;IACI,KAAK,CAAC,kBAAkB,CAAC,MAAc;QAC5C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CACxC,aAAa,MAAM,oBAAoB,EACvC,EAAE,CACH,CAAC;YAEF,0DAA0D;YAC1D,OAAO,IAAI,2CAAmB,CAC5B,QAAQ,CAAC,WAAW,EACpB,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,YAAY,EACrB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAC7B,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,UAAU,CACpB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,6BAAoB,CAAC,yCAAyC,EAAE,KAAc,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;CACF;AA1BD,kFA0BC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BackendClient } from '
|
|
2
|
-
import { DefaultHttpClient } from '
|
|
1
|
+
import { BackendClient } from '../../../sdk/domain/ports/backend/backend-client';
|
|
2
|
+
import { DefaultHttpClient } from '../../../sdk/infra/adapters/default-http-client';
|
|
3
3
|
export declare class WaldeClient implements BackendClient {
|
|
4
4
|
private httpClient;
|
|
5
5
|
private getAuthToken;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WaldeClient = void 0;
|
|
4
|
+
class WaldeClient {
|
|
2
5
|
httpClient;
|
|
3
6
|
getAuthToken;
|
|
4
7
|
constructor(httpClient, getAuthToken) {
|
|
@@ -26,4 +29,5 @@ export class WaldeClient {
|
|
|
26
29
|
return { Authorization: `Bearer ${token}` };
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
exports.WaldeClient = WaldeClient;
|
|
29
33
|
//# sourceMappingURL=walde-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walde-client.js","sourceRoot":"","sources":["../../../../src/sdk/infra/backend/walde-client.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"walde-client.js","sourceRoot":"","sources":["../../../../src/sdk/infra/backend/walde-client.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;IAEZ;IACA;IAFV,YACU,UAA6B,EAC7B,YAAmC;QADnC,eAAU,GAAV,UAAU,CAAmB;QAC7B,iBAAY,GAAZ,YAAY,CAAuB;IAC1C,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAI,QAAgB,EAAE,OAAgC;QAC7D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,EA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|
|
2
|
+
import { S3FilesRepoFactory } from '../../../sdk/domain/interactors/ui/upload-ui-from-folder';
|
|
3
3
|
/**
|
|
4
4
|
* Factory for creating S3 file repositories
|
|
5
5
|
*/
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultS3FilesRepoFactory = void 0;
|
|
4
|
+
const aws_s3_files_repo_1 = require("../../../sdk/infra/adapters/repositories/aws-s3-files-repo");
|
|
2
5
|
/**
|
|
3
6
|
* Factory for creating S3 file repositories
|
|
4
7
|
*/
|
|
5
|
-
|
|
8
|
+
class DefaultS3FilesRepoFactory {
|
|
6
9
|
create(siteId) {
|
|
7
|
-
return new AwsS3FilesRepo();
|
|
10
|
+
return new aws_s3_files_repo_1.AwsS3FilesRepo();
|
|
8
11
|
}
|
|
9
12
|
}
|
|
13
|
+
exports.DefaultS3FilesRepoFactory = DefaultS3FilesRepoFactory;
|
|
10
14
|
//# sourceMappingURL=s3-files-repo-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-files-repo-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/s3-files-repo-factory.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"s3-files-repo-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/s3-files-repo-factory.ts"],"names":[],"mappings":";;;AAEA,2FAAqF;AAErF;;GAEG;AACH,MAAa,yBAAyB;IACpC,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,kCAAc,EAAE,CAAC;IAC9B,CAAC;CACF;AAJD,8DAIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WaldeAdminConfigData, PartialWaldeAdminConfigData } from '
|
|
1
|
+
import { WaldeAdminConfigData, PartialWaldeAdminConfigData } from '../../../sdk/domain/entities/walde-admin-config';
|
|
2
2
|
/**
|
|
3
3
|
* Factory for creating complete Walde configuration
|
|
4
4
|
*/
|
|
@@ -1,14 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WaldeAdminConfigFactory = void 0;
|
|
37
|
+
const static_walde_admin_config_1 = require("../../../sdk/infra/adapters/repositories/static-walde-admin-config");
|
|
38
|
+
const file_walde_admin_config_1 = require("../../../sdk/infra/adapters/repositories/file-walde-admin-config");
|
|
39
|
+
const default_walde_admin_config_1 = require("../../../sdk/infra/adapters/repositories/default-walde-admin-config");
|
|
40
|
+
const errors_1 = require("../../../sdk/domain/errors");
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const os = __importStar(require("os"));
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
8
44
|
/**
|
|
9
45
|
* Factory for creating complete Walde configuration
|
|
10
46
|
*/
|
|
11
|
-
|
|
47
|
+
class WaldeAdminConfigFactory {
|
|
12
48
|
static migrationCompleted = false;
|
|
13
49
|
/**
|
|
14
50
|
* Perform one-time migration from ~/.writer/ to ~/.walde/
|
|
@@ -50,7 +86,7 @@ export class WaldeAdminConfigFactory {
|
|
|
50
86
|
const homeDir = os.homedir();
|
|
51
87
|
const fileName = stage ? `walde.${stage}.json` : 'walde.json';
|
|
52
88
|
const globalWaldeAdminConfigPath = path.join(homeDir, '.walde', fileName);
|
|
53
|
-
return new FileWaldeAdminConfig(globalWaldeAdminConfigPath);
|
|
89
|
+
return new file_walde_admin_config_1.FileWaldeAdminConfig(globalWaldeAdminConfigPath);
|
|
54
90
|
}
|
|
55
91
|
/**
|
|
56
92
|
* Get workspace config from walde[.stage].json starting from cwd and going up
|
|
@@ -60,24 +96,24 @@ export class WaldeAdminConfigFactory {
|
|
|
60
96
|
const fileName = stage ? `walde.${stage}.json` : 'walde.json';
|
|
61
97
|
while (currentDir !== path.dirname(currentDir)) {
|
|
62
98
|
const waldeConfigPath = path.join(currentDir, fileName);
|
|
63
|
-
const candidate = new FileWaldeAdminConfig(waldeConfigPath);
|
|
99
|
+
const candidate = new file_walde_admin_config_1.FileWaldeAdminConfig(waldeConfigPath);
|
|
64
100
|
const data = candidate.getData();
|
|
65
101
|
if (data.endpoint || data.clientId || data.region) {
|
|
66
102
|
return candidate;
|
|
67
103
|
}
|
|
68
104
|
currentDir = path.dirname(currentDir);
|
|
69
105
|
}
|
|
70
|
-
return new StaticWaldeAdminConfig();
|
|
106
|
+
return new static_walde_admin_config_1.StaticWaldeAdminConfig();
|
|
71
107
|
}
|
|
72
108
|
/**
|
|
73
109
|
* Load and merge configuration from all sources with stage support
|
|
74
110
|
*/
|
|
75
111
|
static create(providedConfig = {}, stage) {
|
|
76
112
|
// Merge configs: provided > workspace > home > default
|
|
77
|
-
let finalConfig = (new StaticWaldeAdminConfig(providedConfig))
|
|
113
|
+
let finalConfig = (new static_walde_admin_config_1.StaticWaldeAdminConfig(providedConfig))
|
|
78
114
|
.merge(this.getWorkspaceConfig(stage))
|
|
79
115
|
.merge(this.getHomeConfig(stage))
|
|
80
|
-
.merge(DefaultWaldeAdminConfig.create());
|
|
116
|
+
.merge(default_walde_admin_config_1.DefaultWaldeAdminConfig.create());
|
|
81
117
|
// If stage is specified and config is incomplete, fallback to default files
|
|
82
118
|
if (stage) {
|
|
83
119
|
const stageConfigResult = finalConfig.promote();
|
|
@@ -85,15 +121,16 @@ export class WaldeAdminConfigFactory {
|
|
|
85
121
|
finalConfig = finalConfig
|
|
86
122
|
.merge(this.getWorkspaceConfig())
|
|
87
123
|
.merge(this.getHomeConfig())
|
|
88
|
-
.merge(DefaultWaldeAdminConfig.create());
|
|
124
|
+
.merge(default_walde_admin_config_1.DefaultWaldeAdminConfig.create());
|
|
89
125
|
}
|
|
90
126
|
}
|
|
91
127
|
// Promote to complete configuration
|
|
92
128
|
const completeConfigResult = finalConfig.promote();
|
|
93
129
|
if (completeConfigResult.isErr()) {
|
|
94
|
-
throw new WaldeUnexpectedError(completeConfigResult.unwrapErr(), new Error('Config promotion failed'));
|
|
130
|
+
throw new errors_1.WaldeUnexpectedError(completeConfigResult.unwrapErr(), new Error('Config promotion failed'));
|
|
95
131
|
}
|
|
96
132
|
return completeConfigResult.unwrap();
|
|
97
133
|
}
|
|
98
134
|
}
|
|
135
|
+
exports.WaldeAdminConfigFactory = WaldeAdminConfigFactory;
|
|
99
136
|
//# sourceMappingURL=walde-admin-config-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walde-admin-config-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-admin-config-factory.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"walde-admin-config-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-admin-config-factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2GAAqG;AACrG,uGAAiG;AACjG,6GAAuG;AACvG,gDAA2D;AAC3D,2CAA6B;AAC7B,uCAAyB;AACzB,uCAAyB;AAEzB;;GAEG;AACH,MAAa,uBAAuB;IAC1B,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAE1C;;OAEG;IACK,MAAM,CAAC,gBAAgB;QAC7B,IAAI,IAAI,CAAC,kBAAkB;YAAE,OAAO;QAEpC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAEjD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAE/C,sCAAsC;gBACtC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAA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;qBAChC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;qBAC3B,KAAK,CAAC,oDAAuB,CAAC,MAAM,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QAED,oCAAoC;QACpC,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;QACnD,IAAI,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC;YACjC,MAAM,IAAI,6BAAoB,CAAC,oBAAoB,CAAC,SAAS,EAAE,EAAE,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACzG,CAAC;QAED,OAAO,oBAAoB,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;;AAlGH,0DAmGC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaldeAdmin } from '
|
|
2
|
-
import { CredentialsProvider } from '
|
|
1
|
+
import { WaldeAdmin } from '../../../sdk/infra/futures/walde-admin-future';
|
|
2
|
+
import { CredentialsProvider } from '../../../sdk/domain/ports/out/credentials-provider';
|
|
3
3
|
interface WaldeAdminFactoryConfig {
|
|
4
4
|
credentialsProvider: CredentialsProvider;
|
|
5
5
|
endpoint?: string;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WaldeAdminFactory = void 0;
|
|
4
|
+
const walde_admin_future_1 = require("../../../sdk/infra/futures/walde-admin-future");
|
|
5
|
+
const http_site_repo_1 = require("../../../sdk/infra/adapters/repositories/http-site-repo");
|
|
6
|
+
const http_content_repo_1 = require("../../../sdk/infra/adapters/http/http-content-repo");
|
|
7
|
+
const file_workspace_config_repo_1 = require("../../../sdk/infra/adapters/repositories/file-workspace-config-repo");
|
|
8
|
+
const writer_api_aws_ui_upload_credentials_repo_1 = require("../../../sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo");
|
|
9
|
+
const s3_files_repo_factory_1 = require("./s3-files-repo-factory");
|
|
10
|
+
const api_client_1 = require("../../../sdk/infra/adapters/api-client");
|
|
11
|
+
const default_http_client_1 = require("../../../sdk/infra/adapters/default-http-client");
|
|
12
|
+
const default_token_provider_1 = require("../../../sdk/infra/adapters/default-token-provider");
|
|
13
|
+
const walde_admin_config_factory_1 = require("./walde-admin-config-factory");
|
|
11
14
|
/**
|
|
12
15
|
* Factory for creating properly configured WaldeAdmin instances
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
class WaldeAdminFactory {
|
|
15
18
|
static createAdmin(config) {
|
|
16
|
-
const completeConfig = WaldeAdminConfigFactory.create({
|
|
19
|
+
const completeConfig = walde_admin_config_factory_1.WaldeAdminConfigFactory.create({
|
|
17
20
|
endpoint: config.endpoint,
|
|
18
21
|
clientId: config.clientId,
|
|
19
22
|
region: config.region
|
|
20
23
|
}, config.stage);
|
|
21
|
-
const tokenProvider = new DefaultTokenProvider(config.credentialsProvider);
|
|
22
|
-
const httpClient = new DefaultHttpClient(completeConfig.endpoint, tokenProvider);
|
|
23
|
-
const apiClient = new ApiClient(httpClient);
|
|
24
|
-
const sitesRepo = new HttpSiteRepository(apiClient);
|
|
25
|
-
const contentRepo = new HttpContentRepo(apiClient);
|
|
26
|
-
const workspaceConfigRepo = new FileWorkspaceConfigRepo();
|
|
27
|
-
const uiUploadCredentialsRepo = new WriterApiAwsUiUploadCredentialsRepo(apiClient);
|
|
28
|
-
const s3FilesRepoFactory = new DefaultS3FilesRepoFactory();
|
|
24
|
+
const tokenProvider = new default_token_provider_1.DefaultTokenProvider(config.credentialsProvider);
|
|
25
|
+
const httpClient = new default_http_client_1.DefaultHttpClient(completeConfig.endpoint, tokenProvider);
|
|
26
|
+
const apiClient = new api_client_1.ApiClient(httpClient);
|
|
27
|
+
const sitesRepo = new http_site_repo_1.HttpSiteRepository(apiClient);
|
|
28
|
+
const contentRepo = new http_content_repo_1.HttpContentRepo(apiClient);
|
|
29
|
+
const workspaceConfigRepo = new file_workspace_config_repo_1.FileWorkspaceConfigRepo();
|
|
30
|
+
const uiUploadCredentialsRepo = new writer_api_aws_ui_upload_credentials_repo_1.WriterApiAwsUiUploadCredentialsRepo(apiClient);
|
|
31
|
+
const s3FilesRepoFactory = new s3_files_repo_factory_1.DefaultS3FilesRepoFactory();
|
|
29
32
|
const backendCommunication = apiClient;
|
|
30
|
-
return new WaldeAdmin({
|
|
33
|
+
return new walde_admin_future_1.WaldeAdmin({
|
|
31
34
|
credentialsProvider: config.credentialsProvider,
|
|
32
35
|
sitesRepo,
|
|
33
36
|
contentRepo,
|
|
@@ -39,4 +42,5 @@ export class WaldeAdminFactory {
|
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
}
|
|
45
|
+
exports.WaldeAdminFactory = WaldeAdminFactory;
|
|
42
46
|
//# sourceMappingURL=walde-admin-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walde-admin-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-admin-factory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"walde-admin-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-admin-factory.ts"],"names":[],"mappings":";;;AAAA,+EAAoE;AAQpE,qFAAsF;AACtF,mFAA8E;AAC9E,6GAAuG;AACvG,2IAAkI;AAClI,mEAAoE;AACpE,gEAA4D;AAC5D,kFAA6E;AAC7E,wFAAmF;AACnF,6EAAuE;AAUvE;;GAEG;AACH,MAAa,iBAAiB;IACrB,MAAM,CAAC,WAAW,CAAC,MAA+B;QACvD,MAAM,cAAc,GAAG,oDAAuB,CAAC,MAAM,CAAC;YACpD,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAEjB,MAAM,aAAa,GAAG,IAAI,6CAAoB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC3E,MAAM,UAAU,GAAG,IAAI,uCAAiB,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACjF,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,SAAS,GAAmB,IAAI,mCAAkB,CAAC,SAAS,CAAC,CAAC;QACpE,MAAM,WAAW,GAAgB,IAAI,mCAAe,CAAC,SAAS,CAAC,CAAC;QAChE,MAAM,mBAAmB,GAAwB,IAAI,oDAAuB,EAAE,CAAC;QAC/E,MAAM,uBAAuB,GAA4B,IAAI,+EAAmC,CAAC,SAAS,CAAC,CAAC;QAC5G,MAAM,kBAAkB,GAAuB,IAAI,iDAAyB,EAAE,CAAC;QAC/E,MAAM,oBAAoB,GAAyB,SAAS,CAAC;QAE7D,OAAO,IAAI,+BAAU,CAAC;YACpB,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,SAAS;YACT,WAAW;YACX,mBAAmB;YACnB,uBAAuB;YACvB,kBAAkB;YAClB,oBAAoB;YACpB,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,8CA6BC"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WaldeFactory = void 0;
|
|
4
|
+
const frontend_http_client_1 = require("../../../sdk/infra/adapters/frontend-http-client");
|
|
5
|
+
const manifest_dto_mapper_1 = require("../../../sdk/infra/mappers/dto/manifest-dto-mapper");
|
|
6
|
+
const frontend_content_dto_mapper_1 = require("../../../sdk/infra/mappers/dto/frontend-content-dto-mapper");
|
|
7
|
+
const walde_future_1 = require("../../../sdk/infra/futures/walde-future");
|
|
5
8
|
/**
|
|
6
9
|
* Factory for creating properly configured Walde instances
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
class WaldeFactory {
|
|
9
12
|
/**
|
|
10
13
|
* Create a Walde instance with all dependencies
|
|
11
14
|
*/
|
|
12
15
|
static create(config) {
|
|
13
|
-
const httpClient = new FrontendHttpClient(config.url);
|
|
14
|
-
const manifestMapper = new ManifestDtoMapper();
|
|
15
|
-
const contentMapper = new FrontendContentDtoMapper();
|
|
16
|
-
return new WaldeFuture(httpClient, manifestMapper, contentMapper);
|
|
16
|
+
const httpClient = new frontend_http_client_1.FrontendHttpClient(config.url);
|
|
17
|
+
const manifestMapper = new manifest_dto_mapper_1.ManifestDtoMapper();
|
|
18
|
+
const contentMapper = new frontend_content_dto_mapper_1.FrontendContentDtoMapper();
|
|
19
|
+
return new walde_future_1.WaldeFuture(httpClient, manifestMapper, contentMapper);
|
|
17
20
|
}
|
|
18
21
|
}
|
|
22
|
+
exports.WaldeFactory = WaldeFactory;
|
|
19
23
|
//# sourceMappingURL=walde-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walde-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-factory.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"walde-factory.js","sourceRoot":"","sources":["../../../../src/sdk/infra/factories/walde-factory.ts"],"names":[],"mappings":";;;AAAA,oFAA+E;AAC/E,qFAAgF;AAChF,qGAA+F;AAC/F,mEAA+D;AAE/D;;GAEG;AACH,MAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,MAAuB;QACnC,MAAM,UAAU,GAAG,IAAI,yCAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtD,MAAM,cAAc,GAAG,IAAI,uCAAiB,EAAE,CAAC;QAC/C,MAAM,aAAa,GAAG,IAAI,sDAAwB,EAAE,CAAC;QAErD,OAAO,IAAI,0BAAW,CAAC,UAAU,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC;CACF;AAXD,oCAWC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Future, Result } from '
|
|
2
|
-
import { ApiCallParams } from '
|
|
3
|
-
import { BackendCommunication } from '
|
|
1
|
+
import { Future, Result } from '../../../std';
|
|
2
|
+
import { ApiCallParams } from '../../../sdk/domain/interactors/api-call';
|
|
3
|
+
import { BackendCommunication } from '../../../sdk/domain/ports/out/backend-communication';
|
|
4
4
|
import { WaldeAdmin } from './walde-admin-future';
|
|
5
5
|
export declare class ApiFuture extends Future<any, WaldeAdmin> {
|
|
6
6
|
private apiCall;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiFuture = void 0;
|
|
4
|
+
const std_1 = require("../../../std");
|
|
5
|
+
const api_call_1 = require("../../../sdk/domain/interactors/api-call");
|
|
6
|
+
class ApiFuture extends std_1.Future {
|
|
4
7
|
apiCall;
|
|
5
8
|
callParams;
|
|
6
9
|
constructor({ parent, backendCommunication }) {
|
|
7
10
|
super({ parent });
|
|
8
|
-
this.apiCall = new ApiCall(backendCommunication);
|
|
11
|
+
this.apiCall = new api_call_1.ApiCall(backendCommunication);
|
|
9
12
|
}
|
|
10
13
|
call(params) {
|
|
11
14
|
const future = new ApiFuture({ parent: this.parent, backendCommunication: this.parent.getConfig().backendCommunication });
|
|
@@ -15,14 +18,15 @@ export class ApiFuture extends Future {
|
|
|
15
18
|
async resolve() {
|
|
16
19
|
try {
|
|
17
20
|
if (!this.callParams) {
|
|
18
|
-
return err('No API call parameters specified');
|
|
21
|
+
return (0, std_1.err)('No API call parameters specified');
|
|
19
22
|
}
|
|
20
23
|
const result = await this.apiCall.execute(this.callParams);
|
|
21
|
-
return ok(result);
|
|
24
|
+
return (0, std_1.ok)(result);
|
|
22
25
|
}
|
|
23
26
|
catch (error) {
|
|
24
|
-
return err(error instanceof Error ? error.message : String(error));
|
|
27
|
+
return (0, std_1.err)(error instanceof Error ? error.message : String(error));
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
31
|
+
exports.ApiFuture = ApiFuture;
|
|
28
32
|
//# sourceMappingURL=api-future.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-future.js","sourceRoot":"","sources":["../../../../src/sdk/infra/futures/api-future.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"api-future.js","sourceRoot":"","sources":["../../../../src/sdk/infra/futures/api-future.ts"],"names":[],"mappings":";;;AAAA,+BAAgD;AAChD,gEAA2E;AAI3E,MAAa,SAAU,SAAQ,YAAuB;IAC5C,OAAO,CAAU;IACjB,UAAU,CAAiB;IAEnC,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAsE;QAC9G,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAO,CAAC,oBAAoB,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,CAAC,MAAqB;QACxB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC1H,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC;QAC3B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,OAAO,IAAA,SAAG,EAAC,kCAAkC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3D,OAAO,IAAA,QAAE,EAAC,MAAM,CAAC,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAA,SAAG,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF;AA3BD,8BA2BC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Future } from '
|
|
2
|
-
import type { Result } from '
|
|
3
|
-
import { Content } from '
|
|
1
|
+
import { Future } from '../../../std';
|
|
2
|
+
import type { Result } from '../../../std';
|
|
3
|
+
import { Content } from '../../../sdk/domain/entities/content';
|
|
4
4
|
export interface ContentParams {
|
|
5
5
|
parent: any;
|
|
6
6
|
siteId: string;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentFuture = void 0;
|
|
4
|
+
const std_1 = require("../../../std");
|
|
5
|
+
const content_1 = require("../../../sdk/domain/entities/content");
|
|
6
|
+
const push_content_1 = require("../../../sdk/domain/interactors/content/push-content");
|
|
7
|
+
const file_content_reader_1 = require("../../../sdk/infra/adapters/filesystem/file-content-reader");
|
|
8
|
+
const file_content_writer_1 = require("../../../sdk/infra/adapters/filesystem/file-content-writer");
|
|
9
|
+
const errors_1 = require("../../../sdk/domain/errors");
|
|
7
10
|
/**
|
|
8
11
|
* Future for content operations
|
|
9
12
|
*/
|
|
10
|
-
|
|
13
|
+
class ContentFuture extends std_1.Future {
|
|
11
14
|
params;
|
|
12
15
|
constructor(params) {
|
|
13
16
|
super({ parent: params });
|
|
@@ -30,34 +33,35 @@ export class ContentFuture extends Future {
|
|
|
30
33
|
const config = this.params.parent.getConfig();
|
|
31
34
|
if (this.params.filePath) {
|
|
32
35
|
// Push from file - create file adapters
|
|
33
|
-
const contentFileReader = new FileContentReader();
|
|
34
|
-
const contentFileWriter = new FileContentWriter();
|
|
35
|
-
const pushContent = new PushContent(config.contentRepo, contentFileReader, contentFileWriter);
|
|
36
|
+
const contentFileReader = new file_content_reader_1.FileContentReader();
|
|
37
|
+
const contentFileWriter = new file_content_writer_1.FileContentWriter();
|
|
38
|
+
const pushContent = new push_content_1.PushContent(config.contentRepo, contentFileReader, contentFileWriter);
|
|
36
39
|
const result = await pushContent.execute(this.params.siteId, this.params.filePath);
|
|
37
|
-
return ok(result);
|
|
40
|
+
return (0, std_1.ok)(result);
|
|
38
41
|
}
|
|
39
42
|
else if (this.params.contentData) {
|
|
40
43
|
// Push content data
|
|
41
44
|
if (!this.params.contentData.name) {
|
|
42
|
-
return err(new WaldeValidationError('Content name is required'));
|
|
45
|
+
return (0, std_1.err)(new errors_1.WaldeValidationError('Content name is required'));
|
|
43
46
|
}
|
|
44
47
|
if (!this.params.contentData.key) {
|
|
45
|
-
return err(new WaldeValidationError('Content key is required'));
|
|
48
|
+
return (0, std_1.err)(new errors_1.WaldeValidationError('Content key is required'));
|
|
46
49
|
}
|
|
47
50
|
if (!this.params.contentData.state) {
|
|
48
|
-
return err(new WaldeValidationError('Content state is required'));
|
|
51
|
+
return (0, std_1.err)(new errors_1.WaldeValidationError('Content state is required'));
|
|
49
52
|
}
|
|
50
|
-
const content = new Content(this.params.contentId, this.params.siteId, this.params.contentData.name, this.params.contentData.key, this.params.contentData.state);
|
|
53
|
+
const content = new content_1.Content(this.params.contentId, this.params.siteId, this.params.contentData.name, this.params.contentData.key, this.params.contentData.state);
|
|
51
54
|
const result = await config.contentRepo.pushContent(content, {});
|
|
52
|
-
return ok(result);
|
|
55
|
+
return (0, std_1.ok)(result);
|
|
53
56
|
}
|
|
54
57
|
else {
|
|
55
|
-
throw new WaldeValidationError('No content data or file path provided');
|
|
58
|
+
throw new errors_1.WaldeValidationError('No content data or file path provided');
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
catch (error) {
|
|
59
|
-
return err(error);
|
|
62
|
+
return (0, std_1.err)(error);
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
}
|
|
66
|
+
exports.ContentFuture = ContentFuture;
|
|
63
67
|
//# sourceMappingURL=content-future.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-future.js","sourceRoot":"","sources":["../../../../src/sdk/infra/futures/content-future.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"content-future.js","sourceRoot":"","sources":["../../../../src/sdk/infra/futures/content-future.ts"],"names":[],"mappings":";;;AAAA,+BAAwC;AAExC,2DAAwD;AAExD,gFAA4E;AAC5E,6FAAwF;AACxF,6FAAwF;AACxF,gDAA2D;AAU3D;;GAEG;AACH,MAAa,aAAc,SAAQ,YAA8B;IAC3C;IAApB,YAAoB,MAAqB;QACvC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QADR,WAAM,GAAN,MAAM,CAAe;IAEzC,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAsB;QACxB,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,MAAM;YACd,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,IAAI,EAAE;SACrD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAE9C,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACzB,wCAAwC;gBACxC,MAAM,iBAAiB,GAAG,IAAI,uCAAiB,EAAE,CAAC;gBAClD,MAAM,iBAAiB,GAAG,IAAI,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AS,CAAC,CAAC;gBACxE,OAAO,IAAA,QAAE,EAAC,MAAM,CAAC,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,6BAAoB,CAAC,uCAAuC,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAA,SAAG,EAAC,KAAc,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF;AA7DD,sCA6DC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Future } from '
|
|
2
|
-
import { Result } from '
|
|
3
|
-
import { FrontendContent } from '
|
|
4
|
-
import { ManifestContent } from '
|
|
5
|
-
import { FrontendHttpClient } from '
|
|
6
|
-
import { FrontendContentDtoMapper } from '
|
|
1
|
+
import { Future } from '../../../std/domain/entities/future';
|
|
2
|
+
import { Result } from '../../../std/domain/entities/result';
|
|
3
|
+
import { FrontendContent } from '../../../sdk/domain/entities/frontend-content';
|
|
4
|
+
import { ManifestContent } from '../../../sdk/domain/entities/manifest-content';
|
|
5
|
+
import { FrontendHttpClient } from '../../../sdk/infra/adapters/frontend-http-client';
|
|
6
|
+
import { FrontendContentDtoMapper } from '../../../sdk/infra/mappers/dto/frontend-content-dto-mapper';
|
|
7
7
|
/**
|
|
8
8
|
* Future for individual content item operations with locale support
|
|
9
9
|
*/
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentItemFuture = void 0;
|
|
4
|
+
const future_1 = require("../../../std/domain/entities/future");
|
|
5
|
+
const result_1 = require("../../../std/domain/entities/result");
|
|
6
|
+
const errors_1 = require("../../../sdk/domain/errors");
|
|
4
7
|
/**
|
|
5
8
|
* Future for individual content item operations with locale support
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
class ContentItemFuture extends future_1.Future {
|
|
8
11
|
contentMetadata;
|
|
9
12
|
httpClient;
|
|
10
13
|
contentMapper;
|
|
@@ -20,7 +23,7 @@ export class ContentItemFuture extends Future {
|
|
|
20
23
|
*/
|
|
21
24
|
locale(locale) {
|
|
22
25
|
if (!this.contentMetadata.locales.includes(locale)) {
|
|
23
|
-
throw new WaldeValidationError(`Locale '${locale}' not available for content '${this.contentMetadata.name}'. Available locales: ${this.contentMetadata.locales.join(', ')}`);
|
|
26
|
+
throw new errors_1.WaldeValidationError(`Locale '${locale}' not available for content '${this.contentMetadata.name}'. Available locales: ${this.contentMetadata.locales.join(', ')}`);
|
|
24
27
|
}
|
|
25
28
|
const newFuture = new ContentItemFuture(this.contentMetadata, this.httpClient, this.contentMapper);
|
|
26
29
|
newFuture.selectedLocale = locale;
|
|
@@ -32,16 +35,17 @@ export class ContentItemFuture extends Future {
|
|
|
32
35
|
async resolve() {
|
|
33
36
|
try {
|
|
34
37
|
if (!this.selectedLocale) {
|
|
35
|
-
throw new WaldeValidationError(`Locale must be specified for content '${this.contentMetadata.name}'. Available locales: ${this.contentMetadata.locales.join(', ')}`);
|
|
38
|
+
throw new errors_1.WaldeValidationError(`Locale must be specified for content '${this.contentMetadata.name}'. Available locales: ${this.contentMetadata.locales.join(', ')}`);
|
|
36
39
|
}
|
|
37
40
|
const endpoint = `/contents/${this.contentMetadata.id}/${this.selectedLocale}.json`;
|
|
38
41
|
const contentData = await this.httpClient.get(endpoint);
|
|
39
42
|
const content = this.contentMapper.toDomain(contentData);
|
|
40
|
-
return ok(content);
|
|
43
|
+
return (0, result_1.ok)(content);
|
|
41
44
|
}
|
|
42
45
|
catch (error) {
|
|
43
|
-
return err(error);
|
|
46
|
+
return (0, result_1.err)(error);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
50
|
+
exports.ContentItemFuture = ContentItemFuture;
|
|
47
51
|
//# sourceMappingURL=content-item-future.js.map
|