@esri/hub-common 14.105.0 → 14.107.0

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 (81) hide show
  1. package/dist/esm/core/schemas/internal/getEditorSchemas.js +1 -0
  2. package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
  3. package/dist/esm/core/schemas/shared/HubItemEntitySchema.js +11 -0
  4. package/dist/esm/core/schemas/shared/HubItemEntitySchema.js.map +1 -1
  5. package/dist/esm/events/api/events.js +1 -1
  6. package/dist/esm/events/api/utils/authenticate-request.js +1 -1
  7. package/dist/esm/initiatives/HubInitiative.js +14 -1
  8. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  9. package/dist/esm/initiatives/HubInitiatives.js +35 -4
  10. package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
  11. package/dist/esm/initiatives/_internal/InitiativeSchema.js +1 -0
  12. package/dist/esm/initiatives/_internal/InitiativeSchema.js.map +1 -1
  13. package/dist/esm/initiatives/_internal/InitiativeUiSchemaAssociations.js +62 -0
  14. package/dist/esm/initiatives/_internal/InitiativeUiSchemaAssociations.js.map +1 -0
  15. package/dist/esm/newsletters/api/index.js +4 -0
  16. package/dist/esm/newsletters/api/index.js.map +1 -0
  17. package/dist/esm/newsletters/api/orval/api/orval-newsletters.js +107 -0
  18. package/dist/esm/newsletters/api/orval/api/orval-newsletters.js.map +1 -0
  19. package/dist/esm/newsletters/api/orval/awaited-type.js +1 -0
  20. package/dist/esm/newsletters/api/orval/awaited-type.js.map +1 -0
  21. package/dist/esm/newsletters/api/orval/custom-client.js +44 -0
  22. package/dist/esm/newsletters/api/orval/custom-client.js.map +1 -0
  23. package/dist/esm/newsletters/api/subscriptions.js +53 -0
  24. package/dist/esm/newsletters/api/subscriptions.js.map +1 -0
  25. package/dist/esm/newsletters/api/types.js +2 -0
  26. package/dist/esm/newsletters/api/types.js.map +1 -0
  27. package/dist/esm/newsletters/api/users.js +43 -0
  28. package/dist/esm/newsletters/api/users.js.map +1 -0
  29. package/dist/esm/newsletters/api/utils/authenticate-request.js +15 -0
  30. package/dist/esm/newsletters/api/utils/authenticate-request.js.map +1 -0
  31. package/dist/esm/newsletters/index.js +2 -0
  32. package/dist/esm/newsletters/index.js.map +1 -0
  33. package/dist/node/core/schemas/internal/getEditorSchemas.js +1 -0
  34. package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
  35. package/dist/node/core/schemas/shared/HubItemEntitySchema.js +11 -0
  36. package/dist/node/core/schemas/shared/HubItemEntitySchema.js.map +1 -1
  37. package/dist/node/events/api/events.js +1 -1
  38. package/dist/node/events/api/utils/authenticate-request.js +1 -1
  39. package/dist/node/initiatives/HubInitiative.js +14 -1
  40. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  41. package/dist/node/initiatives/HubInitiatives.js +34 -3
  42. package/dist/node/initiatives/HubInitiatives.js.map +1 -1
  43. package/dist/node/initiatives/_internal/InitiativeSchema.js +1 -0
  44. package/dist/node/initiatives/_internal/InitiativeSchema.js.map +1 -1
  45. package/dist/node/initiatives/_internal/InitiativeUiSchemaAssociations.js +65 -0
  46. package/dist/node/initiatives/_internal/InitiativeUiSchemaAssociations.js.map +1 -0
  47. package/dist/node/newsletters/api/index.js +7 -0
  48. package/dist/node/newsletters/api/index.js.map +1 -0
  49. package/dist/node/newsletters/api/orval/api/orval-newsletters.js +110 -0
  50. package/dist/node/newsletters/api/orval/api/orval-newsletters.js.map +1 -0
  51. package/dist/node/newsletters/api/orval/awaited-type.js +3 -0
  52. package/dist/node/newsletters/api/orval/awaited-type.js.map +1 -0
  53. package/dist/node/newsletters/api/orval/custom-client.js +48 -0
  54. package/dist/node/newsletters/api/orval/custom-client.js.map +1 -0
  55. package/dist/node/newsletters/api/subscriptions.js +61 -0
  56. package/dist/node/newsletters/api/subscriptions.js.map +1 -0
  57. package/dist/node/newsletters/api/types.js +7 -0
  58. package/dist/node/newsletters/api/types.js.map +1 -0
  59. package/dist/node/newsletters/api/users.js +50 -0
  60. package/dist/node/newsletters/api/users.js.map +1 -0
  61. package/dist/node/newsletters/api/utils/authenticate-request.js +19 -0
  62. package/dist/node/newsletters/api/utils/authenticate-request.js.map +1 -0
  63. package/dist/node/newsletters/index.js +5 -0
  64. package/dist/node/newsletters/index.js.map +1 -0
  65. package/dist/types/core/schemas/types.d.ts +2 -2
  66. package/dist/types/core/types/IHubItemEntity.d.ts +10 -1
  67. package/dist/types/events/api/events.d.ts +1 -1
  68. package/dist/types/events/api/utils/authenticate-request.d.ts +1 -1
  69. package/dist/types/initiatives/HubInitiatives.d.ts +3 -2
  70. package/dist/types/initiatives/_internal/InitiativeSchema.d.ts +1 -1
  71. package/dist/types/initiatives/_internal/InitiativeUiSchemaAssociations.d.ts +10 -0
  72. package/dist/types/newsletters/api/index.d.ts +3 -0
  73. package/dist/types/newsletters/api/orval/api/orval-newsletters.d.ts +215 -0
  74. package/dist/types/newsletters/api/orval/awaited-type.d.ts +5 -0
  75. package/dist/types/newsletters/api/orval/custom-client.d.ts +22 -0
  76. package/dist/types/newsletters/api/subscriptions.d.ts +36 -0
  77. package/dist/types/newsletters/api/types.d.ts +47 -0
  78. package/dist/types/newsletters/api/users.d.ts +29 -0
  79. package/dist/types/newsletters/api/utils/authenticate-request.d.ts +9 -0
  80. package/dist/types/newsletters/index.d.ts +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-client.js","sourceRoot":"","sources":["../../../../../src/newsletters/api/orval/custom-client.ts"],"names":[],"mappings":";;;AAuBO,KAAK,UAAU,YAAY,CAChC,WAAyB,EACzB,YAA2B;IAE3B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC;IAC1C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;IAClD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,mBAAmB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,GAAG,OAAO,GAAG,GAAG,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;IAErE,MAAM,cAAc,GAAgB;QAClC,OAAO;QACP,MAAM;QACN,KAAK;QACL,WAAW;QACX,IAAI;KACL,CAAC;IACF,IAAI,IAAI,EAAE;QACR,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAC5C;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACpD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAEnC,IAAI,GAAG,CAAC,EAAE,EAAE;QACV,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;KACnB;IAED,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,IAAI,iBAAiB,CACzB,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAC9B,CAAC;AACJ,CAAC;AApCD,oCAoCC;AAED,SAAS,mBAAmB,CAAC,SAAS,GAAG,wBAAwB;IAC/D,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,aAAa,CAAC,WAAyB,EAAE,OAAsB;IACtE,MAAM,OAAO,GAAG,IAAI,OAAO,iCACtB,WAAW,CAAC,OAAO,GACnB,OAAO,CAAC,OAAO,EAClB,CAAC;IACH,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7C;IAED,MAAM,MAAM,mCACP,WAAW,CAAC,MAAM,GAClB,OAAO,CAAC,MAAM,CAClB,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,iBAAkB,SAAQ,KAAK;IAKnC,YAAY,OAAe,EAAE,GAAW,EAAE,MAAc,EAAE,KAAa;QACrE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateSubscription = exports.getSubscription = exports.getSubscriptions = exports.createSubscription = exports.subscribe = void 0;
4
+ const authenticate_request_1 = require("./utils/authenticate-request");
5
+ const orval_newsletters_1 = require("./orval/api/orval-newsletters");
6
+ /**
7
+ * create a subscription for user (existing or not) to a newsletter
8
+ *
9
+ * @param {ISubscribeParams} options
10
+ * @return {Promise<ISubscription>}
11
+ */
12
+ async function subscribe(options) {
13
+ options.token = await authenticate_request_1.authenticateRequest(options);
14
+ return orval_newsletters_1.subscribe(options.data, options);
15
+ }
16
+ exports.subscribe = subscribe;
17
+ /**
18
+ * create a subscription for user (existing) to a newsletter
19
+ *
20
+ * @param {ICreateSubscriptionParams} options
21
+ * @return {Promise<ISubscription>}
22
+ */
23
+ async function createSubscription(options) {
24
+ options.token = await authenticate_request_1.authenticateRequest(options);
25
+ return orval_newsletters_1.createSubscription(options.data, options);
26
+ }
27
+ exports.createSubscription = createSubscription;
28
+ /**
29
+ * get subscriptions
30
+ *
31
+ * @param {IGetSubscriptionsParams} options
32
+ * @return {Promise<ISubscription[]>}
33
+ */
34
+ async function getSubscriptions(options) {
35
+ options.token = await authenticate_request_1.authenticateRequest(options);
36
+ return orval_newsletters_1.getSubscriptions(options.data, options);
37
+ }
38
+ exports.getSubscriptions = getSubscriptions;
39
+ /**
40
+ * get a subscription
41
+ *
42
+ * @param {IGetSubscriptionParams} options
43
+ * @return {Promise<ISubscription>}
44
+ */
45
+ async function getSubscription(options) {
46
+ options.token = await authenticate_request_1.authenticateRequest(options);
47
+ return orval_newsletters_1.getSubscription(options.subscriptionId, options);
48
+ }
49
+ exports.getSubscription = getSubscription;
50
+ /**
51
+ * update a subscription
52
+ *
53
+ * @param {IUpdateSubscriptionParams} options
54
+ * @return {Promise<ISubscription>}
55
+ */
56
+ async function updateSubscription(options) {
57
+ options.token = await authenticate_request_1.authenticateRequest(options);
58
+ return orval_newsletters_1.updateSubscription(options.subscriptionId, options.data, options);
59
+ }
60
+ exports.updateSubscription = updateSubscription;
61
+ //# sourceMappingURL=subscriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../../src/newsletters/api/subscriptions.ts"],"names":[],"mappings":";;;AAQA,uEAAmE;AACnE,qEAMuC;AAEvC;;;;;GAKG;AACI,KAAK,UAAU,SAAS,CAC7B,OAAyB;IAEzB,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,6BAAU,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AALD,8BAKC;AAED;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CACtC,OAAkC;IAElC,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,sCAAmB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AALD,gDAKC;AAED;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,OAAgC;IAEhC,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,oCAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AALD,4CAKC;AAED;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,mCAAgB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AALD,0CAKC;AAED;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CACtC,OAAkC;IAElC,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,sCAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5E,CAAC;AALD,gDAKC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var orval_newsletters_1 = require("./orval/api/orval-newsletters");
4
+ Object.defineProperty(exports, "Cadence", { enumerable: true, get: function () { return orval_newsletters_1.Cadence; } });
5
+ Object.defineProperty(exports, "DeliveryMethod", { enumerable: true, get: function () { return orval_newsletters_1.DeliveryMethod; } });
6
+ Object.defineProperty(exports, "SystemNotificationSpecNames", { enumerable: true, get: function () { return orval_newsletters_1.SystemNotificationSpecNames; } });
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/newsletters/api/types.ts"],"names":[],"mappings":";;AAAA,mEAWuC;AAVrC,4GAAA,OAAO,OAAA;AACP,mHAAA,cAAc,OAAA;AAQd,gIAAA,2BAA2B,OAAA"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteUser = exports.updateUser = exports.getUser = exports.createUser = void 0;
4
+ const authenticate_request_1 = require("./utils/authenticate-request");
5
+ const orval_newsletters_1 = require("./orval/api/orval-newsletters");
6
+ /**
7
+ * create a user
8
+ *
9
+ * @param {ICreateUserParams} options
10
+ * @return {Promise<IUser>}
11
+ */
12
+ async function createUser(options) {
13
+ options.token = await authenticate_request_1.authenticateRequest(options);
14
+ return orval_newsletters_1.createUser(options.data, options);
15
+ }
16
+ exports.createUser = createUser;
17
+ /**
18
+ * get a user
19
+ *
20
+ * @param {IGetUserParams} options
21
+ * @return {Promise<IUser>}
22
+ */
23
+ async function getUser(options) {
24
+ options.token = await authenticate_request_1.authenticateRequest(options);
25
+ return orval_newsletters_1.getUser(options.userId, options);
26
+ }
27
+ exports.getUser = getUser;
28
+ /**
29
+ * update a user
30
+ *
31
+ * @param {IUpdateUserParams} options
32
+ * @return {Promise<IUser>}
33
+ */
34
+ async function updateUser(options) {
35
+ options.token = await authenticate_request_1.authenticateRequest(options);
36
+ return orval_newsletters_1.updateUser(options.userId, options.data, options);
37
+ }
38
+ exports.updateUser = updateUser;
39
+ /**
40
+ * delete a user
41
+ *
42
+ * @param {IDeleteUserParams} options
43
+ * @return {Promise<IUser>}
44
+ */
45
+ async function deleteUser(options) {
46
+ options.token = await authenticate_request_1.authenticateRequest(options);
47
+ return orval_newsletters_1.deleteUser(options.userId, options);
48
+ }
49
+ exports.deleteUser = deleteUser;
50
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../../src/newsletters/api/users.ts"],"names":[],"mappings":";;;AAOA,uEAAmE;AACnE,qEAKuC;AAEvC;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,OAA0B;IACzD,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,8BAAW,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAHD,gCAGC;AAED;;;;;GAKG;AACI,KAAK,UAAU,OAAO,CAAC,OAAuB;IACnD,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,2BAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAHD,0BAGC;AAED;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,OAA0B;IACzD,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,8BAAW,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAHD,gCAGC;AAED;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,OAA0B;IACzD,OAAO,CAAC,KAAK,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,8BAAW,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAHD,gCAGC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authenticateRequest = void 0;
4
+ /**
5
+ * return a token created using options.authentication or set on options.token
6
+ *
7
+ * @export
8
+ * @param {INewslettersRequestOptions} options
9
+ * @return {*} {Promise<string>}
10
+ */
11
+ function authenticateRequest(options) {
12
+ const { token, authentication } = options;
13
+ if (authentication) {
14
+ return authentication.getToken(authentication.portal);
15
+ }
16
+ return Promise.resolve(token);
17
+ }
18
+ exports.authenticateRequest = authenticateRequest;
19
+ //# sourceMappingURL=authenticate-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate-request.js","sourceRoot":"","sources":["../../../../../src/newsletters/api/utils/authenticate-request.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,OAAmC;IAEnC,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAE1C,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;KACvD;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAVD,kDAUC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./api"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsletters/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB"}
@@ -12,7 +12,7 @@ export interface IEditorConfig {
12
12
  * to the supported/defined uiSchema configurations
13
13
  */
14
14
  export declare type EntityEditorType = (typeof validEntityEditorTypes)[number];
15
- export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings"];
15
+ export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics", "hub:initiative:associations", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings"];
16
16
  /** Defines the possible editor type values for a stat card. These
17
17
  * correspond to the supported/defined uiSchema configurations. This should
18
18
  * have its own signature in the getEditorConfig function.
@@ -36,7 +36,7 @@ export declare const validCardEditorTypes: readonly ["hub:card:stat", "hub:card:
36
36
  * to defined schema/uiSchema configurations
37
37
  */
38
38
  export declare type EditorType = (typeof validEditorTypes)[number];
39
- export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:card:stat", "hub:card:follow"];
39
+ export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics", "hub:initiative:associations", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:card:stat", "hub:card:follow"];
40
40
  /**
41
41
  * An editor's module when dynamically imported depending on the EditorType. This
42
42
  * will always have a buildUiSchema function, and sometimes it will have a
@@ -1,6 +1,6 @@
1
1
  import { IHubEntityBase } from "./IHubEntityBase";
2
2
  import { IHubGeography } from "../../types";
3
- import { AccessLevel } from "./types";
3
+ import { AccessLevel, MembershipAccess } from "./types";
4
4
  import { IWithPermissions, IWithViewSettings, IWithDiscussions } from "../traits";
5
5
  import { IHubLocation } from "./IHubLocation";
6
6
  import { IWithFollowers } from "../traits/IWithFollowers";
@@ -129,5 +129,14 @@ export declare type IHubItemEntityEditor<T> = Omit<T, "extent"> & {
129
129
  showFollowAction?: boolean;
130
130
  isDiscussable?: boolean;
131
131
  };
132
+ /**
133
+ * Association group settings. These settings are only used in the
134
+ * Editor and is persisted appropriately in the fromEditor
135
+ * method on the Class
136
+ */
137
+ _associations?: {
138
+ groupAccess?: AccessLevel;
139
+ membershipAccess?: MembershipAccess;
140
+ };
132
141
  _metric?: IMetricEditorValues;
133
142
  };
@@ -16,7 +16,7 @@ export declare function getEvents(options: IGetEventsParams): Promise<IEvent[]>;
16
16
  /**
17
17
  * get an event
18
18
  *
19
- * @param {ICreateEventParams} options
19
+ * @param {IGetEventParams} options
20
20
  * @return {Promise<IEvent>}
21
21
  */
22
22
  export declare function getEvent(options: IGetEventParams): Promise<IEvent>;
@@ -3,7 +3,7 @@ import { IEventsRequestOptions } from "../types";
3
3
  * return a token created using options.authentication or set on options.token
4
4
  *
5
5
  * @export
6
- * @param {IDiscussionsRequestOptions} options
6
+ * @param {IEventsRequestOptions} options
7
7
  * @return {*} {Promise<string>}
8
8
  */
9
9
  export declare function authenticateRequest(options: IEventsRequestOptions): Promise<string>;
@@ -1,10 +1,11 @@
1
1
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { IHubRequestOptions, IHubInitiativeEditor } from "../index";
3
3
  import { IQuery } from "../search/types/IHubCatalog";
4
- import { IItem, IPortal } from "@esri/arcgis-rest-portal";
4
+ import { IItem } from "@esri/arcgis-rest-portal";
5
5
  import { IRequestOptions } from "@esri/arcgis-rest-request";
6
6
  import { IEntityInfo, IHubInitiative } from "../core/types";
7
7
  import { IHubSearchResult } from "../search";
8
+ import { IArcGISContext } from "../ArcGISContext";
8
9
  /**
9
10
  * @private
10
11
  * Create a new Hub Initiative item
@@ -21,7 +22,7 @@ export declare function createInitiative(partialInitiative: Partial<IHubInitiati
21
22
  * @param portal
22
23
  * @returns
23
24
  */
24
- export declare function editorToInitiative(editor: IHubInitiativeEditor, portal: IPortal): IHubInitiative;
25
+ export declare function editorToInitiative(editor: IHubInitiativeEditor, context: IArcGISContext): Promise<IHubInitiative>;
25
26
  /**
26
27
  * @private
27
28
  * Update a Hub Initiative
@@ -1,6 +1,6 @@
1
1
  import { IConfigurationSchema } from "../../core";
2
2
  export declare type InitiativeEditorType = (typeof InitiativeEditorTypes)[number];
3
- export declare const InitiativeEditorTypes: readonly ["hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics"];
3
+ export declare const InitiativeEditorTypes: readonly ["hub:initiative:edit", "hub:initiative:create", "hub:initiative:metrics", "hub:initiative:associations"];
4
4
  /**
5
5
  * defines the JSON schema for a Hub Initiative's editable fields
6
6
  */
@@ -0,0 +1,10 @@
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IUiSchema } from "../../core/schemas/types";
3
+ import { IHubInitiative } from "../../core/types";
4
+ /**
5
+ * @private
6
+ * constructs the minimal association group settings uiSchema for Hub Initiatives.
7
+ * This defines how the schema properties should be rendered
8
+ * in the initiative creation experience
9
+ */
10
+ export declare const buildUiSchema: (i18nScope: string, options: Partial<IHubInitiative>, context: IArcGISContext) => Promise<IUiSchema>;
@@ -0,0 +1,3 @@
1
+ export * from "./subscriptions";
2
+ export * from "./users";
3
+ export * from "./types";
@@ -0,0 +1,215 @@
1
+ import { Awaited } from "../awaited-type";
2
+ /**
3
+ * Generated by orval v6.24.0 🍺
4
+ * Do not edit manually.
5
+ * Hub Newsletters Service
6
+ * OpenAPI spec version: 0.0.1
7
+ */
8
+ import { customClient } from "../custom-client";
9
+ export declare type GetSubscriptionsParams = {
10
+ /**
11
+ * Optional array of matching notification spec names to filter by
12
+ */
13
+ names?: string[];
14
+ /**
15
+ * Optional cadence to filter by
16
+ */
17
+ cadence?: Cadence;
18
+ /**
19
+ * Optional user id to filter by. Note this gets extracted/overridden from AGO token if provided
20
+ */
21
+ userId?: string;
22
+ /**
23
+ * Optional flag for filtering active subscriptions
24
+ */
25
+ active?: boolean;
26
+ };
27
+ export interface IUpdateNotificationSpec {
28
+ /** Description of the notification spec */
29
+ description?: string;
30
+ /** Name identifier for the notification spec */
31
+ name?: string;
32
+ }
33
+ export interface ICreateNotificationSpec {
34
+ /** Description of the notification spec */
35
+ description?: string;
36
+ /** Name identifier for the notification spec */
37
+ name: string;
38
+ }
39
+ export interface IUpdateUser {
40
+ /** Flag for deleted user */
41
+ deleted?: boolean;
42
+ /** Email for the subscriber. Will always be extracted from the token unless service token is used. */
43
+ email?: string;
44
+ /** First name for the subscriber. Will always be extracted from the token unless service token is used. */
45
+ firstName?: string;
46
+ /** Last name for the subscriber. Will always be extracted from the token unless service token is used. */
47
+ lastName?: string;
48
+ /** Flag for unsubscribed user */
49
+ optedOut?: boolean;
50
+ /** Username for the subscriber. Will always be extracted from the token unless service token is used. */
51
+ username?: string;
52
+ }
53
+ export interface ICreateUser {
54
+ /** ArcGIS Online id for a user. Will always be extracted from the token unless service token is used. */
55
+ agoId?: string;
56
+ /** Flag for deleted user */
57
+ deleted?: boolean;
58
+ /** Email for the subscriber. Will always be extracted from the token unless service token is used. */
59
+ email?: string;
60
+ /** First name for the subscriber. Will always be extracted from the token unless service token is used. */
61
+ firstName?: string;
62
+ /** Last name for the subscriber. Will always be extracted from the token unless service token is used. */
63
+ lastName?: string;
64
+ /** Flag for unsubscribed user */
65
+ optedOut?: boolean;
66
+ /** Username for the subscriber. Will always be extracted from the token unless service token is used. */
67
+ username?: string;
68
+ }
69
+ /**
70
+ * Metadata for the subscription
71
+ */
72
+ export declare type ISubscribeMetadata = ICreateEventMetadata | ICreateTelemetryReportMetadata;
73
+ export declare type ISubscriptionMetadata = {
74
+ [key: string]: any;
75
+ };
76
+ export interface IUser {
77
+ agoId: string;
78
+ createdAt: string;
79
+ deleted: boolean;
80
+ email: string;
81
+ firstName: string;
82
+ lastName: string;
83
+ optedOut: boolean;
84
+ updatedAt: string;
85
+ username: string;
86
+ }
87
+ export interface INotificationSpec {
88
+ createdAt: string;
89
+ createdById: string;
90
+ description: string;
91
+ id: number;
92
+ name: string;
93
+ updatedAt: string;
94
+ }
95
+ /**
96
+ * Metadata for the subscription
97
+ */
98
+ export declare type ICreateSubscriptionMetadata = ICreateEventMetadata | ICreateTelemetryReportMetadata;
99
+ export declare enum DeliveryMethod {
100
+ EMAIL = "EMAIL"
101
+ }
102
+ export declare enum Cadence {
103
+ ON_EVENT = "ON_EVENT",
104
+ DAILY = "DAILY",
105
+ WEEKLY = "WEEKLY",
106
+ MONTHLY = "MONTHLY"
107
+ }
108
+ export interface IUpdateSubscription {
109
+ /** Flag to opt user in or out of subscription */
110
+ active?: boolean;
111
+ /** Frequency of the subscription */
112
+ cadence?: Cadence;
113
+ /** Delivery method for subscription, ie email or text */
114
+ deliveryMethod?: DeliveryMethod;
115
+ /** Last delivered datetime string of the subscription in ISO 8601 format */
116
+ lastDelivery?: string;
117
+ /** ArcGIS Online id for a user. Will always be extracted from the token unless service token is used. */
118
+ userId?: string;
119
+ }
120
+ export interface ISubscription {
121
+ active: boolean;
122
+ cadence: Cadence;
123
+ createdAt: string;
124
+ deliveryMethod: DeliveryMethod;
125
+ id: number;
126
+ lastDelivery: string;
127
+ metadata: ISubscriptionMetadata;
128
+ notificationSpec?: INotificationSpec;
129
+ notificationSpecId: number;
130
+ updatedAt: string;
131
+ user?: IUser;
132
+ userId: string;
133
+ }
134
+ export declare enum SystemNotificationSpecNames {
135
+ TELEMETRY_REPORT = "TELEMETRY_REPORT",
136
+ EVENT = "EVENT"
137
+ }
138
+ export interface ISubscribe {
139
+ /** ArcGIS Online id for a user. Will always be extracted from the token unless service token is used. */
140
+ agoId?: string;
141
+ /** Frequency of the subscription */
142
+ cadence: Cadence;
143
+ /** Flag for deleted user */
144
+ deleted?: boolean;
145
+ /** Delivery method for subscription, ie email or text */
146
+ deliveryMethod: DeliveryMethod;
147
+ /** Email for the subscriber. Will always be extracted from the token unless service token is used. */
148
+ email?: string;
149
+ /** First name for the subscriber. Will always be extracted from the token unless service token is used. */
150
+ firstName?: string;
151
+ /** Last name for the subscriber. Will always be extracted from the token unless service token is used. */
152
+ lastName?: string;
153
+ /** Metadata for the subscription */
154
+ metadata: ISubscribeMetadata;
155
+ /** Notification spec name for the subscription */
156
+ notificationSpecName: SystemNotificationSpecNames;
157
+ /** Flag for unsubscribed user */
158
+ optedOut?: boolean;
159
+ /** Username for the subscriber. Will always be extracted from the token unless service token is used. */
160
+ username?: string;
161
+ }
162
+ export interface ICreateSubscription {
163
+ /** Frequency of the subscription */
164
+ cadence: Cadence;
165
+ /** Delivery method for subscription, ie email or text */
166
+ deliveryMethod: DeliveryMethod;
167
+ /** Metadata for the subscription */
168
+ metadata: ICreateSubscriptionMetadata;
169
+ /** Notification spec name for the subscription */
170
+ notificationSpecName: SystemNotificationSpecNames;
171
+ /** AGO id for user which subscription belongs to */
172
+ userId: string;
173
+ }
174
+ export interface ICreateEventMetadata {
175
+ /** Event id for the subscription */
176
+ eventId: string;
177
+ }
178
+ export interface ICreateTelemetryReportMetadata {
179
+ /** Hostname for telemetry report. */
180
+ hostname: string;
181
+ }
182
+ declare type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
183
+ export declare const createSubscription: (iCreateSubscription: ICreateSubscription, options?: SecondParameter<typeof customClient>) => Promise<ISubscription>;
184
+ export declare const getSubscriptions: (params?: GetSubscriptionsParams, options?: SecondParameter<typeof customClient>) => Promise<ISubscription[]>;
185
+ export declare const subscribe: (iSubscribe: ISubscribe, options?: SecondParameter<typeof customClient>) => Promise<ISubscription>;
186
+ export declare const getSubscription: (id: number, options?: SecondParameter<typeof customClient>) => Promise<ISubscription>;
187
+ export declare const updateSubscription: (id: number, iUpdateSubscription: IUpdateSubscription, options?: SecondParameter<typeof customClient>) => Promise<ISubscription>;
188
+ export declare const deleteSubscription: (id: number, options?: SecondParameter<typeof customClient>) => Promise<ISubscription>;
189
+ export declare const createUser: (iCreateUser: ICreateUser, options?: SecondParameter<typeof customClient>) => Promise<IUser>;
190
+ export declare const getUsers: (options?: SecondParameter<typeof customClient>) => Promise<IUser[]>;
191
+ export declare const getUser: (userId: string, options?: SecondParameter<typeof customClient>) => Promise<IUser>;
192
+ export declare const updateUser: (userId: string, iUpdateUser: IUpdateUser, options?: SecondParameter<typeof customClient>) => Promise<IUser>;
193
+ export declare const deleteUser: (userId: string, options?: SecondParameter<typeof customClient>) => Promise<IUser>;
194
+ export declare const createNotificationSpec: (iCreateNotificationSpec: ICreateNotificationSpec, options?: SecondParameter<typeof customClient>) => Promise<INotificationSpec>;
195
+ export declare const getNotificationSpecs: (options?: SecondParameter<typeof customClient>) => Promise<INotificationSpec[]>;
196
+ export declare const getNotificationSpec: (id: number, options?: SecondParameter<typeof customClient>) => Promise<INotificationSpec>;
197
+ export declare const updateNotificationSpec: (id: number, iUpdateNotificationSpec: IUpdateNotificationSpec, options?: SecondParameter<typeof customClient>) => Promise<INotificationSpec>;
198
+ export declare const deleteNotificationSpec: (id: number, options?: SecondParameter<typeof customClient>) => Promise<INotificationSpec>;
199
+ export declare type CreateSubscriptionResult = NonNullable<Awaited<ReturnType<typeof createSubscription>>>;
200
+ export declare type GetSubscriptionsResult = NonNullable<Awaited<ReturnType<typeof getSubscriptions>>>;
201
+ export declare type SubscribeResult = NonNullable<Awaited<ReturnType<typeof subscribe>>>;
202
+ export declare type GetSubscriptionResult = NonNullable<Awaited<ReturnType<typeof getSubscription>>>;
203
+ export declare type UpdateSubscriptionResult = NonNullable<Awaited<ReturnType<typeof updateSubscription>>>;
204
+ export declare type DeleteSubscriptionResult = NonNullable<Awaited<ReturnType<typeof deleteSubscription>>>;
205
+ export declare type CreateUserResult = NonNullable<Awaited<ReturnType<typeof createUser>>>;
206
+ export declare type GetUsersResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
207
+ export declare type GetUserResult = NonNullable<Awaited<ReturnType<typeof getUser>>>;
208
+ export declare type UpdateUserResult = NonNullable<Awaited<ReturnType<typeof updateUser>>>;
209
+ export declare type DeleteUserResult = NonNullable<Awaited<ReturnType<typeof deleteUser>>>;
210
+ export declare type CreateNotificationSpecResult = NonNullable<Awaited<ReturnType<typeof createNotificationSpec>>>;
211
+ export declare type GetNotificationSpecsResult = NonNullable<Awaited<ReturnType<typeof getNotificationSpecs>>>;
212
+ export declare type GetNotificationSpecResult = NonNullable<Awaited<ReturnType<typeof getNotificationSpec>>>;
213
+ export declare type UpdateNotificationSpecResult = NonNullable<Awaited<ReturnType<typeof updateNotificationSpec>>>;
214
+ export declare type DeleteNotificationSpecResult = NonNullable<Awaited<ReturnType<typeof deleteNotificationSpec>>>;
215
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Orval generates return types for functions using utility type Awaited
3
+ * This was introduced in Typescript 4.5, but hub.js is using Typescript 3
4
+ */
5
+ export declare type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Generated and copied from the [hub engagement repo](https://github.com/ArcGIS/hub-newsletters/blob/master/orval/custom-client.ts)
3
+ * Do not edit manually
4
+ */
5
+ export interface IOrvalParams {
6
+ url: string;
7
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
8
+ headers?: HeadersInit;
9
+ params?: Record<string, any>;
10
+ data?: Record<string, any>;
11
+ }
12
+ export interface ICustomParams {
13
+ hubApiUrl?: string;
14
+ token?: string;
15
+ headers?: HeadersInit;
16
+ params?: Record<string, any>;
17
+ data?: Record<string, any>;
18
+ mode?: RequestMode;
19
+ cache?: RequestCache;
20
+ credentials?: RequestCredentials;
21
+ }
22
+ export declare function customClient<T>(orvalParams: IOrvalParams, customParams: ICustomParams): Promise<T>;
@@ -0,0 +1,36 @@
1
+ import { ISubscribeParams, ISubscription, ICreateSubscriptionParams, IGetSubscriptionsParams, IGetSubscriptionParams, IUpdateSubscriptionParams } from "./types";
2
+ /**
3
+ * create a subscription for user (existing or not) to a newsletter
4
+ *
5
+ * @param {ISubscribeParams} options
6
+ * @return {Promise<ISubscription>}
7
+ */
8
+ export declare function subscribe(options: ISubscribeParams): Promise<ISubscription>;
9
+ /**
10
+ * create a subscription for user (existing) to a newsletter
11
+ *
12
+ * @param {ICreateSubscriptionParams} options
13
+ * @return {Promise<ISubscription>}
14
+ */
15
+ export declare function createSubscription(options: ICreateSubscriptionParams): Promise<ISubscription>;
16
+ /**
17
+ * get subscriptions
18
+ *
19
+ * @param {IGetSubscriptionsParams} options
20
+ * @return {Promise<ISubscription[]>}
21
+ */
22
+ export declare function getSubscriptions(options: IGetSubscriptionsParams): Promise<ISubscription[]>;
23
+ /**
24
+ * get a subscription
25
+ *
26
+ * @param {IGetSubscriptionParams} options
27
+ * @return {Promise<ISubscription>}
28
+ */
29
+ export declare function getSubscription(options: IGetSubscriptionParams): Promise<ISubscription>;
30
+ /**
31
+ * update a subscription
32
+ *
33
+ * @param {IUpdateSubscriptionParams} options
34
+ * @return {Promise<ISubscription>}
35
+ */
36
+ export declare function updateSubscription(options: IUpdateSubscriptionParams): Promise<ISubscription>;
@@ -0,0 +1,47 @@
1
+ export { Cadence, DeliveryMethod, ICreateEventMetadata, ICreateTelemetryReportMetadata, INotificationSpec, ISubscribeMetadata, ISubscription, ISubscriptionMetadata, IUser, SystemNotificationSpecNames, } from "./orval/api/orval-newsletters";
2
+ import { IHubRequestOptions } from "../../types";
3
+ import { GetSubscriptionsParams, ICreateSubscription, ICreateUser, ISubscribe, IUpdateSubscription, IUpdateUser } from "./orval/api/orval-newsletters";
4
+ /**
5
+ * options for making requests against the Newsletters API
6
+ *
7
+ * @export
8
+ * @interface INewslettersRequestOptions
9
+ * @extends IHubRequestOptions
10
+ */
11
+ export interface INewslettersRequestOptions extends Omit<IHubRequestOptions, "httpMethod" | "isPortal">, Pick<RequestInit, "mode" | "cache" | "credentials"> {
12
+ httpMethod?: "GET" | "POST" | "PATCH" | "DELETE";
13
+ isPortal?: boolean;
14
+ token?: string;
15
+ data?: {
16
+ [key: string]: any;
17
+ };
18
+ }
19
+ export interface ICreateUserParams extends INewslettersRequestOptions {
20
+ data: ICreateUser;
21
+ }
22
+ export interface IGetUserParams extends INewslettersRequestOptions {
23
+ userId: string;
24
+ }
25
+ export interface IUpdateUserParams extends INewslettersRequestOptions {
26
+ userId: string;
27
+ data: IUpdateUser;
28
+ }
29
+ export interface IDeleteUserParams extends INewslettersRequestOptions {
30
+ userId: string;
31
+ }
32
+ export interface ISubscribeParams extends INewslettersRequestOptions {
33
+ data: ISubscribe;
34
+ }
35
+ export interface ICreateSubscriptionParams extends INewslettersRequestOptions {
36
+ data: ICreateSubscription;
37
+ }
38
+ export interface IGetSubscriptionsParams extends INewslettersRequestOptions {
39
+ data: GetSubscriptionsParams;
40
+ }
41
+ export interface IGetSubscriptionParams extends INewslettersRequestOptions {
42
+ subscriptionId: number;
43
+ }
44
+ export interface IUpdateSubscriptionParams extends INewslettersRequestOptions {
45
+ subscriptionId: number;
46
+ data: IUpdateSubscription;
47
+ }
@@ -0,0 +1,29 @@
1
+ import { ICreateUserParams, IDeleteUserParams, IGetUserParams, IUpdateUserParams, IUser } from "./types";
2
+ /**
3
+ * create a user
4
+ *
5
+ * @param {ICreateUserParams} options
6
+ * @return {Promise<IUser>}
7
+ */
8
+ export declare function createUser(options: ICreateUserParams): Promise<IUser>;
9
+ /**
10
+ * get a user
11
+ *
12
+ * @param {IGetUserParams} options
13
+ * @return {Promise<IUser>}
14
+ */
15
+ export declare function getUser(options: IGetUserParams): Promise<IUser>;
16
+ /**
17
+ * update a user
18
+ *
19
+ * @param {IUpdateUserParams} options
20
+ * @return {Promise<IUser>}
21
+ */
22
+ export declare function updateUser(options: IUpdateUserParams): Promise<IUser>;
23
+ /**
24
+ * delete a user
25
+ *
26
+ * @param {IDeleteUserParams} options
27
+ * @return {Promise<IUser>}
28
+ */
29
+ export declare function deleteUser(options: IDeleteUserParams): Promise<IUser>;