@ingram-cloud/pulumi 2.2.0 → 3.0.1

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/README.md CHANGED
@@ -20,7 +20,7 @@ pass. A typical split:
20
20
  app stack IcAgent, IcWebPage, IcSkill — instructions come from the app's
21
21
  own source.
22
22
 
23
- infra stack IcMcpServer, IcOauthProvider, IcTelegramBot, IcWhatsAppConfig,
23
+ infra stack IcMcpServer, IcOauthProvider, IcTelegramBot, IcWhatsAppNumber,
24
24
  IcEmail, IcWebhook, IcModelKey — tenant integration config. It can
25
25
  read the app stack's outputs (agent ids, webhook secret) through
26
26
  pulumi.StackReference and write them to the app's env.
@@ -162,7 +162,7 @@ const biller = new ic.IcAgent("biller", {
162
162
  });
163
163
  ```
164
164
 
165
- ### IcMcpServer, IcOauthProvider, IcTelegramBot, IcWhatsAppConfig, IcEmail, IcWebhook, IcModelKey (infra stack)
165
+ ### IcMcpServer, IcOauthProvider, IcTelegramBot, IcWhatsAppNumber, IcEmail, IcWebhook, IcModelKey (infra stack)
166
166
 
167
167
  ```ts
168
168
  // Your own server (raw URL).
@@ -14,7 +14,7 @@
14
14
  * so declare these in the APP repo's Pulumi program, sourced from the app's
15
15
  * own spec module. Never copy prompts into the infra repo.
16
16
  * - **Integrations / tenant config** (`IcMcpServer`, `IcOauthProvider`,
17
- * `IcTelegramBot`, `IcWhatsAppConfig`, `IcWebhook`, `IcModelKey`) —
17
+ * `IcTelegramBot`, `IcWhatsAppNumber`, `IcWebhook`, `IcModelKey`) —
18
18
  * tenant-level wiring; declare in the infra repo alongside DNS/DB/Vercel.
19
19
  *
20
20
  * Not modelled here, on purpose:
@@ -248,7 +248,7 @@ export interface IcOauthProviderArgs {
248
248
  export declare class IcOauthProvider extends pulumi.dynamic.Resource {
249
249
  constructor(name: string, args: IcOauthProviderArgs, opts?: pulumi.CustomResourceOptions);
250
250
  }
251
- export interface IcWhatsAppConfigArgs {
251
+ export interface IcWhatsAppNumberArgs {
252
252
  baseUrl: pulumi.Input<string>;
253
253
  token: pulumi.Input<string>;
254
254
  phoneNumberId: pulumi.Input<string>;
@@ -256,10 +256,12 @@ export interface IcWhatsAppConfigArgs {
256
256
  /** The WhatsApp Business Account id — IC subscribes its app to it so inbound flows. */
257
257
  wabaId: pulumi.Input<string>;
258
258
  }
259
- export declare class IcWhatsAppConfig extends pulumi.dynamic.Resource {
260
- readonly displayPhoneNumber: pulumi.Output<string>;
259
+ /** One of the tenant's WhatsApp numbers. A tenant may register several; bind one to
260
+ * an agent with a `whatsapp` deployment whose `address` is its `phoneNumberId`. */
261
+ export declare class IcWhatsAppNumber extends pulumi.dynamic.Resource {
262
+ readonly displayPhoneNumber: pulumi.Output<string | null>;
261
263
  readonly webhookUrl: pulumi.Output<string>;
262
- constructor(name: string, args: IcWhatsAppConfigArgs, opts?: pulumi.CustomResourceOptions);
264
+ constructor(name: string, args: IcWhatsAppNumberArgs, opts?: pulumi.CustomResourceOptions);
263
265
  }
264
266
  export interface IcEmailArgs {
265
267
  baseUrl: pulumi.Input<string>;
package/dist/resources.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.IcWebPage = exports.IcProjectToken = exports.IcProject = exports.IcModelKey = exports.IcWebhook = exports.IcEmail = exports.IcWhatsAppConfig = exports.IcOauthProvider = exports.IcTelegramBot = exports.IcMcpServer = exports.IcVectorStore = exports.IcSkill = exports.IcAgent = exports.IC_API_VERSION = void 0;
36
+ exports.IcWebPage = exports.IcProjectToken = exports.IcProject = exports.IcModelKey = exports.IcWebhook = exports.IcEmail = exports.IcWhatsAppNumber = exports.IcOauthProvider = exports.IcTelegramBot = exports.IcMcpServer = exports.IcVectorStore = exports.IcSkill = exports.IcAgent = exports.IC_API_VERSION = void 0;
37
37
  /**
38
38
  * Ingram Cloud /v1 tenant configuration as Pulumi dynamic resources.
39
39
  *
@@ -50,7 +50,7 @@ exports.IcWebPage = exports.IcProjectToken = exports.IcProject = exports.IcModel
50
50
  * so declare these in the APP repo's Pulumi program, sourced from the app's
51
51
  * own spec module. Never copy prompts into the infra repo.
52
52
  * - **Integrations / tenant config** (`IcMcpServer`, `IcOauthProvider`,
53
- * `IcTelegramBot`, `IcWhatsAppConfig`, `IcWebhook`, `IcModelKey`) —
53
+ * `IcTelegramBot`, `IcWhatsAppNumber`, `IcWebhook`, `IcModelKey`) —
54
54
  * tenant-level wiring; declare in the infra repo alongside DNS/DB/Vercel.
55
55
  *
56
56
  * Not modelled here, on purpose:
@@ -889,7 +889,13 @@ const telegramProvider = makePutResource({
889
889
  botId: res.bot_id,
890
890
  webhookUrl: res.webhook_url,
891
891
  }),
892
- diff: { scalarKeys: ["botToken", "token", "baseUrl"] },
892
+ // The token is write-only, so refresh can only see whether a bot is set at
893
+ // all. An unconfigured tenant reads back as a missing botToken, which diffs
894
+ // and makes the next `up` PUT it again instead of reporting a clean state.
895
+ readProps: (_i, res) => (res.configured ? {} : { botToken: undefined }),
896
+ // A fixed-path singleton: create-before-delete would PUT the new config and
897
+ // then DELETE the same path, leaving the tenant with no bot.
898
+ diff: { scalarKeys: ["botToken", "token", "baseUrl"], deleteBeforeReplace: true },
893
899
  });
894
900
  class IcTelegramBot extends pulumi.dynamic.Resource {
895
901
  constructor(name, args, opts) {
@@ -947,22 +953,21 @@ class IcOauthProvider extends pulumi.dynamic.Resource {
947
953
  }
948
954
  exports.IcOauthProvider = IcOauthProvider;
949
955
  const whatsappProvider = makePutResource({
950
- path: () => "/v1/tenant/whatsapp",
951
- id: () => "whatsapp",
952
- body: (i) => ({
953
- phone_number_id: i.phoneNumberId,
954
- access_token: i.accessToken,
955
- waba_id: i.wabaId,
956
- }),
956
+ path: (i) => `/v1/tenant/whatsapp/${encodeURIComponent(i.phoneNumberId)}`,
957
+ id: (i) => i.phoneNumberId,
958
+ body: (i) => ({ access_token: i.accessToken, waba_id: i.wabaId }),
957
959
  outs: (_i, res) => ({
958
960
  displayPhoneNumber: res.display_phone_number,
959
961
  webhookUrl: res.webhook_url,
960
962
  }),
961
963
  diff: {
962
- scalarKeys: ["phoneNumberId", "accessToken", "wabaId", "token", "baseUrl"],
964
+ replaceKeys: ["phoneNumberId"],
965
+ scalarKeys: ["accessToken", "wabaId", "token", "baseUrl"],
963
966
  },
964
967
  });
965
- class IcWhatsAppConfig extends pulumi.dynamic.Resource {
968
+ /** One of the tenant's WhatsApp numbers. A tenant may register several; bind one to
969
+ * an agent with a `whatsapp` deployment whose `address` is its `phoneNumberId`. */
970
+ class IcWhatsAppNumber extends pulumi.dynamic.Resource {
966
971
  constructor(name, args, opts) {
967
972
  super(whatsappProvider, name, {
968
973
  displayPhoneNumber: undefined,
@@ -974,7 +979,7 @@ class IcWhatsAppConfig extends pulumi.dynamic.Resource {
974
979
  });
975
980
  }
976
981
  }
977
- exports.IcWhatsAppConfig = IcWhatsAppConfig;
982
+ exports.IcWhatsAppNumber = IcWhatsAppNumber;
978
983
  const emailProvider = makePutResource({
979
984
  path: () => "/v1/tenant/email",
980
985
  id: () => "email",
@@ -992,6 +997,9 @@ const emailProvider = makePutResource({
992
997
  inboundUrl: res.inbound_url,
993
998
  configured: res.configured,
994
999
  }),
1000
+ // Same refresh rule as Telegram: the API token is write-only, so an
1001
+ // unconfigured tenant reads back as a missing token and the next `up` re-PUTs.
1002
+ readProps: (_i, res) => (res.configured ? {} : { cloudflareApiToken: undefined }),
995
1003
  // inboundSecret excluded — IC may generate it, so it's an output, not drift.
996
1004
  diff: {
997
1005
  scalarKeys: [
@@ -1002,6 +1010,8 @@ const emailProvider = makePutResource({
1002
1010
  "token",
1003
1011
  "baseUrl",
1004
1012
  ],
1013
+ // Fixed-path singleton, see the Telegram provider.
1014
+ deleteBeforeReplace: true,
1005
1015
  },
1006
1016
  });
1007
1017
  class IcEmail extends pulumi.dynamic.Resource {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-cloud/pulumi",
3
- "version": "2.2.0",
3
+ "version": "3.0.1",
4
4
  "description": "Pulumi dynamic resources for the Ingram Cloud /v1 API — projects, project tokens, agents, MCP servers, channels, webhooks, model keys.",
5
5
  "keywords": [
6
6
  "ingram",